summaryrefslogtreecommitdiffstats
path: root/toolkit/components/url-classifier/tests
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/components/url-classifier/tests')
-rw-r--r--toolkit/components/url-classifier/tests/UrlClassifierTestUtils.sys.mjs8
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/allowlistAnnotatedFrame.html2
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedFrame.html2
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/classifierCommon.js6
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/classifierHelper.js4
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/dnt.html2
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/features.js2
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/head.js2
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_bug1254766.html4
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_cachemiss.html4
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_classified_annotations.html2
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_classifier_changetablepref.html6
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_classify_by_default.html2
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_classify_ping.html6
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_classify_top_sandboxed.html2
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_classify_track.html6
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_donottrack.html2
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_gethash.html2
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_privatebrowsing_trackingprotection.html2
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_reporturl.html4
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_threathit_report.html4
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_bug1312515.html8
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_bug1580416.html2
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_whitelist.html2
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/workerFrame.html10
-rw-r--r--toolkit/components/url-classifier/tests/unit/head_urlclassifier.js10
-rw-r--r--toolkit/components/url-classifier/tests/unit/test_channelClassifierService.js20
-rw-r--r--toolkit/components/url-classifier/tests/unit/test_dbservice.js2
-rw-r--r--toolkit/components/url-classifier/tests/unit/test_hashcompleter.js4
-rw-r--r--toolkit/components/url-classifier/tests/unit/test_partial.js2
-rw-r--r--toolkit/components/url-classifier/tests/unit/test_rsListService.js24
-rw-r--r--toolkit/components/url-classifier/tests/unit/test_shouldclassify.js6
32 files changed, 82 insertions, 82 deletions
diff --git a/toolkit/components/url-classifier/tests/UrlClassifierTestUtils.sys.mjs b/toolkit/components/url-classifier/tests/UrlClassifierTestUtils.sys.mjs
index c69d0c24b4..a05260b6b3 100644
--- a/toolkit/components/url-classifier/tests/UrlClassifierTestUtils.sys.mjs
+++ b/toolkit/components/url-classifier/tests/UrlClassifierTestUtils.sys.mjs
@@ -225,12 +225,12 @@ export var UrlClassifierTestUtils = {
throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE);
},
- updateUrlRequested: url => {},
- streamFinished: status => {},
- updateError: errorCode => {
+ updateUrlRequested: () => {},
+ streamFinished: () => {},
+ updateError: () => {
reject("Got updateError when updating " + table.name);
},
- updateSuccess: requestedTimeout => {
+ updateSuccess: () => {
resolve();
},
};
diff --git a/toolkit/components/url-classifier/tests/mochitest/allowlistAnnotatedFrame.html b/toolkit/components/url-classifier/tests/mochitest/allowlistAnnotatedFrame.html
index 1096274260..48ca1662c8 100644
--- a/toolkit/components/url-classifier/tests/mochitest/allowlistAnnotatedFrame.html
+++ b/toolkit/components/url-classifier/tests/mochitest/allowlistAnnotatedFrame.html
@@ -134,7 +134,7 @@ fetch("http://tracking.example.com/tests/toolkit/components/url-classifier/tests
fetchItem = "badresponse";
loaded("fetch");
}
- }).catch(function(error) {
+ }).catch(function() {
fetchItem = "error";
loaded("fetch");
});
diff --git a/toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedFrame.html b/toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedFrame.html
index 9b12f529cb..a1ca1ad303 100644
--- a/toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedFrame.html
+++ b/toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedFrame.html
@@ -141,7 +141,7 @@ fetch("http://tracking.example.com/tests/toolkit/components/url-classifier/tests
fetchItem = "badresponse";
loaded("fetch");
}
- }).catch(function(error) {
+ }).catch(function() {
fetchItem = "error";
loaded("fetch");
});
diff --git a/toolkit/components/url-classifier/tests/mochitest/classifierCommon.js b/toolkit/components/url-classifier/tests/mochitest/classifierCommon.js
index ca288986e3..00a4e8d08b 100644
--- a/toolkit/components/url-classifier/tests/mochitest/classifierCommon.js
+++ b/toolkit/components/url-classifier/tests/mochitest/classifierCommon.js
@@ -23,12 +23,12 @@ function setTimeout(callback, delay) {
function doUpdate(update) {
let listener = {
QueryInterface: ChromeUtils.generateQI(["nsIUrlClassifierUpdateObserver"]),
- updateUrlRequested(url) {},
- streamFinished(status) {},
+ updateUrlRequested() {},
+ streamFinished() {},
updateError(errorCode) {
sendAsyncMessage("updateError", errorCode);
},
- updateSuccess(requestedTimeout) {
+ updateSuccess() {
sendAsyncMessage("updateSuccess");
},
};
diff --git a/toolkit/components/url-classifier/tests/mochitest/classifierHelper.js b/toolkit/components/url-classifier/tests/mochitest/classifierHelper.js
index 157e5d54f7..b07bfc7fc5 100644
--- a/toolkit/components/url-classifier/tests/mochitest/classifierHelper.js
+++ b/toolkit/components/url-classifier/tests/mochitest/classifierHelper.js
@@ -27,7 +27,7 @@ classifierHelper._initsCB = [];
// This function return a Promise, promise is resolved when SafeBrowsing.jsm
// is initialized.
classifierHelper.waitForInit = function () {
- return new Promise(function (resolve, reject) {
+ return new Promise(function (resolve) {
classifierHelper._initsCB.push(resolve);
gScript.sendAsyncMessage("waitForInit");
});
@@ -115,7 +115,7 @@ classifierHelper.resetDatabase = function () {
};
classifierHelper.reloadDatabase = function () {
- return new Promise(function (resolve, reject) {
+ return new Promise(function (resolve) {
gScript.addMessageListener("reloadSuccess", function handler() {
gScript.removeMessageListener("reloadSuccess", handler);
resolve();
diff --git a/toolkit/components/url-classifier/tests/mochitest/dnt.html b/toolkit/components/url-classifier/tests/mochitest/dnt.html
index 2246263688..2ce66d4961 100644
--- a/toolkit/components/url-classifier/tests/mochitest/dnt.html
+++ b/toolkit/components/url-classifier/tests/mochitest/dnt.html
@@ -13,7 +13,7 @@ function makeXHR(url, callback) {
xhr.send();
}
-function loaded(type) {
+function loaded() {
window.parent.postMessage("navigator.doNotTrack=" + navigator.doNotTrack, "*");
makeXHR("dnt.sjs", (res) => {
diff --git a/toolkit/components/url-classifier/tests/mochitest/features.js b/toolkit/components/url-classifier/tests/mochitest/features.js
index 0004693d81..fc2d8d1c81 100644
--- a/toolkit/components/url-classifier/tests/mochitest/features.js
+++ b/toolkit/components/url-classifier/tests/mochitest/features.js
@@ -247,7 +247,7 @@ var chromeScript;
function runTests(flag, prefs, trackingResource) {
chromeScript = SpecialPowers.loadChromeScript(_ => {
/* eslint-env mozilla/chrome-script */
- function onExamResp(subject, topic, data) {
+ function onExamResp(subject) {
let channel = subject.QueryInterface(Ci.nsIHttpChannel);
let classifiedChannel = subject.QueryInterface(Ci.nsIClassifiedChannel);
if (
diff --git a/toolkit/components/url-classifier/tests/mochitest/head.js b/toolkit/components/url-classifier/tests/mochitest/head.js
index dca6abe279..f105b1718d 100644
--- a/toolkit/components/url-classifier/tests/mochitest/head.js
+++ b/toolkit/components/url-classifier/tests/mochitest/head.js
@@ -1,6 +1,6 @@
// calculate the fullhash and send it to gethash server
function addCompletionToServer(list, url, mochitestUrl) {
- return new Promise(function (resolve, reject) {
+ return new Promise(function (resolve) {
var listParam = "list=" + list;
var fullhashParam = "fullhash=" + hash(url);
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_bug1254766.html b/toolkit/components/url-classifier/tests/mochitest/test_bug1254766.html
index 2e528a7242..67dff80255 100644
--- a/toolkit/components/url-classifier/tests/mochitest/test_bug1254766.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_bug1254766.html
@@ -36,7 +36,7 @@ var gCurGethashCounter = 0;
var expectLoad = false;
function loadTestFrame() {
- return new Promise(function(resolve, reject) {
+ return new Promise(function(resolve) {
var iframe = document.createElement("iframe");
iframe.setAttribute("src", "gethashFrame.html");
document.body.appendChild(iframe);
@@ -49,7 +49,7 @@ function loadTestFrame() {
}
function getGethashCounter() {
- return new Promise(function(resolve, reject) {
+ return new Promise(function(resolve) {
var xhr = new XMLHttpRequest;
xhr.open("PUT", GETHASH_URL + "?gethashcount");
xhr.setRequestHeader("Content-Type", "text/plain");
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_cachemiss.html b/toolkit/components/url-classifier/tests/mochitest/test_cachemiss.html
index 2af0285884..71d14b6d47 100644
--- a/toolkit/components/url-classifier/tests/mochitest/test_cachemiss.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_cachemiss.html
@@ -29,7 +29,7 @@ var gPreGethashCounter = 0;
var gCurGethashCounter = 0;
function loadTestFrame() {
- return new Promise(function(resolve, reject) {
+ return new Promise(function(resolve) {
var iframe = document.createElement("iframe");
iframe.setAttribute("src", "gethashFrame.html");
document.body.appendChild(iframe);
@@ -42,7 +42,7 @@ function loadTestFrame() {
}
function getGethashCounter() {
- return new Promise(function(resolve, reject) {
+ return new Promise(function(resolve) {
var xhr = new XMLHttpRequest;
xhr.open("PUT", GETHASH_URL + "?gethashcount");
xhr.setRequestHeader("Content-Type", "text/plain");
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_classified_annotations.html b/toolkit/components/url-classifier/tests/mochitest/test_classified_annotations.html
index 44a0c92549..6d255dd094 100644
--- a/toolkit/components/url-classifier/tests/mochitest/test_classified_annotations.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_classified_annotations.html
@@ -28,7 +28,7 @@ const {TestUtils} = ChromeUtils.importESModule(
);
function testOnWindow() {
- return new Promise((resolve, reject) => {
+ return new Promise((resolve) => {
let win = mainWindow.OpenBrowserWindow();
win.addEventListener("load", function() {
TestUtils.topicObserved("browser-delayed-startup-finished",
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_classifier_changetablepref.html b/toolkit/components/url-classifier/tests/mochitest/test_classifier_changetablepref.html
index ea16c14e74..7b3674c04a 100644
--- a/toolkit/components/url-classifier/tests/mochitest/test_classifier_changetablepref.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_classifier_changetablepref.html
@@ -49,7 +49,7 @@ function checkLoads(aWindow, aBlocked) {
}
function testOnWindow() {
- return new Promise((resolve, reject) => {
+ return new Promise((resolve) => {
let win = mainWindow.OpenBrowserWindow();
win.addEventListener("load", function() {
TestUtils.topicObserved("browser-delayed-startup-finished",
@@ -63,7 +63,7 @@ function testOnWindow() {
}
win.removeEventListener("DOMContentLoaded", onInnerLoad, true);
- win.content.addEventListener("load", function innerLoad2(e) {
+ win.content.addEventListener("load", function innerLoad2() {
win.content.removeEventListener("load", innerLoad2);
SimpleTest.executeSoon(function() {
resolve(win);
@@ -81,7 +81,7 @@ function testOnWindow() {
}
function setup() {
- return new Promise(function(resolve, reject) {
+ return new Promise(function(resolve) {
// gethash url of test table "moz-track-digest256" should be updated
// after setting preference.
var url = listmanager.getGethashUrl(testTable);
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_classify_by_default.html b/toolkit/components/url-classifier/tests/mochitest/test_classify_by_default.html
index c10a0c62f9..a3ede628e0 100644
--- a/toolkit/components/url-classifier/tests/mochitest/test_classify_by_default.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_classify_by_default.html
@@ -77,7 +77,7 @@ async function setupAndRun(hasCookie, topLevelSite = TEST_TOP_SITE) {
});
}
-async function cleanup(topLevelSite = TEST_TOP_SITE) {
+async function cleanup() {
function clearServiceWorker() {
return new Promise(resolve => {
let w;
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_classify_ping.html b/toolkit/components/url-classifier/tests/mochitest/test_classify_ping.html
index 6a8a189ed2..72bfd35ece 100644
--- a/toolkit/components/url-classifier/tests/mochitest/test_classify_ping.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_classify_ping.html
@@ -31,7 +31,7 @@
var id = "1111";
ping(id, host_nottrack);
- return new Promise(function(resolve, reject) {
+ return new Promise(function(resolve) {
// Retry at most 30 seconds.
isPingedWithRetry(id, expectPing, msg, resolve, 30 * 1000 / RETRY_TIMEOUT_MS);
});
@@ -45,7 +45,7 @@
var id = "2222";
ping(id, host_track);
- return new Promise(function(resolve, reject) {
+ return new Promise(function(resolve) {
// Retry at most 30 seconds.
isPingedWithRetry(id, expectPing, msg, resolve, 30 * 1000 / RETRY_TIMEOUT_MS);
});
@@ -59,7 +59,7 @@
var id = "3333";
ping(id, host_track);
- return new Promise(function(resolve, reject) {
+ return new Promise(function(resolve) {
setTimeout(function() {
isPinged(id, expectPing, msg, resolve);
}, timeout);
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_classify_top_sandboxed.html b/toolkit/components/url-classifier/tests/mochitest/test_classify_top_sandboxed.html
index 7e3ae97751..51e1d0ae41 100644
--- a/toolkit/components/url-classifier/tests/mochitest/test_classify_top_sandboxed.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_classify_top_sandboxed.html
@@ -15,7 +15,7 @@ async function runTests() {
var chromeScript;
chromeScript = SpecialPowers.loadChromeScript(_ => {
/* eslint-env mozilla/chrome-script */
- function onExamResp(subject, topic, data) {
+ function onExamResp(subject) {
let channel = subject.QueryInterface(Ci.nsIHttpChannel);
let classifiedChannel = subject.QueryInterface(Ci.nsIClassifiedChannel);
if (
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_classify_track.html b/toolkit/components/url-classifier/tests/mochitest/test_classify_track.html
index cbb6e67c78..3bc1e9e8f9 100644
--- a/toolkit/components/url-classifier/tests/mochitest/test_classify_track.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_classify_track.html
@@ -28,7 +28,7 @@
function testValidTrack() {
SpecialPowers.setBoolPref(PREF, true);
- return new Promise(function(resolve, reject) {
+ return new Promise(function(resolve) {
var track = document.createElement("track");
track.track.mode = "hidden";
track.src = validtrack_url;
@@ -58,7 +58,7 @@
function testBlocklistTrackSafebrowsingOff() {
SpecialPowers.setBoolPref(PREF, false);
- return new Promise(function(resolve, reject) {
+ return new Promise(function(resolve) {
var track = document.createElement("track");
track.track.mode = "hidden";
track.src = malware_url;
@@ -88,7 +88,7 @@
function testBlocklistTrackSafebrowsingOn() {
SpecialPowers.setBoolPref(PREF, true);
- return new Promise(function(resolve, reject) {
+ return new Promise(function(resolve) {
var track = document.createElement("track");
track.track.mode = "hidden";
// Add a query string parameter here to avoid url classifier bypass classify
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_donottrack.html b/toolkit/components/url-classifier/tests/mochitest/test_donottrack.html
index 96278ae49d..e542b97b39 100644
--- a/toolkit/components/url-classifier/tests/mochitest/test_donottrack.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_donottrack.html
@@ -78,7 +78,7 @@ function executeTest(test) {
var win = mainWindow.OpenBrowserWindow({private: test.setting.pbMode});
- return new Promise(function(resolve, reject) {
+ return new Promise(function(resolve) {
win.addEventListener("load", function() {
TestUtils.topicObserved("browser-delayed-startup-finished",
subject => subject == win).then(() => {
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_gethash.html b/toolkit/components/url-classifier/tests/mochitest/test_gethash.html
index b9d3a2fd44..a917e59342 100644
--- a/toolkit/components/url-classifier/tests/mochitest/test_gethash.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_gethash.html
@@ -32,7 +32,7 @@ var shouldLoad = false;
// When access the test page gecko should trigger gethash request to server and
// get the completion response.
function loadTestFrame(id) {
- return new Promise(function(resolve, reject) {
+ return new Promise(function(resolve) {
var iframe = document.getElementById(id);
iframe.setAttribute("src", "gethashFrame.html");
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_privatebrowsing_trackingprotection.html b/toolkit/components/url-classifier/tests/mochitest/test_privatebrowsing_trackingprotection.html
index 0959ecf42e..e7c7fc9909 100644
--- a/toolkit/components/url-classifier/tests/mochitest/test_privatebrowsing_trackingprotection.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_privatebrowsing_trackingprotection.html
@@ -27,7 +27,7 @@ const {TestUtils} = ChromeUtils.importESModule(
);
function testOnWindow(aPrivate) {
- return new Promise((resolve, reject) => {
+ return new Promise((resolve) => {
let win = mainWindow.OpenBrowserWindow({private: aPrivate});
win.addEventListener("load", function() {
TestUtils.topicObserved("browser-delayed-startup-finished",
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_reporturl.html b/toolkit/components/url-classifier/tests/mochitest/test_reporturl.html
index 36d128cdf7..201a86f94a 100644
--- a/toolkit/components/url-classifier/tests/mochitest/test_reporturl.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_reporturl.html
@@ -103,7 +103,7 @@ var createBlockedIframe = function(aWindow, aBrowser, aTopUrl, aUrl) {
await SpecialPowers.spawn(aBrowser, [aUrl], async function(url) {
return new Promise(resolve => {
- let listener = e => {
+ let listener = () => {
docShell.chromeEventHandler.removeEventListener("AboutBlockedLoaded", listener, false, true);
resolve();
};
@@ -120,7 +120,7 @@ var createBlockedIframe = function(aWindow, aBrowser, aTopUrl, aUrl) {
})();
};
-var createBlockedPage = function(aWindow, aBrowser, aTopUrl, aUrl) {
+var createBlockedPage = function(aWindow, aBrowser, aTopUrl) {
(async function() {
BrowserTestUtils.startLoadingURIString(aBrowser, aTopUrl);
await BrowserTestUtils.waitForContentEvent(aBrowser, "DOMContentLoaded");
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_threathit_report.html b/toolkit/components/url-classifier/tests/mochitest/test_threathit_report.html
index 341d26fa3f..307c708785 100644
--- a/toolkit/components/url-classifier/tests/mochitest/test_threathit_report.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_threathit_report.html
@@ -76,7 +76,7 @@ var testDatas = [
];
function addDataV4ToServer(list, type, data) {
- return new Promise(function(resolve, reject) {
+ return new Promise(function(resolve) {
var xhr = new XMLHttpRequest;
let params = new URLSearchParams();
params.append("action", "store");
@@ -185,7 +185,7 @@ function testOnWindow(aTestData) {
let expected;
let browser = win.gBrowser.selectedBrowser;
let progressListener = {
- onContentBlockingEvent(aWebProgress, aRequest, aEvent) {
+ onContentBlockingEvent() {
expected = aTestData.reportUrl;
},
QueryInterface: ChromeUtils.generateQI(["nsISupportsWeakReference"]),
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_bug1312515.html b/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_bug1312515.html
index 31c69ac293..d29c4e8b99 100644
--- a/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_bug1312515.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_bug1312515.html
@@ -86,7 +86,7 @@ function checkPriority(aSubject, aCallback, aPriority, aMessage) {
}
function testXHR1() {
- return new Promise(function(aResolve, aReject) {
+ return new Promise(function(aResolve) {
testUrl = "http://tracking.example.com/";
info("Not blocklisted: " + testUrl);
resolve = aResolve;
@@ -96,7 +96,7 @@ function testXHR1() {
}
function testXHR2() {
- return new Promise(function(aResolve, aReject) {
+ return new Promise(function(aResolve) {
testUrl = "http://trackertest.org/";
info("Blocklisted and not entitylisted: " + testUrl);
resolve = aResolve;
@@ -106,7 +106,7 @@ function testXHR2() {
}
function testFetch1() {
- return new Promise(function(aResolve, aReject) {
+ return new Promise(function(aResolve) {
testUrl = "http://itisatracker.org/"; // only entitylisted in TP, not for annotations
info("Blocklisted and not entitylisted: " + testUrl);
resolve = aResolve;
@@ -116,7 +116,7 @@ function testFetch1() {
}
function testFetch2() {
- return new Promise(function(aResolve, aReject) {
+ return new Promise(function(aResolve) {
testUrl = "http://tracking.example.org/"; // only entitylisted for annotations, not in TP
info("Blocklisted but also entitylisted: " + testUrl);
resolve = aResolve;
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_bug1580416.html b/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_bug1580416.html
index 75d69b2596..9ca8eebb88 100644
--- a/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_bug1580416.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_bug1580416.html
@@ -28,7 +28,7 @@ const {TestUtils} = ChromeUtils.importESModule(
);
function testOnWindow(contentPage) {
- return new Promise((resolve, reject) => {
+ return new Promise((resolve) => {
var win = mainWindow.OpenBrowserWindow();
win.addEventListener("load", function() {
TestUtils.topicObserved("browser-delayed-startup-finished",
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_whitelist.html b/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_whitelist.html
index 69ca337c33..55070dd3ae 100644
--- a/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_whitelist.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_whitelist.html
@@ -31,7 +31,7 @@ const {TestUtils} = ChromeUtils.importESModule(
);
function testOnWindow(contentPage) {
- return new Promise((resolve, reject) => {
+ return new Promise((resolve) => {
var win = mainWindow.OpenBrowserWindow();
win.addEventListener("load", function() {
TestUtils.topicObserved("browser-delayed-startup-finished",
diff --git a/toolkit/components/url-classifier/tests/mochitest/workerFrame.html b/toolkit/components/url-classifier/tests/mochitest/workerFrame.html
index 69e8dd0074..20a682c529 100644
--- a/toolkit/components/url-classifier/tests/mochitest/workerFrame.html
+++ b/toolkit/components/url-classifier/tests/mochitest/workerFrame.html
@@ -16,7 +16,7 @@ function startCleanWorker() {
window.parent.postMessage("finish", "*");
};
- worker.onerror = function(event) {
+ worker.onerror = function() {
window.parent.postmessage("failure:failed to load cleanWorker.js", "*");
window.parent.postMessage("finish", "*");
};
@@ -27,12 +27,12 @@ function startCleanWorker() {
function startEvilWorker() {
var worker = new Worker("evilWorker.js");
- worker.onmessage = function(event) {
+ worker.onmessage = function() {
window.parent.postMessage("failure:failed to block evilWorker.js", "*");
startUnwantedWorker();
};
- worker.onerror = function(event) {
+ worker.onerror = function() {
window.parent.postMessage("success:blocked evilWorker.js", "*");
startUnwantedWorker();
};
@@ -43,12 +43,12 @@ function startEvilWorker() {
function startUnwantedWorker() {
var worker = new Worker("unwantedWorker.js");
- worker.onmessage = function(event) {
+ worker.onmessage = function() {
window.parent.postMessage("failure:failed to block unwantedWorker.js", "*");
startCleanWorker();
};
- worker.onerror = function(event) {
+ worker.onerror = function() {
window.parent.postMessage("success:blocked unwantedWorker.js", "*");
startCleanWorker();
};
diff --git a/toolkit/components/url-classifier/tests/unit/head_urlclassifier.js b/toolkit/components/url-classifier/tests/unit/head_urlclassifier.js
index 0ed731b564..b38fa447bf 100644
--- a/toolkit/components/url-classifier/tests/unit/head_urlclassifier.js
+++ b/toolkit/components/url-classifier/tests/unit/head_urlclassifier.js
@@ -186,8 +186,8 @@ function doSimpleUpdate(updateText, success, failure) {
var listener = {
QueryInterface: ChromeUtils.generateQI(["nsIUrlClassifierUpdateObserver"]),
- updateUrlRequested(url) {},
- streamFinished(status) {},
+ updateUrlRequested() {},
+ streamFinished() {},
updateError(errorCode) {
failure(errorCode);
},
@@ -210,8 +210,8 @@ function doErrorUpdate(tables, success, failure) {
var listener = {
QueryInterface: ChromeUtils.generateQI(["nsIUrlClassifierUpdateObserver"]),
- updateUrlRequested(url) {},
- streamFinished(status) {},
+ updateUrlRequested() {},
+ streamFinished() {},
updateError(errorCode) {
success(errorCode);
},
@@ -442,7 +442,7 @@ function Timer(delay, cb) {
Timer.prototype = {
QueryInterface: ChromeUtils.generateQI(["nsITimerCallback"]),
- notify(timer) {
+ notify() {
this.cb();
},
};
diff --git a/toolkit/components/url-classifier/tests/unit/test_channelClassifierService.js b/toolkit/components/url-classifier/tests/unit/test_channelClassifierService.js
index 9d5f5edb65..b7c176c371 100644
--- a/toolkit/components/url-classifier/tests/unit/test_channelClassifierService.js
+++ b/toolkit/components/url-classifier/tests/unit/test_channelClassifierService.js
@@ -42,7 +42,7 @@ function setupChannel(uri, topUri = TOP_LEVEL_DOMAIN) {
function waitForBeforeBlockEvent(expected, callback) {
return new Promise(function (resolve) {
- let observer = function observe(aSubject, aTopic, aData) {
+ let observer = function observe(aSubject, aTopic) {
switch (aTopic) {
case "urlclassifier-before-block-channel":
let channel = aSubject.QueryInterface(
@@ -90,10 +90,10 @@ add_task(async function test_block_channel() {
null
);
- let openPromise = new Promise((resolve, reject) => {
+ let openPromise = new Promise(resolve => {
channel.asyncOpen({
- onStartRequest: (request, context) => {},
- onDataAvailable: (request, context, stream, offset, count) => {},
+ onStartRequest: () => {},
+ onDataAvailable: () => {},
onStopRequest: (request, status) => {
dump("status = " + status + "\n");
if (status == 200) {
@@ -140,10 +140,10 @@ add_task(async function test_unblock_channel() {
}
);
- let openPromise = new Promise((resolve, reject) => {
+ let openPromise = new Promise(resolve => {
channel.asyncOpen({
- onStartRequest: (request, context) => {},
- onDataAvailable: (request, context, stream, offset, count) => {},
+ onStartRequest: () => {},
+ onDataAvailable: () => {},
onStopRequest: (request, status) => {
if (status == Cr.NS_ERROR_SOCIALTRACKING_URI) {
Assert.ok(false, "Classifier should not cancel this channel");
@@ -191,10 +191,10 @@ add_task(async function test_allow_channel() {
}
);
- let openPromise = new Promise((resolve, reject) => {
+ let openPromise = new Promise(resolve => {
channel.asyncOpen({
- onStartRequest: (request, context) => {},
- onDataAvailable: (request, context, stream, offset, count) => {},
+ onStartRequest: () => {},
+ onDataAvailable: () => {},
onStopRequest: (request, status) => {
if (status == Cr.NS_ERROR_SOCIALTRACKING_URI) {
Assert.ok(false, "Classifier should not cancel this channel");
diff --git a/toolkit/components/url-classifier/tests/unit/test_dbservice.js b/toolkit/components/url-classifier/tests/unit/test_dbservice.js
index 70ac02021a..1e3b986625 100644
--- a/toolkit/components/url-classifier/tests/unit/test_dbservice.js
+++ b/toolkit/components/url-classifier/tests/unit/test_dbservice.js
@@ -112,7 +112,7 @@ function tablesCallbackWithoutSub(tables) {
checkNoHost();
}
-function expireSubSuccess(result) {
+function expireSubSuccess() {
dbservice.getTables(tablesCallbackWithoutSub);
}
diff --git a/toolkit/components/url-classifier/tests/unit/test_hashcompleter.js b/toolkit/components/url-classifier/tests/unit/test_hashcompleter.js
index b8d6c7b128..2c6bbe36e8 100644
--- a/toolkit/components/url-classifier/tests/unit/test_hashcompleter.js
+++ b/toolkit/components/url-classifier/tests/unit/test_hashcompleter.js
@@ -383,7 +383,7 @@ function callback(completion) {
}
callback.prototype = {
- completionV2: function completionV2(hash, table, chunkId, trusted) {
+ completionV2: function completionV2(hash, table, chunkId) {
Assert.ok(this._completion.expectCompletion);
if (this._completion.multipleCompletions) {
for (let completion of this._completion.completions) {
@@ -411,7 +411,7 @@ callback.prototype = {
}
},
- completionFinished: function completionFinished(status) {
+ completionFinished: function completionFinished() {
finishedCompletions++;
Assert.equal(!!this._completion.expectCompletion, !!this._completed);
this._completion._finished = true;
diff --git a/toolkit/components/url-classifier/tests/unit/test_partial.js b/toolkit/components/url-classifier/tests/unit/test_partial.js
index 1220665063..640862729c 100644
--- a/toolkit/components/url-classifier/tests/unit/test_partial.js
+++ b/toolkit/components/url-classifier/tests/unit/test_partial.js
@@ -417,7 +417,7 @@ function setupCachedResults(addUrls, part2) {
}
function testCachedResults() {
- setupCachedResults(["foo.com/a"], function (add) {
+ setupCachedResults(["foo.com/a"], function () {
// This is called after setupCachedResults(). Verify that
// checking the url again does not cause a completer request.
diff --git a/toolkit/components/url-classifier/tests/unit/test_rsListService.js b/toolkit/components/url-classifier/tests/unit/test_rsListService.js
index cd70f92885..107de3568d 100644
--- a/toolkit/components/url-classifier/tests/unit/test_rsListService.js
+++ b/toolkit/components/url-classifier/tests/unit/test_rsListService.js
@@ -164,7 +164,7 @@ add_task(async function test_empty_update() {
gListService.fetchList(buildPayload(TEST_TABLES), {
// nsIStreamListener observer
- onStartRequest(request) {},
+ onStartRequest() {},
onDataAvailable(aRequest, aStream, aOffset, aCount) {
let stream = Cc["@mozilla.org/scriptableinputstream;1"].createInstance(
Ci.nsIScriptableInputStream
@@ -175,7 +175,7 @@ add_task(async function test_empty_update() {
});
updateEvent.dispatchEvent(event);
},
- onStopRequest(request, status) {},
+ onStopRequest() {},
});
let expected = "n:" + SBRS_UPDATE_MINIMUM_DELAY + "\n";
@@ -205,7 +205,7 @@ add_task(async function test_update() {
gListService.fetchList(buildPayload(TEST_TABLES), {
// observer
// nsIStreamListener observer
- onStartRequest(request) {},
+ onStartRequest() {},
onDataAvailable(aRequest, aStream, aOffset, aCount) {
let stream = Cc["@mozilla.org/scriptableinputstream;1"].createInstance(
Ci.nsIScriptableInputStream
@@ -216,7 +216,7 @@ add_task(async function test_update() {
});
updateEvent.dispatchEvent(event);
},
- onStopRequest(request, status) {},
+ onStopRequest() {},
});
// Build request with no version
@@ -247,7 +247,7 @@ add_task(async function test_no_update() {
gListService.fetchList(buildPayload(TEST_TABLES), {
// nsIStreamListener observer
- onStartRequest(request) {},
+ onStartRequest() {},
onDataAvailable(aRequest, aStream, aOffset, aCount) {
let stream = Cc["@mozilla.org/scriptableinputstream;1"].createInstance(
Ci.nsIScriptableInputStream
@@ -258,7 +258,7 @@ add_task(async function test_no_update() {
});
updateEvent.dispatchEvent(event);
},
- onStopRequest(request, status) {},
+ onStopRequest() {},
});
// No data is expected
@@ -338,11 +338,11 @@ add_test(function test_update_download_error() {
].getService(Ci.nsIUrlClassifierStreamUpdater);
// Download some updates, and don't continue until the downloads are done.
- function updateSuccessOrError(aEvent) {
+ function updateSuccessOrError() {
do_throw("Should be downbload error");
}
// Just throw if we ever get an update or download error.
- function downloadError(aEvent) {
+ function downloadError() {
run_next_test();
}
@@ -363,11 +363,11 @@ add_test(function test_update_update_error() {
].getService(Ci.nsIUrlClassifierStreamUpdater);
// Download some updates, and don't continue until the downloads are done.
- function updateSuccessOrDownloadError(aEvent) {
+ function updateSuccessOrDownloadError() {
do_throw("Should be update error");
}
// Just throw if we ever get an update or download error.
- function updateError(aEvent) {
+ function updateError() {
run_next_test();
}
@@ -393,7 +393,7 @@ add_task(async function test_update_large_file() {
gListService.fetchList(buildPayload(TEST_TABLES), {
// observer
// nsIStreamListener observer
- onStartRequest(request) {},
+ onStartRequest() {},
onDataAvailable(aRequest, aStream, aOffset, aCount) {
let stream = Cc["@mozilla.org/scriptableinputstream;1"].createInstance(
Ci.nsIScriptableInputStream
@@ -404,7 +404,7 @@ add_task(async function test_update_large_file() {
});
updateEvent.dispatchEvent(event);
},
- onStopRequest(request, status) {},
+ onStopRequest() {},
});
// Build request with no version
diff --git a/toolkit/components/url-classifier/tests/unit/test_shouldclassify.js b/toolkit/components/url-classifier/tests/unit/test_shouldclassify.js
index 6abdbb5f85..deb5ae9bb6 100644
--- a/toolkit/components/url-classifier/tests/unit/test_shouldclassify.js
+++ b/toolkit/components/url-classifier/tests/unit/test_shouldclassify.js
@@ -141,7 +141,7 @@ add_task(async function testShouldClassify() {
await new Promise(resolve => {
channel.asyncOpen({
- onStartRequest: (request, context) => {
+ onStartRequest: request => {
Assert.equal(
!!(
request.QueryInterface(Ci.nsIClassifiedChannel)
@@ -154,8 +154,8 @@ add_task(async function testShouldClassify() {
resolve();
},
- onDataAvailable: (request, context, stream, offset, count) => {},
- onStopRequest: (request, context, status) => {},
+ onDataAvailable: () => {},
+ onStopRequest: () => {},
});
});
}