Bug 1864896: Autofix unused function arguments (testing). r=webdriver-reviewers,perftest-reviewers,jmaher,devtools-reviewers,sparky

Differential Revision: https://phabricator.services.mozilla.com/D202990
This commit is contained in:
Dave Townsend 2024-03-05 14:21:16 +00:00
Родитель b8f4c2d785
Коммит 3918ef71d8
59 изменённых файлов: 148 добавлений и 169 удалений

Просмотреть файл

@ -10,7 +10,7 @@
var req = indexedDB.open(name, ver);
req.onerror = reject;
req.onsuccess = (event) => {
req.onsuccess = () => {
resolve(req.result);
};

Просмотреть файл

@ -17,7 +17,7 @@ function success(position) {
message.innerHTML += "<p>Altitude: " + position.coords.altitude + "</p>";
}
function error(msg) {
function error() {
let message = document.getElementById("status");
message.innerHTML = "Failed to get geolocation.";
}

Просмотреть файл

@ -704,7 +704,7 @@ export var BrowserTestUtils = {
* @resolves When STATE_START reaches the tab's progress listener
*/
browserStarted(browser, expectedURI) {
let testFn = function (aStateFlags, aStatus) {
let testFn = function (aStateFlags) {
return (
aStateFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK &&
aStateFlags & Ci.nsIWebProgressListener.STATE_START
@ -763,7 +763,7 @@ export var BrowserTestUtils = {
} else {
urlMatches = urlToMatch => urlToMatch != "about:blank";
}
return new Promise((resolve, reject) => {
return new Promise(resolve => {
tabbrowser.tabContainer.addEventListener(
"TabOpen",
function tabOpenListener(openEvent) {
@ -829,15 +829,9 @@ export var BrowserTestUtils = {
* @resolves When onLocationChange fires.
*/
waitForLocationChange(tabbrowser, url) {
return new Promise((resolve, reject) => {
return new Promise(resolve => {
let progressListener = {
onLocationChange(
aBrowser,
aWebProgress,
aRequest,
aLocationURI,
aFlags
) {
onLocationChange(aBrowser, aWebProgress, aRequest, aLocationURI) {
if (
(url && aLocationURI.spec != url) ||
(!url && aLocationURI.spec == "about:blank")
@ -885,7 +879,7 @@ export var BrowserTestUtils = {
}
return new Promise((resolve, reject) => {
let observe = async (win, topic, data) => {
let observe = async (win, topic) => {
if (topic != "domwindowopened") {
return;
}
@ -1002,7 +996,7 @@ export var BrowserTestUtils = {
*/
domWindowOpened(win, checkFn) {
return new Promise(resolve => {
async function observer(subject, topic, data) {
async function observer(subject, topic) {
if (topic == "domwindowopened" && (!win || subject === win)) {
let observedWindow = subject;
if (checkFn && !(await checkFn(observedWindow))) {
@ -1055,7 +1049,7 @@ export var BrowserTestUtils = {
*/
domWindowClosed(win) {
return new Promise(resolve => {
function observer(subject, topic, data) {
function observer(subject, topic) {
if (topic == "domwindowclosed" && (!win || subject === win)) {
Services.ww.unregisterNotification(observer);
resolve(subject);
@ -1167,7 +1161,7 @@ export var BrowserTestUtils = {
win.gBrowser._insertBrowser(win.gBrowser.getTabForBrowser(browser));
});
let observer = (subject, topic, data) => {
let observer = subject => {
if (browserSet.has(subject)) {
browserSet.delete(subject);
}
@ -1202,7 +1196,7 @@ export var BrowserTestUtils = {
return new Promise(resolve => {
let browser = tab.linkedBrowser;
let flushTopic = "sessionstore-browser-shutdown-flush";
let observer = (subject, topic, data) => {
let observer = subject => {
if (subject === browser) {
Services.obs.removeObserver(observer, flushTopic);
// Wait for the next event tick to make sure other listeners are
@ -1615,7 +1609,7 @@ export var BrowserTestUtils = {
}
},
observe(subject, topic, data) {
observe(subject, topic) {
switch (topic) {
case "test-complete":
this._cleanupContentEventListeners();
@ -2054,7 +2048,7 @@ export var BrowserTestUtils = {
let expectedPromises = [];
let crashCleanupPromise = new Promise((resolve, reject) => {
let observer = (subject, topic, data) => {
let observer = (subject, topic) => {
if (topic != "ipc:content-shutdown") {
reject("Received incorrect observer topic: " + topic);
return;
@ -2129,7 +2123,7 @@ export var BrowserTestUtils = {
if (shouldShowTabCrashPage) {
expectedPromises.push(
new Promise((resolve, reject) => {
new Promise(resolve => {
browser.addEventListener(
"AboutTabCrashedReady",
function onCrash() {
@ -2187,7 +2181,7 @@ export var BrowserTestUtils = {
});
let sawNormalCrash = false;
let observer = (subject, topic, data) => {
let observer = () => {
sawNormalCrash = true;
};
@ -2232,7 +2226,7 @@ export var BrowserTestUtils = {
waitForAttribute(attr, element, value) {
let MutationObserver = element.ownerGlobal.MutationObserver;
return new Promise(resolve => {
let mut = new MutationObserver(mutations => {
let mut = new MutationObserver(() => {
if (
(!value && element.hasAttribute(attr)) ||
(value && element.getAttribute(attr) === value)
@ -2263,7 +2257,7 @@ export var BrowserTestUtils = {
let MutationObserver = element.ownerGlobal.MutationObserver;
return new Promise(resolve => {
dump("Waiting for removal\n");
let mut = new MutationObserver(mutations => {
let mut = new MutationObserver(() => {
if (!element.hasAttribute(attr)) {
resolve();
mut.disconnect();

Просмотреть файл

@ -14,7 +14,7 @@ function AboutPage(aboutHost, chromeURL, uriFlags) {
AboutPage.prototype = {
QueryInterface: ChromeUtils.generateQI(["nsIAboutModule"]),
getURIFlags(aURI) {
getURIFlags() {
// eslint-disable-line no-unused-vars
return this.uriFlags;
},

Просмотреть файл

@ -26,7 +26,7 @@ const windowTracker = {
Services.obs.addObserver(this, "chrome-document-global-created");
},
async observe(window, topic, data) {
async observe(window, topic) {
if (topic === "chrome-document-global-created") {
await new Promise(resolve =>
window.addEventListener("DOMContentLoaded", resolve, { once: true })

Просмотреть файл

@ -13,7 +13,7 @@ add_task(async function () {
gBrowser,
url: "about:blank",
},
async function (browser) {
async function () {
ok(true, "Collecting baseline coverage for browser-chrome tests.");
await new Promise(c => setTimeout(c, 30 * 1000));
}

Просмотреть файл

@ -45,7 +45,7 @@ var TabDestroyObserver = {
Services.obs.removeObserver(this, "message-manager-disconnect");
},
observe(subject, topic, data) {
observe(subject, topic) {
if (topic == "message-manager-close") {
this.outstanding.add(subject);
} else if (topic == "message-manager-disconnect") {
@ -516,7 +516,7 @@ Tester.prototype = {
this.SimpleTest.waitForFocus(aCallback);
},
finish: function Tester_finish(aSkipSummary) {
finish: function Tester_finish() {
var passCount = this.tests.reduce((a, f) => a + f.passCount, 0);
var failCount = this.tests.reduce((a, f) => a + f.failCount, 0);
var todoCount = this.tests.reduce((a, f) => a + f.todoCount, 0);
@ -564,7 +564,7 @@ Tester.prototype = {
this.repeat = 0;
},
observe: function Tester_observe(aSubject, aTopic, aData) {
observe: function Tester_observe(aSubject, aTopic) {
if (!aTopic) {
this.onConsoleMessage(aSubject);
}

Просмотреть файл

@ -215,7 +215,7 @@ function createMochitestServer(serverBasePath) {
});
return file;
},
QueryInterface(aIID) {
QueryInterface() {
return this;
},
};

Просмотреть файл

@ -6,7 +6,7 @@ addMessageListener("foo", function (message) {
sendAsyncMessage("bar", message);
});
addMessageListener("valid-assert", function (message) {
addMessageListener("valid-assert", function () {
assert.ok(true, "valid assertion");
assert.equal(1, 1, "another valid assertion");
sendAsyncMessage("valid-assert-done");

Просмотреть файл

@ -14,11 +14,11 @@
<script class="testbody" type="text/javascript">
var eventCount = 0;
function testEventListener(e) {
function testEventListener() {
++eventCount;
}
function testEventListener2(e) {
function testEventListener2() {
++eventCount;
}

Просмотреть файл

@ -37,7 +37,7 @@ function endOfFirstTest() {
// that is used to run the chrome script.
script2 = SpecialPowers.loadChromeScript(_ => {
/* eslint-env mozilla/chrome-script */
addMessageListener("valid-assert", function (message) {
addMessageListener("valid-assert", function () {
assert.equal(typeof XMLHttpRequest, "function", "XMLHttpRequest is defined");
assert.equal(typeof CSS, "undefined", "CSS is not defined");
sendAsyncMessage("valid-assert-done");

Просмотреть файл

@ -22,7 +22,7 @@ var script = SpecialPowers.loadChromeScript(function loadChromeScriptTest() {
sendAsyncMessage("bar", message);
});
addMessageListener("valid-assert", function (message) {
addMessageListener("valid-assert", function () {
assert.ok(true, "valid assertion");
assert.equal(1, 1, "another valid assertion");
sendAsyncMessage("valid-assert-done");

Просмотреть файл

@ -23,7 +23,7 @@
is(f.type, fileType, "File should have the specified type");
test2();
},
function (msg) { ok(false, "Should be able to create a file without an error"); test2(); }
function () { ok(false, "Should be able to create a file without an error"); test2(); }
);
}
@ -36,7 +36,7 @@
SpecialPowers.createFiles([{name: "/\/\/\/\/\/\/\/\/\/\/\invalidname",}],
function () { test3Check(false); },
function (msg) { test3Check(true); }
function () { test3Check(true); }
);
}
@ -75,7 +75,7 @@
ok(f.name, "test4 test file should have a name");
SimpleTest.finish();
},
function (msg) {
function () {
ok(false, "Should be able to create a file without a name without an error");
SimpleTest.finish();
}

Просмотреть файл

@ -247,7 +247,7 @@ function starttest() {
/* test synthesizeMouse* */
//focus trick enables us to run this in iframes
$("radioTarget1").addEventListener('focus', function (aEvent) {
$("radioTarget1").addEventListener('focus', function () {
synthesizeMouse($("radioTarget1"), 1, 1, {});
is($("radioTarget1").checked, true, "synthesizeMouse should work")
$("radioTarget1").checked = false;
@ -260,7 +260,7 @@ function starttest() {
$("radioTarget1").focus();
//focus trick enables us to run this in iframes
$("textBoxA").addEventListener("focus", function (aEvent) {
$("textBoxA").addEventListener("focus", function () {
check = false;
$("textBoxA").addEventListener("click", function() { check = true; }, { once: true });
synthesizeMouseAtCenter($("textBoxA"), {});

Просмотреть файл

@ -1405,13 +1405,10 @@ function synthesizeAndWaitNativeMouseMove(
);
let eventRegisteredPromise = new Promise(resolve => {
mm.addMessageListener(
"Test:MouseMoveRegistered",
function processed(message) {
mm.addMessageListener("Test:MouseMoveRegistered", function processed() {
mm.removeMessageListener("Test:MouseMoveRegistered", processed);
resolve();
}
);
});
});
let eventReceivedPromise = ContentTask.spawn(
browser,
@ -1579,7 +1576,7 @@ function synthesizeAndWaitKey(
);
let keyRegisteredPromise = new Promise(resolve => {
mm.addMessageListener("Test:KeyRegistered", function processed(message) {
mm.addMessageListener("Test:KeyRegistered", function processed() {
mm.removeMessageListener("Test:KeyRegistered", processed);
resolve();
});
@ -3884,7 +3881,7 @@ class EventCounter {
// SpecialPowers is picky and needs to be passed an explicit reference to
// the function to be called. To avoid having to bind "this", we therefore
// define the method this way, via a property.
this.handleEvent = aEvent => {
this.handleEvent = () => {
this.eventCount++;
};

Просмотреть файл

@ -48,7 +48,7 @@ LogController.extend = function (args, skip) {
};
/* logs message with given level. Currently used locally by log() and error() */
LogController.logWithLevel = function (level, message /*, ...*/) {
LogController.logWithLevel = function (level /*, ...*/) {
var msg = LogController.createLogMessage(
level,
LogController.extend(arguments, 1)

Просмотреть файл

@ -384,7 +384,7 @@ function usesFailurePatterns() {
* @return {boolean} Whether a matched failure pattern is found.
*/
function recordIfMatchesFailurePattern(name, diag) {
let index = SimpleTest.expected.findIndex(([pat, count]) => {
let index = SimpleTest.expected.findIndex(([pat]) => {
return (
pat == null ||
(typeof name == "string" && name.includes(pat)) ||

Просмотреть файл

@ -63,7 +63,7 @@ function extend(obj, /* optional */ skip) {
return ret;
}
function flattenArguments(lst /* ...*/) {
function flattenArguments(/* ...*/) {
var res = [];
var args = extend(arguments);
while (args.length) {

Просмотреть файл

@ -100,7 +100,7 @@
window.promiseAllPaintsDone = function (subdoc = null, flush = false) {
var flushmode = flush ? FlushModes.FLUSH : FlushModes.NOFLUSH;
return new Promise(function (resolve, reject) {
return new Promise(function (resolve) {
// The callback is given the components of the rect, but resolve() can
// only be given one arg, so we turn it back into an array.
waitForPaints((l, r, t, b) => resolve([l, r, t, b]), subdoc, flushmode);

Просмотреть файл

@ -247,7 +247,7 @@ TestRunner.logger.addListener(
var gTestList = [];
var RunSet = {};
RunSet.runall = function (e) {
RunSet.runall = function () {
// Filter tests to include|exclude tests based on data in params.filter.
// This allows for including or excluding tests from the gTestList
// TODO Only used by ipc tests, remove once those are implemented sanely
@ -265,7 +265,7 @@ RunSet.runall = function (e) {
}
};
RunSet.runtests = function (e) {
RunSet.runtests = function () {
// Which tests we're going to run
var my_tests = gTestList;

Просмотреть файл

@ -34,7 +34,7 @@ export class MockRegistry {
QueryInterface: ChromeUtils.generateQI(["nsIWindowsRegKey"]),
// --- Overridden nsIWindowsRegKey interface functions ---
open(root, path, mode) {
open(root, path) {
let rootKey = registry.getRoot(root);
if (!rootKey.has(path)) {
rootKey.set(path, new Map());
@ -60,7 +60,7 @@ export class MockRegistry {
return this.values.has(name);
},
getValueType(name) {
getValueType() {
return Ci.nsIWindowsRegKey.TYPE_STRING;
},

Просмотреть файл

@ -207,9 +207,7 @@ export var TestUtils = {
*/
waitForPrefChange(prefName, checkFn) {
return new Promise((resolve, reject) => {
Services.prefs.addObserver(
prefName,
function observer(subject, topic, data) {
Services.prefs.addObserver(prefName, function observer() {
try {
let prefValue = null;
switch (Services.prefs.getPrefType(prefName)) {
@ -232,8 +230,7 @@ export var TestUtils = {
Services.prefs.removeObserver(prefName, observer);
reject(ex);
}
}
);
});
});
},

Просмотреть файл

@ -68,7 +68,7 @@ function promiseBrowserLoaded(browser, url, redirectUrl) {
"nsIWebProgressListener",
]),
onStateChange(webProgress, request, stateFlags, statusCode) {
onStateChange(webProgress, request, stateFlags) {
request.QueryInterface(Ci.nsIChannel);
let requestURI =
@ -233,7 +233,7 @@ class ContentPage {
this.browser.messageManager.loadFrameScript(frameScript, false, true);
}
didChangeBrowserRemoteness(event) {
didChangeBrowserRemoteness() {
// XXX: Tests can load their own additional frame scripts, so we may need to
// track all scripts that have been loaded, and reload them here?
this.loadFrameScript(frameScript);

Просмотреть файл

@ -52,7 +52,7 @@ addEventListener("DOMContentLoaded", function () {
});
find_all(".sortable").forEach(function (elem) {
elem.addEventListener("click", function (event) {
elem.addEventListener("click", function () {
toggle_sort_states(elem);
var colIndex = toArray(elem.parentNode.childNodes).indexOf(elem);
var key = elem.classList.contains("numeric") ? key_num : key_alpha;

Просмотреть файл

@ -4,7 +4,7 @@
/* eslint-env node */
"use strict";
async function test(context, commands) {}
async function test() {}
module.exports = {
test,

Просмотреть файл

@ -69,7 +69,7 @@ function SPConsoleListener(callback, contentWindow) {
SPConsoleListener.prototype = {
// Overload the observe method for both nsIConsoleListener and nsIObserver.
// The topic will be null for nsIConsoleListener.
observe(msg, topic) {
observe(msg) {
let m = {
message: msg.message,
errorMessage: null,
@ -162,7 +162,7 @@ export class SpecialPowersChild extends JSWindowActorChild {
);
}
observe(aSubject, aTopic, aData) {
observe() {
// Ignore the "{chrome/content}-document-global-created" event. It
// is only observed to force creation of the actor.
}
@ -1089,7 +1089,7 @@ export class SpecialPowersChild extends JSWindowActorChild {
}
return val;
}
_getPref(prefName, prefType, { defaultValue }) {
_getPref(prefName, prefType) {
switch (prefType) {
case "BOOL":
return Services.prefs.getBoolPref(prefName);
@ -1132,7 +1132,7 @@ export class SpecialPowersChild extends JSWindowActorChild {
removeAutoCompletePopupEventListener(window, eventname, listener) {
this._getAutoCompletePopup(window).removeEventListener(eventname, listener);
}
getFormFillController(window) {
getFormFillController() {
return Cc["@mozilla.org/satchel/form-fill-controller;1"].getService(
Ci.nsIFormFillController
);
@ -1927,11 +1927,11 @@ export class SpecialPowersChild extends JSWindowActorChild {
return this.sendQuery("SPRemoveServiceWorkerDataForExampleDomain", {});
}
cleanUpSTSData(origin, flags) {
cleanUpSTSData(origin) {
return this.sendQuery("SPCleanUpSTSData", { origin });
}
async requestDumpCoverageCounters(cb) {
async requestDumpCoverageCounters() {
// We want to avoid a roundtrip between child and parent.
if (!lazy.PerTestCoverageUtils.enabled) {
return;
@ -1940,7 +1940,7 @@ export class SpecialPowersChild extends JSWindowActorChild {
await this.sendQuery("SPRequestDumpCoverageCounters", {});
}
async requestResetCoverageCounters(cb) {
async requestResetCoverageCounters() {
// We want to avoid a roundtrip between child and parent.
if (!lazy.PerTestCoverageUtils.enabled) {
return;
@ -2275,7 +2275,7 @@ SpecialPowersChild.prototype._proxiedObservers = {
);
},
"specialpowers-service-worker-shutdown": function (aMessage) {
"specialpowers-service-worker-shutdown": function () {
Services.obs.notifyObservers(null, "specialpowers-service-worker-shutdown");
},

Просмотреть файл

@ -247,7 +247,7 @@ export class SpecialPowersParent extends JSWindowActorParent {
swm.removeListener(this._serviceWorkerListener);
}
observe(aSubject, aTopic, aData) {
observe(aSubject, aTopic) {
function addDumpIDToMessage(propertyName) {
try {
var id = aSubject.getPropertyAsAString(propertyName);

Просмотреть файл

@ -257,7 +257,7 @@ let SpecialPowersHandler = {
return Reflect.has(this.wrapped.get(target).obj, prop);
},
get(target, prop, receiver) {
get(target, prop) {
let global = Cu.getGlobalForObject(this);
return wrapExceptions(global, () => {
let obj = waiveXraysIfAppropriate(this.wrapped.get(target).obj, prop);
@ -266,7 +266,7 @@ let SpecialPowersHandler = {
});
},
set(target, prop, val, receiver) {
set(target, prop, val) {
return wrapExceptions(Cu.getGlobalForObject(this), () => {
let obj = waiveXraysIfAppropriate(this.wrapped.get(target).obj, prop);
return Reflect.set(obj, prop, unwrapIfWrapped(val));
@ -279,7 +279,7 @@ let SpecialPowersHandler = {
});
},
defineProperty(target, prop, descriptor) {
defineProperty() {
throw new Error(
"Can't call defineProperty on SpecialPowers wrapped object"
);
@ -332,7 +332,7 @@ let SpecialPowersHandler = {
return Cu.cloneInto(props, Cu.getGlobalForObject(this));
},
preventExtensions(target) {
preventExtensions() {
throw new Error(
"Can't call preventExtensions on SpecialPowers wrapped object"
);

10
testing/talos/talos/bootstrap.js поставляемый
Просмотреть файл

@ -27,7 +27,7 @@ const windowTracker = {
Services.ww.registerNotification(this);
},
async observe(window, topic, data) {
async observe(window, topic) {
if (topic === "domwindowopened") {
await new Promise(resolve =>
window.addEventListener("DOMWindowCreated", resolve, { once: true })
@ -50,13 +50,13 @@ function readSync(uri) {
return new TextDecoder().decode(buffer);
}
function startup(data, reason) {
function startup(data) {
Services.scriptloader.loadSubScript(
data.resourceURI.resolve("content/initialize_browser.js")
);
windowTracker.init();
}
function shutdown(data, reason) {}
function install(data, reason) {}
function uninstall(data, reason) {}
function shutdown() {}
function install() {}
function uninstall() {}

Просмотреть файл

@ -55,7 +55,7 @@
ensureAccessibleTreeForNode(node);
}
addEventListener("DOMContentLoaded", e => {
addEventListener("DOMContentLoaded", () => {
Cu.exportFunction(initAccessibility, content, {
defineAs: "initAccessibility",
});

Просмотреть файл

@ -8,8 +8,8 @@ function _contentHeroHandler(isload) {
var obs = null;
var el = content.window.document.querySelector("[elementtiming]");
if (el) {
function callback(entries, observer) {
entries.forEach(entry => {
function callback(entries) {
entries.forEach(() => {
sendAsyncMessage("PageLoader:LoadEvent", {
time: content.window.performance.now(),
name: "tphero",

Просмотреть файл

@ -9,7 +9,7 @@ function _contentPaintHandler() {
if (utils.isMozAfterPaintPending) {
addEventListener(
"MozAfterPaint",
function afterpaint(e) {
function afterpaint() {
removeEventListener("MozAfterPaint", afterpaint, true);
sendAsyncMessage("PageLoader:LoadEvent", {});
},

Просмотреть файл

@ -241,7 +241,7 @@ async function plInit() {
// pages should be able to load in the same mode as the initial page - due
// to this reinitialization on the switch.
let tab = gBrowser.selectedTab;
tab.addEventListener("TabRemotenessChange", function (evt) {
tab.addEventListener("TabRemotenessChange", function () {
loadFrameScripts(tab.linkedBrowser);
});
loadFrameScripts(tab.linkedBrowser);
@ -300,7 +300,7 @@ function plLoadPage() {
}
let tab = gBrowser.selectedTab;
tab.addEventListener("TabRemotenessChange", evt => {
tab.addEventListener("TabRemotenessChange", () => {
addMsgListeners(tab.linkedBrowser);
});
addMsgListeners(tab.linkedBrowser);
@ -581,13 +581,10 @@ function waitForPDFPaint() {
function forceContentGC() {
return new Promise(resolve => {
let mm = browserWindow.gBrowser.selectedBrowser.messageManager;
mm.addMessageListener(
"Talos:ForceGC:OK",
function onTalosContentForceGC(msg) {
mm.addMessageListener("Talos:ForceGC:OK", function onTalosContentForceGC() {
mm.removeMessageListener("Talos:ForceGC:OK", onTalosContentForceGC);
resolve();
}
);
});
mm.sendAsyncMessage("Talos:ForceGC");
});
}

Просмотреть файл

@ -267,7 +267,7 @@ function testScroll(target, stepSize, opt_reportFunc, opt_numSteps) {
TalosPowersParent.exec("stopFrameTimeRecording", handle, cb, win);
}
return new Promise(function (resolve, reject) {
return new Promise(function (resolve) {
setSmooth();
var handle = -1;

Просмотреть файл

@ -28,7 +28,7 @@ this.sessionrestore = class extends ExtensionAPI {
this.run();
}
observe(subject, topic, data) {
observe(subject, topic) {
if (topic == "browser-idle-startup-tasks-finished") {
this.promiseIdleFinished.resolve();
}

Просмотреть файл

@ -27,7 +27,7 @@ this.startup_about_home_paint = class extends ExtensionAPI {
});
}
observe(subject, topic, data) {
observe(subject, topic) {
if (topic == "browser-idle-startup-tasks-finished") {
this.checkForTelemetry();
}

Просмотреть файл

@ -371,7 +371,7 @@ TalosPowersService.prototype = {
},
*/
ParentExecServices: {
ping(arg, callback, win) {
ping(arg, callback) {
callback();
},
@ -387,15 +387,15 @@ TalosPowersService.prototype = {
callback(rv);
},
requestDumpCoverageCounters(arg, callback, win) {
requestDumpCoverageCounters(arg, callback) {
PerTestCoverageUtils.afterTest().then(callback);
},
requestResetCoverageCounters(arg, callback, win) {
requestResetCoverageCounters(arg, callback) {
PerTestCoverageUtils.beforeTest().then(callback);
},
dumpAboutSupport(arg, callback, win) {
dumpAboutSupport(arg, callback) {
const { Troubleshoot } = ChromeUtils.importESModule(
"resource://gre/modules/Troubleshoot.sys.mjs"
);

Просмотреть файл

@ -35,7 +35,7 @@ addMessageListener("TalosContentProfiler:Response", msg => {
addEventListener(
"TalosPowersContentForceCCAndGC",
e => {
() => {
Cu.forceGC();
Cu.forceCC();
Cu.forceShrinkingGC();
@ -46,7 +46,7 @@ addEventListener(
addEventListener(
"TalosPowersContentFocus",
e => {
() => {
if (
content.location.protocol != "file:" &&
content.location.hostname != "localhost" &&
@ -72,7 +72,7 @@ addEventListener(
addEventListener(
"TalosPowersContentGetStartupInfo",
e => {
() => {
sendAsyncMessage("TalosPowersContent:GetStartupInfo");
addMessageListener(
"TalosPowersContent:GetStartupInfo:Result",
@ -103,7 +103,7 @@ addEventListener(
addEventListener(
"TalosPowersContentDumpConsole",
e => {
() => {
var messages;
try {
messages = Services.console.getMessageArray();
@ -147,7 +147,7 @@ addEventListener(
*/
addEventListener(
"TalosPowersWebRenderCapture",
e => {
() => {
if (content && content.windowUtils) {
content.windowUtils.wrCapture();
} else {

Просмотреть файл

@ -116,7 +116,7 @@ this.cpstartup = class extends ExtensionAPI {
removeTab(tab) {
return new Promise(resolve => {
let browser = tab.linkedBrowser;
let observer = (subject, topic, data) => {
let observer = subject => {
if (subject === browser) {
Services.obs.removeObserver(observer, BROWSER_FLUSH_TOPIC);
resolve();

Просмотреть файл

@ -7,7 +7,7 @@
addEventListener(
"CPStartup:Ping",
e => {
() => {
let evt = new content.CustomEvent("CPStartup:Pong", { bubbles: true });
content.dispatchEvent(evt);
},

Просмотреть файл

@ -5,7 +5,7 @@
/* eslint-disable no-restricted-globals */
export class DampLoadChild extends JSWindowActorChild {
handleEvent(evt) {
handleEvent() {
this.sendAsyncMessage("DampLoadChild:PageShow", {
browsingContext: this.browsingContext,
});

Просмотреть файл

@ -216,7 +216,7 @@ Damp.prototype = {
return tab;
},
async testTeardown(url) {
async testTeardown() {
// Disable closing animation to avoid intermittents and prevent having to wait for
// animation's end. (See bug 1480953)
this._win.gBrowser.removeCurrentTab({ animate: false });

Просмотреть файл

@ -145,7 +145,7 @@ async function stepDebuggerAndLog(dbg, tab, testFunction) {
}
}
async function testProjectSearch(dbg, tab) {
async function testProjectSearch(dbg) {
dump("Executing project search\n");
const test = runTest(`custom.jsdebugger.project-search.DAMP`);
const firstSearchResultTest = runTest(
@ -216,7 +216,7 @@ async function testPreview(dbg, tab, testFunction) {
await garbageCollect();
}
async function testOpeningLargeMinifiedFile(dbg, tab) {
async function testOpeningLargeMinifiedFile(dbg) {
const fileFirstMinifiedChars = `(()=>{var e,t,n,r,o={82603`;
dump("Open minified.js (large minified file)\n");

Просмотреть файл

@ -352,13 +352,7 @@ async function removeBreakpoints(dbg) {
}
exports.removeBreakpoints = removeBreakpoints;
async function pauseDebugger(
dbg,
tab,
testFunction,
{ line, file },
pauseOptions
) {
async function pauseDebugger(dbg, tab, testFunction, { line, file }) {
const { getSelectedLocation, isMapScopesEnabled } = dbg.selectors;
const state = dbg.store.getState();

Просмотреть файл

@ -114,7 +114,7 @@ function waitForDOMPredicate(
return Promise.resolve(rv);
}
return new Promise(resolve => {
const observer = new target.ownerGlobal.MutationObserver(mutations => {
const observer = new target.ownerGlobal.MutationObserver(() => {
rv = predicate();
if (rv) {
resolve(rv);

Просмотреть файл

@ -45,7 +45,7 @@ async function waitForAllRequestsFinished(
let payloadReady = 0;
let resolveWithLessThanMaxRequestsTimer = null;
function onPayloadReady(_, id) {
function onPayloadReady() {
payloadReady++;
dump(`Waiting for ${maxExpectedRequests - payloadReady} requests\n`);
maybeResolve();

Просмотреть файл

@ -12,7 +12,7 @@ class DampTestActor extends Actor {
super(conn, dampTestSpec);
}
testMethod(arg, { option }, arraySize) {
testMethod(arg, { option }) {
// Emit an event with second argument's option.
this.emit("testEvent", option);

Просмотреть файл

@ -67,7 +67,7 @@ module.exports = async function () {
bigObject["attribute-" + i] = bigString;
}
let bigArray = Array.from({ length: ARRAY_SIZE }, (_, i) => bigObject);
let bigArray = Array.from({ length: ARRAY_SIZE }, _ => bigObject);
// Open against options to avoid noise from tools
let toolbox = await openToolbox("options");

Просмотреть файл

@ -40,7 +40,7 @@ function waitForPayload(count, panelWin) {
return new Promise(resolve => {
let payloadReady = 0;
function onPayloadReady(_, id) {
function onPayloadReady() {
payloadReady++;
maybeResolve();
}

Просмотреть файл

@ -160,7 +160,7 @@ this.tabpaint = class extends ExtensionAPI {
* Resolves once the tab has been fully removed. Resolves
* with the time (in ms) it took to open the tab from content.
*/
async openTabFromContent(gBrowser) {
async openTabFromContent() {
TalosParentProfiler.subtestStart("TabPaint Content Start");
let start_time = Cu.now();
@ -200,7 +200,7 @@ this.tabpaint = class extends ExtensionAPI {
TalosParentProfiler.mark("Tabpaint: Remove Tab");
return new Promise(resolve => {
let browser = tab.linkedBrowser;
let observer = (subject, topic, data) => {
let observer = subject => {
if (subject === browser) {
Services.obs.removeObserver(observer, BROWSER_FLUSH_TOPIC);
resolve();

Просмотреть файл

@ -3,7 +3,7 @@
(function () {
addEventListener(
"load",
loadevt => {
() => {
if (!content.location.pathname.endsWith("target.html")) {
return;
}
@ -62,7 +62,7 @@
addEventListener(
"TabPaint:Ping",
e => {
() => {
let evt = new content.CustomEvent("TabPaint:Pong", { bubbles: true });
content.dispatchEvent(evt);
},
@ -79,7 +79,7 @@
true
);
addMessageListener("TabPaint:OpenFromContent", msg => {
addMessageListener("TabPaint:OpenFromContent", () => {
let evt = new content.CustomEvent("TabPaint:OpenFromContent", {
bubbles: true,
});

Просмотреть файл

@ -13,7 +13,7 @@ function init() {
tpRecordTime([fromParent, fromContent].join(","), 0, "tabpaint-from-parent, tabpaint-from-content");
}, {once: true});
window.addEventListener("TabPaint:OpenFromContent", (event) => {
window.addEventListener("TabPaint:OpenFromContent", () => {
let target = document.getElementById("target");
//win.performance.now() + win.performance.timing.navigationStart gives the UNIX timestamp.

Просмотреть файл

@ -21,7 +21,7 @@ export class TalosTabSwitchChild extends RemotePageChild {
super.actorCreated();
}
handleEvent(event) {}
handleEvent() {}
receiveMessage(message) {
if (message.name == "GarbageCollect") {

Просмотреть файл

@ -27,7 +27,7 @@ const TPSProcessScript = {
chan.originalURI = aURI;
return chan;
}
getURIFlags(aURI) {
getURIFlags() {
return (
Ci.nsIAboutModule.ALLOW_SCRIPT |
Ci.nsIAboutModule.URI_MUST_LOAD_IN_CHILD |

Просмотреть файл

@ -39,7 +39,7 @@ function content_focused() {
runTest();
}
function fullscreen(event) {
function fullscreen() {
if ((document.fullscreenElement && document.fullscreenElement !== null) ||
document.mozFullScreen) {
startTest();

Просмотреть файл

@ -188,7 +188,7 @@
const WARMUP_TIMESTAMPS = 30; // Must be at least 2
const MEASURED_FRAMES = 100;
var gDoneCallback = function placeholder(intervals) {};
var gDoneCallback = function placeholder() {};
var gCurrentTimestamp = 0;
var gResultTimestamps = [];
@ -202,7 +202,7 @@
});
}
function draw(timestamp) {
function draw() {
// It's possible that under some implementations (even if not our current one),
// the rAF callback arg will be in some way "optimized", e.g. always point to the
// estimated next vsync timestamp, in order to allow the callee to have less

Просмотреть файл

@ -19,7 +19,7 @@ browser.webRequest.onBeforeRequest.addListener(
let filter = browser.webRequest.filterResponseData(details.requestId);
filter.onstop = event => {
filter.onstop = () => {
filter.close();
};
filter.ondata = event => {
@ -48,7 +48,7 @@ browser.webRequest.onHeadersReceived.addListener(
["blocking", "responseHeaders"]
);
browser.webRequest.onErrorOccurred.addListener(details => {}, {
browser.webRequest.onErrorOccurred.addListener(() => {}, {
urls: ["https://*/*", "http://*/*"],
});
@ -73,7 +73,7 @@ browser.tabs.onUpdated.addListener((tabId, changed, tab) => {
});
});
browser.tabs.onActivated.addListener(({ tabId, windowId }) => {
browser.tabs.onActivated.addListener(({ tabId }) => {
browser.pageAction.show(tabId);
});
@ -81,8 +81,8 @@ browser.tabs.onCreated.addListener(tab => {
browser.pageAction.show(tab.id);
});
browser.tabs.onRemoved.addListener((tabId, removeInfo) => {});
browser.tabs.onRemoved.addListener(() => {});
browser.tabs.onAttached.addListener((tabId, attachInfo) => {});
browser.tabs.onAttached.addListener(() => {});
browser.tabs.onDetached.addListener((tabId, detachInfo) => {});
browser.tabs.onDetached.addListener(() => {});

Просмотреть файл

@ -434,7 +434,7 @@ function _setupDevToolsServer(breakpointFiles, callback) {
// Or when devtools are destroyed and we should stop observing.
"xpcshell-test-devtools-shutdown",
];
let observe = function (subject, topic, data) {
let observe = function (subject, topic) {
if (topic === "devtools-thread-ready") {
const threadActor = subject.wrappedJSObject;
threadActor.setBreakpointOnLoad(breakpointFiles);
@ -745,7 +745,7 @@ function _execute_test() {
* @param aFiles Array of files to load.
*/
function _load_files(aFiles) {
function load_file(element, index, array) {
function load_file(element) {
try {
let startTime = Cu.now();
load(element);
@ -1829,7 +1829,7 @@ function run_next_test() {
}
function frontLoadSetups() {
_gTests.sort(([propsA, funcA], [propsB, funcB]) => {
_gTests.sort(([propsA], [propsB]) => {
if (propsB.isSetup === propsA.isSetup) {
return 0;
}

Просмотреть файл

@ -56,7 +56,7 @@ var framer_module = node_http2_root + "/lib/protocol/framer";
var http2_framer = require(framer_module);
var Serializer = http2_framer.Serializer;
var originalTransform = Serializer.prototype._transform;
var newTransform = function (frame, encoding, done) {
var newTransform = function (frame) {
if (frame.type == "DATA") {
// Insert our empty DATA frame
const emptyFrame = {};
@ -1757,7 +1757,7 @@ server.on("connection", function (socket) {
});
});
server.on("connect", function (req, clientSocket, head) {
server.on("connect", function (req, clientSocket) {
clientSocket.write(
"HTTP/1.1 404 Not Found\r\nProxy-agent: Node.js-Proxy\r\n\r\n"
);