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.
2 "use strict";
4 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
5 Cu.import('resource://gre/modules/Services.jsm');
6 Cu.import('resource://gre/modules/identity/IdentityUtils.jsm');
8 function test_check_deprecated() {
9 let options = {
10 id: 123,
11 loggedInEmail: "jed@foo.com",
12 pies: 42
13 };
15 do_check_true(checkDeprecated(options, "loggedInEmail"));
16 do_check_false(checkDeprecated(options, "flans"));
18 run_next_test();
19 }
21 function test_check_renamed() {
22 let options = {
23 id: 123,
24 loggedInEmail: "jed@foo.com",
25 pies: 42
26 };
28 checkRenamed(options, "loggedInEmail", "loggedInUser");
30 // It moves loggedInEmail to loggedInUser
31 do_check_false(!!options.loggedInEmail);
32 do_check_eq(options.loggedInUser, "jed@foo.com");
34 run_next_test();
35 }
37 let TESTS = [
38 test_check_deprecated,
39 test_check_renamed
40 ];
42 TESTS.forEach(add_test);
44 function run_test() {
45 run_next_test();
46 }