toolkit/mozapps/extensions/test/xpcshell/test_bug514327_1.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/. */
     5 const Cc = Components.classes;
     6 const Ci = Components.interfaces;
     8 const nsIBLS = Ci.nsIBlocklistService;
    10 var PLUGINS = [{
    11   // blocklisted - default severity
    12   name: "test_bug514327_1",
    13   version: "5",
    14   disabled: false,
    15   blocklisted: false
    16 },
    17 {
    18   // outdated - severity of "0"
    19   name: "test_bug514327_2",
    20   version: "5",
    21   disabled: false,
    22   blocklisted: false
    23 },
    24 {
    25   // outdated - severity of "0"
    26   name: "test_bug514327_3",
    27   version: "5",
    28   disabled: false,
    29   blocklisted: false
    30 },
    31 {
    32   // not blocklisted, not outdated
    33   name: "test_bug514327_4",
    34   version: "5",
    35   disabled: false,
    36   blocklisted: false,
    37   outdated: false
    38 }];
    41 function run_test() {
    42   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
    44   copyBlocklistToProfile(do_get_file("data/test_bug514327_1.xml"));
    46   var blocklist = Cc["@mozilla.org/extensions/blocklist;1"].getService(nsIBLS);
    48   // blocked (sanity check)
    49   do_check_true(blocklist.getPluginBlocklistState(PLUGINS[0], "1", "1.9") == nsIBLS.STATE_BLOCKED);
    51   // outdated
    52   do_check_true(blocklist.getPluginBlocklistState(PLUGINS[1], "1", "1.9") == nsIBLS.STATE_OUTDATED);
    54   // outdated
    55   do_check_true(blocklist.getPluginBlocklistState(PLUGINS[2], "1", "1.9") == nsIBLS.STATE_OUTDATED);
    57   // not blocked
    58   do_check_true(blocklist.getPluginBlocklistState(PLUGINS[3], "1", "1.9") == nsIBLS.STATE_NOT_BLOCKED);
    59 }

mercurial