Bug 1609998 - Enable ESLint for non-third party files in editor/libeditor/tests/browserscope/. r=m_kato

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mark Banner 2020-01-21 17:00:48 +00:00
Родитель e88d437de8
Коммит 07db0a7e2b
3 изменённых файлов: 19 добавлений и 18 удалений

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

@ -137,9 +137,6 @@ dom/workers/test/importScripts_worker_imported3.js
dom/workers/test/invalid.js
dom/workers/test/threadErrors_worker1.js
# Third-party
editor/libeditor/tests/browserscope/
# intl/ exclusions
intl/locale/
intl/strres/

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

@ -7,7 +7,7 @@ BrowserScope richtext category tests
<title>BrowserScope Richtext Tests</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script src="/tests/SimpleTest/EventUtils.js"></script>
<script src="/tests/SimpleTest/EventUtils.js"></script>
<script type="text/javascript" src="lib/richtext/currentStatus.js"></script>
</head>
<body>
@ -27,7 +27,7 @@ function sendScore(results, continueParams) {
ok(results.length > 1, "At least one test should have been run");
for (var i = 1; i < results.length; ++i) {
var result = results[i];
[type, command, param, success] = result.split(/[\-=]/);
let [type, command, param, success] = result.split(/[\-=]/);
var comp = is;
if (isKnownFailure(type, command, param)) {
comp = todo_is;

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

@ -14,7 +14,7 @@ http://code.google.com/p/browserscope/source/browse/trunk/categories/richtext2/u
<title>BrowserScope Richtext2 Tests</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script src="/tests/SimpleTest/EventUtils.js"></script>
<script src="/tests/SimpleTest/EventUtils.js"></script>
<!-- utility scripts -->
<script type="text/javascript" src="lib/richtext2/richtext2/static/js/variables.js"></script>
@ -68,10 +68,13 @@ http://code.google.com/p/browserscope/source/browse/trunk/categories/richtext2/u
);
}
/* eslint-disable-next-line complexity */
function runTest() {
initVariables();
initEditorDocs();
// These are all globals in the js and py files above */
/* eslint-disable no-undef */
const tests = [
SELECTION_TESTS,
APPLY_TESTS,
@ -89,8 +92,9 @@ http://code.google.com/p/browserscope/source/browse/trunk/categories/richtext2/u
QUERYSTATE_TESTS,
QUERYVALUE_TESTS,
];
/* eslint-enable no-undef */
for (var i = 0; i < tests.length; ++i) {
for (let i = 0; i < tests.length; ++i) {
runTestSuite(tests[i]);
}
@ -132,10 +136,10 @@ http://code.google.com/p/browserscope/source/browse/trunk/categories/richtext2/u
// 'body' (test within a <body contenteditable="true">)
if (UPDATE_TEST_RESULTS) {
var newKnownFailures = {value: {}, select: {}};
for (var i = 0; i < tests.length; ++i) {
var category = tests[i];
for (var group in results[category.id]) {
let newKnownFailures = {value: {}, select: {}};
for (let i = 0; i < tests.length; ++i) {
let category = tests[i];
for (let group in results[category.id]) {
switch (group) {
// Skip the known properties
case "count":
@ -144,7 +148,7 @@ http://code.google.com/p/browserscope/source/browse/trunk/categories/richtext2/u
case "time":
break;
default:
for (var test_id in results[category.id][group]) {
for (let test_id in results[category.id][group]) {
switch (test_id) {
// Skip the known properties
case "count":
@ -152,7 +156,7 @@ http://code.google.com/p/browserscope/source/browse/trunk/categories/richtext2/u
case "selscore":
break;
default:
for (var structure in results[category.id][group][test_id]) {
for (let structure in results[category.id][group][test_id]) {
switch (structure) {
// Only look at each test structure
case "dM":
@ -175,9 +179,9 @@ http://code.google.com/p/browserscope/source/browse/trunk/categories/richtext2/u
resultContainer.style.display = "";
resultContainer.textContent = JSON.stringify(newKnownFailures);
} else {
for (var i = 0; i < tests.length; ++i) {
var category = tests[i];
for (var group in results[category.id]) {
for (let i = 0; i < tests.length; ++i) {
let category = tests[i];
for (let group in results[category.id]) {
switch (group) {
// Skip the known properties
case "count":
@ -186,7 +190,7 @@ http://code.google.com/p/browserscope/source/browse/trunk/categories/richtext2/u
case "time":
break;
default:
for (var test_id in results[category.id][group]) {
for (let test_id in results[category.id][group]) {
switch (test_id) {
// Skip the known properties
case "count":
@ -194,7 +198,7 @@ http://code.google.com/p/browserscope/source/browse/trunk/categories/richtext2/u
case "selscore":
break;
default:
for (var structure in results[category.id][group][test_id]) {
for (let structure in results[category.id][group][test_id]) {
switch (structure) {
// Only look at each test structure
case "dM":