browser/components/tabview/test/browser_tabview_bug634085.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:b7a3d4ff69be
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
3
4 function test() {
5 let numChildren = 7;
6
7 let assertTopOfStack = function (tabItem) {
8 ok(!tabItem.getHidden(), "tabItem is visible");
9 is(tabItem.zIndex, tabItem.parent.getZ() + numChildren + 1, "zIndex");
10 }
11
12 let testTopOfStack = function (tabItem, callback) {
13 hideTabView(function () {
14 gBrowser.selectedTab = tabItem.tab;
15
16 showTabView(function () {
17 assertTopOfStack(tabItem);
18 callback();
19 });
20 });
21 }
22
23 let finishTest = function () {
24 registerCleanupFunction(function () {
25 is(1, gBrowser.tabs.length, "there is one tab, only");
26 ok(!TabView.isVisible(), "tabview is not visible");
27 });
28
29 finish();
30 }
31
32 waitForExplicitFinish();
33
34 showTabView(function () {
35 let groupItem = createGroupItemWithBlankTabs(window, 150, 150, 10, numChildren);
36
37 registerCleanupFunction(function () {
38 closeGroupItem(groupItem, function () TabView.hide());
39 });
40
41 testTopOfStack(groupItem.getChild(1), function () {
42 testTopOfStack(groupItem.getChild(6), function () {
43 closeGroupItem(groupItem, function () {
44 hideTabView(finishTest);
45 });
46 });
47 });
48 });
49 }

mercurial