--- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm
@@ -4996,32 +4996,16 @@ AddonInternal.prototype = {
targetApp.maxVersion = updateTarget.maxVersion;
}
}
}
this.appDisabled = !isUsableAddon(this);
},
/**
- * getDataDirectory tries to execute the callback with two arguments:
- * 1) the path of the data directory within the profile,
- * 2) any exception generated from trying to build it.
- */
- getDataDirectory(callback) {
- let parentPath = OS.Path.join(OS.Constants.Path.profileDir, "extension-data");
- let dirPath = OS.Path.join(parentPath, this.id);
-
- (async function() {
- await OS.File.makeDir(parentPath, {ignoreExisting: true});
- await OS.File.makeDir(dirPath, {ignoreExisting: true});
- })().then(() => callback(dirPath, null),
- e => callback(dirPath, e));
- },
-
- /**
* toJSON is called by JSON.stringify in order to create a filtered version
* of this object to be serialized to a JSON file. A new object is returned
* with copies of all non-private properties. Functions, getters and setters
* are not copied.
*
* @param aKey
* The key that this object is being serialized as in the JSON.
* Unused here since this is always the main object serialized
@@ -5631,18 +5615,17 @@ function defineAddonWrapperProperty(name
enumerable: true,
});
}
["id", "syncGUID", "version", "isCompatible", "isPlatformCompatible",
"providesUpdatesSecurely", "blocklistState", "blocklistURL", "appDisabled",
"softDisabled", "skinnable", "size", "foreignInstall",
"strictCompatibility", "updateURL", "dependencies",
- "getDataDirectory", "signedState",
- "isCorrectlySigned"].forEach(function(aProp) {
+ "signedState", "isCorrectlySigned"].forEach(function(aProp) {
defineAddonWrapperProperty(aProp, function() {
let addon = addonFor(this);
return (aProp in addon) ? addon[aProp] : undefined;
});
});
["fullDescription", "developerComments", "supportURL",
"contributionURL", "averageRating", "reviewCount",
--- a/toolkit/mozapps/extensions/test/addons/test_data_directory/install.rdf
+++ b/toolkit/mozapps/extensions/test/addons/test_data_directory/install.rdf
@@ -1,16 +1,17 @@
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>datadirectory1@tests.mozilla.org</em:id>
<em:version>1.0</em:version>
+ <em:bootstrap>true</em:bootstrap>
<!-- Front End MetaData -->
<em:name>Test Data Directory 1</em:name>
<em:description>Test Description</em:description>
<em:targetApplication>
<Description>
<em:id>xpcshell@tests.mozilla.org</em:id>
--- a/toolkit/mozapps/extensions/test/addons/test_locale/install.rdf
+++ b/toolkit/mozapps/extensions/test/addons/test_locale/install.rdf
@@ -1,16 +1,17 @@
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>addon1@tests.mozilla.org</em:id>
<em:version>1.0</em:version>
+ <em:bootstrap>true</em:bootstrap>
<em:targetApplication>
<Description>
<em:id>xpcshell@tests.mozilla.org</em:id>
<em:minVersion>1</em:minVersion>
<em:maxVersion>1</em:maxVersion>
</Description>
</em:targetApplication>
index 51b00475a9641ea9d608874a3ab7679da3a4374b..12a13f139bf6f5ef3670ebc66763e32b514c277d
GIT binary patch
literal 463
zc$^FHW@Zs#W?<l8ShKa%hx^eEJ!3`&h8!ja25trhhRnR;lEj=Gy`q$~+@OnohYUn&
z?}uOcm=<KUOkZblLX(Q!42k5P^{t{gIr-DSo%7v)@6ZIJjrq3U=M<mMj5=q%_~i1E
zxX2kxCl^jTS2=0Q`O~7D!XGw&k=>{#k$t=D&b^+sw>O?Fu}Y0R_i4_qEbqVK3tnja
z2%I&cpej-EtV8yj?U$ltcs}XuPQCQz>f$Ntj-h%>?^}c>cQ_uoWoF?m&3-g6RO5rj
zmSt`Yx4iltx84u&3SQA={@^NKitFwuU4x##KX*-%jR-7UbK3c~f%RSG#9ZB~l10y6
zNL4;?(XhN2uw(9#-Mg-3DSvn(aNFgLj!x8Sdl5Z7VZN1a2VWaT$Qv`&cP#pSbp7`u
z97h~-Cah@xmw$nOy@slGI^#*(kSBqQBDh3aF8%OO=y{Uw&;LZ#rlR2W#Ds#4>rx(C
ze|*9o;LXTn&x|W{RTv;Zp<ziQ18P`vF(`ng7#SoO7(V^_vEblkMszyBo0ScshLIr_
JNXIaOcmSi&zZ3uf
--- a/toolkit/mozapps/extensions/test/xpcshell/head_addons.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/head_addons.js
@@ -67,58 +67,32 @@ ChromeUtils.defineModuleGetter(this, "Mo
XPCOMUtils.defineLazyServiceGetter(this, "aomStartup",
"@mozilla.org/addons/addon-manager-startup;1",
"amIAddonManagerStartup");
// Whitelist existing tests that still use non-restartless extensions.
const LEGACY_NON_RESTARTLESS_TESTS = new Set([
"test_AddonRepository.js",
"test_AddonRepository_cache.js",
- "test_backgroundupdate.js",
- "test_bad_json.js",
- "test_blocklist_metadata_filters.js",
- "test_blocklist_prefs.js",
- "test_blocklist_regexp.js",
"test_blocklistchange.js",
"test_bug335238.js",
- "test_bug384052.js",
- "test_bug393285.js",
"test_bug397778.js",
- "test_bug406118.js",
"test_bug425657.js",
- "test_bug449027.js",
"test_bug455906.js",
"test_bug470377_1.js",
"test_bug470377_2.js",
"test_bug470377_3.js",
"test_bug470377_4.js",
- "test_bug566626.js",
- "test_bug569138.js",
"test_bug655254.js",
- "test_bug753900.js",
"test_cacheflush.js",
"test_checkcompatibility.js",
- "test_compatoverrides.js",
- "test_dataDirectory.js",
- "test_distribution.js",
- "test_error.js",
- "test_filepointer.js",
- "test_invalid_install_rdf.js",
- "test_locale.js",
- "test_onPropertyChanged_appDisabled.js",
"test_proxies.js",
- "test_safemode.js",
- "test_sideloads.js",
"test_signed_verify.js",
- "test_softblocked.js",
- "test_sourceURI.js",
"test_strictcompatibility.js",
"test_syncGUID.js",
- "test_updateCancel.js",
- "test_update_compatmode.js",
"test_upgrade.js",
]);
if (LEGACY_NON_RESTARTLESS_TESTS.has(_TEST_FILE[0].replace(/.*\//, ""))) {
Services.prefs.setBoolPref("extensions.legacy.non-restartless.enabled", true);
}
const {
--- a/toolkit/mozapps/extensions/test/xpcshell/test_backgroundupdate.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_backgroundupdate.js
@@ -51,39 +51,42 @@ function run_test_1() {
// Verify that with two add-ons installed both of which claim to have updates
// available we get the notification after both updates attempted to start
function run_test_2() {
writeInstallRDFForExtension({
id: "addon1@tests.mozilla.org",
version: "1.0",
updateURL: "http://localhost:" + gPort + "/data/test_backgroundupdate.json",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "1"
}],
name: "Test Addon 1",
}, profileDir);
writeInstallRDFForExtension({
id: "addon2@tests.mozilla.org",
version: "1.0",
updateURL: "http://localhost:" + gPort + "/data/test_backgroundupdate.json",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "1"
}],
name: "Test Addon 2",
}, profileDir);
writeInstallRDFForExtension({
id: "addon3@tests.mozilla.org",
version: "1.0",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "1"
}],
name: "Test Addon 3",
}, profileDir);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bad_json.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bad_json.js
@@ -4,16 +4,17 @@
// Tests that we rebuild the database correctly if it contains
// JSON data that parses correctly but doesn't contain required fields
var addon1 = {
id: "addon1@tests.mozilla.org",
version: "2.0",
name: "Test 1",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "1"
}]
};
const profileDir = gProfD.clone();
--- a/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_metadata_filters.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_metadata_filters.js
@@ -73,44 +73,47 @@ function run_test() {
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1");
// Should get blocked by name
writeInstallRDFForExtension({
id: "block1@tests.mozilla.org",
version: "1.0",
name: "Mozilla Corp.",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "3"
}]
}, profileDir);
// Should get blocked by all the attributes.
writeInstallRDFForExtension({
id: "block2@tests.mozilla.org",
version: "1.0",
name: "Moz-addon",
+ bootstrap: true,
creator: "Dangerous",
homepageURL: "www.extension.dangerous.com",
updateURL: "www.extension.dangerous.com/update.rdf",
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "3"
}]
}, profileDir);
// Fails to get blocked because of a different ID even though other
// attributes match against a blocklist entry.
writeInstallRDFForExtension({
id: "block3@tests.mozilla.org",
version: "1.0",
name: "Moz-addon",
+ bootstrap: true,
creator: "Dangerous",
homepageURL: "www.extensions.dangerous.com",
updateURL: "www.extension.dangerous.com/update.rdf",
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "3"
}]
--- a/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_prefs.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_prefs.js
@@ -73,27 +73,29 @@ function run_test() {
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1");
// Add 2 extensions
writeInstallRDFForExtension({
id: "block1@tests.mozilla.org",
version: "1.0",
name: "Blocked add-on-1 with to-be-reset prefs",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "3"
}]
}, profileDir);
writeInstallRDFForExtension({
id: "block2@tests.mozilla.org",
version: "1.0",
name: "Blocked add-on-2 with to-be-reset prefs",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "3"
}]
}, profileDir);
// Pre-set the preferences that we expect to get reset.
--- a/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_regexp.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_blocklist_regexp.js
@@ -77,16 +77,17 @@ function run_test() {
do_test_pending();
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1");
writeInstallRDFForExtension({
id: "block1@tests.mozilla.org",
version: "1.0",
name: "RegExp blocked add-on",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "3"
}]
}, profileDir);
startupManager();
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug384052.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug384052.js
@@ -50,16 +50,17 @@ function initTest() {
// Install a test extension into the profile
let dir = gProfD.clone();
dir.append("extensions");
writeInstallRDFForExtension({
id: "test@mozilla.org",
version: "1.0",
name: "Test extension",
+ bootstrap: true,
updateURL: gTestURL,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "1"
}],
}, dir);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug393285.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug393285.js
@@ -85,171 +85,186 @@ function end_test() {
function run_test() {
do_test_pending();
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
writeInstallRDFForExtension({
id: "test_bug393285_1@tests.mozilla.org",
name: "extension 1",
+ bootstrap: true,
version: "1.0",
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "3"
}]
}, profileDir);
writeInstallRDFForExtension({
id: "test_bug393285_2@tests.mozilla.org",
name: "extension 2",
+ bootstrap: true,
version: "1.0",
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "3"
}]
}, profileDir);
writeInstallRDFForExtension({
id: "test_bug393285_3a@tests.mozilla.org",
name: "extension 3a",
+ bootstrap: true,
version: "1.0",
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "3"
}]
}, profileDir);
writeInstallRDFForExtension({
id: "test_bug393285_3b@tests.mozilla.org",
name: "extension 3b",
+ bootstrap: true,
version: "2.0",
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "3"
}]
}, profileDir);
writeInstallRDFForExtension({
id: "test_bug393285_4@tests.mozilla.org",
name: "extension 4",
+ bootstrap: true,
version: "1.0",
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "3"
}]
}, profileDir);
writeInstallRDFForExtension({
id: "test_bug393285_5@tests.mozilla.org",
name: "extension 5",
+ bootstrap: true,
version: "1.0",
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "3"
}]
}, profileDir);
writeInstallRDFForExtension({
id: "test_bug393285_6@tests.mozilla.org",
name: "extension 6",
+ bootstrap: true,
version: "1.0",
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "3"
}]
}, profileDir);
writeInstallRDFForExtension({
id: "test_bug393285_7@tests.mozilla.org",
name: "extension 7",
+ bootstrap: true,
version: "1.0",
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "3"
}]
}, profileDir);
writeInstallRDFForExtension({
id: "test_bug393285_8@tests.mozilla.org",
name: "extension 8",
+ bootstrap: true,
version: "1.0",
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "3"
}]
}, profileDir);
writeInstallRDFForExtension({
id: "test_bug393285_9@tests.mozilla.org",
name: "extension 9",
+ bootstrap: true,
version: "1.0",
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "3"
}]
}, profileDir);
writeInstallRDFForExtension({
id: "test_bug393285_10@tests.mozilla.org",
name: "extension 10",
+ bootstrap: true,
version: "1.0",
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "3"
}]
}, profileDir);
writeInstallRDFForExtension({
id: "test_bug393285_11@tests.mozilla.org",
name: "extension 11",
+ bootstrap: true,
version: "1.0",
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "3"
}]
}, profileDir);
writeInstallRDFForExtension({
id: "test_bug393285_12@tests.mozilla.org",
name: "extension 12",
+ bootstrap: true,
version: "1.0",
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "3"
}]
}, profileDir);
writeInstallRDFForExtension({
id: "test_bug393285_13@tests.mozilla.org",
name: "extension 13",
+ bootstrap: true,
version: "1.0",
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "3"
}]
}, profileDir);
writeInstallRDFForExtension({
id: "test_bug393285_14@tests.mozilla.org",
name: "extension 14",
+ bootstrap: true,
version: "1.0",
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "3"
}]
}, profileDir);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug406118.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug406118.js
@@ -73,50 +73,54 @@ function end_test() {
function run_test() {
do_test_pending();
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
writeInstallRDFForExtension({
id: "test_bug393285_1@tests.mozilla.org",
name: "extension 1",
+ bootstrap: true,
version: "1.0",
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "3"
}]
}, profileDir);
writeInstallRDFForExtension({
id: "test_bug393285_2@tests.mozilla.org",
name: "extension 2",
+ bootstrap: true,
version: "1.0",
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "3"
}]
}, profileDir);
writeInstallRDFForExtension({
id: "test_bug393285_3a@tests.mozilla.org",
name: "extension 3a",
+ bootstrap: true,
version: "1.0",
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "3"
}]
}, profileDir);
writeInstallRDFForExtension({
id: "test_bug393285_4@tests.mozilla.org",
name: "extension 4",
+ bootstrap: true,
version: "1.0",
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "3"
}]
}, profileDir);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug449027.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug449027.js
@@ -279,16 +279,17 @@ MockRegistrar.register("@mozilla.org/emb
function create_addon(addon) {
var installrdf = "<?xml version=\"1.0\"?>\n" +
"\n" +
"<RDF xmlns=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n" +
" xmlns:em=\"http://www.mozilla.org/2004/em-rdf#\">\n" +
" <Description about=\"urn:mozilla:install-manifest\">\n" +
" <em:id>" + addon.id + "</em:id>\n" +
" <em:version>" + addon.version + "</em:version>\n" +
+ " <em:bootstrap>true</em:bootstrap>\n" +
" <em:targetApplication>\n" +
" <Description>\n" +
" <em:id>xpcshell@tests.mozilla.org</em:id>\n" +
" <em:minVersion>3</em:minVersion>\n" +
" <em:maxVersion>3</em:maxVersion>\n" +
" </Description>\n" +
" </em:targetApplication>\n" +
" <em:name>" + addon.name + "</em:name>\n" +
@@ -321,24 +322,16 @@ function check_state(test, lastTest, cal
for (i = 0; i < PLUGINS.length; i++) {
if (PLUGINS[i].blocklisted != PLUGINS[i][test])
do_throw("Blocklist state did not match expected for plugin " + (i + 1) + ", test " + test);
}
if (lastTest) {
var expected = 0;
- for (i = 0; i < ADDONS.length; i++) {
- if (ADDONS[i][test] && !ADDONS[i][lastTest]) {
- if (!gNewBlocks.includes(ADDONS[i].name + " " + ADDONS[i].version))
- do_throw("Addon " + (i + 1) + " should have been listed in the blocklist notification for test " + test);
- expected++;
- }
- }
-
for (i = 0; i < PLUGINS.length; i++) {
if (PLUGINS[i][test] && !PLUGINS[i][lastTest]) {
if (!gNewBlocks.includes(PLUGINS[i].name + " " + PLUGINS[i].version))
do_throw("Plugin " + (i + 1) + " should have been listed in the blocklist notification for test " + test);
expected++;
}
}
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug566626.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug566626.js
@@ -4,16 +4,17 @@
// This verifies that multiple calls to the async API return fully formed
// add-ons
var addon1 = {
id: "addon1@tests.mozilla.org",
version: "1.0",
name: "Test 1",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "1"
}]
};
const profileDir = gProfD.clone();
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug569138.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug569138.js
@@ -5,85 +5,92 @@
// This verifies that add-ons with invalid target application entries show
// up in the API but are correctly appDisabled
// A working add-on
var addon1 = {
id: "addon1@tests.mozilla.org",
version: "1.0",
name: "Test 1",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "1"
}]
};
// Missing id
var addon2 = {
id: "addon2@tests.mozilla.org",
version: "1.0",
name: "Test 2",
+ bootstrap: true,
targetApplications: [{
minVersion: "1",
maxVersion: "2"
}]
};
// Missing minVersion
var addon3 = {
id: "addon3@tests.mozilla.org",
version: "1.0",
name: "Test 3",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
maxVersion: "1"
}]
};
// Missing maxVersion
var addon4 = {
id: "addon4@tests.mozilla.org",
version: "1.0",
name: "Test 4",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1"
}]
};
// Blank id
var addon5 = {
id: "addon5@tests.mozilla.org",
version: "1.0",
name: "Test 5",
+ bootstrap: true,
targetApplications: [{
id: "",
minVersion: "1",
maxVersion: "2"
}]
};
// Blank minVersion
var addon6 = {
id: "addon6@tests.mozilla.org",
version: "1.0",
name: "Test 6",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "",
maxVersion: "1"
}]
};
// Blank maxVersion
var addon7 = {
id: "addon7@tests.mozilla.org",
version: "1.0",
name: "Test 7",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: ""
}]
};
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug753900.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug753900.js
@@ -1,37 +1,15 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
// This verifies that strange characters in an add-on version don't break the
// crash annotation.
-var addon1 = {
- id: "addon1@tests.mozilla.org",
- version: "1,0",
- name: "Test 1",
- targetApplications: [{
- id: "xpcshell@tests.mozilla.org",
- minVersion: "1",
- maxVersion: "1"
- }]
-};
-
-var addon2 = {
- id: "addon2@tests.mozilla.org",
- version: "1:0",
- name: "Test 2",
- targetApplications: [{
- id: "xpcshell@tests.mozilla.org",
- minVersion: "1",
- maxVersion: "1"
- }]
-};
-
var addon3 = {
id: "addon3@tests.mozilla.org",
version: "1,0",
name: "Test 3",
bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
@@ -54,33 +32,25 @@ var addon4 = {
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
const profileDir = gProfD.clone();
profileDir.append("extensions");
function run_test() {
do_test_pending();
- writeInstallRDFForExtension(addon1, profileDir);
- writeInstallRDFForExtension(addon2, profileDir);
writeInstallRDFForExtension(addon3, profileDir);
writeInstallRDFForExtension(addon4, profileDir);
startupManager();
- AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
- "addon2@tests.mozilla.org",
- "addon3@tests.mozilla.org",
+ AddonManager.getAddonsByIDs(["addon3@tests.mozilla.org",
"addon4@tests.mozilla.org"],
- function([a1, a2, a3, a4]) {
+ function([a3, a4]) {
- Assert.notEqual(a1, null);
- do_check_in_crash_annotation(addon1.id, addon1.version);
- Assert.notEqual(a2, null);
- do_check_in_crash_annotation(addon2.id, addon2.version);
Assert.notEqual(a3, null);
do_check_in_crash_annotation(addon3.id, addon3.version);
Assert.notEqual(a4, null);
do_check_in_crash_annotation(addon4.id, addon4.version);
executeSoon(do_test_finished);
});
}
--- a/toolkit/mozapps/extensions/test/xpcshell/test_compatoverrides.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_compatoverrides.js
@@ -191,112 +191,121 @@ Services.prefs.setCharPref(PREF_GETADDON
Services.prefs.setCharPref(PREF_COMPAT_OVERRIDES, `${BASE_URL}/compat.json`);
// Not hosted, no overrides
var addon1 = {
id: "addon1@tests.mozilla.org",
version: "1.0",
name: "Test addon 1",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "1"
}]
};
// Hosted, no overrides
var addon2 = {
id: "addon2@tests.mozilla.org",
version: "1.0",
name: "Test addon 2",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "1"
}]
};
// Hosted, matching override
var addon3 = {
id: "addon3@tests.mozilla.org",
version: "1.0",
name: "Test addon 3",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "1"
}]
};
// Hosted, matching override, wouldn't be compatible if strict checking is enabled
var addon4 = {
id: "addon4@tests.mozilla.org",
version: "1.0",
name: "Test addon 4",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "0.1",
maxVersion: "0.2"
}]
};
// Hosted, app ID doesn't match in override
var addon5 = {
id: "addon5@tests.mozilla.org",
version: "1.0",
name: "Test addon 5",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "1"
}]
};
// Hosted, addon version range doesn't match in override
var addon6 = {
id: "addon6@tests.mozilla.org",
version: "1.0",
name: "Test addon 6",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "1"
}]
};
// Hosted, app version range doesn't match in override
var addon7 = {
id: "addon7@tests.mozilla.org",
version: "1.0",
name: "Test addon 7",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "1"
}]
};
// Hosted, multiple overrides
var addon8 = {
id: "addon8@tests.mozilla.org",
version: "1.0",
name: "Test addon 8",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "1"
}]
};
// Not hosted, matching override
var addon9 = {
id: "addon9@tests.mozilla.org",
version: "1.0",
name: "Test addon 9",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "1"
}]
};
const profileDir = gProfD.clone();
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/test_dataDirectory.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/* 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/.
- */
-
-// Disables security checking our updates which haven't been signed
-Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false);
-
-var ADDON = {
- id: "datadirectory1@tests.mozilla.org",
- addon: "test_data_directory"
-};
-
-function run_test() {
- var expectedDir = gProfD.clone();
- expectedDir.append("extension-data");
- expectedDir.append(ADDON.id);
-
- do_test_pending();
- Assert.ok(!expectedDir.exists());
-
- createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2", "1.9");
- startupManager();
-
- installAllFiles([do_get_addon(ADDON.addon)], function() {
- restartManager();
-
- AddonManager.getAddonByID(ADDON.id, function(item) {
- item.getDataDirectory(promise_callback);
- });
- });
-}
-
-function promise_callback() {
- Assert.equal(arguments.length, 2);
- var expectedDir = gProfD.clone();
- expectedDir.append("extension-data");
- expectedDir.append(ADDON.id);
-
- Assert.equal(arguments[0], expectedDir.path);
- Assert.ok(expectedDir.exists());
- Assert.ok(expectedDir.isDirectory());
-
- Assert.equal(arguments[1], null);
-
- // Cleanup.
- expectedDir.parent.remove(true);
-
- do_test_finished();
-}
--- a/toolkit/mozapps/extensions/test/xpcshell/test_distribution.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_distribution.js
@@ -16,38 +16,41 @@ const distroDir = gProfD.clone();
distroDir.append("distribution");
distroDir.append("extensions");
registerDirectory("XREAppDist", distroDir.parent);
var addon1_1 = {
id: "addon1@tests.mozilla.org",
version: "1.0",
name: "Test version 1",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "5"
}]
};
var addon1_2 = {
id: "addon1@tests.mozilla.org",
version: "2.0",
name: "Test version 2",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "5"
}]
};
var addon1_3 = {
id: "addon1@tests.mozilla.org",
version: "3.0",
name: "Test version 3",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "5"
}]
};
function getActiveVersion() {
--- a/toolkit/mozapps/extensions/test/xpcshell/test_invalid_install_rdf.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_invalid_install_rdf.js
@@ -48,43 +48,65 @@ add_task(async function() {
"chrome.manifest": `
content foo-langpack ./
`,
});
await promiseWriteInstallRDFToXPI({
id: "foo@addons.mozilla.org",
version: "1.0",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "1"
}],
name: "Invalid install.rdf extension",
}, userExtensions, undefined, {
"chrome.manifest": `
content foo ./
`,
});
+ await promiseWriteInstallRDFToXPI({
+ id: "foo-legacy-legacy@addons.mozilla.org",
+ version: "1.0",
+ targetApplications: [{
+ id: "xpcshell@tests.mozilla.org",
+ minVersion: "1",
+ maxVersion: "1"
+ }],
+ name: "Invalid install.rdf extension",
+ }, userExtensions, undefined, {
+ "chrome.manifest": `
+ content foo-legacy-legacy ./
+ `,
+ });
+
equal(hasChromeEntry("foo-langpack"), false,
- "Should not foo-langpack resource before AOM startup");
+ "Should not have registered foo-langpack resource before AOM startup");
+ equal(hasChromeEntry("foo-legacy-legacy"), false,
+ "Should not have registered foo-legacy-legacy resource before AOM startup");
equal(hasChromeEntry("foo"), false,
- "Should not foo resource before AOM startup");
+ "Should not have registered foo resource before AOM startup");
await promiseStartupManager();
equal(hasChromeEntry("foo-langpack"), false,
"Should not have registered chrome manifest for invalid extension");
+ equal(hasChromeEntry("foo-legacy-legacy"), false,
+ "Should not have registered chrome manifest for non-restartless extension");
equal(hasChromeEntry("foo"), true,
"Should have registered chrome manifest for valid extension");
await promiseRestartManager();
equal(hasChromeEntry("foo-langpack"), false,
"Should still not have registered chrome manifest for invalid extension after restart");
+ equal(hasChromeEntry("foo-legacy-legacy"), false,
+ "Should still not have registered chrome manifest for non-restartless extension");
equal(hasChromeEntry("foo"), true,
"Should still have registered chrome manifest for valid extension after restart");
await promiseShutdownManager();
userAppDir.remove(true);
});
--- a/toolkit/mozapps/extensions/test/xpcshell/test_locale.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_locale.js
@@ -17,17 +17,18 @@ function run_test() {
// Tests that the localized properties are visible before installation
function run_test_1() {
AddonManager.getInstallForFile(do_get_addon("test_locale"), function(install) {
Assert.equal(install.addon.name, "fr-FR Name");
Assert.equal(install.addon.description, "fr-FR Description");
prepare_test({
"addon1@tests.mozilla.org": [
- "onInstalling"
+ ["onInstalling", false],
+ ["onInstalled", false],
]
}, [
"onInstallStarted",
"onInstallEnded",
], callback_soon(run_test_2));
install.install();
});
}
--- a/toolkit/mozapps/extensions/test/xpcshell/test_onPropertyChanged_appDisabled.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_onPropertyChanged_appDisabled.js
@@ -7,16 +7,17 @@ profileDir.append("extensions");
function run_test() {
do_test_pending();
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
writeInstallRDFForExtension({
id: "addon1@tests.mozilla.org",
version: "1.0",
name: "Test 1",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "0.1",
maxVersion: "0.2"
}]
}, profileDir);
startupManager();
--- a/toolkit/mozapps/extensions/test/xpcshell/test_safemode.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_safemode.js
@@ -8,16 +8,17 @@ ChromeUtils.import("resource://gre/modul
var addon1 = {
id: "addon1@tests.mozilla.org",
version: "1.0",
name: "Test 1",
optionsURL: "chrome://foo/content/options.xul",
aboutURL: "chrome://foo/content/about.xul",
iconURL: "chrome://foo/content/icon.png",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "1"
}]
};
const profileDir = gProfD.clone();
@@ -44,17 +45,17 @@ function run_test() {
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(newa1) {
Assert.notEqual(newa1, null);
Assert.ok(!newa1.isActive);
Assert.ok(!newa1.userDisabled);
Assert.equal(newa1.aboutURL, null);
Assert.equal(newa1.optionsURL, null);
Assert.equal(newa1.iconURL, gIconURL);
- Assert.ok(isExtensionInAddonsList(profileDir, newa1.id));
+ Assert.ok(isExtensionInBootstrappedList(profileDir, newa1.id));
Assert.ok(hasFlag(newa1.permissions, AddonManager.PERM_CAN_DISABLE));
Assert.ok(!hasFlag(newa1.permissions, AddonManager.PERM_CAN_ENABLE));
Assert.equal(newa1.operationsRequiringRestart, AddonManager.OP_NEEDS_RESTART_NONE);
do_check_not_in_crash_annotation(addon1.id, addon1.version);
run_test_1();
});
}));
--- a/toolkit/mozapps/extensions/test/xpcshell/test_sideloads.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_sideloads.js
@@ -24,16 +24,17 @@ async function createWebExtension(detail
await AddonTestUtils.manuallyInstall(xpi);
}
async function createXULExtension(details) {
let xpi = AddonTestUtils.createTempXPIFile({
"install.rdf": {
id: details.id,
name: details.name,
+ bootstrap: true,
version: "0.1",
targetApplications: [{
id: "toolkit@mozilla.org",
minVersion: "0",
maxVersion: "*",
}],
},
});
--- a/toolkit/mozapps/extensions/test/xpcshell/test_softblocked.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_softblocked.js
@@ -68,16 +68,17 @@ function run_test() {
// Tests that an appDisabled add-on that becomes softBlocked remains disabled
// when becoming appEnabled
add_task(async function() {
writeInstallRDFForExtension({
id: "softblock1@tests.mozilla.org",
version: "1.0",
name: "Softblocked add-on",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "2",
maxVersion: "3"
}]
}, profileDir);
startupManager();
--- a/toolkit/mozapps/extensions/test/xpcshell/test_sourceURI.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_sourceURI.js
@@ -10,16 +10,17 @@ const PREF_GETADDONS_CACHE_ENABLED
const PORT = gServer.identity.primaryPort;
const BASE_URL = "http://localhost:" + PORT;
var addon = {
id: "addon@tests.mozilla.org",
version: "1.0",
name: "Test",
+ bootstrap: true,
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "1"
}]
};
const profileDir = gProfD.clone();
--- a/toolkit/mozapps/extensions/test/xpcshell/test_updateCancel.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_updateCancel.js
@@ -54,16 +54,17 @@ testserver.registerDirectory("/addons/",
testserver.registerPathHandler("/data/test_update.json", dataHandler);
testserver.start(-1);
gPort = testserver.identity.primaryPort;
// Set up an add-on for update check
writeInstallRDFForExtension({
id: "addon1@tests.mozilla.org",
version: "1.0",
+ bootstrap: true,
updateURL: "http://localhost:" + gPort + "/data/test_update.json",
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "1"
}],
name: "Test Addon 1",
}, profileDir);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_update_compatmode.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_update_compatmode.js
@@ -23,53 +23,57 @@ profileDir.append("extensions");
function run_test() {
do_test_pending();
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
writeInstallRDFForExtension({
id: "compatmode-normal@tests.mozilla.org",
version: "1.0",
+ bootstrap: true,
updateURL: "http://localhost:" + gPort + "/data/test_updatecompatmode_%COMPATIBILITY_MODE%.json",
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "1"
}],
name: "Test Addon - normal"
}, profileDir);
writeInstallRDFForExtension({
id: "compatmode-strict@tests.mozilla.org",
version: "1.0",
+ bootstrap: true,
updateURL: "http://localhost:" + gPort + "/data/test_updatecompatmode_%COMPATIBILITY_MODE%.json",
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "1"
}],
name: "Test Addon - strict"
}, profileDir);
writeInstallRDFForExtension({
id: "compatmode-strict-optin@tests.mozilla.org",
version: "1.0",
+ bootstrap: true,
updateURL: "http://localhost:" + gPort + "/data/test_updatecompatmode_%COMPATIBILITY_MODE%.json",
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "1"
}],
name: "Test Addon - strict opt-in",
strictCompatibility: true
}, profileDir);
writeInstallRDFForExtension({
id: "compatmode-ignore@tests.mozilla.org",
version: "1.0",
+ bootstrap: true,
updateURL: "http://localhost:" + gPort + "/data/test_updatecompatmode_%COMPATIBILITY_MODE%.json",
targetApplications: [{
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "1"
}],
name: "Test Addon - ignore",
}, profileDir);
--- a/toolkit/mozapps/extensions/test/xpcshell/xpcshell.ini
+++ b/toolkit/mozapps/extensions/test/xpcshell/xpcshell.ini
@@ -182,17 +182,16 @@ tags = blocklist
[test_bug753900.js]
[test_bug757663.js]
[test_bug953156.js]
[test_checkcompatibility.js]
[test_childprocess.js]
[test_compatoverrides.js]
[test_corrupt.js]
[test_corruptfile.js]
-[test_dataDirectory.js]
[test_db_path.js]
head =
[test_default_providers_pref.js]
[test_dictionary.js]
[test_distribution.js]
[test_duplicateplugins.js]
# Bug 676992: test consistently hangs on Android
skip-if = os == "android"