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 testForceCheck() {
5 addChromeEventListener("update-available", function(evt) {
6 let update = evt.detail;
7 is(update.displayVersion, "99.0");
8 is(update.isOSUpdate, false);
9 statusSettingIs("check-complete", testDownload);
10 return true;
11 });
12 sendContentEvent("force-update-check");
13 }
15 function testDownload() {
16 let gotStarted = false, gotProgress = false, gotStopped = false;
17 let progress = 0, total = 0;
19 addChromeEventListener("update-download-started", function(evt) {
20 gotStarted = true;
21 return true;
22 });
23 addChromeEventListener("update-download-progress", function(evt) {
24 progress = evt.detail.progress;
25 total = evt.detail.total;
26 gotProgress = true;
27 if (total == progress) {
28 ok(gotStarted);
29 return true;
30 }
31 return false;
32 });
33 addChromeEventListener("update-download-stopped", function(evt) {
34 is(evt.detail.paused, false);
35 gotStopped = true;
36 ok(gotStarted);
37 ok(gotProgress);
38 return true;
39 });
40 addChromeEventListener("update-downloaded", function(evt) {
41 ok(gotStarted);
42 ok(gotProgress);
43 ok(gotStopped);
44 is(progress, total);
45 return true;
46 });
47 addChromeEventListener("update-prompt-apply", function(evt) {
48 let update = evt.detail;
49 is(update.displayVersion, "99.0");
50 is(update.isOSUpdate, false);
51 cleanUp();
52 });
53 sendContentEvent("update-available-result", {
54 result: "download"
55 });
56 }
58 function testApplied() {
59 let updateFile = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
60 updateFile.initWithPath("/system/b2g/update_test/UpdateTestAddFile");
61 ok(updateFile.exists());
62 cleanUp();
63 }
65 // Update lifecycle callbacks
66 function preUpdate() {
67 testForceCheck();
68 }
70 function postUpdate() {
71 testApplied();
72 }