Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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/. */
5 function test() {
6 waitForExplicitFinish();
8 let tabOne = gBrowser.addTab("about:blank");
9 let tabTwo = gBrowser.addTab("http://mochi.test:8888/");
10 gBrowser.selectedTab = tabTwo;
12 let browser = gBrowser.getBrowserForTab(tabTwo);
13 let onLoad = function() {
14 browser.removeEventListener("load", onLoad, true);
16 gBrowser.showOnlyTheseTabs([tabTwo]);
18 is(gBrowser.visibleTabs.length, 1, "Only one tab is visible");
20 let uris = PlacesCommandHook.uniqueCurrentPages;
21 is(uris.length, 1, "Only one uri is returned");
23 is(uris[0].spec, tabTwo.linkedBrowser.currentURI.spec, "It's the correct URI");
25 gBrowser.removeTab(tabOne);
26 gBrowser.removeTab(tabTwo);
27 Array.forEach(gBrowser.tabs, function(tab) {
28 gBrowser.showTab(tab);
29 });
31 finish();
32 }
33 browser.addEventListener("load", onLoad, true);
34 }