browser/components/tabview/test/browser_tabview_bug608037.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 let tabOne;
     5 let tabTwo;
     7 function test() {
     8   waitForExplicitFinish();
    10   tabOne = gBrowser.addTab("http://mochi.test:8888/");
    11   tabTwo = gBrowser.addTab("http://mochi.test:8888/browser/browser/components/tabview/test/dummy_page.html");
    13   afterAllTabsLoaded(function () {
    14     // make sure the tab one is selected because undoCloseTab() would remove
    15     // the selected tab if it's a blank tab.
    16     gBrowser.selectedTab = tabOne;
    17     showTabView(onTabViewWindowLoaded);
    18   });
    19 }
    21 function onTabViewWindowLoaded() {
    22   let contentWindow = TabView.getContentWindow();
    23   let groupItems = contentWindow.GroupItems.groupItems;
    24   is(groupItems.length, 1, "There is only one group");
    25   is(groupItems[0].getChildren().length, 3, "The group has three tab items");
    27   gBrowser.removeTab(tabTwo);
    28   ok(TabView.isVisible(), "Tab View is still visible after removing a tab");
    29   is(groupItems[0].getChildren().length, 2, "The group has two tab items");
    31   restoreTab(function (tabTwo) {
    32     ok(TabView.isVisible(), "Tab View is still visible after restoring a tab");
    33     is(groupItems[0].getChildren().length, 3, "The group still has three tab items");
    35     // clean up and finish
    36     hideTabView(function () {
    37       gBrowser.removeTab(tabOne);
    38       gBrowser.removeTab(tabTwo);
    39       finish();
    40     });
    41   });
    42 }

mercurial