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 "use strict";
6 const {utils: Cu} = Components;
8 Cu.import("resource://gre/modules/Promise.jsm", this);
9 Cu.import("resource://gre/modules/Services.jsm", this);
10 Cu.import("resource://testing-common/AppData.jsm", this);
12 function run_test() {
13 run_next_test();
14 }
16 add_task(function* test_setup() {
17 do_get_profile();
18 yield makeFakeAppDir();
19 });
21 add_task(function* test_main_process_crash() {
22 let cm = Services.crashmanager;
23 Assert.ok(cm, "CrashManager available.");
25 let basename;
26 let deferred = Promise.defer();
27 do_crash("crashType = CrashTestUtils.CRASH_RUNTIMEABORT;",
28 (minidump, extra) => {
29 basename = minidump.leafName;
30 cm._eventsDirs = [getEventDir()];
31 cm.aggregateEventsFiles().then(deferred.resolve, deferred.reject);
32 },
33 true);
35 let count = yield deferred.promise;
36 Assert.equal(count, 1, "A single crash event file was seen.");
37 let crashes = yield cm.getCrashes();
38 Assert.equal(crashes.length, 1);
39 let crash = crashes[0];
40 Assert.ok(crash.isMainProcessCrash);
41 Assert.equal(crash.id + ".dmp", basename, "ID recorded properly");
42 });