diff --git a/browser/devtools/styleinspector/test/head.js b/browser/devtools/styleinspector/test/head.js index 1d3250690ad..c030cf5770a 100644 --- a/browser/devtools/styleinspector/test/head.js +++ b/browser/devtools/styleinspector/test/head.js @@ -506,25 +506,19 @@ function fireCopyEvent(element) { * polling timeouts after several tries and the promise rejects. * @param {String} name Optional name of the test. This is used to generate * the success and failure messages. - * @param {Number} timeout Optional timeout for the validator function, in - * milliseconds. Default is 5000. * @return a promise that resolves when the function returned true or rejects * if the timeout is reached */ -function waitForSuccess(validatorFn, name="untitled", timeout=5000) { +function waitForSuccess(validatorFn, name="untitled") { let def = promise.defer(); let start = Date.now(); function wait(validatorFn) { - if ((Date.now() - start) > timeout) { - ok(false, "Validator function " + name + " timed out"); - return def.reject(); - } if (validatorFn()) { ok(true, "Validator function " + name + " returned true"); def.resolve(); } else { - setTimeout(() => wait(validatorFn), 100); + setTimeout(() => wait(validatorFn), 200); } } wait(validatorFn);