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