browser/components/tabview/test/browser_tabview_bug587990.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_bug587990.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,31 @@
     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 +  let newTab;
     1.9 +
    1.10 +  let onLoad = function (win) {
    1.11 +    registerCleanupFunction(function () win.close());
    1.12 +
    1.13 +    newTab = win.gBrowser.addTab();
    1.14 +
    1.15 +    let popup = win.document.getElementById("context_tabViewMenuPopup");
    1.16 +    win.TabView.updateContextMenu(newTab, popup);
    1.17 +  };
    1.18 +
    1.19 +  let onShow = function (win) {
    1.20 +    let cw = win.TabView.getContentWindow();
    1.21 +    is(cw.GroupItems.groupItems.length, 1, "Has only one group");
    1.22 +
    1.23 +    let groupItem = cw.GroupItems.groupItems[0];
    1.24 +    let tabItems = groupItem.getChildren();
    1.25 +
    1.26 +    let tab = tabItems[tabItems.length - 1].tab;
    1.27 +    is(tab, newTab, "The new tab exists in the group");
    1.28 +
    1.29 +    finish();
    1.30 +  };
    1.31 +
    1.32 +  waitForExplicitFinish();
    1.33 +  newWindowWithTabView(onShow, onLoad);
    1.34 +}

mercurial