browser/components/tabview/test/browser_tabview_bug604098.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 let contentWindow;
     5 let contentElement;
     7 function test() {
     8   waitForExplicitFinish();
    10   registerCleanupFunction(function() {
    11     if (gBrowser.tabs.length > 1)
    12       gBrowser.removeTab(gBrowser.tabs[1]);
    13     hideTabView();
    14   });
    16   showTabView(function() {
    17     contentWindow = TabView.getContentWindow();
    18     contentElement = contentWindow.document.getElementById("content");
    19     test1();
    20   });
    21 }
    23 function test1() {
    24   let groupItems = contentWindow.GroupItems.groupItems;
    25   is(groupItems.length, 1, "there is one groupItem");
    27   whenTabViewIsHidden(function() {
    28     gBrowser.selectedTab = gBrowser.tabs[0];
    29     is(groupItems.length, 2, "there are two groupItems");
    30     closeGroupItem(groupItems[1], finish);
    31   });
    33   // double click
    34   doubleClick(contentElement, 0);
    35 }
    37 function doubleClick(targetElement, buttonCode) {
    38   EventUtils.sendMouseEvent(
    39     { type: "dblclick", button: buttonCode }, targetElement, contentWindow);
    40 }

mercurial