forked from mirrors/gecko-dev
Bug 1792694 - Set up ESLint on the dom/ directory for enabling no-unused-vars and no-undef in more places across the dom tests. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D158254
This commit is contained in:
parent
d4aadf5320
commit
860b0acba4
5 changed files with 81 additions and 6 deletions
|
|
@ -31,9 +31,8 @@ const chromeTestPaths = ["**/test*/chrome/"];
|
|||
const mochitestTestPaths = [
|
||||
// Note: we do not want to match testing/mochitest as that would apply
|
||||
// too many globals for that directory.
|
||||
"**/test/mochitest/",
|
||||
"**/tests/mochitest/",
|
||||
"**/test/mochitests/",
|
||||
"**/test/mochitest*/",
|
||||
"**/tests/mochitest*/",
|
||||
"testing/mochitest/tests/SimpleTest/",
|
||||
"testing/mochitest/tests/Harness_sanity/",
|
||||
];
|
||||
|
|
@ -187,9 +186,12 @@ const extraBrowserTestPaths = [
|
|||
"dom/payments/test/",
|
||||
"dom/plugins/test/mochitest/",
|
||||
"dom/reporting/tests/",
|
||||
"dom/security/test/cors/",
|
||||
"dom/security/test/csp/",
|
||||
"dom/security/test/general/",
|
||||
"dom/security/test/https-first/",
|
||||
"dom/security/test/https-only/",
|
||||
"dom/security/test/mixedcontentblocker/",
|
||||
"dom/security/test/referrer-policy/",
|
||||
"dom/security/test/sec-fetch/",
|
||||
"dom/serviceworkers/test/",
|
||||
|
|
@ -325,7 +327,10 @@ const extraMochitestTestPaths = [
|
|||
"dom/push/test/",
|
||||
"dom/quota/test/modules/content/",
|
||||
"dom/reporting/tests/",
|
||||
"dom/security/test/cors/",
|
||||
"dom/security/test/csp/",
|
||||
"dom/security/test/https-only/",
|
||||
"dom/security/test/mixedcontentblocker/",
|
||||
"dom/security/test/referrer-policy/",
|
||||
"dom/security/test/sec-fetch/",
|
||||
"dom/security/test/sri/",
|
||||
|
|
@ -402,8 +407,11 @@ let expectedDupePaths = new Set([
|
|||
"dom/plugins/test/mochitest/",
|
||||
"dom/promise/tests/",
|
||||
"dom/reporting/tests/",
|
||||
"dom/security/test/cors/",
|
||||
"dom/security/test/csp/",
|
||||
"dom/security/test/general/",
|
||||
"dom/security/test/https-only/",
|
||||
"dom/security/test/mixedcontentblocker/",
|
||||
"dom/security/test/referrer-policy/",
|
||||
"dom/security/test/sec-fetch/",
|
||||
"dom/serviceworkers/test/",
|
||||
|
|
|
|||
61
.eslintrc.js
61
.eslintrc.js
|
|
@ -370,14 +370,58 @@ module.exports = {
|
|||
"no-unreachable": "off",
|
||||
"no-unsanitized/method": "off",
|
||||
"no-unsanitized/property": "off",
|
||||
"no-undef": "off",
|
||||
"no-unused-vars": "off",
|
||||
"no-useless-call": "off",
|
||||
"no-useless-concat": "off",
|
||||
"no-useless-return": "off",
|
||||
"no-with": "off",
|
||||
},
|
||||
},
|
||||
{
|
||||
// Bug 1792693: Gradually enable no-undef and no-unused-vars on these
|
||||
// directories.
|
||||
files: [
|
||||
"dom/animation/test/**",
|
||||
"dom/base/test/*.*",
|
||||
"dom/base/test/unit/test_serializers_entities*.js",
|
||||
"dom/base/test/unit_ipc/**",
|
||||
"dom/base/test/jsmodules/**",
|
||||
"dom/canvas/test/**",
|
||||
"dom/encoding/test/**",
|
||||
"dom/events/test/**",
|
||||
"dom/file/ipc/tests/**",
|
||||
"dom/file/tests/**",
|
||||
"dom/html/test/**",
|
||||
"dom/media/tests/**",
|
||||
"dom/media/webaudio/test/**",
|
||||
"dom/media/webrtc/tests/**",
|
||||
"dom/media/webspeech/recognition/test/**",
|
||||
"dom/media/webspeech/synth/test/**",
|
||||
"dom/payments/test/**",
|
||||
"dom/performance/tests/**",
|
||||
"dom/quota/test/browser/**",
|
||||
"dom/quota/test/common/**",
|
||||
"dom/quota/test/mochitest/**",
|
||||
"dom/quota/test/xpcshell/**",
|
||||
"dom/security/test/cors/**",
|
||||
"dom/security/test/csp/**",
|
||||
"dom/security/test/mixedcontentblocker/**",
|
||||
"dom/serviceworkers/test/**",
|
||||
"dom/smil/test/**",
|
||||
"dom/tests/mochitest/**",
|
||||
"dom/u2f/tests/**",
|
||||
"dom/vr/test/**",
|
||||
"dom/webauthn/tests/**",
|
||||
"dom/webgpu/mochitest/**",
|
||||
"dom/websocket/tests/**",
|
||||
"dom/workers/test/**",
|
||||
"dom/worklet/tests/**",
|
||||
"dom/xslt/tests/**",
|
||||
],
|
||||
rules: {
|
||||
"no-undef": "off",
|
||||
"no-unused-vars": "off",
|
||||
},
|
||||
},
|
||||
{
|
||||
files: [
|
||||
"dom/base/test/chrome/file_bug1139964.xhtml",
|
||||
|
|
@ -1586,6 +1630,10 @@ module.exports = {
|
|||
"dom/performance/tests/test_performance_paint_observer_helper.html",
|
||||
"dom/performance/tests/test_performance_paint_timing_helper.html",
|
||||
"dom/quota/test/xpcshell/make_unknownFiles.js",
|
||||
"dom/security/test/cors/file_bug1456721.html",
|
||||
"dom/security/test/cors/test_CrossSiteXHR.html",
|
||||
"dom/security/test/cors/test_CrossSiteXHR_cache.html",
|
||||
"dom/security/test/cors/test_CrossSiteXHR_origin.html",
|
||||
"dom/security/test/csp/browser_manifest-src-override-default-src.js",
|
||||
"dom/security/test/csp/browser_test_uir_optional_clicks.js",
|
||||
"dom/security/test/csp/browser_test_web_manifest.js",
|
||||
|
|
@ -1680,6 +1728,15 @@ module.exports = {
|
|||
"dom/security/test/https-only/test_http_background_request.html",
|
||||
"dom/security/test/https-only/test_resource_upgrade.html",
|
||||
"dom/security/test/https-only/test_user_suggestion_box.html",
|
||||
"dom/security/test/mixedcontentblocker/browser_test_mixed_content_download.js",
|
||||
"dom/security/test/mixedcontentblocker/download_page.html",
|
||||
"dom/security/test/mixedcontentblocker/file_auth_download_page.html",
|
||||
"dom/security/test/mixedcontentblocker/file_frameNavigation.html",
|
||||
"dom/security/test/mixedcontentblocker/file_frameNavigation_blankTarget.html",
|
||||
"dom/security/test/mixedcontentblocker/file_frameNavigation_secure_grandchild.html",
|
||||
"dom/security/test/mixedcontentblocker/file_main.html",
|
||||
"dom/security/test/mixedcontentblocker/file_main_bug803225.html",
|
||||
"dom/security/test/mixedcontentblocker/file_redirect_handler.sjs",
|
||||
"dom/security/test/referrer-policy/browser_referrer_disallow_cross_site_relaxing.js",
|
||||
"dom/security/test/referrer-policy/img_referrer_testserver.sjs",
|
||||
"dom/security/test/referrer-policy/referrer_testserver.sjs",
|
||||
|
|
|
|||
|
|
@ -173,6 +173,8 @@ MediaStreamPlayback.prototype = {
|
|||
// haxx to prevent SimpleTest from failing at window.onload
|
||||
function addLoadEvent() {}
|
||||
|
||||
/* import-globals-from /testing/mochitest/tests/SimpleTest/SimpleTest.js */
|
||||
/* import-globals-from head.js */
|
||||
var scriptsReady = Promise.all(
|
||||
["/tests/SimpleTest/SimpleTest.js", "head.js"].map(script => {
|
||||
var el = document.createElement("script");
|
||||
|
|
|
|||
|
|
@ -2376,6 +2376,14 @@ function loadScript(...scripts) {
|
|||
}
|
||||
|
||||
// Ensure SimpleTest.js is loaded before other scripts.
|
||||
/* import-globals-from /testing/mochitest/tests/SimpleTest/SimpleTest.js */
|
||||
/* import-globals-from head.js */
|
||||
/* import-globals-from templates.js */
|
||||
/* import-globals-from turnConfig.js */
|
||||
/* import-globals-from dataChannel.js */
|
||||
/* import-globals-from network.js */
|
||||
/* import-globals-from sdpUtils.js */
|
||||
|
||||
var scriptsReady = loadScript("/tests/SimpleTest/SimpleTest.js").then(() => {
|
||||
return loadScript(
|
||||
"head.js",
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ async function runTest(url, link, checkFunction, description) {
|
|||
await SpecialPowers.popPrefEnv();
|
||||
}
|
||||
|
||||
add_task(async function setup() {
|
||||
add_setup(async () => {
|
||||
let list = await Downloads.getList(Downloads.ALL);
|
||||
list.addView(downloadMonitoringView);
|
||||
registerCleanupFunction(() => list.removeView(downloadMonitoringView));
|
||||
|
|
|
|||
Loading…
Reference in a new issue