dom/events/test/test_bug605242.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=605242
     5 -->
     6 <head>
     7   <title>Test for Bug 605242</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 onload="setTimeout('runTest()', 0)">
    12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=605242">Mozilla Bug 605242</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 605242 **/
    22 SimpleTest.waitForExplicitFinish();
    24 var utils = SpecialPowers.getDOMWindowUtils(window);
    25 function sendMouseDown(el) {
    26   var rect = el.getBoundingClientRect();
    27   utils.sendMouseEvent('mousedown', rect.left + 5, rect.top + 5, 0, 1, 0);
    28 }
    30 function sendMouseUp(el) {
    31   var rect = el.getBoundingClientRect();
    32   utils.sendMouseEvent('mouseup', rect.left + 5, rect.top + 5, 0, 1, 0);
    33 }
    35 function runTest() {
    36   var b = document.getElementById("testbutton");
    37   sendMouseDown(b);
    38   var l = document.querySelectorAll(":active");
    40   var contains = false;  
    41   for (var i = 0; i < l.length; ++i) {
    42     if (l[i] == b) {
    43       contains = true;
    44     }
    45   }
    47   ok(contains, "Wrong active content! \n");
    48   sendMouseUp(b);
    49   SimpleTest.finish();
    50 }
    52 </script>
    53 </pre>
    54 <button id="testbutton">A button</button>
    55 <pre id="log">
    56 </pre>
    57 </body>
    58 </html>

mercurial