Bug 1561435 - Fix linting errors for netwerk/, r=standard8

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D35920

--HG--
extra : source : fd273b25480e88ff03e1009588f831de08e171f6
extra : intermediate-source : 34d49f0e83e16be8ddce2aba23a16eeb9f6751d1
This commit is contained in:
Victor Porof 2019-06-21 13:55:36 -07:00
Родитель 2c53a5dcd9
Коммит 4bd76df603
8 изменённых файлов: 28 добавлений и 6 удалений

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

@ -386,9 +386,9 @@ function RawTest(host, port, data, responseCheck) {
throw new Error("bad data length");
}
// eslint-disable-next-line no-control-regex
if (
!data.every(function(v) {
// eslint-disable-next-line no-control-regex
return /^[\x00-\xff]*$/.test(v);
})
) {

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

@ -22,6 +22,7 @@ function run_test() {
do_test_pending();
tests.push(function testsComplete(_) {
dumpn(
// eslint-disable-next-line no-useless-concat
"******************\n" + "* TESTS COMPLETE *\n" + "******************"
);
do_test_finished();
@ -527,6 +528,7 @@ function CustomPipe(name) {
// see nsIAsyncInputStream.closeWithStatus
//
closeWithStatus: function closeWithStatus(status) {
// eslint-disable-next-line no-useless-concat
dumpn("*** [" + this.name + "].closeWithStatus" + "(" + status + ")");
if (!Components.isSuccessCode(self._status)) {
@ -929,7 +931,7 @@ function CustomPipe(name) {
Assert.equal(
this._writable,
sum(this._writableAmounts),
"total writable amount not equal to sum of writable " + "increments"
"total writable amount not equal to sum of writable increments"
);
actualWritten = this._writableAmounts.shift();
}
@ -1493,6 +1495,7 @@ CopyTest.prototype = {
var outputWrittenWatcher = {
onInputStreamReady: function onInputStreamReady(input) {
dumpn(
// eslint-disable-next-line no-useless-concat
"*** outputWrittenWatcher.onInputStreamReady" + "(" + input.name + ")"
);
@ -1565,9 +1568,7 @@ CopyTest.prototype = {
* this test was first created.
*/
_testComplete: function _testComplete() {
dumpn(
"*** CopyTest(" + this.name + ") complete! " + "On to the next test..."
);
dumpn("*** CopyTest(" + this.name + ") complete! On to the next test...");
try {
Assert.ok(this._allDataWritten, "expect all data written now!");

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

@ -254,7 +254,7 @@ function http10Request(request, response) {
writeDetails(request, response);
response.setStatusLine("1.0", 200, "TEST PASSED");
}
data = "GET /http/1.0-request HTTP/1.0\r\n" + "\r\n";
data = "GET /http/1.0-request HTTP/1.0\r\n\r\n";
function check10(aData) {
let iter = LineIterator(aData);
@ -281,6 +281,7 @@ tests.push(test);
// HTTP/1.1 request, no Host header, expect a 400 response
// eslint-disable-next-line no-useless-concat
data = "GET /http/1.1-request HTTP/1.1\r\n" + "\r\n";
test = new RawTest("localhost", PORT, data, check400);
tests.push(test);
@ -288,6 +289,7 @@ tests.push(test);
// HTTP/1.1 request, wrong host, expect a 400 response
data =
// eslint-disable-next-line no-useless-concat
"GET /http/1.1-request HTTP/1.1\r\n" + "Host: not-localhost\r\n" + "\r\n";
test = new RawTest("localhost", PORT, data, check400);
tests.push(test);
@ -303,6 +305,7 @@ tests.push(test);
// HTTP/1.1 request, Host header has host but no port, expect a 400 response
// eslint-disable-next-line no-useless-concat
data = "GET /http/1.1-request HTTP/1.1\r\n" + "Host: 127.0.0.1\r\n" + "\r\n";
test = new RawTest("localhost", PORT, data, check400);
tests.push(test);
@ -341,6 +344,7 @@ function http11goodHost(request, response) {
response.setStatusLine("1.1", 200, "TEST PASSED");
}
data =
// eslint-disable-next-line no-useless-concat
"GET /http/1.1-good-host HTTP/1.1\r\n" + "Host: localhost:4444\r\n" + "\r\n";
function check11goodHost(aData) {
let iter = LineIterator(aData);
@ -373,6 +377,7 @@ function http11ipHost(request, response) {
response.setStatusLine("1.1", 200, "TEST PASSED");
}
data =
// eslint-disable-next-line no-useless-concat
"GET /http/1.1-ip-host HTTP/1.1\r\n" + "Host: 127.0.0.1:4444\r\n" + "\r\n";
function check11ipHost(aData) {
let iter = LineIterator(aData);
@ -561,6 +566,7 @@ tests.push(test);
// HTTP/1.1 request, a malformed Host header
// eslint-disable-next-line no-useless-concat
data = "GET /http/1.1-request HTTP/1.1\r\n" + "Host: la la la\r\n" + "\r\n";
test = new RawTest("localhost", PORT, data, check400);
tests.push(test);

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

@ -150,26 +150,31 @@ XPCOMUtils.defineLazyGetter(this, "tests", function() {
];
});
// eslint-disable-next-line no-useless-concat
var data0 = "GET /raw-data HTTP/1.0\r\n" + "\r\n";
function checkRawData(data) {
Assert.equal(data, "Raw data!");
}
// eslint-disable-next-line no-useless-concat
var data1 = "GET /called-too-late HTTP/1.0\r\n" + "\r\n";
function checkTooLate(data) {
Assert.equal(LineIterator(data).next().value, "too-late passed");
}
// eslint-disable-next-line no-useless-concat
var data2 = "GET /exceptions HTTP/1.0\r\n" + "\r\n";
function checkExceptions(data) {
Assert.equal("exceptions test passed", data);
}
// eslint-disable-next-line no-useless-concat
var data3 = "GET /async-seizure HTTP/1.0\r\n" + "\r\n";
function checkAsyncSeizure(data) {
Assert.equal(data, "async seizure passed");
}
// eslint-disable-next-line no-useless-concat
var data4 = "GET /seize-after-async HTTP/1.0\r\n" + "\r\n";
function checkSeizeAfterAsync(data) {
Assert.equal(

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

@ -81,18 +81,21 @@ function pathHandler(request, response) {
XPCOMUtils.defineLazyGetter(this, "tests", function() {
return [
new Test(
// eslint-disable-next-line no-useless-concat
URL + "/state1.sjs?" + "newShared=newShared&newPrivate=newPrivate",
null,
start_initial,
null
),
new Test(
// eslint-disable-next-line no-useless-concat
URL + "/state1.sjs?" + "newShared=newShared2&newPrivate=newPrivate2",
null,
start_overwrite,
null
),
new Test(
// eslint-disable-next-line no-useless-concat
URL + "/state1.sjs?" + "newShared=&newPrivate=newPrivate3",
null,
start_remove,
@ -101,24 +104,28 @@ XPCOMUtils.defineLazyGetter(this, "tests", function() {
new Test(URL + "/path-handler", null, start_handler, null),
new Test(URL + "/path-handler", null, start_handler_again, null),
new Test(
// eslint-disable-next-line no-useless-concat
URL + "/state2.sjs?" + "newShared=newShared4&newPrivate=newPrivate4",
null,
start_other_initial,
null
),
new Test(
// eslint-disable-next-line no-useless-concat
URL + "/state2.sjs?" + "newShared=",
null,
start_other_remove_ignore,
null
),
new Test(
// eslint-disable-next-line no-useless-concat
URL + "/state2.sjs?" + "newShared=newShared5&newPrivate=newPrivate5",
null,
start_other_set_new,
null
),
new Test(
// eslint-disable-next-line no-useless-concat
URL + "/state1.sjs?" + "newShared=done!&newPrivate=",
null,
start_set_remove_original,

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

@ -88,6 +88,7 @@ add_test(function test_304_stored_in_cache() {
cacheEntry.setMetaDataElement("request-method", "GET");
cacheEntry.setMetaDataElement(
"response-head",
// eslint-disable-next-line no-useless-concat
"HTTP/1.1 304 Not Modified\r\n" + "\r\n"
);
cacheEntry.metaDataReady();

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

@ -295,6 +295,7 @@ var tests = [
// check underflow
[
// eslint-disable-next-line no-useless-concat
"attachment; filename=basic; filename*0*=UTF-8''0;\r\n" + " filename*-1=1",
"attachment",
"0",

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

@ -921,6 +921,7 @@ function myipaddress2_callback(pi) {
function run_failed_script_test() {
// test to make sure we go direct with invalid PAC
// eslint-disable-next-line no-useless-concat
var pac = "data:text/plain," + "\nfor(;\n";
var channel = NetUtil.newChannel({