forked from mirrors/gecko-dev
Bug 1864896: Autofix unused function arguments (toolkit/mozapps/extensions). r=zombie
Differential Revision: https://phabricator.services.mozilla.com/D202994
This commit is contained in:
parent
0901ab454a
commit
0391afb5dc
98 changed files with 198 additions and 231 deletions
|
|
@ -102,7 +102,7 @@ export class AbuseReportError extends Error {
|
||||||
async function responseToErrorInfo(response) {
|
async function responseToErrorInfo(response) {
|
||||||
return JSON.stringify({
|
return JSON.stringify({
|
||||||
status: response.status,
|
status: response.status,
|
||||||
responseText: await response.text().catch(err => ""),
|
responseText: await response.text().catch(() => ""),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -244,7 +244,7 @@ export const AbuseReporter = {
|
||||||
}
|
}
|
||||||
|
|
||||||
let errorInfo = await responseToErrorInfo(response).catch(
|
let errorInfo = await responseToErrorInfo(response).catch(
|
||||||
err => undefined
|
() => undefined
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response.status === 404) {
|
if (response.status === 404) {
|
||||||
|
|
@ -550,7 +550,7 @@ export const AbuseReporter = {
|
||||||
* A string that identify how the report has been triggered.
|
* A string that identify how the report has been triggered.
|
||||||
*/
|
*/
|
||||||
class AbuseReport {
|
class AbuseReport {
|
||||||
constructor({ addon, createErrorType, reportData, reportEntryPoint }) {
|
constructor({ addon, reportData, reportEntryPoint }) {
|
||||||
this[PRIVATE_REPORT_PROPS] = {
|
this[PRIVATE_REPORT_PROPS] = {
|
||||||
aborted: false,
|
aborted: false,
|
||||||
abortController: new AbortController(),
|
abortController: new AbortController(),
|
||||||
|
|
@ -599,7 +599,7 @@ class AbuseReport {
|
||||||
// Leave errorInfo empty if there is no response or fails to
|
// Leave errorInfo empty if there is no response or fails to
|
||||||
// be converted into an error info object.
|
// be converted into an error info object.
|
||||||
const errorInfo = response
|
const errorInfo = response
|
||||||
? await responseToErrorInfo(response).catch(err => undefined)
|
? await responseToErrorInfo(response).catch(() => undefined)
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
throw new AbuseReportError(errorType, errorInfo);
|
throw new AbuseReportError(errorType, errorInfo);
|
||||||
|
|
|
||||||
|
|
@ -160,7 +160,7 @@ var PrefObserver = {
|
||||||
this.observe(null, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID, PREF_LOGGING_ENABLED);
|
this.observe(null, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID, PREF_LOGGING_ENABLED);
|
||||||
},
|
},
|
||||||
|
|
||||||
observe(aSubject, aTopic, aData) {
|
observe(aSubject, aTopic) {
|
||||||
if (aTopic == "xpcom-shutdown") {
|
if (aTopic == "xpcom-shutdown") {
|
||||||
Services.prefs.removeObserver(PREF_LOGGING_ENABLED, this);
|
Services.prefs.removeObserver(PREF_LOGGING_ENABLED, this);
|
||||||
Services.obs.removeObserver(this, "xpcom-shutdown");
|
Services.obs.removeObserver(this, "xpcom-shutdown");
|
||||||
|
|
@ -339,7 +339,7 @@ BrowserListener.prototype = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
observe(subject, topic, data) {
|
observe(subject) {
|
||||||
if (subject != this.messageManager) {
|
if (subject != this.messageManager) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -349,7 +349,7 @@ BrowserListener.prototype = {
|
||||||
this.cancelInstall();
|
this.cancelInstall();
|
||||||
},
|
},
|
||||||
|
|
||||||
onLocationChange(webProgress, request, location) {
|
onLocationChange() {
|
||||||
if (
|
if (
|
||||||
this.browser.contentPrincipal &&
|
this.browser.contentPrincipal &&
|
||||||
this.principal.subsumes(this.browser.contentPrincipal)
|
this.principal.subsumes(this.browser.contentPrincipal)
|
||||||
|
|
@ -361,19 +361,19 @@ BrowserListener.prototype = {
|
||||||
this.cancelInstall();
|
this.cancelInstall();
|
||||||
},
|
},
|
||||||
|
|
||||||
onDownloadCancelled(install) {
|
onDownloadCancelled() {
|
||||||
this.unregister();
|
this.unregister();
|
||||||
},
|
},
|
||||||
|
|
||||||
onDownloadFailed(install) {
|
onDownloadFailed() {
|
||||||
this.unregister();
|
this.unregister();
|
||||||
},
|
},
|
||||||
|
|
||||||
onInstallFailed(install) {
|
onInstallFailed() {
|
||||||
this.unregister();
|
this.unregister();
|
||||||
},
|
},
|
||||||
|
|
||||||
onInstallEnded(install) {
|
onInstallEnded() {
|
||||||
this.unregister();
|
this.unregister();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -553,7 +553,7 @@ var AddonManagerInternal = {
|
||||||
this.pendingProviders.add(aProvider);
|
this.pendingProviders.add(aProvider);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise(resolve => {
|
||||||
logger.debug("Calling shutdown blocker for " + name);
|
logger.debug("Calling shutdown blocker for " + name);
|
||||||
resolve(aProvider.shutdown());
|
resolve(aProvider.shutdown());
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
|
|
@ -1311,7 +1311,7 @@ var AddonManagerInternal = {
|
||||||
}
|
}
|
||||||
|
|
||||||
updates.push(
|
updates.push(
|
||||||
new Promise((resolve, reject) => {
|
new Promise(resolve => {
|
||||||
addon.findUpdates(
|
addon.findUpdates(
|
||||||
{
|
{
|
||||||
onUpdateAvailable(aAddon, aInstall) {
|
onUpdateAvailable(aAddon, aInstall) {
|
||||||
|
|
@ -3892,7 +3892,7 @@ export var AddonManagerPrivate = {
|
||||||
* This can be used as an implementation for Addon.findUpdates() when
|
* This can be used as an implementation for Addon.findUpdates() when
|
||||||
* no update mechanism is available.
|
* no update mechanism is available.
|
||||||
*/
|
*/
|
||||||
callNoUpdateListeners(addon, listener, reason, appVersion, platformVersion) {
|
callNoUpdateListeners(addon, listener) {
|
||||||
if ("onNoCompatibilityUpdateAvailable" in listener) {
|
if ("onNoCompatibilityUpdateAvailable" in listener) {
|
||||||
safeCall(listener.onNoCompatibilityUpdateAvailable.bind(listener), addon);
|
safeCall(listener.onNoCompatibilityUpdateAvailable.bind(listener), addon);
|
||||||
}
|
}
|
||||||
|
|
@ -4739,7 +4739,7 @@ AMTelemetry = {
|
||||||
|
|
||||||
// Observer Service notification callback.
|
// Observer Service notification callback.
|
||||||
|
|
||||||
observe(subject, topic, data) {
|
observe(subject, topic) {
|
||||||
switch (topic) {
|
switch (topic) {
|
||||||
case "addon-install-blocked": {
|
case "addon-install-blocked": {
|
||||||
const { installs } = subject.wrappedJSObject;
|
const { installs } = subject.wrappedJSObject;
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ RemoteMediator.prototype = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
enabled(url) {
|
enabled() {
|
||||||
let params = {
|
let params = {
|
||||||
mimetype: XPINSTALL_MIMETYPE,
|
mimetype: XPINSTALL_MIMETYPE,
|
||||||
};
|
};
|
||||||
|
|
@ -237,14 +237,14 @@ InstallTrigger.prototype = {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
startSoftwareUpdate(url, flags) {
|
startSoftwareUpdate(url) {
|
||||||
let filename = Services.io.newURI(url).QueryInterface(Ci.nsIURL).filename;
|
let filename = Services.io.newURI(url).QueryInterface(Ci.nsIURL).filename;
|
||||||
let args = {};
|
let args = {};
|
||||||
args[filename] = { URL: url };
|
args[filename] = { URL: url };
|
||||||
return this.install(args);
|
return this.install(args);
|
||||||
},
|
},
|
||||||
|
|
||||||
installChrome(type, url, skin) {
|
installChrome(type, url) {
|
||||||
return this.startSoftwareUpdate(url);
|
return this.startSoftwareUpdate(url);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ export function amManager() {
|
||||||
}
|
}
|
||||||
|
|
||||||
amManager.prototype = {
|
amManager.prototype = {
|
||||||
observe(aSubject, aTopic, aData) {
|
observe(aSubject, aTopic) {
|
||||||
switch (aTopic) {
|
switch (aTopic) {
|
||||||
case "addons-startup":
|
case "addons-startup":
|
||||||
AddonManagerPrivate.startup();
|
AddonManagerPrivate.startup();
|
||||||
|
|
@ -129,7 +129,7 @@ amManager.prototype = {
|
||||||
|
|
||||||
if (aCallback) {
|
if (aCallback) {
|
||||||
aInstall.addListener({
|
aInstall.addListener({
|
||||||
onDownloadCancelled(aInstall) {
|
onDownloadCancelled() {
|
||||||
callCallback(USER_CANCELLED);
|
callCallback(USER_CANCELLED);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -141,11 +141,11 @@ amManager.prototype = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onInstallFailed(aInstall) {
|
onInstallFailed() {
|
||||||
callCallback(EXECUTION_ERROR);
|
callCallback(EXECUTION_ERROR);
|
||||||
},
|
},
|
||||||
|
|
||||||
onInstallEnded(aInstall, aStatus) {
|
onInstallEnded() {
|
||||||
callCallback(SUCCESS);
|
callCallback(SUCCESS);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
@ -165,7 +165,7 @@ amManager.prototype = {
|
||||||
return retval;
|
return retval;
|
||||||
},
|
},
|
||||||
|
|
||||||
notify(aTimer) {
|
notify() {
|
||||||
AddonManagerPrivate.backgroundUpdateTimerHandler();
|
AddonManagerPrivate.backgroundUpdateTimerHandler();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -214,7 +214,7 @@ export class WebAPI extends APIObject {
|
||||||
|
|
||||||
super.init(window, broker, {});
|
super.init(window, broker, {});
|
||||||
|
|
||||||
window.addEventListener("unload", event => {
|
window.addEventListener("unload", () => {
|
||||||
this.broker.sendCleanup(this.allInstalls);
|
this.broker.sendCleanup(this.allInstalls);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -263,7 +263,7 @@ export class WebAPI extends APIObject {
|
||||||
return lazy.AMO_ABUSEREPORT;
|
return lazy.AMO_ABUSEREPORT;
|
||||||
}
|
}
|
||||||
|
|
||||||
eventListenerAdded(type) {
|
eventListenerAdded() {
|
||||||
if (this.listenerCount == 0) {
|
if (this.listenerCount == 0) {
|
||||||
this.broker.setAddonListener(data => {
|
this.broker.setAddonListener(data => {
|
||||||
let event = new this.window.AddonEvent(data.event, data);
|
let event = new this.window.AddonEvent(data.event, data);
|
||||||
|
|
@ -273,7 +273,7 @@ export class WebAPI extends APIObject {
|
||||||
this.listenerCount++;
|
this.listenerCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
eventListenerRemoved(type) {
|
eventListenerRemoved() {
|
||||||
this.listenerCount--;
|
this.listenerCount--;
|
||||||
if (this.listenerCount == 0) {
|
if (this.listenerCount == 0) {
|
||||||
this.broker.setAddonListener(null);
|
this.broker.setAddonListener(null);
|
||||||
|
|
|
||||||
|
|
@ -322,12 +322,12 @@ function checkForUpdate(addon) {
|
||||||
onDownloadFailed: failed,
|
onDownloadFailed: failed,
|
||||||
onInstallCancelled: failed,
|
onInstallCancelled: failed,
|
||||||
onInstallFailed: failed,
|
onInstallFailed: failed,
|
||||||
onInstallEnded: (...args) => {
|
onInstallEnded: () => {
|
||||||
detachUpdateHandler(install);
|
detachUpdateHandler(install);
|
||||||
install.removeListener(updateListener);
|
install.removeListener(updateListener);
|
||||||
resolve({ installed: true, pending: false, found: true });
|
resolve({ installed: true, pending: false, found: true });
|
||||||
},
|
},
|
||||||
onInstallPostponed: (...args) => {
|
onInstallPostponed: () => {
|
||||||
detachUpdateHandler(install);
|
detachUpdateHandler(install);
|
||||||
install.removeListener(updateListener);
|
install.removeListener(updateListener);
|
||||||
resolve({ installed: false, pending: true, found: true });
|
resolve({ installed: false, pending: true, found: true });
|
||||||
|
|
@ -375,7 +375,7 @@ const OPTIONS_TYPE_MAP = {
|
||||||
|
|
||||||
// Check if an add-on has the provided options type, accounting for the pref
|
// Check if an add-on has the provided options type, accounting for the pref
|
||||||
// to disable inline options.
|
// to disable inline options.
|
||||||
function getOptionsType(addon, type) {
|
function getOptionsType(addon) {
|
||||||
return OPTIONS_TYPE_MAP[addon.optionsType];
|
return OPTIONS_TYPE_MAP[addon.optionsType];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1064,7 +1064,7 @@ class AddonPageOptions extends HTMLElement {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkForUpdates(e) {
|
async checkForUpdates() {
|
||||||
let message = document.getElementById("updates-message");
|
let message = document.getElementById("updates-message");
|
||||||
message.state = "updating";
|
message.state = "updating";
|
||||||
message.hidden = false;
|
message.hidden = false;
|
||||||
|
|
@ -2096,11 +2096,11 @@ class AddonDetails extends HTMLElement {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onDisabled(addon) {
|
onDisabled() {
|
||||||
this.extensionShutdown();
|
this.extensionShutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
onEnabled(addon) {
|
onEnabled() {
|
||||||
this.extensionStartup();
|
this.extensionStartup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2968,18 +2968,18 @@ class AddonCard extends HTMLElement {
|
||||||
this.sendEvent("update-postponed");
|
this.sendEvent("update-postponed");
|
||||||
}
|
}
|
||||||
|
|
||||||
onDisabled(addon) {
|
onDisabled() {
|
||||||
if (!this.reloading) {
|
if (!this.reloading) {
|
||||||
this.update();
|
this.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onEnabled(addon) {
|
onEnabled() {
|
||||||
this.reloading = false;
|
this.reloading = false;
|
||||||
this.update();
|
this.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
onInstalled(addon) {
|
onInstalled() {
|
||||||
// When a temporary addon is reloaded, onInstalled is triggered instead of
|
// When a temporary addon is reloaded, onInstalled is triggered instead of
|
||||||
// onEnabled.
|
// onEnabled.
|
||||||
this.reloading = false;
|
this.reloading = false;
|
||||||
|
|
|
||||||
|
|
@ -185,7 +185,7 @@ async function openAbuseReport({ addonId, reportEntryPoint }) {
|
||||||
// to be async, but it is so that both the implementations will be providing
|
// to be async, but it is so that both the implementations will be providing
|
||||||
// the same type signatures (returning a promise) to the callers, independently
|
// the same type signatures (returning a promise) to the callers, independently
|
||||||
// from which abuse reporting feature is enabled.
|
// from which abuse reporting feature is enabled.
|
||||||
async function openAbuseReportAMOForm({ addonId, reportEntryPoint }) {
|
async function openAbuseReportAMOForm({ addonId }) {
|
||||||
const amoUrl = AbuseReporter.getAMOFormURL({ addonId });
|
const amoUrl = AbuseReporter.getAMOFormURL({ addonId });
|
||||||
windowRoot.ownerGlobal.openTrustedLinkIn(amoUrl, "tab", {
|
windowRoot.ownerGlobal.openTrustedLinkIn(amoUrl, "tab", {
|
||||||
// Make sure the newly open tab is going to be focused, independently
|
// Make sure the newly open tab is going to be focused, independently
|
||||||
|
|
|
||||||
|
|
@ -283,7 +283,7 @@ ChromeUtils.defineESModuleGetters(this, {
|
||||||
}
|
}
|
||||||
|
|
||||||
return Object.entries(modifierMap)
|
return Object.entries(modifierMap)
|
||||||
.filter(([key, isDown]) => isDown)
|
.filter(([, isDown]) => isDown)
|
||||||
.map(([key]) => key)
|
.map(([key]) => key)
|
||||||
.concat(getStringForEvent(e))
|
.concat(getStringForEvent(e))
|
||||||
.join("+");
|
.join("+");
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ var gViewController = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
observe(subject, topic, data) {
|
observe(subject, topic) {
|
||||||
if (topic == "EM-ping") {
|
if (topic == "EM-ping") {
|
||||||
this.readyForLoadView = true;
|
this.readyForLoadView = true;
|
||||||
Services.obs.notifyObservers(window, "EM-pong");
|
Services.obs.notifyObservers(window, "EM-pong");
|
||||||
|
|
|
||||||
|
|
@ -466,13 +466,13 @@ export var AddonRepository = {
|
||||||
request.open("GET", url, true);
|
request.open("GET", url, true);
|
||||||
request.responseType = "json";
|
request.responseType = "json";
|
||||||
|
|
||||||
request.addEventListener("error", aEvent => {
|
request.addEventListener("error", () => {
|
||||||
reject(new Error(`GET ${url} failed`));
|
reject(new Error(`GET ${url} failed`));
|
||||||
});
|
});
|
||||||
request.addEventListener("timeout", aEvent => {
|
request.addEventListener("timeout", () => {
|
||||||
reject(new Error(`GET ${url} timed out`));
|
reject(new Error(`GET ${url} timed out`));
|
||||||
});
|
});
|
||||||
request.addEventListener("load", aEvent => {
|
request.addEventListener("load", () => {
|
||||||
let response = request.response;
|
let response = request.response;
|
||||||
if (!response || (request.status != 200 && request.status != 0)) {
|
if (!response || (request.status != 200 && request.status != 0)) {
|
||||||
reject(new Error(`GET ${url} failed (status ${request.status})`));
|
reject(new Error(`GET ${url} failed (status ${request.status})`));
|
||||||
|
|
|
||||||
|
|
@ -340,7 +340,7 @@ GMPWrapper.prototype = {
|
||||||
return { source: "gmp-plugin" };
|
return { source: "gmp-plugin" };
|
||||||
},
|
},
|
||||||
|
|
||||||
isCompatibleWith(aAppVersion, aPlatformVersion) {
|
isCompatibleWith() {
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -377,7 +377,7 @@ GMPWrapper.prototype = {
|
||||||
* Widevine is not yet installed, or if the user toggles prefs to enable EME.
|
* Widevine is not yet installed, or if the user toggles prefs to enable EME.
|
||||||
* For the function used in those cases see `checkForUpdates`.
|
* For the function used in those cases see `checkForUpdates`.
|
||||||
*/
|
*/
|
||||||
findUpdates(aListener, aReason, aAppVersion, aPlatformVersion) {
|
findUpdates(aListener, aReason) {
|
||||||
this._log.trace(
|
this._log.trace(
|
||||||
"findUpdates() - " + this._plugin.id + " - reason=" + aReason
|
"findUpdates() - " + this._plugin.id + " - reason=" + aReason
|
||||||
);
|
);
|
||||||
|
|
@ -895,7 +895,7 @@ var GMPProvider = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
observe(subject, topic, data) {
|
observe(subject, topic) {
|
||||||
if (topic == FIRST_CONTENT_PROCESS_TOPIC) {
|
if (topic == FIRST_CONTENT_PROCESS_TOPIC) {
|
||||||
lazy.AddonManagerPrivate.registerProvider(GMPProvider, ["plugin"]);
|
lazy.AddonManagerPrivate.registerProvider(GMPProvider, ["plugin"]);
|
||||||
Services.obs.notifyObservers(null, "gmp-provider-registered");
|
Services.obs.notifyObservers(null, "gmp-provider-registered");
|
||||||
|
|
|
||||||
|
|
@ -422,7 +422,7 @@ function downloadFile(url, options = { httpsOnlyNoUpgrade: false }) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
let sr = new lazy.ServiceRequest();
|
let sr = new lazy.ServiceRequest();
|
||||||
|
|
||||||
sr.onload = function (response) {
|
sr.onload = function () {
|
||||||
logger.info("downloadFile File download. status=" + sr.status);
|
logger.info("downloadFile File download. status=" + sr.status);
|
||||||
if (sr.status != 200 && sr.status != 206) {
|
if (sr.status != 200 && sr.status != 206) {
|
||||||
reject(Components.Exception("File download failed", sr.status));
|
reject(Components.Exception("File download failed", sr.status));
|
||||||
|
|
|
||||||
|
|
@ -190,7 +190,7 @@ class SitePermsAddonWrapper {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateBlocklistState(options = {}) {}
|
async updateBlocklistState() {}
|
||||||
|
|
||||||
get blocklistState() {
|
get blocklistState() {
|
||||||
return Ci.nsIBlocklistService.STATE_NOT_BLOCKED;
|
return Ci.nsIBlocklistService.STATE_NOT_BLOCKED;
|
||||||
|
|
@ -277,7 +277,7 @@ class SitePermsAddonWrapper {
|
||||||
return { source: "siteperm-addon-provider", method: "synthetic-install" };
|
return { source: "siteperm-addon-provider", method: "synthetic-install" };
|
||||||
}
|
}
|
||||||
|
|
||||||
isCompatibleWith(aAppVersion, aPlatformVersion) {
|
isCompatibleWith() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2175,7 +2175,7 @@ export const XPIDatabase = {
|
||||||
*/
|
*/
|
||||||
async verifySignatures() {
|
async verifySignatures() {
|
||||||
try {
|
try {
|
||||||
let addons = await this.getAddonList(a => true);
|
let addons = await this.getAddonList(() => true);
|
||||||
|
|
||||||
let changes = {
|
let changes = {
|
||||||
enabled: [],
|
enabled: [],
|
||||||
|
|
@ -2426,7 +2426,7 @@ export const XPIDatabase = {
|
||||||
if (!this.addonDB) {
|
if (!this.addonDB) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
return _filterDB(this.addonDB, aAddon => true);
|
return _filterDB(this.addonDB, () => true);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -3084,24 +3084,11 @@ export const XPIDatabaseReconcile = {
|
||||||
* The new state of the add-on
|
* The new state of the add-on
|
||||||
* @param {AddonInternal?} [aNewAddon]
|
* @param {AddonInternal?} [aNewAddon]
|
||||||
* The manifest for the new add-on if it has already been loaded
|
* The manifest for the new add-on if it has already been loaded
|
||||||
* @param {string?} [aOldAppVersion]
|
|
||||||
* The version of the application last run with this profile or null
|
|
||||||
* if it is a new profile or the version is unknown
|
|
||||||
* @param {string?} [aOldPlatformVersion]
|
|
||||||
* The version of the platform last run with this profile or null
|
|
||||||
* if it is a new profile or the version is unknown
|
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
* A boolean indicating if flushing caches is required to complete
|
* A boolean indicating if flushing caches is required to complete
|
||||||
* changing this add-on
|
* changing this add-on
|
||||||
*/
|
*/
|
||||||
addMetadata(
|
addMetadata(aLocation, aId, aAddonState, aNewAddon) {
|
||||||
aLocation,
|
|
||||||
aId,
|
|
||||||
aAddonState,
|
|
||||||
aNewAddon,
|
|
||||||
aOldAppVersion,
|
|
||||||
aOldPlatformVersion
|
|
||||||
) {
|
|
||||||
logger.debug(`New add-on ${aId} installed in ${aLocation.name}`);
|
logger.debug(`New add-on ${aId} installed in ${aLocation.name}`);
|
||||||
|
|
||||||
// We treat this is a new install if,
|
// We treat this is a new install if,
|
||||||
|
|
|
||||||
|
|
@ -287,7 +287,7 @@ DirPackage = class DirPackage extends Package {
|
||||||
return IOUtils.read(PathUtils.join(this.filePath, ...path));
|
return IOUtils.read(PathUtils.join(this.filePath, ...path));
|
||||||
}
|
}
|
||||||
|
|
||||||
async verifySignedStateForRoot(addonId, root) {
|
async verifySignedStateForRoot() {
|
||||||
return { signedState: AddonManager.SIGNEDSTATE_UNKNOWN, cert: null };
|
return { signedState: AddonManager.SIGNEDSTATE_UNKNOWN, cert: null };
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -2321,7 +2321,7 @@ var DownloadAddonInstall = class extends AddonInstall {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
observe(aSubject, aTopic, aData) {
|
observe() {
|
||||||
// Network is going offline
|
// Network is going offline
|
||||||
this.cancel();
|
this.cancel();
|
||||||
}
|
}
|
||||||
|
|
@ -2592,7 +2592,7 @@ var DownloadAddonInstall = class extends AddonInstall {
|
||||||
new UpdateChecker(
|
new UpdateChecker(
|
||||||
this.addon,
|
this.addon,
|
||||||
{
|
{
|
||||||
onUpdateFinished: aAddon => this.downloadCompleted(),
|
onUpdateFinished: () => this.downloadCompleted(),
|
||||||
},
|
},
|
||||||
AddonManager.UPDATE_WHEN_ADDON_INSTALLED
|
AddonManager.UPDATE_WHEN_ADDON_INSTALLED
|
||||||
);
|
);
|
||||||
|
|
@ -3880,7 +3880,7 @@ class SystemAddonInstaller extends DirectoryInstaller {
|
||||||
}
|
}
|
||||||
|
|
||||||
// old system add-on upgrade dirs get automatically removed
|
// old system add-on upgrade dirs get automatically removed
|
||||||
uninstallAddon(aAddon) {}
|
uninstallAddon() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
var AppUpdate = {
|
var AppUpdate = {
|
||||||
|
|
|
||||||
|
|
@ -1598,7 +1598,7 @@ var XPIStates = {
|
||||||
*
|
*
|
||||||
* @returns {XPIState?}
|
* @returns {XPIState?}
|
||||||
*/
|
*/
|
||||||
findAddon(aId, aFilter = location => true) {
|
findAddon(aId, aFilter = () => true) {
|
||||||
// Fortunately the Map iterator returns in order of insertion, which is
|
// Fortunately the Map iterator returns in order of insertion, which is
|
||||||
// also our highest -> lowest priority order.
|
// also our highest -> lowest priority order.
|
||||||
for (let location of this.locations()) {
|
for (let location of this.locations()) {
|
||||||
|
|
@ -2706,7 +2706,7 @@ export var XPIProvider = {
|
||||||
"profile-before-change",
|
"profile-before-change",
|
||||||
"test-load-xpi-database",
|
"test-load-xpi-database",
|
||||||
];
|
];
|
||||||
let observer = (subject, topic, data) => {
|
let observer = (subject, topic) => {
|
||||||
if (
|
if (
|
||||||
topic == "xul-window-visible" &&
|
topic == "xul-window-visible" &&
|
||||||
!Services.wm.getMostRecentWindow("devtools:toolbox")
|
!Services.wm.getMostRecentWindow("devtools:toolbox")
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ const ADDON_SEARCH_RESULTS = {};
|
||||||
|
|
||||||
const mockAddonRepository = ({ addons = [] }) => {
|
const mockAddonRepository = ({ addons = [] }) => {
|
||||||
return {
|
return {
|
||||||
async getMappedAddons(browserID, extensionIDs) {
|
async getMappedAddons() {
|
||||||
return Promise.resolve({
|
return Promise.resolve({
|
||||||
addons,
|
addons,
|
||||||
matchedIDs: [],
|
matchedIDs: [],
|
||||||
|
|
|
||||||
|
|
@ -17,22 +17,22 @@ var gInstallProperties = [
|
||||||
var gInstall;
|
var gInstall;
|
||||||
var gExpectedCancel = false;
|
var gExpectedCancel = false;
|
||||||
var gTestInstallListener = {
|
var gTestInstallListener = {
|
||||||
onInstallStarted(aInstall) {
|
onInstallStarted() {
|
||||||
check_hidden(false);
|
check_hidden(false);
|
||||||
},
|
},
|
||||||
|
|
||||||
onInstallEnded(aInstall) {
|
onInstallEnded() {
|
||||||
check_hidden(false);
|
check_hidden(false);
|
||||||
run_next_test();
|
run_next_test();
|
||||||
},
|
},
|
||||||
|
|
||||||
onInstallCancelled(aInstall) {
|
onInstallCancelled() {
|
||||||
ok(gExpectedCancel, "Should expect install cancel");
|
ok(gExpectedCancel, "Should expect install cancel");
|
||||||
check_hidden(false);
|
check_hidden(false);
|
||||||
run_next_test();
|
run_next_test();
|
||||||
},
|
},
|
||||||
|
|
||||||
onInstallFailed(aInstall) {
|
onInstallFailed() {
|
||||||
ok(false, "Did not expect onInstallFailed");
|
ok(false, "Did not expect onInstallFailed");
|
||||||
run_next_test();
|
run_next_test();
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ const dragService = Cc["@mozilla.org/widget/dragservice;1"].getService(
|
||||||
async function checkInstallConfirmation(...names) {
|
async function checkInstallConfirmation(...names) {
|
||||||
let notificationCount = 0;
|
let notificationCount = 0;
|
||||||
let observer = {
|
let observer = {
|
||||||
observe(aSubject, aTopic, aData) {
|
observe(aSubject) {
|
||||||
let installInfo = aSubject.wrappedJSObject;
|
let installInfo = aSubject.wrappedJSObject;
|
||||||
isnot(
|
isnot(
|
||||||
installInfo.browser,
|
installInfo.browser,
|
||||||
|
|
|
||||||
|
|
@ -603,7 +603,7 @@ add_task(async function test_abusereport_messagebars() {
|
||||||
await AbuseReportTestUtils.promiseReportRendered();
|
await AbuseReportTestUtils.promiseReportRendered();
|
||||||
AbuseReportTestUtils.triggerSubmit("fake-reason", "fake-message");
|
AbuseReportTestUtils.triggerSubmit("fake-reason", "fake-message");
|
||||||
},
|
},
|
||||||
([submittingDetails, submittedDetails]) => {
|
([, submittedDetails]) => {
|
||||||
const buttonsL10nId = Array.from(
|
const buttonsL10nId = Array.from(
|
||||||
submittedDetails.messagebar.querySelectorAll("button")
|
submittedDetails.messagebar.querySelectorAll("button")
|
||||||
).map(el => el.getAttribute("data-l10n-id"));
|
).map(el => el.getAttribute("data-l10n-id"));
|
||||||
|
|
@ -634,10 +634,8 @@ add_task(async function test_abusereport_messagebars() {
|
||||||
await addon.uninstall(true);
|
await addon.uninstall(true);
|
||||||
AbuseReportTestUtils.triggerSubmit("fake-reason", "fake-message");
|
AbuseReportTestUtils.triggerSubmit("fake-reason", "fake-message");
|
||||||
};
|
};
|
||||||
const assertMessageBarDetails = async ([
|
const assertMessageBarDetails = async ([, submittedDetails]) =>
|
||||||
submittingDetails,
|
AbuseReportTestUtils.assertFluentStrings(submittedDetails.messagebar);
|
||||||
submittedDetails,
|
|
||||||
]) => AbuseReportTestUtils.assertFluentStrings(submittedDetails.messagebar);
|
|
||||||
await assertMessageBars(
|
await assertMessageBars(
|
||||||
["submitting", "submitted-and-removed"],
|
["submitting", "submitted-and-removed"],
|
||||||
testFn,
|
testFn,
|
||||||
|
|
@ -657,7 +655,7 @@ add_task(async function test_abusereport_messagebars() {
|
||||||
await AbuseReportTestUtils.promiseReportRendered();
|
await AbuseReportTestUtils.promiseReportRendered();
|
||||||
AbuseReportTestUtils.triggerSubmit("fake-reason", "fake-message");
|
AbuseReportTestUtils.triggerSubmit("fake-reason", "fake-message");
|
||||||
},
|
},
|
||||||
([submittingDetails, submittedDetails]) =>
|
([, submittedDetails]) =>
|
||||||
AbuseReportTestUtils.assertFluentStrings(submittedDetails.messagebar)
|
AbuseReportTestUtils.assertFluentStrings(submittedDetails.messagebar)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ class DiscoveryAPIHandler {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
unblockResponses(responseText) {
|
unblockResponses() {
|
||||||
throw new Error("You need to call blockNextResponses first!");
|
throw new Error("You need to call blockNextResponses first!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,7 @@ async function installAddon({ card, recommendedList, manifestExtra = {} }) {
|
||||||
return extension;
|
return extension;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function testListRecommendations({ type, manifestExtra = {} }) {
|
async function testListRecommendations({ type }) {
|
||||||
let win = await loadInitialView(type);
|
let win = await loadInitialView(type);
|
||||||
let doc = win.document;
|
let doc = win.document;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ add_task(async function testChangeAutoUpdates() {
|
||||||
let win = await loadInitialView("extension");
|
let win = await loadInitialView("extension");
|
||||||
let doc = win.document;
|
let doc = win.document;
|
||||||
|
|
||||||
let getInputs = updateRow => ({
|
let getInputs = () => ({
|
||||||
default: updatesRow.querySelector('input[value="1"]'),
|
default: updatesRow.querySelector('input[value="1"]'),
|
||||||
on: updatesRow.querySelector('input[value="2"]'),
|
on: updatesRow.querySelector('input[value="2"]'),
|
||||||
off: updatesRow.querySelector('input[value="0"]'),
|
off: updatesRow.querySelector('input[value="0"]'),
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ MockFilePicker.init(window.browsingContext);
|
||||||
async function checkInstallConfirmation(...names) {
|
async function checkInstallConfirmation(...names) {
|
||||||
let notificationCount = 0;
|
let notificationCount = 0;
|
||||||
let observer = {
|
let observer = {
|
||||||
observe(aSubject, aTopic, aData) {
|
observe(aSubject) {
|
||||||
var installInfo = aSubject.wrappedJSObject;
|
var installInfo = aSubject.wrappedJSObject;
|
||||||
isnot(
|
isnot(
|
||||||
installInfo.browser,
|
installInfo.browser,
|
||||||
|
|
|
||||||
|
|
@ -235,7 +235,7 @@ add_task(async function testDuplicateShortcutOnMacOSCtrlKey() {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const clearWarning = async inputEl => {
|
const clearWarning = async () => {
|
||||||
anotherCommandInput.blur();
|
anotherCommandInput.blur();
|
||||||
await TestUtils.waitForCondition(
|
await TestUtils.waitForCondition(
|
||||||
() => BrowserTestUtils.isHidden(errorEl),
|
() => BrowserTestUtils.isHidden(errorEl),
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ function installLocale() {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
gInstall = gProvider.createInstalls(gInstallProperties)[0];
|
gInstall = gProvider.createInstalls(gInstallProperties)[0];
|
||||||
gInstall.addTestListener({
|
gInstall.addTestListener({
|
||||||
onInstallEnded(aInstall) {
|
onInstallEnded() {
|
||||||
gInstall.removeTestListener(this);
|
gInstall.removeTestListener(this);
|
||||||
resolve();
|
resolve();
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -25,14 +25,7 @@ var gStart = 0;
|
||||||
var gLast = 0;
|
var gLast = 0;
|
||||||
|
|
||||||
var HTTPObserver = {
|
var HTTPObserver = {
|
||||||
observeActivity(
|
observeActivity(aChannel, aType, aSubtype) {
|
||||||
aChannel,
|
|
||||||
aType,
|
|
||||||
aSubtype,
|
|
||||||
aTimestamp,
|
|
||||||
aSizeData,
|
|
||||||
aStringData
|
|
||||||
) {
|
|
||||||
aChannel.QueryInterface(Ci.nsIChannel);
|
aChannel.QueryInterface(Ci.nsIChannel);
|
||||||
|
|
||||||
dump(
|
dump(
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ async function testInstall(browser, args, steps, description) {
|
||||||
let receivedEvents = [];
|
let receivedEvents = [];
|
||||||
let prevEvent = null;
|
let prevEvent = null;
|
||||||
events.forEach(event => {
|
events.forEach(event => {
|
||||||
install.addEventListener(event, e => {
|
install.addEventListener(event, () => {
|
||||||
receivedEvents.push({
|
receivedEvents.push({
|
||||||
event,
|
event,
|
||||||
state: install.state,
|
state: install.state,
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ add_task(async function test_theme_install() {
|
||||||
|
|
||||||
await BrowserTestUtils.withNewTab(TESTPAGE, async browser => {
|
await BrowserTestUtils.withNewTab(TESTPAGE, async browser => {
|
||||||
let updates = [];
|
let updates = [];
|
||||||
function observer(subject, topic, data) {
|
function observer(subject) {
|
||||||
updates.push(JSON.stringify(subject.wrappedJSObject));
|
updates.push(JSON.stringify(subject.wrappedJSObject));
|
||||||
}
|
}
|
||||||
Services.obs.addObserver(observer, "lightweight-theme-styling-update");
|
Services.obs.addObserver(observer, "lightweight-theme-styling-update");
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,7 @@ function run_next_test() {
|
||||||
executeSoon(() => log_exceptions(test));
|
executeSoon(() => log_exceptions(test));
|
||||||
}
|
}
|
||||||
|
|
||||||
var get_tooltip_info = async function (addonEl, managerWindow) {
|
var get_tooltip_info = async function (addonEl) {
|
||||||
// Extract from title attribute.
|
// Extract from title attribute.
|
||||||
const { addon } = addonEl;
|
const { addon } = addonEl;
|
||||||
const name = addon.name;
|
const name = addon.name;
|
||||||
|
|
@ -324,7 +324,7 @@ function open_manager(
|
||||||
aLongerTimeout,
|
aLongerTimeout,
|
||||||
aWin = window
|
aWin = window
|
||||||
) {
|
) {
|
||||||
let p = new Promise((resolve, reject) => {
|
let p = new Promise(resolve => {
|
||||||
async function setup_manager(aManagerWindow) {
|
async function setup_manager(aManagerWindow) {
|
||||||
if (aLoadCallback) {
|
if (aLoadCallback) {
|
||||||
log_exceptions(aLoadCallback, aManagerWindow);
|
log_exceptions(aLoadCallback, aManagerWindow);
|
||||||
|
|
@ -354,7 +354,7 @@ function open_manager(
|
||||||
}
|
}
|
||||||
|
|
||||||
info("Loading manager window in tab");
|
info("Loading manager window in tab");
|
||||||
Services.obs.addObserver(function observer(aSubject, aTopic, aData) {
|
Services.obs.addObserver(function observer(aSubject, aTopic) {
|
||||||
Services.obs.removeObserver(observer, aTopic);
|
Services.obs.removeObserver(observer, aTopic);
|
||||||
if (aSubject.location.href != MANAGER_URI) {
|
if (aSubject.location.href != MANAGER_URI) {
|
||||||
info("Ignoring load event for " + aSubject.location.href);
|
info("Ignoring load event for " + aSubject.location.href);
|
||||||
|
|
@ -434,7 +434,7 @@ function wait_for_window_open(aCallback) {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
onCloseWindow(aWindow) {},
|
onCloseWindow() {},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -487,7 +487,7 @@ function promiseAddonsByIDs(aIDs) {
|
||||||
*/
|
*/
|
||||||
async function install_addon(path, cb, pathPrefix = TESTROOT) {
|
async function install_addon(path, cb, pathPrefix = TESTROOT) {
|
||||||
let install = await AddonManager.getInstallForURL(pathPrefix + path);
|
let install = await AddonManager.getInstallForURL(pathPrefix + path);
|
||||||
let p = new Promise((resolve, reject) => {
|
let p = new Promise(resolve => {
|
||||||
install.addListener({
|
install.addListener({
|
||||||
onInstallEnded: () => resolve(install.addon),
|
onInstallEnded: () => resolve(install.addon),
|
||||||
});
|
});
|
||||||
|
|
@ -946,7 +946,7 @@ MockProvider.prototype = {
|
||||||
* true if the newly enabled add-on will only become enabled after a
|
* true if the newly enabled add-on will only become enabled after a
|
||||||
* restart
|
* restart
|
||||||
*/
|
*/
|
||||||
addonChanged: function MP_addonChanged(aId, aType, aPendingRestart) {
|
addonChanged: function MP_addonChanged() {
|
||||||
// Not implemented
|
// Not implemented
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -965,7 +965,7 @@ MockProvider.prototype = {
|
||||||
* @param {object} aOptions
|
* @param {object} aOptions
|
||||||
* Options for the install
|
* Options for the install
|
||||||
*/
|
*/
|
||||||
getInstallForURL: function MP_getInstallForURL(aUrl, aOptions) {
|
getInstallForURL: function MP_getInstallForURL() {
|
||||||
// Not yet implemented
|
// Not yet implemented
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -975,7 +975,7 @@ MockProvider.prototype = {
|
||||||
* @param aFile
|
* @param aFile
|
||||||
* The file to be installed
|
* The file to be installed
|
||||||
*/
|
*/
|
||||||
getInstallForFile: function MP_getInstallForFile(aFile) {
|
getInstallForFile: function MP_getInstallForFile() {
|
||||||
// Not yet implemented
|
// Not yet implemented
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -996,7 +996,7 @@ MockProvider.prototype = {
|
||||||
* The mimetype to check for
|
* The mimetype to check for
|
||||||
* @return true if the mimetype is supported
|
* @return true if the mimetype is supported
|
||||||
*/
|
*/
|
||||||
supportsMimetype: function MP_supportsMimetype(aMimetype) {
|
supportsMimetype: function MP_supportsMimetype() {
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -1007,7 +1007,7 @@ MockProvider.prototype = {
|
||||||
* The URI being installed from
|
* The URI being installed from
|
||||||
* @return true if installing is allowed
|
* @return true if installing is allowed
|
||||||
*/
|
*/
|
||||||
isInstallAllowed: function MP_isInstallAllowed(aUri) {
|
isInstallAllowed: function MP_isInstallAllowed() {
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
@ -1143,11 +1143,11 @@ MockAddon.prototype = {
|
||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
|
|
||||||
isCompatibleWith(aAppVersion, aPlatformVersion) {
|
isCompatibleWith() {
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
findUpdates(aListener, aReason, aAppVersion, aPlatformVersion) {
|
findUpdates() {
|
||||||
// Tests can implement this if they need to
|
// Tests can implement this if they need to
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ function waitForNewWindow() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function waitClosedWindow(win) {
|
function waitClosedWindow(win) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise(resolve => {
|
||||||
function onWindowClosed() {
|
function onWindowClosed() {
|
||||||
if (win && !win.closed) {
|
if (win && !win.closed) {
|
||||||
// If a specific window reference has been passed, then check
|
// If a specific window reference has been passed, then check
|
||||||
|
|
@ -215,7 +215,7 @@ const AbuseReportTestUtils = {
|
||||||
return abuseReportEl.ownerGlobal.ABUSE_REPORT_REASONS[reason];
|
return abuseReportEl.ownerGlobal.ABUSE_REPORT_REASONS[reason];
|
||||||
},
|
},
|
||||||
|
|
||||||
async promiseReportOpened({ addonId, reportEntryPoint, managerWindow }) {
|
async promiseReportOpened({ addonId, reportEntryPoint }) {
|
||||||
let abuseReportEl;
|
let abuseReportEl;
|
||||||
|
|
||||||
if (!this.getReportDialog()) {
|
if (!this.getReportDialog()) {
|
||||||
|
|
|
||||||
|
|
@ -935,7 +935,7 @@ class EventChecker {
|
||||||
return this.checkAddonEvent("onInstalled", addon);
|
return this.checkAddonEvent("onInstalled", addon);
|
||||||
}
|
}
|
||||||
|
|
||||||
onUninstalling(addon, requiresRestart) {
|
onUninstalling(addon) {
|
||||||
return this.checkAddonEvent("onUninstalling", addon);
|
return this.checkAddonEvent("onUninstalling", addon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1033,7 +1033,7 @@ class EventChecker {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onInstallEnded(install, newAddon) {
|
onInstallEnded(install) {
|
||||||
return this.checkInstall("onInstallEnded", install, {
|
return this.checkInstall("onInstallEnded", install, {
|
||||||
state: "STATE_INSTALLED",
|
state: "STATE_INSTALLED",
|
||||||
error: 0,
|
error: 0,
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ AddonManager.addExternalExtensionLoader({
|
||||||
Object.assign(addon, manifest);
|
Object.assign(addon, manifest);
|
||||||
return addon;
|
return addon;
|
||||||
},
|
},
|
||||||
loadScope(addon, file) {
|
loadScope() {
|
||||||
return {
|
return {
|
||||||
install() {},
|
install() {},
|
||||||
uninstall() {},
|
uninstall() {},
|
||||||
|
|
|
||||||
|
|
@ -227,7 +227,7 @@ function createAddon(addon) {
|
||||||
* If a lastTest is provided checks that the notification dialog got passed
|
* If a lastTest is provided checks that the notification dialog got passed
|
||||||
* the newly blocked items compared to the previous test.
|
* the newly blocked items compared to the previous test.
|
||||||
*/
|
*/
|
||||||
async function checkState(test, lastTest, callback) {
|
async function checkState(test) {
|
||||||
let addons = await AddonManager.getAddonsByIDs(ADDONS.map(a => a.id));
|
let addons = await AddonManager.getAddonsByIDs(ADDONS.map(a => a.id));
|
||||||
|
|
||||||
const bls = Ci.nsIBlocklistService;
|
const bls = Ci.nsIBlocklistService;
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ add_task(async function collapse_multiple_pending_update_requests() {
|
||||||
// Add a spy to the RemoteSettings client, so we can verify that the number
|
// Add a spy to the RemoteSettings client, so we can verify that the number
|
||||||
// of RemoteSettings accesses matches with what we expect.
|
// of RemoteSettings accesses matches with what we expect.
|
||||||
const originalClientGet = ExtensionBlocklistMLBF._client.get;
|
const originalClientGet = ExtensionBlocklistMLBF._client.get;
|
||||||
const spyClientGet = (tag, returnValue) => {
|
const spyClientGet = tag => {
|
||||||
ExtensionBlocklistMLBF._client.get = async function () {
|
ExtensionBlocklistMLBF._client.get = async function () {
|
||||||
// Record the method call.
|
// Record the method call.
|
||||||
observed.push(tag);
|
observed.push(tag);
|
||||||
|
|
|
||||||
|
|
@ -451,7 +451,7 @@ add_task(async function test_pt4() {
|
||||||
await promiseRestartManager();
|
await promiseRestartManager();
|
||||||
await checkInitialState();
|
await checkInitialState();
|
||||||
|
|
||||||
await loadBlocklist("empty", args => {
|
await loadBlocklist("empty", () => {
|
||||||
dump("Checking notification pt 4\n");
|
dump("Checking notification pt 4\n");
|
||||||
// See note in other callback - we no longer notify for non-blocked add-ons.
|
// See note in other callback - we no longer notify for non-blocked add-ons.
|
||||||
ok(false, "Should not get a notification as there are no blocked addons.");
|
ok(false, "Should not get a notification as there are no blocked addons.");
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ const useMLBF = Services.prefs.getBoolPref(
|
||||||
|
|
||||||
var testserver = createHttpServer({ hosts: ["example.com"] });
|
var testserver = createHttpServer({ hosts: ["example.com"] });
|
||||||
|
|
||||||
function permissionPromptHandler(subject, topic, data) {
|
function permissionPromptHandler(subject) {
|
||||||
ok(
|
ok(
|
||||||
subject?.wrappedJSObject?.info?.resolve,
|
subject?.wrappedJSObject?.info?.resolve,
|
||||||
"Got a permission prompt notification as expected"
|
"Got a permission prompt notification as expected"
|
||||||
|
|
@ -343,16 +343,16 @@ function Pload_blocklist(aId) {
|
||||||
// Does a background update check for add-ons and returns a promise that
|
// Does a background update check for add-ons and returns a promise that
|
||||||
// resolves when any started installs complete
|
// resolves when any started installs complete
|
||||||
function Pbackground_update() {
|
function Pbackground_update() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise(resolve => {
|
||||||
let installCount = 0;
|
let installCount = 0;
|
||||||
let backgroundCheckCompleted = false;
|
let backgroundCheckCompleted = false;
|
||||||
|
|
||||||
AddonManager.addInstallListener({
|
AddonManager.addInstallListener({
|
||||||
onNewInstall(aInstall) {
|
onNewInstall() {
|
||||||
installCount++;
|
installCount++;
|
||||||
},
|
},
|
||||||
|
|
||||||
onInstallEnded(aInstall) {
|
onInstallEnded() {
|
||||||
installCount--;
|
installCount--;
|
||||||
// Wait until all started installs have completed
|
// Wait until all started installs have completed
|
||||||
if (installCount) {
|
if (installCount) {
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ async function run_test() {
|
||||||
do_test_finished();
|
do_test_finished();
|
||||||
}
|
}
|
||||||
|
|
||||||
Services.obs.addObserver(function (aSubject, aTopic, aData) {
|
Services.obs.addObserver(function () {
|
||||||
// If we wait until after we go through the event loop, gfxInfo is sure to
|
// If we wait until after we go through the event loop, gfxInfo is sure to
|
||||||
// have processed the gfxItems event.
|
// have processed the gfxItems event.
|
||||||
executeSoon(checkBlacklist);
|
executeSoon(checkBlacklist);
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ async function run_test() {
|
||||||
do_test_finished();
|
do_test_finished();
|
||||||
}
|
}
|
||||||
|
|
||||||
Services.obs.addObserver(function (aSubject, aTopic, aData) {
|
Services.obs.addObserver(function () {
|
||||||
// If we wait until after we go through the event loop, gfxInfo is sure to
|
// If we wait until after we go through the event loop, gfxInfo is sure to
|
||||||
// have processed the gfxItems event.
|
// have processed the gfxItems event.
|
||||||
executeSoon(checkBlacklist);
|
executeSoon(checkBlacklist);
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ async function run_test() {
|
||||||
do_test_finished();
|
do_test_finished();
|
||||||
}
|
}
|
||||||
|
|
||||||
Services.obs.addObserver(function (aSubject, aTopic, aData) {
|
Services.obs.addObserver(function () {
|
||||||
// If we wait until after we go through the event loop, gfxInfo is sure to
|
// If we wait until after we go through the event loop, gfxInfo is sure to
|
||||||
// have processed the gfxItems event.
|
// have processed the gfxItems event.
|
||||||
executeSoon(checkBlacklist);
|
executeSoon(checkBlacklist);
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ async function run_test() {
|
||||||
do_test_finished();
|
do_test_finished();
|
||||||
}
|
}
|
||||||
|
|
||||||
Services.obs.addObserver(function (aSubject, aTopic, aData) {
|
Services.obs.addObserver(function () {
|
||||||
// If we wait until after we go through the event loop, gfxInfo is sure to
|
// If we wait until after we go through the event loop, gfxInfo is sure to
|
||||||
// have processed the gfxItems event.
|
// have processed the gfxItems event.
|
||||||
executeSoon(checkBlacklist);
|
executeSoon(checkBlacklist);
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ async function run_test() {
|
||||||
do_test_finished();
|
do_test_finished();
|
||||||
}
|
}
|
||||||
|
|
||||||
Services.obs.addObserver(function (aSubject, aTopic, aData) {
|
Services.obs.addObserver(function () {
|
||||||
// If we wait until after we go through the event loop, gfxInfo is sure to
|
// If we wait until after we go through the event loop, gfxInfo is sure to
|
||||||
// have processed the gfxItems event.
|
// have processed the gfxItems event.
|
||||||
executeSoon(checkBlacklist);
|
executeSoon(checkBlacklist);
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ async function run_test() {
|
||||||
do_test_finished();
|
do_test_finished();
|
||||||
}
|
}
|
||||||
|
|
||||||
Services.obs.addObserver(function (aSubject, aTopic, aData) {
|
Services.obs.addObserver(function () {
|
||||||
// If we wait until after we go through the event loop, gfxInfo is sure to
|
// If we wait until after we go through the event loop, gfxInfo is sure to
|
||||||
// have processed the gfxItems event.
|
// have processed the gfxItems event.
|
||||||
executeSoon(checkBlacklist);
|
executeSoon(checkBlacklist);
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ async function run_test() {
|
||||||
do_test_finished();
|
do_test_finished();
|
||||||
}
|
}
|
||||||
|
|
||||||
Services.obs.addObserver(function (aSubject, aTopic, aData) {
|
Services.obs.addObserver(function () {
|
||||||
// If we wait until after we go through the event loop, gfxInfo is sure to
|
// If we wait until after we go through the event loop, gfxInfo is sure to
|
||||||
// have processed the gfxItems event.
|
// have processed the gfxItems event.
|
||||||
executeSoon(checkBlacklist);
|
executeSoon(checkBlacklist);
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ async function run_test() {
|
||||||
do_test_finished();
|
do_test_finished();
|
||||||
}
|
}
|
||||||
|
|
||||||
Services.obs.addObserver(function (aSubject, aTopic, aData) {
|
Services.obs.addObserver(function () {
|
||||||
// If we wait until after we go through the event loop, gfxInfo is sure to
|
// If we wait until after we go through the event loop, gfxInfo is sure to
|
||||||
// have processed the gfxItems event.
|
// have processed the gfxItems event.
|
||||||
executeSoon(checkBlacklist);
|
executeSoon(checkBlacklist);
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ async function run_test() {
|
||||||
do_test_finished();
|
do_test_finished();
|
||||||
}
|
}
|
||||||
|
|
||||||
Services.obs.addObserver(function (aSubject, aTopic, aData) {
|
Services.obs.addObserver(function () {
|
||||||
// If we wait until after we go through the event loop, gfxInfo is sure to
|
// If we wait until after we go through the event loop, gfxInfo is sure to
|
||||||
// have processed the gfxItems event.
|
// have processed the gfxItems event.
|
||||||
executeSoon(checkBlacklist);
|
executeSoon(checkBlacklist);
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ async function run_test() {
|
||||||
do_test_finished();
|
do_test_finished();
|
||||||
}
|
}
|
||||||
|
|
||||||
Services.obs.addObserver(function (aSubject, aTopic, aData) {
|
Services.obs.addObserver(function () {
|
||||||
// If we wait until after we go through the event loop, gfxInfo is sure to
|
// If we wait until after we go through the event loop, gfxInfo is sure to
|
||||||
// have processed the gfxItems event.
|
// have processed the gfxItems event.
|
||||||
executeSoon(checkBlacklist);
|
executeSoon(checkBlacklist);
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ async function run_test() {
|
||||||
do_test_finished();
|
do_test_finished();
|
||||||
}
|
}
|
||||||
|
|
||||||
Services.obs.addObserver(function (aSubject, aTopic, aData) {
|
Services.obs.addObserver(function () {
|
||||||
// If we wait until after we go through the event loop, gfxInfo is sure to
|
// If we wait until after we go through the event loop, gfxInfo is sure to
|
||||||
// have processed the gfxItems event.
|
// have processed the gfxItems event.
|
||||||
executeSoon(checkBlacklist);
|
executeSoon(checkBlacklist);
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ async function run_test() {
|
||||||
do_test_finished();
|
do_test_finished();
|
||||||
}
|
}
|
||||||
|
|
||||||
Services.obs.addObserver(function (aSubject, aTopic, aData) {
|
Services.obs.addObserver(function () {
|
||||||
// If we wait until after we go through the event loop, gfxInfo is sure to
|
// If we wait until after we go through the event loop, gfxInfo is sure to
|
||||||
// have processed the gfxItems event.
|
// have processed the gfxItems event.
|
||||||
executeSoon(checkBlacklist);
|
executeSoon(checkBlacklist);
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ async function run_test() {
|
||||||
do_test_finished();
|
do_test_finished();
|
||||||
}
|
}
|
||||||
|
|
||||||
Services.obs.addObserver(function (aSubject, aTopic, aData) {
|
Services.obs.addObserver(function () {
|
||||||
// If we wait until after we go through the event loop, gfxInfo is sure to
|
// If we wait until after we go through the event loop, gfxInfo is sure to
|
||||||
// have processed the gfxItems event.
|
// have processed the gfxItems event.
|
||||||
executeSoon(checkBlacklist);
|
executeSoon(checkBlacklist);
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ async function run_test() {
|
||||||
do_test_finished();
|
do_test_finished();
|
||||||
}
|
}
|
||||||
|
|
||||||
Services.obs.addObserver(function (aSubject, aTopic, aData) {
|
Services.obs.addObserver(function () {
|
||||||
// If we wait until after we go through the event loop, gfxInfo is sure to
|
// If we wait until after we go through the event loop, gfxInfo is sure to
|
||||||
// have processed the gfxItems event.
|
// have processed the gfxItems event.
|
||||||
executeSoon(checkBlacklist);
|
executeSoon(checkBlacklist);
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,7 @@ async function run_test() {
|
||||||
do_test_finished();
|
do_test_finished();
|
||||||
}
|
}
|
||||||
|
|
||||||
Services.obs.addObserver(function (aSubject, aTopic, aData) {
|
Services.obs.addObserver(function () {
|
||||||
// If we wait until after we go through the event loop, gfxInfo is sure to
|
// If we wait until after we go through the event loop, gfxInfo is sure to
|
||||||
// have processed the gfxItems event.
|
// have processed the gfxItems event.
|
||||||
executeSoon(checkBlocklist);
|
executeSoon(checkBlocklist);
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ async function run_test() {
|
||||||
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");
|
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");
|
||||||
await promiseStartupManager();
|
await promiseStartupManager();
|
||||||
|
|
||||||
function blacklistAdded(aSubject, aTopic, aData) {
|
function blacklistAdded() {
|
||||||
// If we wait until after we go through the event loop, gfxInfo is sure to
|
// If we wait until after we go through the event loop, gfxInfo is sure to
|
||||||
// have processed the gfxItems event.
|
// have processed the gfxItems event.
|
||||||
executeSoon(ensureBlacklistSet);
|
executeSoon(ensureBlacklistSet);
|
||||||
|
|
@ -95,7 +95,7 @@ async function run_test() {
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function blacklistRemoved(aSubject, aTopic, aData) {
|
function blacklistRemoved() {
|
||||||
// If we wait until after we go through the event loop, gfxInfo is sure to
|
// If we wait until after we go through the event loop, gfxInfo is sure to
|
||||||
// have processed the gfxItems event.
|
// have processed the gfxItems event.
|
||||||
executeSoon(ensureBlacklistUnset);
|
executeSoon(ensureBlacklistUnset);
|
||||||
|
|
|
||||||
|
|
@ -800,11 +800,7 @@ add_task(async function test_report_recommended() {
|
||||||
});
|
});
|
||||||
|
|
||||||
add_task(async function test_query_amo_details() {
|
add_task(async function test_query_amo_details() {
|
||||||
async function assertReportOnAMODetails({
|
async function assertReportOnAMODetails({ addonId, expectedReport } = {}) {
|
||||||
addonId,
|
|
||||||
addonType = "extension",
|
|
||||||
expectedReport,
|
|
||||||
} = {}) {
|
|
||||||
// Clear last report timestamp and any telemetry event recorded so far.
|
// Clear last report timestamp and any telemetry event recorded so far.
|
||||||
clearAbuseReportState();
|
clearAbuseReportState();
|
||||||
Services.telemetry.clearEvents();
|
Services.telemetry.clearEvents();
|
||||||
|
|
|
||||||
|
|
@ -465,7 +465,7 @@ function check_cache(aExpectedToFind, aExpectedImmediately) {
|
||||||
|
|
||||||
for (let i = 0; i < REPOSITORY_ADDONS.length; i++) {
|
for (let i = 0; i < REPOSITORY_ADDONS.length; i++) {
|
||||||
lookups.push(
|
lookups.push(
|
||||||
new Promise((resolve, reject) => {
|
new Promise(resolve => {
|
||||||
let immediatelyFound = true;
|
let immediatelyFound = true;
|
||||||
let expected = aExpectedToFind[i] ? REPOSITORY_ADDONS[i] : null;
|
let expected = aExpectedToFind[i] ? REPOSITORY_ADDONS[i] : null;
|
||||||
// can't Promise-wrap this because we're also testing whether the callback is
|
// can't Promise-wrap this because we're also testing whether the callback is
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,7 @@ function promiseLocaleChanged(requestedLocale) {
|
||||||
}
|
}
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
let localeObserver = {
|
let localeObserver = {
|
||||||
observe(aSubject, aTopic, aData) {
|
observe(aSubject, aTopic) {
|
||||||
switch (aTopic) {
|
switch (aTopic) {
|
||||||
case REQ_LOC_CHANGE_EVENT:
|
case REQ_LOC_CHANGE_EVENT:
|
||||||
let reqLocs = Services.locale.requestedLocales;
|
let reqLocs = Services.locale.requestedLocales;
|
||||||
|
|
@ -169,7 +169,7 @@ function promiseLocaleChanged(requestedLocale) {
|
||||||
|
|
||||||
function promiseMetaDataUpdate() {
|
function promiseMetaDataUpdate() {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
let listener = args => {
|
let listener = () => {
|
||||||
Services.prefs.removeObserver(PREF_METADATA_LASTUPDATE, listener);
|
Services.prefs.removeObserver(PREF_METADATA_LASTUPDATE, listener);
|
||||||
resolve();
|
resolve();
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ function getTelemetryEvents(includeMethods = EVENT_METHODS) {
|
||||||
);
|
);
|
||||||
|
|
||||||
return snapshot.parent
|
return snapshot.parent
|
||||||
.filter(([timestamp, category, method]) => {
|
.filter(([, category, method]) => {
|
||||||
const includeMethod = includeMethods
|
const includeMethod = includeMethods
|
||||||
? includeMethods.includes(method)
|
? includeMethods.includes(method)
|
||||||
: true;
|
: true;
|
||||||
|
|
@ -68,11 +68,9 @@ function assertNoTelemetryEvents() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let filteredEvents = snapshot.parent.filter(
|
let filteredEvents = snapshot.parent.filter(([_timestamp, category]) => {
|
||||||
([timestamp, category, method]) => {
|
|
||||||
return category === EVENT_CATEGORY;
|
return category === EVENT_CATEGORY;
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
Assert.deepEqual(filteredEvents, [], "Got no AMTelemetry events as expected");
|
Assert.deepEqual(filteredEvents, [], "Got no AMTelemetry events as expected");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -206,7 +206,7 @@ add_task(async function delay_updates_complete() {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
background() {
|
background() {
|
||||||
browser.runtime.onUpdateAvailable.addListener(details => {
|
browser.runtime.onUpdateAvailable.addListener(() => {
|
||||||
browser.test.notifyPass("reload");
|
browser.test.notifyPass("reload");
|
||||||
browser.runtime.reload();
|
browser.runtime.reload();
|
||||||
});
|
});
|
||||||
|
|
@ -273,7 +273,7 @@ add_task(async function delay_updates_defer() {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
background() {
|
background() {
|
||||||
browser.runtime.onUpdateAvailable.addListener(details => {
|
browser.runtime.onUpdateAvailable.addListener(() => {
|
||||||
// Upgrade will only proceed when "allow" message received.
|
// Upgrade will only proceed when "allow" message received.
|
||||||
browser.test.onMessage.addListener(msg => {
|
browser.test.onMessage.addListener(msg => {
|
||||||
if (msg == "allow") {
|
if (msg == "allow") {
|
||||||
|
|
@ -371,7 +371,7 @@ add_task(async function delay_updates_staged() {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
background() {
|
background() {
|
||||||
browser.runtime.onUpdateAvailable.addListener(details => {
|
browser.runtime.onUpdateAvailable.addListener(() => {
|
||||||
browser.test.sendMessage("denied");
|
browser.test.sendMessage("denied");
|
||||||
});
|
});
|
||||||
browser.test.sendMessage("ready");
|
browser.test.sendMessage("ready");
|
||||||
|
|
@ -443,7 +443,7 @@ add_task(async function delay_updates_staged_no_update_url() {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
background() {
|
background() {
|
||||||
browser.runtime.onUpdateAvailable.addListener(details => {
|
browser.runtime.onUpdateAvailable.addListener(() => {
|
||||||
browser.test.sendMessage("denied");
|
browser.test.sendMessage("denied");
|
||||||
});
|
});
|
||||||
browser.test.sendMessage("ready");
|
browser.test.sendMessage("ready");
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@ function testInstallEvent(expectTelemetry) {
|
||||||
|
|
||||||
let events = snapshot.parent
|
let events = snapshot.parent
|
||||||
.filter(
|
.filter(
|
||||||
([timestamp, category, method, object, value, extra]) =>
|
([, category, method, , , extra]) =>
|
||||||
category === "addonsManager" &&
|
category === "addonsManager" &&
|
||||||
method == "install" &&
|
method == "install" &&
|
||||||
extra.step == expectTelemetry.step
|
extra.step == expectTelemetry.step
|
||||||
|
|
@ -229,15 +229,13 @@ function promiseCompleteWebInstall(
|
||||||
installInfo.install();
|
installInfo.install();
|
||||||
});
|
});
|
||||||
|
|
||||||
TestUtils.topicObserved("addon-install-confirmation").then(
|
TestUtils.topicObserved("addon-install-confirmation").then(subject => {
|
||||||
(subject, data) => {
|
|
||||||
info(`==== test got addon-install-confirmation`);
|
info(`==== test got addon-install-confirmation`);
|
||||||
let installInfo = subject.wrappedJSObject;
|
let installInfo = subject.wrappedJSObject;
|
||||||
for (let installer of installInfo.installs) {
|
for (let installer of installInfo.installs) {
|
||||||
installer.install();
|
installer.install();
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
);
|
|
||||||
TestUtils.topicObserved("webextension-permission-prompt").then(
|
TestUtils.topicObserved("webextension-permission-prompt").then(
|
||||||
([subject]) => {
|
([subject]) => {
|
||||||
const { info } = subject.wrappedJSObject || {};
|
const { info } = subject.wrappedJSObject || {};
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ class TestListener {
|
||||||
|
|
||||||
function startListener(listener) {
|
function startListener(listener) {
|
||||||
let observer = {
|
let observer = {
|
||||||
observe(subject, topic, data) {
|
observe(subject) {
|
||||||
let channel = subject.QueryInterface(Ci.nsIHttpChannel);
|
let channel = subject.QueryInterface(Ci.nsIHttpChannel);
|
||||||
if (channel.URI.spec === "http://example.com/addons/test.xpi") {
|
if (channel.URI.spec === "http://example.com/addons/test.xpi") {
|
||||||
let channelListener = new TestListener(listener);
|
let channelListener = new TestListener(listener);
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ function mockAddonProvider(name) {
|
||||||
|
|
||||||
AddonManager.isInstallEnabled("made-up-mimetype");
|
AddonManager.isInstallEnabled("made-up-mimetype");
|
||||||
},
|
},
|
||||||
supportsMimetype(mimetype) {
|
supportsMimetype() {
|
||||||
this.apiAccessed = true;
|
this.apiAccessed = true;
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ function mockAddonProvider(aName) {
|
||||||
mockProvider.doneResolve = resolve;
|
mockProvider.doneResolve = resolve;
|
||||||
mockProvider.doneReject = reject;
|
mockProvider.doneReject = reject;
|
||||||
});
|
});
|
||||||
mockProvider.shutdownPromise = new Promise((resolve, reject) => {
|
mockProvider.shutdownPromise = new Promise(resolve => {
|
||||||
mockProvider.shutdownResolve = resolve;
|
mockProvider.shutdownResolve = resolve;
|
||||||
});
|
});
|
||||||
return mockProvider;
|
return mockProvider;
|
||||||
|
|
|
||||||
|
|
@ -99,11 +99,11 @@ add_task(async function test_can_reload_permanent_addon() {
|
||||||
let disabledCalled = false;
|
let disabledCalled = false;
|
||||||
let enabledCalled = false;
|
let enabledCalled = false;
|
||||||
AddonManager.addAddonListener({
|
AddonManager.addAddonListener({
|
||||||
onDisabled: aAddon => {
|
onDisabled: () => {
|
||||||
Assert.ok(!enabledCalled);
|
Assert.ok(!enabledCalled);
|
||||||
disabledCalled = true;
|
disabledCalled = true;
|
||||||
},
|
},
|
||||||
onEnabled: aAddon => {
|
onEnabled: () => {
|
||||||
Assert.ok(disabledCalled);
|
Assert.ok(disabledCalled);
|
||||||
enabledCalled = true;
|
enabledCalled = true;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ add_task(async function test_no_change() {
|
||||||
await manuallyInstall(do_get_file(`${DATA}/signed2.xpi`), profileDir, ID);
|
await manuallyInstall(do_get_file(`${DATA}/signed2.xpi`), profileDir, ID);
|
||||||
|
|
||||||
let listener = {
|
let listener = {
|
||||||
onPropetyChanged(_addon, properties) {
|
onPropetyChanged(_addon) {
|
||||||
Assert.ok(false, `Got unexpected onPropertyChanged for ${_addon.id}`);
|
Assert.ok(false, `Got unexpected onPropertyChanged for ${_addon.id}`);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ registerCleanupFunction(() => {
|
||||||
distroDir.remove(true);
|
distroDir.remove(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddonTestUtils.usePrivilegedSignatures = id => "system";
|
AddonTestUtils.usePrivilegedSignatures = () => "system";
|
||||||
|
|
||||||
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "42");
|
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "42");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ add_task(async function test_app_addons() {
|
||||||
`http://localhost:${gServer.identity.primaryPort}/get?%IDS%`
|
`http://localhost:${gServer.identity.primaryPort}/get?%IDS%`
|
||||||
);
|
);
|
||||||
|
|
||||||
gServer.registerPathHandler("/get", (request, response) => {
|
gServer.registerPathHandler("/get", () => {
|
||||||
do_throw("Unexpected request to server.");
|
do_throw("Unexpected request to server.");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
const updatesDir = FileUtils.getDir("ProfD", ["features"]);
|
const updatesDir = FileUtils.getDir("ProfD", ["features"]);
|
||||||
|
|
||||||
AddonTestUtils.usePrivilegedSignatures = id => "system";
|
AddonTestUtils.usePrivilegedSignatures = () => "system";
|
||||||
|
|
||||||
add_task(async function setup() {
|
add_task(async function setup() {
|
||||||
// Build the test sets
|
// Build the test sets
|
||||||
|
|
@ -489,7 +489,7 @@ add_task(async function test_bad_app_cert() {
|
||||||
|
|
||||||
await promiseShutdownManager();
|
await promiseShutdownManager();
|
||||||
|
|
||||||
AddonTestUtils.usePrivilegedSignatures = id => "system";
|
AddonTestUtils.usePrivilegedSignatures = () => "system";
|
||||||
});
|
});
|
||||||
|
|
||||||
// A failed upgrade should revert to the default set.
|
// A failed upgrade should revert to the default set.
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ let distroDir = FileUtils.getDir("ProfD", ["sysfeatures", "empty"]);
|
||||||
distroDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
|
distroDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
|
||||||
registerDirectory("XREAppFeat", distroDir);
|
registerDirectory("XREAppFeat", distroDir);
|
||||||
|
|
||||||
AddonTestUtils.usePrivilegedSignatures = id => "system";
|
AddonTestUtils.usePrivilegedSignatures = () => "system";
|
||||||
|
|
||||||
add_task(() => initSystemAddonDirs());
|
add_task(() => initSystemAddonDirs());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ let distroDir = FileUtils.getDir("ProfD", ["sysfeatures", "empty"]);
|
||||||
distroDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
|
distroDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
|
||||||
registerDirectory("XREAppFeat", distroDir);
|
registerDirectory("XREAppFeat", distroDir);
|
||||||
|
|
||||||
AddonTestUtils.usePrivilegedSignatures = id => "system";
|
AddonTestUtils.usePrivilegedSignatures = () => "system";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the set of initial conditions to run each test against. Each should
|
* Defines the set of initial conditions to run each test against. Each should
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ let distroDir = FileUtils.getDir("ProfD", ["sysfeatures", "empty"]);
|
||||||
distroDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
|
distroDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
|
||||||
registerDirectory("XREAppFeat", distroDir);
|
registerDirectory("XREAppFeat", distroDir);
|
||||||
|
|
||||||
AddonTestUtils.usePrivilegedSignatures = id => "system";
|
AddonTestUtils.usePrivilegedSignatures = () => "system";
|
||||||
|
|
||||||
add_task(initSystemAddonDirs);
|
add_task(initSystemAddonDirs);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ let distroDir = FileUtils.getDir("ProfD", ["sysfeatures", "empty"]);
|
||||||
distroDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
|
distroDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
|
||||||
registerDirectory("XREAppFeat", distroDir);
|
registerDirectory("XREAppFeat", distroDir);
|
||||||
|
|
||||||
AddonTestUtils.usePrivilegedSignatures = id => "system";
|
AddonTestUtils.usePrivilegedSignatures = () => "system";
|
||||||
|
|
||||||
add_task(() => initSystemAddonDirs());
|
add_task(() => initSystemAddonDirs());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ let distroDir = FileUtils.getDir("ProfD", ["sysfeatures", "empty"]);
|
||||||
distroDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
|
distroDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
|
||||||
registerDirectory("XREAppFeat", distroDir);
|
registerDirectory("XREAppFeat", distroDir);
|
||||||
|
|
||||||
AddonTestUtils.usePrivilegedSignatures = id => "system";
|
AddonTestUtils.usePrivilegedSignatures = () => "system";
|
||||||
|
|
||||||
add_task(() => initSystemAddonDirs());
|
add_task(() => initSystemAddonDirs());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ let distroDir = FileUtils.getDir("ProfD", ["sysfeatures", "empty"]);
|
||||||
distroDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
|
distroDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
|
||||||
registerDirectory("XREAppFeat", distroDir);
|
registerDirectory("XREAppFeat", distroDir);
|
||||||
|
|
||||||
AddonTestUtils.usePrivilegedSignatures = id => "system";
|
AddonTestUtils.usePrivilegedSignatures = () => "system";
|
||||||
|
|
||||||
add_task(() => initSystemAddonDirs());
|
add_task(() => initSystemAddonDirs());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ distroDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
|
||||||
registerDirectory("XREAppFeat", distroDir);
|
registerDirectory("XREAppFeat", distroDir);
|
||||||
add_task(() => initSystemAddonDirs());
|
add_task(() => initSystemAddonDirs());
|
||||||
|
|
||||||
AddonTestUtils.usePrivilegedSignatures = id => "system";
|
AddonTestUtils.usePrivilegedSignatures = () => "system";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the set of initial conditions to run each test against. Each should
|
* Defines the set of initial conditions to run each test against. Each should
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ add_task(async function test_systems_update_uninstall_check() {
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const listener = (msg, { method, params, reason }) => {
|
const listener = (msg, { method, params }) => {
|
||||||
if (params.id === "system2@tests.mozilla.org" && method === "uninstall") {
|
if (params.id === "system2@tests.mozilla.org" && method === "uninstall") {
|
||||||
Assert.ok(
|
Assert.ok(
|
||||||
false,
|
false,
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ let distroDir = FileUtils.getDir("ProfD", ["sysfeatures", "empty"]);
|
||||||
distroDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
|
distroDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
|
||||||
registerDirectory("XREAppFeat", distroDir);
|
registerDirectory("XREAppFeat", distroDir);
|
||||||
|
|
||||||
AddonTestUtils.usePrivilegedSignatures = id => "system";
|
AddonTestUtils.usePrivilegedSignatures = () => "system";
|
||||||
|
|
||||||
add_task(() => initSystemAddonDirs());
|
add_task(() => initSystemAddonDirs());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ const systemDefaults = FileUtils.getDir("ProfD", [
|
||||||
systemDefaults.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
|
systemDefaults.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
|
||||||
registerDirectory("XREAppFeat", systemDefaults);
|
registerDirectory("XREAppFeat", systemDefaults);
|
||||||
|
|
||||||
AddonTestUtils.usePrivilegedSignatures = id => "system";
|
AddonTestUtils.usePrivilegedSignatures = () => "system";
|
||||||
|
|
||||||
const ADDON_ID = "updates@test";
|
const ADDON_ID = "updates@test";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ add_task(async function test_new_temporary() {
|
||||||
Assert.equal(aInstall.version, "1.0");
|
Assert.equal(aInstall.version, "1.0");
|
||||||
installedCalled = true;
|
installedCalled = true;
|
||||||
},
|
},
|
||||||
onInstallStarted: aInstall => {
|
onInstallStarted: () => {
|
||||||
do_throw("onInstallStarted called unexpectedly");
|
do_throw("onInstallStarted called unexpectedly");
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
@ -416,7 +416,7 @@ add_task(async function test_replace_permanent() {
|
||||||
}
|
}
|
||||||
installedCalled = true;
|
installedCalled = true;
|
||||||
},
|
},
|
||||||
onInstallStarted: aInstall => {
|
onInstallStarted: () => {
|
||||||
do_throw("onInstallStarted called unexpectedly");
|
do_throw("onInstallStarted called unexpectedly");
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -595,9 +595,7 @@ add_task(async function test_params() {
|
||||||
let resultsPromise = new Promise(resolve => {
|
let resultsPromise = new Promise(resolve => {
|
||||||
let results = new Map();
|
let results = new Map();
|
||||||
|
|
||||||
testserver.registerPathHandler(
|
testserver.registerPathHandler("/data/param_test.json", function (request) {
|
||||||
"/data/param_test.json",
|
|
||||||
function (request, response) {
|
|
||||||
let params = new URLSearchParams(request.queryString);
|
let params = new URLSearchParams(request.queryString);
|
||||||
let itemId = params.get("item_id");
|
let itemId = params.get("item_id");
|
||||||
ok(
|
ok(
|
||||||
|
|
@ -612,8 +610,7 @@ add_task(async function test_params() {
|
||||||
}
|
}
|
||||||
|
|
||||||
request.setStatusLine(null, 500, "Server Error");
|
request.setStatusLine(null, 500, "Server Error");
|
||||||
}
|
});
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
let addons = await getAddons(PARAM_IDS);
|
let addons = await getAddons(PARAM_IDS);
|
||||||
|
|
@ -746,11 +743,11 @@ add_task(async function test_no_auto_update() {
|
||||||
equal(aInstall.existingAddon.id, "addon1@tests.mozilla.org");
|
equal(aInstall.existingAddon.id, "addon1@tests.mozilla.org");
|
||||||
},
|
},
|
||||||
|
|
||||||
onDownloadFailed(aInstall) {
|
onDownloadFailed() {
|
||||||
ok(false, "Should not have seen onDownloadFailed event");
|
ok(false, "Should not have seen onDownloadFailed event");
|
||||||
},
|
},
|
||||||
|
|
||||||
onDownloadCancelled(aInstall) {
|
onDownloadCancelled() {
|
||||||
ok(false, "Should not have seen onDownloadCancelled event");
|
ok(false, "Should not have seen onDownloadCancelled event");
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -764,11 +761,11 @@ add_task(async function test_no_auto_update() {
|
||||||
resolve();
|
resolve();
|
||||||
},
|
},
|
||||||
|
|
||||||
onInstallFailed(aInstall) {
|
onInstallFailed() {
|
||||||
ok(false, "Should not have seen onInstallFailed event");
|
ok(false, "Should not have seen onInstallFailed event");
|
||||||
},
|
},
|
||||||
|
|
||||||
onInstallCancelled(aInstall) {
|
onInstallCancelled() {
|
||||||
ok(false, "Should not have seen onInstallCancelled event");
|
ok(false, "Should not have seen onInstallCancelled event");
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ function makeCancelListener() {
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
onUpdateAvailable(addon, install) {
|
onUpdateAvailable() {
|
||||||
reject("Should not have seen onUpdateAvailable notification");
|
reject("Should not have seen onUpdateAvailable notification");
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ add_task(async function test_update_theme_to_extension() {
|
||||||
|
|
||||||
await Assert.rejects(
|
await Assert.rejects(
|
||||||
install.install(),
|
install.install(),
|
||||||
err => install.error == AddonManager.ERROR_UNEXPECTED_ADDON_TYPE,
|
() => install.error == AddonManager.ERROR_UNEXPECTED_ADDON_TYPE,
|
||||||
"Refusing to change addon type from theme to extension"
|
"Refusing to change addon type from theme to extension"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ add_task(async function test_systems_update_uninstall_check() {
|
||||||
await setupSystemAddonConditions(initialSetup, distroDir);
|
await setupSystemAddonConditions(initialSetup, distroDir);
|
||||||
|
|
||||||
const testserver = createHttpServer({ hosts: ["example.com"] });
|
const testserver = createHttpServer({ hosts: ["example.com"] });
|
||||||
testserver.registerPathHandler("/update.json", (request, response) => {
|
testserver.registerPathHandler("/update.json", request => {
|
||||||
Assert.ok(
|
Assert.ok(
|
||||||
!request._queryString.includes("system2@tests.mozilla.org"),
|
!request._queryString.includes("system2@tests.mozilla.org"),
|
||||||
"System addon should not request update from normal update process"
|
"System addon should not request update from normal update process"
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ add_task(async function test_update_new_id() {
|
||||||
|
|
||||||
await Assert.rejects(
|
await Assert.rejects(
|
||||||
install.install(),
|
install.install(),
|
||||||
err => install.error == AddonManager.ERROR_INCORRECT_ID,
|
() => install.error == AddonManager.ERROR_INCORRECT_ID,
|
||||||
"Upgrade to a different ID fails"
|
"Upgrade to a different ID fails"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ add_task(async function test_update_version_mismatch() {
|
||||||
|
|
||||||
await Assert.rejects(
|
await Assert.rejects(
|
||||||
install.install(),
|
install.install(),
|
||||||
err => install.error == AddonManager.ERROR_UNEXPECTED_ADDON_VERSION,
|
() => install.error == AddonManager.ERROR_UNEXPECTED_ADDON_VERSION,
|
||||||
"Should refuse installation when downloaded version does not match"
|
"Should refuse installation when downloaded version does not match"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ function get_auth_info() {
|
||||||
return ["testuser", "testpass"];
|
return ["testuser", "testpass"];
|
||||||
}
|
}
|
||||||
|
|
||||||
function download_failed(install) {
|
function download_failed() {
|
||||||
ok(false, "Install should not have failed");
|
ok(false, "Install should not have failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ function get_auth_info() {
|
||||||
return ["testuser", "testpass"];
|
return ["testuser", "testpass"];
|
||||||
}
|
}
|
||||||
|
|
||||||
function download_failed(install) {
|
function download_failed() {
|
||||||
ok(false, "Install should not have failed");
|
ok(false, "Install should not have failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ function allow_blocked(installInfo) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function confirm_install(panel) {
|
function confirm_install() {
|
||||||
ok(false, "Should not see the install dialog");
|
ok(false, "Should not see the install dialog");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ function allow_blocked(installInfo) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function confirm_install(panel) {
|
function confirm_install() {
|
||||||
ok(false, "Should not see the install dialog");
|
ok(false, "Should not see the install dialog");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ function test() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function confirm_install(panel) {
|
function confirm_install() {
|
||||||
ok(false, "Should not see the install dialog");
|
ok(false, "Should not see the install dialog");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ async function waitForProgressNotification(
|
||||||
let topic = getObserverTopic(notificationId);
|
let topic = getObserverTopic(notificationId);
|
||||||
|
|
||||||
let observerPromise = new Promise(resolve => {
|
let observerPromise = new Promise(resolve => {
|
||||||
Services.obs.addObserver(function observer(aSubject, aTopic, aData) {
|
Services.obs.addObserver(function observer(aSubject, aTopic) {
|
||||||
// Ignore the progress notification unless that is the notification we want
|
// Ignore the progress notification unless that is the notification we want
|
||||||
if (
|
if (
|
||||||
notificationId != PROGRESS_NOTIFICATION &&
|
notificationId != PROGRESS_NOTIFICATION &&
|
||||||
|
|
@ -208,7 +208,7 @@ async function waitForNotification(
|
||||||
let observerPromise;
|
let observerPromise;
|
||||||
if (aId !== "addon-webext-permissions") {
|
if (aId !== "addon-webext-permissions") {
|
||||||
observerPromise = new Promise(resolve => {
|
observerPromise = new Promise(resolve => {
|
||||||
Services.obs.addObserver(function observer(aSubject, aTopic, aData) {
|
Services.obs.addObserver(function observer(aSubject, aTopic) {
|
||||||
// Ignore the progress notification unless that is the notification we want
|
// Ignore the progress notification unless that is the notification we want
|
||||||
if (
|
if (
|
||||||
aId != PROGRESS_NOTIFICATION &&
|
aId != PROGRESS_NOTIFICATION &&
|
||||||
|
|
@ -298,7 +298,7 @@ function acceptInstallDialog(installDialog) {
|
||||||
installDialog.button.click();
|
installDialog.button.click();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function waitForSingleNotification(aCallback) {
|
async function waitForSingleNotification() {
|
||||||
while (PopupNotifications.panel.childNodes.length != 1) {
|
while (PopupNotifications.panel.childNodes.length != 1) {
|
||||||
await new Promise(resolve => executeSoon(resolve));
|
await new Promise(resolve => executeSoon(resolve));
|
||||||
|
|
||||||
|
|
@ -1477,7 +1477,7 @@ var TESTS = [
|
||||||
var gTestStart = null;
|
var gTestStart = null;
|
||||||
|
|
||||||
var XPInstallObserver = {
|
var XPInstallObserver = {
|
||||||
observe(aSubject, aTopic, aData) {
|
observe(aSubject, aTopic) {
|
||||||
var installInfo = aSubject.wrappedJSObject;
|
var installInfo = aSubject.wrappedJSObject;
|
||||||
info(
|
info(
|
||||||
"Observed " + aTopic + " for " + installInfo.installs.length + " installs"
|
"Observed " + aTopic + " for " + installInfo.installs.length + " installs"
|
||||||
|
|
|
||||||
|
|
@ -51,17 +51,17 @@ add_task(async function test_disabled() {
|
||||||
add_task(async function test_disabled2() {
|
add_task(async function test_disabled2() {
|
||||||
let installDisabledCalled = false;
|
let installDisabledCalled = false;
|
||||||
|
|
||||||
Harness.installDisabledCallback = installInfo => {
|
Harness.installDisabledCallback = () => {
|
||||||
installDisabledCalled = true;
|
installDisabledCalled = true;
|
||||||
ok(true, "Saw installation disabled");
|
ok(true, "Saw installation disabled");
|
||||||
};
|
};
|
||||||
|
|
||||||
Harness.installBlockedCallback = installInfo => {
|
Harness.installBlockedCallback = () => {
|
||||||
ok(false, "Should never see the blocked install notification");
|
ok(false, "Should never see the blocked install notification");
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
Harness.installConfirmCallback = panel => {
|
Harness.installConfirmCallback = () => {
|
||||||
ok(false, "Should never see an install confirmation dialog");
|
ok(false, "Should never see an install confirmation dialog");
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ function test() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function allow_blocked(installInfo) {
|
function allow_blocked() {
|
||||||
ok(true, "Seen blocked");
|
ok(true, "Seen blocked");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ function test() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function allow_blocked(installInfo) {
|
function allow_blocked() {
|
||||||
ok(true, "Seen blocked");
|
ok(true, "Seen blocked");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ function test() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function allow_blocked(installInfo) {
|
function allow_blocked() {
|
||||||
ok(true, "Seen blocked");
|
ok(true, "Seen blocked");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ function test() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function download_progress(addon, value, maxValue) {
|
function download_progress() {
|
||||||
try {
|
try {
|
||||||
// Tests always connect to localhost, and per bug 87717, localhost is now
|
// Tests always connect to localhost, and per bug 87717, localhost is now
|
||||||
// reachable in offline mode. To avoid this, disable any proxy.
|
// reachable in offline mode. To avoid this, disable any proxy.
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ function test() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_blocked(installInfo) {
|
function install_blocked() {
|
||||||
wasOriginBlocked = true;
|
wasOriginBlocked = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -512,7 +512,7 @@ var Harness = {
|
||||||
|
|
||||||
// nsIObserver
|
// nsIObserver
|
||||||
|
|
||||||
observe(subject, topic, data) {
|
observe(subject, topic) {
|
||||||
var installInfo = subject.wrappedJSObject;
|
var installInfo = subject.wrappedJSObject;
|
||||||
switch (topic) {
|
switch (topic) {
|
||||||
case "addon-install-started":
|
case "addon-install-started":
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
/* globals InstallTrigger */
|
/* globals InstallTrigger */
|
||||||
/* exported startInstall */
|
/* exported startInstall */
|
||||||
function installCallback(url, status) {
|
function installCallback() {
|
||||||
document.location = "#foo";
|
document.location = "#foo";
|
||||||
|
|
||||||
dump("Sending InstallComplete\n");
|
dump("Sending InstallComplete\n");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue