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 /* Any copyright is dedicated to the Public Domain.
2 * http://creativecommons.org/publicdomain/zero/1.0/ */
4 function runTests() {
5 let crashObserver = bgAddCrashObserver();
7 // make a good capture first - this ensures we have the <browser>
8 let goodUrl = bgTestPageURL();
9 yield bgCapture(goodUrl);
10 ok(thumbnailExists(goodUrl), "Thumbnail should be cached after capture");
11 removeThumbnail(goodUrl);
13 // inject our content script.
14 let mm = bgInjectCrashContentScript();
16 // queue up 2 captures - the first has a wait, so this is the one that
17 // will die. The second one should immediately capture after the crash.
18 let waitUrl = bgTestPageURL({ wait: 30000 });
19 let sawWaitUrlCapture = false;
20 bgCapture(waitUrl, { onDone: () => {
21 sawWaitUrlCapture = true;
22 ok(!thumbnailExists(waitUrl), "Thumbnail should not have been saved due to the crash");
23 }});
24 bgCapture(goodUrl, { onDone: () => {
25 ok(sawWaitUrlCapture, "waitUrl capture should have finished first");
26 ok(thumbnailExists(goodUrl), "We should have recovered and completed the 2nd capture after the crash");
27 removeThumbnail(goodUrl);
28 // Test done.
29 ok(crashObserver.crashed, "Saw a crash from this test");
30 next();
31 }});
33 info("Crashing the thumbnail content process.");
34 mm.sendAsyncMessage("thumbnails-test:crash");
35 yield true;
36 }