toolkit/mozapps/extensions/test/xpcshell/test_bug740612.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 /* Any copyright is dedicated to the Public Domain.
michael@0 2 * http://creativecommons.org/publicdomain/zero/1.0/
michael@0 3 */
michael@0 4
michael@0 5 // This verifies that attempts to override the global values fails but doesn't
michael@0 6 // destroy the world with it
michael@0 7 createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
michael@0 8
michael@0 9 const profileDir = gProfD.clone();
michael@0 10 profileDir.append("extensions");
michael@0 11
michael@0 12 function getActiveVersion() {
michael@0 13 return Services.prefs.getIntPref("bootstraptest.active_version");
michael@0 14 }
michael@0 15
michael@0 16 function getInstalledVersion() {
michael@0 17 return Services.prefs.getIntPref("bootstraptest.installed_version");
michael@0 18 }
michael@0 19
michael@0 20 function run_test() {
michael@0 21 do_test_pending();
michael@0 22
michael@0 23 manuallyInstall(do_get_addon("test_bug740612_1"), profileDir,
michael@0 24 "bug740612_1@tests.mozilla.org");
michael@0 25 manuallyInstall(do_get_addon("test_bug740612_2"), profileDir,
michael@0 26 "bug740612_2@tests.mozilla.org");
michael@0 27
michael@0 28 startupManager();
michael@0 29
michael@0 30 AddonManager.getAddonsByIDs(["bug740612_1@tests.mozilla.org",
michael@0 31 "bug740612_2@tests.mozilla.org"],
michael@0 32 function([a1, a2]) {
michael@0 33 do_check_neq(a1, null);
michael@0 34 do_check_neq(a2, null);
michael@0 35 do_check_eq(getInstalledVersion(), "1.0");
michael@0 36 do_check_eq(getActiveVersion(), "1.0");
michael@0 37
michael@0 38 do_execute_soon(do_test_finished);
michael@0 39 });
michael@0 40 }

mercurial