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.
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html lang="en"> |
michael@0 | 3 | <head> |
michael@0 | 4 | <meta charset="utf8"> |
michael@0 | 5 | <title>Test for the Reflow Activity</title> |
michael@0 | 6 | <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 7 | <script type="text/javascript;version=1.8" src="common.js"></script> |
michael@0 | 8 | <!-- Any copyright is dedicated to the Public Domain. |
michael@0 | 9 | - http://creativecommons.org/publicdomain/zero/1.0/ --> |
michael@0 | 10 | </head> |
michael@0 | 11 | <body> |
michael@0 | 12 | <p>Test for reflow events</p> |
michael@0 | 13 | |
michael@0 | 14 | <script class="testbody" type="text/javascript;version=1.8"> |
michael@0 | 15 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 16 | |
michael@0 | 17 | let client; |
michael@0 | 18 | |
michael@0 | 19 | function generateReflow() |
michael@0 | 20 | { |
michael@0 | 21 | top.document.documentElement.style.display = "none"; |
michael@0 | 22 | top.document.documentElement.getBoundingClientRect(); |
michael@0 | 23 | top.document.documentElement.style.display = "block"; |
michael@0 | 24 | } |
michael@0 | 25 | |
michael@0 | 26 | function startTest() |
michael@0 | 27 | { |
michael@0 | 28 | removeEventListener("load", startTest); |
michael@0 | 29 | attachConsole(["ReflowActivity"], onAttach, true); |
michael@0 | 30 | } |
michael@0 | 31 | |
michael@0 | 32 | function onAttach(aState, aResponse) |
michael@0 | 33 | { |
michael@0 | 34 | client = aState.dbgClient; |
michael@0 | 35 | |
michael@0 | 36 | onReflowActivity = onReflowActivity.bind(null, aState); |
michael@0 | 37 | client.addListener("reflowActivity", onReflowActivity); |
michael@0 | 38 | generateReflow(); |
michael@0 | 39 | } |
michael@0 | 40 | |
michael@0 | 41 | // We are expecting 3 reflow events. |
michael@0 | 42 | let expectedEvents = [ |
michael@0 | 43 | { |
michael@0 | 44 | interruptible: false, |
michael@0 | 45 | sourceURL: "chrome://mochitests/content/chrome/toolkit/devtools/webconsole/test/test_reflow.html", |
michael@0 | 46 | functionName: "generateReflow" |
michael@0 | 47 | }, |
michael@0 | 48 | { |
michael@0 | 49 | interruptible: true, |
michael@0 | 50 | sourceURL: null, |
michael@0 | 51 | functionName: null |
michael@0 | 52 | }, |
michael@0 | 53 | { |
michael@0 | 54 | interruptible: true, |
michael@0 | 55 | sourceURL: null, |
michael@0 | 56 | functionName: null |
michael@0 | 57 | }, |
michael@0 | 58 | ]; |
michael@0 | 59 | |
michael@0 | 60 | let receivedEvents = []; |
michael@0 | 61 | |
michael@0 | 62 | |
michael@0 | 63 | function onReflowActivity(aState, aType, aPacket) |
michael@0 | 64 | { |
michael@0 | 65 | info("packet: " + aPacket.message); |
michael@0 | 66 | receivedEvents.push(aPacket); |
michael@0 | 67 | if (receivedEvents.length == expectedEvents.length) { |
michael@0 | 68 | checkEvents(); |
michael@0 | 69 | finish(aState); |
michael@0 | 70 | } |
michael@0 | 71 | } |
michael@0 | 72 | |
michael@0 | 73 | function checkEvents() { |
michael@0 | 74 | for (let i = 0; i < expectedEvents.length; i++) { |
michael@0 | 75 | let a = expectedEvents[i]; |
michael@0 | 76 | let b = receivedEvents[i]; |
michael@0 | 77 | for (let key in a) { |
michael@0 | 78 | is(a[key], b[key], "field " + key + " is valid"); |
michael@0 | 79 | } |
michael@0 | 80 | } |
michael@0 | 81 | } |
michael@0 | 82 | |
michael@0 | 83 | function finish(aState) { |
michael@0 | 84 | client.removeListener("reflowActivity", onReflowActivity); |
michael@0 | 85 | closeDebugger(aState, function() { |
michael@0 | 86 | SimpleTest.finish(); |
michael@0 | 87 | }); |
michael@0 | 88 | } |
michael@0 | 89 | |
michael@0 | 90 | addEventListener("load", startTest); |
michael@0 | 91 | |
michael@0 | 92 | </script> |
michael@0 | 93 | </body> |
michael@0 | 94 | </html> |