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 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
michael@0 | 4 | */ |
michael@0 | 5 | |
michael@0 | 6 | // Disables security checking our updates which haven't been signed |
michael@0 | 7 | Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false); |
michael@0 | 8 | |
michael@0 | 9 | // Get the HTTP server. |
michael@0 | 10 | Components.utils.import("resource://testing-common/httpd.js"); |
michael@0 | 11 | var testserver; |
michael@0 | 12 | |
michael@0 | 13 | var ADDON = { |
michael@0 | 14 | id: "bug299716-2@tests.mozilla.org", |
michael@0 | 15 | addon: "test_bug299716_2" |
michael@0 | 16 | }; |
michael@0 | 17 | |
michael@0 | 18 | function run_test() { |
michael@0 | 19 | do_test_pending(); |
michael@0 | 20 | |
michael@0 | 21 | createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2", "1.9"); |
michael@0 | 22 | |
michael@0 | 23 | const dataDir = do_get_file("data"); |
michael@0 | 24 | const addonsDir = do_get_addon(ADDON.addon).parent; |
michael@0 | 25 | |
michael@0 | 26 | // Create and configure the HTTP server. |
michael@0 | 27 | testserver = new HttpServer(); |
michael@0 | 28 | testserver.registerDirectory("/addons/", addonsDir); |
michael@0 | 29 | testserver.registerDirectory("/data/", dataDir); |
michael@0 | 30 | testserver.start(4444); |
michael@0 | 31 | |
michael@0 | 32 | startupManager(); |
michael@0 | 33 | |
michael@0 | 34 | installAllFiles([do_get_addon(ADDON.addon)], function() { |
michael@0 | 35 | restartManager(); |
michael@0 | 36 | |
michael@0 | 37 | AddonManager.getAddonByID(ADDON.id, function(item) { |
michael@0 | 38 | do_check_eq(item.version, 0.1); |
michael@0 | 39 | do_check_false(item.isCompatible); |
michael@0 | 40 | |
michael@0 | 41 | item.findUpdates({ |
michael@0 | 42 | onUpdateFinished: function(addon) { |
michael@0 | 43 | do_check_false(item.isCompatible); |
michael@0 | 44 | |
michael@0 | 45 | testserver.stop(do_test_finished); |
michael@0 | 46 | } |
michael@0 | 47 | }, AddonManager.UPDATE_WHEN_USER_REQUESTED); |
michael@0 | 48 | }); |
michael@0 | 49 | }); |
michael@0 | 50 | } |