browser/base/content/test/general/browser_visibleTabs_bookmarkAllPages.js

branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
equal deleted inserted replaced
-1:000000000000 0:365f9d858617
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5 function test() {
6 waitForExplicitFinish();
7
8 let tabOne = gBrowser.addTab("about:blank");
9 let tabTwo = gBrowser.addTab("http://mochi.test:8888/");
10 gBrowser.selectedTab = tabTwo;
11
12 let browser = gBrowser.getBrowserForTab(tabTwo);
13 let onLoad = function() {
14 browser.removeEventListener("load", onLoad, true);
15
16 gBrowser.showOnlyTheseTabs([tabTwo]);
17
18 is(gBrowser.visibleTabs.length, 1, "Only one tab is visible");
19
20 let uris = PlacesCommandHook.uniqueCurrentPages;
21 is(uris.length, 1, "Only one uri is returned");
22
23 is(uris[0].spec, tabTwo.linkedBrowser.currentURI.spec, "It's the correct URI");
24
25 gBrowser.removeTab(tabOne);
26 gBrowser.removeTab(tabTwo);
27 Array.forEach(gBrowser.tabs, function(tab) {
28 gBrowser.showTab(tab);
29 });
30
31 finish();
32 }
33 browser.addEventListener("load", onLoad, true);
34 }

mercurial