browser/components/tabview/test/browser_tabview_bug706736.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_bug706736.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,40 @@
     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 +
    1.10 +  newWindowWithTabView(function(win) {
    1.11 +    registerCleanupFunction(function() {
    1.12 +      win.close();
    1.13 +    });
    1.14 +
    1.15 +    let cw = win.TabView.getContentWindow();
    1.16 +
    1.17 +    let groupItemOne = cw.GroupItems.groupItems[0];
    1.18 +    is(groupItemOne.getChildren().length, 1, "Group one has 1 tab item");
    1.19 +
    1.20 +    let groupItemTwo = createGroupItemWithBlankTabs(win, 300, 300, 40, 1);
    1.21 +    is(groupItemTwo.getChildren().length, 1, "Group two has 1 tab items");
    1.22 +
    1.23 +    whenTabViewIsHidden(function() {
    1.24 +      win.gBrowser.removeTab(win.gBrowser.selectedTab);
    1.25 +      executeSoon(function() {
    1.26 +        win.undoCloseTab();
    1.27 +
    1.28 +        groupItemTwo.addSubscriber("childAdded", function onChildAdded(data) {
    1.29 +          groupItemTwo.removeSubscriber("childAdded", onChildAdded);
    1.30 +
    1.31 +          is(groupItemOne.getChildren().length, 1, "Group one still has 1 tab item");
    1.32 +          is(groupItemTwo.getChildren().length, 1, "Group two still has 1 tab item");
    1.33 +        });
    1.34 +
    1.35 +        finish();
    1.36 +      });
    1.37 +    }, win);
    1.38 +    groupItemTwo.getChild(0).zoomIn();
    1.39 +  }, function(win) {
    1.40 +    let newTab = win.gBrowser.addTab();
    1.41 +    win.gBrowser.pinTab(newTab);
    1.42 +  });
    1.43 +}

mercurial