modify tests to use a local URL for kinto collection sync
MozReview-Commit-ID: HC4XkbmzY44
--- a/addon-sdk/source/test/preferences/no-connections.json
+++ b/addon-sdk/source/test/preferences/no-connections.json
@@ -23,16 +23,17 @@
"browser.safebrowsing.provider.mozilla.updateURL": "http://localhost/safebrowsing-dummy/update",
"browser.newtabpage.directory.source": "data:application/json,{'jetpack':1}",
"browser.newtabpage.directory.ping": "",
"extensions.update.url": "http://localhost/extensions-dummy/updateURL",
"extensions.update.background.url": "http://localhost/extensions-dummy/updateBackgroundURL",
"extensions.blocklist.url": "http://localhost/extensions-dummy/blocklistURL",
"extensions.webservice.discoverURL": "http://localhost/extensions-dummy/discoveryURL",
"extensions.getAddons.maxResults": 0,
+ "services.kinto.base": "http://localhost/kinto-dummy/v1",
"geo.wifi.uri": "http://localhost/location-dummy/locationURL",
"browser.search.geoip.url": "http://localhost/location-dummy/locationURL",
"browser.search.isUS": true,
"browser.search.countryCode": "US",
"geo.wifi.uri": "http://localhost/extensions-dummy/geowifiURL",
"geo.wifi.scan": false,
"browser.webapps.checkForUpdates": 0,
"identity.fxaccounts.auth.uri": "http://localhost/fxa-dummy/"
--- a/testing/profiles/prefs_general.js
+++ b/testing/profiles/prefs_general.js
@@ -101,16 +101,18 @@ user_pref("extensions.pocket.enabled", f
// Make sure opening about:addons won't hit the network
user_pref("extensions.webservice.discoverURL", "http://%(server)s/extensions-dummy/discoveryURL");
// Make sure AddonRepository won't hit the network
user_pref("extensions.getAddons.maxResults", 0);
user_pref("extensions.getAddons.get.url", "http://%(server)s/extensions-dummy/repositoryGetURL");
user_pref("extensions.getAddons.getWithPerformance.url", "http://%(server)s/extensions-dummy/repositoryGetWithPerformanceURL");
user_pref("extensions.getAddons.search.browseURL", "http://%(server)s/extensions-dummy/repositoryBrowseURL");
user_pref("extensions.getAddons.search.url", "http://%(server)s/extensions-dummy/repositorySearchURL");
+// Ensure kinto updates don't hit the network
+user_pref("services.kinto.base", "http://localhost/dummy-kinto/v1");
// Make sure that opening the plugins check page won't hit the network
user_pref("plugins.update.url", "http://%(server)s/plugins-dummy/updateCheckURL");
// Make sure SNTP requests don't hit the network
user_pref("network.sntp.pools", "%(server)s");
// We know the SNTP request will fail, since localhost isn't listening on
// port 135. The default number of retries (10) is excessive, but retrying
// at least once will mean that codepath is still tested in automation.
user_pref("network.sntp.maxRetryCount", 1);
--- a/toolkit/mozapps/extensions/nsBlocklistService.js
+++ b/toolkit/mozapps/extensions/nsBlocklistService.js
@@ -624,21 +624,24 @@ Blocklist.prototype = {
request.send(null);
// When the blocklist loads we need to compare it to the current copy so
// make sure we have loaded it.
if (!this._isBlocklistLoaded())
this._loadBlocklist();
// If kinto update is enabled, do the kinto update
- if (gPref.getBoolPref(PREF_KINTO_UPDATE_ENABLED, false)) {
+ if (gPref.getBoolPref(PREF_KINTO_UPDATE_ENABLED)) {
let KintoUpdater =
Components.utils.import("resource://services-common/kinto-updater.js",
{});
- KintoUpdater.checkVersions();
+ KintoUpdater.checkVersions().catch(() => {
+ // Before we enable this in release, we want to collect telemetry on
+ // failed kinto updates - see bug 1254099
+ });
}
},
onXMLLoad: Task.async(function*(aEvent) {
let request = aEvent.target;
try {
gCertUtils.checkCert(request.channel);
}
--- a/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_metadata_filters.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_metadata_filters.js
@@ -55,16 +55,18 @@ function load_blocklist(aFile, aCallback
Services.obs.addObserver(function() {
Services.obs.removeObserver(arguments.callee, "blocklist-updated");
do_execute_soon(aCallback);
}, "blocklist-updated", false);
Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" +
gPort + "/data/" + aFile);
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
var blocklist = Cc["@mozilla.org/extensions/blocklist;1"].
getService(Ci.nsITimerCallback);
blocklist.notify(null);
}
function end_test() {
testserver.stop(do_test_finished);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_prefs.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_prefs.js
@@ -61,16 +61,18 @@ function load_blocklist(aFile, aCallback
Services.obs.addObserver(function() {
Services.obs.removeObserver(arguments.callee, "blocklist-updated");
do_execute_soon(aCallback);
}, "blocklist-updated", false);
Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" +
gPort + "/data/" + aFile);
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
var blocklist = Cc["@mozilla.org/extensions/blocklist;1"].
getService(Ci.nsITimerCallback);
blocklist.notify(null);
}
function end_test() {
testserver.stop(do_test_finished);
}
--- a/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_regexp.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_regexp.js
@@ -57,18 +57,21 @@ function load_blocklist(aFile, aCallback
Services.obs.addObserver(function() {
Services.obs.removeObserver(arguments.callee, "blocklist-updated");
do_execute_soon(aCallback);
}, "blocklist-updated", false);
Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" +
gPort + "/data/" + aFile);
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
var blocklist = Cc["@mozilla.org/extensions/blocklist;1"].
getService(Ci.nsITimerCallback);
+ ok(Services.prefs.getBoolPref("services.kinto.update_enabled", false), "I thought this would be set!");
blocklist.notify(null);
}
function end_test() {
testserver.stop(do_test_finished);
}
--- a/toolkit/mozapps/extensions/test/xpcshell/test_blocklistchange.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_blocklistchange.js
@@ -398,16 +398,18 @@ function Pload_blocklist(aFile) {
Services.obs.addObserver(function() {
Services.obs.removeObserver(arguments.callee, "blocklist-updated");
resolve();
}, "blocklist-updated", false);
});
Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" + gPort + "/data/blocklistchange/" + aFile);
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
var blocklist = Cc["@mozilla.org/extensions/blocklist;1"].
getService(Ci.nsITimerCallback);
blocklist.notify(null);
return blocklist_updated;
}
// Does a background update check for add-ons and returns a promise that
// resolves when any started installs complete
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug393285.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug393285.js
@@ -69,16 +69,18 @@ function load_blocklist(aFile, aCallback
Services.obs.addObserver(function() {
Services.obs.removeObserver(arguments.callee, "blocklist-updated");
do_execute_soon(aCallback);
}, "blocklist-updated", false);
Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" +
gPort + "/data/" + aFile);
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
var blocklist = Cc["@mozilla.org/extensions/blocklist;1"].
getService(Ci.nsITimerCallback);
blocklist.notify(null);
}
function end_test() {
testserver.stop(do_test_finished);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug406118.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug406118.js
@@ -57,16 +57,18 @@ function load_blocklist(aFile, aCallback
Services.obs.addObserver(function() {
Services.obs.removeObserver(arguments.callee, "blocklist-updated");
do_execute_soon(aCallback);
}, "blocklist-updated", false);
Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" +
gPort + "/data/" + aFile);
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
var blocklist = Cc["@mozilla.org/extensions/blocklist;1"].
getService(Ci.nsITimerCallback);
blocklist.notify(null);
}
function end_test() {
testserver.stop(do_test_finished);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug430120.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug430120.js
@@ -1,15 +1,16 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
const BLOCKLIST_TIMER = "blocklist-background-update-timer";
const PREF_BLOCKLIST_URL = "extensions.blocklist.url";
+const PREF_KINTO_BASE_URL = "services.kinto.base";
const PREF_BLOCKLIST_ENABLED = "extensions.blocklist.enabled";
const PREF_APP_DISTRIBUTION = "distribution.id";
const PREF_APP_DISTRIBUTION_VERSION = "distribution.version";
const PREF_APP_UPDATE_CHANNEL = "app.update.channel";
const PREF_GENERAL_USERAGENT_LOCALE = "general.useragent.locale";
const CATEGORY_UPDATE_TIMER = "update-timer";
// Get the HTTP server.
@@ -108,16 +109,17 @@ function run_test() {
gBlocklist.observe(null, "profile-after-change", "");
do_check_true(timerService.hasTimer(BLOCKLIST_TIMER));
do_test_pending();
// This should have no effect as the blocklist is disabled
Services.prefs.setCharPref(PREF_BLOCKLIST_URL, "http://localhost:" + gPort + "/1");
+ Services.prefs.setCharPref(PREF_KINTO_BASE_URL, "http://localhost/dummy-kinto/v1")
Services.prefs.setBoolPref(PREF_BLOCKLIST_ENABLED, false);
timerService.fireTimer(BLOCKLIST_TIMER);
// Some values have to be on the default branch to work
var defaults = Services.prefs.QueryInterface(Components.interfaces.nsIPrefService)
.getDefaultBranch(null);
defaults.setCharPref(PREF_APP_UPDATE_CHANNEL, "updatechannel");
defaults.setCharPref(PREF_APP_DISTRIBUTION, "distribution");
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug449027.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug449027.js
@@ -350,16 +350,18 @@ function check_state(test, lastTest, cal
do_check_eq(expected, gNewBlocks.length);
}
do_execute_soon(callback);
});
}
function load_blocklist(file) {
Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" + gPort + "/data/" + file);
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
var blocklist = Components.classes["@mozilla.org/extensions/blocklist;1"]
.getService(Ci.nsITimerCallback);
blocklist.notify(null);
}
function run_test() {
// Setup for test
dump("Setting up tests\n");
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug455906.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug455906.js
@@ -193,16 +193,18 @@ function create_addon(addon) {
FileUtils.MODE_WRONLY | FileUtils.MODE_CREATE | FileUtils.MODE_TRUNCATE,
FileUtils.PERMS_FILE, 0);
stream.write(installrdf, installrdf.length);
stream.close();
}
function load_blocklist(file) {
Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" + gPort + "/data/" + file);
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
var blocklist = Cc["@mozilla.org/extensions/blocklist;1"].
getService(Ci.nsITimerCallback);
blocklist.notify(null);
}
function check_addon_state(addon) {
return addon.userDisabled + "," + addon.softDisabled + "," + addon.appDisabled;
}
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug514327_3.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug514327_3.js
@@ -86,16 +86,18 @@ var WindowWatcher = {
MockRegistrar.register("@mozilla.org/plugin/host;1", PluginHost);
MockRegistrar.register("@mozilla.org/embedcomp/window-watcher;1", WindowWatcher);
function do_update_blocklist(aDatafile, aNextPart) {
gNextTestPart = aNextPart;
gPrefs.setCharPref("extensions.blocklist.url", "http://localhost:" + gPort + "/data/" + aDatafile);
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
gBlocklist.QueryInterface(Ci.nsITimerCallback).notify(null);
}
function run_test() {
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
gTestserver = new HttpServer();
gTestserver.registerDirectory("/data/", do_get_file("data"));
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug619730.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug619730.js
@@ -18,16 +18,18 @@ function load_blocklist(file, aCallback)
Services.obs.addObserver(function() {
Services.obs.removeObserver(arguments.callee, "blocklist-updated");
do_execute_soon(aCallback);
}, "blocklist-updated", false);
Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" +
gPort + "/data/" + file);
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
var blocklist = Cc["@mozilla.org/extensions/blocklist;1"].
getService(Ci.nsITimerCallback);
blocklist.notify(null);
}
var gSawGFX = false;
var gSawTest = false;
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug620837.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug620837.js
@@ -31,16 +31,18 @@ function run_test() {
gTestserver = new HttpServer();
gTestserver.registerPathHandler("/", pathHandler);
gTestserver.start(-1);
gPort = gTestserver.identity.primaryPort;
Services.prefs.setCharPref("extensions.blocklist.url",
"http://localhost:" + gPort +
"/?%PING_COUNT%&%TOTAL_PING_COUNT%&%DAYS_SINCE_LAST_PING%");
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
do_test_pending();
test1();
}
function getNowInSeconds() {
return Math.round(Date.now() / 1000);
}
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Device.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Device.js
@@ -20,16 +20,18 @@ function get_platform() {
var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
.getService(Ci.nsIXULRuntime);
return xulRuntime.OS;
}
function load_blocklist(file) {
Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" +
gPort + "/data/" + file);
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
var blocklist = Cc["@mozilla.org/extensions/blocklist;1"].
getService(Ci.nsITimerCallback);
blocklist.notify(null);
}
// Performs the initial setup
function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_DriverNew.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_DriverNew.js
@@ -20,16 +20,18 @@ function get_platform() {
var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
.getService(Ci.nsIXULRuntime);
return xulRuntime.OS;
}
function load_blocklist(file) {
Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" +
gPort + "/data/" + file);
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
var blocklist = Cc["@mozilla.org/extensions/blocklist;1"].
getService(Ci.nsITimerCallback);
blocklist.notify(null);
}
// Performs the initial setup
function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverNew.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverNew.js
@@ -20,16 +20,18 @@ function get_platform() {
var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
.getService(Ci.nsIXULRuntime);
return xulRuntime.OS;
}
function load_blocklist(file) {
Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" +
gPort + "/data/" + file);
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
var blocklist = Cc["@mozilla.org/extensions/blocklist;1"].
getService(Ci.nsITimerCallback);
blocklist.notify(null);
}
// Performs the initial setup
function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverOld.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverOld.js
@@ -20,16 +20,18 @@ function get_platform() {
var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
.getService(Ci.nsIXULRuntime);
return xulRuntime.OS;
}
function load_blocklist(file) {
Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" +
gPort + "/data/" + file);
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
var blocklist = Cc["@mozilla.org/extensions/blocklist;1"].
getService(Ci.nsITimerCallback);
blocklist.notify(null);
}
// Performs the initial setup
function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_OK.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_OK.js
@@ -20,16 +20,18 @@ function get_platform() {
var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
.getService(Ci.nsIXULRuntime);
return xulRuntime.OS;
}
function load_blocklist(file) {
Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" +
gPort + "/data/" + file);
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
var blocklist = Cc["@mozilla.org/extensions/blocklist;1"].
getService(Ci.nsITimerCallback);
blocklist.notify(null);
}
// Performs the initial setup
function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_DriverOld.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_DriverOld.js
@@ -20,16 +20,18 @@ function get_platform() {
var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
.getService(Ci.nsIXULRuntime);
return xulRuntime.OS;
}
function load_blocklist(file) {
Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" +
gPort + "/data/" + file);
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
var blocklist = Cc["@mozilla.org/extensions/blocklist;1"].
getService(Ci.nsITimerCallback);
blocklist.notify(null);
}
// Performs the initial setup
function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_OK.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_OK.js
@@ -20,16 +20,18 @@ function get_platform() {
var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
.getService(Ci.nsIXULRuntime);
return xulRuntime.OS;
}
function load_blocklist(file) {
Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" +
gPort + "/data/" + file);
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
var blocklist = Cc["@mozilla.org/extensions/blocklist;1"].
getService(Ci.nsITimerCallback);
blocklist.notify(null);
}
// Performs the initial setup
function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_No_Comparison.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_No_Comparison.js
@@ -20,16 +20,18 @@ function get_platform() {
var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
.getService(Ci.nsIXULRuntime);
return xulRuntime.OS;
}
function load_blocklist(file) {
Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" +
gPort + "/data/" + file);
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
var blocklist = Cc["@mozilla.org/extensions/blocklist;1"].
getService(Ci.nsITimerCallback);
blocklist.notify(null);
}
// Performs the initial setup
function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OK.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OK.js
@@ -20,16 +20,18 @@ function get_platform() {
var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
.getService(Ci.nsIXULRuntime);
return xulRuntime.OS;
}
function load_blocklist(file) {
Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" +
gPort + "/data/" + file);
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
var blocklist = Cc["@mozilla.org/extensions/blocklist;1"].
getService(Ci.nsITimerCallback);
blocklist.notify(null);
}
// Performs the initial setup
function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OS.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OS.js
@@ -20,16 +20,18 @@ function get_platform() {
var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
.getService(Ci.nsIXULRuntime);
return xulRuntime.OS;
}
function load_blocklist(file) {
Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" +
gPort + "/data/" + file);
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
var blocklist = Cc["@mozilla.org/extensions/blocklist;1"].
getService(Ci.nsITimerCallback);
blocklist.notify(null);
}
// Performs the initial setup
function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_match.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_match.js
@@ -19,16 +19,18 @@ function get_platform() {
var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
.getService(Ci.nsIXULRuntime);
return xulRuntime.OS;
}
function load_blocklist(file) {
Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" +
gPort + "/data/" + file);
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
var blocklist = Cc["@mozilla.org/extensions/blocklist;1"].
getService(Ci.nsITimerCallback);
blocklist.notify(null);
}
// Performs the initial setup
function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_mismatch_DriverVersion.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_mismatch_DriverVersion.js
@@ -20,16 +20,18 @@ function get_platform() {
var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
.getService(Ci.nsIXULRuntime);
return xulRuntime.OS;
}
function load_blocklist(file) {
Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" +
gPort + "/data/" + file);
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
var blocklist = Cc["@mozilla.org/extensions/blocklist;1"].
getService(Ci.nsITimerCallback);
blocklist.notify(null);
}
// Performs the initial setup
function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_mismatch_OSVersion.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OSVersion_mismatch_OSVersion.js
@@ -20,16 +20,18 @@ function get_platform() {
var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
.getService(Ci.nsIXULRuntime);
return xulRuntime.OS;
}
function load_blocklist(file) {
Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" +
gPort + "/data/" + file);
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
var blocklist = Cc["@mozilla.org/extensions/blocklist;1"].
getService(Ci.nsITimerCallback);
blocklist.notify(null);
}
// Performs the initial setup
function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Vendor.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Vendor.js
@@ -20,16 +20,18 @@ function get_platform() {
var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
.getService(Ci.nsIXULRuntime);
return xulRuntime.OS;
}
function load_blocklist(file) {
Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" +
gPort + "/data/" + file);
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
var blocklist = Cc["@mozilla.org/extensions/blocklist;1"].
getService(Ci.nsITimerCallback);
blocklist.notify(null);
}
// Performs the initial setup
function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Version.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Version.js
@@ -19,16 +19,18 @@ function get_platform() {
var xulRuntime = Cc["@mozilla.org/xre/app-info;1"]
.getService(Ci.nsIXULRuntime);
return xulRuntime.OS;
}
function load_blocklist(file) {
Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" +
gPort + "/data/" + file);
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
var blocklist = Cc["@mozilla.org/extensions/blocklist;1"].
getService(Ci.nsITimerCallback);
blocklist.notify(null);
}
// Performs the initial setup
function run_test() {
var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_prefs.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_prefs.js
@@ -19,16 +19,18 @@ function get_platform() {
var xulRuntime = Components.classes["@mozilla.org/xre/app-info;1"]
.getService(Components.interfaces.nsIXULRuntime);
return xulRuntime.OS;
}
function load_blocklist(file) {
Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" +
gPort + "/data/" + file);
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
var blocklist = Cc["@mozilla.org/extensions/blocklist;1"].
getService(Ci.nsITimerCallback);
blocklist.notify(null);
}
// Performs the initial setup
function run_test() {
try {
--- a/toolkit/mozapps/extensions/test/xpcshell/test_pluginBlocklistCtp.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_pluginBlocklistCtp.js
@@ -92,41 +92,47 @@ function get_test_plugin() {
// so it shouldn't be click-to-play.
function test_is_not_clicktoplay() {
var plugin = get_test_plugin();
var blocklistState = gBlocklistService.getPluginBlocklistState(plugin, "1", "1.9");
do_check_neq(blocklistState, Components.interfaces.nsIBlocklistService.STATE_VULNERABLE_UPDATE_AVAILABLE);
do_check_neq(blocklistState, Components.interfaces.nsIBlocklistService.STATE_VULNERABLE_NO_UPDATE);
Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" + gPort + "/data/test_pluginBlocklistCtpUndo.xml");
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
gNextTest = test_is_clicktoplay;
gNotifier.notify(null);
}
// Here, we've updated the blocklist to have a block for the test plugin,
// so it should be click-to-play.
function test_is_clicktoplay() {
var plugin = get_test_plugin();
var blocklistState = gBlocklistService.getPluginBlocklistState(plugin, "1", "1.9");
do_check_eq(blocklistState, Components.interfaces.nsIBlocklistService.STATE_VULNERABLE_NO_UPDATE);
Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" + gPort + "/data/test_pluginBlocklistCtp.xml");
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
gNextTest = test_is_not_clicktoplay2;
gNotifier.notify(null);
}
// But now we've removed that entry from the blocklist (really we've gone back
// to the old one), so the plugin shouldn't be click-to-play any more.
function test_is_not_clicktoplay2() {
var plugin = get_test_plugin();
var blocklistState = gBlocklistService.getPluginBlocklistState(plugin, "1", "1.9");
do_check_neq(blocklistState, Components.interfaces.nsIBlocklistService.STATE_VULNERABLE_UPDATE_AVAILABLE);
do_check_neq(blocklistState, Components.interfaces.nsIBlocklistService.STATE_VULNERABLE_NO_UPDATE);
Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" + gPort + "/data/test_pluginBlocklistCtpUndo.xml");
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
gNextTest = test_disable_blocklist;
gNotifier.notify(null);
}
// Test that disabling the blocklist when a plugin is ctp-blocklisted will
// result in the plugin not being click-to-play.
function test_disable_blocklist() {
var plugin = get_test_plugin();
@@ -156,25 +162,28 @@ function observer() {
if (gNextTest)
do_execute_soon(gNextTest);
}
function run_test() {
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:" + gPort + "/data/test_pluginBlocklistCtp.xml");
+ Services.prefs.setCharPref("services.kinto.base",
+ "http://localhost/dummy-kinto/v1");
startupManager();
gPluginHost = Components.classes["@mozilla.org/plugin/host;1"].getService(Components.interfaces.nsIPluginHost);
gBlocklistService = Components.classes["@mozilla.org/extensions/blocklist;1"].getService(Components.interfaces.nsIBlocklistService);
gNotifier = Components.classes["@mozilla.org/extensions/blocklist;1"].getService(Components.interfaces.nsITimerCallback);
Services.obs.addObserver(observer, "blocklist-updated", false);
do_register_cleanup(function() {
Services.prefs.clearUserPref("extensions.blocklist.url");
+ Services.prefs.clearUserPref("services.kinto.base");
Services.prefs.clearUserPref("extensions.blocklist.enabled");
Services.prefs.clearUserPref("plugins.click_to_play");
Services.obs.removeObserver(observer, "blocklist-updated");
});
gNextTest = test_basic;
do_test_pending();
gNotifier.notify(null);