toolkit/mozapps/extensions/test/xpcshell/test_bug470377_2.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

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 var ADDONS = [
michael@0 10 "test_bug470377_1",
michael@0 11 "test_bug470377_2",
michael@0 12 "test_bug470377_3",
michael@0 13 "test_bug470377_4",
michael@0 14 "test_bug470377_5",
michael@0 15 ];
michael@0 16
michael@0 17 Components.utils.import("resource://testing-common/httpd.js");
michael@0 18 var server;
michael@0 19
michael@0 20 function run_test() {
michael@0 21 do_test_pending();
michael@0 22 createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2", "2");
michael@0 23
michael@0 24 server = new HttpServer();
michael@0 25 server.registerDirectory("/", do_get_file("data/test_bug470377"));
michael@0 26 server.start(-1);
michael@0 27
michael@0 28 startupManager();
michael@0 29 AddonManager.checkCompatibility = false;
michael@0 30
michael@0 31 installAllFiles([do_get_addon(a) for each (a in ADDONS)], function() {
michael@0 32 restartManager();
michael@0 33
michael@0 34 AddonManager.getAddonsByIDs(["bug470377_1@tests.mozilla.org",
michael@0 35 "bug470377_2@tests.mozilla.org",
michael@0 36 "bug470377_3@tests.mozilla.org",
michael@0 37 "bug470377_4@tests.mozilla.org",
michael@0 38 "bug470377_5@tests.mozilla.org"],
michael@0 39 function([a1, a2, a3, a4, a5]) {
michael@0 40 do_check_eq(a1, null);
michael@0 41 do_check_neq(a2, null);
michael@0 42 do_check_neq(a3, null);
michael@0 43 do_check_neq(a4, null);
michael@0 44 do_check_neq(a5, null);
michael@0 45
michael@0 46 server.stop(do_test_finished);
michael@0 47 });
michael@0 48 }, true);
michael@0 49 }

mercurial