Improved the test for Bug 585853 - Test 'bookmark all pages' in presence of tab candy

This commit is contained in:
Raymond Lee 2010-08-11 11:50:57 +08:00
parent 33ba441530
commit 9acd746ebc

View File

@ -40,11 +40,12 @@ function test() {
let tabOne = gBrowser.addTab("about:blank");
let tabTwo = gBrowser.addTab("http://mochi.test:8888/");
gBrowser.selectedTab = tabTwo;
var browser = gBrowser.getBrowserForTab(tabTwo);
browser.addEventListener("load", function() {
let browser = gBrowser.getBrowserForTab(tabTwo);
let onLoad = function() {
browser.removeEventListener("load", onLoad, true);
gBrowser.showOnlyTheseTabs([tabTwo]);
is(gBrowser.visibleTabs.length, 1, "Only one tab is visible");
@ -61,5 +62,6 @@ function test() {
});
finish();
}, true);
}
browser.addEventListener("load", onLoad, true);
}