diff options
Diffstat (limited to 'dom/push/test')
48 files changed, 95 insertions, 100 deletions
diff --git a/dom/push/test/lifetime_worker.js b/dom/push/test/lifetime_worker.js index 02c09d966e..251a4a2bee 100644 --- a/dom/push/test/lifetime_worker.js +++ b/dom/push/test/lifetime_worker.js @@ -20,7 +20,7 @@ self.onfetch = function (event) { state = "update"; } else if (event.request.url.includes("wait")) { event.respondWith( - new Promise(function (res, rej) { + new Promise(function (res) { if (resolvePromiseCallback) { dump("ERROR: service worker was already waiting on a promise.\n"); } @@ -50,7 +50,7 @@ self.onmessage = function (event) { state = event.data; if (state === "wait") { event.waitUntil( - new Promise(function (res, rej) { + new Promise(function (res) { if (resolvePromiseCallback) { dump("ERROR: service worker was already waiting on a promise.\n"); } diff --git a/dom/push/test/mockpushserviceparent.js b/dom/push/test/mockpushserviceparent.js index 08d93f3aaf..7553b81876 100644 --- a/dom/push/test/mockpushserviceparent.js +++ b/dom/push/test/mockpushserviceparent.js @@ -85,7 +85,7 @@ addMessageListener("socket-setup", function () { }); }); -addMessageListener("socket-teardown", function (msg) { +addMessageListener("socket-teardown", function () { pushService .restoreServiceBackend() .then(_ => { diff --git a/dom/push/test/test_data.html b/dom/push/test/test_data.html index a2f043b7d9..0fad066cb7 100644 --- a/dom/push/test/test_data.html +++ b/dom/push/test/test_data.html @@ -154,7 +154,7 @@ http://creativecommons.org/licenses/publicdomain/ is(message.data.text, "Hi! \ud83d\udc40", "Wrong text for message with emoji"); var text = await new Promise((resolve, reject) => { var reader = new FileReader(); - reader.onloadend = event => { + reader.onloadend = () => { if (reader.error) { reject(reader.error); } else { diff --git a/dom/push/test/test_has_permissions.html b/dom/push/test/test_has_permissions.html index 0bef8fe19f..b66a9d4746 100644 --- a/dom/push/test/test_has_permissions.html +++ b/dom/push/test/test_has_permissions.html @@ -23,7 +23,7 @@ http://creativecommons.org/licenses/publicdomain/ </pre> <script class="testbody" type="text/javascript"> - function debug(str) { + function debug() { // console.log(str + "\n"); } diff --git a/dom/push/test/test_multiple_register.html b/dom/push/test/test_multiple_register.html index 3a963b7cd4..8073e0ccbf 100644 --- a/dom/push/test/test_multiple_register.html +++ b/dom/push/test/test_multiple_register.html @@ -23,7 +23,7 @@ http://creativecommons.org/licenses/publicdomain/ </pre> <script class="testbody" type="text/javascript"> - function debug(str) { + function debug() { // console.log(str + "\n"); } @@ -46,12 +46,12 @@ http://creativecommons.org/licenses/publicdomain/ } function setupPushNotification(swr) { - var p = new Promise(function(res, rej) { + var p = new Promise(function(res) { swr.pushManager.subscribe().then( function(pushSubscription) { ok(true, "successful registered for push notification"); res({swr, pushSubscription}); - }, function(error) { + }, function() { ok(false, "could not register for push notification"); res(null); } @@ -61,12 +61,12 @@ http://creativecommons.org/licenses/publicdomain/ } function setupSecondEndpoint(result) { - var p = new Promise(function(res, rej) { + var p = new Promise(function(res) { result.swr.pushManager.subscribe().then( function(pushSubscription) { ok(result.pushSubscription.endpoint == pushSubscription.endpoint, "setupSecondEndpoint - Got the same endpoint back."); res(result); - }, function(error) { + }, function() { ok(false, "could not register for push notification"); res(null); } @@ -76,12 +76,12 @@ http://creativecommons.org/licenses/publicdomain/ } function getEndpointExpectNull(swr) { - var p = new Promise(function(res, rej) { + var p = new Promise(function(res) { swr.pushManager.getSubscription().then( function(pushSubscription) { ok(pushSubscription == null, "getEndpoint should return null when app not subscribed."); res(swr); - }, function(error) { + }, function() { ok(false, "could not register for push notification"); res(null); } @@ -91,13 +91,13 @@ http://creativecommons.org/licenses/publicdomain/ } function getEndpoint(result) { - var p = new Promise(function(res, rej) { + var p = new Promise(function(res) { result.swr.pushManager.getSubscription().then( function(pushSubscription) { ok(result.pushSubscription.endpoint == pushSubscription.endpoint, "getEndpoint - Got the same endpoint back."); res(pushSubscription); - }, function(error) { + }, function() { ok(false, "could not register for push notification"); res(null); } diff --git a/dom/push/test/test_multiple_register_different_scope.html b/dom/push/test/test_multiple_register_different_scope.html index b7c5bf1414..34cef0b015 100644 --- a/dom/push/test/test_multiple_register_different_scope.html +++ b/dom/push/test/test_multiple_register_different_scope.html @@ -26,7 +26,7 @@ http://creativecommons.org/licenses/publicdomain/ var scopeA = "./a/"; var scopeB = "./b/"; - function debug(str) { + function debug() { // console.log(str + "\n"); } diff --git a/dom/push/test/test_multiple_register_during_service_activation.html b/dom/push/test/test_multiple_register_during_service_activation.html index be043a523e..fcce74affb 100644 --- a/dom/push/test/test_multiple_register_during_service_activation.html +++ b/dom/push/test/test_multiple_register_during_service_activation.html @@ -25,7 +25,7 @@ http://creativecommons.org/licenses/publicdomain/ </pre> <script class="testbody" type="text/javascript"> - function debug(str) { + function debug() { // console.log(str + "\n"); } diff --git a/dom/push/test/test_permissions.html b/dom/push/test/test_permissions.html index 442cfe4a09..4562175b5c 100644 --- a/dom/push/test/test_permissions.html +++ b/dom/push/test/test_permissions.html @@ -23,7 +23,7 @@ http://creativecommons.org/licenses/publicdomain/ </pre> <script class="testbody" type="text/javascript"> - function debug(str) { + function debug() { // console.log(str + "\n"); } diff --git a/dom/push/test/test_register.html b/dom/push/test/test_register.html index 541e4a2d8d..c5800d328c 100644 --- a/dom/push/test/test_register.html +++ b/dom/push/test/test_register.html @@ -23,7 +23,7 @@ http://creativecommons.org/licenses/publicdomain/ </pre> <script class="testbody" type="text/javascript"> - function debug(str) { + function debug() { // console.log(str + "\n"); } diff --git a/dom/push/test/test_register_key.html b/dom/push/test/test_register_key.html index b3e7570770..ba216d24dc 100644 --- a/dom/push/test/test_register_key.html +++ b/dom/push/test/test_register_key.html @@ -58,7 +58,7 @@ http://creativecommons.org/licenses/publicdomain/ }; }, - registration(pageRecord) { + registration() { return { endpoint: "https://example.com/push/subWithKey", appServerKey: testKey, diff --git a/dom/push/test/test_serviceworker_lifetime.html b/dom/push/test/test_serviceworker_lifetime.html index 30f191a119..c8098e1728 100644 --- a/dom/push/test/test_serviceworker_lifetime.html +++ b/dom/push/test/test_serviceworker_lifetime.html @@ -42,7 +42,7 @@ } function waitForActiveServiceWorker(ctx) { - return waitForActive(ctx.registration).then(function(result) { + return waitForActive(ctx.registration).then(function() { ok(ctx.registration.active, "Service Worker is active"); return ctx; }); @@ -57,13 +57,13 @@ } function registerPushNotification(ctx) { - var p = new Promise(function(res, rej) { + var p = new Promise(function(res) { ctx.registration.pushManager.subscribe().then( function(pushSubscription) { ok(true, "successful registered for push notification"); ctx.subscription = pushSubscription; res(ctx); - }, function(error) { + }, function() { ok(false, "could not register for push notification"); res(ctx); }); @@ -103,7 +103,7 @@ } function createIframe(ctx) { - var p = new Promise(function(res, rej) { + var p = new Promise(function(res) { var iframe = document.createElement("iframe"); // This file doesn't exist, the service worker will give us an empty // document. @@ -120,7 +120,7 @@ function closeIframe(ctx) { ctx.iframe.remove(); - return new Promise(function(res, rej) { + return new Promise(function(res) { // XXXcatalinb: give the worker more time to "notice" it stopped // controlling documents ctx.iframe = null; @@ -135,7 +135,7 @@ this.navigator.serviceWorker.onmessage = null; resolve(); } - return new Promise(function(res, rej) { + return new Promise(function(res) { contentWindow.navigator.serviceWorker.onmessage = checkMessage.bind(contentWindow, expected, res); }); @@ -148,7 +148,7 @@ return p; } - function pushEvent(ctx, expected_state, new_state) { + function pushEvent(ctx, expected_state) { var expected = {type: "push", state: expected_state}; var p = waitAndCheckMessage(ctx.iframe.contentWindow, expected); sendPushToPushServer(ctx.subscription.endpoint); @@ -184,9 +184,9 @@ return function(ctx) { cancelShutdownObserver(ctx); - ctx.observer_promise = new Promise(function(res, rej) { + ctx.observer_promise = new Promise(function(res) { ctx.observer = { - observe(subject, topic, data) { + observe(subject, topic) { ok((topic == shutdownTopic) && expectingEvent, "Service worker was terminated."); this.remove(ctx); }, @@ -217,7 +217,7 @@ function subTest(test) { return function(ctx) { - return new Promise(function(res, rej) { + return new Promise(function(res) { function run() { test.steps(ctx).catch(function(e) { ok(false, "Some test failed with error: " + e); @@ -322,7 +322,7 @@ ["dom.serviceWorkers.idle_extended_timeout", 0], ], steps(context) { - return new Promise(function(res, rej) { + return new Promise(function(res) { context.iframe.contentWindow.navigator.serviceWorker.controller.postMessage("ping"); res(context); }); diff --git a/dom/push/test/test_try_registering_offline_disabled.html b/dom/push/test/test_try_registering_offline_disabled.html index d993e73e60..db65c79ce6 100644 --- a/dom/push/test/test_try_registering_offline_disabled.html +++ b/dom/push/test/test_try_registering_offline_disabled.html @@ -23,7 +23,7 @@ http://creativecommons.org/licenses/publicdomain/ </pre> <script class="testbody" type="text/javascript"> - function debug(str) { + function debug() { // console.log(str + "\n"); } @@ -54,12 +54,12 @@ http://creativecommons.org/licenses/publicdomain/ } function subscribeFail(swr) { - return new Promise((res, rej) => { + return new Promise((res) => { swr.pushManager.subscribe() - .then(sub => { + .then(() => { ok(false, "successful registered for push notification"); throw new Error("Should fail"); - }, err => { + }, () => { ok(true, "could not register for push notification"); res(swr); }); @@ -118,7 +118,7 @@ http://creativecommons.org/licenses/publicdomain/ }; function changeOfflineState(offline) { - return new Promise(function(res, rej) { + return new Promise(function(res) { // eslint-disable-next-line mozilla/use-services const obsService = SpecialPowers.Cc["@mozilla.org/observer-service;1"] .getService(SpecialPowers.Ci.nsIObserverService); diff --git a/dom/push/test/test_utils.js b/dom/push/test/test_utils.js index 0214318d09..5ecda2bd96 100644 --- a/dom/push/test/test_utils.js +++ b/dom/push/test/test_utils.js @@ -98,7 +98,7 @@ class MockWebSocket { this._isActive = false; } - onHello(request) { + onHello() { this.serverSendMsg( JSON.stringify({ messageType: "hello", @@ -131,7 +131,7 @@ class MockWebSocket { ); } - onAck(request) { + onAck() { // Do nothing. } @@ -222,7 +222,7 @@ function setupPrefsAndMockSocket(mockSocket) { } function injectControlledFrame(target = document.body) { - return new Promise(function (res, rej) { + return new Promise(function (res) { var iframe = document.createElement("iframe"); iframe.src = "/tests/dom/push/test/frame.html"; @@ -266,7 +266,7 @@ function waitForActive(swr) { resolve(swr); return; } - sw.addEventListener("statechange", function onStateChange(evt) { + sw.addEventListener("statechange", function onStateChange() { if (sw.state === "activated") { sw.removeEventListener("statechange", onStateChange); resolve(swr); diff --git a/dom/push/test/worker.js b/dom/push/test/worker.js index bcdbf0e0ad..f576ea3cf0 100644 --- a/dom/push/test/worker.js +++ b/dom/push/test/worker.js @@ -82,7 +82,7 @@ function handlePush(event) { } var testHandlers = { - publicKey(data) { + publicKey() { return self.registration.pushManager .getSubscription() .then(subscription => ({ @@ -116,7 +116,7 @@ var testHandlers = { }); }, - denySubscribe(data) { + denySubscribe() { return self.registration.pushManager .getSubscription() .then(subscription => { diff --git a/dom/push/test/xpcshell/broadcast_handler.sys.mjs b/dom/push/test/xpcshell/broadcast_handler.sys.mjs index eecf220a6f..f1f5a0fa89 100644 --- a/dom/push/test/xpcshell/broadcast_handler.sys.mjs +++ b/dom/push/test/xpcshell/broadcast_handler.sys.mjs @@ -2,7 +2,7 @@ export var broadcastHandler = { reset() { this.notifications = []; - this.wasNotified = new Promise((resolve, reject) => { + this.wasNotified = new Promise(resolve => { this.receivedBroadcastMessage = function () { resolve(); this.notifications.push(Array.from(arguments)); diff --git a/dom/push/test/xpcshell/head.js b/dom/push/test/xpcshell/head.js index da50ee3c5c..926d523201 100644 --- a/dom/push/test/xpcshell/head.js +++ b/dom/push/test/xpcshell/head.js @@ -46,7 +46,7 @@ var isParent = Services.appinfo.processType == Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT; // Stop and clean up after the PushService. -Services.obs.addObserver(function observe(subject, topic, data) { +Services.obs.addObserver(function observe(subject, topic) { Services.obs.removeObserver(observe, topic); PushService.uninit(); // Occasionally, `profile-change-teardown` and `xpcom-shutdown` will fire @@ -107,7 +107,7 @@ function waterfall(...callbacks) { * @returns {Promise} A promise that fulfills when the notification is fired. */ function promiseObserverNotification(topic, matchFunc) { - return new Promise((resolve, reject) => { + return new Promise(resolve => { Services.obs.addObserver(function observe(subject, aTopic, data) { let matches = typeof matchFunc != "function" || matchFunc(subject, data); if (!matches) { @@ -305,7 +305,7 @@ MockWebSocket.prototype = { this._handleMessage(msg); }, - close(code, reason) { + close() { waterfall(() => this._listener.onStop(this._context, Cr.NS_OK)); }, @@ -413,7 +413,7 @@ var setUpServiceInParent = async function (service, db) { }), makeWebSocket(uri) { return new MockWebSocket(uri, { - onHello(request) { + onHello() { this.serverSendMsg( JSON.stringify({ messageType: "hello", diff --git a/dom/push/test/xpcshell/test_broadcast_success.js b/dom/push/test/xpcshell/test_broadcast_success.js index 16f586081b..1f4c8b4a42 100644 --- a/dom/push/test/xpcshell/test_broadcast_success.js +++ b/dom/push/test/xpcshell/test_broadcast_success.js @@ -189,7 +189,7 @@ add_task(async function test_handle_hello_broadcasts() { ); }, - onBroadcastSubscribe(data) {}, + onBroadcastSubscribe() {}, }); }, }); @@ -239,7 +239,7 @@ add_task(async function test_broadcast_context() { db, makeWebSocket(uri) { return new MockWebSocket(uri, { - onHello(data) {}, + onHello() {}, }); }, }); diff --git a/dom/push/test/xpcshell/test_clearAll_successful.js b/dom/push/test/xpcshell/test_clearAll_successful.js index a638fffaaf..7a919c3b23 100644 --- a/dom/push/test/xpcshell/test_clearAll_successful.js +++ b/dom/push/test/xpcshell/test_clearAll_successful.js @@ -7,7 +7,7 @@ var db; var unregisterDefers = {}; var userAgentID = "4ce480ef-55b2-4f83-924c-dcd35ab978b4"; -function promiseUnregister(keyID, code) { +function promiseUnregister(keyID) { return new Promise(r => (unregisterDefers[keyID] = r)); } @@ -41,7 +41,7 @@ add_task(async function setup() { db, makeWebSocket(uri) { return new MockWebSocket(uri, { - onHello(request) { + onHello() { this.serverSendMsg( JSON.stringify({ messageType: "hello", diff --git a/dom/push/test/xpcshell/test_clear_forgetAboutSite.js b/dom/push/test/xpcshell/test_clear_forgetAboutSite.js index 27ae57af25..5bb385969e 100644 --- a/dom/push/test/xpcshell/test_clear_forgetAboutSite.js +++ b/dom/push/test/xpcshell/test_clear_forgetAboutSite.js @@ -79,7 +79,7 @@ add_task(async function setup() { db, makeWebSocket(uri) { return new MockWebSocket(uri, { - onHello(request) { + onHello() { this.serverSendMsg( JSON.stringify({ messageType: "hello", diff --git a/dom/push/test/xpcshell/test_clear_origin_data.js b/dom/push/test/xpcshell/test_clear_origin_data.js index 7c743148a6..fe42031df3 100644 --- a/dom/push/test/xpcshell/test_clear_origin_data.js +++ b/dom/push/test/xpcshell/test_clear_origin_data.js @@ -59,11 +59,6 @@ add_task(async function test_webapps_cleardata() { originAttributes: {}, clearIf: { inIsolatedMozBrowser: false }, }, - { - scope: "https://example.org/1", - originAttributes: { inIsolatedMozBrowser: true }, - clearIf: {}, - }, ]; let unregisterDone; diff --git a/dom/push/test/xpcshell/test_drop_expired.js b/dom/push/test/xpcshell/test_drop_expired.js index 823049c21f..b933919516 100644 --- a/dom/push/test/xpcshell/test_drop_expired.js +++ b/dom/push/test/xpcshell/test_drop_expired.js @@ -111,7 +111,7 @@ add_task(async function setUp() { db, makeWebSocket(uri) { return new MockWebSocket(uri, { - onHello(request) { + onHello() { this.serverSendMsg( JSON.stringify({ messageType: "hello", diff --git a/dom/push/test/xpcshell/test_notification_duplicate.js b/dom/push/test/xpcshell/test_notification_duplicate.js index 9812b63149..039437060f 100644 --- a/dom/push/test/xpcshell/test_notification_duplicate.js +++ b/dom/push/test/xpcshell/test_notification_duplicate.js @@ -116,7 +116,7 @@ add_task(async function test_notification_duplicate() { db, makeWebSocket(uri) { return new MockWebSocket(uri, { - onHello(request) { + onHello() { this.serverSendMsg( JSON.stringify({ messageType: "hello", diff --git a/dom/push/test/xpcshell/test_notification_error.js b/dom/push/test/xpcshell/test_notification_error.js index 21ab7ab94f..f50b58e1ef 100644 --- a/dom/push/test/xpcshell/test_notification_error.js +++ b/dom/push/test/xpcshell/test_notification_error.js @@ -75,7 +75,7 @@ add_task(async function test_notification_error() { }), makeWebSocket(uri) { return new MockWebSocket(uri, { - onHello(request) { + onHello() { this.serverSendMsg( JSON.stringify({ messageType: "hello", diff --git a/dom/push/test/xpcshell/test_notification_incomplete.js b/dom/push/test/xpcshell/test_notification_incomplete.js index 48aba51132..ee94b44316 100644 --- a/dom/push/test/xpcshell/test_notification_incomplete.js +++ b/dom/push/test/xpcshell/test_notification_incomplete.js @@ -56,7 +56,7 @@ add_task(async function test_notification_incomplete() { await db.put(record); } - function observeMessage(subject, topic, data) { + function observeMessage() { ok(false, "Should not deliver malformed updates"); } registerCleanupFunction(() => @@ -79,7 +79,7 @@ add_task(async function test_notification_incomplete() { db, makeWebSocket(uri) { return new MockWebSocket(uri, { - onHello(request) { + onHello() { this.serverSendMsg( JSON.stringify({ messageType: "hello", diff --git a/dom/push/test/xpcshell/test_notification_version_string.js b/dom/push/test/xpcshell/test_notification_version_string.js index 7aaaee5269..f0c10c8fc9 100644 --- a/dom/push/test/xpcshell/test_notification_version_string.js +++ b/dom/push/test/xpcshell/test_notification_version_string.js @@ -39,7 +39,7 @@ add_task(async function test_notification_version_string() { db, makeWebSocket(uri) { return new MockWebSocket(uri, { - onHello(request) { + onHello() { this.serverSendMsg( JSON.stringify({ messageType: "hello", diff --git a/dom/push/test/xpcshell/test_permissions.js b/dom/push/test/xpcshell/test_permissions.js index 1b3e3282bb..c9e027e3d8 100644 --- a/dom/push/test/xpcshell/test_permissions.js +++ b/dom/push/test/xpcshell/test_permissions.js @@ -117,7 +117,7 @@ add_task(async function setUp() { db, makeWebSocket(uri) { return new MockWebSocket(uri, { - onHello(request) { + onHello() { this.serverSendMsg( JSON.stringify({ messageType: "hello", @@ -149,7 +149,7 @@ add_task(async function setUp() { }) ); }, - onACK(request) {}, + onACK() {}, }); }, }); diff --git a/dom/push/test/xpcshell/test_quota_exceeded.js b/dom/push/test/xpcshell/test_quota_exceeded.js index f8365aa888..d802871550 100644 --- a/dom/push/test/xpcshell/test_quota_exceeded.js +++ b/dom/push/test/xpcshell/test_quota_exceeded.js @@ -77,7 +77,7 @@ add_task(async function test_expiration_origin_threshold() { let updates = 0; let notifyPromise = promiseObserverNotification( PushServiceComponent.pushTopic, - (subject, data) => { + () => { updates++; return updates == 6; } @@ -91,7 +91,7 @@ add_task(async function test_expiration_origin_threshold() { db, makeWebSocket(uri) { return new MockWebSocket(uri, { - onHello(request) { + onHello() { this.serverSendMsg( JSON.stringify({ messageType: "hello", @@ -140,7 +140,7 @@ add_task(async function test_expiration_origin_threshold() { }, // We expect to receive acks, but don't care about their // contents. - onACK(request) {}, + onACK() {}, }); }, }); diff --git a/dom/push/test/xpcshell/test_quota_observer.js b/dom/push/test/xpcshell/test_quota_observer.js index 447f509967..aafc5fa17e 100644 --- a/dom/push/test/xpcshell/test_quota_observer.js +++ b/dom/push/test/xpcshell/test_quota_observer.js @@ -77,7 +77,7 @@ add_task(async function test_expiration_history_observer() { db, makeWebSocket(uri) { return new MockWebSocket(uri, { - onHello(request) { + onHello() { this.serverSendMsg( JSON.stringify({ messageType: "hello", @@ -106,7 +106,7 @@ add_task(async function test_expiration_history_observer() { equal(request.code, 201, "Expected quota exceeded unregister reason"); unregisterDone(); }, - onACK(request) {}, + onACK() {}, }); }, }); diff --git a/dom/push/test/xpcshell/test_quota_with_notification.js b/dom/push/test/xpcshell/test_quota_with_notification.js index d2e6d7cae8..015033c505 100644 --- a/dom/push/test/xpcshell/test_quota_with_notification.js +++ b/dom/push/test/xpcshell/test_quota_with_notification.js @@ -50,7 +50,7 @@ add_task(async function test_expiration_origin_threshold() { let updates = 0; let notifyPromise = promiseObserverNotification( PushServiceComponent.pushTopic, - (subject, data) => { + () => { updates++; return updates == numMessages; } @@ -59,7 +59,7 @@ add_task(async function test_expiration_origin_threshold() { let modifications = 0; let modifiedPromise = promiseObserverNotification( PushServiceComponent.subscriptionModifiedTopic, - (subject, data) => { + () => { // Each subscription should be modified twice: once to update the message // count and last push time, and the second time to update the quota. modifications++; @@ -67,7 +67,7 @@ add_task(async function test_expiration_origin_threshold() { } ); - let updateQuotaPromise = new Promise((resolve, reject) => { + let updateQuotaPromise = new Promise(resolve => { let quotaUpdateCount = 0; PushService._updateQuotaTestCallback = function () { quotaUpdateCount++; @@ -82,7 +82,7 @@ add_task(async function test_expiration_origin_threshold() { db, makeWebSocket(uri) { return new MockWebSocket(uri, { - onHello(request) { + onHello() { this.serverSendMsg( JSON.stringify({ messageType: "hello", @@ -107,12 +107,12 @@ add_task(async function test_expiration_origin_threshold() { ); } }, - onUnregister(request) { + onUnregister() { ok(false, "Channel should not be unregistered."); }, // We expect to receive acks, but don't care about their // contents. - onACK(request) {}, + onACK() {}, }); }, }); diff --git a/dom/push/test/xpcshell/test_reconnect_retry.js b/dom/push/test/xpcshell/test_reconnect_retry.js index 7ff3740ee8..9350781e8e 100644 --- a/dom/push/test/xpcshell/test_reconnect_retry.js +++ b/dom/push/test/xpcshell/test_reconnect_retry.js @@ -25,7 +25,7 @@ add_task(async function test_reconnect_retry() { db, makeWebSocket(uri) { return new MockWebSocket(uri, { - onHello(request) { + onHello() { this.serverSendMsg( JSON.stringify({ messageType: "hello", diff --git a/dom/push/test/xpcshell/test_register_case.js b/dom/push/test/xpcshell/test_register_case.js index 1ae6f127f3..f70d2f3f84 100644 --- a/dom/push/test/xpcshell/test_register_case.js +++ b/dom/push/test/xpcshell/test_register_case.js @@ -22,7 +22,7 @@ add_task(async function test_register_case() { db, makeWebSocket(uri) { return new MockWebSocket(uri, { - onHello(request) { + onHello() { this.serverSendMsg( JSON.stringify({ messageType: "HELLO", diff --git a/dom/push/test/xpcshell/test_register_flush.js b/dom/push/test/xpcshell/test_register_flush.js index 2c12ecb9ba..132f2d029d 100644 --- a/dom/push/test/xpcshell/test_register_flush.js +++ b/dom/push/test/xpcshell/test_register_flush.js @@ -42,7 +42,7 @@ add_task(async function test_register_flush() { db, makeWebSocket(uri) { return new MockWebSocket(uri, { - onHello(request) { + onHello() { this.serverSendMsg( JSON.stringify({ messageType: "hello", diff --git a/dom/push/test/xpcshell/test_register_invalid_channel.js b/dom/push/test/xpcshell/test_register_invalid_channel.js index 0f1b6cf1b1..93b91ab29a 100644 --- a/dom/push/test/xpcshell/test_register_invalid_channel.js +++ b/dom/push/test/xpcshell/test_register_invalid_channel.js @@ -24,7 +24,7 @@ add_task(async function test_register_invalid_channel() { db, makeWebSocket(uri) { return new MockWebSocket(uri, { - onHello(request) { + onHello() { this.serverSendMsg( JSON.stringify({ messageType: "hello", @@ -33,7 +33,7 @@ add_task(async function test_register_invalid_channel() { }) ); }, - onRegister(request) { + onRegister() { this.serverSendMsg( JSON.stringify({ messageType: "register", diff --git a/dom/push/test/xpcshell/test_register_invalid_endpoint.js b/dom/push/test/xpcshell/test_register_invalid_endpoint.js index 64398b97f8..1f4f6e0023 100644 --- a/dom/push/test/xpcshell/test_register_invalid_endpoint.js +++ b/dom/push/test/xpcshell/test_register_invalid_endpoint.js @@ -24,7 +24,7 @@ add_task(async function test_register_invalid_endpoint() { db, makeWebSocket(uri) { return new MockWebSocket(uri, { - onHello(request) { + onHello() { this.serverSendMsg( JSON.stringify({ messageType: "hello", @@ -33,7 +33,7 @@ add_task(async function test_register_invalid_endpoint() { }) ); }, - onRegister(request) { + onRegister() { this.serverSendMsg( JSON.stringify({ messageType: "register", diff --git a/dom/push/test/xpcshell/test_register_invalid_json.js b/dom/push/test/xpcshell/test_register_invalid_json.js index d7a19e789c..38030f19a6 100644 --- a/dom/push/test/xpcshell/test_register_invalid_json.js +++ b/dom/push/test/xpcshell/test_register_invalid_json.js @@ -25,7 +25,7 @@ add_task(async function test_register_invalid_json() { serverURI: "wss://push.example.org/", makeWebSocket(uri) { return new MockWebSocket(uri, { - onHello(request) { + onHello() { this.serverSendMsg( JSON.stringify({ messageType: "hello", diff --git a/dom/push/test/xpcshell/test_register_no_id.js b/dom/push/test/xpcshell/test_register_no_id.js index 763350b11e..e58b29b60e 100644 --- a/dom/push/test/xpcshell/test_register_no_id.js +++ b/dom/push/test/xpcshell/test_register_no_id.js @@ -26,7 +26,7 @@ add_task(async function test_register_no_id() { serverURI: "wss://push.example.org/", makeWebSocket(uri) { return new MockWebSocket(uri, { - onHello(request) { + onHello() { this.serverSendMsg( JSON.stringify({ messageType: "hello", diff --git a/dom/push/test/xpcshell/test_register_request_queue.js b/dom/push/test/xpcshell/test_register_request_queue.js index 6d7928c52a..fbe44cb7ce 100644 --- a/dom/push/test/xpcshell/test_register_request_queue.js +++ b/dom/push/test/xpcshell/test_register_request_queue.js @@ -21,7 +21,7 @@ add_task(async function test_register_request_queue() { let onHello; let helloPromise = new Promise( resolve => - (onHello = after(2, function onHelloReceived(request) { + (onHello = after(2, function onHelloReceived() { this.serverSendMsg( JSON.stringify({ messageType: "hello", diff --git a/dom/push/test/xpcshell/test_register_rollback.js b/dom/push/test/xpcshell/test_register_rollback.js index 9a0233aca8..6ace051a9e 100644 --- a/dom/push/test/xpcshell/test_register_rollback.js +++ b/dom/push/test/xpcshell/test_register_rollback.js @@ -30,7 +30,7 @@ add_task(async function test_register_rollback() { PushService.init({ serverURI: "wss://push.example.org/", db: makeStub(db, { - put(prev, record) { + put() { return Promise.reject("universe has imploded"); }, }), diff --git a/dom/push/test/xpcshell/test_register_wrong_id.js b/dom/push/test/xpcshell/test_register_wrong_id.js index 674ce9f9ff..06dc73ee4f 100644 --- a/dom/push/test/xpcshell/test_register_wrong_id.js +++ b/dom/push/test/xpcshell/test_register_wrong_id.js @@ -28,7 +28,7 @@ add_task(async function test_register_wrong_id() { serverURI: "wss://push.example.org/", makeWebSocket(uri) { return new MockWebSocket(uri, { - onHello(request) { + onHello() { this.serverSendMsg( JSON.stringify({ messageType: "hello", diff --git a/dom/push/test/xpcshell/test_register_wrong_type.js b/dom/push/test/xpcshell/test_register_wrong_type.js index b3b9aaa927..f1fcf582bc 100644 --- a/dom/push/test/xpcshell/test_register_wrong_type.js +++ b/dom/push/test/xpcshell/test_register_wrong_type.js @@ -24,7 +24,7 @@ add_task(async function test_register_wrong_type() { serverURI: "wss://push.example.org/", makeWebSocket(uri) { return new MockWebSocket(uri, { - onHello(request) { + onHello() { this.serverSendMsg( JSON.stringify({ messageType: "hello", @@ -34,7 +34,7 @@ add_task(async function test_register_wrong_type() { ); helloDone(); }, - onRegister(request) { + onRegister() { registers++; this.serverSendMsg( JSON.stringify({ diff --git a/dom/push/test/xpcshell/test_registration_error.js b/dom/push/test/xpcshell/test_registration_error.js index cba22ddc1c..6e826181fe 100644 --- a/dom/push/test/xpcshell/test_registration_error.js +++ b/dom/push/test/xpcshell/test_registration_error.js @@ -20,7 +20,7 @@ add_task(async function test_registrations_error() { PushService.init({ serverURI: "wss://push.example.org/", db: makeStub(db, { - getByIdentifiers(prev, scope) { + getByIdentifiers() { return Promise.reject("Database error"); }, }), diff --git a/dom/push/test/xpcshell/test_retry_ws.js b/dom/push/test/xpcshell/test_retry_ws.js index 19df72acd3..87f9e7dba8 100644 --- a/dom/push/test/xpcshell/test_retry_ws.js +++ b/dom/push/test/xpcshell/test_retry_ws.js @@ -33,7 +33,7 @@ add_task(async function test_ws_retry() { // Use a mock timer to avoid waiting for the backoff interval. let reconnects = 0; PushServiceWebSocket._backoffTimer = { - init(observer, delay, type) { + init(observer, delay) { reconnects++; ok( delay >= 5 && delay <= 2000, @@ -51,7 +51,7 @@ add_task(async function test_ws_retry() { serverURI: "wss://push.example.org/", makeWebSocket(uri) { return new MockWebSocket(uri, { - onHello(request) { + onHello() { if (reconnects == 10) { this.serverSendMsg( JSON.stringify({ diff --git a/dom/push/test/xpcshell/test_service_child.js b/dom/push/test/xpcshell/test_service_child.js index a22f1f4d73..7e44cadd7c 100644 --- a/dom/push/test/xpcshell/test_service_child.js +++ b/dom/push/test/xpcshell/test_service_child.js @@ -108,7 +108,7 @@ add_test(function test_subscribeWithKey_success() { } ); }, - error => { + () => { ok(false, "Error generating app server key"); done(); } @@ -139,7 +139,7 @@ add_test(function test_subscribeWithKey_conflict() { } ); }, - error => { + () => { ok(false, "Error generating different app server key"); done(); } diff --git a/dom/push/test/xpcshell/test_unregister_empty_scope.js b/dom/push/test/xpcshell/test_unregister_empty_scope.js index b5b6109ddb..6663f7c6ad 100644 --- a/dom/push/test/xpcshell/test_unregister_empty_scope.js +++ b/dom/push/test/xpcshell/test_unregister_empty_scope.js @@ -16,7 +16,7 @@ add_task(async function test_unregister_empty_scope() { serverURI: "wss://push.example.org/", makeWebSocket(uri) { return new MockWebSocket(uri, { - onHello(request) { + onHello() { this.serverSendMsg( JSON.stringify({ messageType: "hello", diff --git a/dom/push/test/xpcshell/test_unregister_error.js b/dom/push/test/xpcshell/test_unregister_error.js index bc56dc49b4..4273379eda 100644 --- a/dom/push/test/xpcshell/test_unregister_error.js +++ b/dom/push/test/xpcshell/test_unregister_error.js @@ -32,7 +32,7 @@ add_task(async function test_unregister_error() { db, makeWebSocket(uri) { return new MockWebSocket(uri, { - onHello(request) { + onHello() { this.serverSendMsg( JSON.stringify({ messageType: "hello", diff --git a/dom/push/test/xpcshell/test_unregister_invalid_json.js b/dom/push/test/xpcshell/test_unregister_invalid_json.js index fa709c8eae..7cb7d0bada 100644 --- a/dom/push/test/xpcshell/test_unregister_invalid_json.js +++ b/dom/push/test/xpcshell/test_unregister_invalid_json.js @@ -51,7 +51,7 @@ add_task(async function test_unregister_invalid_json() { db, makeWebSocket(uri) { return new MockWebSocket(uri, { - onHello(request) { + onHello() { this.serverSendMsg( JSON.stringify({ messageType: "hello", @@ -61,7 +61,7 @@ add_task(async function test_unregister_invalid_json() { }) ); }, - onUnregister(request) { + onUnregister() { this.serverSendMsg(");alert(1);("); unregisterDone(); }, diff --git a/dom/push/test/xpcshell/test_unregister_not_found.js b/dom/push/test/xpcshell/test_unregister_not_found.js index a7693f3cf5..8694add393 100644 --- a/dom/push/test/xpcshell/test_unregister_not_found.js +++ b/dom/push/test/xpcshell/test_unregister_not_found.js @@ -14,7 +14,7 @@ add_task(async function test_unregister_not_found() { serverURI: "wss://push.example.org/", makeWebSocket(uri) { return new MockWebSocket(uri, { - onHello(request) { + onHello() { this.serverSendMsg( JSON.stringify({ messageType: "hello", diff --git a/dom/push/test/xpcshell/test_unregister_success.js b/dom/push/test/xpcshell/test_unregister_success.js index ccd0d31495..7064acd7d8 100644 --- a/dom/push/test/xpcshell/test_unregister_success.js +++ b/dom/push/test/xpcshell/test_unregister_success.js @@ -35,7 +35,7 @@ add_task(async function test_unregister_success() { db, makeWebSocket(uri) { return new MockWebSocket(uri, { - onHello(request) { + onHello() { this.serverSendMsg( JSON.stringify({ messageType: "hello", |