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