browser/components/tabview/test/browser_tabview_bug608153.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

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 function test() {
michael@0 5 waitForExplicitFinish();
michael@0 6
michael@0 7 let pinnedTab = gBrowser.addTab();
michael@0 8 gBrowser.pinTab(pinnedTab);
michael@0 9
michael@0 10 registerCleanupFunction(function() {
michael@0 11 gBrowser.unpinTab(pinnedTab);
michael@0 12
michael@0 13 // Don't remove the initial tab.
michael@0 14 gBrowser.moveTabTo(gBrowser.tabs[1], 0);
michael@0 15
michael@0 16 while (gBrowser.tabs[1])
michael@0 17 gBrowser.removeTab(gBrowser.tabs[1]);
michael@0 18 hideTabView();
michael@0 19 });
michael@0 20
michael@0 21 showTabView(function() {
michael@0 22 let cw = TabView.getContentWindow();
michael@0 23 let groupItemOne = cw.GroupItems.groupItems[0];
michael@0 24 let groupItemTwo = createGroupItemWithBlankTabs(window, 250, 250, 40, 1);
michael@0 25
michael@0 26 is(cw.GroupItems.groupItems.length, 2, "Two group items");
michael@0 27
michael@0 28 hideTabView(function() {
michael@0 29 gBrowser.selectedTab = pinnedTab;
michael@0 30 is(cw.GroupItems.getActiveGroupItem(), groupItemTwo, "Group two is active");
michael@0 31 is(gBrowser.selectedTab, pinnedTab, "Selected tab is the pinned tab");
michael@0 32
michael@0 33 goToNextGroup();
michael@0 34 is(cw.GroupItems.getActiveGroupItem(), groupItemOne, "Group one is active");
michael@0 35 is(gBrowser.selectedTab, pinnedTab, "Selected tab is the pinned tab");
michael@0 36
michael@0 37 finish();
michael@0 38 });
michael@0 39 });
michael@0 40 }
michael@0 41

mercurial