browser/components/tabview/test/browser_tabview_bug604098.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_bug604098.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,41 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 +   http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +
     1.7 +let contentWindow;
     1.8 +let contentElement;
     1.9 +
    1.10 +function test() {
    1.11 +  waitForExplicitFinish();
    1.12 +
    1.13 +  registerCleanupFunction(function() {
    1.14 +    if (gBrowser.tabs.length > 1)
    1.15 +      gBrowser.removeTab(gBrowser.tabs[1]);
    1.16 +    hideTabView();
    1.17 +  });
    1.18 +
    1.19 +  showTabView(function() {
    1.20 +    contentWindow = TabView.getContentWindow();
    1.21 +    contentElement = contentWindow.document.getElementById("content");
    1.22 +    test1();
    1.23 +  });
    1.24 +}
    1.25 +
    1.26 +function test1() {
    1.27 +  let groupItems = contentWindow.GroupItems.groupItems;
    1.28 +  is(groupItems.length, 1, "there is one groupItem");
    1.29 +
    1.30 +  whenTabViewIsHidden(function() {
    1.31 +    gBrowser.selectedTab = gBrowser.tabs[0];
    1.32 +    is(groupItems.length, 2, "there are two groupItems");
    1.33 +    closeGroupItem(groupItems[1], finish);
    1.34 +  });
    1.35 +
    1.36 +  // double click
    1.37 +  doubleClick(contentElement, 0);
    1.38 +}
    1.39 +
    1.40 +function doubleClick(targetElement, buttonCode) {
    1.41 +  EventUtils.sendMouseEvent(
    1.42 +    { type: "dblclick", button: buttonCode }, targetElement, contentWindow);
    1.43 +}
    1.44 +

mercurial