dom/xbl/test/test_bug403162.xhtml

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 <html xmlns="http://www.w3.org/1999/xhtml">
     2 <!--
     3 https://bugzilla.mozilla.org/show_bug.cgi?id=403162
     4 -->
     5 <head>
     6   <title>Test for Bug 403162</title>
     7   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     8   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     9   <bindings xmlns="http://www.mozilla.org/xbl">
    10     <binding id="test">
    11       <handlers>
    12         <handler event="foo" action="XPCNativeWrapper.unwrap(window).triggerCount++" allowuntrusted="true"/>
    13       </handlers>
    14     </binding>
    15   </bindings>
    16 </head>
    17 <body>
    18 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=403162">Mozilla Bug 403162</a>
    19 <p id="display" style="-moz-binding: url(#test)"></p>
    20 <div id="content" style="display: none">
    22 </div>
    23 <pre id="test">
    24 <script class="testbody" type="text/javascript">
    25 <![CDATA[
    26 var triggerCount = 0;
    28 function dispatchEvent(t) {
    29   var ev = document.createEvent("Events");
    30   ev.initEvent("foo", true, true);
    31   t.dispatchEvent(ev);  
    32 }
    34 /** Test for Bug 403162 **/
    35 SimpleTest.waitForExplicitFinish();
    36 addLoadEvent(function() {
    37   var t = $("display");
    38   is(triggerCount, 0, "Haven't dispatched event");
    40   dispatchEvent(t);
    41   is(triggerCount, 1, "Dispatched once");
    43   dispatchEvent(t);
    44   is(triggerCount, 2, "Dispatched twice");
    46   t.parentNode.removeChild(t);
    47   dispatchEvent(t);
    48   is(triggerCount, 2, "Listener should be gone now");
    50   SimpleTest.finish();
    51 });
    52 ]]>
    53 </script>
    54 </pre>
    55 </body>
    56 </html>

mercurial