browser/components/tabview/test/browser_tabview_bug634085.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/components/tabview/test/browser_tabview_bug634085.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,49 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 +   http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +
     1.7 +function test() {
     1.8 +  let numChildren = 7;
     1.9 +
    1.10 +  let assertTopOfStack = function (tabItem) {
    1.11 +    ok(!tabItem.getHidden(), "tabItem is visible");
    1.12 +    is(tabItem.zIndex, tabItem.parent.getZ() + numChildren + 1, "zIndex");
    1.13 +  }
    1.14 +
    1.15 +  let testTopOfStack = function (tabItem, callback) {
    1.16 +    hideTabView(function () {
    1.17 +      gBrowser.selectedTab = tabItem.tab;
    1.18 +
    1.19 +      showTabView(function () {
    1.20 +        assertTopOfStack(tabItem);
    1.21 +        callback();
    1.22 +      });
    1.23 +    });
    1.24 +  }
    1.25 +
    1.26 +  let finishTest = function () {
    1.27 +    registerCleanupFunction(function () {
    1.28 +      is(1, gBrowser.tabs.length, "there is one tab, only");
    1.29 +      ok(!TabView.isVisible(), "tabview is not visible");
    1.30 +    });
    1.31 +
    1.32 +    finish();
    1.33 +  }
    1.34 +
    1.35 +  waitForExplicitFinish();
    1.36 +
    1.37 +  showTabView(function () {
    1.38 +    let groupItem = createGroupItemWithBlankTabs(window, 150, 150, 10, numChildren);
    1.39 +
    1.40 +    registerCleanupFunction(function () {
    1.41 +      closeGroupItem(groupItem, function () TabView.hide());
    1.42 +    });
    1.43 +
    1.44 +    testTopOfStack(groupItem.getChild(1), function () {
    1.45 +      testTopOfStack(groupItem.getChild(6), function () {
    1.46 +        closeGroupItem(groupItem, function () {
    1.47 +          hideTabView(finishTest);
    1.48 +        });
    1.49 +      });
    1.50 +    });
    1.51 +  });
    1.52 +}

mercurial