browser/components/tabview/test/browser_tabview_bug634085.js

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 function test() {
     5   let numChildren = 7;
     7   let assertTopOfStack = function (tabItem) {
     8     ok(!tabItem.getHidden(), "tabItem is visible");
     9     is(tabItem.zIndex, tabItem.parent.getZ() + numChildren + 1, "zIndex");
    10   }
    12   let testTopOfStack = function (tabItem, callback) {
    13     hideTabView(function () {
    14       gBrowser.selectedTab = tabItem.tab;
    16       showTabView(function () {
    17         assertTopOfStack(tabItem);
    18         callback();
    19       });
    20     });
    21   }
    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     });
    29     finish();
    30   }
    32   waitForExplicitFinish();
    34   showTabView(function () {
    35     let groupItem = createGroupItemWithBlankTabs(window, 150, 150, 10, numChildren);
    37     registerCleanupFunction(function () {
    38       closeGroupItem(groupItem, function () TabView.hide());
    39     });
    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