Bug 1558485 - Turn on ESLint for all of dom/ disabling most of the failing rules. r=smaug

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mark Banner 2019-06-13 20:21:46 +00:00
parent c51c2a8807
commit 201255ab84
23 changed files with 216 additions and 71 deletions

View file

@ -12,52 +12,13 @@
obj*/** obj*/**
# dom/ exclusions which should be removed (aka ESLint enabled) # dom/ exclusions which should be removed (aka ESLint enabled)
dom/animation/**
dom/base/*.* dom/base/*.*
dom/base/test/*.* dom/base/test/*.*
dom/base/test/unit/test_serializers_entities*.js
dom/base/test/unit_ipc/**
dom/base/test/jsmodules/** dom/base/test/jsmodules/**
dom/canvas/**
dom/encoding/**
dom/events/**
dom/fetch/**
dom/file/**
dom/html/**
dom/jsurl/**
dom/media/test/** dom/media/test/**
!dom/media/test/marionette/yttest/*.js !dom/media/test/marionette/yttest/*.js
dom/media/tests/**
dom/media/webaudio/**
dom/media/webspeech/**
dom/messagechannel/**
dom/midi/**
dom/network/**
dom/payments/**
dom/performance/**
dom/permission/**
dom/promise/** dom/promise/**
dom/quota/**
dom/security/test/cors/**
dom/security/test/csp/**
dom/security/test/general/**
dom/security/test/mixedcontentblocker/**
dom/security/test/sri/**
dom/serviceworkers/**
dom/smil/**
dom/tests/mochitest/**
dom/u2f/**
dom/vr/**
dom/webauthn/**
dom/webgpu/**
dom/websocket/**
dom/workers/**
dom/worklet/**
dom/xbl/**
dom/xhr/** dom/xhr/**
dom/xml/**
dom/xslt/**
dom/xul/**
# build/ third-party code # build/ third-party code
build/pgo/js-input/** build/pgo/js-input/**
@ -207,6 +168,26 @@ dom/media/webvtt/**
dom/svg/test/test_nonAnimStrings.xhtml dom/svg/test/test_nonAnimStrings.xhtml
dom/svg/test/test_SVG_namespace_ids.html dom/svg/test/test_SVG_namespace_ids.html
# Strange encodings
dom/encoding/test/test_utf16_files.html
dom/encoding/test/file_utf16_be_bom.js
dom/encoding/test/file_utf16_le_bom.js
# Not parsable
dom/tests/mochitest/general/test_focusrings.xul
dom/html/test/test_bug677658.html
# Intentional broken files
dom/base/test/file_js_cache_syntax_error.js
dom/media/tests/mochitest/identity/idp-bad.js
dom/serviceworkers/test/file_js_cache_syntax_error.js
dom/serviceworkers/test/parse_error_worker.js
dom/tests/mochitest/bugs/test_bug531176.html
dom/webauthn/tests/cbor.js
dom/workers/test/importScripts_worker_imported3.js
dom/workers/test/invalid.js
dom/workers/test/threadErrors_worker1.js
# Third-party # Third-party
editor/libeditor/tests/browserscope/** editor/libeditor/tests/browserscope/**

View file

@ -330,5 +330,138 @@ module.exports = {
"space-unary-ops": "off", "space-unary-ops": "off",
"spaced-comment": "off", "spaced-comment": "off",
} }
}, {
"files": [
"dom/animation/**",
"dom/base/test/*.*",
"dom/base/test/unit/test_serializers_entities*.js",
"dom/base/test/unit_ipc/**",
"dom/base/test/jsmodules/**",
"dom/base/*.*",
"dom/canvas/**",
"dom/encoding/**",
"dom/events/**",
"dom/fetch/**",
"dom/file/**",
"dom/html/**",
"dom/jsurl/**",
"dom/media/tests/**",
"dom/media/webaudio/**",
"dom/media/webspeech/**",
"dom/messagechannel/**",
"dom/midi/**",
"dom/network/**",
"dom/payments/**",
"dom/performance/**",
"dom/permission/**",
"dom/quota/**",
"dom/security/test/cors/**",
"dom/security/test/csp/**",
"dom/security/test/general/**",
"dom/security/test/mixedcontentblocker/**",
"dom/security/test/sri/**",
"dom/serviceworkers/**",
"dom/smil/**",
"dom/tests/mochitest/**",
"dom/u2f/**",
"dom/vr/**",
"dom/webauthn/**",
"dom/webgpu/**",
"dom/websocket/**",
"dom/workers/**",
"dom/worklet/**",
"dom/xbl/**",
"dom/xml/**",
"dom/xslt/**",
"dom/xul/**",
],
"rules": {
"consistent-return": "off",
"dot-notation": "off",
"object-shorthand": "off",
"mozilla/avoid-removeChild": "off",
"mozilla/consistent-if-bracing": "off",
"mozilla/no-arbitrary-setTimeout": "off",
"mozilla/no-compare-against-boolean-literals": "off",
"mozilla/no-define-cc-etc": "off",
"mozilla/no-useless-parameters": "off",
"mozilla/no-useless-run-test": "off",
"mozilla/reject-importGlobalProperties": "off",
"mozilla/use-cc-etc": "off",
"mozilla/use-chromeutils-generateqi": "off",
"mozilla/use-chromeutils-import": "off",
"mozilla/use-includes-instead-of-indexOf": "off",
"mozilla/use-ownerGlobal": "off",
"mozilla/use-services": "off",
"no-array-constructor": "off",
"no-caller": "off",
"no-cond-assign": "off",
"no-control-regex": "off",
"no-debugger": "off",
"no-else-return": "off",
"no-empty": "off",
"no-eval": "off",
"no-extra-boolean-cast": "off",
"no-func-assign": "off",
"no-global-assign": "off",
"no-implied-eval": "off",
"no-lone-blocks": "off",
"no-lonely-if": "off",
"no-nested-ternary": "off",
"no-new-object": "off",
"no-new-wrappers": "off",
"no-octal": "off",
"no-redeclare": "off",
"no-return-await": "off",
"no-restricted-globals": "off",
"no-self-assign": "off",
"no-self-compare": "off",
"no-sequences": "off",
"no-shadow": "off",
"no-shadow-restricted-names": "off",
"no-sparse-arrays": "off",
"no-throw-literal": "off",
"no-unneeded-ternary": "off",
"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",
// Not enabling the rules below for now pending prettier roll-out.
"arrow-spacing": "off",
"block-spacing": "off",
"brace-style": "off",
"comma-dangle": "off",
"comma-spacing": "off",
"comma-style": "off",
"computed-property-spacing": "off",
"eol-last": "off",
"func-call-spacing": "off",
"generator-star-spacing": "off",
"linebreak-style": "off",
"key-spacing": "off",
"keyword-spacing": "off",
"no-extra-semi": "off",
"no-tabs": "off",
"no-mixed-spaces-and-tabs": "off",
"no-multi-spaces": "off",
"no-trailing-spaces": "off",
"no-unexpected-multiline": "off",
"no-whitespace-before-property": "off",
"padded-blocks": "off",
"quotes": "off",
"rest-spread-spacing": "off",
"semi": "off",
"space-before-blocks": "off",
"space-before-function-paren": "off",
"space-infix-ops": "off",
"space-unary-ops": "off",
"spaced-comment": "off",
}
}] }]
}; };

View file

@ -16,7 +16,7 @@ function IsD2DEnabled() {
try { try {
enabled = Cc["@mozilla.org/gfx/info;1"].getService(SpecialPowers.Ci.nsIGfxInfo).D2DEnabled; enabled = Cc["@mozilla.org/gfx/info;1"].getService(SpecialPowers.Ci.nsIGfxInfo).D2DEnabled;
} catch(e) {} } catch(e) {}
return enabled; return enabled;
} }
@ -34,7 +34,7 @@ function IsLinux() {
function IsAzureSkia() { function IsAzureSkia() {
var enabled = false; var enabled = false;
try { try {
var backend = Cc["@mozilla.org/gfx/info;1"].getService(SpecialPowers.Ci.nsIGfxInfo).getInfo().AzureCanvasBackend; var backend = Cc["@mozilla.org/gfx/info;1"].getService(SpecialPowers.Ci.nsIGfxInfo).getInfo().AzureCanvasBackend;
enabled = (backend == "skia"); enabled = (backend == "skia");
@ -45,7 +45,7 @@ function IsAzureSkia() {
function IsAzureCairo() { function IsAzureCairo() {
var enabled = false; var enabled = false;
try { try {
var backend = Cc["@mozilla.org/gfx/info;1"].getService(SpecialPowers.Ci.nsIGfxInfo).getInfo().AzureCanvasBackend; var backend = Cc["@mozilla.org/gfx/info;1"].getService(SpecialPowers.Ci.nsIGfxInfo).getInfo().AzureCanvasBackend;
enabled = (backend == "cairo"); enabled = (backend == "cairo");
@ -3639,7 +3639,7 @@ var ctx = canvas.getContext('2d');
var _thrown = undefined; try { var _thrown = undefined; try {
ctx.drawImage(undefined, 0, 0); ctx.drawImage(undefined, 0, 0);
} catch (e) { _thrown = e }; } catch (e) { _thrown = e };
ok(_thrown && _thrown.name == "TypeError", "should throw TypeError"); ok(_thrown && _thrown.name == "TypeError", "should throw TypeError");
var _thrown = undefined; try { var _thrown = undefined; try {
@ -5891,6 +5891,7 @@ isPixel(ctx, 40,20, 0,255,0,255, 2);
<canvas id="c220" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> <canvas id="c220" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script> <script>
// eslint-disable-next-line complexity
function test_2d_gradient_linear_nonfinite() { function test_2d_gradient_linear_nonfinite() {
var canvas = document.getElementById('c220'); var canvas = document.getElementById('c220');
@ -6704,6 +6705,7 @@ var _thrown = undefined; try {
<canvas id="c244" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> <canvas id="c244" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script> <script>
// eslint-disable-next-line complexity
function test_2d_gradient_radial_nonfinite() { function test_2d_gradient_radial_nonfinite() {
var canvas = document.getElementById('c244'); var canvas = document.getElementById('c244');
@ -7666,6 +7668,7 @@ ok(imgdata2.data[2] === 255, "imgdata2.data[\""+(2)+"\"] === 255");
<canvas id="c265" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> <canvas id="c265" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script> <script>
// eslint-disable-next-line complexity
function test_2d_imageData_get_nonfinite() { function test_2d_imageData_get_nonfinite() {
var canvas = document.getElementById('c265'); var canvas = document.getElementById('c265');
@ -8564,6 +8567,7 @@ isPixel(ctx, 75,25, 0,255,0,255, 2);
<script> <script>
// eslint-disable-next-line complexity
function test_2d_imageData_put_created() { function test_2d_imageData_put_created() {
var canvas = document.getElementById('c291'); var canvas = document.getElementById('c291');
@ -8853,6 +8857,7 @@ isPixel(ctx, 50,25, 0,255,0,255, 2);
<canvas id="c299" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> <canvas id="c299" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script> <script>
// eslint-disable-next-line complexity
function test_2d_imageData_put_nonfinite() { function test_2d_imageData_put_nonfinite() {
var canvas = document.getElementById('c299'); var canvas = document.getElementById('c299');
@ -9236,7 +9241,7 @@ var ctx = canvas.getContext('2d');
var imgdata = { width: 1, height: 1, data: [255, 0, 0, 255] }; var imgdata = { width: 1, height: 1, data: [255, 0, 0, 255] };
var _thrown = undefined; try { var _thrown = undefined; try {
ctx.putImageData(imgdata, 0, 0); ctx.putImageData(imgdata, 0, 0);
} catch (e) { _thrown = e }; } catch (e) { _thrown = e };
ok(_thrown && _thrown.name == "TypeError", "should throw TypeError"); ok(_thrown && _thrown.name == "TypeError", "should throw TypeError");
var _thrown = undefined; try { var _thrown = undefined; try {
@ -10456,6 +10461,7 @@ isPixel(ctx, 86,25, 0,255,0,255, 0);
<canvas id="c331" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> <canvas id="c331" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<script> <script>
// eslint-disable-next-line complexity
function test_2d_missingargs() { function test_2d_missingargs() {
var canvas = document.getElementById('c331'); var canvas = document.getElementById('c331');
@ -19482,7 +19488,7 @@ ok(ctx.createLinearGradient(0, 0, 0, 0).addColorStop(0, 'white') === undefined,
<img id="i3" src="image_green-redirect"> <img id="i3" src="image_green-redirect">
</p> </p>
<div id="content" style="display: none"> <div id="content" style="display: none">
</div> </div>
<pre id="test"> <pre id="test">
<script class="testbody" type="text/javascript"> <script class="testbody" type="text/javascript">
@ -19502,7 +19508,7 @@ function test_bug397524() {
$("canvas1").toDataURL("image/png"); $("canvas1").toDataURL("image/png");
// Should not be able to get the data out of a cross-site load // Should not be able to get the data out of a cross-site load
var gotData = false; var gotData = false;
try { try {
$("canvas2").toDataURL("image/png"); $("canvas2").toDataURL("image/png");
gotData = true; gotData = true;
@ -19514,7 +19520,7 @@ function test_bug397524() {
is(gotData, false, "Shouldn't be able to read images cross-site!"); is(gotData, false, "Shouldn't be able to read images cross-site!");
// Should not be able to get the data out of a redirected cross-site load // Should not be able to get the data out of a redirected cross-site load
var gotData = false; var gotData = false;
try { try {
$("canvas3").toDataURL("image/png"); $("canvas3").toDataURL("image/png");
gotData = true; gotData = true;
@ -21160,7 +21166,7 @@ by multiplying by 255/a and rounding down. So if
we will get a change in value when we go through a putImageData/getImageData cycle. Therefore, to make sure we don't have to worry about our color we will get a change in value when we go through a putImageData/getImageData cycle. Therefore, to make sure we don't have to worry about our color
channels, our alpha channel should never be < 250, unless it's 0. And when it's 0, all our color channels will come back as 0 too. */ channels, our alpha channel should never be < 250, unless it's 0. And when it's 0, all our color channels will come back as 0 too. */
/* Our tests. Each test has two arrays: the array of values to set and the /* Our tests. Each test has two arrays: the array of values to set and the
array of values that should read back as a result. */ array of values that should read back as a result. */
var tests = [ var tests = [
@ -21236,7 +21242,7 @@ function doTests(type) {
var canvas681; var canvas681;
var ctx681; var ctx681;
function test_2d_imagedata_coercion() { function test_2d_imagedata_coercion() {
canvas681 = document.getElementById('c681'); canvas681 = document.getElementById('c681');
@ -22337,7 +22343,8 @@ function asyncTestsDone() {
setTimeout(asyncTestsDone, 500); setTimeout(asyncTestsDone, 500);
} }
} }
// eslint-disable-next-line complexity
function runTests() { function runTests() {
/** /**
* xor and lighter aren't well handled by cairo; they mostly work, but we don't want * xor and lighter aren't well handled by cairo; they mostly work, but we don't want
@ -22353,7 +22360,7 @@ function runTests() {
//test_2d_composite_canvas_lighter(); //test_2d_composite_canvas_lighter();
//test_2d_composite_clip_xor(); //test_2d_composite_clip_xor();
//test_2d_composite_clip_lighter(); //test_2d_composite_clip_lighter();
/** /**
* Temporarily disabled tests; unbounded operators changed behaviour, need to reevaluate tests * Temporarily disabled tests; unbounded operators changed behaviour, need to reevaluate tests
*/ */
@ -22365,7 +22372,7 @@ function runTests() {
//test_2d_composite_image_destination_in(); //test_2d_composite_image_destination_in();
//test_2d_composite_image_source_in(); //test_2d_composite_image_source_in();
//test_2d_composite_image_source_out(); //test_2d_composite_image_source_out();
/** /**
* These tests only pass on Mac OS X >= 10.5; see bug 450114 * These tests only pass on Mac OS X >= 10.5; see bug 450114
*/ */
@ -22373,7 +22380,7 @@ function runTests() {
//test_2d_gradient_radial_touch1(); //test_2d_gradient_radial_touch1();
//test_2d_gradient_radial_touch2(); //test_2d_gradient_radial_touch2();
//test_2d_gradient_radial_touch3(); //test_2d_gradient_radial_touch3();
/** /**
* These 19 tests receive special makefile treatment * These 19 tests receive special makefile treatment
*/ */
@ -22396,7 +22403,7 @@ function runTests() {
//test_2d_path_arc_shape_3(); //test_2d_path_arc_shape_3();
//test_2d_path_rect_selfintersect(); //test_2d_path_rect_selfintersect();
//test_2d_strokeRect_zero_5(); //test_2d_strokeRect_zero_5();
/** /**
* Other tests not being run * Other tests not being run
*/ */
@ -22408,10 +22415,10 @@ function runTests() {
//test_2d_composite_uncovered_pattern_destination_in(); //test_2d_composite_uncovered_pattern_destination_in();
//test_2d_composite_uncovered_pattern_source_in(); //test_2d_composite_uncovered_pattern_source_in();
//test_2d_composite_uncovered_pattern_source_out(); //test_2d_composite_uncovered_pattern_source_out();
//test_2d_path_rect_zero_6(); // This test is bogus according to the spec; see bug 407107 //test_2d_path_rect_zero_6(); // This test is bogus according to the spec; see bug 407107
// These tests are bogus according to the spec: shadows should not be // These tests are bogus according to the spec: shadows should not be
// drawn if shadowBlur, shadowOffsetX, and shadowOffsetY are all zero, whic // drawn if shadowBlur, shadowOffsetX, and shadowOffsetY are all zero, whic
// they are in these tests // they are in these tests
//test_2d_shadow_composite_3(); //test_2d_shadow_composite_3();
@ -25772,7 +25779,7 @@ function runTests() {
} catch (e) { } catch (e) {
ok(false, "unexpected exception thrown in: test_2d_drawImage_animated_gif"); ok(false, "unexpected exception thrown in: test_2d_drawImage_animated_gif");
} }
setTimeout(asyncTestsDone, 500); setTimeout(asyncTestsDone, 500);
} }

View file

@ -13,7 +13,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=563329
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=563329">Mozilla Bug 563329</a> <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=563329">Mozilla Bug 563329</a>
<p id="display"></p> <p id="display"></p>
<div id="content" style="display: none"> <div id="content" style="display: none">
</div> </div>
<pre id="test"> <pre id="test">
<script type="application/javascript"> <script type="application/javascript">
@ -25,7 +25,7 @@ var target = null;
var testGen = getTests(); var testGen = getTests();
var currentTest = null; var currentTest = null;
function getTests() { function* getTests() {
let tests = [ let tests = [
{ "func": function() { setTimeout(doCheckContextMenu, 100)}, "message": "Context menu should has fired"}, { "func": function() { setTimeout(doCheckContextMenu, 100)}, "message": "Context menu should has fired"},
{ "func": function() { setTimeout(doCheckDuration, 100)}, "message": "Context menu should has fired with delay"}, { "func": function() { setTimeout(doCheckDuration, 100)}, "message": "Context menu should has fired with delay"},

View file

@ -17,11 +17,13 @@
<input id="reset" type="reset"> <input id="reset" type="reset">
</p> </p>
<div id="content" style="display: none"> <div id="content" style="display: none">
</div> </div>
<pre id="test"> <pre id="test">
<script type="application/javascript"> <script type="application/javascript">
/* eslint-disable max-nested-callbacks */
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(runTests); SimpleTest.waitForFocus(runTests);

View file

@ -17,6 +17,7 @@ const kKeyList = [
const kStrictKeyPressEvents = const kStrictKeyPressEvents =
SpecialPowers.getBoolPref("dom.keyboardevent.keypress.dispatch_non_printable_keys_only_system_group_in_content"); SpecialPowers.getBoolPref("dom.keyboardevent.keypress.dispatch_non_printable_keys_only_system_group_in_content");
/* eslint-disable mozilla/no-arbitrary-setTimeout */
function frameScript() { function frameScript() {
let doc = content.document; let doc = content.document;
addMessageListener("Test:RequestFullscreen", () => { addMessageListener("Test:RequestFullscreen", () => {
@ -52,6 +53,7 @@ function frameScript() {
} }
waitUntilActive(); waitUntilActive();
} }
/* eslint-enable mozilla/no-arbitrary-setTimeout */
var gMessageManager; var gMessageManager;

View file

@ -6,6 +6,7 @@
// error. // error.
SimpleTest.ignoreAllUncaughtExceptions(true); SimpleTest.ignoreAllUncaughtExceptions(true);
/* eslint-disable mozilla/no-arbitrary-setTimeout */
function frameScript() { function frameScript() {
addMessageListener("Test:RequestFullscreen", () => { addMessageListener("Test:RequestFullscreen", () => {
content.document.body.requestFullscreen(); content.document.body.requestFullscreen();
@ -27,6 +28,7 @@ function frameScript() {
} }
waitUntilActive(); waitUntilActive();
} }
/* eslint-enable mozilla/no-arbitrary-setTimeout */
var gMessageManager; var gMessageManager;
@ -95,6 +97,7 @@ add_task(async function() {
// Wait a small time to confirm that the first ESC key // Wait a small time to confirm that the first ESC key
// does not exit fullscreen. // does not exit fullscreen.
// eslint-disable-next-line mozilla/no-arbitrary-setTimeout
await new Promise(resolve => setTimeout(resolve, 1000)); await new Promise(resolve => setTimeout(resolve, 1000));
gMessageManager.sendAsyncMessage("Test:QueryFullscreenState"); gMessageManager.sendAsyncMessage("Test:QueryFullscreenState");
state = await promiseOneMessage("Test:FullscreenState"); state = await promiseOneMessage("Test:FullscreenState");

View file

@ -61,6 +61,7 @@ async function runTest() {
// Ensure the browser exits fullscreen state in reasonable time. // Ensure the browser exits fullscreen state in reasonable time.
await Promise.race([ await Promise.race([
BrowserTestUtils.waitForCondition(() => getSizeMode() == "normal"), BrowserTestUtils.waitForCondition(() => getSizeMode() == "normal"),
// eslint-disable-next-line mozilla/no-arbitrary-setTimeout
new Promise(resolve => setTimeout(resolve, 2000)) new Promise(resolve => setTimeout(resolve, 2000))
]); ]);

View file

@ -14,6 +14,7 @@
<script class="testbody" type="application/javascript"> <script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
// eslint-disable-next-line complexity
SimpleTest.waitForFocus(() => { SimpleTest.waitForFocus(() => {
let content = document.getElementById("content"); let content = document.getElementById("content");
/** /**

View file

@ -315,6 +315,7 @@ var pedanticChecks = report => {
[...report.keys()].forEach(key => is(report[key], undefined, [...report.keys()].forEach(key => is(report[key], undefined,
`Report is not dictionary like, it lacks a property for key ${key}`)); `Report is not dictionary like, it lacks a property for key ${key}`));
// eslint-disable-next-line complexity
report.forEach((statObj, mapKey) => { report.forEach((statObj, mapKey) => {
let tested = {}; let tested = {};
// Record what fields get tested. // Record what fields get tested.

View file

@ -102,6 +102,7 @@ function discreteSum(sourceBuffer, destBuffer) {
// Speaker channel interpretation mixing: // Speaker channel interpretation mixing:
// https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#UpMix // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#UpMix
// eslint-disable-next-line complexity
function speakersSum(sourceBuffer, destBuffer) function speakersSum(sourceBuffer, destBuffer)
{ {
var numberOfSourceChannels = sourceBuffer.numberOfChannels; var numberOfSourceChannels = sourceBuffer.numberOfChannels;

View file

@ -16,7 +16,7 @@
await navigator.requestMIDIAccess({ "sysex": false }) await navigator.requestMIDIAccess({ "sysex": false })
ok(true, "MIDI Access Request successful"); ok(true, "MIDI Access Request successful");
SimpleTest.finish(); SimpleTest.finish();
} catch { } catch (ex) {
ok(false, "MIDI Access Request Failed!"); ok(false, "MIDI Access Request Failed!");
SimpleTest.finish(); SimpleTest.finish();
} }

View file

@ -16,7 +16,7 @@
await navigator.requestMIDIAccess({ "sysex": false }); await navigator.requestMIDIAccess({ "sysex": false });
ok(false, "MIDI Access Request Deny failed"); ok(false, "MIDI Access Request Deny failed");
SimpleTest.finish(); SimpleTest.finish();
} catch { } catch (ex) {
ok(true, "MIDI Access Request Deny successful!"); ok(true, "MIDI Access Request Deny successful!");
SimpleTest.finish(); SimpleTest.finish();
} }

View file

@ -74,6 +74,7 @@ function checkSimplestRequest(payRequest) {
} }
} }
// eslint-disable-next-line complexity
function checkComplexRequest(payRequest) { function checkComplexRequest(payRequest) {
if (payRequest.topLevelPrincipal.origin != "https://example.com") { if (payRequest.topLevelPrincipal.origin != "https://example.com") {
emitTestFail("Top level principal's origin should be 'https://example.com', but got '" emitTestFail("Top level principal's origin should be 'https://example.com', but got '"

View file

@ -3,7 +3,7 @@
<head> <head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<title>Test for Cross Site XMLHttpRequest</title> <title>Test for Cross Site XMLHttpRequest</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script> <script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head> </head>
<body onload="initTest()"> <body onload="initTest()">
@ -11,7 +11,7 @@
<iframe id=loader></iframe> <iframe id=loader></iframe>
</p> </p>
<div id="content" style="display: none"> <div id="content" style="display: none">
</div> </div>
<pre id="test"> <pre id="test">
<script class="testbody" type="application/javascript"> <script class="testbody" type="application/javascript">
@ -36,10 +36,11 @@ function initTestCallback() {
}); });
gen = runTest(); gen = runTest();
gen.next() gen.next()
} }
// eslint-disable-next-line complexity
function* runTest() { function* runTest() {
var loader = document.getElementById('loader'); var loader = document.getElementById('loader');
var loaderWindow = loader.contentWindow; var loaderWindow = loader.contentWindow;

View file

@ -62,7 +62,6 @@ var tests = {
}, },
'none-src-by-frame-src': { 'none-src-by-frame-src': {
id: "none-src-by-frame-src", id: "none-src-by-frame-src",
file: "file_child-src_iframe.html",
file: IFRAME_SRC, file: IFRAME_SRC,
result : "blocked", result : "blocked",
policy : "default-src 'none'; script-src 'unsafe-inline'; child-src http://mochi.test:8888; frame-src 'none'" policy : "default-src 'none'; script-src 'unsafe-inline'; child-src http://mochi.test:8888; frame-src 'none'"

View file

@ -11,9 +11,11 @@ const USER_CONTEXT_ID = 3
let mockAlertsService = { let mockAlertsService = {
showAlert: function(alert, alertListener) { showAlert: function(alert, alertListener) {
ok(true, "Showing alert"); ok(true, "Showing alert");
// eslint-disable-next-line mozilla/no-arbitrary-setTimeout
setTimeout(function () { setTimeout(function () {
alertListener.observe(null, "alertshow", alert.cookie); alertListener.observe(null, "alertshow", alert.cookie);
}, 100); }, 100);
// eslint-disable-next-line mozilla/no-arbitrary-setTimeout
setTimeout(function () { setTimeout(function () {
alertListener.observe(null, "alertclickcallback", alert.cookie); alertListener.observe(null, "alertclickcallback", alert.cookie);
}, 100); }, 100);

View file

@ -1,5 +1,6 @@
var seenIndex = false; var seenIndex = false;
// eslint-disable-next-line complexity
onfetch = function(ev) { onfetch = function(ev) {
if (ev.request.url.includes("ignore")) { if (ev.request.url.includes("ignore")) {
return; return;

View file

@ -27,7 +27,7 @@
{ scope: "./sw_clients/focus_stealing_client.html" }) { scope: "./sw_clients/focus_stealing_client.html" })
.then((swr) => { .then((swr) => {
registration = swr; registration = swr;
returun waitForState(swr.installing, 'activated', swr); return waitForState(swr.installing, 'activated', swr);
}); });
} }
@ -97,4 +97,3 @@
</pre> </pre>
</body> </body>
</html> </html>

View file

@ -142,7 +142,7 @@ async function test_noUint8Array_continue(r, that) {
try { try {
await r.blob(); await r.blob();
that.ok(false, "We cannot have a blob here!"); that.ok(false, "We cannot have a blob here!");
} catch { } catch (ex) {
that.ok(true, "We cannot have a blob here!"); that.ok(true, "We cannot have a blob here!");
} }
} }

View file

@ -8,6 +8,8 @@
<script type="text/javascript"> <script type="text/javascript">
/* eslint-disable max-nested-callbacks */
/* /*
This is strictly implementation specific test for dom storage code from bug 600307. This is strictly implementation specific test for dom storage code from bug 600307.
It exercises code for asynchronous data flushing with regard to cache life time and its preload. It exercises code for asynchronous data flushing with regard to cache life time and its preload.

View file

@ -197,7 +197,7 @@ function expectException(func, msg) {
ok(failed, msg + " succeeded, but should have failed."); ok(failed, msg + " succeeded, but should have failed.");
} }
function runTest() { function* runTest() {
// We can't enable universal XPConnect privleges in this function, because // We can't enable universal XPConnect privleges in this function, because
// test 5 needs to be running at normal privleges in order to test the // test 5 needs to be running at normal privleges in order to test the
// same-origin policy. // same-origin policy.
@ -531,7 +531,7 @@ function runTest() {
locationEndsWith(popup, "good1.html"); locationEndsWith(popup, "good1.html");
// Even though we replaceState with title "state 1", the title should remain // Even though we replaceState with title "state 1", the title should remain
// "test 1" because we ignore the title argument in push/replaceState. // "test 1" because we ignore the title argument in push/replaceState.
// See bug 544535. // See bug 544535.
is(getSHTitle(shistory), "test 1", "SHEntry title 'state 1'"); is(getSHTitle(shistory), "test 1", "SHEntry title 'state 1'");

View file

@ -24,7 +24,15 @@ dom/media/webspeech/recognition/energy_endpointer.cc
dom/media/webspeech/recognition/energy_endpointer.h dom/media/webspeech/recognition/energy_endpointer.h
dom/media/webspeech/recognition/energy_endpointer_params.cc dom/media/webspeech/recognition/energy_endpointer_params.cc
dom/media/webspeech/recognition/energy_endpointer_params.h dom/media/webspeech/recognition/energy_endpointer_params.h
dom/tests/ajax/jquery/
dom/tests/ajax/mochikit/
dom/tests/mochitest/ajax/
dom/tests/mochitest/dom-level1-core/
dom/tests/mochitest/dom-level2-core/
dom/tests/mochitest/dom-level2-html/
dom/u2f/tests/pkijs/
dom/webauthn/cbor-cpp/ dom/webauthn/cbor-cpp/
dom/webauthn/tests/pkijs/
editor/libeditor/tests/browserscope/lib/richtext/ editor/libeditor/tests/browserscope/lib/richtext/
editor/libeditor/tests/browserscope/lib/richtext2/ editor/libeditor/tests/browserscope/lib/richtext2/
extensions/spellcheck/hunspell/src/ extensions/spellcheck/hunspell/src/