Backed out 4 changesets (bug 1348981) for Linux debug timeouts in test_system_update.js

Backed out changeset b1fe39ea6d5c (bug 1348981)
Backed out changeset 47866f942752 (bug 1348981)
Backed out changeset 5e93d8760487 (bug 1348981)
Backed out changeset 58431e2c37d7 (bug 1348981)

MozReview-Commit-ID: 2WjZKztxyVs
This commit is contained in:
Phil Ringnalda 2017-09-23 06:20:56 -07:00
parent 596a1c503e
commit 216b709c48
23 changed files with 22 additions and 249 deletions

View File

@ -83,7 +83,7 @@ clean clobber repackage::
MAC_BUNDLE_VERSION = $(shell $(PYTHON) $(srcdir)/macversion.py --version=$(MOZ_APP_VERSION) --buildid=$(DEPTH)/buildid.h) MAC_BUNDLE_VERSION = $(shell $(PYTHON) $(srcdir)/macversion.py --version=$(MOZ_APP_VERSION) --buildid=$(DEPTH)/buildid.h)
.PHONY: repackage .PHONY: repackage
tools repackage:: $(DIST)/bin/$(MOZ_APP_NAME) features tools repackage:: $(DIST)/bin/$(MOZ_APP_NAME)
rm -rf $(dist_dest) rm -rf $(dist_dest)
$(MKDIR) -p $(dist_dest)/Contents/MacOS $(MKDIR) -p $(dist_dest)/Contents/MacOS
$(MKDIR) -p $(dist_dest)/$(LPROJ) $(MKDIR) -p $(dist_dest)/$(LPROJ)
@ -104,7 +104,3 @@ ifdef MOZ_UPDATER
endif endif
printf APPLMOZB > $(dist_dest)/Contents/PkgInfo printf APPLMOZB > $(dist_dest)/Contents/PkgInfo
endif endif
.PHONY: features
tools features::
$(PYTHON) -c 'import os, json; listing = {"system": os.listdir("$(DIST)/bin/browser/features")}; print json.dumps(listing)' > $(DIST)/bin/browser/chrome/browser/content/browser/built_in_addons.json

View File

@ -110,9 +110,3 @@ endif
$(TOPOBJDIR)/config/makefiles/xpidl/xpidl: $(addprefix install-,$(filter dist/bin%,$(INSTALL_MANIFESTS))) $(TOPOBJDIR)/config/makefiles/xpidl/xpidl: $(addprefix install-,$(filter dist/bin%,$(INSTALL_MANIFESTS)))
$(TOPOBJDIR)/build/application.ini: $(TOPOBJDIR)/buildid.h $(TOPOBJDIR)/source-repo.h $(TOPOBJDIR)/build/application.ini: $(TOPOBJDIR)/buildid.h $(TOPOBJDIR)/source-repo.h
# The manifest of allowed system add-ons should be re-built when using
# "build faster".
ifeq ($(MOZ_BUILD_APP),browser/app)
default: $(TOPOBJDIR)/browser/app/features
endif

View File

@ -15,7 +15,6 @@ interface nsIClassInfo;
interface nsIComponentManager; interface nsIComponentManager;
interface nsICycleCollectorListener; interface nsICycleCollectorListener;
interface nsIFile; interface nsIFile;
interface nsIURI;
interface nsIJSCID; interface nsIJSCID;
interface nsIJSIID; interface nsIJSIID;
interface nsIPrincipal; interface nsIPrincipal;
@ -702,12 +701,6 @@ interface nsIXPCComponents_Utils : nsISupports
* startup so its contents will be available the next time they're read. * startup so its contents will be available the next time they're read.
*/ */
ACString readFile(in nsIFile file); ACString readFile(in nsIFile file);
/*
* Reads the given local file URL and returns its contents. This has the
* same semantics of readFile.
*/
ACString readURI(in nsIURI url);
}; };
/** /**

View File

@ -83,20 +83,22 @@ URLPreloader::CollectReports(nsIHandleReportCallback* aHandleReport,
return NS_OK; return NS_OK;
} }
URLPreloader& URLPreloader&
URLPreloader::GetSingleton() URLPreloader::GetSingleton()
{ {
if (!sSingleton) { static RefPtr<URLPreloader> singleton;
sSingleton = new URLPreloader();
ClearOnShutdown(&sSingleton); if (!singleton) {
singleton = new URLPreloader();
ClearOnShutdown(&singleton);
} }
return *sSingleton; return *singleton;
} }
bool URLPreloader::sInitialized = false;
StaticRefPtr<URLPreloader> URLPreloader::sSingleton; bool URLPreloader::sInitialized = false;
URLPreloader::URLPreloader() URLPreloader::URLPreloader()
{ {
@ -154,14 +156,6 @@ URLPreloader::InitInternal()
return Ok(); return Ok();
} }
URLPreloader&
URLPreloader::ReInitialize()
{
sSingleton = new URLPreloader();
return *sSingleton;
}
Result<nsCOMPtr<nsIFile>, nsresult> Result<nsCOMPtr<nsIFile>, nsresult>
URLPreloader::GetCacheFile(const nsAString& suffix) URLPreloader::GetCacheFile(const nsAString& suffix)
{ {

View File

@ -96,18 +96,13 @@ private:
static bool sInitialized; static bool sInitialized;
static mozilla::StaticRefPtr<URLPreloader> sSingleton;
protected: protected:
friend class AddonManagerStartup;
friend class ScriptPreloader; friend class ScriptPreloader;
virtual ~URLPreloader(); virtual ~URLPreloader();
Result<Ok, nsresult> WriteCache(); Result<Ok, nsresult> WriteCache();
static URLPreloader& ReInitialize();
// Clear leftover entries after the cache has been written. // Clear leftover entries after the cache has been written.
void Cleanup(); void Cleanup();

View File

@ -3397,15 +3397,6 @@ nsXPCComponents_Utils::ReadFile(nsIFile* aFile, nsACString& aResult)
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP
nsXPCComponents_Utils::ReadURI(nsIURI* aURI, nsACString& aResult)
{
NS_ENSURE_TRUE(aURI, NS_ERROR_INVALID_ARG);
MOZ_TRY_VAR(aResult, URLPreloader::ReadURI(aURI));
return NS_OK;
}
NS_IMETHODIMP NS_IMETHODIMP
nsXPCComponents_Utils::Now(double* aRetval) nsXPCComponents_Utils::Now(double* aRetval)
{ {

View File

@ -37,7 +37,6 @@ function loadSystemAddon() {
loadAddonTestFunctions(); loadAddonTestFunctions();
loadSystemAddon(); loadSystemAddon();
awaitPromise(overrideBuiltIns({ "system": [SYSTEM_ADDON_ID] }));
startupManager(); startupManager();
let engine; let engine;

View File

@ -179,7 +179,7 @@ function wrapWithExceptionHandler(f) {
return wrapper; return wrapper;
} }
async function loadAddonManager(...args) { function loadAddonManager(...args) {
AddonTestUtils.init(gGlobalScope); AddonTestUtils.init(gGlobalScope);
AddonTestUtils.overrideCertDB(); AddonTestUtils.overrideCertDB();
createAppInfo(...args); createAppInfo(...args);
@ -188,8 +188,6 @@ async function loadAddonManager(...args) {
// used by system add-ons. // used by system add-ons.
const distroDir = FileUtils.getDir("ProfD", ["sysfeatures", "app0"], true); const distroDir = FileUtils.getDir("ProfD", ["sysfeatures", "app0"], true);
AddonTestUtils.registerDirectory("XREAppFeat", distroDir); AddonTestUtils.registerDirectory("XREAppFeat", distroDir);
await AddonTestUtils.overrideBuiltIns(
{"system": ["tel-system-xpi@tests.mozilla.org"]});
return AddonTestUtils.promiseStartupManager(); return AddonTestUtils.promiseStartupManager();
} }

View File

@ -858,7 +858,7 @@ add_task(async function setup() {
let system_addon = FileUtils.File(distroDir.path); let system_addon = FileUtils.File(distroDir.path);
system_addon.append("tel-system-xpi@tests.mozilla.org.xpi"); system_addon.append("tel-system-xpi@tests.mozilla.org.xpi");
system_addon.lastModifiedTime = SYSTEM_ADDON_INSTALL_DATE; system_addon.lastModifiedTime = SYSTEM_ADDON_INSTALL_DATE;
await loadAddonManager(APP_ID, APP_NAME, APP_VERSION, PLATFORM_VERSION); loadAddonManager(APP_ID, APP_NAME, APP_VERSION, PLATFORM_VERSION);
// Spoof the persona ID. // Spoof the persona ID.
LightweightThemeManager.currentTheme = LightweightThemeManager.currentTheme =

View File

@ -745,15 +745,6 @@ AddonManagerStartup::Reset()
return NS_OK; return NS_OK;
} }
nsresult
AddonManagerStartup::InitializeURLPreloader()
{
MOZ_RELEASE_ASSERT(xpc::IsInAutomation());
URLPreloader::ReInitialize();
return NS_OK;
}
/****************************************************************************** /******************************************************************************
* RegisterChrome * RegisterChrome

View File

@ -75,13 +75,5 @@ interface amIAddonManagerStartup : nsISupports
* NOT FOR USE OUTSIDE OF UNIT TESTS. * NOT FOR USE OUTSIDE OF UNIT TESTS.
*/ */
void reset(); void reset();
/**
* Initializes the URL Preloader.
*
* NOT FOR USE OUTSIDE OF UNIT TESTS.
*/
void initializeURLPreloader();
}; };

View File

@ -220,7 +220,6 @@ var AddonTestUtils = {
testUnpacked: false, testUnpacked: false,
useRealCertChecks: false, useRealCertChecks: false,
usePrivilegedSignatures: true, usePrivilegedSignatures: true,
aomStartup: null,
init(testScope) { init(testScope) {
this.testScope = testScope; this.testScope = testScope;
@ -1274,28 +1273,6 @@ var AddonTestUtils = {
}); });
}); });
}, },
/**
* Override chrome URL for specifying allowed built-in add-ons.
*
* @param {object} data - An object specifying which add-on IDs are permitted
* to load, for instance: { "system": ["id1", "..."] }
*/
async overrideBuiltIns(data) {
// We need to set this in order load the URL preloader service, which
// is only possible when running in automation.
Services.prefs.setBoolPref(PREF_DISABLE_SECURITY, true);
aomStartup.initializeURLPreloader();
let file = FileUtils.getFile("TmpD", "override.txt");
let manifest = Services.io.newFileURI(file);
await OS.File.writeAtomic(file.path,
new TextEncoder().encode(JSON.stringify(data)));
this.aomStartup = aomStartup.registerChrome(manifest, [
["override", "chrome://browser/content/built_in_addons.json",
Services.io.newFileURI(file).spec],
]);
}
}; };
for (let [key, val] of Object.entries(AddonTestUtils)) { for (let [key, val] of Object.entries(AddonTestUtils)) {

View File

@ -102,9 +102,6 @@ const PREF_EM_MIN_COMPAT_PLATFORM_VERSION = "extensions.minCompatiblePlatformVer
const PREF_EM_HOTFIX_ID = "extensions.hotfix.id"; const PREF_EM_HOTFIX_ID = "extensions.hotfix.id";
const PREF_EM_LAST_APP_BUILD_ID = "extensions.lastAppBuildId"; const PREF_EM_LAST_APP_BUILD_ID = "extensions.lastAppBuildId";
// Specify a list of valid built-in add-ons to load.
const BUILT_IN_ADDONS_URI = "chrome://browser/content/built_in_addons.json";
const OBSOLETE_PREFERENCES = [ const OBSOLETE_PREFERENCES = [
"extensions.bootstrappedAddons", "extensions.bootstrappedAddons",
"extensions.enabledAddons", "extensions.enabledAddons",
@ -2042,18 +2039,6 @@ this.XPIProvider = {
XPIProvider.installLocationsByName[location.name] = location; XPIProvider.installLocationsByName[location.name] = location;
} }
function addBuiltInInstallLocation(name, key, paths, scope) {
try {
let dir = FileUtils.getDir(key, paths);
let location = new BuiltInInstallLocation(name, dir, scope);
XPIProvider.installLocations.push(location);
XPIProvider.installLocationsByName[location.name] = location;
} catch (e) {
logger.warn(`Failed to add built-in install location ${name}`, e);
}
}
function addSystemAddonInstallLocation(aName, aKey, aPaths, aScope) { function addSystemAddonInstallLocation(aName, aKey, aPaths, aScope) {
try { try {
var dir = FileUtils.getDir(aKey, aPaths); var dir = FileUtils.getDir(aKey, aPaths);
@ -2122,8 +2107,8 @@ this.XPIProvider = {
[DIR_SYSTEM_ADDONS], [DIR_SYSTEM_ADDONS],
AddonManager.SCOPE_PROFILE); AddonManager.SCOPE_PROFILE);
addBuiltInInstallLocation(KEY_APP_SYSTEM_DEFAULTS, KEY_APP_FEATURES, addDirectoryInstallLocation(KEY_APP_SYSTEM_DEFAULTS, KEY_APP_FEATURES,
[], AddonManager.SCOPE_PROFILE); [], AddonManager.SCOPE_PROFILE, true);
if (enabledScopes & AddonManager.SCOPE_USER) { if (enabledScopes & AddonManager.SCOPE_USER) {
addDirectoryInstallLocation(KEY_APP_SYSTEM_USER, "XREUSysExt", addDirectoryInstallLocation(KEY_APP_SYSTEM_USER, "XREUSysExt",
@ -6462,49 +6447,6 @@ class MutableDirectoryInstallLocation extends DirectoryInstallLocation {
} }
} }
/**
* An object which identifies a built-in install location for add-ons, such
* as default system add-ons.
*
* This location should point either to an omni jar, or a directory in a local build.
*/
class BuiltInInstallLocation extends DirectoryInstallLocation {
/**
* Read the manifest of allowed add-ons and build a mapping between ID and URI
* for each.
*/
_readAddons() {
let manifest;
try {
let url = Services.io.newURI(BUILT_IN_ADDONS_URI);
let data = Cu.readURI(url);
manifest = JSON.parse(data);
} catch (e) {
logger.warn("List of valid built-in add-ons could not be parsed.", e);
return;
}
if (!("system" in manifest)) {
logger.warn("No list of valid system add-ons found.");
return;
}
for (let id of manifest.system) {
let file = new FileUtils.File(this._directory.path);
file.append(`${id}.xpi`);
// Only attempt to load unpacked directory if unofficial build.
if (!AppConstants.MOZILLA_OFFICIAL && !file.exists()) {
file = new FileUtils.File(this._directory.path);
file.append(`${id}`);
}
this._IDToFileMap[id] = file;
XPIProvider._addURIMapping(id, file);
}
}
}
/** /**
* An object which identifies a directory install location for system add-ons * An object which identifies a directory install location for system add-ons
* updates. * updates.

View File

@ -24,8 +24,6 @@ const PREF_SYSTEM_ADDON_SET = "extensions.systemAddonSet";
const PREF_SYSTEM_ADDON_UPDATE_URL = "extensions.systemAddon.update.url"; const PREF_SYSTEM_ADDON_UPDATE_URL = "extensions.systemAddon.update.url";
const PREF_APP_UPDATE_ENABLED = "app.update.enabled"; const PREF_APP_UPDATE_ENABLED = "app.update.enabled";
const PREF_ALLOW_NON_MPC = "extensions.allow-non-mpc-extensions"; const PREF_ALLOW_NON_MPC = "extensions.allow-non-mpc-extensions";
const PREF_DISABLE_SECURITY = ("security.turn_off_all_security_so_that_" +
"viruses_can_take_over_this_computer");
// Forcibly end the test if it runs longer than 15 minutes // Forcibly end the test if it runs longer than 15 minutes
const TIMEOUT_MS = 900000; const TIMEOUT_MS = 900000;
@ -76,7 +74,6 @@ const {
createUpdateRDF, createUpdateRDF,
getFileForAddon, getFileForAddon,
manuallyUninstall, manuallyUninstall,
overrideBuiltIns,
promiseAddonEvent, promiseAddonEvent,
promiseCompleteAllInstalls, promiseCompleteAllInstalls,
promiseCompleteInstall, promiseCompleteInstall,
@ -162,7 +159,6 @@ const promiseAddonByID = AddonManager.getAddonByID;
const promiseAddonsByIDs = AddonManager.getAddonsByIDs; const promiseAddonsByIDs = AddonManager.getAddonsByIDs;
const promiseAddonsWithOperationsByTypes = AddonManager.getAddonsWithOperationsByTypes; const promiseAddonsWithOperationsByTypes = AddonManager.getAddonsWithOperationsByTypes;
let gStartup = null;
var gPort = null; var gPort = null;
var gUrlToFileMap = {}; var gUrlToFileMap = {};
@ -1533,14 +1529,12 @@ async function setupSystemAddonConditions(setup, distroDir) {
do_print("Clearing existing database."); do_print("Clearing existing database.");
Services.prefs.clearUserPref(PREF_SYSTEM_ADDON_SET); Services.prefs.clearUserPref(PREF_SYSTEM_ADDON_SET);
distroDir.leafName = "empty"; distroDir.leafName = "empty";
await overrideBuiltIns({ "system": ["system1@tests.mozilla.org", "system2@tests.mozilla.org", "system3@tests.mozilla.org", "system4@tests.mozilla.org", "system5@tests.mozilla.org"] });
startupManager(false); startupManager(false);
await promiseShutdownManager(); await promiseShutdownManager();
do_print("Setting up conditions."); do_print("Setting up conditions.");
await setup.setup(); await setup.setup();
await overrideBuiltIns({ "system": ["system1@tests.mozilla.org", "system2@tests.mozilla.org", "system3@tests.mozilla.org", "system4@tests.mozilla.org", "system5@tests.mozilla.org"] });
startupManager(false); startupManager(false);
// Make sure the initial state is correct // Make sure the initial state is correct
@ -1586,9 +1580,7 @@ async function verifySystemAddonState(initialState, finalState = undefined, alre
await checkInstalledSystemAddons(...finalState, distroDir); await checkInstalledSystemAddons(...finalState, distroDir);
// Check that the new state is active after a restart // Check that the new state is active after a restart
shutdownManager(); await promiseRestartManager();
await overrideBuiltIns({ "system": ["system1@tests.mozilla.org", "system2@tests.mozilla.org", "system3@tests.mozilla.org", "system4@tests.mozilla.org", "system5@tests.mozilla.org"] });
await promiseStartupManager();
await checkInstalledSystemAddons(finalState, distroDir); await checkInstalledSystemAddons(finalState, distroDir);
} }

View File

@ -18,7 +18,7 @@ createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "42");
// normal add-ons can be user disabled. // normal add-ons can be user disabled.
add_task(async function() { add_task(async function() {
writeInstallRDFToXPI({ writeInstallRDFToDir({
id: NORMAL_ID, id: NORMAL_ID,
version: "1.0", version: "1.0",
bootstrap: true, bootstrap: true,
@ -62,7 +62,7 @@ add_task(async function() {
// system add-ons can never be user disabled. // system add-ons can never be user disabled.
add_task(async function() { add_task(async function() {
writeInstallRDFToXPI({ writeInstallRDFToDir({
id: SYSTEM_ID, id: SYSTEM_ID,
version: "1.0", version: "1.0",
bootstrap: true, bootstrap: true,
@ -74,8 +74,6 @@ add_task(async function() {
name: "Test disabling hidden add-ons, hidden system add-on case.", name: "Test disabling hidden add-ons, hidden system add-on case.",
}, distroDir, SYSTEM_ID); }, distroDir, SYSTEM_ID);
await overrideBuiltIns({ "system": [SYSTEM_ID] });
startupManager(); startupManager();
let addon = await promiseAddonByID(SYSTEM_ID); let addon = await promiseAddonByID(SYSTEM_ID);

View File

@ -1,48 +0,0 @@
// Tests that only allowed built-in system add-ons are loaded on startup.
BootstrapMonitor.init();
// Build the test set
var distroDir = FileUtils.getDir("ProfD", ["sysfeatures"], true);
do_get_file("data/system_addons/system1_1.xpi").copyTo(distroDir, "system1@tests.mozilla.org.xpi");
do_get_file("data/system_addons/system2_1.xpi").copyTo(distroDir, "system2@tests.mozilla.org.xpi");
do_get_file("data/system_addons/system3_1.xpi").copyTo(distroDir, "system3@tests.mozilla.org.xpi");
registerDirectory("XREAppFeat", distroDir);
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "0");
// Ensure that only allowed add-ons are loaded.
add_task(async function test_allowed_addons() {
// 1 and 2 are allowed, 3 is not.
let validAddons = { "system": ["system1@tests.mozilla.org", "system2@tests.mozilla.org"]};
await overrideBuiltIns(validAddons);
await promiseStartupManager();
let addon = await AddonManager.getAddonByID("system1@tests.mozilla.org");
notEqual(addon, null);
addon = await AddonManager.getAddonByID("system2@tests.mozilla.org");
notEqual(addon, null);
addon = await AddonManager.getAddonByID("system3@tests.mozilla.org");
do_check_eq(addon, null);
equal(addon, null);
// 3 is now allowed, 1 and 2 are not.
validAddons = { "system": ["system3@tests.mozilla.org"]};
await overrideBuiltIns(validAddons);
await promiseRestartManager();
addon = await AddonManager.getAddonByID("system1@tests.mozilla.org");
equal(addon, null);
addon = await AddonManager.getAddonByID("system2@tests.mozilla.org");
equal(addon, null);
addon = await AddonManager.getAddonByID("system3@tests.mozilla.org");
notEqual(addon, null);
await promiseShutdownManager();
});

View File

@ -14,6 +14,7 @@ const DEFER_ID = "system_delay_defer@tests.mozilla.org";
const DEFER_ALSO_ID = "system_delay_defer_also@tests.mozilla.org"; const DEFER_ALSO_ID = "system_delay_defer_also@tests.mozilla.org";
const NORMAL_ID = "system1@tests.mozilla.org"; const NORMAL_ID = "system1@tests.mozilla.org";
const TEST_IGNORE_PREF = "delaytest.ignore"; const TEST_IGNORE_PREF = "delaytest.ignore";
const distroDir = FileUtils.getDir("ProfD", ["sysfeatures"], true); const distroDir = FileUtils.getDir("ProfD", ["sysfeatures"], true);
@ -117,8 +118,6 @@ add_task(async function() {
do_get_file("data/system_addons/system_delay_ignore.xpi").copyTo(distroDir, "system_delay_ignore@tests.mozilla.org.xpi"); do_get_file("data/system_addons/system_delay_ignore.xpi").copyTo(distroDir, "system_delay_ignore@tests.mozilla.org.xpi");
do_get_file("data/system_addons/system1_1.xpi").copyTo(distroDir, "system1@tests.mozilla.org.xpi"); do_get_file("data/system_addons/system1_1.xpi").copyTo(distroDir, "system1@tests.mozilla.org.xpi");
await overrideBuiltIns({ "system": [IGNORE_ID, NORMAL_ID] })
startupManager(); startupManager();
let updateList = [ let updateList = [
{ id: IGNORE_ID, version: "2.0", path: "system_delay_ignore_2.xpi" }, { id: IGNORE_ID, version: "2.0", path: "system_delay_ignore_2.xpi" },
@ -182,8 +181,6 @@ add_task(async function() {
do_get_file("data/system_addons/system_delay_complete.xpi").copyTo(distroDir, "system_delay_complete@tests.mozilla.org.xpi"); do_get_file("data/system_addons/system_delay_complete.xpi").copyTo(distroDir, "system_delay_complete@tests.mozilla.org.xpi");
do_get_file("data/system_addons/system1_1.xpi").copyTo(distroDir, "system1@tests.mozilla.org.xpi"); do_get_file("data/system_addons/system1_1.xpi").copyTo(distroDir, "system1@tests.mozilla.org.xpi");
await overrideBuiltIns({ "system": [COMPLETE_ID, NORMAL_ID] })
startupManager(); startupManager();
let updateList = [ let updateList = [
@ -268,8 +265,6 @@ add_task(async function() {
do_get_file("data/system_addons/system_delay_defer.xpi").copyTo(distroDir, "system_delay_defer@tests.mozilla.org.xpi"); do_get_file("data/system_addons/system_delay_defer.xpi").copyTo(distroDir, "system_delay_defer@tests.mozilla.org.xpi");
do_get_file("data/system_addons/system1_1.xpi").copyTo(distroDir, "system1@tests.mozilla.org.xpi"); do_get_file("data/system_addons/system1_1.xpi").copyTo(distroDir, "system1@tests.mozilla.org.xpi");
await overrideBuiltIns({ "system": [DEFER_ID, NORMAL_ID] })
startupManager(); startupManager();
let updateList = [ let updateList = [
@ -359,8 +354,6 @@ add_task(async function() {
do_get_file("data/system_addons/system_delay_defer.xpi").copyTo(distroDir, "system_delay_defer@tests.mozilla.org.xpi"); do_get_file("data/system_addons/system_delay_defer.xpi").copyTo(distroDir, "system_delay_defer@tests.mozilla.org.xpi");
do_get_file("data/system_addons/system_delay_defer_also.xpi").copyTo(distroDir, "system_delay_defer_also@tests.mozilla.org.xpi"); do_get_file("data/system_addons/system_delay_defer_also.xpi").copyTo(distroDir, "system_delay_defer_also@tests.mozilla.org.xpi");
await overrideBuiltIns({ "system": [DEFER_ID, DEFER_ALSO_ID] })
startupManager(); startupManager();
let updateList = [ let updateList = [

View File

@ -30,8 +30,6 @@ add_task(async function test_app_addons() {
do_throw("Unexpected request to server."); do_throw("Unexpected request to server.");
}); });
awaitPromise(overrideBuiltIns({ "system": ["system1@tests.mozilla.org", "system2@tests.mozilla.org", "system3@tests.mozilla.org"] }))
startupManager(); startupManager();
await new Promise((resolve) => { await new Promise((resolve) => {

View File

@ -95,7 +95,6 @@ async function check_installed(conditions) {
// Test with a missing features directory // Test with a missing features directory
add_task(async function test_missing_app_dir() { add_task(async function test_missing_app_dir() {
await overrideBuiltIns({ "system": ["system1@tests.mozilla.org", "system2@tests.mozilla.org", "system3@tests.mozilla.org", "system5@tests.mozilla.org"] });
startupManager(); startupManager();
let conditions = [ let conditions = [
@ -115,7 +114,6 @@ add_task(async function test_missing_app_dir() {
add_task(async function test_new_version() { add_task(async function test_new_version() {
gAppInfo.version = "1"; gAppInfo.version = "1";
distroDir.leafName = "app1"; distroDir.leafName = "app1";
await overrideBuiltIns({ "system": ["system1@tests.mozilla.org", "system2@tests.mozilla.org", "system3@tests.mozilla.org", "system5@tests.mozilla.org"] });
startupManager(); startupManager();
let conditions = [ let conditions = [
@ -135,7 +133,6 @@ add_task(async function test_new_version() {
add_task(async function test_upgrade() { add_task(async function test_upgrade() {
gAppInfo.version = "2"; gAppInfo.version = "2";
distroDir.leafName = "app2"; distroDir.leafName = "app2";
await overrideBuiltIns({ "system": ["system1@tests.mozilla.org", "system2@tests.mozilla.org", "system3@tests.mozilla.org", "system5@tests.mozilla.org"] });
startupManager(); startupManager();
let conditions = [ let conditions = [
@ -155,7 +152,6 @@ add_task(async function test_upgrade() {
add_task(async function test_downgrade() { add_task(async function test_downgrade() {
gAppInfo.version = "1"; gAppInfo.version = "1";
distroDir.leafName = "app1"; distroDir.leafName = "app1";
await overrideBuiltIns({ "system": ["system1@tests.mozilla.org", "system2@tests.mozilla.org", "system3@tests.mozilla.org", "system5@tests.mozilla.org"] });
startupManager(); startupManager();
let conditions = [ let conditions = [
@ -199,7 +195,6 @@ add_task(async function test_updated() {
}; };
Services.prefs.setCharPref(PREF_SYSTEM_ADDON_SET, JSON.stringify(addonSet)); Services.prefs.setCharPref(PREF_SYSTEM_ADDON_SET, JSON.stringify(addonSet));
await overrideBuiltIns({ "system": ["system1@tests.mozilla.org", "system2@tests.mozilla.org", "system3@tests.mozilla.org", "system5@tests.mozilla.org"] });
startupManager(false); startupManager(false);
let conditions = [ let conditions = [
@ -217,7 +212,6 @@ add_task(async function test_updated() {
// default system add-ons // default system add-ons
add_task(async function safe_mode_disabled() { add_task(async function safe_mode_disabled() {
gAppInfo.inSafeMode = true; gAppInfo.inSafeMode = true;
await overrideBuiltIns({ "system": ["system1@tests.mozilla.org", "system2@tests.mozilla.org", "system3@tests.mozilla.org", "system5@tests.mozilla.org"] });
startupManager(false); startupManager(false);
let conditions = [ let conditions = [
@ -234,7 +228,6 @@ add_task(async function safe_mode_disabled() {
// Leaving safe mode should re-enable the updated system add-ons // Leaving safe mode should re-enable the updated system add-ons
add_task(async function normal_mode_enabled() { add_task(async function normal_mode_enabled() {
gAppInfo.inSafeMode = false; gAppInfo.inSafeMode = false;
await overrideBuiltIns({ "system": ["system1@tests.mozilla.org", "system2@tests.mozilla.org", "system3@tests.mozilla.org", "system5@tests.mozilla.org"] });
startupManager(false); startupManager(false);
let conditions = [ let conditions = [
@ -254,7 +247,6 @@ add_task(async function test_skips_additional() {
let file = do_get_file("data/system_addons/system4_1.xpi"); let file = do_get_file("data/system_addons/system4_1.xpi");
file.copyTo(updatesDir, "system4@tests.mozilla.org.xpi"); file.copyTo(updatesDir, "system4@tests.mozilla.org.xpi");
await overrideBuiltIns({ "system": ["system1@tests.mozilla.org", "system2@tests.mozilla.org", "system3@tests.mozilla.org", "system5@tests.mozilla.org"] });
startupManager(false); startupManager(false);
let conditions = [ let conditions = [
@ -275,7 +267,6 @@ add_task(async function test_revert() {
// With the add-on physically gone from disk we won't see uninstall events // With the add-on physically gone from disk we won't see uninstall events
BootstrapMonitor.clear("system2@tests.mozilla.org"); BootstrapMonitor.clear("system2@tests.mozilla.org");
await overrideBuiltIns({ "system": ["system1@tests.mozilla.org", "system2@tests.mozilla.org", "system3@tests.mozilla.org", "system5@tests.mozilla.org"] });
startupManager(false); startupManager(false);
// With system add-on 2 gone the updated set is now invalid so it reverts to // With system add-on 2 gone the updated set is now invalid so it reverts to
@ -296,7 +287,6 @@ add_task(async function test_reuse() {
let file = do_get_file("data/system_addons/system2_2.xpi"); let file = do_get_file("data/system_addons/system2_2.xpi");
file.copyTo(updatesDir, "system2@tests.mozilla.org.xpi"); file.copyTo(updatesDir, "system2@tests.mozilla.org.xpi");
await overrideBuiltIns({ "system": ["system1@tests.mozilla.org", "system2@tests.mozilla.org", "system3@tests.mozilla.org", "system5@tests.mozilla.org"] });
startupManager(false); startupManager(false);
let conditions = [ let conditions = [
@ -314,7 +304,6 @@ add_task(async function test_reuse() {
add_task(async function test_corrupt_pref() { add_task(async function test_corrupt_pref() {
Services.prefs.setCharPref(PREF_SYSTEM_ADDON_SET, "foo"); Services.prefs.setCharPref(PREF_SYSTEM_ADDON_SET, "foo");
await overrideBuiltIns({ "system": ["system1@tests.mozilla.org", "system2@tests.mozilla.org", "system3@tests.mozilla.org", "system5@tests.mozilla.org"] });
startupManager(false); startupManager(false);
let conditions = [ let conditions = [
@ -351,7 +340,6 @@ add_task(async function test_bad_profile_cert() {
}; };
Services.prefs.setCharPref(PREF_SYSTEM_ADDON_SET, JSON.stringify(addonSet)); Services.prefs.setCharPref(PREF_SYSTEM_ADDON_SET, JSON.stringify(addonSet));
await overrideBuiltIns({ "system": ["system1@tests.mozilla.org", "system2@tests.mozilla.org", "system3@tests.mozilla.org", "system5@tests.mozilla.org"] });
startupManager(false); startupManager(false);
let conditions = [ let conditions = [
@ -369,7 +357,6 @@ add_task(async function test_bad_profile_cert() {
add_task(async function test_bad_app_cert() { add_task(async function test_bad_app_cert() {
gAppInfo.version = "3"; gAppInfo.version = "3";
distroDir.leafName = "app3"; distroDir.leafName = "app3";
await overrideBuiltIns({ "system": ["system1@tests.mozilla.org", "system2@tests.mozilla.org", "system3@tests.mozilla.org", "system5@tests.mozilla.org"] });
startupManager(); startupManager();
// Since we updated the app version, the system addon set should be reset as well. // Since we updated the app version, the system addon set should be reset as well.
@ -420,7 +407,6 @@ add_task(async function test_updated_bad_update_set() {
}; };
Services.prefs.setCharPref(PREF_SYSTEM_ADDON_SET, JSON.stringify(addonSet)); Services.prefs.setCharPref(PREF_SYSTEM_ADDON_SET, JSON.stringify(addonSet));
await overrideBuiltIns({ "system": ["system1@tests.mozilla.org", "system2@tests.mozilla.org", "system3@tests.mozilla.org", "system5@tests.mozilla.org"] });
startupManager(false); startupManager(false);
let conditions = [ let conditions = [
@ -431,3 +417,4 @@ add_task(async function test_updated_bad_update_set() {
await promiseShutdownManager(); await promiseShutdownManager();
}); });

View File

@ -298,7 +298,6 @@ const TESTS = {
add_task(async function setup() { add_task(async function setup() {
// Initialise the profile // Initialise the profile
await overrideBuiltIns({ "system": ["system1@tests.mozilla.org", "system2@tests.mozilla.org", "system3@tests.mozilla.org", "system4@tests.mozilla.org", "system5@tests.mozilla.org"] });
startupManager(); startupManager();
await promiseShutdownManager(); await promiseShutdownManager();
}); });

View File

@ -166,7 +166,6 @@ const TESTS = {
add_task(async function setup() { add_task(async function setup() {
// Initialise the profile // Initialise the profile
await overrideBuiltIns({ "system": ["system1@tests.mozilla.org", "system2@tests.mozilla.org", "system3@tests.mozilla.org", "system4@tests.mozilla.org", "system5@tests.mozilla.org"] });
startupManager(); startupManager();
await promiseShutdownManager(); await promiseShutdownManager();
}); });

View File

@ -1359,14 +1359,12 @@ function check_test_7_cache() {
// Test that the update check returns nothing for addons in locked install // Test that the update check returns nothing for addons in locked install
// locations. // locations.
add_test(async function run_test_locked_install() { add_test(function run_test_locked_install() {
const lockedDir = gProfD.clone(); const lockedDir = gProfD.clone();
lockedDir.append("locked_extensions"); lockedDir.append("locked_extensions");
registerDirectory("XREAppFeat", lockedDir); registerDirectory("XREAppFeat", lockedDir);
restartManager();
await promiseShutdownManager(); writeInstallRDFForExtension({
writeInstallRDFToXPI({
id: "addon13@tests.mozilla.org", id: "addon13@tests.mozilla.org",
version: "1.0", version: "1.0",
updateURL: "http://localhost:" + gPort + "/data/test_update.rdf", updateURL: "http://localhost:" + gPort + "/data/test_update.rdf",
@ -1377,11 +1375,7 @@ add_test(async function run_test_locked_install() {
}], }],
name: "Test Addon 13", name: "Test Addon 13",
}, lockedDir); }, lockedDir);
restartManager();
let validAddons = { "system": ["addon13@tests.mozilla.org"] };
await overrideBuiltIns(validAddons);
await promiseStartupManager();
AddonManager.getAddonByID("addon13@tests.mozilla.org", function(a13) { AddonManager.getAddonByID("addon13@tests.mozilla.org", function(a13) {
do_check_neq(a13, null); do_check_neq(a13, null);

View File

@ -51,6 +51,5 @@ tags = webextensions
[test_system_delay_update.js] [test_system_delay_update.js]
[test_schema_change.js] [test_schema_change.js]
[test_registerchrome.js] [test_registerchrome.js]
[test_system_allowed.js]
[include:xpcshell-shared.ini] [include:xpcshell-shared.ini]