dom/base/test/test_messageChannel.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.

     2 <!DOCTYPE HTML>
     3 <html>
     4 <!--
     5 https://bugzilla.mozilla.org/show_bug.cgi?id=677638
     6 -->
     7 <head>
     8   <meta charset="utf-8">
     9   <title>Test for Bug 677638 - basic support</title>
    10   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    11   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    12 </head>
    13 <body>
    14 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=677638">Mozilla Bug 677638</a>
    15 <p id="display"></p>
    16 <div id="content" style="display: none">
    17   <iframe name="x" id="x"></iframe>
    18   <iframe name="y" id="y"></iframe>
    19 </div>
    20 <pre id="test">
    21 </pre>
    22   <script type="application/javascript">
    24   function runTest() {
    25     /** Test for Bug 677638 **/
    26     var a = new MessageChannel();
    27     ok(a, "MessageChannel created");
    29     var port1 = a.port1;
    30     ok(port1, "MessageChannel.port1 exists");
    31     is(port1, a.port1, "MessageChannel.port1 is port1");
    33     var port2 = a.port2;
    34     ok(port2, "MessageChannel.port1 exists");
    35     is(port2, a.port2, "MessageChannel.port2 is port2");
    37     [ 'postMessage', 'start', 'close' ].forEach(function(e) {
    38       ok(e in port1, "MessagePort1." + e + " exists");
    39       ok(e in port2, "MessagePort2." + e + " exists");
    40     });
    42     SimpleTest.finish();
    43   }
    45   SimpleTest.waitForExplicitFinish();
    46   SpecialPowers.pushPrefEnv({"set": [["dom.messageChannel.enabled", true]]}, runTest);
    47   </script>
    48 </body>
    49 </html>

mercurial