gecko-dev/browser/base/content/test/head_plain.js
Andres Hernandez 48614a72cf Bug 841406 - Split head file for browser and plain tests. r=mak
--HG--
rename : browser/base/content/test/head.js => browser/base/content/test/head_plain.js
2013-02-15 15:20:00 -06:00

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(); };
}