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.
michael@0 | 1 | /* Any copyright is dedicated to the Public Domain. |
michael@0 | 2 | http://creativecommons.org/publicdomain/zero/1.0/ */ |
michael@0 | 3 | |
michael@0 | 4 | let tabOne; |
michael@0 | 5 | let tabTwo; |
michael@0 | 6 | |
michael@0 | 7 | function test() { |
michael@0 | 8 | waitForExplicitFinish(); |
michael@0 | 9 | |
michael@0 | 10 | tabOne = gBrowser.addTab("http://mochi.test:8888/"); |
michael@0 | 11 | tabTwo = gBrowser.addTab("http://mochi.test:8888/browser/browser/components/tabview/test/dummy_page.html"); |
michael@0 | 12 | |
michael@0 | 13 | afterAllTabsLoaded(function () { |
michael@0 | 14 | // make sure the tab one is selected because undoCloseTab() would remove |
michael@0 | 15 | // the selected tab if it's a blank tab. |
michael@0 | 16 | gBrowser.selectedTab = tabOne; |
michael@0 | 17 | showTabView(onTabViewWindowLoaded); |
michael@0 | 18 | }); |
michael@0 | 19 | } |
michael@0 | 20 | |
michael@0 | 21 | function onTabViewWindowLoaded() { |
michael@0 | 22 | let contentWindow = TabView.getContentWindow(); |
michael@0 | 23 | let groupItems = contentWindow.GroupItems.groupItems; |
michael@0 | 24 | is(groupItems.length, 1, "There is only one group"); |
michael@0 | 25 | is(groupItems[0].getChildren().length, 3, "The group has three tab items"); |
michael@0 | 26 | |
michael@0 | 27 | gBrowser.removeTab(tabTwo); |
michael@0 | 28 | ok(TabView.isVisible(), "Tab View is still visible after removing a tab"); |
michael@0 | 29 | is(groupItems[0].getChildren().length, 2, "The group has two tab items"); |
michael@0 | 30 | |
michael@0 | 31 | restoreTab(function (tabTwo) { |
michael@0 | 32 | ok(TabView.isVisible(), "Tab View is still visible after restoring a tab"); |
michael@0 | 33 | is(groupItems[0].getChildren().length, 3, "The group still has three tab items"); |
michael@0 | 34 | |
michael@0 | 35 | // clean up and finish |
michael@0 | 36 | hideTabView(function () { |
michael@0 | 37 | gBrowser.removeTab(tabOne); |
michael@0 | 38 | gBrowser.removeTab(tabTwo); |
michael@0 | 39 | finish(); |
michael@0 | 40 | }); |
michael@0 | 41 | }); |
michael@0 | 42 | } |