Bug 467206, Correctly remove the load listener in mochibrowser: browser_bug441778.js

r=gavin
This commit is contained in:
Justin Wood 2008-12-05 23:04:18 -05:00
Родитель 45f90f4236
Коммит e8051a2512
1 изменённых файлов: 6 добавлений и 4 удалений

Просмотреть файл

@ -77,9 +77,6 @@ function test() {
};
let continueTest = function() {
// Remove the load listener so it doesn't get called for the sub-document.
testBrowser.removeEventListener("load", continueTest, true);
// Change the zoom level and then save it so we can compare it to the level
// after loading the sub-document.
FullZoom.enlarge();
@ -97,7 +94,12 @@ function test() {
// Note: in order for the sub-document load to trigger a location change
// the way it does under real world usage scenarios, we have to continue
// the test in a timeout for some unknown reason.
let continueListener = function() { window.setTimeout(continueTest, 0) };
let continueListener = function() {
window.setTimeout(continueTest, 0);
// Remove the load listener so it doesn't get called for the sub-document.
testBrowser.removeEventListener("load", continueListener, true);
};
testBrowser.addEventListener("load", continueListener, true);
// Start the test by loading the test page.