js/xpconnect/tests/mochitest/test_bug661980.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=661980
     5 -->
     6 <head>
     7   <title>Test for Bug 661980</title>
     8   <script type="application/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=661980">Mozilla Bug 661980</a>
    13 <p id="display"></p>
    14 <div id="content" style="display: none">
    16 </div>
    17 <pre id="test">
    18 <script type="application/javascript">
    20 /** Test for Bug 661980 **/
    22 // While not currently needed, make this as similar as possible to a real
    23 // EventTarget just to make sure that we're tripping on the wrapping and
    24 // nothing else.
    25 var fakeTarget = {
    26   addEventListener: function() {},
    27   removeEventListener: function() {},
    28   dispatchEvent: function() {}
    29 }
    31 var mouseevent = document.createEvent("MouseEvent");
    32 var didThrow = false;
    33 dump("hello nurse");
    34 try {
    35   mouseevent.initMouseEvent("mouseover",
    36                             false, false,
    37                             window,
    38                             1, 2, 3, 4, 5,
    39                             false, false, false, false,
    40                             0,
    41                             fakeTarget);
    42 }
    43 catch (ex) {
    44   didThrow = true;
    45 }
    46 ok(didThrow, "should not be able to implement EventTarget using script");
    48 mouseevent.initMouseEvent("mouseout",
    49                           false, false,
    50                           window,
    51                           1, 2, 3, 4, 5,
    52                           false, false, false, false,
    53                           0,
    54                           document.body);
    55 is(mouseevent.type, "mouseout",
    56    "should able to implement EventTarget using Element");
    58 </script>
    59 </pre>
    60 </body>
    61 </html>

mercurial