toolkit/mozapps/extensions/test/xpcshell/test_isDebuggable.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.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
     4  */
     6 var ADDONS = [
     7   "test_bootstrap2_1", // restartless addon
     8   "test_bootstrap1_4", // old-school addon
     9   "test_jetpack"       // sdk addon
    10 ];
    12 var IDS = [
    13   "bootstrap1@tests.mozilla.org",
    14   "bootstrap2@tests.mozilla.org",
    15   "jetpack@tests.mozilla.org"
    16 ];
    18 function run_test() {
    19   do_test_pending();
    21   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2", "2");
    23   startupManager();
    24   AddonManager.checkCompatibility = false;
    26   installAllFiles(ADDONS.map(do_get_addon), function () {
    27     restartManager();
    29     AddonManager.getAddonsByIDs(IDS, function([a1, a2, a3]) {
    30       do_check_eq(a1.isDebuggable, false);
    31       do_check_eq(a2.isDebuggable, true);
    32       do_check_eq(a3.isDebuggable, true);
    33       do_test_finished();
    34     });
    35   }, true);
    36 }

mercurial