browser/components/tabview/test/browser_tabview_bug608037.js

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     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