Bug 1864896: Autofix unused function arguments (toolkit). r=mconley,translations-reviewers,omc-reviewers,aminomancer

Differential Revision: https://phabricator.services.mozilla.com/D203002
This commit is contained in:
Dave Townsend 2024-03-19 14:59:21 +00:00
parent 0391afb5dc
commit 6b484b48f8
235 changed files with 570 additions and 631 deletions

View file

@ -4,7 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
export class AutoplayChild extends JSWindowActorChild { export class AutoplayChild extends JSWindowActorChild {
handleEvent(event) { handleEvent() {
this.sendAsyncMessage("GloballyAutoplayBlocked", {}); this.sendAsyncMessage("GloballyAutoplayBlocked", {});
} }
} }

View file

@ -4,7 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
export class AutoplayParent extends JSWindowActorParent { export class AutoplayParent extends JSWindowActorParent {
receiveMessage(aMessage) { receiveMessage() {
let topBrowsingContext = this.manager.browsingContext.top; let topBrowsingContext = this.manager.browsingContext.top;
let browser = topBrowsingContext.embedderElement; let browser = topBrowsingContext.embedderElement;
let document = browser.ownerDocument; let document = browser.ownerDocument;

View file

@ -47,7 +47,7 @@ export class ControllersParent extends JSWindowActorParent {
this.sendAsyncMessage("ControllerCommands:Do", aCommand); this.sendAsyncMessage("ControllerCommands:Do", aCommand);
} }
getCommandStateWithParams(aCommand, aCommandParams) { getCommandStateWithParams() {
throw Components.Exception("Not implemented", Cr.NS_ERROR_NOT_IMPLEMENTED); throw Components.Exception("Not implemented", Cr.NS_ERROR_NOT_IMPLEMENTED);
} }

View file

@ -33,7 +33,7 @@ class CaptivePortalObserver {
Services.obs.removeObserver(this, "captive-portal-login-success"); Services.obs.removeObserver(this, "captive-portal-login-success");
} }
observe(aSubject, aTopic, aData) { observe(aSubject, aTopic) {
switch (aTopic) { switch (aTopic) {
case "captive-portal-login-abort": case "captive-portal-login-abort":
case "captive-portal-login-success": case "captive-portal-login-success":
@ -172,7 +172,7 @@ export class NetErrorParent extends JSWindowActorParent {
request.channel.loadFlags |= Ci.nsIRequest.LOAD_BYPASS_CACHE; request.channel.loadFlags |= Ci.nsIRequest.LOAD_BYPASS_CACHE;
request.channel.loadFlags |= Ci.nsIRequest.INHIBIT_CACHING; request.channel.loadFlags |= Ci.nsIRequest.INHIBIT_CACHING;
request.addEventListener("error", event => { request.addEventListener("error", () => {
// Make sure the user is still on the cert error page. // Make sure the user is still on the cert error page.
if (!browser.documentURI.spec.startsWith("about:certerror")) { if (!browser.documentURI.spec.startsWith("about:certerror")) {
return; return;

View file

@ -947,11 +947,8 @@ export class PictureInPictureToggleChild extends JSWindowActorChild {
* tear out or in. If we happened to be tracking videos before the tear * tear out or in. If we happened to be tracking videos before the tear
* occurred, we re-add the mouse event listeners so that they're attached to * occurred, we re-add the mouse event listeners so that they're attached to
* the right WindowRoot. * the right WindowRoot.
*
* @param {Event} event The pageshow event fired when completing a tab tear
* out or in.
*/ */
onPageShow(event) { onPageShow() {
let state = this.docState; let state = this.docState;
if (state.isTrackingVideos) { if (state.isTrackingVideos) {
this.addMouseButtonListeners(); this.addMouseButtonListeners();
@ -963,11 +960,8 @@ export class PictureInPictureToggleChild extends JSWindowActorChild {
* tear out or in. If we happened to be tracking videos before the tear * tear out or in. If we happened to be tracking videos before the tear
* occurred, we remove the mouse event listeners. We'll re-add them when the * occurred, we remove the mouse event listeners. We'll re-add them when the
* pageshow event fires. * pageshow event fires.
*
* @param {Event} event The pagehide event fired when starting a tab tear
* out or in.
*/ */
onPageHide(event) { onPageHide() {
let state = this.docState; let state = this.docState;
if (state.isTrackingVideos) { if (state.isTrackingVideos) {
this.removeMouseButtonListeners(); this.removeMouseButtonListeners();
@ -1049,7 +1043,7 @@ export class PictureInPictureToggleChild extends JSWindowActorChild {
} }
} }
startPictureInPicture(event, video, toggle) { startPictureInPicture(event, video) {
Services.telemetry.keyedScalarAdd( Services.telemetry.keyedScalarAdd(
"pictureinpicture.opened_method", "pictureinpicture.opened_method",
"toggle", "toggle",
@ -2445,7 +2439,7 @@ export class PictureInPictureChild extends JSWindowActorChild {
} }
} }
onCueChange(e) { onCueChange() {
if (!lazy.DISPLAY_TEXT_TRACKS_PREF) { if (!lazy.DISPLAY_TEXT_TRACKS_PREF) {
this.updateWebVTTTextTracksDisplay(null); this.updateWebVTTTextTracksDisplay(null);
} else { } else {
@ -3110,10 +3104,10 @@ class PictureInPictureChildVideoWrapper {
* a cue change is triggered {@see updatePiPTextTracks()}. * a cue change is triggered {@see updatePiPTextTracks()}.
* @param {HTMLVideoElement} video * @param {HTMLVideoElement} video
* The originating video source element * The originating video source element
* @param {Function} callback * @param {Function} _callback
* The callback function to be executed when cue changes are detected * The callback function to be executed when cue changes are detected
*/ */
setCaptionContainerObserver(video, callback) { setCaptionContainerObserver(video, _callback) {
return this.#callWrapperMethod({ return this.#callWrapperMethod({
name: "setCaptionContainerObserver", name: "setCaptionContainerObserver",
args: [ args: [

View file

@ -94,7 +94,7 @@ export class PrintingChild extends JSWindowActorChild {
// will wait for MozAfterPaint event to be fired. // will wait for MozAfterPaint event to be fired.
let actor = thisWindow.windowGlobalChild.getActor("Printing"); let actor = thisWindow.windowGlobalChild.getActor("Printing");
let webProgressListener = { let webProgressListener = {
onStateChange(webProgress, req, flags, status) { onStateChange(webProgress, req, flags) {
if (flags & Ci.nsIWebProgressListener.STATE_STOP) { if (flags & Ci.nsIWebProgressListener.STATE_STOP) {
webProgress.removeProgressListener(webProgressListener); webProgress.removeProgressListener(webProgressListener);
let domUtils = contentWindow.windowUtils; let domUtils = contentWindow.windowUtils;

View file

@ -70,7 +70,7 @@ SelectContentHelper.prototype = {
mozSystemGroup: true, mozSystemGroup: true,
}); });
let MutationObserver = this.element.ownerGlobal.MutationObserver; let MutationObserver = this.element.ownerGlobal.MutationObserver;
this.mut = new MutationObserver(mutations => { this.mut = new MutationObserver(() => {
// Something changed the <select> while it was open, so // Something changed the <select> while it was open, so
// we'll poke a DeferredTask to update the parent sometime // we'll poke a DeferredTask to update the parent sometime
// in the very near future. // in the very near future.

View file

@ -125,7 +125,7 @@ export class ViewSourcePageChild extends JSWindowActorChild {
* @param event * @param event
* The pageshow event being handled. * The pageshow event being handled.
*/ */
onPageShow(event) { onPageShow() {
// If we need to draw the selection, wait until an actual view source page // If we need to draw the selection, wait until an actual view source page
// has loaded, instead of about:blank. // has loaded, instead of about:blank.
if ( if (

View file

@ -509,7 +509,7 @@ function loadPrefs() {
}); });
}); });
showAll.addEventListener("click", event => { showAll.addEventListener("click", () => {
search.focus(); search.focus();
search.value = ""; search.value = "";
gFilterPrefsTask.disarm(); gFilterPrefsTask.disarm();

View file

@ -608,7 +608,7 @@ function dumpGCLogAndCCLog(aVerbose) {
); );
let section = appendElement(gMain, "div", "section"); let section = appendElement(gMain, "div", "section");
function displayInfo(aGCLog, aCCLog, aIsParent) { function displayInfo(aGCLog, aCCLog) {
appendElementWithText(section, "div", "", "Saved GC log to " + aGCLog.path); appendElementWithText(section, "div", "", "Saved GC log to " + aGCLog.path);
let ccLogType = aVerbose ? "verbose" : "concise"; let ccLogType = aVerbose ? "verbose" : "concise";
@ -824,7 +824,7 @@ function loadMemoryReportsFromFile(aFilename, aTitleNote, aFn) {
"uncompressed", "uncompressed",
{ {
data: [], data: [],
onStartRequest(aR, aC) {}, onStartRequest() {},
onDataAvailable(aR, aStream, aO, aCount) { onDataAvailable(aR, aStream, aO, aCount) {
let bi = new nsBinaryStream(aStream); let bi = new nsBinaryStream(aStream);
this.data.push(bi.readBytes(aCount)); this.data.push(bi.readBytes(aCount));

View file

@ -40,7 +40,7 @@
const PERCENTAGE = Ci.nsIMemoryReporter.UNITS_PERCENTAGE; const PERCENTAGE = Ci.nsIMemoryReporter.UNITS_PERCENTAGE;
let fakeReporters = [ let fakeReporters = [
{ collectReports(aCbObj, aClosure, aAnonymize) { { collectReports(aCbObj, aClosure) {
function f(aP, aK, aU, aA) { function f(aP, aK, aU, aA) {
aCbObj.callback("Main Process", aP, aK, aU, aA, "Desc.", aClosure); aCbObj.callback("Main Process", aP, aK, aU, aA, "Desc.", aClosure);
} }
@ -77,7 +77,7 @@
f("compartments/system/foo", OTHER, COUNT, 1); f("compartments/system/foo", OTHER, COUNT, 1);
} }
}, },
{ collectReports(aCbObj, aClosure, aAnonymize) { { collectReports(aCbObj, aClosure) {
function f(aP, aK, aU, aA) { function f(aP, aK, aU, aA) {
aCbObj.callback("Main Process", aP, aK, aU, aA, "Desc.", aClosure); aCbObj.callback("Main Process", aP, aK, aU, aA, "Desc.", aClosure);
} }
@ -92,7 +92,7 @@
f("explicit/f/g/h/j", HEAP, BYTES, 10 * MB); f("explicit/f/g/h/j", HEAP, BYTES, 10 * MB);
} }
}, },
{ collectReports(aCbObj, aClosure, aAnonymize) { { collectReports(aCbObj, aClosure) {
function f(aP, aK, aU, aA) { function f(aP, aK, aU, aA) {
aCbObj.callback("Main Process", aP, aK, aU, aA, "Desc.", aClosure); aCbObj.callback("Main Process", aP, aK, aU, aA, "Desc.", aClosure);
} }
@ -103,7 +103,7 @@
f("compartments/user/https:\\\\very-long-url.com\\very-long\\oh-so-long\\really-quite-long.html?a=2&b=3&c=4&d=5&e=abcdefghijklmnopqrstuvwxyz&f=123456789123456789123456789", OTHER, COUNT, 1); f("compartments/user/https:\\\\very-long-url.com\\very-long\\oh-so-long\\really-quite-long.html?a=2&b=3&c=4&d=5&e=abcdefghijklmnopqrstuvwxyz&f=123456789123456789123456789", OTHER, COUNT, 1);
} }
}, },
{ collectReports(aCbObj, aClosure, aAnonymize) { { collectReports(aCbObj, aClosure) {
function f(aP) { function f(aP) {
aCbObj.callback("Main Process", aP, OTHER, COUNT, 1, "Desc.", aClosure); aCbObj.callback("Main Process", aP, OTHER, COUNT, 1, "Desc.", aClosure);
} }
@ -121,7 +121,7 @@
// the largest). Processes without a |resident| memory reporter are saved // the largest). Processes without a |resident| memory reporter are saved
// for the end. // for the end.
let fakeReporters2 = [ let fakeReporters2 = [
{ collectReports(aCbObj, aClosure, aAnonymize) { { collectReports(aCbObj, aClosure) {
function f(aP1, aP2, aK, aU, aA) { function f(aP1, aP2, aK, aU, aA) {
aCbObj.callback(aP1, aP2, aK, aU, aA, "Desc.", aClosure); aCbObj.callback(aP1, aP2, aK, aU, aA, "Desc.", aClosure);
} }

View file

@ -36,7 +36,7 @@
let jk2Path = "explicit/j/k2"; let jk2Path = "explicit/j/k2";
let fakeReporters = [ let fakeReporters = [
{ collectReports(aCbObj, aClosure, aAnonymize) { { collectReports(aCbObj, aClosure) {
function f(aP, aK, aA) { function f(aP, aK, aA) {
aCbObj.callback("Main Process ABC", aP, aK, BYTES, aA, "Desc.", aClosure); aCbObj.callback("Main Process ABC", aP, aK, BYTES, aA, "Desc.", aClosure);
} }

View file

@ -31,7 +31,7 @@
const BYTES = Ci.nsIMemoryReporter.UNITS_BYTES; const BYTES = Ci.nsIMemoryReporter.UNITS_BYTES;
let fakeReporters = [ let fakeReporters = [
{ collectReports(aCbObj, aClosure, aAnonymize) { { collectReports(aCbObj, aClosure) {
function f(aP, aK, aA, aD) { function f(aP, aK, aA, aD) {
aCbObj.callback("", aP, aK, BYTES, aA, aD, aClosure); aCbObj.callback("", aP, aK, BYTES, aA, aD, aClosure);
} }

View file

@ -35,7 +35,7 @@
frame.height = 300; frame.height = 300;
frame.src = "about:memory?file=" + makePathname(aFilename); frame.src = "about:memory?file=" + makePathname(aFilename);
document.documentElement.appendChild(frame); document.documentElement.appendChild(frame);
frame.addEventListener("load", function onFrameLoad(e) { frame.addEventListener("load", function onFrameLoad() {
frame.focus(); frame.focus();
// Initialize the clipboard contents. // Initialize the clipboard contents.

View file

@ -30,7 +30,7 @@
const BYTES = Ci.nsIMemoryReporter.UNITS_BYTES; const BYTES = Ci.nsIMemoryReporter.UNITS_BYTES;
let fakeReporters = [ let fakeReporters = [
{ collectReports(aCbObj, aClosure, aAnonymize) { { collectReports(aCbObj, aClosure) {
function f(aP, aK, aA) { function f(aP, aK, aA) {
aCbObj.callback("Main Process", aP, aK, BYTES, aA, "Desc.", aClosure); aCbObj.callback("Main Process", aP, aK, BYTES, aA, "Desc.", aClosure);
} }

View file

@ -77,8 +77,7 @@
let mySandbox = Cu.Sandbox(document.nodePrincipal, let mySandbox = Cu.Sandbox(document.nodePrincipal,
{ sandboxName: "this-is-a-sandbox-name" }); { sandboxName: "this-is-a-sandbox-name" });
function handleReportNormal(aProcess, aPath, aKind, aUnits, aAmount, function handleReportNormal(aProcess, aPath, aKind, aUnits, aAmount)
aDescription)
{ {
if (aProcess.startsWith(`Utility `)) { if (aProcess.startsWith(`Utility `)) {
// The Utility process that runs the ORB JavaScript validator starts on first // The Utility process that runs the ORB JavaScript validator starts on first
@ -128,8 +127,7 @@
} }
} }
function handleReportAnonymized(aProcess, aPath, aKind, aUnits, aAmount, function handleReportAnonymized(aProcess, aPath)
aDescription)
{ {
// Path might include an xmlns using http, which is safe to ignore. // Path might include an xmlns using http, which is safe to ignore.
let reducedPath = aPath.replace(XUL_NS, ""); let reducedPath = aPath.replace(XUL_NS, "");
@ -331,7 +329,7 @@
} }
}, },
// nsIMemoryReporter // nsIMemoryReporter
collectReports(callback, data, anonymize) { collectReports(callback, data) {
for (let path of Object.keys(this.tests)) { for (let path of Object.keys(this.tests)) {
try { try {
let test = this.tests[path]; let test = this.tests[path];
@ -350,7 +348,7 @@
} }
}, },
// nsIHandleReportCallback // nsIHandleReportCallback
callback(process, path, kind, units, amount, data) { callback(process, path, kind, units, amount) {
if (path in this.tests) { if (path in this.tests) {
this.seen++; this.seen++;
let test = this.tests[path]; let test = this.tests[path];

View file

@ -55,7 +55,7 @@
{ {
let residents = {}; let residents = {};
let handleReport = function(aProcess, aPath, aKind, aUnits, aAmount, aDesc) { let handleReport = function(aProcess, aPath, aKind, aUnits, aAmount) {
if (aProcess.startsWith(`Utility `)) { if (aProcess.startsWith(`Utility `)) {
// The Utility process that runs the ORB JavaScript validator starts on first // The Utility process that runs the ORB JavaScript validator starts on first
// idle in the parent process. This makes it notoriously hard to know _if_ it // idle in the parent process. This makes it notoriously hard to know _if_ it

View file

@ -17,14 +17,7 @@ function run_test() {
}; };
let foundGPUProcess = false; let foundGPUProcess = false;
let onHandleReport = function ( let onHandleReport = function (aProcess) {
aProcess,
aPath,
aKind,
aUnits,
aAmount,
aDescription
) {
if (/GPU \(pid \d+\)/.test(aProcess)) { if (/GPU \(pid \d+\)/.test(aProcess)) {
foundGPUProcess = true; foundGPUProcess = true;
} }

View file

@ -787,7 +787,7 @@ var View = {
return isOpen; return isOpen;
}, },
displayDOMWindowRow(data, parent) { displayDOMWindowRow(data) {
const cellCount = 2; const cellCount = 2;
let rowId = "w:" + data.outerWindowId; let rowId = "w:" + data.outerWindowId;
let row = this._getOrCreateRow(rowId, cellCount); let row = this._getOrCreateRow(rowId, cellCount);
@ -1124,7 +1124,7 @@ var Control = {
// Visibility change: // Visibility change:
// - stop updating while the user isn't looking; // - stop updating while the user isn't looking;
// - resume updating when the user returns. // - resume updating when the user returns.
window.addEventListener("visibilitychange", event => { window.addEventListener("visibilitychange", () => {
if (!document.hidden) { if (!document.hidden) {
this._updateDisplay(true); this._updateDisplay(true);
} }

View file

@ -135,7 +135,7 @@ add_task(async () => {
"after system info was collected." "after system info was collected."
); );
await BrowserTestUtils.withNewTab("about:third-party", async browser => { await BrowserTestUtils.withNewTab("about:third-party", async () => {
if (!content.fetchDataDone) { if (!content.fetchDataDone) {
const mainDiv = content.document.getElementById("main"); const mainDiv = content.document.getElementById("main");
await BrowserTestUtils.waitForMutationCondition( await BrowserTestUtils.waitForMutationCondition(

View file

@ -546,7 +546,7 @@ function sidebar_set_disabled(disabled) {
}); });
} }
function check_pin_repeat_is_correct(button) { function check_pin_repeat_is_correct() {
let pin = document.getElementById("new-pin"); let pin = document.getElementById("new-pin");
let pin_repeat = document.getElementById("new-pin-repeat"); let pin_repeat = document.getElementById("new-pin-repeat");
let has_current_pin = !document.getElementById("current-pin-div").hidden; let has_current_pin = !document.getElementById("current-pin-div").hidden;
@ -853,7 +853,7 @@ try {
Ci.nsIWebAuthnService Ci.nsIWebAuthnService
); );
document.addEventListener("DOMContentLoaded", onLoad); document.addEventListener("DOMContentLoaded", onLoad);
window.addEventListener("beforeunload", event => { window.addEventListener("beforeunload", () => {
AboutWebauthnManagerJS.uninit(); AboutWebauthnManagerJS.uninit();
if (AboutWebauthnService) { if (AboutWebauthnService) {
AboutWebauthnService.cancel(0); AboutWebauthnService.cancel(0);

View file

@ -24,7 +24,7 @@ registerCleanupFunction(async function () {
function send_credential_list(credlist) { function send_credential_list(credlist) {
let num_of_creds = 0; let num_of_creds = 0;
credlist.forEach(domain => { credlist.forEach(domain => {
domain.credentials.forEach(c => { domain.credentials.forEach(() => {
num_of_creds += 1; num_of_creds += 1;
}); });
}); });

View file

@ -29,7 +29,7 @@ add_task(async () => {
}); });
await BrowserTestUtils.withNewTab( await BrowserTestUtils.withNewTab(
{ gBrowser: originalBrowser, url: "about:windows-messages" }, { gBrowser: originalBrowser, url: "about:windows-messages" },
async browser => { async () => {
let messagesList = content.document.getElementById("windows-div"); let messagesList = content.document.getElementById("windows-div");
// This is tricky because the test framework has its own windows // This is tricky because the test framework has its own windows
Assert.greaterOrEqual( Assert.greaterOrEqual(

View file

@ -23,7 +23,7 @@ const chromeScript = SpecialPowers.loadChromeScript(_ => {
sendAsyncMessage("waitForXULAlert", false); sendAsyncMessage("waitForXULAlert", false);
}, 2000); }, 2000);
var windowObserver = function(win, aTopic, aData) { var windowObserver = function(win, aTopic) {
if (aTopic != "domwindowopened") { if (aTopic != "domwindowopened") {
return; return;
} }
@ -95,7 +95,7 @@ add_task(async function test_require_interaction() {
var actualSequence = []; var actualSequence = [];
function createAlertListener(name, showCallback, finishCallback) { function createAlertListener(name, showCallback, finishCallback) {
return (subject, topic, data) => { return (subject, topic) => {
if (topic == "alertshow") { if (topic == "alertshow") {
actualSequence.push(name + " show"); actualSequence.push(name + " show");
if (showCallback) { if (showCallback) {

View file

@ -18,7 +18,7 @@
let promise = new Promise((res, rej) => {resolve = res; reject = rej}); let promise = new Promise((res, rej) => {resolve = res; reject = rej});
let success = false; let success = false;
function observe(aSubject, aTopic, aData) { function observe(aSubject, aTopic) {
if (aTopic == "alertshow") { if (aTopic == "alertshow") {
success = true; success = true;
notifier.closeAlert(alertName); notifier.closeAlert(alertName);

View file

@ -26,7 +26,7 @@ const chromeScript = SpecialPowers.loadChromeScript(_ => {
sendAsyncMessage("waitedForPosition", null); sendAsyncMessage("waitedForPosition", null);
}, 2000); }, 2000);
var windowObserver = function(win, aTopic, aData) { var windowObserver = function(win, aTopic) {
if (aTopic != "domwindowopened") { if (aTopic != "domwindowopened") {
return; return;
} }

View file

@ -38,7 +38,7 @@ const chromeScript = SpecialPowers.loadChromeScript(_ => {
function notify(alertName, principal) { function notify(alertName, principal) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
var source; var source;
async function observe(subject, topic, data) { async function observe(subject, topic) {
if (topic == "alertclickcallback") { if (topic == "alertclickcallback") {
reject(new Error("Alerts should not be clicked during test")); reject(new Error("Alerts should not be clicked during test"));
} else if (topic == "alertshow") { } else if (topic == "alertshow") {

View file

@ -101,7 +101,7 @@ AutoCompleteResultBase.prototype = {
return this._styles[aIndex]; return this._styles[aIndex];
}, },
getImageAt(aIndex) { getImageAt() {
return ""; return "";
}, },
@ -109,11 +109,11 @@ AutoCompleteResultBase.prototype = {
return this._finalCompleteValues[aIndex] || this._values[aIndex]; return this._finalCompleteValues[aIndex] || this._values[aIndex];
}, },
isRemovableAt(aRowIndex) { isRemovableAt() {
return true; return true;
}, },
removeValueAt(aRowIndex) {}, removeValueAt() {},
// nsISupports implementation // nsISupports implementation
QueryInterface: ChromeUtils.generateQI(["nsIAutoCompleteResult"]), QueryInterface: ChromeUtils.generateQI(["nsIAutoCompleteResult"]),
@ -161,7 +161,7 @@ function AutocompletePopupBase(input) {
AutocompletePopupBase.prototype = { AutocompletePopupBase.prototype = {
selectedIndex: 0, selectedIndex: 0,
invalidate() {}, invalidate() {},
selectBy(reverse, page) { selectBy(reverse) {
let numRows = this.input.controller.matchCount; let numRows = this.input.controller.matchCount;
if (numRows > 0) { if (numRows > 0) {
let delta = reverse ? -1 : 1; let delta = reverse ? -1 : 1;

View file

@ -45,7 +45,7 @@ AutoCompleteInput.prototype = {
popupOpen: false, popupOpen: false,
popup: { popup: {
setSelectedIndex(aIndex) {}, setSelectedIndex() {},
invalidate() {}, invalidate() {},
// nsISupports implementation // nsISupports implementation
@ -100,7 +100,7 @@ AutoCompleteResult.prototype = {
return this._styles[aIndex]; return this._styles[aIndex];
}, },
getImageAt(aIndex) { getImageAt() {
return ""; return "";
}, },
@ -108,11 +108,11 @@ AutoCompleteResult.prototype = {
return this.getValueAt(aIndex); return this.getValueAt(aIndex);
}, },
isRemovableAt(aRowIndex) { isRemovableAt() {
return true; return true;
}, },
removeValueAt(aRowIndex) {}, removeValueAt() {},
// nsISupports implementation // nsISupports implementation
QueryInterface: ChromeUtils.generateQI(["nsIAutoCompleteResult"]), QueryInterface: ChromeUtils.generateQI(["nsIAutoCompleteResult"]),

View file

@ -44,7 +44,7 @@ AutoCompleteInput.prototype = {
popupOpen: false, popupOpen: false,
popup: { popup: {
setSelectedIndex(aIndex) {}, setSelectedIndex() {},
invalidate() {}, invalidate() {},
// nsISupports implementation // nsISupports implementation
@ -99,7 +99,7 @@ AutoCompleteResult.prototype = {
return this._styles[aIndex]; return this._styles[aIndex];
}, },
getImageAt(aIndex) { getImageAt() {
return ""; return "";
}, },
@ -107,11 +107,11 @@ AutoCompleteResult.prototype = {
return this.getValueAt(aIndex); return this.getValueAt(aIndex);
}, },
isRemovableAt(aRowIndex) { isRemovableAt() {
return true; return true;
}, },
removeValueAt(aRowIndex) {}, removeValueAt() {},
// nsISupports implementation // nsISupports implementation
QueryInterface: ChromeUtils.generateQI(["nsIAutoCompleteResult"]), QueryInterface: ChromeUtils.generateQI(["nsIAutoCompleteResult"]),

View file

@ -43,7 +43,7 @@ AutoCompleteInput.prototype = {
popupOpen: false, popupOpen: false,
popup: { popup: {
setSelectedIndex(aIndex) {}, setSelectedIndex() {},
invalidate() {}, invalidate() {},
// nsISupports implementation // nsISupports implementation
@ -98,7 +98,7 @@ AutoCompleteResult.prototype = {
return this._styles[aIndex]; return this._styles[aIndex];
}, },
getImageAt(aIndex) { getImageAt() {
return ""; return "";
}, },
@ -106,11 +106,11 @@ AutoCompleteResult.prototype = {
return this.getValueAt(aIndex); return this.getValueAt(aIndex);
}, },
isRemovableAt(aRowIndex) { isRemovableAt() {
return true; return true;
}, },
removeValueAt(aRowIndex) {}, removeValueAt() {},
// nsISupports implementation // nsISupports implementation
QueryInterface: ChromeUtils.generateQI(["nsIAutoCompleteResult"]), QueryInterface: ChromeUtils.generateQI(["nsIAutoCompleteResult"]),

View file

@ -40,7 +40,7 @@ AutoCompleteInput.prototype = {
popupOpen: false, popupOpen: false,
popup: { popup: {
setSelectedIndex(aIndex) {}, setSelectedIndex() {},
invalidate() {}, invalidate() {},
// nsISupports implementation // nsISupports implementation
@ -92,7 +92,7 @@ AutoCompleteResult.prototype = {
return this._styles[aIndex]; return this._styles[aIndex];
}, },
getImageAt(aIndex) { getImageAt() {
return ""; return "";
}, },
@ -100,11 +100,11 @@ AutoCompleteResult.prototype = {
return this.getValueAt(aIndex); return this.getValueAt(aIndex);
}, },
isRemovableAt(aRowIndex) { isRemovableAt() {
return true; return true;
}, },
removeValueAt(aRowIndex) {}, removeValueAt() {},
// nsISupports implementation // nsISupports implementation
QueryInterface: ChromeUtils.generateQI(["nsIAutoCompleteResult"]), QueryInterface: ChromeUtils.generateQI(["nsIAutoCompleteResult"]),

View file

@ -21,12 +21,7 @@ function doSearch(aString, aUserContextId) {
return new Promise(resolve => { return new Promise(resolve => {
let search = new AutoCompleteSearch("test"); let search = new AutoCompleteSearch("test");
search.startSearch = function ( search.startSearch = function (aSearchString, aSearchParam) {
aSearchString,
aSearchParam,
aPreviousResult,
aListener
) {
unregisterAutoCompleteSearch(search); unregisterAutoCompleteSearch(search);
resolve(aSearchParam); resolve(aSearchParam);
}; };

View file

@ -45,7 +45,7 @@ AutoCompleteInput.prototype = {
popupOpen: false, popupOpen: false,
popup: { popup: {
setSelectedIndex(aIndex) {}, setSelectedIndex() {},
invalidate() {}, invalidate() {},
// nsISupports implementation // nsISupports implementation
@ -100,7 +100,7 @@ AutoCompleteResult.prototype = {
return this._styles[aIndex]; return this._styles[aIndex];
}, },
getImageAt(aIndex) { getImageAt() {
return ""; return "";
}, },
@ -108,11 +108,11 @@ AutoCompleteResult.prototype = {
return this.getValueAt(aIndex); return this.getValueAt(aIndex);
}, },
isRemovableAt(aRowIndex) { isRemovableAt() {
return true; return true;
}, },
removeValueAt(aRowIndex) {}, removeValueAt() {},
// nsISupports implementation // nsISupports implementation
QueryInterface: ChromeUtils.generateQI(["nsIAutoCompleteResult"]), QueryInterface: ChromeUtils.generateQI(["nsIAutoCompleteResult"]),

View file

@ -60,7 +60,7 @@ function AutoCompleteSearch(aName) {
AutoCompleteSearch.prototype = { AutoCompleteSearch.prototype = {
constructor: AutoCompleteSearch, constructor: AutoCompleteSearch,
stopSearchInvoked: true, stopSearchInvoked: true,
startSearch(aSearchString, aSearchParam, aPreviousResult, aListener) { startSearch() {
info("Check stop search has been called"); info("Check stop search has been called");
Assert.ok(this.stopSearchInvoked); Assert.ok(this.stopSearchInvoked);
this.stopSearchInvoked = false; this.stopSearchInvoked = false;

View file

@ -142,7 +142,7 @@ BHRTelemetryService.prototype = Object.freeze({
this.submit(); this.submit();
}, },
observe(aSubject, aTopic, aData) { observe(aSubject, aTopic) {
switch (aTopic) { switch (aTopic) {
case "profile-after-change": case "profile-after-change":
this.resetPayload(); this.resetPayload();

View file

@ -82,10 +82,7 @@ outputInfo = (sentinel, info) => {
dump(`${sentinel}${JSON.stringify(info)}${sentinel}\n`); dump(`${sentinel}${JSON.stringify(info)}${sentinel}\n`);
}; };
function monkeyPatchRemoteSettingsClient({ function monkeyPatchRemoteSettingsClient({ data = [] }) {
last_modified = new Date().getTime(),
data = [],
}) {
lazy.RemoteSettingsClient.prototype.get = async (options = {}) => { lazy.RemoteSettingsClient.prototype.get = async (options = {}) => {
outputInfo({ "RemoteSettingsClient.get": { options, response: { data } } }); outputInfo({ "RemoteSettingsClient.get": { options, response: { data } } });
return data; return data;

View file

@ -172,7 +172,7 @@ export class BackgroundTasksManager {
const waitFlag = const waitFlag =
commandLine.findFlag("wait-for-jsdebugger", CASE_INSENSITIVE) != -1; commandLine.findFlag("wait-for-jsdebugger", CASE_INSENSITIVE) != -1;
if (waitFlag) { if (waitFlag) {
function onDevtoolsThreadReady(subject, topic, data) { function onDevtoolsThreadReady(subject, topic) {
lazy.log.info( lazy.log.info(
`${Services.appinfo.processID}: Setting breakpoints for background task named '${name}'` + `${Services.appinfo.processID}: Setting breakpoints for background task named '${name}'` +
` (with ${commandLine.length} arguments)` ` (with ${commandLine.length} arguments)`

View file

@ -193,7 +193,7 @@ export var BackgroundTasksUtils = {
lazy.log.info(`readPreferences: profile is locked`); lazy.log.info(`readPreferences: profile is locked`);
let prefs = {}; let prefs = {};
let addPref = (kind, name, value, sticky, locked) => { let addPref = (kind, name, value) => {
if (predicate && !predicate(name)) { if (predicate && !predicate(name)) {
return; return;
} }

View file

@ -11,7 +11,7 @@
* code to exit code 0. * code to exit code 0.
*/ */
export function runBackgroundTask(commandLine) { export function runBackgroundTask() {
// In the future, will be modifed by the JS debugger (to 0, success). // In the future, will be modifed by the JS debugger (to 0, success).
var exposedExitCode = 0; var exposedExitCode = 0;

View file

@ -3,7 +3,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
export async function runBackgroundTask(commandLine) { export async function runBackgroundTask() {
const get = Services.env.get("MOZ_TEST_PROCESS_UPDATES"); const get = Services.env.get("MOZ_TEST_PROCESS_UPDATES");
let exitCode = 81; let exitCode = 81;
if (get == "ShouldNotProcessUpdates(): OtherInstanceRunning") { if (get == "ShouldNotProcessUpdates(): OtherInstanceRunning") {

View file

@ -20,7 +20,7 @@ const EXCLUDED_NAMES = [
* Return 0 (success) if all targeting getters succeed, 11 (failure) * Return 0 (success) if all targeting getters succeed, 11 (failure)
* otherwise. * otherwise.
*/ */
export async function runBackgroundTask(commandLine) { export async function runBackgroundTask() {
let exitCode = EXIT_CODE.SUCCESS; let exitCode = EXIT_CODE.SUCCESS;
// Can't use `ASRouterTargeting.getEnvironmentSnapshot`, since that // Can't use `ASRouterTargeting.getEnvironmentSnapshot`, since that

View file

@ -56,7 +56,7 @@ function URLFetcher(url, timeout) {
xhr.onerror = function () { xhr.onerror = function () {
self.onerror(); self.onerror();
}; };
xhr.onreadystatechange = function (oEvent) { xhr.onreadystatechange = function () {
if (xhr.readyState === 4) { if (xhr.readyState === 4) {
if (self._isAborted) { if (self._isAborted) {
return; return;
@ -181,10 +181,7 @@ function LoginObserver(captivePortalDetector) {
observeActivity: function observeActivity( observeActivity: function observeActivity(
aHttpChannel, aHttpChannel,
aActivityType, aActivityType,
aActivitySubtype, aActivitySubtype
aTimestamp,
aExtraSizeData,
aExtraStringData
) { ) {
if ( if (
aActivityType === aActivityType ===
@ -541,5 +538,5 @@ if (DEBUG) {
}; };
} else { } else {
// eslint-disable-next-line no-global-assign // eslint-disable-next-line no-global-assign
debug = function (s) {}; debug = function () {};
} }

View file

@ -21,7 +21,7 @@ function xhr_handler(metadata, response) {
} }
function fakeUIResponse() { function fakeUIResponse() {
Services.obs.addObserver(function observe(subject, topic, data) { Services.obs.addObserver(function observe(subject, topic) {
if (topic === "captive-portal-login") { if (topic === "captive-portal-login") {
do_throw("should not receive captive-portal-login event"); do_throw("should not receive captive-portal-login event");
} }
@ -37,7 +37,7 @@ function test_abort() {
Assert.equal(++step, 1); Assert.equal(++step, 1);
gCaptivePortalDetector.finishPreparation(kInterfaceName); gCaptivePortalDetector.finishPreparation(kInterfaceName);
}, },
complete: function complete(success) { complete: function complete() {
do_throw("should not execute |complete| callback"); do_throw("should not execute |complete| callback");
}, },
}; };

View file

@ -51,7 +51,7 @@ function test_abort() {
Assert.equal(++step, 1); Assert.equal(++step, 1);
gCaptivePortalDetector.finishPreparation(kInterfaceName); gCaptivePortalDetector.finishPreparation(kInterfaceName);
}, },
complete: function complete(success) { complete: function complete() {
do_throw("should not execute |complete| callback"); do_throw("should not execute |complete| callback");
}, },
}; };

View file

@ -22,7 +22,7 @@ function xhr_handler(metadata, response) {
} }
function fakeUIResponse() { function fakeUIResponse() {
Services.obs.addObserver(function observe(subject, topic, data) { Services.obs.addObserver(function observe(subject, topic) {
if (topic === "captive-portal-login") { if (topic === "captive-portal-login") {
let xhr = new XMLHttpRequest(); let xhr = new XMLHttpRequest();
xhr.open("GET", gServerURL + kCanonicalSitePath, true); xhr.open("GET", gServerURL + kCanonicalSitePath, true);
@ -42,7 +42,7 @@ function test_multiple_requests_abort() {
Assert.equal(++step, 1); Assert.equal(++step, 1);
gCaptivePortalDetector.finishPreparation(kInterfaceName); gCaptivePortalDetector.finishPreparation(kInterfaceName);
}, },
complete: function complete(success) { complete: function complete() {
do_throw("should not execute |complete| callback for " + kInterfaceName); do_throw("should not execute |complete| callback for " + kInterfaceName);
}, },
}; };

View file

@ -22,7 +22,7 @@ function xhr_handler(metadata, response) {
} }
function fakeUIResponse() { function fakeUIResponse() {
Services.obs.addObserver(function observe(subject, topic, data) { Services.obs.addObserver(function observe(subject, topic) {
if (topic === "captive-portal-login") { if (topic === "captive-portal-login") {
let xhr = new XMLHttpRequest(); let xhr = new XMLHttpRequest();
xhr.open("GET", gServerURL + kCanonicalSitePath, true); xhr.open("GET", gServerURL + kCanonicalSitePath, true);
@ -56,7 +56,7 @@ function test_abort() {
"should not execute |prepare| callback for " + kOtherInterfaceName "should not execute |prepare| callback for " + kOtherInterfaceName
); );
}, },
complete: function complete(success) { complete: function complete() {
do_throw("should not execute |complete| callback for " + kInterfaceName); do_throw("should not execute |complete| callback for " + kInterfaceName);
}, },
}; };

View file

@ -21,7 +21,7 @@ function xhr_handler(metadata, response) {
} }
function fakeUIResponse() { function fakeUIResponse() {
Services.obs.addObserver(function observe(subject, topic, data) { Services.obs.addObserver(function observe(subject, topic) {
if (topic === "captive-portal-login") { if (topic === "captive-portal-login") {
let xhr = new XMLHttpRequest(); let xhr = new XMLHttpRequest();
xhr.open("GET", gServerURL + kCanonicalSitePath, true); xhr.open("GET", gServerURL + kCanonicalSitePath, true);
@ -31,7 +31,7 @@ function fakeUIResponse() {
} }
}, "captive-portal-login"); }, "captive-portal-login");
Services.obs.addObserver(function observe(subject, topic, data) { Services.obs.addObserver(function observe(subject, topic) {
if (topic === "captive-portal-login-success") { if (topic === "captive-portal-login-success") {
Assert.equal(++step, 4); Assert.equal(++step, 4);
gServer.stop(do_test_finished); gServer.stop(do_test_finished);

View file

@ -26,7 +26,7 @@ function xhr_handler(metadata, response) {
} }
function fakeUIResponse() { function fakeUIResponse() {
Services.obs.addObserver(function observe(subject, topic, data) { Services.obs.addObserver(function observe(subject, topic) {
if (topic === "captive-portal-login") { if (topic === "captive-portal-login") {
let xhr = new XMLHttpRequest(); let xhr = new XMLHttpRequest();
xhr.open("GET", gServerURL + kCanonicalSitePath, true); xhr.open("GET", gServerURL + kCanonicalSitePath, true);
@ -36,7 +36,7 @@ function fakeUIResponse() {
} }
}, "captive-portal-login"); }, "captive-portal-login");
Services.obs.addObserver(function observe(subject, topic, data) { Services.obs.addObserver(function observe(subject, topic) {
if (topic === "captive-portal-login-success") { if (topic === "captive-portal-login-success") {
Assert.equal(++step, 4); Assert.equal(++step, 4);
gServer.stop(function () { gServer.stop(function () {

View file

@ -19,7 +19,7 @@ function xhr_handler(metadata, response) {
} }
function fakeUIResponse() { function fakeUIResponse() {
Services.obs.addObserver(function observe(subject, topic, data) { Services.obs.addObserver(function observe(subject, topic) {
if (topic == "captive-portal-login") { if (topic == "captive-portal-login") {
do_throw("should not receive captive-portal-login event"); do_throw("should not receive captive-portal-login event");
} }

View file

@ -15,7 +15,7 @@ function xhr_handler(metadata, response) {
} }
function fakeUIResponse() { function fakeUIResponse() {
Services.obs.addObserver(function observe(subject, topic, data) { Services.obs.addObserver(function observe(subject, topic) {
if (topic === "captive-portal-login") { if (topic === "captive-portal-login") {
do_throw("should not receive captive-portal-login event"); do_throw("should not receive captive-portal-login event");
} }

View file

@ -23,7 +23,7 @@ function xhr_handler(metadata, response) {
} }
function fakeUIResponse() { function fakeUIResponse() {
Services.obs.addObserver(function observe(subject, topic, data) { Services.obs.addObserver(function observe(subject, topic) {
if (topic === "captive-portal-login") { if (topic === "captive-portal-login") {
let xhr = new XMLHttpRequest(); let xhr = new XMLHttpRequest();
xhr.open("GET", gServerURL + kCanonicalSitePath, true); xhr.open("GET", gServerURL + kCanonicalSitePath, true);
@ -33,7 +33,7 @@ function fakeUIResponse() {
} }
}, "captive-portal-login"); }, "captive-portal-login");
Services.obs.addObserver(function observe(subject, topic, data) { Services.obs.addObserver(function observe(subject, topic) {
if (topic === "captive-portal-login-success") { if (topic === "captive-portal-login-success") {
loginSuccessCount++; loginSuccessCount++;
if (loginSuccessCount > 1) { if (loginSuccessCount > 1) {

View file

@ -10,7 +10,7 @@ import {
pemToDER, pemToDER,
} from "chrome://global/content/certviewer/certDecoder.mjs"; } from "chrome://global/content/certviewer/certDecoder.mjs";
document.addEventListener("DOMContentLoaded", async e => { document.addEventListener("DOMContentLoaded", async () => {
let url = new URL(document.URL); let url = new URL(document.URL);
let certInfo = url.searchParams.getAll("cert"); let certInfo = url.searchParams.getAll("cert");
if (certInfo.length === 0) { if (certInfo.length === 0) {
@ -469,7 +469,7 @@ const buildChain = async chain => {
let adjustedCerts = certs.map(cert => adjustCertInformation(cert)); let adjustedCerts = certs.map(cert => adjustCertInformation(cert));
return render(adjustedCerts, false); return render(adjustedCerts, false);
}) })
.catch(err => { .catch(() => {
render(null, true); render(null, true);
}); });
}; };

View file

@ -63,7 +63,7 @@ function openCertDownloadDialog(cert) {
cert, cert,
returnVals returnVals
); );
return new Promise((resolve, reject) => { return new Promise(resolve => {
win.addEventListener( win.addEventListener(
"load", "load",
function () { function () {

View file

@ -21,7 +21,7 @@ function is_element_visible(aElement, aMsg) {
// Extracted from https://searchfox.org/mozilla-central/rev/40ef22080910c2e2c27d9e2120642376b1d8b8b2/browser/components/preferences/in-content/tests/head.js#41 // Extracted from https://searchfox.org/mozilla-central/rev/40ef22080910c2e2c27d9e2120642376b1d8b8b2/browser/components/preferences/in-content/tests/head.js#41
function promiseLoadSubDialog(aURL) { function promiseLoadSubDialog(aURL) {
return new Promise((resolve, reject) => { return new Promise(resolve => {
content.gSubDialog._dialogStack.addEventListener( content.gSubDialog._dialogStack.addEventListener(
"dialogopen", "dialogopen",
function dialogopen(aEvent) { function dialogopen(aEvent) {

View file

@ -193,7 +193,7 @@ const CookieCleaner = {
}); });
}, },
deleteByRange(aFrom, aTo) { deleteByRange(aFrom) {
return Services.cookies.removeAllSince(aFrom); return Services.cookies.removeAllSince(aFrom);
}, },
@ -584,7 +584,7 @@ const DownloadsCleaner = {
}; };
const PasswordsCleaner = { const PasswordsCleaner = {
deleteByHost(aHost, aOriginAttributes) { deleteByHost(aHost) {
// Clearing by host also clears associated subdomains. // Clearing by host also clears associated subdomains.
return this._deleteInternal(aLogin => return this._deleteInternal(aLogin =>
Services.eTLD.hasRootDomain(aLogin.hostname, aHost) Services.eTLD.hasRootDomain(aLogin.hostname, aHost)
@ -630,7 +630,7 @@ const PasswordsCleaner = {
}; };
const MediaDevicesCleaner = { const MediaDevicesCleaner = {
async deleteByRange(aFrom, aTo) { async deleteByRange(aFrom) {
let mediaMgr = Cc["@mozilla.org/mediaManagerService;1"].getService( let mediaMgr = Cc["@mozilla.org/mediaManagerService;1"].getService(
Ci.nsIMediaManagerService Ci.nsIMediaManagerService
); );
@ -799,7 +799,7 @@ const QuotaCleaner = {
} }
}, },
async deleteByHost(aHost, aOriginAttributes) { async deleteByHost(aHost) {
// XXX: The aOriginAttributes is expected to always be empty({}). Maybe have // XXX: The aOriginAttributes is expected to always be empty({}). Maybe have
// a debug assertion here to ensure that? // a debug assertion here to ensure that?
@ -872,7 +872,7 @@ const QuotaCleaner = {
_ => /* exceptionThrown = */ false, _ => /* exceptionThrown = */ false,
_ => /* exceptionThrown = */ true _ => /* exceptionThrown = */ true
) )
.then(exceptionThrown => { .then(() => {
// QuotaManager: In the event of a failure, we call reject to propagate // QuotaManager: In the event of a failure, we call reject to propagate
// the error upwards. // the error upwards.
return new Promise((aResolve, aReject) => { return new Promise((aResolve, aReject) => {
@ -1002,7 +1002,7 @@ const PushNotificationsCleaner = {
}); });
}, },
deleteByHost(aHost, aOriginAttributes) { deleteByHost(aHost) {
// Will also clear entries for subdomains of aHost. Data is cleared across // Will also clear entries for subdomains of aHost. Data is cleared across
// all origin attributes. // all origin attributes.
return this._deleteByRootDomain(aHost); return this._deleteByRootDomain(aHost);
@ -1078,7 +1078,7 @@ const StorageAccessCleaner = {
}); });
}, },
async deleteByHost(aHost, aOriginAttributes) { async deleteByHost(aHost) {
// Clearing by host also clears associated subdomains. // Clearing by host also clears associated subdomains.
this._deleteInternal(({ principal }) => { this._deleteInternal(({ principal }) => {
let toBeRemoved = false; let toBeRemoved = false;
@ -1095,7 +1095,7 @@ const StorageAccessCleaner = {
); );
}, },
async deleteByRange(aFrom, aTo) { async deleteByRange(aFrom) {
Services.perms.removeByTypeSince("storageAccessAPI", aFrom / 1000); Services.perms.removeByTypeSince("storageAccessAPI", aFrom / 1000);
}, },
@ -1105,7 +1105,7 @@ const StorageAccessCleaner = {
}; };
const HistoryCleaner = { const HistoryCleaner = {
deleteByHost(aHost, aOriginAttributes) { deleteByHost(aHost) {
if (!AppConstants.MOZ_PLACES) { if (!AppConstants.MOZ_PLACES) {
return Promise.resolve(); return Promise.resolve();
} }
@ -1142,7 +1142,7 @@ const HistoryCleaner = {
}; };
const SessionHistoryCleaner = { const SessionHistoryCleaner = {
async deleteByHost(aHost, aOriginAttributes) { async deleteByHost(aHost) {
// Session storage and history also clear subdomains of aHost. // Session storage and history also clear subdomains of aHost.
Services.obs.notifyObservers(null, "browser:purge-sessionStorage", aHost); Services.obs.notifyObservers(null, "browser:purge-sessionStorage", aHost);
Services.obs.notifyObservers( Services.obs.notifyObservers(
@ -1160,7 +1160,7 @@ const SessionHistoryCleaner = {
return this.deleteByHost(aBaseDomain, {}); return this.deleteByHost(aBaseDomain, {});
}, },
async deleteByRange(aFrom, aTo) { async deleteByRange(aFrom) {
Services.obs.notifyObservers( Services.obs.notifyObservers(
null, null,
"browser:purge-session-history", "browser:purge-session-history",
@ -1275,7 +1275,7 @@ const PermissionsCleaner = {
} }
}, },
deleteByHost(aHost, aOriginAttributes) { deleteByHost(aHost) {
return this._deleteInternal({ host: aHost }); return this._deleteInternal({ host: aHost });
}, },
@ -1287,7 +1287,7 @@ const PermissionsCleaner = {
return this._deleteInternal({ baseDomain: aBaseDomain }); return this._deleteInternal({ baseDomain: aBaseDomain });
}, },
async deleteByRange(aFrom, aTo) { async deleteByRange(aFrom) {
Services.perms.removeAllSince(aFrom / 1000); Services.perms.removeAllSince(aFrom / 1000);
}, },
@ -1301,7 +1301,7 @@ const PermissionsCleaner = {
}; };
const PreferencesCleaner = { const PreferencesCleaner = {
deleteByHost(aHost, aOriginAttributes) { deleteByHost(aHost) {
// Also clears subdomains of aHost. // Also clears subdomains of aHost.
return new Promise((aResolve, aReject) => { return new Promise((aResolve, aReject) => {
let cps2 = Cc["@mozilla.org/content-pref/service;1"].getService( let cps2 = Cc["@mozilla.org/content-pref/service;1"].getService(
@ -1328,7 +1328,7 @@ const PreferencesCleaner = {
return this.deleteByHost(aBaseDomain, {}); return this.deleteByHost(aBaseDomain, {});
}, },
async deleteByRange(aFrom, aTo) { async deleteByRange(aFrom) {
let cps2 = Cc["@mozilla.org/content-pref/service;1"].getService( let cps2 = Cc["@mozilla.org/content-pref/service;1"].getService(
Ci.nsIContentPrefService2 Ci.nsIContentPrefService2
); );
@ -1477,7 +1477,7 @@ const EMECleaner = {
}; };
const ReportsCleaner = { const ReportsCleaner = {
deleteByHost(aHost, aOriginAttributes) { deleteByHost(aHost) {
// Also clears subdomains of aHost. // Also clears subdomains of aHost.
return new Promise(aResolve => { return new Promise(aResolve => {
Services.obs.notifyObservers(null, "reporting:purge-host", aHost); Services.obs.notifyObservers(null, "reporting:purge-host", aHost);
@ -1520,7 +1520,7 @@ const ContentBlockingCleaner = {
await this.deleteAll(); await this.deleteAll();
}, },
deleteByRange(aFrom, aTo) { deleteByRange(aFrom) {
return lazy.TrackingDBService.clearSince(aFrom); return lazy.TrackingDBService.clearSince(aFrom);
}, },
}; };
@ -1616,7 +1616,7 @@ const IdentityCredentialStorageCleaner = {
} }
}, },
async deleteByPrincipal(aPrincipal, aIsUserRequest) { async deleteByPrincipal(aPrincipal) {
if ( if (
Services.prefs.getBoolPref( Services.prefs.getBoolPref(
"dom.security.credentialmanagement.identity.enabled", "dom.security.credentialmanagement.identity.enabled",
@ -1698,7 +1698,7 @@ const BounceTrackingProtectionStateCleaner = {
await lazy.bounceTrackingProtection.clearAll(); await lazy.bounceTrackingProtection.clearAll();
}, },
async deleteByPrincipal(aPrincipal, aIsUserRequest) { async deleteByPrincipal(aPrincipal) {
if (!lazy.isBounceTrackingProtectionEnabled) { if (!lazy.isBounceTrackingProtectionEnabled) {
return; return;
} }
@ -1709,7 +1709,7 @@ const BounceTrackingProtectionStateCleaner = {
); );
}, },
async deleteByBaseDomain(aBaseDomain, aIsUserRequest) { async deleteByBaseDomain(aBaseDomain) {
if (!lazy.isBounceTrackingProtectionEnabled) { if (!lazy.isBounceTrackingProtectionEnabled) {
return; return;
} }
@ -1723,7 +1723,7 @@ const BounceTrackingProtectionStateCleaner = {
await lazy.bounceTrackingProtection.clearByTimeRange(aFrom, aTo); await lazy.bounceTrackingProtection.clearByTimeRange(aFrom, aTo);
}, },
async deleteByHost(aHost, aOriginAttributes) { async deleteByHost(aHost) {
if (!lazy.isBounceTrackingProtectionEnabled) { if (!lazy.isBounceTrackingProtectionEnabled) {
return; return;
} }

View file

@ -244,10 +244,10 @@ export var SiteDataTestUtils = {
return new Promise(resolve => { return new Promise(resolve => {
let data = true; let data = true;
let request = indexedDB.openForPrincipal(principal, "TestDatabase", 1); let request = indexedDB.openForPrincipal(principal, "TestDatabase", 1);
request.onupgradeneeded = function (e) { request.onupgradeneeded = function () {
data = false; data = false;
}; };
request.onsuccess = function (e) { request.onsuccess = function () {
resolve(data); resolve(data);
}; };
}); });
@ -276,11 +276,11 @@ export var SiteDataTestUtils = {
CacheListener.prototype = { CacheListener.prototype = {
QueryInterface: ChromeUtils.generateQI(["nsICacheEntryOpenCallback"]), QueryInterface: ChromeUtils.generateQI(["nsICacheEntryOpenCallback"]),
onCacheEntryCheck(entry) { onCacheEntryCheck() {
return Ci.nsICacheEntryOpenCallback.ENTRY_WANTED; return Ci.nsICacheEntryOpenCallback.ENTRY_WANTED;
}, },
onCacheEntryAvailable(entry, isnew, status) { onCacheEntryAvailable() {
resolve(); resolve();
}, },
}; };

View file

@ -88,7 +88,7 @@ add_task(async function test_principal_permissions() {
await new Promise(aResolve => { await new Promise(aResolve => {
Services.clearData.deleteData( Services.clearData.deleteData(
Ci.nsIClearDataService.CLEAR_PERMISSIONS, Ci.nsIClearDataService.CLEAR_PERMISSIONS,
value => aResolve() () => aResolve()
); );
}); });
}); });
@ -465,7 +465,7 @@ add_task(async function test_3rdpartystorage_permissions() {
await new Promise(aResolve => { await new Promise(aResolve => {
Services.clearData.deleteData( Services.clearData.deleteData(
Ci.nsIClearDataService.CLEAR_PERMISSIONS, Ci.nsIClearDataService.CLEAR_PERMISSIONS,
value => aResolve() () => aResolve()
); );
}); });
}); });

View file

@ -62,7 +62,7 @@ add_task(async function test_removing_storage_permission() {
await new Promise(aResolve => { await new Promise(aResolve => {
Services.clearData.deleteData( Services.clearData.deleteData(
Ci.nsIClearDataService.CLEAR_PERMISSIONS, Ci.nsIClearDataService.CLEAR_PERMISSIONS,
value => aResolve() () => aResolve()
); );
}); });
}); });
@ -138,7 +138,7 @@ add_task(async function test_removing_storage_permission_from_principal() {
await new Promise(aResolve => { await new Promise(aResolve => {
Services.clearData.deleteData( Services.clearData.deleteData(
Ci.nsIClearDataService.CLEAR_PERMISSIONS, Ci.nsIClearDataService.CLEAR_PERMISSIONS,
value => aResolve() () => aResolve()
); );
}); });
}); });
@ -240,7 +240,7 @@ add_task(async function test_removing_storage_permission_from_base_domainl() {
await new Promise(aResolve => { await new Promise(aResolve => {
Services.clearData.deleteData( Services.clearData.deleteData(
Ci.nsIClearDataService.CLEAR_PERMISSIONS, Ci.nsIClearDataService.CLEAR_PERMISSIONS,
value => aResolve() () => aResolve()
); );
}); });
}); });
@ -392,7 +392,7 @@ add_task(async function test_deleteUserInteractionForClearingHistory() {
await new Promise(aResolve => { await new Promise(aResolve => {
Services.clearData.deleteData( Services.clearData.deleteData(
Ci.nsIClearDataService.CLEAR_PERMISSIONS, Ci.nsIClearDataService.CLEAR_PERMISSIONS,
value => aResolve() () => aResolve()
); );
}); });
}); });

View file

@ -39,7 +39,7 @@ export function ContentPrefService2() {
} }
const cache = new ContentPrefStore(); const cache = new ContentPrefStore();
cache.set = function CPS_cache_set(group, name, val) { cache.set = function CPS_cache_set() {
Object.getPrototypeOf(this).set.apply(this, arguments); Object.getPrototypeOf(this).set.apply(this, arguments);
let groupCount = this._groups.size; let groupCount = this._groups.size;
if (groupCount >= CACHE_MAX_GROUP_ENTRIES) { if (groupCount >= CACHE_MAX_GROUP_ENTRIES) {
@ -211,7 +211,7 @@ ContentPrefService2.prototype = {
cbHandleResult(callback, new ContentPref(grp, name, val)); cbHandleResult(callback, new ContentPref(grp, name, val));
} }
}, },
onDone: (reason, ok, gotRow) => { onDone: (reason, ok) => {
if (ok) { if (ok) {
for (let [pbGroup, pbName, pbVal] of pbPrefs) { for (let [pbGroup, pbName, pbVal] of pbPrefs) {
cbHandleResult(callback, new ContentPref(pbGroup, pbName, pbVal)); cbHandleResult(callback, new ContentPref(pbGroup, pbName, pbVal));
@ -1088,9 +1088,8 @@ ContentPrefService2.prototype = {
* *
* @param subj This value depends on topic. * @param subj This value depends on topic.
* @param topic The backchannel "method" name. * @param topic The backchannel "method" name.
* @param data This value depends on topic.
*/ */
observe: function CPS2_observe(subj, topic, data) { observe: function CPS2_observe(subj, topic) {
switch (topic) { switch (topic) {
case "profile-before-change": case "profile-before-change":
this._destroy(); this._destroy();

View file

@ -92,7 +92,7 @@ export class ContentPrefsParent extends JSProcessActorParent {
let actor = this; let actor = this;
let args = data.args; let args = data.args;
return new Promise(resolve => { return new Promise(() => {
let listener = { let listener = {
handleResult(pref) { handleResult(pref) {
actor.sendAsyncMessage("ContentPrefs:HandleResult", { actor.sendAsyncMessage("ContentPrefs:HandleResult", {

View file

@ -173,7 +173,7 @@ async function runTestsForFrame(browser, isPrivate) {
onContentPrefSet(group, name, value, isPrivate) { onContentPrefSet(group, name, value, isPrivate) {
resolve({ group, name, value, isPrivate }); resolve({ group, name, value, isPrivate });
}, },
onContentPrefRemoved(group, name, isPrivate) { onContentPrefRemoved() {
reject("got unexpected notification"); reject("got unexpected notification");
}, },
}; };
@ -202,7 +202,7 @@ async function runTestsForFrame(browser, isPrivate) {
info("received handleResult"); info("received handleResult");
results.push(pref); results.push(pref);
}, },
handleCompletion(reason) { handleCompletion() {
resolve(); resolve();
}, },
handleError(rv) { handleError(rv) {

View file

@ -82,7 +82,7 @@ function setWithDate(group, name, val, timestamp, context) {
}); });
} }
async function getDate(group, name, context) { async function getDate(group, name) {
let conn = await sendMessage("db"); let conn = await sendMessage("db");
let [result] = await conn.execute( let [result] = await conn.execute(
` `
@ -158,7 +158,7 @@ async function getGlobalOK(args, expectedVal) {
await getOKEx("getGlobal", args, expectedPrefs); await getOKEx("getGlobal", args, expectedPrefs);
} }
async function getOKEx(methodName, args, expectedPrefs, strict, context) { async function getOKEx(methodName, args, expectedPrefs, strict) {
let actualPrefs = []; let actualPrefs = [];
await new Promise(resolve => { await new Promise(resolve => {
args.push( args.push(

View file

@ -25,7 +25,7 @@ BEGIN TRANSACTION;
CREATE INDEX prefs_idx ON prefs(groupID, settingID); CREATE INDEX prefs_idx ON prefs(groupID, settingID);
COMMIT;`; COMMIT;`;
function prepareVersion3Schema(callback) { function prepareVersion3Schema() {
var dbFile = Services.dirsvc.get("ProfD", Ci.nsIFile); var dbFile = Services.dirsvc.get("ProfD", Ci.nsIFile);
dbFile.append("content-prefs.sqlite"); dbFile.append("content-prefs.sqlite");

View file

@ -41,7 +41,7 @@ _TabRemovalObserver.prototype = {
QueryInterface: ChromeUtils.generateQI(["nsIObserver"]), QueryInterface: ChromeUtils.generateQI(["nsIObserver"]),
observe(subject, topic, data) { observe(subject) {
let remoteTab = subject.QueryInterface(Ci.nsIRemoteTab); let remoteTab = subject.QueryInterface(Ci.nsIRemoteTab);
if (this._remoteTabIds.has(remoteTab.tabId)) { if (this._remoteTabIds.has(remoteTab.tabId)) {
this._remoteTabIds.delete(remoteTab.tabId); this._remoteTabIds.delete(remoteTab.tabId);

View file

@ -66,7 +66,7 @@ function runMinidumpAnalyzer(minidumpPath, allThreads) {
args.unshift("--full"); args.unshift("--full");
} }
process.runAsync(args, args.length, (subject, topic, data) => { process.runAsync(args, args.length, (subject, topic) => {
switch (topic) { switch (topic) {
case "process-finished": case "process-finished":
gRunningProcesses.delete(process); gRunningProcesses.delete(process);
@ -211,7 +211,7 @@ CrashService.prototype = Object.freeze({
await blocker; await blocker;
}, },
observe(subject, topic, data) { observe(subject, topic) {
switch (topic) { switch (topic) {
case "profile-after-change": case "profile-after-change":
// Side-effect is the singleton is instantiated. // Side-effect is the singleton is instantiated.

View file

@ -824,7 +824,7 @@ add_task(async function test_glean_crash_ping() {
// Test with additional fields // Test with additional fields
submitted = false; submitted = false;
GleanPings.crash.testBeforeNextSubmit(reason => { GleanPings.crash.testBeforeNextSubmit(() => {
submitted = true; submitted = true;
const MINUTES = new Date(DUMMY_DATE_2); const MINUTES = new Date(DUMMY_DATE_2);
MINUTES.setSeconds(0); MINUTES.setSeconds(0);

View file

@ -170,7 +170,7 @@ add_task(async function test_addCrash_quitting() {
await setup(firstCrashId); await setup(firstCrashId);
let minidumpAnalyzerKilledPromise = new Promise((resolve, reject) => { let minidumpAnalyzerKilledPromise = new Promise((resolve, reject) => {
Services.obs.addObserver((subject, topic, data) => { Services.obs.addObserver((subject, topic) => {
if (topic === "test-minidump-analyzer-killed") { if (topic === "test-minidump-analyzer-killed") {
resolve(); resolve();
} }

View file

@ -257,7 +257,7 @@ add_task(async function test_add_mixed_types() {
allAdd && allAdd &&
s.addCrash(ptName, CRASH_TYPE_CRASH, ptName + "crash", new Date()); s.addCrash(ptName, CRASH_TYPE_CRASH, ptName + "crash", new Date());
}, },
(_, ptName) => { _ => {
allAdd = allAdd =
allAdd && allAdd &&
s.addCrash( s.addCrash(

View file

@ -189,7 +189,7 @@ export var CrashMonitor = {
* *
* Update checkpoint file for every new notification received. * Update checkpoint file for every new notification received.
*/ */
observe(aSubject, aTopic, aData) { observe(aSubject, aTopic) {
this.writeCheckpoint(aTopic); this.writeCheckpoint(aTopic);
if ( if (

View file

@ -14,7 +14,7 @@ CrashMonitor.prototype = {
QueryInterface: ChromeUtils.generateQI(["nsIObserver"]), QueryInterface: ChromeUtils.generateQI(["nsIObserver"]),
observe(aSubject, aTopic, aData) { observe(aSubject, aTopic) {
switch (aTopic) { switch (aTopic) {
case "profile-after-change": case "profile-after-change":
MonitorAPI.init(); MonitorAPI.init();

View file

@ -83,7 +83,7 @@ FileFaker.prototype = {
}, },
}; };
function do_get_file(path, allowNonexistent) { function do_get_file(path) {
if (!_WORKINGDIR_) { if (!_WORKINGDIR_) {
do_throw("No way to fake files if working directory is unknown!"); do_throw("No way to fake files if working directory is unknown!");
} }

View file

@ -3470,7 +3470,7 @@ function run_string_tests(library) {
Assert.equal(ptrValue(test_ansi_echo(null)), 0); Assert.equal(ptrValue(test_ansi_echo(null)), 0);
} }
function run_readstring_tests(library) { function run_readstring_tests() {
// ASCII decode test, "hello world" // ASCII decode test, "hello world"
let ascii_string = ctypes.unsigned_char.array(12)(); let ascii_string = ctypes.unsigned_char.array(12)();
ascii_string[0] = 0x68; ascii_string[0] = 0x68;

View file

@ -296,7 +296,7 @@ EnterprisePoliciesManager.prototype = {
}, },
// nsIObserver implementation // nsIObserver implementation
observe: function BG_observe(subject, topic, data) { observe: function BG_observe(subject, topic) {
switch (topic) { switch (topic) {
case "policies-startup": case "policies-startup":
// Before the first set of policy callbacks runs, we must // Before the first set of policy callbacks runs, we must

View file

@ -14,13 +14,13 @@ add_task(async function test_enterprise_only_policies() {
enterprisePolicyRan = false; enterprisePolicyRan = false;
Policies.NormalPolicy = { Policies.NormalPolicy = {
onProfileAfterChange(manager, param) { onProfileAfterChange() {
normalPolicyRan = true; normalPolicyRan = true;
}, },
}; };
Policies.EnterpriseOnlyPolicy = { Policies.EnterpriseOnlyPolicy = {
onProfileAfterChange(manager, param) { onProfileAfterChange() {
enterprisePolicyRan = true; enterprisePolicyRan = true;
}, },
}; };

View file

@ -21,7 +21,7 @@ async function cleanUp() {
await new Promise(resolve => { await new Promise(resolve => {
Services.clearData.deleteData( Services.clearData.deleteData(
Ci.nsIClearDataService.CLEAR_PERMISSIONS, Ci.nsIClearDataService.CLEAR_PERMISSIONS,
value => resolve() () => resolve()
); );
}); });
} }

View file

@ -397,7 +397,7 @@ SanityTest.prototype = {
return true; return true;
}, },
observe(subject, topic, data) { observe(subject, topic) {
if (topic != "profile-after-change") { if (topic != "profile-after-change") {
return; return;
} }

View file

@ -45,7 +45,7 @@ const gfxFrameScript = {
return aUri.endsWith("/sanitytest.html"); return aUri.endsWith("/sanitytest.html");
}, },
onStateChange(webProgress, req, flags, status) { onStateChange(webProgress, req, flags) {
if ( if (
webProgress.isTopLevel && webProgress.isTopLevel &&
flags & Ci.nsIWebProgressListener.STATE_STOP && flags & Ci.nsIWebProgressListener.STATE_STOP &&

View file

@ -139,7 +139,7 @@ function setupFileServer() {
"GET", "GET",
`${SECURE_ROOT_PATH}file_upgrade_insecure_server.sjs?queryresult=${INSECURE_ROOT_PATH}` `${SECURE_ROOT_PATH}file_upgrade_insecure_server.sjs?queryresult=${INSECURE_ROOT_PATH}`
); );
xhrRequest.onload = function (e) { xhrRequest.onload = function () {
var results = xhrRequest.responseText.split(","); var results = xhrRequest.responseText.split(",");
resolve(results); resolve(results);
}; };

View file

@ -71,7 +71,7 @@ var listener = {
); );
}, },
onDataAvailable(request, stream, offset, count) { onDataAvailable(request, stream) {
try { try {
var bis = Cc["@mozilla.org/binaryinputstream;1"].createInstance( var bis = Cc["@mozilla.org/binaryinputstream;1"].createInstance(
Ci.nsIBinaryInputStream Ci.nsIBinaryInputStream
@ -83,7 +83,7 @@ var listener = {
} }
}, },
onStopRequest(request, status) { onStopRequest() {
testRan++; testRan++;
runNext(); runNext();
}, },

View file

@ -61,7 +61,7 @@ var listener = {
); );
}, },
onDataAvailable(request, stream, offset, count) { onDataAvailable(request, stream) {
try { try {
var bis = Cc["@mozilla.org/binaryinputstream;1"].createInstance( var bis = Cc["@mozilla.org/binaryinputstream;1"].createInstance(
Ci.nsIBinaryInputStream Ci.nsIBinaryInputStream
@ -73,7 +73,7 @@ var listener = {
} }
}, },
onStopRequest(request, status) { onStopRequest() {
testRan++; testRan++;
runNext(); runNext();
}, },

View file

@ -291,7 +291,7 @@ export const SpecialMessageActions = {
Ci.nsISupportsWeakReference, Ci.nsISupportsWeakReference,
]), ]),
observe(aSubject, aTopic, aData) { observe() {
let state = lazy.UIState.get(); let state = lazy.UIState.get();
if (state.status === lazy.UIState.STATUS_SIGNED_IN) { if (state.status === lazy.UIState.STATUS_SIGNED_IN) {
// We completed sign-in, so tear down our listener / observer and resolve // We completed sign-in, so tear down our listener / observer and resolve

View file

@ -4,7 +4,7 @@
"use strict"; "use strict";
add_task(async function test_OPEN_PROTECTION_PANEL() { add_task(async function test_OPEN_PROTECTION_PANEL() {
await BrowserTestUtils.withNewTab(EXAMPLE_URL, async browser => { await BrowserTestUtils.withNewTab(EXAMPLE_URL, async () => {
const popupshown = BrowserTestUtils.waitForEvent( const popupshown = BrowserTestUtils.waitForEvent(
window, window,
"popupshown", "popupshown",

View file

@ -4,7 +4,7 @@
"use strict"; "use strict";
add_task(async function test_PIN_CURRENT_TAB() { add_task(async function test_PIN_CURRENT_TAB() {
await BrowserTestUtils.withNewTab("about:blank", async browser => { await BrowserTestUtils.withNewTab("about:blank", async () => {
await SMATestUtils.executeAndValidateAction({ type: "PIN_CURRENT_TAB" }); await SMATestUtils.executeAndValidateAction({ type: "PIN_CURRENT_TAB" });
ok(gBrowser.selectedTab.pinned, "should pin current tab"); ok(gBrowser.selectedTab.pinned, "should pin current tab");

View file

@ -91,7 +91,7 @@ export class MLEngineParent extends JSWindowActorParent {
} }
// eslint-disable-next-line consistent-return // eslint-disable-next-line consistent-return
async receiveMessage({ name, data }) { async receiveMessage({ name }) {
switch (name) { switch (name) {
case "MLEngine:Ready": case "MLEngine:Ready":
if (lazy.EngineProcess.resolveMLEngineParent) { if (lazy.EngineProcess.resolveMLEngineParent) {

View file

@ -242,7 +242,7 @@ export var PdfJs = {
}, },
// nsIObserver // nsIObserver
observe(aSubject, aTopic, aData) { observe() {
this.checkIsDefault(); this.checkIsDefault();
}, },
}; };

View file

@ -79,7 +79,7 @@ export class NetworkManager {
xhr.responseType = "arraybuffer"; xhr.responseType = "arraybuffer";
if (args.onError) { if (args.onError) {
xhr.onerror = function (evt) { xhr.onerror = function () {
args.onError(xhr.status); args.onError(xhr.status);
}; };
} }
@ -109,7 +109,7 @@ export class NetworkManager {
} }
} }
onStateChange(xhrId, evt) { onStateChange(xhrId) {
var pendingRequest = this.pendingRequests[xhrId]; var pendingRequest = this.pendingRequests[xhrId];
if (!pendingRequest) { if (!pendingRequest) {
// Maybe abortRequest was called... // Maybe abortRequest was called...

View file

@ -253,7 +253,7 @@ class ChromeActions {
} }
} }
download(data, sendResponse) { download(data) {
const { originalUrl, options } = data; const { originalUrl, options } = data;
const blobUrl = data.blobUrl || originalUrl; const blobUrl = data.blobUrl || originalUrl;
let { filename } = data; let { filename } = data;
@ -318,7 +318,7 @@ class ChromeActions {
actor.sendAsyncMessage("PDFJS:Parent:getNimbus"); actor.sendAsyncMessage("PDFJS:Parent:getNimbus");
Services.obs.addObserver( Services.obs.addObserver(
{ {
observe(aSubject, aTopic, aData) { observe(aSubject, aTopic) {
if (aTopic === "pdfjs-getNimbus") { if (aTopic === "pdfjs-getNimbus") {
Services.obs.removeObserver(this, aTopic); Services.obs.removeObserver(this, aTopic);
sendResponse(aSubject && JSON.stringify(aSubject.wrappedJSObject)); sendResponse(aSubject && JSON.stringify(aSubject.wrappedJSObject));
@ -747,7 +747,7 @@ PdfStreamConverter.prototype = {
*/ */
// nsIStreamConverter::convert // nsIStreamConverter::convert
convert(aFromStream, aFromType, aToType, aCtxt) { convert() {
throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED); throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED);
}, },
@ -1020,7 +1020,7 @@ PdfStreamConverter.prototype = {
// request(aRequest) below so we don't overwrite the original channel and // request(aRequest) below so we don't overwrite the original channel and
// trigger an assertion. // trigger an assertion.
var proxy = { var proxy = {
onStartRequest(request) { onStartRequest() {
listener.onStartRequest(aRequest); listener.onStartRequest(aRequest);
}, },
onDataAvailable(request, inputStream, offset, count) { onDataAvailable(request, inputStream, offset, count) {

View file

@ -187,7 +187,7 @@ export class PdfjsParent extends JSWindowActorParent {
let newBrowser = aEvent.detail; let newBrowser = aEvent.detail;
newBrowser.addEventListener( newBrowser.addEventListener(
"EndSwapDocShells", "EndSwapDocShells",
evt => { () => {
this._hookupEventListeners(newBrowser); this._hookupEventListeners(newBrowser);
}, },
{ once: true } { once: true }

View file

@ -13,7 +13,7 @@ const OS_PDF_URL = TESTROOT + "file_pdfjs_object_stream.pdf";
const TEST_PDF_URL = TESTROOT + "file_pdfjs_test.pdf"; const TEST_PDF_URL = TESTROOT + "file_pdfjs_test.pdf";
add_task(async function test_find_octet_stream_pdf() { add_task(async function test_find_octet_stream_pdf() {
await BrowserTestUtils.withNewTab(OS_PDF_URL, async browser => { await BrowserTestUtils.withNewTab(OS_PDF_URL, async () => {
let findEls = ["cmd_find", "cmd_findAgain", "cmd_findPrevious"].map(id => let findEls = ["cmd_find", "cmd_findAgain", "cmd_findPrevious"].map(id =>
document.getElementById(id) document.getElementById(id)
); );

View file

@ -13,7 +13,7 @@ add_task(async function test_file_opening() {
// the default - because files from disk should always use pdfjs, unless // the default - because files from disk should always use pdfjs, unless
// it is forcibly disabled. // it is forcibly disabled.
let openedWindow = false; let openedWindow = false;
let windowOpenedPromise = new Promise((resolve, reject) => { let windowOpenedPromise = new Promise(resolve => {
addWindowListener( addWindowListener(
"chrome://mozapps/content/downloads/unknownContentType.xhtml", "chrome://mozapps/content/downloads/unknownContentType.xhtml",
() => { () => {
@ -82,7 +82,7 @@ function addWindowListener(aURL, aCallback) {
aCallback(); aCallback();
}, domwindow); }, domwindow);
}, },
onCloseWindow(aXULWindow) {}, onCloseWindow() {},
}; };
Services.wm.addListener(listener); Services.wm.addListener(listener);
listenerCleanup = () => Services.wm.removeListener(listener); listenerCleanup = () => Services.wm.removeListener(listener);

View file

@ -8,7 +8,7 @@ function waitForFullScreenState(browser, state) {
return new Promise(resolve => { return new Promise(resolve => {
let eventReceived = false; let eventReceived = false;
let observe = (subject, topic, data) => { let observe = () => {
if (!eventReceived) { if (!eventReceived) {
return; return;
} }

View file

@ -229,7 +229,7 @@ async function contentSetUp() {
return new Promise(resolve => { return new Promise(resolve => {
document.addEventListener( document.addEventListener(
"pagerendered", "pagerendered",
function (e) { function () {
document.querySelector("#viewer").click(); document.querySelector("#viewer").click();
resolve(); resolve();
}, },

View file

@ -88,7 +88,7 @@ add_task(async function test_octet_stream_in_frame() {
await BrowserTestUtils.withNewTab( await BrowserTestUtils.withNewTab(
{ gBrowser, url: `data:text/html,<iframe src='${PDF_URL}'>` }, { gBrowser, url: `data:text/html,<iframe src='${PDF_URL}'>` },
async function (newTabBrowser) { async function () {
// wait until downloadsPanel opens before continuing with test // wait until downloadsPanel opens before continuing with test
info("Waiting for download panel to open"); info("Waiting for download panel to open");
await downloadsPanelPromise; await downloadsPanelPromise;

View file

@ -48,6 +48,6 @@ function addWindowListener(aURL, aCallback) {
aCallback(); aCallback();
}, domwindow); }, domwindow);
}, },
onCloseWindow(aXULWindow) {}, onCloseWindow() {},
}); });
} }

View file

@ -46,7 +46,7 @@ var logger = (function () {
return _logger; return _logger;
})(); })();
function serializeSettings(settings, logPrefix) { function serializeSettings(settings) {
let re = /^(k[A-Z]|resolution)/; // accessing settings.resolution throws an exception? let re = /^(k[A-Z]|resolution)/; // accessing settings.resolution throws an exception?
let types = new Set(["string", "boolean", "number", "undefined"]); let types = new Set(["string", "boolean", "number", "undefined"]);
let nameValues = {}; let nameValues = {};
@ -80,7 +80,7 @@ function cancelDeferredTasks() {
document.addEventListener( document.addEventListener(
"DOMContentLoaded", "DOMContentLoaded",
e => { () => {
window._initialized = PrintEventHandler.init().catch(e => console.error(e)); window._initialized = PrintEventHandler.init().catch(e => console.error(e));
ourBrowser.setAttribute("flex", "0"); ourBrowser.setAttribute("flex", "0");
ourBrowser.setAttribute("constrainpopups", "false"); ourBrowser.setAttribute("constrainpopups", "false");
@ -96,7 +96,7 @@ window.addEventListener("dialogclosing", () => {
window.addEventListener( window.addEventListener(
"unload", "unload",
e => { () => {
document.textContent = ""; document.textContent = "";
}, },
{ once: true } { once: true }
@ -1608,7 +1608,7 @@ function PrintUIControlMixin(superClass) {
render() {} render() {}
update(settings) {} update() {}
dispatchSettingsChange(changedSettings) { dispatchSettingsChange(changedSettings) {
this.dispatchEvent( this.dispatchEvent(
@ -1628,7 +1628,7 @@ function PrintUIControlMixin(superClass) {
); );
} }
handleEvent(event) {} handleEvent() {}
}; };
} }
@ -1863,7 +1863,7 @@ class PrintSettingCheckbox extends PrintUIControlMixin(HTMLInputElement) {
this.checked = settings[this.settingName]; this.checked = settings[this.settingName];
} }
handleEvent(e) { handleEvent() {
this.dispatchSettingsChange({ this.dispatchSettingsChange({
[this.settingName]: this.checked, [this.settingName]: this.checked,
}); });
@ -1884,7 +1884,7 @@ class PrintSettingRadio extends PrintUIControlMixin(HTMLInputElement) {
this.checked = settings[this.settingName] == this.value; this.checked = settings[this.settingName] == this.value;
} }
handleEvent(e) { handleEvent() {
this.dispatchSettingsChange({ this.dispatchSettingsChange({
[this.settingName]: this.value, [this.settingName]: this.value,
}); });
@ -2020,7 +2020,7 @@ class CopiesInput extends PrintUIControlMixin(HTMLElement) {
this._copiesError.hidden = true; this._copiesError.hidden = true;
} }
handleEvent(e) { handleEvent() {
this._copiesError.hidden = this._copiesInput.checkValidity(); this._copiesError.hidden = this._copiesInput.checkValidity();
} }
} }
@ -2679,7 +2679,7 @@ class TwistySummary extends PrintUIControlMixin(HTMLElement) {
this.updateSummary(shouldOpen); this.updateSummary(shouldOpen);
} }
handleEvent(e) { handleEvent() {
let willOpen = !this.isOpen; let willOpen = !this.isOpen;
Services.prefs.setBoolPref("print.more-settings.open", willOpen); Services.prefs.setBoolPref("print.more-settings.open", willOpen);
this.updateSummary(willOpen); this.updateSummary(willOpen);

View file

@ -23,7 +23,7 @@ async function waitForPageStatusUpdate(elem, expected, message) {
); );
} }
async function waitUntilVisible(elem, visible = true) { async function waitUntilVisible(elem) {
await TestUtils.waitForCondition( await TestUtils.waitForCondition(
() => () =>
BrowserTestUtils.isVisible(elem) && getComputedStyle(elem).opacity == "1", BrowserTestUtils.isVisible(elem) && getComputedStyle(elem).opacity == "1",

View file

@ -3,7 +3,7 @@
<script> <script>
let count = 0; let count = 0;
onload = function() { onload = function() {
window.addEventListener('beforeprint', (event) => { window.addEventListener('beforeprint', () => {
document.getElementById("before-print-count").innerText = ++count; document.getElementById("before-print-count").innerText = ++count;
print() print()
}); });

View file

@ -232,11 +232,7 @@ class PrintHelper {
}); });
// Mock PrintEventHandler with our Promises. // Mock PrintEventHandler with our Promises.
this.win.PrintEventHandler._showPrintDialog = ( this.win.PrintEventHandler._showPrintDialog = (window, haveSelection) => {
window,
haveSelection,
settings
) => {
this.systemDialogOpenedWithSelection = haveSelection; this.systemDialogOpenedWithSelection = haveSelection;
return showSystemDialogPromise; return showSystemDialogPromise;
}; };

View file

@ -10,7 +10,7 @@ MainProcessSingleton.prototype = {
"nsISupportsWeakReference", "nsISupportsWeakReference",
]), ]),
observe(subject, topic, data) { observe(subject, topic) {
switch (topic) { switch (topic) {
case "app-startup": { case "app-startup": {
// Imported for side-effects. // Imported for side-effects.

Some files were not shown because too many files have changed in this diff Show more