зеркало из https://github.com/mozilla/gecko-dev.git
Bug 649012 - Fix some flaky mochitests which rely on non-zero timeout values; rs=ted
This commit is contained in:
Родитель
5ecf181a61
Коммит
2759ff18ea
|
@ -38,10 +38,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=430050
|
|||
document.getElementById('b').loadURI('data:text/plain,succeeded',
|
||||
null,
|
||||
'UTF-8');
|
||||
setTimeout(endTest, 0);
|
||||
}
|
||||
}, true);
|
||||
document.documentElement.setAttribute("foo", "bar");
|
||||
setTimeout(endTest, 100);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
|
|
@ -13,7 +13,7 @@ function handleRequest(request, response) {
|
|||
' parent.done();' +
|
||||
' document.close();' +
|
||||
'}' +
|
||||
'setTimeout(doWrite, 1);' +
|
||||
'setTimeout(doWrite, 0);' +
|
||||
'</script>'
|
||||
);
|
||||
|
||||
|
|
|
@ -35,10 +35,10 @@ document.addEventListener('readystatechange', function(event) {
|
|||
window.addEventListener('readystatechange', function(event) {
|
||||
ok(false, 'window listener', 'readystatechange event should not bubble to window');
|
||||
}, false);
|
||||
setTimeout(function() {
|
||||
addLoadEvent(function() {
|
||||
is(i, states.length, 'readystatechange event count');
|
||||
SimpleTest.finish();
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
|
|
|
@ -40,7 +40,7 @@ catch(ex){
|
|||
setTimeout(function(){
|
||||
ok(true,"setTimeout still executes after bogus script insertion");
|
||||
window.error = errorHandler;
|
||||
SimpleTest.finish();}, 200);
|
||||
SimpleTest.finish();}, 0);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=513194
|
|||
consoleListener.finish();
|
||||
consoleService.unregisterListener(consoleListener);
|
||||
}
|
||||
setTimeout(done, 1);
|
||||
setTimeout(done, 0);
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
|
|
|
@ -189,7 +189,7 @@ function xpcWaitForFinishedFrames(callback, numFrames) {
|
|||
|
||||
if (finishedFrameCount == numFrames) {
|
||||
clearInterval(frameWaitInterval);
|
||||
setTimeout(callback, 1);
|
||||
setTimeout(callback, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -48,11 +48,11 @@ SimpleTest.waitForFocus(function() {
|
|||
newInput.focus();
|
||||
newInput.dispatchEvent(event);
|
||||
|
||||
setTimeout(function() {
|
||||
hitEventLoop(function() {
|
||||
ok(!popupShown, "Popup must not be opened");
|
||||
SpecialPowers.removeAutoCompletePopupEventListener(window, listener);
|
||||
SimpleTest.finish();
|
||||
}, 1000);
|
||||
}, 100);
|
||||
}, 0);
|
||||
}, false);
|
||||
|
||||
|
@ -61,6 +61,14 @@ SimpleTest.waitForFocus(function() {
|
|||
synthesizeKey("VK_ENTER", {});
|
||||
});
|
||||
|
||||
function hitEventLoop(func, times) {
|
||||
if (times > 0) {
|
||||
setTimeout(hitEventLoop, 0, func, times - 1);
|
||||
} else {
|
||||
setTimeout(func, 0);
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
|
|
|
@ -179,5 +179,5 @@ function runTest() {
|
|||
is(count, gExpectedCookies, "total number of cookies");
|
||||
cs.removeAll();
|
||||
|
||||
setTimeout(finishTest, 5000);
|
||||
finishTest();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче