summaryrefslogtreecommitdiffstats
path: root/dom/xhr/tests
diff options
context:
space:
mode:
Diffstat (limited to 'dom/xhr/tests')
-rw-r--r--dom/xhr/tests/file_XHRResponseURL.js12
-rw-r--r--dom/xhr/tests/file_sync_xhr_document_write_with_iframe.html2
-rw-r--r--dom/xhr/tests/relativeLoad_worker.js2
-rw-r--r--dom/xhr/tests/temporaryFileBlob.sjs4
-rw-r--r--dom/xhr/tests/terminateSyncXHR_worker.js2
-rw-r--r--dom/xhr/tests/test_XHR.js3
-rw-r--r--dom/xhr/tests/test_XHRDocURI.html40
-rw-r--r--dom/xhr/tests/test_XHR_timeout.js2
-rw-r--r--dom/xhr/tests/test_bug1752863_worker.js2
-rw-r--r--dom/xhr/tests/test_worker_xhr_responseURL.html2
-rw-r--r--dom/xhr/tests/test_worker_xhr_system.js4
-rw-r--r--dom/xhr/tests/test_xhr_progressevents.html2
-rw-r--r--dom/xhr/tests/worker_temporaryFileBlob.js3
-rw-r--r--dom/xhr/tests/worker_terminateSyncXHR_frame.html2
-rw-r--r--dom/xhr/tests/xhrAbort_worker.js4
-rw-r--r--dom/xhr/tests/xhr_worker.js18
16 files changed, 57 insertions, 47 deletions
diff --git a/dom/xhr/tests/file_XHRResponseURL.js b/dom/xhr/tests/file_XHRResponseURL.js
index 1ab1694bfa..29e6ddea69 100644
--- a/dom/xhr/tests/file_XHRResponseURL.js
+++ b/dom/xhr/tests/file_XHRResponseURL.js
@@ -51,7 +51,7 @@ function info(aMessage) {
}
function request(aURL) {
- return new Promise(function (aResolve, aReject) {
+ return new Promise(function (aResolve) {
var xhr = new XMLHttpRequest();
xhr.open("GET", aURL);
xhr.addEventListener("load", function () {
@@ -272,7 +272,7 @@ function testNotToLeakResponseURLWhileDoingRedirects() {
function testNotToLeakResponseURLWhileDoingRedirectsInWindow() {
var xhr = new XMLHttpRequest();
var requestObserver = {
- observe(aSubject, aTopic, aData) {
+ observe() {
is(xhr.readyState, XMLHttpRequest.OPENED, "assert for XHR state");
is(
xhr.responseURL,
@@ -286,7 +286,7 @@ function testNotToLeakResponseURLWhileDoingRedirectsInWindow() {
"specialpowers-http-notify-request"
);
- return new Promise(function (aResolve, aReject) {
+ return new Promise(function (aResolve) {
xhr.open(
"GET",
"http://mochi.test:8888/tests/dom/xhr/tests/file_XHRResponseURL.sjs?url=http://mochi.test:8888/tests/dom/xhr/tests/file_XHRResponseURL.text"
@@ -322,7 +322,7 @@ function testNotToLeakResponseURLWhileDoingRedirectsInWorker() {
}
};
- return new Promise(function (aResolve, aReject) {
+ return new Promise(function (aResolve) {
self.addEventListener("message", testRedirect);
message({ type: "redirect_test", status: "start" });
xhr.open(
@@ -334,7 +334,7 @@ function testNotToLeakResponseURLWhileDoingRedirectsInWorker() {
message({ type: "redirect_test", status: "end" });
aResolve();
});
- xhr.addEventListener("error", function (e) {
+ xhr.addEventListener("error", function () {
ok(false, "unexpected request falilure");
self.removeEventListener("message", testRedirect);
message({ type: "redirect_test", status: "end" });
@@ -345,7 +345,7 @@ function testNotToLeakResponseURLWhileDoingRedirectsInWorker() {
}
function waitForAllMessagesProcessed() {
- return new Promise(function (aResolve, aReject) {
+ return new Promise(function (aResolve) {
var id = setInterval(function () {
if (message.ping === message.pong) {
clearInterval(id);
diff --git a/dom/xhr/tests/file_sync_xhr_document_write_with_iframe.html b/dom/xhr/tests/file_sync_xhr_document_write_with_iframe.html
index 2135011d9c..895fbc4e4b 100644
--- a/dom/xhr/tests/file_sync_xhr_document_write_with_iframe.html
+++ b/dom/xhr/tests/file_sync_xhr_document_write_with_iframe.html
@@ -7,7 +7,7 @@ function syncXHR() {
xhr.send(null);
}
-addEventListener('load', evt => {
+addEventListener('load', () => {
syncXHR();
document.open();
document.write(
diff --git a/dom/xhr/tests/relativeLoad_worker.js b/dom/xhr/tests/relativeLoad_worker.js
index b600b592be..6d281244c2 100644
--- a/dom/xhr/tests/relativeLoad_worker.js
+++ b/dom/xhr/tests/relativeLoad_worker.js
@@ -6,7 +6,7 @@
/* global workerURL */
const importURL = "relativeLoad_import.js";
-onmessage = function (event) {
+onmessage = function () {
var xhr = new XMLHttpRequest();
xhr.open("GET", "worker_testXHR.txt", false);
xhr.send(null);
diff --git a/dom/xhr/tests/temporaryFileBlob.sjs b/dom/xhr/tests/temporaryFileBlob.sjs
index d952b325ce..151c05a231 100644
--- a/dom/xhr/tests/temporaryFileBlob.sjs
+++ b/dom/xhr/tests/temporaryFileBlob.sjs
@@ -28,7 +28,7 @@ function handleRequest(request, response) {
bos.writeByteArray(part);
response.timer1 = new Timer(
- function (timer) {
+ function () {
bos.writeByteArray(bodyBytes);
},
1000,
@@ -36,7 +36,7 @@ function handleRequest(request, response) {
);
response.timer2 = new Timer(
- function (timer) {
+ function () {
response.finish();
},
2000,
diff --git a/dom/xhr/tests/terminateSyncXHR_worker.js b/dom/xhr/tests/terminateSyncXHR_worker.js
index 7a2509af3d..29a5a8a369 100644
--- a/dom/xhr/tests/terminateSyncXHR_worker.js
+++ b/dom/xhr/tests/terminateSyncXHR_worker.js
@@ -3,7 +3,7 @@
* http://creativecommons.org/publicdomain/zero/1.0/
*/
-onmessage = function (event) {
+onmessage = function () {
throw new Error("No messages should reach me!");
};
diff --git a/dom/xhr/tests/test_XHR.js b/dom/xhr/tests/test_XHR.js
index 12eb06e4f6..0034f8a0eb 100644
--- a/dom/xhr/tests/test_XHR.js
+++ b/dom/xhr/tests/test_XHR.js
@@ -1,4 +1,7 @@
"use strict";
+
+/* eslint-disable mozilla/no-comparison-or-assignment-inside-ok */
+
SimpleTest.waitForExplicitFinish();
var gen = runTests();
diff --git a/dom/xhr/tests/test_XHRDocURI.html b/dom/xhr/tests/test_XHRDocURI.html
index 1062be13a6..61be580ddd 100644
--- a/dom/xhr/tests/test_XHRDocURI.html
+++ b/dom/xhr/tests/test_XHRDocURI.html
@@ -89,7 +89,7 @@ function* runTest() {
// use content XHR and access URI properties from content privileged script
var xhr = new XMLHttpRequest;
xhr.open("GET", "http://mochi.test:8888/tests/dom/xhr/tests/file_XHRDocURI.xml");
- xhr.onreadystatechange = function(e) {
+ xhr.onreadystatechange = function() {
if (!xhr.responseXML) {
return;
}
@@ -108,7 +108,7 @@ function* runTest() {
xhr = new XMLHttpRequest;
xhr.open("GET", "http://mochi.test:8888/tests/dom/xhr/tests/file_XHRDocURI.html");
xhr.responseType = "document";
- xhr.onreadystatechange = function(e) {
+ xhr.onreadystatechange = function() {
if (!xhr.response) {
return;
}
@@ -126,7 +126,7 @@ function* runTest() {
xhr = new XMLHttpRequest;
xhr.open("GET", "http://mochi.test:8888/tests/dom/xhr/tests/file_XHRDocURI.text");
- xhr.onreadystatechange = function(e) {
+ xhr.onreadystatechange = function() {
is(xhr.responseXML, null, "should not have document");
if (xhr.readyState == 4) {
gen.next();
@@ -137,7 +137,7 @@ function* runTest() {
xhr = new XMLHttpRequest;
xhr.open("GET", "http://example.com/tests/dom/xhr/tests/file_XHRDocURI.xml");
- xhr.onreadystatechange = function(e) {
+ xhr.onreadystatechange = function() {
if (!xhr.responseXML) {
return;
}
@@ -156,7 +156,7 @@ function* runTest() {
xhr = new XMLHttpRequest;
xhr.open("GET", "http://example.com/tests/dom/xhr/tests/file_XHRDocURI.html");
xhr.responseType = "document";
- xhr.onreadystatechange = function(e) {
+ xhr.onreadystatechange = function() {
if (!xhr.response) {
return;
}
@@ -174,7 +174,7 @@ function* runTest() {
xhr = new XMLHttpRequest;
xhr.open("GET", "http://mochi.test:8888/tests/dom/xhr/tests/file_XHRDocURI.sjs?url=http://example.com/tests/dom/xhr/tests/file_XHRDocURI.xml");
- xhr.onreadystatechange = function(e) {
+ xhr.onreadystatechange = function() {
if (!xhr.responseXML) {
return;
}
@@ -193,7 +193,7 @@ function* runTest() {
xhr = new XMLHttpRequest;
xhr.open("GET", "http://mochi.test:8888/tests/dom/xhr/tests/file_XHRDocURI.sjs?url=http://example.com/tests/dom/xhr/tests/file_XHRDocURI.html");
xhr.responseType = "document";
- xhr.onreadystatechange = function(e) {
+ xhr.onreadystatechange = function() {
if (!xhr.response) {
return;
}
@@ -211,7 +211,7 @@ function* runTest() {
xhr = new XMLHttpRequest;
xhr.open("GET", "http://example.com/tests/dom/xhr/tests/file_XHRDocURI.text");
- xhr.onreadystatechange = function(e) {
+ xhr.onreadystatechange = function() {
is(xhr.responseXML, null, "should not have document");
if (xhr.readyState == 4) {
gen.next();
@@ -225,7 +225,7 @@ function* runTest() {
xhr = new XMLHttpRequest;
xhr.open("GET", "http://mochi.test:8888/tests/dom/xhr/tests/file_XHRDocURI.xml");
- xhr.onreadystatechange = function(e) {
+ xhr.onreadystatechange = function() {
if (!xhr.responseXML) {
return;
}
@@ -246,7 +246,7 @@ function* runTest() {
xhr = new XMLHttpRequest;
xhr.open("GET", "http://mochi.test:8888/tests/dom/xhr/tests/file_XHRDocURI.html");
xhr.responseType = "document";
- xhr.onreadystatechange = function(e) {
+ xhr.onreadystatechange = function() {
if (!xhr.response) {
return;
}
@@ -266,7 +266,7 @@ function* runTest() {
xhr = new XMLHttpRequest;
xhr.open("GET", "http://example.com/tests/dom/xhr/tests/file_XHRDocURI.xml");
- xhr.onreadystatechange = function(e) {
+ xhr.onreadystatechange = function() {
if (!xhr.responseXML) {
return;
}
@@ -287,7 +287,7 @@ function* runTest() {
xhr = new XMLHttpRequest;
xhr.open("GET", "http://example.com/tests/dom/xhr/tests/file_XHRDocURI.html");
xhr.responseType = "document";
- xhr.onreadystatechange = function(e) {
+ xhr.onreadystatechange = function() {
if (!xhr.response) {
return;
}
@@ -307,7 +307,7 @@ function* runTest() {
xhr = new XMLHttpRequest;
xhr.open("GET", "http://mochi.test:8888/tests/dom/xhr/tests/file_XHRDocURI.sjs?url=http://example.com/tests/dom/xhr/tests/file_XHRDocURI.xml");
- xhr.onreadystatechange = function(e) {
+ xhr.onreadystatechange = function() {
if (!xhr.responseXML) {
return;
}
@@ -328,7 +328,7 @@ function* runTest() {
xhr = new XMLHttpRequest;
xhr.open("GET", "http://mochi.test:8888/tests/dom/xhr/tests/file_XHRDocURI.sjs?url=http://example.com/tests/dom/xhr/tests/file_XHRDocURI.html");
xhr.responseType = "document";
- xhr.onreadystatechange = function(e) {
+ xhr.onreadystatechange = function() {
if (!xhr.response) {
return;
}
@@ -351,7 +351,7 @@ function* runTest() {
SpecialPowers.addPermission("systemXHR", true, document);
xhr = new XMLHttpRequest({mozAnon: false, mozSystem: true});
xhr.open("GET", "http://mochi.test:8888/tests/dom/xhr/tests/file_XHRDocURI.xml");
- xhr.onreadystatechange = function(e) {
+ xhr.onreadystatechange = function() {
if (!xhr.responseXML) {
return;
}
@@ -370,7 +370,7 @@ function* runTest() {
xhr = new XMLHttpRequest({mozAnon: false, mozSystem: true});
xhr.open("GET", "http://mochi.test:8888/tests/dom/xhr/tests/file_XHRDocURI.html");
xhr.responseType = "document";
- xhr.onreadystatechange = function(e) {
+ xhr.onreadystatechange = function() {
if (!xhr.response) {
return;
}
@@ -388,7 +388,7 @@ function* runTest() {
xhr = new XMLHttpRequest({mozAnon: false, mozSystem: true});
xhr.open("GET", "http://example.com/tests/dom/xhr/tests/file_XHRDocURI.xml");
- xhr.onreadystatechange = function(e) {
+ xhr.onreadystatechange = function() {
if (!xhr.responseXML) {
return;
}
@@ -407,7 +407,7 @@ function* runTest() {
xhr = new XMLHttpRequest({mozAnon: false, mozSystem: true});
xhr.open("GET", "http://example.com/tests/dom/xhr/tests/file_XHRDocURI.html");
xhr.responseType = "document";
- xhr.onreadystatechange = function(e) {
+ xhr.onreadystatechange = function() {
if (!xhr.response) {
return;
}
@@ -425,7 +425,7 @@ function* runTest() {
xhr = new XMLHttpRequest({mozAnon: false, mozSystem: true});
xhr.open("GET", "http://mochi.test:8888/tests/dom/xhr/tests/file_XHRDocURI.sjs?url=http://example.com/tests/dom/xhr/tests/file_XHRDocURI.xml");
- xhr.onreadystatechange = function(e) {
+ xhr.onreadystatechange = function() {
if (!xhr.responseXML) {
return;
}
@@ -444,7 +444,7 @@ function* runTest() {
xhr = new XMLHttpRequest({mozAnon: false, mozSystem: true});
xhr.open("GET", "http://mochi.test:8888/tests/dom/xhr/tests/file_XHRDocURI.sjs?url=http://example.com/tests/dom/xhr/tests/file_XHRDocURI.html");
xhr.responseType = "document";
- xhr.onreadystatechange = function(e) {
+ xhr.onreadystatechange = function() {
if (!xhr.response) {
return;
}
diff --git a/dom/xhr/tests/test_XHR_timeout.js b/dom/xhr/tests/test_XHR_timeout.js
index 1e75c1c174..69986770e1 100644
--- a/dom/xhr/tests/test_XHR_timeout.js
+++ b/dom/xhr/tests/test_XHR_timeout.js
@@ -1,3 +1,5 @@
+/* eslint-disable mozilla/no-comparison-or-assignment-inside-ok */
+
/* Notes:
- All times are expressed in milliseconds in this test suite.
- Test harness code is at the end of this file.
diff --git a/dom/xhr/tests/test_bug1752863_worker.js b/dom/xhr/tests/test_bug1752863_worker.js
index 196b825c0c..929b005939 100644
--- a/dom/xhr/tests/test_bug1752863_worker.js
+++ b/dom/xhr/tests/test_bug1752863_worker.js
@@ -24,7 +24,7 @@ async function handleLoadstart() {
}
}
-self.onmessage = async function (ev) {
+self.onmessage = async function () {
xhr = new XMLHttpRequest({ mozAnon: false });
myself = self;
xhr.addEventListener("loadstart", handleLoadstart, true);
diff --git a/dom/xhr/tests/test_worker_xhr_responseURL.html b/dom/xhr/tests/test_worker_xhr_responseURL.html
index 89924e9815..b33cc880c6 100644
--- a/dom/xhr/tests/test_worker_xhr_responseURL.html
+++ b/dom/xhr/tests/test_worker_xhr_responseURL.html
@@ -16,7 +16,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=998076
var worker = new Worker("../../../dom/xhr/tests/file_XHRResponseURL.js");
var requestObserver = {
- observe (aSubject, aTopic, aData) {
+ observe () {
worker.postMessage("request");
}
};
diff --git a/dom/xhr/tests/test_worker_xhr_system.js b/dom/xhr/tests/test_worker_xhr_system.js
index 23137801a0..ee5934363d 100644
--- a/dom/xhr/tests/test_worker_xhr_system.js
+++ b/dom/xhr/tests/test_worker_xhr_system.js
@@ -1,3 +1,5 @@
+/* eslint-disable mozilla/no-comparison-or-assignment-inside-ok */
+
function ok(what, msg) {
postMessage({ event: msg, test: "ok", a: what });
}
@@ -6,7 +8,7 @@ function is(a, b, msg) {
postMessage({ event: msg, test: "is", a, b });
}
-self.onmessage = function onmessage(event) {
+self.onmessage = function onmessage() {
// An XHR with system privileges will be able to do cross-site calls.
const TEST_URL =
diff --git a/dom/xhr/tests/test_xhr_progressevents.html b/dom/xhr/tests/test_xhr_progressevents.html
index ebfc06fd5b..69f549f7a8 100644
--- a/dom/xhr/tests/test_xhr_progressevents.html
+++ b/dom/xhr/tests/test_xhr_progressevents.html
@@ -12,7 +12,7 @@ SimpleTest.waitForExplicitFinish();
var gen = runTests();
-function log(s) {
+function log() {
// Uncomment these to get debugging information
/*
document.getElementById("l").textContent += s + "\n";
diff --git a/dom/xhr/tests/worker_temporaryFileBlob.js b/dom/xhr/tests/worker_temporaryFileBlob.js
index 50f071bab7..056b826e00 100644
--- a/dom/xhr/tests/worker_temporaryFileBlob.js
+++ b/dom/xhr/tests/worker_temporaryFileBlob.js
@@ -1,4 +1,7 @@
/* eslint-env worker */
+
+/* eslint-disable mozilla/no-comparison-or-assignment-inside-ok */
+
importScripts("common_temporaryFileBlob.js");
function info(msg) {
diff --git a/dom/xhr/tests/worker_terminateSyncXHR_frame.html b/dom/xhr/tests/worker_terminateSyncXHR_frame.html
index 04bd53ff1d..720cf9551d 100644
--- a/dom/xhr/tests/worker_terminateSyncXHR_frame.html
+++ b/dom/xhr/tests/worker_terminateSyncXHR_frame.html
@@ -16,7 +16,7 @@
parent.postMessage(event.data, "*");
};
- worker.onerror = function(event) {
+ worker.onerror = function() {
parent.postMessage("ERROR!", "*");
}
}
diff --git a/dom/xhr/tests/xhrAbort_worker.js b/dom/xhr/tests/xhrAbort_worker.js
index 6b82241d68..e922f8259f 100644
--- a/dom/xhr/tests/xhrAbort_worker.js
+++ b/dom/xhr/tests/xhrAbort_worker.js
@@ -57,11 +57,11 @@ function runTest() {
events.push(str);
}
- xhr.onerror = function (event) {
+ xhr.onerror = function () {
throw new Error("Error: " + xhr.statusText);
};
- xhr.onload = function (event) {
+ xhr.onload = function () {
throw new Error("Shouldn't have gotten load event!");
};
diff --git a/dom/xhr/tests/xhr_worker.js b/dom/xhr/tests/xhr_worker.js
index 46edd700db..4361b347e5 100644
--- a/dom/xhr/tests/xhr_worker.js
+++ b/dom/xhr/tests/xhr_worker.js
@@ -53,21 +53,21 @@ function onprogress(event) {
}
xhr.addEventListener("progress", onprogress);
-xhr.addEventListener("foopety", function (event) {});
-xhr.removeEventListener("doopety", function (event) {});
+xhr.addEventListener("foopety", function () {});
+xhr.removeEventListener("doopety", function () {});
-xhr.onloadend = function (event) {
+xhr.onloadend = function () {
const message = { type: "loadend" };
postMessage(message);
};
var upload = xhr.upload;
-upload.onprogress = function (event) {};
-upload.addEventListener("foo", function (event) {});
-upload.removeEventListener("foo", function (event) {});
-upload.addEventListener("load", function (event) {});
-upload.removeEventListener("foo", function (event) {});
-upload.onload = function (event) {
+upload.onprogress = function () {};
+upload.addEventListener("foo", function () {});
+upload.removeEventListener("foo", function () {});
+upload.addEventListener("load", function () {});
+upload.removeEventListener("foo", function () {});
+upload.onload = function () {
const message = { type: "upload.load" };
postMessage(message);
};