js/xpconnect/tests/mochitest/test_bug446584.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=446584
     5 -->
     6 <head>
     7   <title>Test for Bug 446584</title>
     8   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    10 </head>
    11 <body>
    12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=446584">Mozilla Bug 446584</a>
    13 <p id="display"></p>
    14 <div id="content" style="display: none">
    16 </div>
    17 <pre id="test">
    18 <script class="testbody" type="text/javascript">
    20 /** Test for Bug 446584 **/
    22 function test(val) {
    23   try {
    24     document.createNodeIterator(document.body,
    25                                 NodeFilter.SHOW_ALL,
    26                                 function() { throw val }).nextNode();
    27     ok(false, "NodeIterator::nextNode() should have thrown an exception.");
    28   } catch (ex) {
    29     ok(val === ex, "NodeIterator did not properly forward exception " +
    30        val + " of type " + typeof val + ".  Thrown value was " + ex + ".");
    31   }
    32 }
    34 test(0);
    35 test(1);
    36 test(3.14);
    37 test('roses');
    38 test({});
    39 test(false);
    40 test(true);
    41 test([1,2,3]);
    42 test(function(){});
    44 </script>
    45 </pre>
    46 </body>
    47 </html>

mercurial