browser/components/tabview/test/browser_tabview_bug634085.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 let numChildren = 7;
michael@0 6
michael@0 7 let assertTopOfStack = function (tabItem) {
michael@0 8 ok(!tabItem.getHidden(), "tabItem is visible");
michael@0 9 is(tabItem.zIndex, tabItem.parent.getZ() + numChildren + 1, "zIndex");
michael@0 10 }
michael@0 11
michael@0 12 let testTopOfStack = function (tabItem, callback) {
michael@0 13 hideTabView(function () {
michael@0 14 gBrowser.selectedTab = tabItem.tab;
michael@0 15
michael@0 16 showTabView(function () {
michael@0 17 assertTopOfStack(tabItem);
michael@0 18 callback();
michael@0 19 });
michael@0 20 });
michael@0 21 }
michael@0 22
michael@0 23 let finishTest = function () {
michael@0 24 registerCleanupFunction(function () {
michael@0 25 is(1, gBrowser.tabs.length, "there is one tab, only");
michael@0 26 ok(!TabView.isVisible(), "tabview is not visible");
michael@0 27 });
michael@0 28
michael@0 29 finish();
michael@0 30 }
michael@0 31
michael@0 32 waitForExplicitFinish();
michael@0 33
michael@0 34 showTabView(function () {
michael@0 35 let groupItem = createGroupItemWithBlankTabs(window, 150, 150, 10, numChildren);
michael@0 36
michael@0 37 registerCleanupFunction(function () {
michael@0 38 closeGroupItem(groupItem, function () TabView.hide());
michael@0 39 });
michael@0 40
michael@0 41 testTopOfStack(groupItem.getChild(1), function () {
michael@0 42 testTopOfStack(groupItem.getChild(6), function () {
michael@0 43 closeGroupItem(groupItem, function () {
michael@0 44 hideTabView(finishTest);
michael@0 45 });
michael@0 46 });
michael@0 47 });
michael@0 48 });
michael@0 49 }

mercurial