dom/indexedDB/test/test_leaving_page.html

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 <!--
     2   Any copyright is dedicated to the Public Domain.
     3   http://creativecommons.org/publicdomain/zero/1.0/
     4 -->
     5 <html>
     6 <head>
     7   <title>Indexed Database Leaving Page Test</title>
     9   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    10   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    11 </head>
    13 <body onload="runTest();">
    14   <iframe id="inner"></iframe>
    15   <a id="a" href="leaving_page_iframe.html"></a>
    17   <script type="text/javascript;version=1.7">
    18     if (!SpecialPowers.isMainProcess()) {
    19       window.runTest = function() {
    20         todo(false, "Figure out this test for child processes!");
    21         finishTest();
    22       }
    23     }
    25     onmessage = function(e) {
    26       ok(false, "gotmessage: " + e.data);
    27     }
    29     function testSteps()
    30     {
    31       var iframe = $("inner");
    32       iframe.src = "leaving_page_iframe.html";
    33       iframe.onload = continueToNextStep;
    34       yield undefined;
    35       is(iframe.contentWindow.location.href, $("a").href,
    36          "should navigate to iframe page");
    37       yield undefined;
    38       is(iframe.contentWindow.location.href, "about:blank",
    39          "should nagivate to about:blank");
    41       let request = indexedDB.open(location, 1);
    42       request.onsuccess = grabEventAndContinueHandler;
    43       let event = yield undefined;
    45       let db = event.target.result;
    46       db.transaction(["mystore"]).objectStore("mystore").get(42).onsuccess =
    47         grabEventAndContinueHandler;
    48       event = yield undefined;
    49       is(event.target.result.hello, "world", "second modification rolled back");
    51       finishTest();
    52       yield undefined;
    53     }
    54   </script>
    55   <script type="text/javascript;version=1.7" src="helpers.js"></script>
    56 </html>

mercurial