Sat, 03 Jan 2015 20:18:00 +0100
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=489671
5 -->
6 <head>
7 <meta charset="utf-8">
8 <title>Test for Bug 489671</title>
9 <script src="/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel="stylesheet" href="/tests/SimpleTest/test.css">
11 </head>
12 <body>
13 <a target="_blank"
14 href="https://bugzilla.mozilla.org/show_bug.cgi?id=489671"
15 >Mozilla Bug 489671</a>
16 <p id="display" onclick="queueNextTest(); throw 'Got click 1';"></p>
17 <script>
18 // override window.onerror so it won't see our exceptions
19 window.onerror = function() {}
21 var testNum = 0;
22 function doTest() {
23 switch(testNum++) {
24 case 0:
25 var event = document.createEvent("MouseEvents");
26 event.initMouseEvent("click", true, true, document.defaultView,
27 0, 0, 0, 0, 0, false, false, false, false, 0, null);
28 $("display").dispatchEvent(event);
29 break;
30 case 1:
31 var script = document.createElement("script");
32 script.textContent = "queueNextTest(); throw 'Got click 2'";
33 document.body.appendChild(script);
34 break;
35 case 2:
36 window.setTimeout("queueNextTest(); throw 'Got click 3'", 0);
37 break;
38 case 3:
39 SimpleTest.endMonitorConsole();
40 return;
41 }
42 }
43 function queueNextTest() { SimpleTest.executeSoon(doTest); }
45 SimpleTest.waitForExplicitFinish();
46 SimpleTest.monitorConsole(SimpleTest.finish, [
47 { errorMessage: "uncaught exception: Got click 1" },
48 { errorMessage: "uncaught exception: Got click 2" },
49 { errorMessage: "uncaught exception: Got click 3" }
50 ]);
52 doTest();
53 </script>
54 </body>
55 </html>