mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-14 15:37:55 +00:00
48614a72cf
--HG-- rename : browser/base/content/test/head.js => browser/base/content/test/head_plain.js
16 lines
330 B
JavaScript
16 lines
330 B
JavaScript
|
|
function waitForCondition(condition, nextTest, errorMsg) {
|
|
var tries = 0;
|
|
var interval = setInterval(function() {
|
|
if (tries >= 30) {
|
|
ok(false, errorMsg);
|
|
moveOn();
|
|
}
|
|
if (condition()) {
|
|
moveOn();
|
|
}
|
|
tries++;
|
|
}, 100);
|
|
var moveOn = function() { clearInterval(interval); nextTest(); };
|
|
}
|