browser/components/tabview/test/browser_tabview_bug608153.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_bug608153.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,41 @@
     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 +  let pinnedTab = gBrowser.addTab();
    1.11 +  gBrowser.pinTab(pinnedTab);
    1.12 +
    1.13 +  registerCleanupFunction(function() {
    1.14 +    gBrowser.unpinTab(pinnedTab);
    1.15 +
    1.16 +    // Don't remove the initial tab.
    1.17 +    gBrowser.moveTabTo(gBrowser.tabs[1], 0);
    1.18 +
    1.19 +    while (gBrowser.tabs[1])
    1.20 +      gBrowser.removeTab(gBrowser.tabs[1]);
    1.21 +    hideTabView();
    1.22 +  });
    1.23 +
    1.24 +  showTabView(function() {
    1.25 +    let cw = TabView.getContentWindow();
    1.26 +    let groupItemOne = cw.GroupItems.groupItems[0];
    1.27 +    let groupItemTwo = createGroupItemWithBlankTabs(window, 250, 250, 40, 1);
    1.28 +
    1.29 +    is(cw.GroupItems.groupItems.length, 2, "Two group items");
    1.30 +
    1.31 +    hideTabView(function() {
    1.32 +      gBrowser.selectedTab = pinnedTab;
    1.33 +      is(cw.GroupItems.getActiveGroupItem(), groupItemTwo, "Group two is active");
    1.34 +      is(gBrowser.selectedTab, pinnedTab, "Selected tab is the pinned tab");
    1.35 +
    1.36 +      goToNextGroup();
    1.37 +      is(cw.GroupItems.getActiveGroupItem(), groupItemOne, "Group one is active");
    1.38 +      is(gBrowser.selectedTab, pinnedTab, "Selected tab is the pinned tab");
    1.39 +
    1.40 +      finish();
    1.41 +    });
    1.42 +  });
    1.43 +}
    1.44 +

mercurial