summaryrefslogtreecommitdiffstats
path: root/toolkit/components/url-classifier/tests/unit
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/components/url-classifier/tests/unit')
-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
7 files changed, 34 insertions, 34 deletions
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: () => {},
});
});
}