browser/base/content/test/general/browser_bug481560.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 function test() {
     2   waitForExplicitFinish();
     4   var win = openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no");
     6   win.addEventListener("load", function () {
     7     win.removeEventListener("load", arguments.callee, false);
     9     win.content.addEventListener("focus", function () {
    10       win.content.removeEventListener("focus", arguments.callee, false);
    12       function onTabClose() {
    13         ok(false, "shouldn't have gotten the TabClose event for the last tab");
    14       }
    15       var tab = win.gBrowser.selectedTab;
    16       tab.addEventListener("TabClose", onTabClose, false);
    18       EventUtils.synthesizeKey("w", { accelKey: true }, win);
    20       ok(win.closed, "accel+w closed the window immediately");
    22       tab.removeEventListener("TabClose", onTabClose, false);
    24       finish();
    25     }, false);
    26   }, false);
    27 }

mercurial