browser/base/content/test/general/browser_bug724239.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 function test() {
     5   waitForExplicitFinish();
     6   BrowserOpenTab();
     8   let tab = gBrowser.selectedTab;
     9   let browser = tab.linkedBrowser;
    11   registerCleanupFunction(function () { gBrowser.removeTab(tab); });
    13   whenBrowserLoaded(browser, function () {
    14     browser.loadURI("http://example.com/");
    16     whenBrowserLoaded(browser, function () {
    17       ok(!gBrowser.canGoBack, "about:newtab wasn't added to the session history");
    18       finish();
    19     });
    20   });
    21 }
    23 function whenBrowserLoaded(aBrowser, aCallback) {
    24   if (aBrowser.contentDocument.readyState == "complete") {
    25     executeSoon(aCallback);
    26     return;
    27   }
    29   aBrowser.addEventListener("load", function onLoad() {
    30     aBrowser.removeEventListener("load", onLoad, true);
    31     executeSoon(aCallback);
    32   }, true);
    33 }

mercurial