Bug 1864896: Autofix unused function arguments (remote). r=webdriver-reviewers,jdescottes

Differential Revision: https://phabricator.services.mozilla.com/D202981
This commit is contained in:
Dave Townsend 2024-03-01 23:43:51 +00:00
Родитель 781b2008f8
Коммит 049e4fc37a
36 изменённых файлов: 78 добавлений и 90 удалений

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

@ -613,7 +613,7 @@ export class Runtime extends ContentProcessDomain {
* @param {nsIConsoleMessage} subject * @param {nsIConsoleMessage} subject
* Console message. * Console message.
*/ */
observe(subject, topic, data) { observe(subject) {
if (subject instanceof Ci.nsIScriptError && subject.hasException) { if (subject instanceof Ci.nsIScriptError && subject.hasException) {
let entry = fromScriptError(subject); let entry = fromScriptError(subject);
this._emitExceptionThrown(entry); this._emitExceptionThrown(entry);

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

@ -151,7 +151,7 @@ export class Network extends Domain {
* @returns {Array<Cookie>} * @returns {Array<Cookie>}
* Array of cookie objects. * Array of cookie objects.
*/ */
async getAllCookies(options = {}) { async getAllCookies() {
const cookies = []; const cookies = [];
for (const cookie of Services.cookies.cookies) { for (const cookie of Services.cookies.cookies) {
cookies.push(_buildCookie(cookie)); cookies.push(_buildCookie(cookie));

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

@ -677,7 +677,7 @@ export class Page extends Domain {
* @param {boolean=} options.enabled * @param {boolean=} options.enabled
* Enabled state of file chooser interception. * Enabled state of file chooser interception.
*/ */
setInterceptFileChooserDialog(options = {}) {} setInterceptFileChooserDialog() {}
_getCurrentHistoryIndex() { _getCurrentHistoryIndex() {
const { window } = this.session.target; const { window } = this.session.target;

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

@ -121,7 +121,7 @@ export class ContextObserver {
} }
} }
observe(subject, topic, data) { observe(subject, topic) {
switch (topic) { switch (topic) {
case "document-element-inserted": case "document-element-inserted":
const window = subject.defaultView; const window = subject.defaultView;

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

@ -186,7 +186,7 @@ export class NetworkObserver {
this._redirectMap.set(newChannel, oldChannel); this._redirectMap.set(newChannel, oldChannel);
} }
_onRequest(channel, topic) { _onRequest(channel) {
const httpChannel = channel.QueryInterface(Ci.nsIHttpChannel); const httpChannel = channel.QueryInterface(Ci.nsIHttpChannel);
const loadContext = getLoadContext(httpChannel); const loadContext = getLoadContext(httpChannel);
const browser = loadContext?.topFrameElement; const browser = loadContext?.topFrameElement;
@ -242,7 +242,7 @@ export class NetworkObserver {
}); });
} }
_onResponse(fromCache, httpChannel, topic) { _onResponse(fromCache, httpChannel) {
const loadContext = getLoadContext(httpChannel); const loadContext = getLoadContext(httpChannel);
if ( if (
!loadContext || !loadContext ||

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

@ -94,7 +94,7 @@ export class TabTarget extends Target {
/** @returns {Promise<string|null>} */ /** @returns {Promise<string|null>} */
get faviconUrl() { get faviconUrl() {
return new Promise((resolve, reject) => { return new Promise(resolve => {
lazy.Favicons.getFaviconURLForPage(this.browser.currentURI, url => { lazy.Favicons.getFaviconURLForPage(this.browser.currentURI, url => {
if (url) { if (url) {
resolve(url.spec); resolve(url.spec);
@ -143,7 +143,7 @@ export class TabTarget extends Target {
// nsIObserver // nsIObserver
observe(subject, topic, data) { observe(subject) {
if (subject === this.mm && subject == "message-manager-disconnect") { if (subject === this.mm && subject == "message-manager-disconnect") {
// disconnect debugging target if <browser> is disconnected, // disconnect debugging target if <browser> is disconnected,
// otherwise this is just a host process change // otherwise this is just a host process change

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

@ -188,7 +188,7 @@ add_task(async function json_activate_target({ client, tab }) {
is(invalidResponse, "No such target id: does-not-exist"); is(invalidResponse, "No such target id: does-not-exist");
}); });
add_task(async function json_close_target({ CDP, client, tab }) { add_task(async function json_close_target({ CDP, client }) {
const { Target } = client; const { Target } = client;
const { targetInfo, newTab } = await openTab(Target); const { targetInfo, newTab } = await openTab(Target);

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

@ -100,7 +100,7 @@ add_task(async function eventsForScriptErrorContent({ client }) {
is(events[0].lineNumber, 2, "Got expected line number"); is(events[0].lineNumber, 2, "Got expected line number");
}); });
async function runEntryAddedTest(client, eventCount, callback, options = {}) { async function runEntryAddedTest(client, eventCount, callback) {
const { Log } = client; const { Log } = client;
const EVENT_ENTRY_ADDED = "Log.entryAdded"; const EVENT_ENTRY_ADDED = "Log.entryAdded";
@ -109,7 +109,7 @@ async function runEntryAddedTest(client, eventCount, callback, options = {}) {
history.addRecorder({ history.addRecorder({
event: Log.entryAdded, event: Log.entryAdded,
eventName: EVENT_ENTRY_ADDED, eventName: EVENT_ENTRY_ADDED,
messageFn: payload => `Received "${EVENT_ENTRY_ADDED}"`, messageFn: () => `Received "${EVENT_ENTRY_ADDED}"`,
}); });
const timeBefore = Date.now(); const timeBefore = Date.now();

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

@ -18,7 +18,7 @@ add_task(async function cacheEnabledAfterDisabled({ client }) {
await waitForLoadFlags(); await waitForLoadFlags();
}); });
add_task(async function cacheEnabledByDefault({ Network }) { add_task(async function cacheEnabledByDefault() {
await watchLoadFlags(LOAD_NORMAL, TEST_PAGE); await watchLoadFlags(LOAD_NORMAL, TEST_PAGE);
await loadURL(TEST_PAGE); await loadURL(TEST_PAGE);
await waitForLoadFlags(); await waitForLoadFlags();
@ -67,7 +67,7 @@ function watchLoadFlags(flags, url) {
); );
}, },
onStateChange(webProgress, request, flags, status) { onStateChange(webProgress, request, flags) {
// We are checking requests - if there isn't one, ignore it. // We are checking requests - if there isn't one, ignore it.
if (!request) { if (!request) {
return; return;

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

@ -178,7 +178,7 @@ async function runPageLifecycleTest(client, expectedEventSets, callback) {
// Check data as exposed by each of these events // Check data as exposed by each of these events
let lastTimestamp = frameEvents[0].payload.timestamp; let lastTimestamp = frameEvents[0].payload.timestamp;
frameEvents.forEach(({ payload }, index) => { frameEvents.forEach(({ payload }) => {
Assert.greaterOrEqual( Assert.greaterOrEqual(
payload.timestamp, payload.timestamp,
lastTimestamp, lastTimestamp,

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

@ -76,12 +76,7 @@ add_task(async function eventsForScriptErrorWithException({ client }) {
is(callFrames[1].url, PAGE_CONSOLE_EVENTS, "Got expected url"); is(callFrames[1].url, PAGE_CONSOLE_EVENTS, "Got expected url");
}); });
async function runExceptionThrownTest( async function runExceptionThrownTest(client, eventCount, callback) {
client,
eventCount,
callback,
options = {}
) {
const { Runtime } = client; const { Runtime } = client;
const EVENT_EXCEPTION_THROWN = "Runtime.exceptionThrown"; const EVENT_EXCEPTION_THROWN = "Runtime.exceptionThrown";

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

@ -68,7 +68,7 @@ function isSecurityState(browser, expectedState) {
); );
} }
add_task(async function testDefault({ Security }) { add_task(async function testDefault() {
for (const url of BAD_CERTS) { for (const url of BAD_CERTS) {
info(`Navigating to ${url}`); info(`Navigating to ${url}`);
const loaded = BrowserTestUtils.waitForErrorPage(gBrowser.selectedBrowser); const loaded = BrowserTestUtils.waitForErrorPage(gBrowser.selectedBrowser);

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

@ -3,7 +3,7 @@
"use strict"; "use strict";
add_task(async function raisesWithoutArguments({ client, tab }) { add_task(async function raisesWithoutArguments({ client }) {
const { Target } = client; const { Target } = client;
await Assert.rejects( await Assert.rejects(
@ -13,7 +13,7 @@ add_task(async function raisesWithoutArguments({ client, tab }) {
); );
}); });
add_task(async function raisesWithUnknownTargetId({ client, tab }) { add_task(async function raisesWithUnknownTargetId({ client }) {
const { Target } = client; const { Target } = client;
await Assert.rejects( await Assert.rejects(

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

@ -3,7 +3,7 @@
"use strict"; "use strict";
add_task(async function raisesWithoutArguments({ client, tab }) { add_task(async function raisesWithoutArguments({ client }) {
const { Target } = client; const { Target } = client;
await Assert.rejects( await Assert.rejects(
@ -13,7 +13,7 @@ add_task(async function raisesWithoutArguments({ client, tab }) {
); );
}); });
add_task(async function raisesWithUnknownTargetId({ client, tab }) { add_task(async function raisesWithUnknownTargetId({ client }) {
const { Target } = client; const { Target } = client;
await Assert.rejects( await Assert.rejects(

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

@ -3,7 +3,7 @@
"use strict"; "use strict";
add_task(async function raisesWithoutArguments({ client, tab }) { add_task(async function raisesWithoutArguments({ client }) {
const { Target } = client; const { Target } = client;
await Assert.rejects( await Assert.rejects(
@ -13,7 +13,7 @@ add_task(async function raisesWithoutArguments({ client, tab }) {
); );
}); });
add_task(async function raisesWithUnknownTargetId({ client, tab }) { add_task(async function raisesWithUnknownTargetId({ client }) {
const { Target } = client; const { Target } = client;
await Assert.rejects( await Assert.rejects(
@ -23,7 +23,7 @@ add_task(async function raisesWithUnknownTargetId({ client, tab }) {
); );
}); });
add_task(async function triggersTargetDestroyed({ client, tab }) { add_task(async function triggersTargetDestroyed({ client }) {
const { Target } = client; const { Target } = client;
const { targetInfo, newTab } = await openTab(Target); const { targetInfo, newTab } = await openTab(Target);

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

@ -3,7 +3,7 @@
"use strict"; "use strict";
add_task(async function eventFiredWhenTabIsClosed({ client, tab }) { add_task(async function eventFiredWhenTabIsClosed({ client }) {
const { Target } = client; const { Target } = client;
const { newTab } = await openTab(Target); const { newTab } = await openTab(Target);

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

@ -37,7 +37,7 @@ async function installAddon(file) {
throw new lazy.error.UnknownError(ERRORS[install.error]); throw new lazy.error.UnknownError(ERRORS[install.error]);
} }
return install.install().catch(err => { return install.install().catch(() => {
throw new lazy.error.UnknownError(ERRORS[install.error]); throw new lazy.error.UnknownError(ERRORS[install.error]);
}); });
} }

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

@ -328,7 +328,7 @@ browser.Context = class {
* @param {XULBrowser} target * @param {XULBrowser} target
* The <xul:browser> that was the target of the originating message. * The <xul:browser> that was the target of the originating message.
*/ */
register(target) { register() {
if (!this.tabBrowser) { if (!this.tabBrowser) {
return; return;
} }

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

@ -540,7 +540,7 @@ GeckoDriver.prototype.handleEvent = function ({ target, type }) {
} }
}; };
GeckoDriver.prototype.observe = async function (subject, topic, data) { GeckoDriver.prototype.observe = async function (subject, topic) {
switch (topic) { switch (topic) {
case TOPIC_BROWSER_READY: case TOPIC_BROWSER_READY:
this.registerWindow(subject); this.registerWindow(subject);

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

@ -265,7 +265,7 @@ navigate.waitForNavigationCompleted = async function waitForNavigationCompleted(
checkDone({ finished: true }); checkDone({ finished: true });
}; };
const onTimer = timer => { const onTimer = () => {
// For the command "Element Click" we want to detect a potential navigation // For the command "Element Click" we want to detect a potential navigation
// as early as possible. The `beforeunload` event is an indication for that // as early as possible. The `beforeunload` event is an indication for that
// but could still cause the navigation to get aborted by the user. As such // but could still cause the navigation to get aborted by the user. As such
@ -356,7 +356,7 @@ navigate.waitForNavigationCompleted = async function waitForNavigationCompleted(
} }
}; };
const onUnload = event => { const onUnload = () => {
lazy.logger.trace( lazy.logger.trace(
"Canceled page load listener " + "Canceled page load listener " +
"because the top-browsing context has been closed" "because the top-browsing context has been closed"

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

@ -30,26 +30,19 @@ BrowserDOMWindow.prototype = {
return null; return null;
}, },
createContentWindow( createContentWindow(aURI, aOpenWindowInfo, aWhere) {
aURI,
aOpenWindowInfo,
aWhere,
aFlags,
aTriggeringPrincipal,
aCsp
) {
return this._maybeOpen(aOpenWindowInfo, aWhere)?.browsingContext; return this._maybeOpen(aOpenWindowInfo, aWhere)?.browsingContext;
}, },
openURI(aURI, aOpenWindowInfo, aWhere, aFlags, aTriggeringPrincipal, aCsp) { openURI(aURI, aOpenWindowInfo, aWhere) {
return this._maybeOpen(aOpenWindowInfo, aWhere)?.browsingContext; return this._maybeOpen(aOpenWindowInfo, aWhere)?.browsingContext;
}, },
createContentWindowInFrame(aURI, aParams, aWhere, aFlags, aName) { createContentWindowInFrame(aURI, aParams, aWhere) {
return this._maybeOpen(aParams.openWindowInfo, aWhere); return this._maybeOpen(aParams.openWindowInfo, aWhere);
}, },
openURIInFrame(aURI, aParams, aWhere, aFlags, aName) { openURIInFrame(aURI, aParams, aWhere) {
return this._maybeOpen(aParams.openWindowInfo, aWhere); return this._maybeOpen(aParams.openWindowInfo, aWhere);
}, },

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

@ -28,7 +28,7 @@ class MessageManager {
this.message = message; this.message = message;
} }
removeMessageListener(message) { removeMessageListener() {
this.func = null; this.func = null;
this.message = null; this.message = null;
} }
@ -55,7 +55,7 @@ class MockTimer {
this.cancelled = false; this.cancelled = false;
} }
initWithCallback(cb, timeout, type) { initWithCallback(cb) {
this.ticks++; this.ticks++;
if (this.ticks >= this.goal) { if (this.ticks >= this.goal) {
cb(); cb();
@ -216,7 +216,7 @@ add_task(function test_TimedPromise_timeoutTypes() {
add_task(async function test_TimedPromise_errorMessage() { add_task(async function test_TimedPromise_errorMessage() {
try { try {
await new TimedPromise(resolve => {}, { timeout: 0 }); await new TimedPromise(() => {}, { timeout: 0 });
ok(false, "Expected Timeout error not raised"); ok(false, "Expected Timeout error not raised");
} catch (e) { } catch (e) {
ok( ok(
@ -226,7 +226,7 @@ add_task(async function test_TimedPromise_errorMessage() {
} }
try { try {
await new TimedPromise(resolve => {}, { await new TimedPromise(() => {}, {
errorMessage: "Not found", errorMessage: "Not found",
timeout: 0, timeout: 0,
}); });

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

@ -68,7 +68,7 @@ function writeString(output, data) {
} }
output.asyncWait( output.asyncWait(
stream => { () => {
try { try {
const written = output.write(data, data.length); const written = output.write(data, data.length);
data = data.slice(written); data = data.slice(written);

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

@ -24,7 +24,7 @@ const ID_THUNDERBIRD = "{3550f703-e582-4d05-9a08-453d09bdfdc6}";
export const AppInfo = new Proxy( export const AppInfo = new Proxy(
{}, {},
{ {
get(target, prop, receiver) { get(target, prop) {
if (target.hasOwnProperty(prop)) { if (target.hasOwnProperty(prop)) {
return target[prop]; return target[prop];
} }

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

@ -89,7 +89,7 @@ export class WebSocketConnection {
* @param {Session} session * @param {Session} session
* The session to register. * The session to register.
*/ */
registerSession(session) { registerSession() {
throw new Error("Not implemented"); throw new Error("Not implemented");
} }
@ -140,7 +140,7 @@ export class WebSocketConnection {
/** /**
* Called by the `transport` when the connection is closed. * Called by the `transport` when the connection is closed.
*/ */
onConnectionClose(status) { onConnectionClose() {
lazy.logger.debug(`${this.constructor.name} ${this.id} closed`); lazy.logger.debug(`${this.constructor.name} ${this.id} closed`);
} }

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

@ -56,12 +56,12 @@ export class NavigationListenerChild extends JSWindowActorChild {
/** /**
* See note above * See note above
*/ */
handleEvent(event) {} handleEvent() {}
/** /**
* See note above * See note above
*/ */
receiveMessage(message) {} receiveMessage() {}
/** /**
* A browsing context might be replaced before reaching the parent process, * A browsing context might be replaced before reaching the parent process,

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

@ -49,7 +49,7 @@ export class ContextualIdentityListener {
this.stopListening(); this.stopListening();
} }
observe(subject, topic, data) { observe(subject, topic) {
switch (topic) { switch (topic) {
case OBSERVER_TOPIC_CREATED: case OBSERVER_TOPIC_CREATED:
this.emit("created", { identity: subject.wrappedJSObject }); this.emit("created", { identity: subject.wrappedJSObject });

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

@ -169,7 +169,7 @@ export class NetworkEventRecord {
* @param {boolean} isRacing * @param {boolean} isRacing
* True if the corresponding channel raced the cache and network requests. * True if the corresponding channel raced the cache and network requests.
*/ */
addSecurityInfo(info, isRacing) {} addSecurityInfo() {}
/** /**
* Add network event timings. * Add network event timings.
@ -185,7 +185,7 @@ export class NetworkEventRecord {
* @param {object} offsets * @param {object} offsets
* The har-like timings, but as offset from the request start. * The har-like timings, but as offset from the request start.
*/ */
addEventTimings(total, timings, offsets) {} addEventTimings() {}
/** /**
* Add response cache entry. * Add response cache entry.
@ -197,7 +197,7 @@ export class NetworkEventRecord {
* @param {object} options * @param {object} options
* An object which contains a single responseCache property. * An object which contains a single responseCache property.
*/ */
addResponseCache(options) {} addResponseCache() {}
/** /**
* Add response content. * Add response content.
@ -237,7 +237,7 @@ export class NetworkEventRecord {
* @param {Array} serverTimings * @param {Array} serverTimings
* The server timings. * The server timings.
*/ */
addServerTimings(serverTimings) {} addServerTimings() {}
/** /**
* Add service worker timings. * Add service worker timings.
@ -249,7 +249,7 @@ export class NetworkEventRecord {
* @param {object} serviceWorkerTimings * @param {object} serviceWorkerTimings
* The server timings. * The server timings.
*/ */
addServiceWorkerTimings(serviceWorkerTimings) {} addServiceWorkerTimings() {}
onAuthPrompt(authDetails, authCallbacks) { onAuthPrompt(authDetails, authCallbacks) {
this.#emitAuthRequired(authCallbacks); this.#emitAuthRequired(authCallbacks);

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

@ -271,7 +271,7 @@ export class MessageHandler extends EventEmitter {
* @param {Array<SessionDataItem>} sessionDataItems * @param {Array<SessionDataItem>} sessionDataItems
* Initial session data items for this MessageHandler. * Initial session data items for this MessageHandler.
*/ */
async initialize(sessionDataItems) {} async initialize() {}
/** /**
* Returns the module path corresponding to this MessageHandler class. * Returns the module path corresponding to this MessageHandler class.
@ -297,7 +297,7 @@ export class MessageHandler extends EventEmitter {
* *
* Needs to be implemented in the sub class. * Needs to be implemented in the sub class.
*/ */
static getIdFromContext(context) { static getIdFromContext() {
throw new Error("Not implemented"); throw new Error("Not implemented");
} }
@ -306,7 +306,7 @@ export class MessageHandler extends EventEmitter {
* *
* Needs to be implemented in the sub class. * Needs to be implemented in the sub class.
*/ */
forwardCommand(command) { forwardCommand() {
throw new Error("Not implemented"); throw new Error("Not implemented");
} }
@ -316,7 +316,7 @@ export class MessageHandler extends EventEmitter {
* *
* Needs to be implemented in the sub class. * Needs to be implemented in the sub class.
*/ */
matchesContext(contextDescriptor) { matchesContext() {
throw new Error("Not implemented"); throw new Error("Not implemented");
} }

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

@ -66,7 +66,7 @@ export class Module {
* @returns {object} * @returns {object}
* The modified event payload. * The modified event payload.
*/ */
interceptEvent(name, payload) { interceptEvent(name) {
throw new Error( throw new Error(
`Could not intercept event ${name}, interceptEvent is not implemented in windowglobal-in-root module` `Could not intercept event ${name}, interceptEvent is not implemented in windowglobal-in-root module`
); );

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

@ -51,7 +51,7 @@ export class RootMessageHandler extends MessageHandler {
* The ROOT MessageHandler is unique for a given MessageHandler network * The ROOT MessageHandler is unique for a given MessageHandler network
* (ie for a given sessionId). Reuse the type as context id here. * (ie for a given sessionId). Reuse the type as context id here.
*/ */
static getIdFromContext(context) { static getIdFromContext() {
return RootMessageHandler.type; return RootMessageHandler.type;
} }

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

@ -27,7 +27,7 @@ class RetryModule extends Module {
// processes. // processes.
const uri = this.messageHandler.window.document.baseURI; const uri = this.messageHandler.window.document.baseURI;
if (!uri.includes("example.net")) { if (!uri.includes("example.net")) {
await new Promise(r => {}); await new Promise(() => {});
} }
return { ...params }; return { ...params };
@ -37,7 +37,7 @@ class RetryModule extends Module {
async blockedOneTime(params) { async blockedOneTime(params) {
callsToBlockedOneTime++; callsToBlockedOneTime++;
if (callsToBlockedOneTime < 2) { if (callsToBlockedOneTime < 2) {
await new Promise(r => {}); await new Promise(() => {});
} }
// Return: // Return:
@ -51,7 +51,7 @@ class RetryModule extends Module {
async blockedTenTimes(params) { async blockedTenTimes(params) {
callsToBlockedTenTimes++; callsToBlockedTenTimes++;
if (callsToBlockedTenTimes < 11) { if (callsToBlockedTenTimes < 11) {
await new Promise(r => {}); await new Promise(() => {});
} }
// Return: // Return:
@ -65,7 +65,7 @@ class RetryModule extends Module {
async blockedElevenTimes(params) { async blockedElevenTimes(params) {
callsToBlockedElevenTimes++; callsToBlockedElevenTimes++;
if (callsToBlockedElevenTimes < 12) { if (callsToBlockedElevenTimes < 12) {
await new Promise(r => {}); await new Promise(() => {});
} }
// Return: // Return:

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

@ -17,7 +17,7 @@ class WindowGlobalToRootModule extends Module {
* Commands * Commands
*/ */
testHandleCommandToRoot(params, destination) { testHandleCommandToRoot() {
return this.messageHandler.handleCommand({ return this.messageHandler.handleCommand({
moduleName: "windowglobaltoroot", moduleName: "windowglobaltoroot",
commandName: "getValueFromRoot", commandName: "getValueFromRoot",
@ -27,7 +27,7 @@ class WindowGlobalToRootModule extends Module {
}); });
} }
testSendRootCommand(params, destination) { testSendRootCommand() {
return this.messageHandler.sendRootCommand({ return this.messageHandler.sendRootCommand({
moduleName: "windowglobaltoroot", moduleName: "windowglobaltoroot",
commandName: "getValueFromRoot", commandName: "getValueFromRoot",

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

@ -50,14 +50,14 @@ class MockElement {
} }
} }
dispatchEvent(event) { dispatchEvent() {
if (this.wantUntrusted) { if (this.wantUntrusted) {
this.untrusted = true; this.untrusted = true;
} }
this.click(); this.click();
} }
removeEventListener(name, func) { removeEventListener() {
this.capture = false; this.capture = false;
this.eventName = null; this.eventName = null;
this.func = null; this.func = null;
@ -213,12 +213,12 @@ add_task(async function test_EventPromise_checkFnCallback() {
{ checkFn: null, expected_count: 0 }, { checkFn: null, expected_count: 0 },
{ checkFn: undefined, expected_count: 0 }, { checkFn: undefined, expected_count: 0 },
{ {
checkFn: event => { checkFn: () => {
throw new Error("foo"); throw new Error("foo");
}, },
expected_count: 0, expected_count: 0,
}, },
{ checkFn: event => count++ > 0, expected_count: 2 }, { checkFn: () => count++ > 0, expected_count: 2 },
]; ];
for (const { checkFn, expected_count } of data) { for (const { checkFn, expected_count } of data) {
@ -417,7 +417,7 @@ add_task(async function test_PollPromise_resolve() {
const timeout = 100; const timeout = 100;
await new PollPromise( await new PollPromise(
(resolve, reject) => { resolve => {
resolve(); resolve();
}, },
{ timeout, errorMessage } { timeout, errorMessage }

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

@ -512,7 +512,7 @@ class Origin {
* @param {InputSource} inputSource - State of current input device. * @param {InputSource} inputSource - State of current input device.
* @param {WindowProxy} win - Current window global * @param {WindowProxy} win - Current window global
*/ */
getOriginCoordinates(inputSource, win) { getOriginCoordinates() {
throw new Error( throw new Error(
`originCoordinates not defined for ${this.constructor.name}` `originCoordinates not defined for ${this.constructor.name}`
); );
@ -559,13 +559,13 @@ class Origin {
} }
class ViewportOrigin extends Origin { class ViewportOrigin extends Origin {
getOriginCoordinates(inputSource, win) { getOriginCoordinates() {
return { x: 0, y: 0 }; return { x: 0, y: 0 };
} }
} }
class PointerOrigin extends Origin { class PointerOrigin extends Origin {
getOriginCoordinates(inputSource, win) { getOriginCoordinates(inputSource) {
return { x: inputSource.x, y: inputSource.y }; return { x: inputSource.x, y: inputSource.y };
} }
} }
@ -630,7 +630,7 @@ class Action {
* @param {WindowProxy} win - Current window global. * @param {WindowProxy} win - Current window global.
* @returns {Promise} - Promise that is resolved once the action is complete. * @returns {Promise} - Promise that is resolved once the action is complete.
*/ */
dispatch(state, inputSource, tickDuration, win) { dispatch() {
throw new Error( throw new Error(
`Action subclass ${this.constructor.name} must override dispatch()` `Action subclass ${this.constructor.name} must override dispatch()`
); );
@ -711,7 +711,7 @@ class PauseAction extends NullAction {
* @param {WindowProxy} win - Current window global. * @param {WindowProxy} win - Current window global.
* @returns {Promise} - Promise that is resolved once the action is complete. * @returns {Promise} - Promise that is resolved once the action is complete.
*/ */
dispatch(state, inputSource, tickDuration, win) { dispatch(state, inputSource, tickDuration) {
const ms = this.duration ?? tickDuration; const ms = this.duration ?? tickDuration;
lazy.logger.trace( lazy.logger.trace(
@ -1424,7 +1424,7 @@ class TouchActionGroup {
* @param {WindowProxy} win - Current window global. * @param {WindowProxy} win - Current window global.
* @returns {Promise} - Promise that is resolved once the action is complete. * @returns {Promise} - Promise that is resolved once the action is complete.
*/ */
dispatch(state, inputSource, tickDuration, win) { dispatch() {
throw new Error( throw new Error(
"TouchActionGroup subclass missing dispatch implementation" "TouchActionGroup subclass missing dispatch implementation"
); );
@ -1622,7 +1622,7 @@ class PointerMoveTouchActionGroup extends TouchActionGroup {
} }
); );
const reachedTarget = perPointerData.every( const reachedTarget = perPointerData.every(
([inputSource, action, target]) => ([inputSource, , target]) =>
target[0] === inputSource.x && target[1] === inputSource.y target[0] === inputSource.x && target[1] === inputSource.y
); );
@ -1784,7 +1784,7 @@ class Pointer {
* @param {Action} action - The Action object invoking the pointer * @param {Action} action - The Action object invoking the pointer
* @param {WindowProxy} win - Current window global. * @param {WindowProxy} win - Current window global.
*/ */
pointerDown(state, inputSource, action, win) { pointerDown() {
throw new Error(`Unimplemented pointerDown for pointerType ${this.type}`); throw new Error(`Unimplemented pointerDown for pointerType ${this.type}`);
} }
@ -1796,7 +1796,7 @@ class Pointer {
* @param {Action} action - The Action object invoking the pointer * @param {Action} action - The Action object invoking the pointer
* @param {WindowProxy} win - Current window global. * @param {WindowProxy} win - Current window global.
*/ */
pointerUp(state, inputSource, action, win) { pointerUp() {
throw new Error(`Unimplemented pointerUp for pointerType ${this.type}`); throw new Error(`Unimplemented pointerUp for pointerType ${this.type}`);
} }
@ -1809,7 +1809,7 @@ class Pointer {
* @param {number} targetY - Target Y coordinate of the pointer move * @param {number} targetY - Target Y coordinate of the pointer move
* @param {WindowProxy} win - Current window global. * @param {WindowProxy} win - Current window global.
*/ */
pointerMove(state, inputSource, targetX, targetY, win) { pointerMove() {
throw new Error(`Unimplemented pointerMove for pointerType ${this.type}`); throw new Error(`Unimplemented pointerMove for pointerType ${this.type}`);
} }
@ -2142,7 +2142,7 @@ class InputEventData {
* @param {State} state - Actions state. * @param {State} state - Actions state.
* @param {InputSource} inputSource - State of the current input device. * @param {InputSource} inputSource - State of the current input device.
*/ */
update(state, inputSource) {} update() {}
toString() { toString() {
return `${this.constructor.name} ${JSON.stringify(this)}`; return `${this.constructor.name} ${JSON.stringify(this)}`;

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

@ -17,7 +17,7 @@ class BrowsingContextObserver {
this.actor = actor; this.actor = actor;
} }
async observe(subject, topic, data) { async observe(subject, topic) {
if (topic === "browsing-context-discarded") { if (topic === "browsing-context-discarded") {
this.actor.cleanUp({ browsingContext: subject }); this.actor.cleanUp({ browsingContext: subject });
} }