dom/xbl/test/test_bug639338.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.

michael@0 1 <html xmlns="http://www.w3.org/1999/xhtml">
michael@0 2 <!--
michael@0 3 https://bugzilla.mozilla.org/show_bug.cgi?id=403162
michael@0 4 -->
michael@0 5 <head>
michael@0 6 <title>Test for Bug 639338</title>
michael@0 7 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
michael@0 8 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
michael@0 9 <bindings xmlns="http://www.mozilla.org/xbl">
michael@0 10 <binding id="test">
michael@0 11 <handlers>
michael@0 12 <handler event="DOMMouseScroll" action="XPCNativeWrapper.unwrap(window).triggerCount++" allowuntrusted="true"/>
michael@0 13 <handler event="DOMMouseScroll" modifiers="shift" action="XPCNativeWrapper.unwrap(window).shiftCount++" allowuntrusted="true"/>
michael@0 14 <handler event="DOMMouseScroll" modifiers="control" action="XPCNativeWrapper.unwrap(window).controlCount++" allowuntrusted="true"/>
michael@0 15 </handlers>
michael@0 16 </binding>
michael@0 17 </bindings>
michael@0 18 </head>
michael@0 19 <body>
michael@0 20 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=639338">Mozilla Bug 639338</a>
michael@0 21 <p id="display" style="-moz-binding: url(#test)"></p>
michael@0 22 <div id="content" style="display: none">
michael@0 23
michael@0 24 </div>
michael@0 25 <pre id="test">
michael@0 26 <script class="testbody" type="text/javascript">
michael@0 27 <![CDATA[
michael@0 28 var triggerCount = 0;
michael@0 29 var shiftCount = 0;
michael@0 30 var controlCount = 0;
michael@0 31
michael@0 32 function dispatchEvent(t, controlKey, shiftKey) {
michael@0 33 var ev = document.createEvent("MouseScrollEvents");
michael@0 34 ev.initMouseScrollEvent("DOMMouseScroll", true, true, window, 0, 0, 0, 0, 0, controlKey, false, shiftKey, false, 0, null, 0);
michael@0 35 t.dispatchEvent(ev);
michael@0 36 }
michael@0 37
michael@0 38 /** Test for Bug 403162 **/
michael@0 39 SimpleTest.waitForExplicitFinish();
michael@0 40 addLoadEvent(function() {
michael@0 41 var t = $("display");
michael@0 42 is(triggerCount, 0, "Haven't dispatched event");
michael@0 43
michael@0 44 dispatchEvent(t, false, false);
michael@0 45 is(triggerCount, 1, "Dispatched once");
michael@0 46 is(shiftCount, 0, "Not shift");
michael@0 47 is(controlCount, 0, "Not control");
michael@0 48
michael@0 49 dispatchEvent(t, false, true);
michael@0 50 is(triggerCount, 2, "Dispatched twice");
michael@0 51 is(shiftCount, 1, "Shift");
michael@0 52 is(controlCount, 0, "Not control");
michael@0 53
michael@0 54 dispatchEvent(t, true, false);
michael@0 55 is(triggerCount, 3, "Dispatched thrice");
michael@0 56 is(shiftCount, 1, "Not shift");
michael@0 57 is(controlCount, 1, "Control");
michael@0 58
michael@0 59 SimpleTest.finish();
michael@0 60 });
michael@0 61 ]]>
michael@0 62 </script>
michael@0 63 </pre>
michael@0 64 </body>
michael@0 65 </html>
michael@0 66

mercurial