browser/components/tabview/test/browser_tabview_bug642793.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_bug642793.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,27 @@
     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 +  waitForExplicitFinish();
     1.9 +  newWindowWithTabView(testTopOfStack, loadTabs);
    1.10 +}
    1.11 +
    1.12 +function loadTabs (win) {
    1.13 +  for (let i = 0; i < 4; i++)
    1.14 +    win.gBrowser.loadOneTab('about:blank', {inBackground: false});
    1.15 +  win.gBrowser.selectedTab = win.gBrowser.tabs[2];
    1.16 +}
    1.17 +
    1.18 +function testTopOfStack(win) {
    1.19 +  registerCleanupFunction(function () { win.close(); });
    1.20 +  let cw = win.TabView.getContentWindow();
    1.21 +  let groupItem = cw.GroupItems.getActiveGroupItem();
    1.22 +  ok(!groupItem.isStacked(), 'groupItem is not stacked');
    1.23 +  groupItem.setSize(150, 150);
    1.24 +  groupItem.setUserSize();
    1.25 +  ok(groupItem.isStacked(), 'groupItem is now stacked');
    1.26 +  ok(groupItem.isTopOfStack(groupItem.getChild(2)),
    1.27 +    'the third tab is on top of stack');
    1.28 +  finish();
    1.29 +}
    1.30 +

mercurial