michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: let tabOne = gBrowser.addTab("about:blank"); michael@0: let tabTwo = gBrowser.addTab("http://mochi.test:8888/"); michael@0: gBrowser.selectedTab = tabTwo; michael@0: michael@0: let browser = gBrowser.getBrowserForTab(tabTwo); michael@0: let onLoad = function() { michael@0: browser.removeEventListener("load", onLoad, true); michael@0: michael@0: gBrowser.showOnlyTheseTabs([tabTwo]); michael@0: michael@0: is(gBrowser.visibleTabs.length, 1, "Only one tab is visible"); michael@0: michael@0: let uris = PlacesCommandHook.uniqueCurrentPages; michael@0: is(uris.length, 1, "Only one uri is returned"); michael@0: michael@0: is(uris[0].spec, tabTwo.linkedBrowser.currentURI.spec, "It's the correct URI"); michael@0: michael@0: gBrowser.removeTab(tabOne); michael@0: gBrowser.removeTab(tabTwo); michael@0: Array.forEach(gBrowser.tabs, function(tab) { michael@0: gBrowser.showTab(tab); michael@0: }); michael@0: michael@0: finish(); michael@0: } michael@0: browser.addEventListener("load", onLoad, true); michael@0: }