mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-01 03:10:14 +02:00
increase length of waitfor timeout for phantom
This commit is contained in:
@@ -2,15 +2,15 @@
|
|||||||
// Adapted from Modernizr
|
// Adapted from Modernizr
|
||||||
|
|
||||||
function waitFor(testFx, onReady, timeOutMillis) {
|
function waitFor(testFx, onReady, timeOutMillis) {
|
||||||
var maxtimeOutMillis = timeOutMillis ? timeOutMillis : 3001 //< Default Max Timout is 3s
|
var maxtimeOutMillis = timeOutMillis ? timeOutMillis : 5001 //< Default Max Timout is 5s
|
||||||
, start = new Date().getTime()
|
, start = new Date().getTime()
|
||||||
, condition = false
|
, condition = false
|
||||||
, interval = setInterval(function() {
|
, interval = setInterval(function () {
|
||||||
if ((new Date().getTime() - start < maxtimeOutMillis) && !condition) {
|
if ((new Date().getTime() - start < maxtimeOutMillis) && !condition) {
|
||||||
// If not time-out yet and condition not yet fulfilled
|
// If not time-out yet and condition not yet fulfilled
|
||||||
condition = (typeof(testFx) === "string" ? eval(testFx) : testFx()) //< defensive code
|
condition = (typeof(testFx) === "string" ? eval(testFx) : testFx()) //< defensive code
|
||||||
} else {
|
} else {
|
||||||
if(!condition) {
|
if (!condition) {
|
||||||
// If condition still not fulfilled (timeout but condition is 'false')
|
// If condition still not fulfilled (timeout but condition is 'false')
|
||||||
console.log("'waitFor()' timeout")
|
console.log("'waitFor()' timeout")
|
||||||
phantom.exit(1)
|
phantom.exit(1)
|
||||||
|
1
js/tests/pid.txt
Normal file
1
js/tests/pid.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
1520
|
Reference in New Issue
Block a user