browser/components/tabview/test/browser_tabview_bug612470.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 // Tests that groups behave properly when closing all tabs but app tabs.
     6 function test() {
     7   let cw, win, groupItem;
     9   let onLoad = function (tvwin) {
    10     win = tvwin;
    11     registerCleanupFunction(function () win.close());
    12     win.gBrowser.pinTab(win.gBrowser.tabs[0]);
    13     win.gBrowser.loadOneTab("about:blank", {inBackground: true});
    14   };
    16   let onShow = function () {
    17     cw = win.TabView.getContentWindow();
    18     is(cw.GroupItems.groupItems.length, 1, "There's only one group");
    20     groupItem = createEmptyGroupItem(cw, 200, 200, 20);
    21     cw.UI.setActive(groupItem);
    23     whenTabViewIsHidden(onHide, win);
    24     cw.UI.goToTab(win.gBrowser.tabs[0]);
    25   };
    27   let onHide = function () {
    28     let tab = win.gBrowser.loadOneTab("about:blank", {inBackground: true});
    29     is(groupItem.getChildren().length, 1, "One tab is in the new group");
    31     executeSoon(function () {
    32       is(win.gBrowser.visibleTabs.length, 2, "There are two tabs displayed");
    33       win.gBrowser.removeTab(tab);
    35       is(groupItem.getChildren().length, 0, "No tabs are in the new group");
    36       is(win.gBrowser.visibleTabs.length, 1, "There is one tab displayed");
    37       is(cw.GroupItems.groupItems.length, 2, "There are two groups still");
    39       finish();
    40     });
    41   };
    43   waitForExplicitFinish();
    45   newWindowWithTabView(onShow, onLoad);
    46 }

mercurial