browser/components/tabview/test/browser_tabview_bug608158.js

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 function test() {
     5   waitForExplicitFinish();
     6   newWindowWithTabView(onTabViewWindowLoaded);
     7 }
     9 function onTabViewWindowLoaded(win) {
    10   let contentWindow = win.TabView.getContentWindow();
    12   is(contentWindow.GroupItems.groupItems.length, 1, 
    13      "There is one group item on startup");
    14   is(win.gBrowser.tabs.length, 1, "There is one tab on startup");
    15   let groupItem = contentWindow.GroupItems.groupItems[0];
    17   hideGroupItem(groupItem, function () {
    18     hideTabView(() => {
    19       is(contentWindow.GroupItems.groupItems.length, 1, 
    20          "There is still one group item");
    21       isnot(groupItem, contentWindow.GroupItems.groupItems[0], 
    22             "The initial group item is not the same as the final group item");
    23       is(win.gBrowser.tabs.length, 1, "There is only one tab");
    24       ok(!win.TabView.isVisible(), "Tab View is hidden");
    25       promiseWindowClosed(win).then(finish);
    26     }, win);
    27   });
    28 }

mercurial