Bug 1864896: Autofix unused function arguments (toolkit/mozapps/extensions). r=zombie

Differential Revision: https://phabricator.services.mozilla.com/D202994
This commit is contained in:
Dave Townsend 2024-03-19 14:59:21 +00:00
parent 0901ab454a
commit 0391afb5dc
98 changed files with 198 additions and 231 deletions

View file

@ -102,7 +102,7 @@ export class AbuseReportError extends Error {
async function responseToErrorInfo(response) {
return JSON.stringify({
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(
err => undefined
() => undefined
);
if (response.status === 404) {
@ -550,7 +550,7 @@ export const AbuseReporter = {
* A string that identify how the report has been triggered.
*/
class AbuseReport {
constructor({ addon, createErrorType, reportData, reportEntryPoint }) {
constructor({ addon, reportData, reportEntryPoint }) {
this[PRIVATE_REPORT_PROPS] = {
aborted: false,
abortController: new AbortController(),
@ -599,7 +599,7 @@ class AbuseReport {
// Leave errorInfo empty if there is no response or fails to
// be converted into an error info object.
const errorInfo = response
? await responseToErrorInfo(response).catch(err => undefined)
? await responseToErrorInfo(response).catch(() => undefined)
: undefined;
throw new AbuseReportError(errorType, errorInfo);

View file

@ -160,7 +160,7 @@ var PrefObserver = {
this.observe(null, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID, PREF_LOGGING_ENABLED);
},
observe(aSubject, aTopic, aData) {
observe(aSubject, aTopic) {
if (aTopic == "xpcom-shutdown") {
Services.prefs.removeObserver(PREF_LOGGING_ENABLED, this);
Services.obs.removeObserver(this, "xpcom-shutdown");
@ -339,7 +339,7 @@ BrowserListener.prototype = {
}
},
observe(subject, topic, data) {
observe(subject) {
if (subject != this.messageManager) {
return;
}
@ -349,7 +349,7 @@ BrowserListener.prototype = {
this.cancelInstall();
},
onLocationChange(webProgress, request, location) {
onLocationChange() {
if (
this.browser.contentPrincipal &&
this.principal.subsumes(this.browser.contentPrincipal)
@ -361,19 +361,19 @@ BrowserListener.prototype = {
this.cancelInstall();
},
onDownloadCancelled(install) {
onDownloadCancelled() {
this.unregister();
},
onDownloadFailed(install) {
onDownloadFailed() {
this.unregister();
},
onInstallFailed(install) {
onInstallFailed() {
this.unregister();
},
onInstallEnded(install) {
onInstallEnded() {
this.unregister();
},
@ -553,7 +553,7 @@ var AddonManagerInternal = {
this.pendingProviders.add(aProvider);
}
return new Promise((resolve, reject) => {
return new Promise(resolve => {
logger.debug("Calling shutdown blocker for " + name);
resolve(aProvider.shutdown());
}).catch(err => {
@ -1311,7 +1311,7 @@ var AddonManagerInternal = {
}
updates.push(
new Promise((resolve, reject) => {
new Promise(resolve => {
addon.findUpdates(
{
onUpdateAvailable(aAddon, aInstall) {
@ -3892,7 +3892,7 @@ export var AddonManagerPrivate = {
* This can be used as an implementation for Addon.findUpdates() when
* no update mechanism is available.
*/
callNoUpdateListeners(addon, listener, reason, appVersion, platformVersion) {
callNoUpdateListeners(addon, listener) {
if ("onNoCompatibilityUpdateAvailable" in listener) {
safeCall(listener.onNoCompatibilityUpdateAvailable.bind(listener), addon);
}
@ -4739,7 +4739,7 @@ AMTelemetry = {
// Observer Service notification callback.
observe(subject, topic, data) {
observe(subject, topic) {
switch (topic) {
case "addon-install-blocked": {
const { installs } = subject.wrappedJSObject;

View file

@ -62,7 +62,7 @@ RemoteMediator.prototype = {
}
},
enabled(url) {
enabled() {
let params = {
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 args = {};
args[filename] = { URL: url };
return this.install(args);
},
installChrome(type, url, skin) {
installChrome(type, url) {
return this.startSoftwareUpdate(url);
},

View file

@ -67,7 +67,7 @@ export function amManager() {
}
amManager.prototype = {
observe(aSubject, aTopic, aData) {
observe(aSubject, aTopic) {
switch (aTopic) {
case "addons-startup":
AddonManagerPrivate.startup();
@ -129,7 +129,7 @@ amManager.prototype = {
if (aCallback) {
aInstall.addListener({
onDownloadCancelled(aInstall) {
onDownloadCancelled() {
callCallback(USER_CANCELLED);
},
@ -141,11 +141,11 @@ amManager.prototype = {
}
},
onInstallFailed(aInstall) {
onInstallFailed() {
callCallback(EXECUTION_ERROR);
},
onInstallEnded(aInstall, aStatus) {
onInstallEnded() {
callCallback(SUCCESS);
},
});
@ -165,7 +165,7 @@ amManager.prototype = {
return retval;
},
notify(aTimer) {
notify() {
AddonManagerPrivate.backgroundUpdateTimerHandler();
},

View file

@ -214,7 +214,7 @@ export class WebAPI extends APIObject {
super.init(window, broker, {});
window.addEventListener("unload", event => {
window.addEventListener("unload", () => {
this.broker.sendCleanup(this.allInstalls);
});
}
@ -263,7 +263,7 @@ export class WebAPI extends APIObject {
return lazy.AMO_ABUSEREPORT;
}
eventListenerAdded(type) {
eventListenerAdded() {
if (this.listenerCount == 0) {
this.broker.setAddonListener(data => {
let event = new this.window.AddonEvent(data.event, data);
@ -273,7 +273,7 @@ export class WebAPI extends APIObject {
this.listenerCount++;
}
eventListenerRemoved(type) {
eventListenerRemoved() {
this.listenerCount--;
if (this.listenerCount == 0) {
this.broker.setAddonListener(null);

View file

@ -322,12 +322,12 @@ function checkForUpdate(addon) {
onDownloadFailed: failed,
onInstallCancelled: failed,
onInstallFailed: failed,
onInstallEnded: (...args) => {
onInstallEnded: () => {
detachUpdateHandler(install);
install.removeListener(updateListener);
resolve({ installed: true, pending: false, found: true });
},
onInstallPostponed: (...args) => {
onInstallPostponed: () => {
detachUpdateHandler(install);
install.removeListener(updateListener);
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
// to disable inline options.
function getOptionsType(addon, type) {
function getOptionsType(addon) {
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");
message.state = "updating";
message.hidden = false;
@ -2096,11 +2096,11 @@ class AddonDetails extends HTMLElement {
}
}
onDisabled(addon) {
onDisabled() {
this.extensionShutdown();
}
onEnabled(addon) {
onEnabled() {
this.extensionStartup();
}
@ -2968,18 +2968,18 @@ class AddonCard extends HTMLElement {
this.sendEvent("update-postponed");
}
onDisabled(addon) {
onDisabled() {
if (!this.reloading) {
this.update();
}
}
onEnabled(addon) {
onEnabled() {
this.reloading = false;
this.update();
}
onInstalled(addon) {
onInstalled() {
// When a temporary addon is reloaded, onInstalled is triggered instead of
// onEnabled.
this.reloading = false;

View file

@ -185,7 +185,7 @@ async function openAbuseReport({ addonId, reportEntryPoint }) {
// 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
// from which abuse reporting feature is enabled.
async function openAbuseReportAMOForm({ addonId, reportEntryPoint }) {
async function openAbuseReportAMOForm({ addonId }) {
const amoUrl = AbuseReporter.getAMOFormURL({ addonId });
windowRoot.ownerGlobal.openTrustedLinkIn(amoUrl, "tab", {
// Make sure the newly open tab is going to be focused, independently

View file

@ -283,7 +283,7 @@ ChromeUtils.defineESModuleGetters(this, {
}
return Object.entries(modifierMap)
.filter(([key, isDown]) => isDown)
.filter(([, isDown]) => isDown)
.map(([key]) => key)
.concat(getStringForEvent(e))
.join("+");

View file

@ -89,7 +89,7 @@ var gViewController = {
}
},
observe(subject, topic, data) {
observe(subject, topic) {
if (topic == "EM-ping") {
this.readyForLoadView = true;
Services.obs.notifyObservers(window, "EM-pong");

View file

@ -466,13 +466,13 @@ export var AddonRepository = {
request.open("GET", url, true);
request.responseType = "json";
request.addEventListener("error", aEvent => {
request.addEventListener("error", () => {
reject(new Error(`GET ${url} failed`));
});
request.addEventListener("timeout", aEvent => {
request.addEventListener("timeout", () => {
reject(new Error(`GET ${url} timed out`));
});
request.addEventListener("load", aEvent => {
request.addEventListener("load", () => {
let response = request.response;
if (!response || (request.status != 200 && request.status != 0)) {
reject(new Error(`GET ${url} failed (status ${request.status})`));

View file

@ -340,7 +340,7 @@ GMPWrapper.prototype = {
return { source: "gmp-plugin" };
},
isCompatibleWith(aAppVersion, aPlatformVersion) {
isCompatibleWith() {
return true;
},
@ -377,7 +377,7 @@ GMPWrapper.prototype = {
* Widevine is not yet installed, or if the user toggles prefs to enable EME.
* For the function used in those cases see `checkForUpdates`.
*/
findUpdates(aListener, aReason, aAppVersion, aPlatformVersion) {
findUpdates(aListener, aReason) {
this._log.trace(
"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) {
lazy.AddonManagerPrivate.registerProvider(GMPProvider, ["plugin"]);
Services.obs.notifyObservers(null, "gmp-provider-registered");

View file

@ -422,7 +422,7 @@ function downloadFile(url, options = { httpsOnlyNoUpgrade: false }) {
return new Promise((resolve, reject) => {
let sr = new lazy.ServiceRequest();
sr.onload = function (response) {
sr.onload = function () {
logger.info("downloadFile File download. status=" + sr.status);
if (sr.status != 200 && sr.status != 206) {
reject(Components.Exception("File download failed", sr.status));

View file

@ -190,7 +190,7 @@ class SitePermsAddonWrapper {
return 0;
}
async updateBlocklistState(options = {}) {}
async updateBlocklistState() {}
get blocklistState() {
return Ci.nsIBlocklistService.STATE_NOT_BLOCKED;
@ -277,7 +277,7 @@ class SitePermsAddonWrapper {
return { source: "siteperm-addon-provider", method: "synthetic-install" };
}
isCompatibleWith(aAppVersion, aPlatformVersion) {
isCompatibleWith() {
return true;
}
}

View file

@ -2175,7 +2175,7 @@ export const XPIDatabase = {
*/
async verifySignatures() {
try {
let addons = await this.getAddonList(a => true);
let addons = await this.getAddonList(() => true);
let changes = {
enabled: [],
@ -2426,7 +2426,7 @@ export const XPIDatabase = {
if (!this.addonDB) {
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
* @param {AddonInternal?} [aNewAddon]
* 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}
* A boolean indicating if flushing caches is required to complete
* changing this add-on
*/
addMetadata(
aLocation,
aId,
aAddonState,
aNewAddon,
aOldAppVersion,
aOldPlatformVersion
) {
addMetadata(aLocation, aId, aAddonState, aNewAddon) {
logger.debug(`New add-on ${aId} installed in ${aLocation.name}`);
// We treat this is a new install if,

View file

@ -287,7 +287,7 @@ DirPackage = class DirPackage extends Package {
return IOUtils.read(PathUtils.join(this.filePath, ...path));
}
async verifySignedStateForRoot(addonId, root) {
async verifySignedStateForRoot() {
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
this.cancel();
}
@ -2592,7 +2592,7 @@ var DownloadAddonInstall = class extends AddonInstall {
new UpdateChecker(
this.addon,
{
onUpdateFinished: aAddon => this.downloadCompleted(),
onUpdateFinished: () => this.downloadCompleted(),
},
AddonManager.UPDATE_WHEN_ADDON_INSTALLED
);
@ -3880,7 +3880,7 @@ class SystemAddonInstaller extends DirectoryInstaller {
}
// old system add-on upgrade dirs get automatically removed
uninstallAddon(aAddon) {}
uninstallAddon() {}
}
var AppUpdate = {

View file

@ -1598,7 +1598,7 @@ var XPIStates = {
*
* @returns {XPIState?}
*/
findAddon(aId, aFilter = location => true) {
findAddon(aId, aFilter = () => true) {
// Fortunately the Map iterator returns in order of insertion, which is
// also our highest -> lowest priority order.
for (let location of this.locations()) {
@ -2706,7 +2706,7 @@ export var XPIProvider = {
"profile-before-change",
"test-load-xpi-database",
];
let observer = (subject, topic, data) => {
let observer = (subject, topic) => {
if (
topic == "xul-window-visible" &&
!Services.wm.getMostRecentWindow("devtools:toolbox")

View file

@ -43,7 +43,7 @@ const ADDON_SEARCH_RESULTS = {};
const mockAddonRepository = ({ addons = [] }) => {
return {
async getMappedAddons(browserID, extensionIDs) {
async getMappedAddons() {
return Promise.resolve({
addons,
matchedIDs: [],

View file

@ -17,22 +17,22 @@ var gInstallProperties = [
var gInstall;
var gExpectedCancel = false;
var gTestInstallListener = {
onInstallStarted(aInstall) {
onInstallStarted() {
check_hidden(false);
},
onInstallEnded(aInstall) {
onInstallEnded() {
check_hidden(false);
run_next_test();
},
onInstallCancelled(aInstall) {
onInstallCancelled() {
ok(gExpectedCancel, "Should expect install cancel");
check_hidden(false);
run_next_test();
},
onInstallFailed(aInstall) {
onInstallFailed() {
ok(false, "Did not expect onInstallFailed");
run_next_test();
},

View file

@ -16,7 +16,7 @@ const dragService = Cc["@mozilla.org/widget/dragservice;1"].getService(
async function checkInstallConfirmation(...names) {
let notificationCount = 0;
let observer = {
observe(aSubject, aTopic, aData) {
observe(aSubject) {
let installInfo = aSubject.wrappedJSObject;
isnot(
installInfo.browser,

View file

@ -603,7 +603,7 @@ add_task(async function test_abusereport_messagebars() {
await AbuseReportTestUtils.promiseReportRendered();
AbuseReportTestUtils.triggerSubmit("fake-reason", "fake-message");
},
([submittingDetails, submittedDetails]) => {
([, submittedDetails]) => {
const buttonsL10nId = Array.from(
submittedDetails.messagebar.querySelectorAll("button")
).map(el => el.getAttribute("data-l10n-id"));
@ -634,10 +634,8 @@ add_task(async function test_abusereport_messagebars() {
await addon.uninstall(true);
AbuseReportTestUtils.triggerSubmit("fake-reason", "fake-message");
};
const assertMessageBarDetails = async ([
submittingDetails,
submittedDetails,
]) => AbuseReportTestUtils.assertFluentStrings(submittedDetails.messagebar);
const assertMessageBarDetails = async ([, submittedDetails]) =>
AbuseReportTestUtils.assertFluentStrings(submittedDetails.messagebar);
await assertMessageBars(
["submitting", "submitted-and-removed"],
testFn,
@ -657,7 +655,7 @@ add_task(async function test_abusereport_messagebars() {
await AbuseReportTestUtils.promiseReportRendered();
AbuseReportTestUtils.triggerSubmit("fake-reason", "fake-message");
},
([submittingDetails, submittedDetails]) =>
([, submittedDetails]) =>
AbuseReportTestUtils.assertFluentStrings(submittedDetails.messagebar)
);

View file

@ -76,7 +76,7 @@ class DiscoveryAPIHandler {
});
}
unblockResponses(responseText) {
unblockResponses() {
throw new Error("You need to call blockNextResponses first!");
}

View file

@ -119,7 +119,7 @@ async function installAddon({ card, recommendedList, manifestExtra = {} }) {
return extension;
}
async function testListRecommendations({ type, manifestExtra = {} }) {
async function testListRecommendations({ type }) {
let win = await loadInitialView(type);
let doc = win.document;

View file

@ -53,7 +53,7 @@ add_task(async function testChangeAutoUpdates() {
let win = await loadInitialView("extension");
let doc = win.document;
let getInputs = updateRow => ({
let getInputs = () => ({
default: updatesRow.querySelector('input[value="1"]'),
on: updatesRow.querySelector('input[value="2"]'),
off: updatesRow.querySelector('input[value="0"]'),

View file

@ -10,7 +10,7 @@ MockFilePicker.init(window.browsingContext);
async function checkInstallConfirmation(...names) {
let notificationCount = 0;
let observer = {
observe(aSubject, aTopic, aData) {
observe(aSubject) {
var installInfo = aSubject.wrappedJSObject;
isnot(
installInfo.browser,

View file

@ -235,7 +235,7 @@ add_task(async function testDuplicateShortcutOnMacOSCtrlKey() {
);
};
const clearWarning = async inputEl => {
const clearWarning = async () => {
anotherCommandInput.blur();
await TestUtils.waitForCondition(
() => BrowserTestUtils.isHidden(errorEl),

View file

@ -18,7 +18,7 @@ function installLocale() {
return new Promise(resolve => {
gInstall = gProvider.createInstalls(gInstallProperties)[0];
gInstall.addTestListener({
onInstallEnded(aInstall) {
onInstallEnded() {
gInstall.removeTestListener(this);
resolve();
},

View file

@ -25,14 +25,7 @@ var gStart = 0;
var gLast = 0;
var HTTPObserver = {
observeActivity(
aChannel,
aType,
aSubtype,
aTimestamp,
aSizeData,
aStringData
) {
observeActivity(aChannel, aType, aSubtype) {
aChannel.QueryInterface(Ci.nsIChannel);
dump(

View file

@ -95,7 +95,7 @@ async function testInstall(browser, args, steps, description) {
let receivedEvents = [];
let prevEvent = null;
events.forEach(event => {
install.addEventListener(event, e => {
install.addEventListener(event, () => {
receivedEvents.push({
event,
state: install.state,

View file

@ -13,7 +13,7 @@ add_task(async function test_theme_install() {
await BrowserTestUtils.withNewTab(TESTPAGE, async browser => {
let updates = [];
function observer(subject, topic, data) {
function observer(subject) {
updates.push(JSON.stringify(subject.wrappedJSObject));
}
Services.obs.addObserver(observer, "lightweight-theme-styling-update");

View file

@ -204,7 +204,7 @@ function run_next_test() {
executeSoon(() => log_exceptions(test));
}
var get_tooltip_info = async function (addonEl, managerWindow) {
var get_tooltip_info = async function (addonEl) {
// Extract from title attribute.
const { addon } = addonEl;
const name = addon.name;
@ -324,7 +324,7 @@ function open_manager(
aLongerTimeout,
aWin = window
) {
let p = new Promise((resolve, reject) => {
let p = new Promise(resolve => {
async function setup_manager(aManagerWindow) {
if (aLoadCallback) {
log_exceptions(aLoadCallback, aManagerWindow);
@ -354,7 +354,7 @@ function open_manager(
}
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);
if (aSubject.location.href != MANAGER_URI) {
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) {
let install = await AddonManager.getInstallForURL(pathPrefix + path);
let p = new Promise((resolve, reject) => {
let p = new Promise(resolve => {
install.addListener({
onInstallEnded: () => resolve(install.addon),
});
@ -946,7 +946,7 @@ MockProvider.prototype = {
* true if the newly enabled add-on will only become enabled after a
* restart
*/
addonChanged: function MP_addonChanged(aId, aType, aPendingRestart) {
addonChanged: function MP_addonChanged() {
// Not implemented
},
@ -965,7 +965,7 @@ MockProvider.prototype = {
* @param {object} aOptions
* Options for the install
*/
getInstallForURL: function MP_getInstallForURL(aUrl, aOptions) {
getInstallForURL: function MP_getInstallForURL() {
// Not yet implemented
},
@ -975,7 +975,7 @@ MockProvider.prototype = {
* @param aFile
* The file to be installed
*/
getInstallForFile: function MP_getInstallForFile(aFile) {
getInstallForFile: function MP_getInstallForFile() {
// Not yet implemented
},
@ -996,7 +996,7 @@ MockProvider.prototype = {
* The mimetype to check for
* @return true if the mimetype is supported
*/
supportsMimetype: function MP_supportsMimetype(aMimetype) {
supportsMimetype: function MP_supportsMimetype() {
return false;
},
@ -1007,7 +1007,7 @@ MockProvider.prototype = {
* The URI being installed from
* @return true if installing is allowed
*/
isInstallAllowed: function MP_isInstallAllowed(aUri) {
isInstallAllowed: function MP_isInstallAllowed() {
return false;
},
};
@ -1143,11 +1143,11 @@ MockAddon.prototype = {
]);
},
isCompatibleWith(aAppVersion, aPlatformVersion) {
isCompatibleWith() {
return true;
},
findUpdates(aListener, aReason, aAppVersion, aPlatformVersion) {
findUpdates() {
// Tests can implement this if they need to
},

View file

@ -66,7 +66,7 @@ function waitForNewWindow() {
}
function waitClosedWindow(win) {
return new Promise((resolve, reject) => {
return new Promise(resolve => {
function onWindowClosed() {
if (win && !win.closed) {
// If a specific window reference has been passed, then check
@ -215,7 +215,7 @@ const AbuseReportTestUtils = {
return abuseReportEl.ownerGlobal.ABUSE_REPORT_REASONS[reason];
},
async promiseReportOpened({ addonId, reportEntryPoint, managerWindow }) {
async promiseReportOpened({ addonId, reportEntryPoint }) {
let abuseReportEl;
if (!this.getReportDialog()) {

View file

@ -935,7 +935,7 @@ class EventChecker {
return this.checkAddonEvent("onInstalled", addon);
}
onUninstalling(addon, requiresRestart) {
onUninstalling(addon) {
return this.checkAddonEvent("onUninstalling", addon);
}
@ -1033,7 +1033,7 @@ class EventChecker {
});
}
onInstallEnded(install, newAddon) {
onInstallEnded(install) {
return this.checkInstall("onInstallEnded", install, {
state: "STATE_INSTALLED",
error: 0,

View file

@ -22,7 +22,7 @@ AddonManager.addExternalExtensionLoader({
Object.assign(addon, manifest);
return addon;
},
loadScope(addon, file) {
loadScope() {
return {
install() {},
uninstall() {},

View file

@ -227,7 +227,7 @@ function createAddon(addon) {
* If a lastTest is provided checks that the notification dialog got passed
* 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));
const bls = Ci.nsIBlocklistService;

View file

@ -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
// of RemoteSettings accesses matches with what we expect.
const originalClientGet = ExtensionBlocklistMLBF._client.get;
const spyClientGet = (tag, returnValue) => {
const spyClientGet = tag => {
ExtensionBlocklistMLBF._client.get = async function () {
// Record the method call.
observed.push(tag);

View file

@ -451,7 +451,7 @@ add_task(async function test_pt4() {
await promiseRestartManager();
await checkInitialState();
await loadBlocklist("empty", args => {
await loadBlocklist("empty", () => {
dump("Checking notification pt 4\n");
// 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.");

View file

@ -40,7 +40,7 @@ const useMLBF = Services.prefs.getBoolPref(
var testserver = createHttpServer({ hosts: ["example.com"] });
function permissionPromptHandler(subject, topic, data) {
function permissionPromptHandler(subject) {
ok(
subject?.wrappedJSObject?.info?.resolve,
"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
// resolves when any started installs complete
function Pbackground_update() {
return new Promise((resolve, reject) => {
return new Promise(resolve => {
let installCount = 0;
let backgroundCheckCompleted = false;
AddonManager.addInstallListener({
onNewInstall(aInstall) {
onNewInstall() {
installCount++;
},
onInstallEnded(aInstall) {
onInstallEnded() {
installCount--;
// Wait until all started installs have completed
if (installCount) {

View file

@ -63,7 +63,7 @@ async function run_test() {
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
// have processed the gfxItems event.
executeSoon(checkBlacklist);

View file

@ -57,7 +57,7 @@ async function run_test() {
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
// have processed the gfxItems event.
executeSoon(checkBlacklist);

View file

@ -102,7 +102,7 @@ async function run_test() {
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
// have processed the gfxItems event.
executeSoon(checkBlacklist);

View file

@ -58,7 +58,7 @@ async function run_test() {
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
// have processed the gfxItems event.
executeSoon(checkBlacklist);

View file

@ -58,7 +58,7 @@ async function run_test() {
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
// have processed the gfxItems event.
executeSoon(checkBlacklist);

View file

@ -58,7 +58,7 @@ async function run_test() {
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
// have processed the gfxItems event.
executeSoon(checkBlacklist);

View file

@ -60,7 +60,7 @@ async function run_test() {
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
// have processed the gfxItems event.
executeSoon(checkBlacklist);

View file

@ -59,7 +59,7 @@ async function run_test() {
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
// have processed the gfxItems event.
executeSoon(checkBlacklist);

View file

@ -59,7 +59,7 @@ async function run_test() {
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
// have processed the gfxItems event.
executeSoon(checkBlacklist);

View file

@ -58,7 +58,7 @@ async function run_test() {
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
// have processed the gfxItems event.
executeSoon(checkBlacklist);

View file

@ -60,7 +60,7 @@ async function run_test() {
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
// have processed the gfxItems event.
executeSoon(checkBlacklist);

View file

@ -60,7 +60,7 @@ async function run_test() {
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
// have processed the gfxItems event.
executeSoon(checkBlacklist);

View file

@ -61,7 +61,7 @@ async function run_test() {
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
// have processed the gfxItems event.
executeSoon(checkBlacklist);

View file

@ -58,7 +58,7 @@ async function run_test() {
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
// have processed the gfxItems event.
executeSoon(checkBlacklist);

View file

@ -180,7 +180,7 @@ async function run_test() {
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
// have processed the gfxItems event.
executeSoon(checkBlocklist);

View file

@ -53,7 +53,7 @@ async function run_test() {
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");
await promiseStartupManager();
function blacklistAdded(aSubject, aTopic, aData) {
function blacklistAdded() {
// If we wait until after we go through the event loop, gfxInfo is sure to
// have processed the gfxItems event.
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
// have processed the gfxItems event.
executeSoon(ensureBlacklistUnset);

View file

@ -800,11 +800,7 @@ add_task(async function test_report_recommended() {
});
add_task(async function test_query_amo_details() {
async function assertReportOnAMODetails({
addonId,
addonType = "extension",
expectedReport,
} = {}) {
async function assertReportOnAMODetails({ addonId, expectedReport } = {}) {
// Clear last report timestamp and any telemetry event recorded so far.
clearAbuseReportState();
Services.telemetry.clearEvents();

View file

@ -465,7 +465,7 @@ function check_cache(aExpectedToFind, aExpectedImmediately) {
for (let i = 0; i < REPOSITORY_ADDONS.length; i++) {
lookups.push(
new Promise((resolve, reject) => {
new Promise(resolve => {
let immediatelyFound = true;
let expected = aExpectedToFind[i] ? REPOSITORY_ADDONS[i] : null;
// can't Promise-wrap this because we're also testing whether the callback is

View file

@ -152,7 +152,7 @@ function promiseLocaleChanged(requestedLocale) {
}
return new Promise(resolve => {
let localeObserver = {
observe(aSubject, aTopic, aData) {
observe(aSubject, aTopic) {
switch (aTopic) {
case REQ_LOC_CHANGE_EVENT:
let reqLocs = Services.locale.requestedLocales;
@ -169,7 +169,7 @@ function promiseLocaleChanged(requestedLocale) {
function promiseMetaDataUpdate() {
return new Promise(resolve => {
let listener = args => {
let listener = () => {
Services.prefs.removeObserver(PREF_METADATA_LASTUPDATE, listener);
resolve();
};

View file

@ -40,7 +40,7 @@ function getTelemetryEvents(includeMethods = EVENT_METHODS) {
);
return snapshot.parent
.filter(([timestamp, category, method]) => {
.filter(([, category, method]) => {
const includeMethod = includeMethods
? includeMethods.includes(method)
: true;
@ -68,11 +68,9 @@ function assertNoTelemetryEvents() {
return;
}
let filteredEvents = snapshot.parent.filter(
([timestamp, category, method]) => {
return category === EVENT_CATEGORY;
}
);
let filteredEvents = snapshot.parent.filter(([_timestamp, category]) => {
return category === EVENT_CATEGORY;
});
Assert.deepEqual(filteredEvents, [], "Got no AMTelemetry events as expected");
}

View file

@ -206,7 +206,7 @@ add_task(async function delay_updates_complete() {
},
},
background() {
browser.runtime.onUpdateAvailable.addListener(details => {
browser.runtime.onUpdateAvailable.addListener(() => {
browser.test.notifyPass("reload");
browser.runtime.reload();
});
@ -273,7 +273,7 @@ add_task(async function delay_updates_defer() {
},
},
background() {
browser.runtime.onUpdateAvailable.addListener(details => {
browser.runtime.onUpdateAvailable.addListener(() => {
// Upgrade will only proceed when "allow" message received.
browser.test.onMessage.addListener(msg => {
if (msg == "allow") {
@ -371,7 +371,7 @@ add_task(async function delay_updates_staged() {
},
},
background() {
browser.runtime.onUpdateAvailable.addListener(details => {
browser.runtime.onUpdateAvailable.addListener(() => {
browser.test.sendMessage("denied");
});
browser.test.sendMessage("ready");
@ -443,7 +443,7 @@ add_task(async function delay_updates_staged_no_update_url() {
},
},
background() {
browser.runtime.onUpdateAvailable.addListener(details => {
browser.runtime.onUpdateAvailable.addListener(() => {
browser.test.sendMessage("denied");
});
browser.test.sendMessage("ready");

View file

@ -179,7 +179,7 @@ function testInstallEvent(expectTelemetry) {
let events = snapshot.parent
.filter(
([timestamp, category, method, object, value, extra]) =>
([, category, method, , , extra]) =>
category === "addonsManager" &&
method == "install" &&
extra.step == expectTelemetry.step
@ -229,15 +229,13 @@ function promiseCompleteWebInstall(
installInfo.install();
});
TestUtils.topicObserved("addon-install-confirmation").then(
(subject, data) => {
info(`==== test got addon-install-confirmation`);
let installInfo = subject.wrappedJSObject;
for (let installer of installInfo.installs) {
installer.install();
}
TestUtils.topicObserved("addon-install-confirmation").then(subject => {
info(`==== test got addon-install-confirmation`);
let installInfo = subject.wrappedJSObject;
for (let installer of installInfo.installs) {
installer.install();
}
);
});
TestUtils.topicObserved("webextension-permission-prompt").then(
([subject]) => {
const { info } = subject.wrappedJSObject || {};

View file

@ -35,7 +35,7 @@ class TestListener {
function startListener(listener) {
let observer = {
observe(subject, topic, data) {
observe(subject) {
let channel = subject.QueryInterface(Ci.nsIHttpChannel);
if (channel.URI.spec === "http://example.com/addons/test.xpi") {
let channelListener = new TestListener(listener);

View file

@ -12,7 +12,7 @@ function mockAddonProvider(name) {
AddonManager.isInstallEnabled("made-up-mimetype");
},
supportsMimetype(mimetype) {
supportsMimetype() {
this.apiAccessed = true;
return false;
},

View file

@ -31,7 +31,7 @@ function mockAddonProvider(aName) {
mockProvider.doneResolve = resolve;
mockProvider.doneReject = reject;
});
mockProvider.shutdownPromise = new Promise((resolve, reject) => {
mockProvider.shutdownPromise = new Promise(resolve => {
mockProvider.shutdownResolve = resolve;
});
return mockProvider;

View file

@ -99,11 +99,11 @@ add_task(async function test_can_reload_permanent_addon() {
let disabledCalled = false;
let enabledCalled = false;
AddonManager.addAddonListener({
onDisabled: aAddon => {
onDisabled: () => {
Assert.ok(!enabledCalled);
disabledCalled = true;
},
onEnabled: aAddon => {
onEnabled: () => {
Assert.ok(disabledCalled);
enabledCalled = true;
},

View file

@ -43,7 +43,7 @@ add_task(async function test_no_change() {
await manuallyInstall(do_get_file(`${DATA}/signed2.xpi`), profileDir, ID);
let listener = {
onPropetyChanged(_addon, properties) {
onPropetyChanged(_addon) {
Assert.ok(false, `Got unexpected onPropertyChanged for ${_addon.id}`);
},
};

View file

@ -26,7 +26,7 @@ registerCleanupFunction(() => {
distroDir.remove(true);
});
AddonTestUtils.usePrivilegedSignatures = id => "system";
AddonTestUtils.usePrivilegedSignatures = () => "system";
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "42");

View file

@ -29,7 +29,7 @@ add_task(async function test_app_addons() {
`http://localhost:${gServer.identity.primaryPort}/get?%IDS%`
);
gServer.registerPathHandler("/get", (request, response) => {
gServer.registerPathHandler("/get", () => {
do_throw("Unexpected request to server.");
});

View file

@ -3,7 +3,7 @@
const updatesDir = FileUtils.getDir("ProfD", ["features"]);
AddonTestUtils.usePrivilegedSignatures = id => "system";
AddonTestUtils.usePrivilegedSignatures = () => "system";
add_task(async function setup() {
// Build the test sets
@ -489,7 +489,7 @@ add_task(async function test_bad_app_cert() {
await promiseShutdownManager();
AddonTestUtils.usePrivilegedSignatures = id => "system";
AddonTestUtils.usePrivilegedSignatures = () => "system";
});
// A failed upgrade should revert to the default set.

View file

@ -6,7 +6,7 @@ let distroDir = FileUtils.getDir("ProfD", ["sysfeatures", "empty"]);
distroDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
registerDirectory("XREAppFeat", distroDir);
AddonTestUtils.usePrivilegedSignatures = id => "system";
AddonTestUtils.usePrivilegedSignatures = () => "system";
add_task(() => initSystemAddonDirs());

View file

@ -6,7 +6,7 @@ let distroDir = FileUtils.getDir("ProfD", ["sysfeatures", "empty"]);
distroDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
registerDirectory("XREAppFeat", distroDir);
AddonTestUtils.usePrivilegedSignatures = id => "system";
AddonTestUtils.usePrivilegedSignatures = () => "system";
/**
* Defines the set of initial conditions to run each test against. Each should

View file

@ -6,7 +6,7 @@ let distroDir = FileUtils.getDir("ProfD", ["sysfeatures", "empty"]);
distroDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
registerDirectory("XREAppFeat", distroDir);
AddonTestUtils.usePrivilegedSignatures = id => "system";
AddonTestUtils.usePrivilegedSignatures = () => "system";
add_task(initSystemAddonDirs);

View file

@ -6,7 +6,7 @@ let distroDir = FileUtils.getDir("ProfD", ["sysfeatures", "empty"]);
distroDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
registerDirectory("XREAppFeat", distroDir);
AddonTestUtils.usePrivilegedSignatures = id => "system";
AddonTestUtils.usePrivilegedSignatures = () => "system";
add_task(() => initSystemAddonDirs());

View file

@ -7,7 +7,7 @@ let distroDir = FileUtils.getDir("ProfD", ["sysfeatures", "empty"]);
distroDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
registerDirectory("XREAppFeat", distroDir);
AddonTestUtils.usePrivilegedSignatures = id => "system";
AddonTestUtils.usePrivilegedSignatures = () => "system";
add_task(() => initSystemAddonDirs());

View file

@ -6,7 +6,7 @@ let distroDir = FileUtils.getDir("ProfD", ["sysfeatures", "empty"]);
distroDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
registerDirectory("XREAppFeat", distroDir);
AddonTestUtils.usePrivilegedSignatures = id => "system";
AddonTestUtils.usePrivilegedSignatures = () => "system";
add_task(() => initSystemAddonDirs());

View file

@ -7,7 +7,7 @@ distroDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
registerDirectory("XREAppFeat", distroDir);
add_task(() => initSystemAddonDirs());
AddonTestUtils.usePrivilegedSignatures = id => "system";
AddonTestUtils.usePrivilegedSignatures = () => "system";
/**
* Defines the set of initial conditions to run each test against. Each should

View file

@ -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") {
Assert.ok(
false,

View file

@ -6,7 +6,7 @@ let distroDir = FileUtils.getDir("ProfD", ["sysfeatures", "empty"]);
distroDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
registerDirectory("XREAppFeat", distroDir);
AddonTestUtils.usePrivilegedSignatures = id => "system";
AddonTestUtils.usePrivilegedSignatures = () => "system";
add_task(() => initSystemAddonDirs());

View file

@ -20,7 +20,7 @@ const systemDefaults = FileUtils.getDir("ProfD", [
systemDefaults.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
registerDirectory("XREAppFeat", systemDefaults);
AddonTestUtils.usePrivilegedSignatures = id => "system";
AddonTestUtils.usePrivilegedSignatures = () => "system";
const ADDON_ID = "updates@test";

View file

@ -80,7 +80,7 @@ add_task(async function test_new_temporary() {
Assert.equal(aInstall.version, "1.0");
installedCalled = true;
},
onInstallStarted: aInstall => {
onInstallStarted: () => {
do_throw("onInstallStarted called unexpectedly");
},
});
@ -416,7 +416,7 @@ add_task(async function test_replace_permanent() {
}
installedCalled = true;
},
onInstallStarted: aInstall => {
onInstallStarted: () => {
do_throw("onInstallStarted called unexpectedly");
},
});

View file

@ -595,25 +595,22 @@ add_task(async function test_params() {
let resultsPromise = new Promise(resolve => {
let results = new Map();
testserver.registerPathHandler(
"/data/param_test.json",
function (request, response) {
let params = new URLSearchParams(request.queryString);
let itemId = params.get("item_id");
ok(
!results.has(itemId),
`Should not see a duplicate request for item ${itemId}`
);
testserver.registerPathHandler("/data/param_test.json", function (request) {
let params = new URLSearchParams(request.queryString);
let itemId = params.get("item_id");
ok(
!results.has(itemId),
`Should not see a duplicate request for item ${itemId}`
);
results.set(itemId, params);
results.set(itemId, params);
if (results.size === PARAM_IDS.length) {
resolve(results);
}
request.setStatusLine(null, 500, "Server Error");
if (results.size === PARAM_IDS.length) {
resolve(results);
}
);
request.setStatusLine(null, 500, "Server Error");
});
});
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");
},
onDownloadFailed(aInstall) {
onDownloadFailed() {
ok(false, "Should not have seen onDownloadFailed event");
},
onDownloadCancelled(aInstall) {
onDownloadCancelled() {
ok(false, "Should not have seen onDownloadCancelled event");
},
@ -764,11 +761,11 @@ add_task(async function test_no_auto_update() {
resolve();
},
onInstallFailed(aInstall) {
onInstallFailed() {
ok(false, "Should not have seen onInstallFailed event");
},
onInstallCancelled(aInstall) {
onInstallCancelled() {
ok(false, "Should not have seen onInstallCancelled event");
},
};

View file

@ -27,7 +27,7 @@ function makeCancelListener() {
});
return {
onUpdateAvailable(addon, install) {
onUpdateAvailable() {
reject("Should not have seen onUpdateAvailable notification");
},

View file

@ -67,7 +67,7 @@ add_task(async function test_update_theme_to_extension() {
await Assert.rejects(
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"
);

View file

@ -25,7 +25,7 @@ add_task(async function test_systems_update_uninstall_check() {
await setupSystemAddonConditions(initialSetup, distroDir);
const testserver = createHttpServer({ hosts: ["example.com"] });
testserver.registerPathHandler("/update.json", (request, response) => {
testserver.registerPathHandler("/update.json", request => {
Assert.ok(
!request._queryString.includes("system2@tests.mozilla.org"),
"System addon should not request update from normal update process"

View file

@ -74,7 +74,7 @@ add_task(async function test_update_new_id() {
await Assert.rejects(
install.install(),
err => install.error == AddonManager.ERROR_INCORRECT_ID,
() => install.error == AddonManager.ERROR_INCORRECT_ID,
"Upgrade to a different ID fails"
);

View file

@ -65,7 +65,7 @@ add_task(async function test_update_version_mismatch() {
await Assert.rejects(
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"
);

View file

@ -42,7 +42,7 @@ function get_auth_info() {
return ["testuser", "testpass"];
}
function download_failed(install) {
function download_failed() {
ok(false, "Install should not have failed");
}

View file

@ -45,7 +45,7 @@ function get_auth_info() {
return ["testuser", "testpass"];
}
function download_failed(install) {
function download_failed() {
ok(false, "Install should not have failed");
}

View file

@ -54,7 +54,7 @@ function allow_blocked(installInfo) {
return false;
}
function confirm_install(panel) {
function confirm_install() {
ok(false, "Should not see the install dialog");
return false;
}

View file

@ -40,7 +40,7 @@ function allow_blocked(installInfo) {
return false;
}
function confirm_install(panel) {
function confirm_install() {
ok(false, "Should not see the install dialog");
return false;
}

View file

@ -36,7 +36,7 @@ function test() {
);
}
function confirm_install(panel) {
function confirm_install() {
ok(false, "Should not see the install dialog");
return false;
}

View file

@ -52,7 +52,7 @@ async function waitForProgressNotification(
let topic = getObserverTopic(notificationId);
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
if (
notificationId != PROGRESS_NOTIFICATION &&
@ -208,7 +208,7 @@ async function waitForNotification(
let observerPromise;
if (aId !== "addon-webext-permissions") {
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
if (
aId != PROGRESS_NOTIFICATION &&
@ -298,7 +298,7 @@ function acceptInstallDialog(installDialog) {
installDialog.button.click();
}
async function waitForSingleNotification(aCallback) {
async function waitForSingleNotification() {
while (PopupNotifications.panel.childNodes.length != 1) {
await new Promise(resolve => executeSoon(resolve));
@ -1477,7 +1477,7 @@ var TESTS = [
var gTestStart = null;
var XPInstallObserver = {
observe(aSubject, aTopic, aData) {
observe(aSubject, aTopic) {
var installInfo = aSubject.wrappedJSObject;
info(
"Observed " + aTopic + " for " + installInfo.installs.length + " installs"

View file

@ -51,17 +51,17 @@ add_task(async function test_disabled() {
add_task(async function test_disabled2() {
let installDisabledCalled = false;
Harness.installDisabledCallback = installInfo => {
Harness.installDisabledCallback = () => {
installDisabledCalled = true;
ok(true, "Saw installation disabled");
};
Harness.installBlockedCallback = installInfo => {
Harness.installBlockedCallback = () => {
ok(false, "Should never see the blocked install notification");
return false;
};
Harness.installConfirmCallback = panel => {
Harness.installConfirmCallback = () => {
ok(false, "Should never see an install confirmation dialog");
return false;
};

View file

@ -27,7 +27,7 @@ function test() {
});
}
function allow_blocked(installInfo) {
function allow_blocked() {
ok(true, "Seen blocked");
return false;
}

View file

@ -40,7 +40,7 @@ function test() {
);
}
function allow_blocked(installInfo) {
function allow_blocked() {
ok(true, "Seen blocked");
return false;
}

View file

@ -39,7 +39,7 @@ function test() {
);
}
function allow_blocked(installInfo) {
function allow_blocked() {
ok(true, "Seen blocked");
return false;
}

View file

@ -28,7 +28,7 @@ function test() {
);
}
function download_progress(addon, value, maxValue) {
function download_progress() {
try {
// Tests always connect to localhost, and per bug 87717, localhost is now
// reachable in offline mode. To avoid this, disable any proxy.

View file

@ -40,7 +40,7 @@ function test() {
);
}
function install_blocked(installInfo) {
function install_blocked() {
wasOriginBlocked = true;
}

View file

@ -512,7 +512,7 @@ var Harness = {
// nsIObserver
observe(subject, topic, data) {
observe(subject, topic) {
var installInfo = subject.wrappedJSObject;
switch (topic) {
case "addon-install-started":

View file

@ -10,7 +10,7 @@
<script type="text/javascript">
/* globals InstallTrigger */
/* exported startInstall */
function installCallback(url, status) {
function installCallback() {
document.location = "#foo";
dump("Sending InstallComplete\n");