js/xpconnect/tests/mochitest/test_bug636097.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 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=504877
     5 test by moz_bug_r_a4@yahoo.com
     6 -->
     7 <head>
     8   <title>Test for Bug 504877</title>
     9   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    10   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    11 </head>
    12 <body>
    13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=504877">Mozilla Bug 504877</a>
    14 <p id="display"></p>
    15 <div id="content" style="display: none">
    17 </div>
    18 <pre id="test">
    19 <script type="application/javascript">
    21 /** Test for Bug 504877 **/
    22 SimpleTest.waitForExplicitFinish();
    24 var targetUrl = "http://example.com/";
    25 var l;
    27 function a() {
    28         var r = "FAIL", s;
    29         try {
    30                 s = l.toString();
    31         }
    32         catch (e) {
    33                 if (/denied|insecure/.test(e))
    34                         r = "PASS";
    35                 s = e;
    36         }
    38         is(r, "PASS", "should have thrown an exception");
    39         SimpleTest.finish();
    40 }
    42 var p = 0;
    43 function b() {
    44         switch (++p) {
    45         case 1:
    46                 frames[0].location = "about:blank";
    47                 break;
    48         case 2:
    49                 l = frames[0].location;
    50                 frames[0].location = targetUrl;
    51                 break;
    52         case 3:
    53                 a();
    54                 break;
    55         }
    56 }
    57 </script>
    59 </pre>
    60 <iframe onload="b()"></iframe>
    61 </body>
    62 </html>

mercurial