|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 function test() { |
|
5 waitForExplicitFinish(); |
|
6 newWindowWithTabView(testTopOfStack, loadTabs); |
|
7 } |
|
8 |
|
9 function loadTabs (win) { |
|
10 for (let i = 0; i < 4; i++) |
|
11 win.gBrowser.loadOneTab('about:blank', {inBackground: false}); |
|
12 win.gBrowser.selectedTab = win.gBrowser.tabs[2]; |
|
13 } |
|
14 |
|
15 function testTopOfStack(win) { |
|
16 registerCleanupFunction(function () { win.close(); }); |
|
17 let cw = win.TabView.getContentWindow(); |
|
18 let groupItem = cw.GroupItems.getActiveGroupItem(); |
|
19 ok(!groupItem.isStacked(), 'groupItem is not stacked'); |
|
20 groupItem.setSize(150, 150); |
|
21 groupItem.setUserSize(); |
|
22 ok(groupItem.isStacked(), 'groupItem is now stacked'); |
|
23 ok(groupItem.isTopOfStack(groupItem.getChild(2)), |
|
24 'the third tab is on top of stack'); |
|
25 finish(); |
|
26 } |
|
27 |