dom/events/test/test_bug556493.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=556493
     5 -->
     6 <head>
     7   <title>Test for Bug 556493</title>
     8   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
    10   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    11   <style>
    12     div {
    13       border: 1px solid;
    14     }
    15   </style>
    16 </head>
    17 <body onload="setTimeout(runTest, 0)">
    18 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=556493">Mozilla Bug 556493</a>
    19 <p id="display"></p>
    20 <div id="content" style="display: none">
    22 </div>
    23 <pre id="test">
    24 <script type="application/javascript">
    26 /** Test for Bug 556493 **/
    28 SimpleTest.waitForExplicitFinish();
    30 var downCount = 0;
    31 var upCount = 0;
    32 var clickCount = 0;
    33 function runTest() {
    34   var d0 = document.getElementById("d0");
    35   var d1 = document.getElementById("d1");
    36   var d2 = document.getElementById("d2");
    38   d0.onmousedown = function(e) { ++downCount; };
    39   d0.onmouseup = function(e) { ++upCount; }
    40   d0.onclick = function(e) { ++clickCount; }
    42   synthesizeMouse(d1, 3, 3, { type: "mousedown"});
    43   synthesizeMouse(d1, 3, 3, { type: "mouseup"});
    45   is(downCount, 1, "Wrong mousedown event count!");
    46   is(upCount, 1, "Wrong mouseup event count!");
    47   is(clickCount, 1, "Wrong click event count!");
    49   synthesizeMouse(d1, 3, 3, { type: "mousedown"});
    50   synthesizeMouse(d1, 30, 3, { type: "mouseup"});
    52   is(downCount, 2, "Wrong mousedown event count!");
    53   is(upCount, 2, "Wrong mouseup event count!");
    54   is(clickCount, 2, "Wrong click event count!");
    56   synthesizeMouse(d1, 3, 3, { type: "mousedown"});
    57   synthesizeMouse(d2, 3, 3, { type: "mouseup"});
    59   is(downCount, 3, "Wrong mousedown event count!");
    60   is(upCount, 3, "Wrong mouseup event count!");
    61   is(clickCount, 2, "Wrong click event count!");
    63   SimpleTest.finish();
    64 }
    66 </script>
    67 </pre>
    68 <div id="d0">
    69 Test divs --
    70 <div id="d1">t</div><div id="d2">t</div>
    71 --
    72 </div>
    73 </body>
    74 </html>

mercurial