mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 555942: Name of AddonsManager.getAddons() is misleading/inconsistent. r=robstrong
This commit is contained in:
parent
37faefbc22
commit
735d0220d5
@ -442,15 +442,15 @@ var AddonManagerInternal = {
|
||||
* A callback which will be passed an array of AddonInstalls
|
||||
* @throws if the aCallback argument is not specified
|
||||
*/
|
||||
getInstalls: function AMI_getInstalls(aTypes, aCallback) {
|
||||
getInstallsByTypes: function AMI_getInstallsByTypes(aTypes, aCallback) {
|
||||
if (!aCallback)
|
||||
throw Cr.NS_ERROR_INVALID_ARG;
|
||||
|
||||
let installs = [];
|
||||
|
||||
new AsyncObjectCaller(this.providers, "getInstalls", {
|
||||
new AsyncObjectCaller(this.providers, "getInstallsByTypes", {
|
||||
nextObject: function(aCaller, aProvider) {
|
||||
callProvider(aProvider, "getInstalls", null, aTypes,
|
||||
callProvider(aProvider, "getInstallsByTypes", null, aTypes,
|
||||
function(aProviderInstalls) {
|
||||
installs = installs.concat(aProviderInstalls);
|
||||
aCaller.callNext();
|
||||
@ -463,6 +463,16 @@ var AddonManagerInternal = {
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Asynchronously gets all current AddonInstalls.
|
||||
*
|
||||
* @param aCallback
|
||||
* A callback which will be passed an array of AddonInstalls
|
||||
*/
|
||||
getAllInstalls: function AMI_getAllInstalls(aCallback) {
|
||||
this.getInstallsByTypes(null, aCallback);
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks whether installation is enabled for a particular mimetype.
|
||||
*
|
||||
@ -584,13 +594,13 @@ var AddonManagerInternal = {
|
||||
* The callback to pass the retrieved add-on to
|
||||
* @throws if the aId or aCallback arguments are not specified
|
||||
*/
|
||||
getAddon: function AMI_getAddon(aId, aCallback) {
|
||||
getAddonByID: function AMI_getAddonByID(aId, aCallback) {
|
||||
if (!aId || !aCallback)
|
||||
throw Cr.NS_ERROR_INVALID_ARG;
|
||||
|
||||
new AsyncObjectCaller(this.providers, "getAddon", {
|
||||
new AsyncObjectCaller(this.providers, "getAddonByID", {
|
||||
nextObject: function(aCaller, aProvider) {
|
||||
callProvider(aProvider, "getAddon", null, aId, function(aAddon) {
|
||||
callProvider(aProvider, "getAddonByID", null, aId, function(aAddon) {
|
||||
if (aAddon)
|
||||
safeCall(aCallback, aAddon);
|
||||
else
|
||||
@ -613,7 +623,7 @@ var AddonManagerInternal = {
|
||||
* The callback to pass an array of Addons to
|
||||
* @throws if the aId or aCallback arguments are not specified
|
||||
*/
|
||||
getAddons: function AMI_getAddons(aIds, aCallback) {
|
||||
getAddonsByIDs: function AMI_getAddonsByIDs(aIds, aCallback) {
|
||||
if (!aIds || !aCallback)
|
||||
throw Cr.NS_ERROR_INVALID_ARG;
|
||||
|
||||
@ -621,7 +631,7 @@ var AddonManagerInternal = {
|
||||
|
||||
new AsyncObjectCaller(aIds, null, {
|
||||
nextObject: function(aCaller, aId) {
|
||||
AddonManagerInternal.getAddon(aId, function(aAddon) {
|
||||
AddonManagerInternal.getAddonByID(aId, function(aAddon) {
|
||||
addons.push(aAddon);
|
||||
aCaller.callNext();
|
||||
});
|
||||
@ -663,6 +673,16 @@ var AddonManagerInternal = {
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Asynchronously gets all installed add-ons.
|
||||
*
|
||||
* @param aCallback
|
||||
* A callback which will be passed an array of Addons
|
||||
*/
|
||||
getAllAddons: function AMI_getAllAddons(aCallback) {
|
||||
this.getAddonsByTypes(null, aCallback);
|
||||
},
|
||||
|
||||
/**
|
||||
* Asynchronously gets add-ons that have operations waiting for an application
|
||||
* restart to complete.
|
||||
@ -673,16 +693,16 @@ var AddonManagerInternal = {
|
||||
* The callback to pass the array of Addons to
|
||||
* @throws if the aCallback argument is not specified
|
||||
*/
|
||||
getAddonsWithPendingOperations:
|
||||
function AMI_getAddonsWithPendingOperations(aTypes, aCallback) {
|
||||
getAddonsWithOperationsByTypes:
|
||||
function AMI_getAddonsWithOperationsByTypes(aTypes, aCallback) {
|
||||
if (!aCallback)
|
||||
throw Cr.NS_ERROR_INVALID_ARG;
|
||||
|
||||
let addons = [];
|
||||
|
||||
new AsyncObjectCaller(this.providers, "getAddonsWithPendingOperations", {
|
||||
new AsyncObjectCaller(this.providers, "getAddonsWithOperationsByTypes", {
|
||||
nextObject: function(aCaller, aProvider) {
|
||||
callProvider(aProvider, "getAddonsWithPendingOperations", null, aTypes,
|
||||
callProvider(aProvider, "getAddonsWithOperationsByTypes", null, aTypes,
|
||||
function(aProviderAddons) {
|
||||
addons = addons.concat(aProviderAddons);
|
||||
aCaller.callNext();
|
||||
@ -849,25 +869,33 @@ var AddonManager = {
|
||||
AddonManagerInternal.getInstallForFile(aFile, aCallback, aMimetype);
|
||||
},
|
||||
|
||||
getAddon: function AM_getAddon(aId, aCallback) {
|
||||
AddonManagerInternal.getAddon(aId, aCallback);
|
||||
getAddonByID: function AM_getAddonByID(aId, aCallback) {
|
||||
AddonManagerInternal.getAddonByID(aId, aCallback);
|
||||
},
|
||||
|
||||
getAddons: function AM_getAddons(aIds, aCallback) {
|
||||
AddonManagerInternal.getAddons(aIds, aCallback);
|
||||
getAddonsByIDs: function AM_getAddonsByIDs(aIds, aCallback) {
|
||||
AddonManagerInternal.getAddonsByIDs(aIds, aCallback);
|
||||
},
|
||||
|
||||
getAddonsWithPendingOperations:
|
||||
function AM_getAddonsWithPendingOperations(aTypes, aCallback) {
|
||||
AddonManagerInternal.getAddonsWithPendingOperations(aTypes, aCallback);
|
||||
getAddonsWithOperationsByTypes:
|
||||
function AM_getAddonsWithOperationsByTypes(aTypes, aCallback) {
|
||||
AddonManagerInternal.getAddonsWithOperationsByTypes(aTypes, aCallback);
|
||||
},
|
||||
|
||||
getAddonsByTypes: function AM_getAddonsByTypes(aTypes, aCallback) {
|
||||
AddonManagerInternal.getAddonsByTypes(aTypes, aCallback);
|
||||
},
|
||||
|
||||
getInstalls: function AM_getInstalls(aTypes, aCallback) {
|
||||
AddonManagerInternal.getInstalls(aTypes, aCallback);
|
||||
getAllAddons: function AM_getAllAddons(aCallback) {
|
||||
AddonManagerInternal.getAllAddons(aCallback);
|
||||
},
|
||||
|
||||
getInstallsByTypes: function AM_getInstallsByTypes(aTypes, aCallback) {
|
||||
AddonManagerInternal.getInstallsByTypes(aTypes, aCallback);
|
||||
},
|
||||
|
||||
getAllInstalls: function AM_getAllInstalls(aCallback) {
|
||||
AddonManagerInternal.getAllInstalls(aCallback);
|
||||
},
|
||||
|
||||
isInstallEnabled: function AM_isInstallEnabled(aType) {
|
||||
|
@ -346,7 +346,7 @@ var LightweightThemeManager = {
|
||||
* @param aCallback
|
||||
* A callback to pass the Addon to
|
||||
*/
|
||||
getAddon: function(aId, aCallback) {
|
||||
getAddonByID: function(aId, aCallback) {
|
||||
let id = _getInternalID(aId);
|
||||
if (!id) {
|
||||
aCallback(null);
|
||||
|
@ -86,7 +86,7 @@ var PluginProvider = {
|
||||
* @param aCallback
|
||||
* A callback to pass the Addon to
|
||||
*/
|
||||
getAddon: function PL_getAddon(aId, aCallback) {
|
||||
getAddonByID: function PL_getAddon(aId, aCallback) {
|
||||
if (!this.plugins)
|
||||
this.buildPluginList();
|
||||
|
||||
@ -130,7 +130,7 @@ var PluginProvider = {
|
||||
let results = [];
|
||||
|
||||
for (let id in this.plugins) {
|
||||
this.getAddon(id, function(aAddon) {
|
||||
this.getAddonByID(id, function(aAddon) {
|
||||
results.push(aAddon);
|
||||
});
|
||||
}
|
||||
@ -146,7 +146,7 @@ var PluginProvider = {
|
||||
* @param aCallback
|
||||
* A callback to pass an array of Addons to
|
||||
*/
|
||||
getAddonsWithPendingOperations: function PL_getAddonsWithPendingOperations(aTypes, aCallback) {
|
||||
getAddonsWithOperationsByTypes: function PL_getAddonsWithOperationsByTypes(aTypes, aCallback) {
|
||||
aCallback([]);
|
||||
},
|
||||
|
||||
@ -158,7 +158,7 @@ var PluginProvider = {
|
||||
* @param aCallback
|
||||
* A callback to pass the array of AddonInstalls to
|
||||
*/
|
||||
getInstalls: function PL_getInstalls(aTypes, aCallback) {
|
||||
getInstallsByTypes: function PL_getInstallsByTypes(aTypes, aCallback) {
|
||||
aCallback([]);
|
||||
},
|
||||
|
||||
|
@ -1669,7 +1669,7 @@ var XPIProvider = {
|
||||
* @param aCallback
|
||||
* A callback to pass the Addon to
|
||||
*/
|
||||
getAddon: function XPI_getAddon(aId, aCallback) {
|
||||
getAddonByID: function XPI_getAddonByID(aId, aCallback) {
|
||||
XPIDatabase.getVisibleAddonForID(aId, function(aAddon) {
|
||||
if (aAddon)
|
||||
aCallback(createWrapper(aAddon));
|
||||
@ -1700,8 +1700,8 @@ var XPIProvider = {
|
||||
* @param aCallback
|
||||
* A callback to pass an array of Addons to
|
||||
*/
|
||||
getAddonsWithPendingOperations:
|
||||
function XPI_getAddonsWithPendingOperations(aTypes, aCallback) {
|
||||
getAddonsWithOperationsByTypes:
|
||||
function XPI_getAddonsWithOperationsByTypes(aTypes, aCallback) {
|
||||
XPIDatabase.getVisibleAddonsWithPendingOperations(aTypes, function(aAddons) {
|
||||
let results = [createWrapper(a) for each (a in aAddons)];
|
||||
XPIProvider.installs.forEach(function(aInstall) {
|
||||
@ -1722,7 +1722,7 @@ var XPIProvider = {
|
||||
* @param aCallback
|
||||
* A callback to pass the array of AddonInstalls to
|
||||
*/
|
||||
getInstalls: function XPI_getInstalls(aTypes, aCallback) {
|
||||
getInstallsByTypes: function XPI_getInstallsByTypes(aTypes, aCallback) {
|
||||
let results = [];
|
||||
this.installs.forEach(function(aInstall) {
|
||||
if (!aTypes || aTypes.indexOf(aInstall.type) >= 0)
|
||||
|
@ -56,7 +56,7 @@ function run_test_1() {
|
||||
}
|
||||
|
||||
function check_test_1() {
|
||||
AddonManager.getAddon("bootstrap1@tests.mozilla.org", function(b1) {
|
||||
AddonManager.getAddonByID("bootstrap1@tests.mozilla.org", function(b1) {
|
||||
do_check_neq(b1, null);
|
||||
do_check_eq(b1.version, "1.0");
|
||||
do_check_false(b1.appDisabled);
|
||||
@ -74,7 +74,7 @@ function check_test_1() {
|
||||
let uri = Services.io.newFileURI(dir).spec;
|
||||
do_check_eq(b1.getResourceURL("bootstrap.js"), uri);
|
||||
|
||||
AddonManager.getAddonsWithPendingOperations(null, function(list) {
|
||||
AddonManager.getAddonsWithOperationsByTypes(null, function(list) {
|
||||
do_check_eq(list.length, 0);
|
||||
|
||||
run_test_2();
|
||||
@ -84,7 +84,7 @@ function check_test_1() {
|
||||
|
||||
// Tests that disabling doesn't require a restart
|
||||
function run_test_2() {
|
||||
AddonManager.getAddon("bootstrap1@tests.mozilla.org", function(b1) {
|
||||
AddonManager.getAddonByID("bootstrap1@tests.mozilla.org", function(b1) {
|
||||
prepare_test({
|
||||
"bootstrap1@tests.mozilla.org": [
|
||||
["onDisabling", false],
|
||||
@ -103,7 +103,7 @@ function run_test_2() {
|
||||
do_check_eq(getActivatedVersion(), 0);
|
||||
do_check_not_in_crash_annotation("bootstrap1@tests.mozilla.org", "1.0");
|
||||
|
||||
AddonManager.getAddon("bootstrap1@tests.mozilla.org", function(newb1) {
|
||||
AddonManager.getAddonByID("bootstrap1@tests.mozilla.org", function(newb1) {
|
||||
do_check_neq(newb1, null);
|
||||
do_check_eq(newb1.version, "1.0");
|
||||
do_check_false(newb1.appDisabled);
|
||||
@ -123,7 +123,7 @@ function run_test_3() {
|
||||
do_check_eq(getActivatedVersion(), 0);
|
||||
do_check_not_in_crash_annotation("bootstrap1@tests.mozilla.org", "1.0");
|
||||
|
||||
AddonManager.getAddon("bootstrap1@tests.mozilla.org", function(b1) {
|
||||
AddonManager.getAddonByID("bootstrap1@tests.mozilla.org", function(b1) {
|
||||
do_check_neq(b1, null);
|
||||
do_check_eq(b1.version, "1.0");
|
||||
do_check_false(b1.appDisabled);
|
||||
@ -136,7 +136,7 @@ function run_test_3() {
|
||||
|
||||
// Tests that enabling doesn't require a restart
|
||||
function run_test_4() {
|
||||
AddonManager.getAddon("bootstrap1@tests.mozilla.org", function(b1) {
|
||||
AddonManager.getAddonByID("bootstrap1@tests.mozilla.org", function(b1) {
|
||||
prepare_test({
|
||||
"bootstrap1@tests.mozilla.org": [
|
||||
["onEnabling", false],
|
||||
@ -155,7 +155,7 @@ function run_test_4() {
|
||||
do_check_eq(getActivatedVersion(), 1);
|
||||
do_check_in_crash_annotation("bootstrap1@tests.mozilla.org", "1.0");
|
||||
|
||||
AddonManager.getAddon("bootstrap1@tests.mozilla.org", function(newb1) {
|
||||
AddonManager.getAddonByID("bootstrap1@tests.mozilla.org", function(newb1) {
|
||||
do_check_neq(newb1, null);
|
||||
do_check_eq(newb1.version, "1.0");
|
||||
do_check_false(newb1.appDisabled);
|
||||
@ -176,7 +176,7 @@ function run_test_5() {
|
||||
do_check_eq(getActivatedVersion(), 1);
|
||||
do_check_in_crash_annotation("bootstrap1@tests.mozilla.org", "1.0");
|
||||
|
||||
AddonManager.getAddon("bootstrap1@tests.mozilla.org", function(b1) {
|
||||
AddonManager.getAddonByID("bootstrap1@tests.mozilla.org", function(b1) {
|
||||
do_check_neq(b1, null);
|
||||
do_check_eq(b1.version, "1.0");
|
||||
do_check_false(b1.appDisabled);
|
||||
@ -217,7 +217,7 @@ function run_test_6() {
|
||||
}
|
||||
|
||||
function check_test_6() {
|
||||
AddonManager.getAddon("bootstrap1@tests.mozilla.org", function(b1) {
|
||||
AddonManager.getAddonByID("bootstrap1@tests.mozilla.org", function(b1) {
|
||||
do_check_neq(b1, null);
|
||||
do_check_eq(b1.version, "2.0");
|
||||
do_check_false(b1.appDisabled);
|
||||
@ -233,7 +233,7 @@ function check_test_6() {
|
||||
|
||||
// Tests that uninstalling doesn't require a restart
|
||||
function run_test_7() {
|
||||
AddonManager.getAddon("bootstrap1@tests.mozilla.org", function(b1) {
|
||||
AddonManager.getAddonByID("bootstrap1@tests.mozilla.org", function(b1) {
|
||||
prepare_test({
|
||||
"bootstrap1@tests.mozilla.org": [
|
||||
["onUninstalling", false],
|
||||
@ -252,12 +252,12 @@ function check_test_7() {
|
||||
do_check_eq(getActivatedVersion(), 0);
|
||||
do_check_not_in_crash_annotation("bootstrap1@tests.mozilla.org", "2.0");
|
||||
|
||||
AddonManager.getAddon("bootstrap1@tests.mozilla.org", function(b1) {
|
||||
AddonManager.getAddonByID("bootstrap1@tests.mozilla.org", function(b1) {
|
||||
do_check_eq(b1, null);
|
||||
|
||||
restartManager(0);
|
||||
|
||||
AddonManager.getAddon("bootstrap1@tests.mozilla.org", function(newb1) {
|
||||
AddonManager.getAddonByID("bootstrap1@tests.mozilla.org", function(newb1) {
|
||||
do_check_eq(newb1, null);
|
||||
|
||||
run_test_8();
|
||||
@ -285,7 +285,7 @@ function run_test_8() {
|
||||
|
||||
startupManager(0, false);
|
||||
|
||||
AddonManager.getAddon("bootstrap1@tests.mozilla.org", function(b1) {
|
||||
AddonManager.getAddonByID("bootstrap1@tests.mozilla.org", function(b1) {
|
||||
do_check_neq(b1, null);
|
||||
do_check_eq(b1.version, "1.0");
|
||||
do_check_false(b1.appDisabled);
|
||||
@ -307,7 +307,7 @@ function run_test_9() {
|
||||
dir.remove(true);
|
||||
startupManager(0, false);
|
||||
|
||||
AddonManager.getAddon("bootstrap1@tests.mozilla.org", function(b1) {
|
||||
AddonManager.getAddonByID("bootstrap1@tests.mozilla.org", function(b1) {
|
||||
do_check_eq(b1, null);
|
||||
do_check_not_in_crash_annotation("bootstrap1@tests.mozilla.org", "1.0");
|
||||
|
||||
|
@ -194,7 +194,7 @@ function run_test_pt2() {
|
||||
dump("\n\n*** RESTARTING EXTENSION MANAGER\n\n");
|
||||
restartManager();
|
||||
|
||||
AddonManager.getAddons([a.id for each (a in ADDONS)], function(items) {
|
||||
AddonManager.getAddonsByIDs([a.id for each (a in ADDONS)], function(items) {
|
||||
dump("\n\n*** REQUESTING UPDATE\n\n");
|
||||
// checkListener will call run_test_pt3().
|
||||
next_test = run_test_pt3;
|
||||
@ -231,7 +231,7 @@ function run_test_pt4() {
|
||||
restartManager();
|
||||
|
||||
dump("\n\n*** FINAL CHECKS\n\n");
|
||||
AddonManager.getAddons([a.id for each (a in ADDONS)], function(items) {
|
||||
AddonManager.getAddonsByIDs([a.id for each (a in ADDONS)], function(items) {
|
||||
for (var i = 0; i < ADDONS.length; i++) {
|
||||
var item = items[i];
|
||||
do_check_item(item, "0.2", ADDONS[i]);
|
||||
|
@ -67,7 +67,7 @@ function run_test() {
|
||||
installAllFiles([do_get_addon(ADDON.addon)], function() {
|
||||
restartManager();
|
||||
|
||||
AddonManager.getAddon(ADDON.id, function(item) {
|
||||
AddonManager.getAddonByID(ADDON.id, function(item) {
|
||||
do_check_eq(item.version, 0.1);
|
||||
do_check_false(item.isCompatible);
|
||||
|
||||
|
@ -171,7 +171,7 @@ function run_test() {
|
||||
|
||||
installAllFiles([do_get_addon(a.addon) for each (a in ADDONS)], function() {
|
||||
restartManager();
|
||||
AddonManager.getAddon(ADDONS[0].id, function(addon) {
|
||||
AddonManager.getAddonByID(ADDONS[0].id, function(addon) {
|
||||
addon.userDisabled = true;
|
||||
restartManager();
|
||||
|
||||
|
@ -126,11 +126,11 @@ function run_test() {
|
||||
installAllFiles([do_get_addon(a.addon) for each (a in ADDONS)], function() {
|
||||
|
||||
restartManager();
|
||||
AddonManager.getAddon(ADDONS[1].id, function(addon) {
|
||||
AddonManager.getAddonByID(ADDONS[1].id, function(addon) {
|
||||
addon.userDisabled = true;
|
||||
restartManager();
|
||||
|
||||
AddonManager.getAddons([a.id for each (a in ADDONS)], function(installedItems) {
|
||||
AddonManager.getAddonsByIDs([a.id for each (a in ADDONS)], function(installedItems) {
|
||||
installedItems.forEach(function(item) {
|
||||
updateListener.pendingCount++;
|
||||
item.findUpdates(updateListener, AddonManager.UPDATE_WHEN_USER_REQUESTED);
|
||||
|
@ -51,12 +51,12 @@ function run_test()
|
||||
// Install test add-on
|
||||
startupManager();
|
||||
installAllFiles([do_get_addon(ADDON)], function() {
|
||||
AddonManager.getAddon(ID, function(addon) {
|
||||
AddonManager.getAddonByID(ID, function(addon) {
|
||||
do_check_neq(addon, null);
|
||||
do_check_eq(addon.name, "Test theme");
|
||||
restartManager();
|
||||
|
||||
AddonManager.getAddon(ID, function(addon) {
|
||||
AddonManager.getAddonByID(ID, function(addon) {
|
||||
do_check_neq(addon, null);
|
||||
do_check_eq(addon.optionsURL, null);
|
||||
do_check_eq(addon.aboutURL, null);
|
||||
|
@ -102,7 +102,7 @@ function run_test()
|
||||
.replace(/%CUSTOM1%/, "custom_parameter_1")
|
||||
.replace(/%CUSTOM2%/, "custom_parameter_2");
|
||||
|
||||
AddonManager.getAddon("test@mozilla.org", function(item) {
|
||||
AddonManager.getAddonByID("test@mozilla.org", function(item) {
|
||||
// Initiate update
|
||||
item.findUpdates({
|
||||
onNoCompatibilityUpdateAvailable: function(addon) {
|
||||
|
@ -72,8 +72,8 @@ function run_test()
|
||||
|
||||
restartManager();
|
||||
|
||||
AddonManager.getAddons(["bug394300_1@tests.mozilla.org",
|
||||
"bug394300_2@tests.mozilla.org"], function(updates) {
|
||||
AddonManager.getAddonsByIDs(["bug394300_1@tests.mozilla.org",
|
||||
"bug394300_2@tests.mozilla.org"], function(updates) {
|
||||
|
||||
do_check_neq(updates[0], null);
|
||||
do_check_neq(updates[1], null);
|
||||
|
@ -60,7 +60,7 @@ function run_test()
|
||||
}
|
||||
|
||||
function run_test_1() {
|
||||
AddonManager.getAddon(ID, function(addon) {
|
||||
AddonManager.getAddonByID(ID, function(addon) {
|
||||
do_check_neq(addon, null);
|
||||
do_check_eq(addon.name, "fr Name");
|
||||
do_check_eq(addon.description, "fr Description");
|
||||
@ -69,7 +69,7 @@ function run_test_1() {
|
||||
addon.userDisabled = true;
|
||||
restartManager();
|
||||
|
||||
AddonManager.getAddon(ID, function(newAddon) {
|
||||
AddonManager.getAddonByID(ID, function(newAddon) {
|
||||
do_check_neq(newAddon, null);
|
||||
do_check_eq(newAddon.name, "fr Name");
|
||||
|
||||
@ -83,7 +83,7 @@ function run_test_2() {
|
||||
Services.prefs.setCharPref(PREF_SELECTED_LOCALE, "de");
|
||||
restartManager();
|
||||
|
||||
AddonManager.getAddon(ID, function(addon) {
|
||||
AddonManager.getAddonByID(ID, function(addon) {
|
||||
do_check_neq(addon, null);
|
||||
do_check_eq(addon.name, "de-DE Name");
|
||||
do_check_eq(addon.description, null);
|
||||
@ -97,7 +97,7 @@ function run_test_3() {
|
||||
Services.prefs.setCharPref(PREF_SELECTED_LOCALE, "DE-de");
|
||||
restartManager();
|
||||
|
||||
AddonManager.getAddon(ID, function(addon) {
|
||||
AddonManager.getAddonByID(ID, function(addon) {
|
||||
do_check_neq(addon, null);
|
||||
do_check_eq(addon.name, "de-DE Name");
|
||||
do_check_eq(addon.description, null);
|
||||
@ -111,7 +111,7 @@ function run_test_4() {
|
||||
Services.prefs.setCharPref(PREF_SELECTED_LOCALE, "es-AR");
|
||||
restartManager();
|
||||
|
||||
AddonManager.getAddon(ID, function(addon) {
|
||||
AddonManager.getAddonByID(ID, function(addon) {
|
||||
do_check_neq(addon, null);
|
||||
do_check_eq(addon.name, "es-ES Name");
|
||||
do_check_eq(addon.description, "es-ES Description");
|
||||
@ -125,7 +125,7 @@ function run_test_5() {
|
||||
Services.prefs.setCharPref(PREF_SELECTED_LOCALE, "zh");
|
||||
restartManager();
|
||||
|
||||
AddonManager.getAddon(ID, function(addon) {
|
||||
AddonManager.getAddonByID(ID, function(addon) {
|
||||
do_check_neq(addon, null);
|
||||
if (addon.name != "zh-TW Name" && addon.name != "zh-CN Name")
|
||||
do_throw("zh matched to " + addon.name);
|
||||
@ -140,7 +140,7 @@ function run_test_6() {
|
||||
Services.prefs.setCharPref(PREF_SELECTED_LOCALE, "nl-NL");
|
||||
restartManager();
|
||||
|
||||
AddonManager.getAddon(ID, function(addon) {
|
||||
AddonManager.getAddonByID(ID, function(addon) {
|
||||
do_check_neq(addon, null);
|
||||
do_check_eq(addon.name, "en Name");
|
||||
do_check_eq(addon.description, "en Description");
|
||||
|
@ -49,7 +49,7 @@ function run_test()
|
||||
startupManager();
|
||||
installAllFiles([do_get_addon(ADDON)], function() {
|
||||
restartManager();
|
||||
AddonManager.getAddon(ID, function(addon) {
|
||||
AddonManager.getAddonByID(ID, function(addon) {
|
||||
do_check_neq(addon, null);
|
||||
do_check_eq(addon.name, "Deutsches W\u00f6rterbuch");
|
||||
do_check_eq(addon.name.length, 20);
|
||||
|
@ -63,12 +63,12 @@ function run_test() {
|
||||
installAllFiles([do_get_addon(a) for each (a in ADDONS)], function() {
|
||||
restartManager();
|
||||
|
||||
AddonManager.getAddons(["bug470377_1@tests.mozilla.org",
|
||||
"bug470377_2@tests.mozilla.org",
|
||||
"bug470377_3@tests.mozilla.org",
|
||||
"bug470377_4@tests.mozilla.org",
|
||||
"bug470377_5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
AddonManager.getAddonsByIDs(["bug470377_1@tests.mozilla.org",
|
||||
"bug470377_2@tests.mozilla.org",
|
||||
"bug470377_3@tests.mozilla.org",
|
||||
"bug470377_4@tests.mozilla.org",
|
||||
"bug470377_5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
do_check_eq(a1, null);
|
||||
do_check_eq(a2, null);
|
||||
do_check_eq(a3, null);
|
||||
|
@ -65,12 +65,12 @@ function run_test() {
|
||||
installAllFiles([do_get_addon(a) for each (a in ADDONS)], function() {
|
||||
restartManager();
|
||||
|
||||
AddonManager.getAddons(["bug470377_1@tests.mozilla.org",
|
||||
"bug470377_2@tests.mozilla.org",
|
||||
"bug470377_3@tests.mozilla.org",
|
||||
"bug470377_4@tests.mozilla.org",
|
||||
"bug470377_5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
AddonManager.getAddonsByIDs(["bug470377_1@tests.mozilla.org",
|
||||
"bug470377_2@tests.mozilla.org",
|
||||
"bug470377_3@tests.mozilla.org",
|
||||
"bug470377_4@tests.mozilla.org",
|
||||
"bug470377_5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
do_check_eq(a1, null);
|
||||
do_check_neq(a2, null);
|
||||
do_check_neq(a3, null);
|
||||
|
@ -78,12 +78,12 @@ function run_test() {
|
||||
}
|
||||
|
||||
function run_test_1() {
|
||||
AddonManager.getAddons(["bug470377_1@tests.mozilla.org",
|
||||
"bug470377_2@tests.mozilla.org",
|
||||
"bug470377_3@tests.mozilla.org",
|
||||
"bug470377_4@tests.mozilla.org",
|
||||
"bug470377_5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
AddonManager.getAddonsByIDs(["bug470377_1@tests.mozilla.org",
|
||||
"bug470377_2@tests.mozilla.org",
|
||||
"bug470377_3@tests.mozilla.org",
|
||||
"bug470377_4@tests.mozilla.org",
|
||||
"bug470377_5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
do_check_neq(a1, null);
|
||||
do_check_false(a1.isActive);
|
||||
do_check_neq(a2, null);
|
||||
@ -104,12 +104,12 @@ function run_test_2() {
|
||||
Services.prefs.setBoolPref("extensions.checkCompatibility.2.2", false);
|
||||
restartManager();
|
||||
|
||||
AddonManager.getAddons(["bug470377_1@tests.mozilla.org",
|
||||
"bug470377_2@tests.mozilla.org",
|
||||
"bug470377_3@tests.mozilla.org",
|
||||
"bug470377_4@tests.mozilla.org",
|
||||
"bug470377_5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
AddonManager.getAddonsByIDs(["bug470377_1@tests.mozilla.org",
|
||||
"bug470377_2@tests.mozilla.org",
|
||||
"bug470377_3@tests.mozilla.org",
|
||||
"bug470377_4@tests.mozilla.org",
|
||||
"bug470377_5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
do_check_neq(a1, null);
|
||||
do_check_false(a1.isActive);
|
||||
do_check_neq(a2, null);
|
||||
|
@ -80,12 +80,12 @@ function run_test_1() {
|
||||
Services.prefs.setBoolPref("extensions.checkCompatibility.2.1a", false);
|
||||
startupManager();
|
||||
|
||||
AddonManager.getAddons(["bug470377_1@tests.mozilla.org",
|
||||
"bug470377_2@tests.mozilla.org",
|
||||
"bug470377_3@tests.mozilla.org",
|
||||
"bug470377_4@tests.mozilla.org",
|
||||
"bug470377_5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
AddonManager.getAddonsByIDs(["bug470377_1@tests.mozilla.org",
|
||||
"bug470377_2@tests.mozilla.org",
|
||||
"bug470377_3@tests.mozilla.org",
|
||||
"bug470377_4@tests.mozilla.org",
|
||||
"bug470377_5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
do_check_neq(a1, null);
|
||||
do_check_false(a1.isActive);
|
||||
do_check_neq(a2, null);
|
||||
@ -106,12 +106,12 @@ function run_test_2() {
|
||||
Services.prefs.setBoolPref("extensions.checkCompatibility.2.1a", true);
|
||||
restartManager();
|
||||
|
||||
AddonManager.getAddons(["bug470377_1@tests.mozilla.org",
|
||||
"bug470377_2@tests.mozilla.org",
|
||||
"bug470377_3@tests.mozilla.org",
|
||||
"bug470377_4@tests.mozilla.org",
|
||||
"bug470377_5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
AddonManager.getAddonsByIDs(["bug470377_1@tests.mozilla.org",
|
||||
"bug470377_2@tests.mozilla.org",
|
||||
"bug470377_3@tests.mozilla.org",
|
||||
"bug470377_4@tests.mozilla.org",
|
||||
"bug470377_5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
do_check_neq(a1, null);
|
||||
do_check_false(a1.isActive);
|
||||
do_check_neq(a2, null);
|
||||
|
@ -52,7 +52,7 @@ function run_test() {
|
||||
installAllFiles([do_get_addon(ADDON)], function() {
|
||||
restartManager();
|
||||
|
||||
AddonManager.getAddon(ID, function(addon) {
|
||||
AddonManager.getAddonByID(ID, function(addon) {
|
||||
do_check_neq(addon, null);
|
||||
do_check_true(addon.isActive);
|
||||
|
||||
@ -65,7 +65,7 @@ function run_test_1() {
|
||||
Services.prefs.setBoolPref("extensions.checkCompatibility.2.0pre", true);
|
||||
|
||||
restartManager();
|
||||
AddonManager.getAddon(ID, function(addon) {
|
||||
AddonManager.getAddonByID(ID, function(addon) {
|
||||
do_check_neq(addon, null);
|
||||
do_check_false(addon.isActive);
|
||||
|
||||
@ -77,7 +77,7 @@ function run_test_2() {
|
||||
Services.prefs.setBoolPref("extensions.checkCompatibility.2.0p", false);
|
||||
|
||||
restartManager();
|
||||
AddonManager.getAddon(ID, function(addon) {
|
||||
AddonManager.getAddonByID(ID, function(addon) {
|
||||
do_check_neq(addon, null);
|
||||
do_check_false(addon.isActive);
|
||||
|
||||
|
@ -49,9 +49,9 @@ function run_test() {
|
||||
|
||||
restartManager();
|
||||
|
||||
AddonManager.getAddons(["bug526598_1@tests.mozilla.org",
|
||||
"bug526598_2@tests.mozilla.org"],
|
||||
function([a1, a2]) {
|
||||
AddonManager.getAddonsByIDs(["bug526598_1@tests.mozilla.org",
|
||||
"bug526598_2@tests.mozilla.org"],
|
||||
function([a1, a2]) {
|
||||
|
||||
do_check_neq(a1, null);
|
||||
do_check_true(a1.hasResource("install.rdf"));
|
||||
@ -76,9 +76,9 @@ function run_test() {
|
||||
|
||||
restartManager();
|
||||
|
||||
AddonManager.getAddons(["bug526598_1@tests.mozilla.org",
|
||||
"bug526598_2@tests.mozilla.org"],
|
||||
function([newa1, newa2]) {
|
||||
AddonManager.getAddonsByIDs(["bug526598_1@tests.mozilla.org",
|
||||
"bug526598_2@tests.mozilla.org"],
|
||||
function([newa1, newa2]) {
|
||||
do_check_eq(newa1, null);
|
||||
do_check_eq(newa2, null);
|
||||
|
||||
|
@ -47,7 +47,7 @@ function run_test() {
|
||||
|
||||
restartManager();
|
||||
|
||||
AddonManager.getAddon("bug541420@tests.mozilla.org", function(addon) {
|
||||
AddonManager.getAddonByID("bug541420@tests.mozilla.org", function(addon) {
|
||||
|
||||
do_check_neq(addon, null);
|
||||
do_check_true(addon.hasResource("binary"));
|
||||
|
@ -120,12 +120,12 @@ function check_state(overridden, a1, a2, a3, a4, a5) {
|
||||
// Tests that with compatibility checking enabled we see the incompatible
|
||||
// add-ons disabled
|
||||
function run_test_1() {
|
||||
AddonManager.getAddons(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
check_state(false, a1, a2, a3, a4, a5);
|
||||
|
||||
run_test_2();
|
||||
@ -138,12 +138,12 @@ function run_test_2() {
|
||||
Services.prefs.setBoolPref("extensions.checkCompatibility.2.2", false);
|
||||
restartManager(0);
|
||||
|
||||
AddonManager.getAddons(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
check_state(true, a1, a2, a3, a4, a5);
|
||||
|
||||
run_test_3();
|
||||
@ -156,12 +156,12 @@ function run_test_3() {
|
||||
Services.prefs.setBoolPref("extensions.checkCompatibility.2.1a", false);
|
||||
restartManager(1, "2.1a4");
|
||||
|
||||
AddonManager.getAddons(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
check_state(true, a1, a2, a3, a4, a5);
|
||||
|
||||
run_test_4();
|
||||
@ -174,12 +174,12 @@ function run_test_4() {
|
||||
Services.prefs.setBoolPref("extensions.checkCompatibility.2.1a", true);
|
||||
restartManager(0);
|
||||
|
||||
AddonManager.getAddons(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
check_state(false, a1, a2, a3, a4, a5);
|
||||
|
||||
do_test_finished();
|
||||
|
@ -26,7 +26,7 @@ function run_test() {
|
||||
|
||||
startupManager(1);
|
||||
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(a1) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1) {
|
||||
do_check_eq(a1, null);
|
||||
do_check_not_in_crash_annotation(addon1.id, addon1.version);
|
||||
|
||||
@ -36,7 +36,7 @@ function run_test() {
|
||||
|
||||
restartManager(1);
|
||||
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(newa1) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(newa1) {
|
||||
do_check_neq(newa1, null);
|
||||
do_check_true(newa1.isActive);
|
||||
do_check_false(newa1.userDisabled);
|
||||
@ -59,7 +59,7 @@ function run_test_1() {
|
||||
]
|
||||
});
|
||||
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(a1) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1) {
|
||||
a1.userDisabled = true;
|
||||
do_check_false(hasFlag(a1.permissions, AddonManager.PERM_CAN_DISABLE));
|
||||
do_check_true(hasFlag(a1.permissions, AddonManager.PERM_CAN_ENABLE));
|
||||
@ -67,13 +67,13 @@ function run_test_1() {
|
||||
|
||||
ensure_test_completed();
|
||||
|
||||
AddonManager.getAddonsWithPendingOperations(null, function(list) {
|
||||
AddonManager.getAddonsWithOperationsByTypes(null, function(list) {
|
||||
do_check_eq(list.length, 1);
|
||||
do_check_eq(list[0].id, "addon1@tests.mozilla.org");
|
||||
|
||||
restartManager(0);
|
||||
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(newa1) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(newa1) {
|
||||
do_check_neq(newa1, null);
|
||||
do_check_false(newa1.isActive);
|
||||
do_check_true(newa1.userDisabled);
|
||||
@ -97,20 +97,20 @@ function run_test_2() {
|
||||
]
|
||||
});
|
||||
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(a1) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1) {
|
||||
a1.userDisabled = false;
|
||||
do_check_true(hasFlag(a1.permissions, AddonManager.PERM_CAN_DISABLE));
|
||||
do_check_false(hasFlag(a1.permissions, AddonManager.PERM_CAN_ENABLE));
|
||||
|
||||
ensure_test_completed();
|
||||
|
||||
AddonManager.getAddonsWithPendingOperations(null, function(list) {
|
||||
AddonManager.getAddonsWithOperationsByTypes(null, function(list) {
|
||||
do_check_eq(list.length, 1);
|
||||
do_check_eq(list[0].id, "addon1@tests.mozilla.org");
|
||||
|
||||
restartManager(0);
|
||||
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(newa1) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(newa1) {
|
||||
do_check_neq(newa1, null);
|
||||
do_check_true(newa1.isActive);
|
||||
do_check_false(newa1.userDisabled);
|
||||
@ -133,7 +133,7 @@ function run_test_3() {
|
||||
]
|
||||
});
|
||||
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(a1) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1) {
|
||||
a1.userDisabled = true;
|
||||
ensure_test_completed();
|
||||
prepare_test({
|
||||
@ -149,7 +149,7 @@ function run_test_3() {
|
||||
|
||||
restartManager(0);
|
||||
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(newa1) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(newa1) {
|
||||
do_check_neq(newa1, null);
|
||||
do_check_true(newa1.isActive);
|
||||
do_check_false(newa1.userDisabled);
|
||||
|
@ -107,7 +107,7 @@ function run_test() {
|
||||
inspector.events.addListener("uninstall", onGenericEvent);
|
||||
inspector.events.addListener("cancel", onGenericEvent);
|
||||
|
||||
AddonManager.getAddon(testdata.inspectorid, function(a) {
|
||||
AddonManager.getAddonByID(testdata.inspectorid, function(a) {
|
||||
a.userDisabled = true;
|
||||
|
||||
do_check_eq(gLastEvent, "disable");
|
||||
|
@ -28,7 +28,7 @@ function run_test_1() {
|
||||
AddonManager.getAddonsByTypes(null, function(addons) {
|
||||
do_check_eq(gCount, addons.length);
|
||||
|
||||
AddonManager.getAddonsWithPendingOperations(null, function(pendingAddons) {
|
||||
AddonManager.getAddonsWithOperationsByTypes(null, function(pendingAddons) {
|
||||
do_check_eq(0, pendingAddons.length);
|
||||
|
||||
run_test_2();
|
||||
|
@ -61,14 +61,14 @@ function run_test_1() {
|
||||
let uri = Services.io.newFileURI(file).spec;
|
||||
do_check_eq(install.addon.getResourceURL("install.rdf"), "jar:" + uri + "!/install.rdf");
|
||||
|
||||
AddonManager.getInstalls(null, function(activeInstalls) {
|
||||
AddonManager.getAllInstalls(function(activeInstalls) {
|
||||
do_check_eq(activeInstalls.length, 1);
|
||||
do_check_eq(activeInstalls[0], install);
|
||||
|
||||
AddonManager.getInstalls(["foo"], function(fooInstalls) {
|
||||
AddonManager.getInstallsByTypes(["foo"], function(fooInstalls) {
|
||||
do_check_eq(fooInstalls.length, 0);
|
||||
|
||||
AddonManager.getInstalls(["extension"], function(extensionInstalls) {
|
||||
AddonManager.getInstallsByTypes(["extension"], function(extensionInstalls) {
|
||||
do_check_eq(extensionInstalls.length, 1);
|
||||
do_check_eq(extensionInstalls[0], install);
|
||||
|
||||
@ -89,19 +89,19 @@ function run_test_1() {
|
||||
|
||||
function check_test_1() {
|
||||
ensure_test_completed();
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(olda1) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(olda1) {
|
||||
do_check_eq(olda1, null);
|
||||
|
||||
AddonManager.getAddonsWithPendingOperations(null, function(pendingAddons) {
|
||||
AddonManager.getAddonsWithOperationsByTypes(null, function(pendingAddons) {
|
||||
do_check_eq(pendingAddons.length, 1);
|
||||
do_check_eq(pendingAddons[0].id, "addon1@tests.mozilla.org");
|
||||
|
||||
restartManager(1);
|
||||
|
||||
AddonManager.getInstalls(null, function(activeInstalls) {
|
||||
AddonManager.getAllInstalls(function(activeInstalls) {
|
||||
do_check_eq(activeInstalls, 0);
|
||||
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(a1) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1) {
|
||||
do_check_neq(a1, null);
|
||||
do_check_eq(a1.type, "extension");
|
||||
do_check_eq(a1.version, "1.0");
|
||||
@ -148,7 +148,7 @@ function run_test_2() {
|
||||
do_check_eq(install.name, "Test 2");
|
||||
do_check_eq(install.state, AddonManager.STATE_AVAILABLE);
|
||||
|
||||
AddonManager.getInstalls(null, function(activeInstalls) {
|
||||
AddonManager.getAllInstalls(function(activeInstalls) {
|
||||
do_check_eq(activeInstalls.length, 1);
|
||||
do_check_eq(activeInstalls[0], install);
|
||||
|
||||
@ -197,14 +197,14 @@ function run_test_3(install) {
|
||||
|
||||
function check_test_3() {
|
||||
ensure_test_completed();
|
||||
AddonManager.getAddon("addon2@tests.mozilla.org", function(olda2) {
|
||||
AddonManager.getAddonByID("addon2@tests.mozilla.org", function(olda2) {
|
||||
do_check_eq(olda2, null);
|
||||
restartManager(1);
|
||||
|
||||
AddonManager.getInstalls(null, function(installs) {
|
||||
AddonManager.getAllInstalls(function(installs) {
|
||||
do_check_eq(installs, 0);
|
||||
|
||||
AddonManager.getAddon("addon2@tests.mozilla.org", function(a2) {
|
||||
AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2) {
|
||||
do_check_neq(a2, null);
|
||||
do_check_eq(a2.type, "extension");
|
||||
do_check_eq(a2.version, "2.0");
|
||||
@ -244,7 +244,7 @@ function run_test_4() {
|
||||
do_check_eq(install.name, "Test 3");
|
||||
do_check_eq(install.state, AddonManager.STATE_AVAILABLE);
|
||||
|
||||
AddonManager.getInstalls(null, function(activeInstalls) {
|
||||
AddonManager.getAllInstalls(function(activeInstalls) {
|
||||
do_check_eq(activeInstalls.length, 1);
|
||||
do_check_eq(activeInstalls[0], install);
|
||||
do_check_eq(install.existingAddon, null);
|
||||
@ -289,19 +289,19 @@ function check_test_5(install) {
|
||||
|
||||
do_check_eq(install.existingAddon.pendingUpgrade.install, install);
|
||||
|
||||
AddonManager.getAddon("addon2@tests.mozilla.org", function(olda2) {
|
||||
AddonManager.getAddonByID("addon2@tests.mozilla.org", function(olda2) {
|
||||
do_check_neq(olda2, null);
|
||||
do_check_true(hasFlag(olda2.pendingOperations, AddonManager.PENDING_UPGRADE));
|
||||
|
||||
AddonManager.getInstalls(null, function(installs) {
|
||||
AddonManager.getInstallsByTypes(null, function(installs) {
|
||||
do_check_eq(installs.length, 1);
|
||||
do_check_eq(installs[0].addon, olda2.pendingUpgrade);
|
||||
restartManager();
|
||||
|
||||
AddonManager.getInstalls(null, function(installs) {
|
||||
AddonManager.getInstallsByTypes(null, function(installs) {
|
||||
do_check_eq(installs.length, 0);
|
||||
|
||||
AddonManager.getAddon("addon2@tests.mozilla.org", function(a2) {
|
||||
AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2) {
|
||||
do_check_neq(a2, null);
|
||||
do_check_eq(a2.type, "extension");
|
||||
do_check_eq(a2.version, "3.0");
|
||||
@ -340,7 +340,7 @@ function run_test_6() {
|
||||
do_check_eq(install.name, "Real Test 4");
|
||||
do_check_eq(install.state, AddonManager.STATE_AVAILABLE);
|
||||
|
||||
AddonManager.getInstalls(null, function(activeInstalls) {
|
||||
AddonManager.getInstallsByTypes(null, function(activeInstalls) {
|
||||
do_check_eq(activeInstalls.length, 1);
|
||||
do_check_eq(activeInstalls[0], install);
|
||||
|
||||
@ -378,14 +378,14 @@ function run_test_7() {
|
||||
|
||||
function check_test_7() {
|
||||
ensure_test_completed();
|
||||
AddonManager.getAddon("addon3@tests.mozilla.org", function(olda3) {
|
||||
AddonManager.getAddonByID("addon3@tests.mozilla.org", function(olda3) {
|
||||
do_check_eq(olda3, null);
|
||||
restartManager();
|
||||
|
||||
AddonManager.getInstalls(null, function(installs) {
|
||||
AddonManager.getAllInstalls(function(installs) {
|
||||
do_check_eq(installs, 0);
|
||||
|
||||
AddonManager.getAddon("addon3@tests.mozilla.org", function(a3) {
|
||||
AddonManager.getAddonByID("addon3@tests.mozilla.org", function(a3) {
|
||||
do_check_neq(a3, null);
|
||||
do_check_eq(a3.type, "extension");
|
||||
do_check_eq(a3.version, "1.0");
|
||||
@ -429,7 +429,7 @@ function run_test_8() {
|
||||
function check_test_8() {
|
||||
restartManager(1);
|
||||
|
||||
AddonManager.getAddon("addon3@tests.mozilla.org", function(a3) {
|
||||
AddonManager.getAddonByID("addon3@tests.mozilla.org", function(a3) {
|
||||
do_check_neq(a3, null);
|
||||
do_check_eq(a3.type, "extension");
|
||||
do_check_eq(a3.version, "1.0");
|
||||
@ -460,7 +460,7 @@ function run_test_9() {
|
||||
do_check_eq(install.name, "Real Test 4");
|
||||
do_check_eq(install.state, AddonManager.STATE_AVAILABLE);
|
||||
|
||||
AddonManager.getInstalls(null, function(activeInstalls) {
|
||||
AddonManager.getInstallsByTypes(null, function(activeInstalls) {
|
||||
do_check_eq(activeInstalls.length, 1);
|
||||
do_check_eq(activeInstalls[0], install);
|
||||
|
||||
@ -482,7 +482,7 @@ function check_test_9(install) {
|
||||
|
||||
ensure_test_completed();
|
||||
|
||||
AddonManager.getInstalls(null, function(activeInstalls) {
|
||||
AddonManager.getAllInstalls(function(activeInstalls) {
|
||||
do_check_eq(activeInstalls.length, 0);
|
||||
|
||||
run_test_10();
|
||||
@ -505,7 +505,7 @@ function run_test_10() {
|
||||
do_check_eq(install.name, "Real Test 4");
|
||||
do_check_eq(install.state, AddonManager.STATE_AVAILABLE);
|
||||
|
||||
AddonManager.getInstalls(null, function(activeInstalls) {
|
||||
AddonManager.getInstallsByTypes(null, function(activeInstalls) {
|
||||
do_check_eq(activeInstalls.length, 1);
|
||||
do_check_eq(activeInstalls[0], install);
|
||||
|
||||
@ -533,7 +533,7 @@ function check_test_10(install) {
|
||||
|
||||
ensure_test_completed();
|
||||
|
||||
AddonManager.getInstalls(null, function(activeInstalls) {
|
||||
AddonManager.getAllInstalls(function(activeInstalls) {
|
||||
do_check_eq(activeInstalls.length, 0);
|
||||
|
||||
end_test();
|
||||
|
@ -43,7 +43,7 @@ function run_test_1() {
|
||||
function run_test_2() {
|
||||
restartManager(1);
|
||||
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(addon) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(addon) {
|
||||
do_check_neq(addon, null);
|
||||
|
||||
do_check_eq(addon.name, "fr-FR Name");
|
||||
@ -58,7 +58,7 @@ function run_test_2() {
|
||||
|
||||
// Test that the localized properties are still there when disabled.
|
||||
function run_test_3() {
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(addon) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(addon) {
|
||||
do_check_neq(addon, null);
|
||||
do_check_eq(addon.name, "fr-FR Name");
|
||||
|
||||
@ -73,7 +73,7 @@ function run_test_4() {
|
||||
Services.prefs.setCharPref("extensions.addon1@tests.mozilla.org.contributor.2", "Contributor 2");
|
||||
restartManager(0);
|
||||
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(addon) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(addon) {
|
||||
do_check_neq(addon, null);
|
||||
do_check_eq(addon.name, "fr-FR Name");
|
||||
let contributors = addon.contributors;
|
||||
@ -91,7 +91,7 @@ function run_test_5() {
|
||||
Services.prefs.setCharPref(PREF_SELECTED_LOCALE, "de-DE");
|
||||
restartManager(0);
|
||||
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(addon) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(addon) {
|
||||
do_check_neq(addon, null);
|
||||
|
||||
do_check_eq(addon.name, "de-DE Name");
|
||||
@ -106,7 +106,7 @@ function run_test_6() {
|
||||
Services.prefs.setCharPref(PREF_SELECTED_LOCALE, "nl-NL");
|
||||
restartManager(0);
|
||||
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(addon) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(addon) {
|
||||
do_check_neq(addon, null);
|
||||
|
||||
do_check_eq(addon.name, "Fallback Name");
|
||||
@ -120,7 +120,7 @@ function run_test_6() {
|
||||
|
||||
// Test that the prefs will override the fallbacks
|
||||
function run_test_7() {
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(addon) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(addon) {
|
||||
do_check_neq(addon, null);
|
||||
|
||||
do_check_eq(addon.name, "Name from prefs");
|
||||
@ -134,7 +134,7 @@ function run_test_8() {
|
||||
Services.prefs.setCharPref(PREF_SELECTED_LOCALE, "fr-FR");
|
||||
restartManager(0);
|
||||
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(addon) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(addon) {
|
||||
do_check_neq(addon, null);
|
||||
|
||||
do_check_eq(addon.name, "Name from prefs");
|
||||
|
@ -254,24 +254,24 @@ function run_test() {
|
||||
|
||||
do_test_pending();
|
||||
startupManager(1);
|
||||
AddonManager.getAddons(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org",
|
||||
"addon6@tests.mozilla.org",
|
||||
"addon7@tests.mozilla.org",
|
||||
"addon8@tests.mozilla.org",
|
||||
"addon9@tests.mozilla.org",
|
||||
"addon10@tests.mozilla.org",
|
||||
"addon11@tests.mozilla.org",
|
||||
"addon12@tests.mozilla.org",
|
||||
"addon13@tests.mozilla.org",
|
||||
"addon14@tests.mozilla.org",
|
||||
"addon15@tests.mozilla.org",
|
||||
"addon16@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
|
||||
a11, a12, a13, a14, a15, a16]) {
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org",
|
||||
"addon6@tests.mozilla.org",
|
||||
"addon7@tests.mozilla.org",
|
||||
"addon8@tests.mozilla.org",
|
||||
"addon9@tests.mozilla.org",
|
||||
"addon10@tests.mozilla.org",
|
||||
"addon11@tests.mozilla.org",
|
||||
"addon12@tests.mozilla.org",
|
||||
"addon13@tests.mozilla.org",
|
||||
"addon14@tests.mozilla.org",
|
||||
"addon15@tests.mozilla.org",
|
||||
"addon16@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
|
||||
a11, a12, a13, a14, a15, a16]) {
|
||||
|
||||
do_check_neq(a1, null);
|
||||
do_check_eq(a1.id, "addon1@tests.mozilla.org");
|
||||
|
@ -72,10 +72,10 @@ function run_test() {
|
||||
old.copyTo(gProfD, "extensions.rdf");
|
||||
|
||||
startupManager(1);
|
||||
AddonManager.getAddons(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org"], function([a1, a2, a3, a4]) {
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org"], function([a1, a2, a3, a4]) {
|
||||
// addon1 was enabled in the old extensions.rdf
|
||||
do_check_neq(a1, null);
|
||||
do_check_false(a1.userDisabled);
|
||||
|
@ -97,10 +97,10 @@ function run_test() {
|
||||
Services.prefs.setIntPref("extensions.databaseSchema", 100);
|
||||
|
||||
startupManager(1);
|
||||
AddonManager.getAddons(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org"], function([a1, a2, a3, a4]) {
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org"], function([a1, a2, a3, a4]) {
|
||||
// addon1 was enabled in the database
|
||||
do_check_neq(a1, null);
|
||||
do_check_false(a1.userDisabled);
|
||||
|
@ -28,7 +28,7 @@ function run_test_1() {
|
||||
|
||||
do_check_neq(gID, null);
|
||||
|
||||
AddonManager.getAddon(gID, function(p) {
|
||||
AddonManager.getAddonByID(gID, function(p) {
|
||||
do_check_neq(p, null)
|
||||
do_check_false(p.userDisabled);
|
||||
do_check_false(p.appDisabled);
|
||||
@ -57,7 +57,7 @@ function run_test_2(p) {
|
||||
do_check_false(p.appDisabled);
|
||||
do_check_false(p.isActive);
|
||||
|
||||
AddonManager.getAddon(gID, function(p) {
|
||||
AddonManager.getAddonByID(gID, function(p) {
|
||||
do_check_neq(p, null)
|
||||
do_check_true(p.userDisabled);
|
||||
do_check_false(p.appDisabled);
|
||||
@ -85,7 +85,7 @@ function run_test_3(p) {
|
||||
do_check_false(p.appDisabled);
|
||||
do_check_true(p.isActive);
|
||||
|
||||
AddonManager.getAddon(gID, function(p) {
|
||||
AddonManager.getAddonByID(gID, function(p) {
|
||||
do_check_neq(p, null)
|
||||
do_check_false(p.userDisabled);
|
||||
do_check_false(p.appDisabled);
|
||||
|
@ -60,8 +60,8 @@ function run_test_1() {
|
||||
|
||||
startupManager(1);
|
||||
|
||||
AddonManager.getAddons(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org"], function([a1, a2]) {
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org"], function([a1, a2]) {
|
||||
do_check_neq(a1, null);
|
||||
do_check_true(a1.isActive);
|
||||
do_check_false(hasFlag(a1.permissions, AddonManager.PERM_CAN_UNINSTALL));
|
||||
@ -87,8 +87,8 @@ function run_test_2() {
|
||||
|
||||
restartManager(1);
|
||||
|
||||
AddonManager.getAddons(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org"], function([a1, a2]) {
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org"], function([a1, a2]) {
|
||||
do_check_eq(a1, null);
|
||||
do_check_eq(a2, null);
|
||||
|
||||
@ -107,8 +107,8 @@ function run_test_3() {
|
||||
|
||||
restartManager(0);
|
||||
|
||||
AddonManager.getAddons(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org"], function([a1, a2]) {
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org"], function([a1, a2]) {
|
||||
do_check_eq(a1, null);
|
||||
do_check_eq(a2, null);
|
||||
|
||||
@ -145,8 +145,8 @@ function run_test_4() {
|
||||
|
||||
restartManager(1);
|
||||
|
||||
AddonManager.getAddons(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org"], function([a1, a2]) {
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org"], function([a1, a2]) {
|
||||
do_check_eq(a1, null);
|
||||
do_check_neq(a2, null);
|
||||
|
||||
|
@ -83,12 +83,12 @@ function run_test() {
|
||||
do_test_pending();
|
||||
startupManager(1);
|
||||
|
||||
AddonManager.getAddons(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
|
||||
do_check_eq(a1, null);
|
||||
do_check_not_in_crash_annotation(addon1.id, addon1.version);
|
||||
@ -129,12 +129,12 @@ function run_test_1() {
|
||||
writeInstallRDFToDir(addon5, dest);
|
||||
|
||||
restartManager(1);
|
||||
AddonManager.getAddons(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
|
||||
do_check_neq(a1, null);
|
||||
do_check_eq(a1.id, "addon1@tests.mozilla.org");
|
||||
@ -211,12 +211,12 @@ function run_test_2() {
|
||||
|
||||
restartManager(1);
|
||||
|
||||
AddonManager.getAddons(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
|
||||
do_check_neq(a1, null);
|
||||
do_check_eq(a1.id, "addon1@tests.mozilla.org");
|
||||
@ -267,12 +267,12 @@ function run_test_3() {
|
||||
|
||||
restartManager(1);
|
||||
|
||||
AddonManager.getAddons(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
|
||||
do_check_neq(a1, null);
|
||||
do_check_eq(a1.id, "addon1@tests.mozilla.org");
|
||||
@ -318,12 +318,12 @@ function run_test_4() {
|
||||
|
||||
restartManager(1);
|
||||
|
||||
AddonManager.getAddons(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
|
||||
do_check_eq(a1, null);
|
||||
do_check_false(isExtensionInAddonsList(profileDir, "addon1@tests.mozilla.org"));
|
||||
@ -350,12 +350,12 @@ function run_test_5() {
|
||||
|
||||
restartManager(1);
|
||||
|
||||
AddonManager.getAddons(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
|
||||
do_check_neq(a1, null);
|
||||
do_check_eq(a1.id, "addon1@tests.mozilla.org");
|
||||
@ -388,12 +388,12 @@ function run_test_6() {
|
||||
|
||||
restartManager(1);
|
||||
|
||||
AddonManager.getAddons(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
|
||||
do_check_neq(a1, null);
|
||||
do_check_eq(a1.id, "addon1@tests.mozilla.org");
|
||||
@ -432,12 +432,12 @@ function run_test_7() {
|
||||
|
||||
restartManager(1);
|
||||
|
||||
AddonManager.getAddons(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
|
||||
do_check_neq(a1, null);
|
||||
do_check_eq(a1.id, "addon1@tests.mozilla.org");
|
||||
@ -479,12 +479,12 @@ function run_test_8() {
|
||||
|
||||
restartManager(1);
|
||||
|
||||
AddonManager.getAddons(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
|
||||
do_check_neq(a1, null);
|
||||
do_check_eq(a1.id, "addon1@tests.mozilla.org");
|
||||
@ -522,12 +522,12 @@ function run_test_9() {
|
||||
|
||||
restartManager(1);
|
||||
|
||||
AddonManager.getAddons(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
|
||||
do_check_neq(a1, null);
|
||||
do_check_eq(a1.id, "addon1@tests.mozilla.org");
|
||||
@ -574,12 +574,12 @@ function run_test_10() {
|
||||
|
||||
restartManager(1);
|
||||
|
||||
AddonManager.getAddons(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
|
||||
do_check_neq(a1, null);
|
||||
do_check_eq(a1.id, "addon1@tests.mozilla.org");
|
||||
@ -624,12 +624,12 @@ function run_test_11() {
|
||||
|
||||
restartManager(1);
|
||||
|
||||
AddonManager.getAddons(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5]) {
|
||||
|
||||
do_check_eq(a1, null);
|
||||
do_check_eq(a2, null);
|
||||
|
@ -71,7 +71,8 @@ function run_test() {
|
||||
AddonManager.addAddonListener(AddonListener);
|
||||
AddonManager.addInstallListener(InstallListener);
|
||||
|
||||
AddonManager.getAddons(["theme1@tests.mozilla.org", "theme2@tests.mozilla.org"], function([t1, t2]) {
|
||||
AddonManager.getAddonsByIDs(["theme1@tests.mozilla.org",
|
||||
"theme2@tests.mozilla.org"], function([t1, t2]) {
|
||||
do_check_neq(t1, null);
|
||||
do_check_false(t1.userDisabled);
|
||||
do_check_false(t1.appDisabled);
|
||||
@ -106,7 +107,8 @@ function run_test_1() {
|
||||
"onEnabling"
|
||||
]
|
||||
});
|
||||
AddonManager.getAddons(["theme1@tests.mozilla.org", "theme2@tests.mozilla.org"], function([t1, t2]) {
|
||||
AddonManager.getAddonsByIDs(["theme1@tests.mozilla.org",
|
||||
"theme2@tests.mozilla.org"], function([t1, t2]) {
|
||||
t2.userDisabled = false;
|
||||
|
||||
ensure_test_completed();
|
||||
@ -125,7 +127,8 @@ function check_test_1() {
|
||||
restartManager(0);
|
||||
do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "theme2/1.0");
|
||||
|
||||
AddonManager.getAddons(["theme1@tests.mozilla.org", "theme2@tests.mozilla.org"], function([t1, t2]) {
|
||||
AddonManager.getAddonsByIDs(["theme1@tests.mozilla.org",
|
||||
"theme2@tests.mozilla.org"], function([t1, t2]) {
|
||||
do_check_neq(t1, null);
|
||||
do_check_true(t1.userDisabled);
|
||||
do_check_false(t1.appDisabled);
|
||||
@ -156,7 +159,8 @@ function run_test_2() {
|
||||
restartManager(1);
|
||||
do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "classic/1.0");
|
||||
|
||||
AddonManager.getAddons(["theme1@tests.mozilla.org", "theme2@tests.mozilla.org"], function([t1, t2]) {
|
||||
AddonManager.getAddonsByIDs(["theme1@tests.mozilla.org",
|
||||
"theme2@tests.mozilla.org"], function([t1, t2]) {
|
||||
do_check_neq(t1, null);
|
||||
do_check_true(t1.userDisabled);
|
||||
do_check_false(t1.appDisabled);
|
||||
@ -219,7 +223,7 @@ function run_test_3() {
|
||||
|
||||
ensure_test_completed();
|
||||
|
||||
AddonManager.getAddon("1@personas.mozilla.org", function(p1) {
|
||||
AddonManager.getAddonByID("1@personas.mozilla.org", function(p1) {
|
||||
do_check_neq(null, p1);
|
||||
do_check_eq(p1.name, "Test LW Theme");
|
||||
do_check_eq(p1.version, "1");
|
||||
@ -289,8 +293,8 @@ function run_test_4() {
|
||||
|
||||
ensure_test_completed();
|
||||
|
||||
AddonManager.getAddons(["1@personas.mozilla.org",
|
||||
"2@personas.mozilla.org"], function([p1, p2]) {
|
||||
AddonManager.getAddonsByIDs(["1@personas.mozilla.org",
|
||||
"2@personas.mozilla.org"], function([p1, p2]) {
|
||||
do_check_neq(null, p2);
|
||||
do_check_false(p2.appDisabled);
|
||||
do_check_false(p2.userDisabled);
|
||||
@ -336,8 +340,8 @@ function run_test_5() {
|
||||
]
|
||||
});
|
||||
|
||||
AddonManager.getAddons(["2@personas.mozilla.org",
|
||||
"theme2@tests.mozilla.org"], function([p2, t2]) {
|
||||
AddonManager.getAddonsByIDs(["2@personas.mozilla.org",
|
||||
"theme2@tests.mozilla.org"], function([p2, t2]) {
|
||||
t2.userDisabled = false;
|
||||
|
||||
ensure_test_completed();
|
||||
@ -383,8 +387,8 @@ function run_test_5() {
|
||||
function check_test_5() {
|
||||
restartManager(0);
|
||||
|
||||
AddonManager.getAddons(["2@personas.mozilla.org",
|
||||
"theme2@tests.mozilla.org"], function([p2, t2]) {
|
||||
AddonManager.getAddonsByIDs(["2@personas.mozilla.org",
|
||||
"theme2@tests.mozilla.org"], function([p2, t2]) {
|
||||
do_check_true(t2.isActive);
|
||||
do_check_false(t2.userDisabled);
|
||||
do_check_false(hasFlag(AddonManager.PENDING_ENABLE, t2.pendingOperations));
|
||||
@ -407,8 +411,8 @@ function run_test_6() {
|
||||
]
|
||||
});
|
||||
|
||||
AddonManager.getAddons(["2@personas.mozilla.org",
|
||||
"theme2@tests.mozilla.org"], function([p2, t2]) {
|
||||
AddonManager.getAddonsByIDs(["2@personas.mozilla.org",
|
||||
"theme2@tests.mozilla.org"], function([p2, t2]) {
|
||||
p2.userDisabled = false;
|
||||
|
||||
ensure_test_completed();
|
||||
@ -453,8 +457,8 @@ function run_test_6() {
|
||||
function check_test_6() {
|
||||
restartManager(0);
|
||||
|
||||
AddonManager.getAddons(["2@personas.mozilla.org",
|
||||
"theme2@tests.mozilla.org"], function([p2, t2]) {
|
||||
AddonManager.getAddonsByIDs(["2@personas.mozilla.org",
|
||||
"theme2@tests.mozilla.org"], function([p2, t2]) {
|
||||
do_check_true(p2.isActive);
|
||||
do_check_false(p2.userDisabled);
|
||||
do_check_false(hasFlag(AddonManager.PENDING_ENABLE, p2.pendingOperations));
|
||||
@ -475,7 +479,7 @@ function run_test_7() {
|
||||
]
|
||||
});
|
||||
|
||||
AddonManager.getAddon("1@personas.mozilla.org", function(p1) {
|
||||
AddonManager.getAddonByID("1@personas.mozilla.org", function(p1) {
|
||||
p1.uninstall();
|
||||
|
||||
ensure_test_completed();
|
||||
@ -499,7 +503,7 @@ function run_test_8() {
|
||||
]
|
||||
});
|
||||
|
||||
AddonManager.getAddon("2@personas.mozilla.org", function(p2) {
|
||||
AddonManager.getAddonByID("2@personas.mozilla.org", function(p2) {
|
||||
p2.uninstall();
|
||||
|
||||
ensure_test_completed();
|
||||
@ -511,7 +515,7 @@ function run_test_8() {
|
||||
|
||||
// Uninstalling a theme not in use should not require a restart
|
||||
function run_test_9() {
|
||||
AddonManager.getAddon("theme1@tests.mozilla.org", function(t1) {
|
||||
AddonManager.getAddonByID("theme1@tests.mozilla.org", function(t1) {
|
||||
prepare_test({
|
||||
"theme1@tests.mozilla.org": [
|
||||
["onUninstalling", false],
|
||||
@ -523,7 +527,7 @@ function run_test_9() {
|
||||
|
||||
ensure_test_completed();
|
||||
|
||||
AddonManager.getAddon("theme1@tests.mozilla.org", function(newt1) {
|
||||
AddonManager.getAddonByID("theme1@tests.mozilla.org", function(newt1) {
|
||||
do_check_eq(newt1, null);
|
||||
|
||||
run_test_10();
|
||||
@ -533,7 +537,7 @@ function run_test_9() {
|
||||
|
||||
// Uninstalling a custom theme in use should require a restart
|
||||
function run_test_10() {
|
||||
AddonManager.getAddon("theme2@tests.mozilla.org", function(oldt2) {
|
||||
AddonManager.getAddonByID("theme2@tests.mozilla.org", function(oldt2) {
|
||||
prepare_test({
|
||||
"theme2@tests.mozilla.org": [
|
||||
"onEnabling",
|
||||
@ -549,8 +553,8 @@ function run_test_10() {
|
||||
|
||||
restartManager(0);
|
||||
|
||||
AddonManager.getAddons(["default@tests.mozilla.org",
|
||||
"theme2@tests.mozilla.org"], function([d, t2]) {
|
||||
AddonManager.getAddonsByIDs(["default@tests.mozilla.org",
|
||||
"theme2@tests.mozilla.org"], function([d, t2]) {
|
||||
do_check_true(t2.isActive);
|
||||
do_check_false(t2.userDisabled);
|
||||
do_check_false(t2.appDisabled);
|
||||
@ -607,7 +611,7 @@ function run_test_11() {
|
||||
}
|
||||
|
||||
function check_test_11() {
|
||||
AddonManager.getAddon("theme1@tests.mozilla.org", function(t1) {
|
||||
AddonManager.getAddonByID("theme1@tests.mozilla.org", function(t1) {
|
||||
do_check_neq(t1, null);
|
||||
|
||||
run_test_12();
|
||||
@ -643,7 +647,7 @@ function run_test_12() {
|
||||
}
|
||||
|
||||
function check_test_12() {
|
||||
AddonManager.getAddon("theme1@tests.mozilla.org", function(t1) {
|
||||
AddonManager.getAddonByID("theme1@tests.mozilla.org", function(t1) {
|
||||
do_check_neq(t1, null);
|
||||
|
||||
run_test_13();
|
||||
@ -652,7 +656,7 @@ function check_test_12() {
|
||||
|
||||
// Updating a custom theme in use should require a restart
|
||||
function run_test_13() {
|
||||
AddonManager.getAddon("theme1@tests.mozilla.org", function(t1) {
|
||||
AddonManager.getAddonByID("theme1@tests.mozilla.org", function(t1) {
|
||||
prepare_test({
|
||||
"theme1@tests.mozilla.org": [
|
||||
"onEnabling",
|
||||
@ -695,7 +699,7 @@ function run_test_13() {
|
||||
function check_test_13() {
|
||||
restartManager(1);
|
||||
|
||||
AddonManager.getAddon("theme1@tests.mozilla.org", function(t1) {
|
||||
AddonManager.getAddonByID("theme1@tests.mozilla.org", function(t1) {
|
||||
do_check_neq(t1, null);
|
||||
do_check_true(t1.isActive);
|
||||
|
||||
|
@ -25,7 +25,7 @@ function run_test() {
|
||||
do_test_pending();
|
||||
startupManager(1);
|
||||
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(olda1) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(olda1) {
|
||||
do_check_eq(olda1, null);
|
||||
|
||||
var dest = profileDir.clone();
|
||||
@ -34,7 +34,7 @@ function run_test() {
|
||||
|
||||
restartManager(1);
|
||||
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(a1) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1) {
|
||||
do_check_neq(a1, null);
|
||||
do_check_true(a1.isActive);
|
||||
do_check_false(a1.userDisabled);
|
||||
@ -58,7 +58,7 @@ function run_test_1() {
|
||||
"onUninstalling"
|
||||
]
|
||||
});
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(a1) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1) {
|
||||
do_check_eq(a1.pendingOperations, 0);
|
||||
a1.uninstall();
|
||||
do_check_true(hasFlag(a1.pendingOperations, AddonManager.PENDING_UNINSTALL));
|
||||
@ -66,7 +66,7 @@ function run_test_1() {
|
||||
|
||||
ensure_test_completed();
|
||||
|
||||
AddonManager.getAddonsWithPendingOperations(null, function(list) {
|
||||
AddonManager.getAddonsWithOperationsByTypes(null, function(list) {
|
||||
do_check_eq(list.length, 1);
|
||||
do_check_eq(list[0].id, "addon1@tests.mozilla.org");
|
||||
|
||||
@ -78,7 +78,7 @@ function run_test_1() {
|
||||
function check_test_1() {
|
||||
restartManager(0);
|
||||
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(a1) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1) {
|
||||
do_check_eq(a1, null);
|
||||
do_check_false(isExtensionInAddonsList(profileDir, "addon1@tests.mozilla.org"));
|
||||
do_check_not_in_crash_annotation(addon1.id, addon1.version);
|
||||
@ -101,7 +101,7 @@ function run_test_2() {
|
||||
]
|
||||
});
|
||||
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(a1) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1) {
|
||||
do_check_neq(a1, null);
|
||||
do_check_true(a1.isActive);
|
||||
do_check_false(a1.userDisabled);
|
||||
@ -129,7 +129,7 @@ function run_test_2() {
|
||||
function check_test_2() {
|
||||
restartManager(0);
|
||||
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(a1) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1) {
|
||||
do_check_neq(a1, null);
|
||||
do_check_true(a1.isActive);
|
||||
do_check_false(a1.userDisabled);
|
||||
@ -141,7 +141,7 @@ function check_test_2() {
|
||||
|
||||
// Uninstalling an item pending disable should still require a restart
|
||||
function run_test_3() {
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(a1) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1) {
|
||||
prepare_test({
|
||||
"addon1@tests.mozilla.org": [
|
||||
"onDisabling"
|
||||
@ -167,7 +167,7 @@ function run_test_3() {
|
||||
function check_test_3() {
|
||||
ensure_test_completed();
|
||||
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(a1) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1) {
|
||||
do_check_neq(a1, null);
|
||||
do_check_true(hasFlag(AddonManager.PENDING_DISABLE, a1.pendingOperations));
|
||||
do_check_true(hasFlag(AddonManager.PENDING_UNINSTALL, a1.pendingOperations));
|
||||
@ -187,7 +187,7 @@ function check_test_3() {
|
||||
|
||||
// Test that uninstalling an inactive item should happen without a restart
|
||||
function run_test_4() {
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(a1) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1) {
|
||||
do_check_neq(a1, null);
|
||||
do_check_false(a1.isActive);
|
||||
do_check_true(a1.userDisabled);
|
||||
@ -206,7 +206,7 @@ function run_test_4() {
|
||||
}
|
||||
|
||||
function check_test_4() {
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(a1) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1) {
|
||||
do_check_eq(a1, null);
|
||||
|
||||
end_test();
|
||||
|
@ -81,7 +81,7 @@ function end_test() {
|
||||
|
||||
// Verify that an update is available and can be installed.
|
||||
function run_test_1() {
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(a1) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1) {
|
||||
do_check_neq(a1, null);
|
||||
do_check_eq(a1.version, "1.0");
|
||||
|
||||
@ -138,12 +138,12 @@ function run_test_2() {
|
||||
function check_test_2() {
|
||||
ensure_test_completed();
|
||||
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(olda1) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(olda1) {
|
||||
do_check_neq(olda1, null);
|
||||
do_check_eq(olda1.version, "1.0");
|
||||
restartManager(1);
|
||||
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(a1) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1) {
|
||||
do_check_neq(a1, null);
|
||||
do_check_eq(a1.version, "2.0");
|
||||
do_check_true(isExtensionInAddonsList(profileDir, a1.id));
|
||||
@ -158,7 +158,7 @@ function check_test_2() {
|
||||
|
||||
// Check that an update check finds compatibility updates and applies them
|
||||
function run_test_3() {
|
||||
AddonManager.getAddon("addon2@tests.mozilla.org", function(a2) {
|
||||
AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2) {
|
||||
do_check_neq(a2, null);
|
||||
do_check_false(a2.isActive);
|
||||
do_check_false(a2.isCompatible);
|
||||
@ -186,7 +186,7 @@ function run_test_3() {
|
||||
}
|
||||
|
||||
function check_test_3() {
|
||||
AddonManager.getAddon("addon2@tests.mozilla.org", function(a2) {
|
||||
AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2) {
|
||||
do_check_neq(a2, null);
|
||||
do_check_true(a2.isActive);
|
||||
do_check_true(a2.isCompatible);
|
||||
@ -199,7 +199,7 @@ function check_test_3() {
|
||||
|
||||
// Checks that we see no compatibility information when there is none.
|
||||
function run_test_4() {
|
||||
AddonManager.getAddon("addon3@tests.mozilla.org", function(a3) {
|
||||
AddonManager.getAddonByID("addon3@tests.mozilla.org", function(a3) {
|
||||
do_check_neq(a3, null);
|
||||
do_check_false(a3.isActive);
|
||||
do_check_false(a3.isCompatible);
|
||||
@ -232,7 +232,7 @@ function run_test_4() {
|
||||
// Checks that compatibility info for future apps are detected but don't make
|
||||
// the item compatibile.
|
||||
function run_test_5() {
|
||||
AddonManager.getAddon("addon3@tests.mozilla.org", function(a3) {
|
||||
AddonManager.getAddonByID("addon3@tests.mozilla.org", function(a3) {
|
||||
do_check_neq(a3, null);
|
||||
do_check_false(a3.isActive);
|
||||
do_check_false(a3.isCompatible);
|
||||
@ -267,7 +267,7 @@ function run_test_5() {
|
||||
}
|
||||
|
||||
function check_test_5() {
|
||||
AddonManager.getAddon("addon3@tests.mozilla.org", function(a3) {
|
||||
AddonManager.getAddonByID("addon3@tests.mozilla.org", function(a3) {
|
||||
do_check_neq(a3, null);
|
||||
do_check_false(a3.isActive);
|
||||
do_check_false(a3.isCompatible);
|
||||
@ -326,7 +326,7 @@ function check_test_6(install) {
|
||||
do_check_eq(install.existingAddon.pendingUpgrade.install, install);
|
||||
|
||||
restartManager(1);
|
||||
AddonManager.getAddon("addon1@tests.mozilla.org", function(a1) {
|
||||
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1) {
|
||||
do_check_neq(a1, null);
|
||||
do_check_eq(a1.version, "2.0");
|
||||
a1.uninstall();
|
||||
@ -375,7 +375,7 @@ function run_test_7() {
|
||||
}));
|
||||
});
|
||||
|
||||
AddonManager.getAddon("1@personas.mozilla.org", function(p1) {
|
||||
AddonManager.getAddonByID("1@personas.mozilla.org", function(p1) {
|
||||
do_check_neq(p1, null);
|
||||
do_check_eq(p1.version, "1");
|
||||
do_check_eq(p1.name, "Test LW Theme");
|
||||
@ -397,7 +397,7 @@ function run_test_7() {
|
||||
}
|
||||
|
||||
function check_test_7() {
|
||||
AddonManager.getAddon("1@personas.mozilla.org", function(p1) {
|
||||
AddonManager.getAddonByID("1@personas.mozilla.org", function(p1) {
|
||||
do_check_neq(p1, null);
|
||||
do_check_eq(p1.version, "2");
|
||||
do_check_eq(p1.name, "Updated Theme");
|
||||
@ -498,7 +498,7 @@ function run_test_8() {
|
||||
|
||||
restartManager(1);
|
||||
|
||||
AddonManager.getAddon("addon2@tests.mozilla.org", function(a2) {
|
||||
AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2) {
|
||||
a2.userDisabled = true;
|
||||
restartManager(0);
|
||||
|
||||
@ -568,13 +568,13 @@ function run_test_8() {
|
||||
request.setStatusLine(null, 500, "Server Error");
|
||||
});
|
||||
|
||||
AddonManager.getAddons(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org",
|
||||
"addon6@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5, a6]) {
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org",
|
||||
"addon4@tests.mozilla.org",
|
||||
"addon5@tests.mozilla.org",
|
||||
"addon6@tests.mozilla.org"],
|
||||
function([a1, a2, a3, a4, a5, a6]) {
|
||||
let count = 6;
|
||||
|
||||
let compatListener = {
|
||||
@ -635,7 +635,7 @@ function run_test_9() {
|
||||
|
||||
restartManager(1);
|
||||
|
||||
AddonManager.getAddon("addon4@tests.mozilla.org", function(a4) {
|
||||
AddonManager.getAddonByID("addon4@tests.mozilla.org", function(a4) {
|
||||
do_check_true(a4.isActive);
|
||||
do_check_true(a4.isCompatible);
|
||||
|
||||
@ -646,7 +646,7 @@ function run_test_9() {
|
||||
// Tests that a normal update check won't decrease a targetApplication's
|
||||
// maxVersion.
|
||||
function run_test_10() {
|
||||
AddonManager.getAddon("addon4@tests.mozilla.org", function(a4) {
|
||||
AddonManager.getAddonByID("addon4@tests.mozilla.org", function(a4) {
|
||||
a4.findUpdates({
|
||||
onUpdateFinished: function(addon) {
|
||||
do_check_true(addon.isCompatible);
|
||||
@ -660,7 +660,7 @@ function run_test_10() {
|
||||
// Tests that an update check for a new application will decrease a
|
||||
// targetApplication's maxVersion.
|
||||
function run_test_11() {
|
||||
AddonManager.getAddon("addon4@tests.mozilla.org", function(a4) {
|
||||
AddonManager.getAddonByID("addon4@tests.mozilla.org", function(a4) {
|
||||
a4.findUpdates({
|
||||
onUpdateFinished: function(addon) {
|
||||
do_check_false(addon.isCompatible);
|
||||
@ -675,7 +675,7 @@ function run_test_11() {
|
||||
function run_test_12() {
|
||||
restartManager(0);
|
||||
|
||||
AddonManager.getAddon("addon4@tests.mozilla.org", function(a4) {
|
||||
AddonManager.getAddonByID("addon4@tests.mozilla.org", function(a4) {
|
||||
do_check_false(a4.isActive);
|
||||
do_check_false(a4.isCompatible);
|
||||
|
||||
@ -706,7 +706,7 @@ function run_test_13() {
|
||||
}, dest);
|
||||
restartManager(1);
|
||||
|
||||
AddonManager.getAddon("addon7@tests.mozilla.org", function(a7) {
|
||||
AddonManager.getAddonByID("addon7@tests.mozilla.org", function(a7) {
|
||||
do_check_neq(a7, null);
|
||||
do_check_false(a7.isActive);
|
||||
do_check_false(a7.isCompatible);
|
||||
@ -733,7 +733,7 @@ function run_test_13() {
|
||||
}
|
||||
|
||||
function check_test_13() {
|
||||
AddonManager.getAddon("addon7@tests.mozilla.org", function(a7) {
|
||||
AddonManager.getAddonByID("addon7@tests.mozilla.org", function(a7) {
|
||||
do_check_neq(a7, null);
|
||||
do_check_true(a7.isActive);
|
||||
do_check_true(a7.isCompatible);
|
||||
|
@ -61,9 +61,9 @@ function run_test() {
|
||||
function run_test_1() {
|
||||
startupManager(1);
|
||||
|
||||
AddonManager.getAddons(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org"], function([a1, a2, a3]) {
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org"], function([a1, a2, a3]) {
|
||||
|
||||
do_check_neq(a1, null);
|
||||
do_check_true(isExtensionInAddonsList(profileDir, a1.id));
|
||||
@ -81,9 +81,9 @@ function run_test_1() {
|
||||
// Test that upgrading the application disables now incompatible add-ons
|
||||
function run_test_2() {
|
||||
restartManager(1, "2");
|
||||
AddonManager.getAddons(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org"], function([a1, a2, a3]) {
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org"], function([a1, a2, a3]) {
|
||||
|
||||
do_check_neq(a1, null);
|
||||
do_check_false(isExtensionInAddonsList(profileDir, a1.id));
|
||||
@ -107,9 +107,9 @@ function run_test_3() {
|
||||
file.remove(true);
|
||||
restartManager(1);
|
||||
|
||||
AddonManager.getAddons(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org"], function([a1, a2, a3]) {
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
"addon2@tests.mozilla.org",
|
||||
"addon3@tests.mozilla.org"], function([a1, a2, a3]) {
|
||||
|
||||
do_check_neq(a1, null);
|
||||
do_check_false(isExtensionInAddonsList(profileDir, a1.id));
|
||||
|
@ -523,7 +523,7 @@ var gUpdates = {
|
||||
}
|
||||
|
||||
var self = this;
|
||||
AddonManager.getAddonsByTypes(["extension", "theme", "locale"], function(addons) {
|
||||
AddonManager.getAllAddons(function(addons) {
|
||||
self.addons = [];
|
||||
addons.forEach(function(addon) {
|
||||
// If an add-on isn't appDisabled and isn't userDisabled then it is
|
||||
|
@ -1465,7 +1465,7 @@ UpdateService.prototype = {
|
||||
_checkAddonCompatibility: function AUS__checkAddonCompatibility() {
|
||||
// Get all the installed add-ons
|
||||
var self = this;
|
||||
AddonManager.getAddonsByTypes(["extension", "theme", "locale"], function(addons) {
|
||||
AddonManager.getAllAddons(function(addons) {
|
||||
self._incompatibleAddons = [];
|
||||
addons.forEach(function(addon) {
|
||||
// If an add-on isn't appDisabled and isn't userDisabled then it is
|
||||
|
Loading…
Reference in New Issue
Block a user