From c9d6056854c5eea797b7f3dbcd3e71619a9aa3c0 Mon Sep 17 00:00:00 2001 From: Bryce Van Dyk Date: Wed, 30 May 2018 08:18:54 -0400 Subject: [PATCH] Bug 1465409 - Change lint rules for mediasource tests to prefer no spaces for array notation. r=jya Change rules so we enforce ["foo", "bar"] rather than [ "foo", "bar" ]. MozReview-Commit-ID: KX6wJd8jmeJ --HG-- extra : rebase_source : 6800cf4e701a33f246418e0deb35a206af8104f4 --- dom/media/mediasource/test/.eslintrc.js | 2 +- dom/media/mediasource/test/mediasource.js | 10 +++++----- dom/media/mediasource/test/test_AVC3_mp4.html | 2 +- .../mediasource/test/test_AudioChange_mp4.html | 10 +++++----- .../mediasource/test/test_BufferingWait_mp4.html | 12 ++++++------ dom/media/mediasource/test/test_ChangeType.html | 14 +++++++------- .../test_ChangeWhileWaitingOnMissingData_mp4.html | 6 +++--- .../test/test_DrainOnMissingData_mp4.html | 6 +++--- .../mediasource/test/test_DurationChange.html | 2 +- .../mediasource/test/test_DurationUpdated.html | 2 +- .../mediasource/test/test_DurationUpdated_mp4.html | 2 +- dom/media/mediasource/test/test_Eviction_mp4.html | 6 +++--- .../mediasource/test/test_ExperimentalAsync.html | 6 +++--- .../mediasource/test/test_FrameSelection.html | 4 ++-- .../mediasource/test/test_FrameSelection_mp4.html | 8 ++++---- dom/media/mediasource/test/test_LiveSeekable.html | 2 +- .../mediasource/test/test_LoadedDataFired_mp4.html | 2 +- .../test/test_MediaSource_disabled.html | 2 +- .../test/test_MediaSource_flac_mp4.html | 2 +- .../test/test_MediaSource_memory_reporting.html | 2 +- .../test/test_MultipleInitSegments.html | 8 ++++---- .../test/test_MultipleInitSegments_mp4.html | 2 +- dom/media/mediasource/test/test_OnEvents.html | 10 +++++----- dom/media/mediasource/test/test_PlayEvents.html | 10 +++++----- .../test/test_PlayEventsAutoPlaying.html | 4 ++-- .../test/test_PlayEventsAutoPlaying2.html | 4 ++-- .../test/test_ResumeAfterClearing_mp4.html | 4 ++-- .../mediasource/test/test_SeekNoData_mp4.html | 4 ++-- dom/media/mediasource/test/test_SeekToEnd_mp4.html | 6 +++--- .../mediasource/test/test_SeekToLastFrame_mp4.html | 2 +- dom/media/mediasource/test/test_SeekTwice_mp4.html | 4 ++-- .../mediasource/test/test_SeekedEvent_mp4.html | 10 +++++----- dom/media/mediasource/test/test_Sequence_mp4.html | 6 +++--- dom/media/mediasource/test/test_Threshold_mp4.html | 4 ++-- .../mediasource/test/test_TimestampOffset_mp4.html | 10 +++++----- .../test/test_WaitingOnMissingDataEnded_mp4.html | 4 ++-- .../test/test_WaitingOnMissingData_mp4.html | 8 ++++---- .../test/test_WaitingToEndedTransition_mp4.html | 4 ++-- .../test/test_WebMTagsBeforeCluster.html | 2 +- 39 files changed, 104 insertions(+), 104 deletions(-) diff --git a/dom/media/mediasource/test/.eslintrc.js b/dom/media/mediasource/test/.eslintrc.js index 2af31a428ad0..87ea04da2a26 100644 --- a/dom/media/mediasource/test/.eslintrc.js +++ b/dom/media/mediasource/test/.eslintrc.js @@ -23,7 +23,7 @@ module.exports = { }, // Use const/let instead of var for tighter scoping, avoiding redeclaration "rules": { - "array-bracket-spacing": ["error", "always"], + "array-bracket-spacing": ["error", "never"], "no-var": "error", "prefer-const": "error" } diff --git a/dom/media/mediasource/test/mediasource.js b/dom/media/mediasource/test/mediasource.js index ce65e64b1b9d..0568b922d6e9 100644 --- a/dom/media/mediasource/test/mediasource.js +++ b/dom/media/mediasource/test/mediasource.js @@ -1,9 +1,9 @@ // Helpers for Media Source Extensions tests let gMSETestPrefs = [ - [ "media.mediasource.enabled", true ], - [ "media.audio-max-decode-error", 0 ], - [ "media.video-max-decode-error", 0 ], + ["media.mediasource.enabled", true], + ["media.audio-max-decode-error", 0], + ["media.video-max-decode-error", 0], ]; // Called before runWithMSE() to set the prefs before running MSE tests. @@ -187,8 +187,8 @@ async function waitUntilTime(target, targetTime) { // Log events for debugging. function logEvents(el) { - [ "suspend", "play", "canplay", "canplaythrough", "loadstart", "loadedmetadata", + ["suspend", "play", "canplay", "canplaythrough", "loadstart", "loadedmetadata", "loadeddata", "playing", "ended", "error", "stalled", "emptied", "abort", "waiting", "pause", "durationchange", "seeking", - "seeked" ].forEach(type => el.addEventListener(type, e => info(`got ${e.type} event`))); + "seeked"].forEach(type => el.addEventListener(type, e => info(`got ${e.type} event`))); } diff --git a/dom/media/mediasource/test/test_AVC3_mp4.html b/dom/media/mediasource/test/test_AVC3_mp4.html index 581f56c7620d..7f3e6cdd8871 100644 --- a/dom/media/mediasource/test/test_AVC3_mp4.html +++ b/dom/media/mediasource/test/test_AVC3_mp4.html @@ -18,7 +18,7 @@ runWithMSE(async (ms, el) => { ok(true, "Receive a sourceopen event"); const videosb = ms.addSourceBuffer("video/mp4"); - await fetchAndLoad(videosb, "avc3/init", [ "" ], ".mp4"); + await fetchAndLoad(videosb, "avc3/init", [""], ".mp4"); const p = once(el, "loadeddata"); await fetchAndLoad(videosb, "avc3/segment", range(1, 2), ".m4s"); await p; diff --git a/dom/media/mediasource/test/test_AudioChange_mp4.html b/dom/media/mediasource/test/test_AudioChange_mp4.html index 578e606f2268..7cc20b3069c8 100644 --- a/dom/media/mediasource/test/test_AudioChange_mp4.html +++ b/dom/media/mediasource/test/test_AudioChange_mp4.html @@ -27,16 +27,16 @@ runWithMSE(async (ms, el) => { }); is(el.readyState, el.HAVE_NOTHING, "readyState is HAVE_NOTHING"); let p = once(el, "loadedmetadata"); - await fetchAndLoad(audiosb, "aac20-48000-64000-", [ "init" ], ".mp4"); + await fetchAndLoad(audiosb, "aac20-48000-64000-", ["init"], ".mp4"); await p; ok(true, "got loadedmetadata event"); - p = Promise.all([ once(el, "loadeddata"), once(el, "canplay") ]); - await fetchAndLoad(audiosb, "aac20-48000-64000-", [ "1" ], ".m4s"); + p = Promise.all([once(el, "loadeddata"), once(el, "canplay")]); + await fetchAndLoad(audiosb, "aac20-48000-64000-", ["1"], ".m4s"); await p; ok(true, "got canplay event"); el.play(); - await fetchAndLoad(audiosb, "aac51-48000-128000-", [ "init" ], ".mp4"); - await fetchAndLoad(audiosb, "aac51-48000-128000-", [ "2" ], ".m4s"); + await fetchAndLoad(audiosb, "aac51-48000-128000-", ["init"], ".mp4"); + await fetchAndLoad(audiosb, "aac51-48000-128000-", ["2"], ".m4s"); ms.endOfStream(); await once(el, "ended"); ok(el.currentTime >= 6, "played to the end"); diff --git a/dom/media/mediasource/test/test_BufferingWait_mp4.html b/dom/media/mediasource/test/test_BufferingWait_mp4.html index 6c6cb8f23843..bf319b44eb5a 100644 --- a/dom/media/mediasource/test/test_BufferingWait_mp4.html +++ b/dom/media/mediasource/test/test_BufferingWait_mp4.html @@ -22,23 +22,23 @@ runWithMSE(async (ms, v) => { ok(false, "Got Error: " + e); SimpleTest.finish(); }); - await fetchAndLoad(sb, "bipbop/bipbop", [ "init" ], ".mp4"); - await fetchAndLoad(sb, "bipbop/bipbop", [ "1" ], ".m4s"); - await fetchAndLoad(sb, "bipbop/bipbop", [ "2" ], ".m4s"); + await fetchAndLoad(sb, "bipbop/bipbop", ["init"], ".mp4"); + await fetchAndLoad(sb, "bipbop/bipbop", ["1"], ".m4s"); + await fetchAndLoad(sb, "bipbop/bipbop", ["2"], ".m4s"); /* Note - Missing |bipbop3| segment here corresponding to (1.62, 2.41] */ /* Note - Missing |bipbop4| segment here corresponding to (2.41, 3.20] */ - await fetchAndLoad(sb, "bipbop/bipbop", [ "5" ], ".m4s"); + await fetchAndLoad(sb, "bipbop/bipbop", ["5"], ".m4s"); // last audio sample has a start time of 1.578956s info("Playing video. It should play for a bit, then fire 'waiting'"); v.play(); await waitUntilTime(v, 1.57895); const firstStop = Date.now(); - await fetchAndLoad(sb, "bipbop/bipbop", [ "3" ], ".m4s"); + await fetchAndLoad(sb, "bipbop/bipbop", ["3"], ".m4s"); // last audio sample has a start time of 2.368435 await waitUntilTime(v, 2.36843); const waitDuration = (Date.now() - firstStop) / 1000; ok(waitDuration < 15, `Should not spend inordinate amount of time buffering: ${waitDuration}`); - await fetchAndLoad(sb, "bipbop/bipbop", [ "4" ], ".m4s"); + await fetchAndLoad(sb, "bipbop/bipbop", ["4"], ".m4s"); ms.endOfStream(); await once(v, "ended"); SimpleTest.finish(); diff --git a/dom/media/mediasource/test/test_ChangeType.html b/dom/media/mediasource/test/test_ChangeType.html index cbe30d0b2b78..5e8415b95c49 100644 --- a/dom/media/mediasource/test/test_ChangeType.html +++ b/dom/media/mediasource/test/test_ChangeType.html @@ -11,7 +11,7 @@ SimpleTest.waitForExplicitFinish(); async function setupTest() { - await SpecialPowers.pushPrefEnv({"set": [ [ "media.mediasource.experimental.enabled", true ] ]}); + await SpecialPowers.pushPrefEnv({"set": [["media.mediasource.experimental.enabled", true]]}); } setupTest(); @@ -19,9 +19,9 @@ runWithMSE(function(ms, el) { el.controls = true; once(ms, "sourceopen").then(function() { // Log events for debugging. - const events = [ "suspend", "play", "canplay", "canplaythrough", "loadstart", "loadedmetadata", - "loadeddata", "playing", "ended", "error", "stalled", "emptied", "abort", - "waiting", "pause", "durationchange", "seeking", "seeked" ]; + const events = ["suspend", "play", "canplay", "canplaythrough", "loadstart", "loadedmetadata", + "loadeddata", "playing", "ended", "error", "stalled", "emptied", "abort", + "waiting", "pause", "durationchange", "seeking", "seeked"]; function logEvent(e) { info("got " + e.type + " event"); } @@ -42,7 +42,7 @@ runWithMSE(function(ms, el) { }); is(el.readyState, el.HAVE_NOTHING, "readyState is HAVE_NOTHING"); const loadedmetadataPromises = []; - loadedmetadataPromises.push(fetchAndLoad(videosb, "bipbop/bipbop", [ "init" ], ".mp4")); + loadedmetadataPromises.push(fetchAndLoad(videosb, "bipbop/bipbop", ["init"], ".mp4")); loadedmetadataPromises.push(once(el, "loadedmetadata")); Promise.all(loadedmetadataPromises) .then(function() { @@ -57,7 +57,7 @@ runWithMSE(function(ms, el) { ok(true, "got canplay event"); el.play(); videosb.timestampOffset = el.buffered.end(0); - return fetchAndLoad(videosb, "bipbop/bipbop_480_624kbps-video", [ "init" ], ".mp4"); + return fetchAndLoad(videosb, "bipbop/bipbop_480_624kbps-video", ["init"], ".mp4"); }) .then(fetchAndLoad.bind(null, videosb, "bipbop/bipbop_480_624kbps-video", range(1, 3), ".m4s")) .then(function() { @@ -69,7 +69,7 @@ runWithMSE(function(ms, el) { SimpleTest.finish(); throw e; } - return fetchAndLoad(videosb, "bipbop/bipbop_300-3s", [ "" ], ".webm"); + return fetchAndLoad(videosb, "bipbop/bipbop_300-3s", [""], ".webm"); }) .then(function() { ms.endOfStream(); diff --git a/dom/media/mediasource/test/test_ChangeWhileWaitingOnMissingData_mp4.html b/dom/media/mediasource/test/test_ChangeWhileWaitingOnMissingData_mp4.html index 1674a0cdae32..2cbd149406a3 100644 --- a/dom/media/mediasource/test/test_ChangeWhileWaitingOnMissingData_mp4.html +++ b/dom/media/mediasource/test/test_ChangeWhileWaitingOnMissingData_mp4.html @@ -16,15 +16,15 @@ runWithMSE(async (ms, el) => { await once(ms, "sourceopen"); ok(true, "Receive a sourceopen event"); const sb = ms.addSourceBuffer("video/mp4"); - await fetchAndLoad(sb, "bipbop/bipbop_480_624kbps-video", [ "init" ], ".mp4"); + await fetchAndLoad(sb, "bipbop/bipbop_480_624kbps-video", ["init"], ".mp4"); await fetchAndLoad(sb, "bipbop/bipbop_480_624kbps-video", range(1, 3), ".m4s"); el.play(); // let seek to the last audio frame. // The seek will complete and then playback will stall. el.currentTime = 1.532517; - await Promise.all([ once(el, "seeked"), once(el, "waiting") ]); + await Promise.all([once(el, "seeked"), once(el, "waiting")]); info("seek completed"); - await fetchAndLoad(sb, "bipbop/bipbop", [ "init" ], ".mp4"); + await fetchAndLoad(sb, "bipbop/bipbop", ["init"], ".mp4"); await fetchAndLoad(sb, "bipbop/bipbop", range(1, 4), ".m4s"); ms.endOfStream(); await once(el, "ended"); diff --git a/dom/media/mediasource/test/test_DrainOnMissingData_mp4.html b/dom/media/mediasource/test/test_DrainOnMissingData_mp4.html index 0b3b2b360fdc..406a9ec33e5b 100644 --- a/dom/media/mediasource/test/test_DrainOnMissingData_mp4.html +++ b/dom/media/mediasource/test/test_DrainOnMissingData_mp4.html @@ -16,11 +16,11 @@ runWithMSE(async (ms, el) => { await once(ms, "sourceopen"); ok(true, "Receive a sourceopen event"); const videosb = ms.addSourceBuffer("video/mp4"); - await fetchAndLoad(videosb, "bipbop/bipbop_video", [ "init" ], ".mp4"); + await fetchAndLoad(videosb, "bipbop/bipbop_video", ["init"], ".mp4"); // Set appendWindowEnd to ensure we only have about 6 frames worth. // We must feed at least 6 frames to pass the MDSM pre-roll. videosb.appendWindowEnd = .4; - await fetchAndLoad(videosb, "bipbop/bipbop_video", [ "1" ], ".m4s"); + await fetchAndLoad(videosb, "bipbop/bipbop_video", ["1"], ".m4s"); info("Invoking play()"); const p = once(el, "playing"); await el.play(); @@ -33,7 +33,7 @@ runWithMSE(async (ms, el) => { isfuzzy(el.currentTime, videosb.buffered.end(0) - 1 / 30, 0.04, `Got a waiting event at ${el.currentTime}`); videosb.appendWindowEnd = 1; - await fetchAndLoad(videosb, "bipbop/bipbop_video", [ 1 ], ".m4s"); + await fetchAndLoad(videosb, "bipbop/bipbop_video", [1], ".m4s"); ms.endOfStream(); await once(el, "ended"); // These fuzz factors are bigger than they should be. We should investigate diff --git a/dom/media/mediasource/test/test_DurationChange.html b/dom/media/mediasource/test/test_DurationChange.html index c6358785121d..c84be8eb967c 100644 --- a/dom/media/mediasource/test/test_DurationChange.html +++ b/dom/media/mediasource/test/test_DurationChange.html @@ -18,7 +18,7 @@ runWithMSE(async (ms, v) => { const arrayBuffer = await fetchWithXHR("seek.webm"); sb.appendBuffer(new Uint8Array(arrayBuffer, 0, 318)); - await Promise.all([ once(v, "loadedmetadata"), once(sb, "updateend") ]); + await Promise.all([once(v, "loadedmetadata"), once(sb, "updateend")]); is(v.duration, ms.duration, "video duration is mediasource one"); must_not_throw(() => ms.duration = 0, "duration = 0 is valid initially"); is(v.duration, 0, "reducing duration with no data buffered is valid"); diff --git a/dom/media/mediasource/test/test_DurationUpdated.html b/dom/media/mediasource/test/test_DurationUpdated.html index 8a10904c6887..852b82b2240d 100644 --- a/dom/media/mediasource/test/test_DurationUpdated.html +++ b/dom/media/mediasource/test/test_DurationUpdated.html @@ -23,7 +23,7 @@ runWithMSE(async (ms, v) => { sb.appendBuffer(new Uint8Array(arrayBuffer, 0, 318)); // Adding the first init segment will fire a durationchange. - await Promise.all([ once(sb, "updateend"), once(v, "loadedmetadata") ]); + await Promise.all([once(sb, "updateend"), once(v, "loadedmetadata")]); ok(true, "got loadedmetadata"); // Set mediasource duration to 0, so future appendBuffer // will update the mediasource duration. diff --git a/dom/media/mediasource/test/test_DurationUpdated_mp4.html b/dom/media/mediasource/test/test_DurationUpdated_mp4.html index 31394f9a5bcb..d941115c1f29 100644 --- a/dom/media/mediasource/test/test_DurationUpdated_mp4.html +++ b/dom/media/mediasource/test/test_DurationUpdated_mp4.html @@ -23,7 +23,7 @@ runWithMSE(async (ms, v) => { sb.appendBuffer(new Uint8Array(arrayBuffer, 0, 1395)); // Adding the first init segment will fire a durationchange. - await Promise.all([ once(sb, "updateend"), once(v, "loadedmetadata") ]); + await Promise.all([once(sb, "updateend"), once(v, "loadedmetadata")]); ok(true, "got loadedmetadata"); // Set mediasource duration to 0, so future appendBuffer // will update the mediasource duration. diff --git a/dom/media/mediasource/test/test_Eviction_mp4.html b/dom/media/mediasource/test/test_Eviction_mp4.html index 008dcf7be5d9..77a34d70b479 100644 --- a/dom/media/mediasource/test/test_Eviction_mp4.html +++ b/dom/media/mediasource/test/test_Eviction_mp4.html @@ -16,8 +16,8 @@ SimpleTest.waitForExplicitFinish(); // as the auto-eviction would succeed (removing all data prior currentTime) addMSEPrefs( - [ "media.mediasource.eviction_threshold.audio", 524288 ], - [ "media.dormant-on-pause-timeout-ms", -1 ] // FIXME: bug 1319292 + ["media.mediasource.eviction_threshold.audio", 524288], + ["media.dormant-on-pause-timeout-ms", -1] // FIXME: bug 1319292 ); runWithMSE(async (ms, el) => { @@ -26,7 +26,7 @@ runWithMSE(async (ms, el) => { ok(true, "Receive a sourceopen event"); const audiosb = ms.addSourceBuffer("audio/mp4"); audiosb.mode = "sequence"; - await fetchAndLoad(audiosb, "bipbop/bipbop_audio", [ "init" ], ".mp4"); + await fetchAndLoad(audiosb, "bipbop/bipbop_audio", ["init"], ".mp4"); const audioBuffer = await fetchWithXHR("bipbop/bipbop_audio1.m4s"); await must_reject(async () => { diff --git a/dom/media/mediasource/test/test_ExperimentalAsync.html b/dom/media/mediasource/test/test_ExperimentalAsync.html index 6a42e187764e..d343870a6789 100644 --- a/dom/media/mediasource/test/test_ExperimentalAsync.html +++ b/dom/media/mediasource/test/test_ExperimentalAsync.html @@ -12,9 +12,9 @@ SimpleTest.waitForExplicitFinish(); addMSEPrefs( - [ "media.mediasource.eviction_threshold.audio", 524288 ], - [ "media.dormant-on-pause-timeout-ms", -1 ], // FIXME: bug 1319292 - [ "media.mediasource.experimental.enabled", true ] + ["media.mediasource.eviction_threshold.audio", 524288], + ["media.dormant-on-pause-timeout-ms", -1], // FIXME: bug 1319292 + ["media.mediasource.experimental.enabled", true] ); // We fill up the source buffer with audio data until the buffer is full. diff --git a/dom/media/mediasource/test/test_FrameSelection.html b/dom/media/mediasource/test/test_FrameSelection.html index 346c84cb6626..bff830618bac 100644 --- a/dom/media/mediasource/test/test_FrameSelection.html +++ b/dom/media/mediasource/test/test_FrameSelection.html @@ -41,7 +41,7 @@ runWithMSE(async (ms, v) => { ms.endOfStream(); info("Seeking to t=3"); - p = Promise.all([ once(v, "seeked"), once(v, "resize") ]); + p = Promise.all([once(v, "seeked"), once(v, "resize")]); v.currentTime = 3; await p; is(v.currentTime, 3, "Video currentTime at target"); @@ -49,7 +49,7 @@ runWithMSE(async (ms, v) => { is(v.videoHeight, 120, "videoHeight has correct low-res value"); info("Seeking to t=1"); - p = Promise.all([ once(v, "seeked"), once(v, "resize") ]); + p = Promise.all([once(v, "seeked"), once(v, "resize")]); v.currentTime = 1; await p; is(v.currentTime, 1, "Video currentTime at target"); diff --git a/dom/media/mediasource/test/test_FrameSelection_mp4.html b/dom/media/mediasource/test/test_FrameSelection_mp4.html index afc95c9cc822..3267548d0a92 100644 --- a/dom/media/mediasource/test/test_FrameSelection_mp4.html +++ b/dom/media/mediasource/test/test_FrameSelection_mp4.html @@ -25,7 +25,7 @@ runWithMSE(async (ms, v) => { ok(false, `should not fire ${e.type} event`); SimpleTest.finish(); }); - await fetchAndLoad(sb, "bipbop/bipbop", [ "init" ], ".mp4"); + await fetchAndLoad(sb, "bipbop/bipbop", ["init"], ".mp4"); const p = once(v, "loadeddata"); await fetchAndLoad(sb, "bipbop/bipbop", range(1, 3), ".m4s"); await p; @@ -33,12 +33,12 @@ runWithMSE(async (ms, v) => { v.play(); // We have nothing to play, waiting will be fired. await waitUntilTime(v, 1.5); - await fetchAndLoad(sb, "bipbop/bipbop_480_624kbps-video", [ "init" ], ".mp4"); + await fetchAndLoad(sb, "bipbop/bipbop_480_624kbps-video", ["init"], ".mp4"); sb.timestampOffset = 1.601666; // End of the video track buffered - time of first video sample (0.095). sb.appendWindowEnd = 1.796677; // Only allow room for three extra video frames (we need 3 as this video has b-frames). - await fetchAndLoad(sb, "bipbop/bipbop_480_624kbps-video", [ "1" ], ".m4s"); + await fetchAndLoad(sb, "bipbop/bipbop_480_624kbps-video", ["1"], ".m4s"); ms.endOfStream(); - await Promise.all([ once(ms, "sourceended"), once(v, "playing"), once(v, "ended") ]); + await Promise.all([once(ms, "sourceended"), once(v, "playing"), once(v, "ended")]); if (v.width, 640, "has proper width"); if (v.height, 480, "has proper height"); SimpleTest.finish(); diff --git a/dom/media/mediasource/test/test_LiveSeekable.html b/dom/media/mediasource/test/test_LiveSeekable.html index 48464676cbd3..a685f4ab5ed7 100644 --- a/dom/media/mediasource/test/test_LiveSeekable.html +++ b/dom/media/mediasource/test/test_LiveSeekable.html @@ -20,7 +20,7 @@ runWithMSE(async (ms, v) => { // and seekable range start. sb.timestampOffset = 2; const p = once(v, "loadedmetadata"); - await fetchAndLoad(sb, "seek", [ "" ], ".webm"); + await fetchAndLoad(sb, "seek", [""], ".webm"); await p; ms.duration = Infinity; sb.abort(); diff --git a/dom/media/mediasource/test/test_LoadedDataFired_mp4.html b/dom/media/mediasource/test/test_LoadedDataFired_mp4.html index 20f54d0b6949..13d83a098acb 100644 --- a/dom/media/mediasource/test/test_LoadedDataFired_mp4.html +++ b/dom/media/mediasource/test/test_LoadedDataFired_mp4.html @@ -29,7 +29,7 @@ runWithMSE(async (ms, el) => { const videosb = ms.addSourceBuffer("video/mp4"); is(el.readyState, el.HAVE_NOTHING, "readyState is HAVE_NOTHING"); let p = once(el, "loadedmetadata"); - await fetchAndLoad(videosb, "bipbop/bipbop_video", [ "init" ], ".mp4"); + await fetchAndLoad(videosb, "bipbop/bipbop_video", ["init"], ".mp4"); await p; videosb.appendWindowStart = 2; videosb.appendWindowEnd = 4; diff --git a/dom/media/mediasource/test/test_MediaSource_disabled.html b/dom/media/mediasource/test/test_MediaSource_disabled.html index 5ecd6abe3b73..5dcb68103fad 100644 --- a/dom/media/mediasource/test/test_MediaSource_disabled.html +++ b/dom/media/mediasource/test/test_MediaSource_disabled.html @@ -21,7 +21,7 @@ function test() { SpecialPowers.pushPrefEnv({"set": [ - [ "media.mediasource.enabled", false ], + ["media.mediasource.enabled", false], ] }, test); diff --git a/dom/media/mediasource/test/test_MediaSource_flac_mp4.html b/dom/media/mediasource/test/test_MediaSource_flac_mp4.html index 67d36cda549d..aa0a915194a3 100644 --- a/dom/media/mediasource/test/test_MediaSource_flac_mp4.html +++ b/dom/media/mediasource/test/test_MediaSource_flac_mp4.html @@ -19,7 +19,7 @@ runWithMSE(async (ms, el) => { const sb = ms.addSourceBuffer("audio/mp4; codecs=\"flac\""); ok(sb, "Create a SourceBuffer"); - await fetchAndLoad(sb, "flac/IS", [ "" ], ".mp4"); + await fetchAndLoad(sb, "flac/IS", [""], ".mp4"); await fetchAndLoad(sb, "flac/0000", range(1, 3), ".m4s"); el.play(); ms.endOfStream(); diff --git a/dom/media/mediasource/test/test_MediaSource_memory_reporting.html b/dom/media/mediasource/test/test_MediaSource_memory_reporting.html index 4fc46063d638..5831e1d417a1 100644 --- a/dom/media/mediasource/test/test_MediaSource_memory_reporting.html +++ b/dom/media/mediasource/test/test_MediaSource_memory_reporting.html @@ -16,7 +16,7 @@ runWithMSE(async (ms, v) => { // Load a webm video and play it. await once(ms, "sourceopen"); const sb = ms.addSourceBuffer("video/webm"); - await fetchAndLoad(sb, "seek", [ "" ], ".webm"); + await fetchAndLoad(sb, "seek", [""], ".webm"); const p = once(v, "ended"); ms.endOfStream(); v.play(); diff --git a/dom/media/mediasource/test/test_MultipleInitSegments.html b/dom/media/mediasource/test/test_MultipleInitSegments.html index 5f9ecb0fcc6a..d7bb49806980 100644 --- a/dom/media/mediasource/test/test_MultipleInitSegments.html +++ b/dom/media/mediasource/test/test_MultipleInitSegments.html @@ -19,10 +19,10 @@ runWithMSE(async (ms, v) => { const seek_lowres = await fetchWithXHR("seek_lowres.webm"); const seek = await fetchWithXHR("seek.webm"); const data = [ - [ seek_lowres, 0, 438 ], // lowres init segment - [ seek_lowres, 438, 25950 ], // lowres media segment 0-1 - [ seek, 0, 318 ], // init segment - [ seek, 46712, 67833 ] // media segment 0.8-1.201 + [seek_lowres, 0, 438], // lowres init segment + [seek_lowres, 438, 25950], // lowres media segment 0-1 + [seek, 0, 318], // init segment + [seek, 46712, 67833] // media segment 0.8-1.201 ]; const length = data.map(d => d[2] - d[1]).reduce((a, b) => a + b, 0); const arrayBuffer = new Uint8Array(length); diff --git a/dom/media/mediasource/test/test_MultipleInitSegments_mp4.html b/dom/media/mediasource/test/test_MultipleInitSegments_mp4.html index 04fec0319e77..731f702fbdb3 100644 --- a/dom/media/mediasource/test/test_MultipleInitSegments_mp4.html +++ b/dom/media/mediasource/test/test_MultipleInitSegments_mp4.html @@ -19,7 +19,7 @@ runWithMSE(async (ms, v) => { const init = new Uint8Array(await fetchWithXHR("bipbop/bipbop_videoinit.mp4")); const segment1 = new Uint8Array(await fetchWithXHR("bipbop/bipbop_video1.m4s")); const segment2 = new Uint8Array(await fetchWithXHR("bipbop/bipbop_video2.m4s")); - const data = [ init, segment1, init, segment2 ]; + const data = [init, segment1, init, segment2]; const length = data.map(d => d.byteLength).reduce((a, b) => a + b, 0); const arrayBuffer = new Uint8Array(length); let pos = 0; diff --git a/dom/media/mediasource/test/test_OnEvents.html b/dom/media/mediasource/test/test_OnEvents.html index 46c8d3b7f0dd..3a54d71ed503 100644 --- a/dom/media/mediasource/test/test_OnEvents.html +++ b/dom/media/mediasource/test/test_OnEvents.html @@ -15,24 +15,24 @@ SimpleTest.waitForExplicitFinish(); runWithMSE(async (ms, v) => { const receiveEvent = e => v["got" + e] = true; - const msevents = [ "onsourceopen", "onsourceended" ]; + const msevents = ["onsourceopen", "onsourceended"]; msevents.forEach(e => ms[e] = () => receiveEvent(e)); - const sblistevents = [ "onaddsourcebuffer", "onremovesourcebuffer" ]; + const sblistevents = ["onaddsourcebuffer", "onremovesourcebuffer"]; sblistevents.forEach(e => ms.sourceBuffers[e] = () => receiveEvent(e)); await once(ms, "sourceopen"); const sb = ms.addSourceBuffer("video/webm"); - const sbevents = [ "onupdatestart", "onupdate", "onupdateend", "onabort" ]; + const sbevents = ["onupdatestart", "onupdate", "onupdateend", "onabort"]; sbevents.forEach(e => sb[e] = () => receiveEvent(e)); - await fetchAndLoad(sb, "seek", [ "" ], ".webm"); + await fetchAndLoad(sb, "seek", [""], ".webm"); sb.appendBuffer(await fetchWithXHR("seek.webm")); ms.removeSourceBuffer(sb); // will fire abort and removesourcebuffer ms.endOfStream(); // will fire sourceended await once(ms, "sourceended"); - [ ...msevents, ...sbevents, ...sblistevents ].forEach(e => ok(v["got" + e], "got " + e)); + [...msevents, ...sbevents, ...sblistevents].forEach(e => ok(v["got" + e], "got " + e)); SimpleTest.finish(); }); diff --git a/dom/media/mediasource/test/test_PlayEvents.html b/dom/media/mediasource/test/test_PlayEvents.html index 5c290e7a63a8..f22df53612cf 100644 --- a/dom/media/mediasource/test/test_PlayEvents.html +++ b/dom/media/mediasource/test/test_PlayEvents.html @@ -33,10 +33,10 @@ runWithMSE(async (ms, el) => { }); is(el.readyState, el.HAVE_NOTHING, "readyState is HAVE_NOTHING"); let p = once(el, "loadedmetadata"); - await fetchAndLoad(videosb, "bipbop/bipbop_video", [ "init" ], ".mp4"); + await fetchAndLoad(videosb, "bipbop/bipbop_video", ["init"], ".mp4"); await p; ok(true, "got loadedmetadata event"); - p = Promise.all([ once(el, "loadeddata"), once(el, "canplay") ]); + p = Promise.all([once(el, "loadeddata"), once(el, "canplay")]); await fetchAndLoad(videosb, "bipbop/bipbop_video", range(1, 3), ".m4s"); await p; ok(true, "got canplay event"); @@ -64,7 +64,7 @@ runWithMSE(async (ms, el) => { ok(true, "got seeking event"); is(el.readyState, el.HAVE_METADATA, "readyState is HAVE_METADATA"); // Load [6+0, 6+1.601666) - p = Promise.all([ once(el, "seeked"), once(el, "canplay") ]); + p = Promise.all([once(el, "seeked"), once(el, "canplay")]); await fetchAndLoad(videosb, "bipbop/bipbop_video", range(1, 3), ".m4s"); await p; ok(true, "got seeked and canplay event"); @@ -94,7 +94,7 @@ runWithMSE(async (ms, el) => { await fetchAndLoad(videosb, "bipbop/bipbop_video", range(3, 5), ".m4s"); ok(true, "data loaded"); // Playback we play for a little while then stall. - p = Promise.all([ once(el, "playing"), once(el, "waiting") ]); + p = Promise.all([once(el, "playing"), once(el, "waiting")]); el.play(); await p; ok(true, "got playing and waiting event"); @@ -102,7 +102,7 @@ runWithMSE(async (ms, el) => { is(el.readyState, el.HAVE_CURRENT_DATA, "readyState is HAVE_CURRENT_DATA"); // Load [15+3.203333, 15+4.805) // Our final buffered range will now be [0, 3.203333)[6, 9.203333)[15, 19.805) - p = Promise.all([ once(el, "playing"), once(el, "canplay"), once(el, "canplaythrough") ]); + p = Promise.all([once(el, "playing"), once(el, "canplay"), once(el, "canplaythrough")]); await fetchAndLoad(videosb, "bipbop/bipbop_video", range(5, 7), ".m4s"); await p; ok(true, "got playing, canplay and canplaythrough event"); diff --git a/dom/media/mediasource/test/test_PlayEventsAutoPlaying.html b/dom/media/mediasource/test/test_PlayEventsAutoPlaying.html index aa2c058d95a4..bdf7916f92f0 100644 --- a/dom/media/mediasource/test/test_PlayEventsAutoPlaying.html +++ b/dom/media/mediasource/test/test_PlayEventsAutoPlaying.html @@ -39,12 +39,12 @@ runWithMSE(async (ms, el) => { }); is(el.readyState, el.HAVE_NOTHING, "readyState is HAVE_NOTHING"); let p = once(el, "loadedmetadata"); - await fetchAndLoad(videosb, "bipbop/bipbop_video", [ "init" ], ".mp4"); + await fetchAndLoad(videosb, "bipbop/bipbop_video", ["init"], ".mp4"); await p; ok(true, "got loadedmetadata event"); // We're only adding 1.6s worth of data, not enough for readyState to change to HAVE_ENOUGH_DATA // So we end the media source so that all the playable data is available. - p = Promise.all([ "loadeddata", "canplay", "play", "playing", "ended" ].map(e => once(el, e))); + p = Promise.all(["loadeddata", "canplay", "play", "playing", "ended"].map(e => once(el, e))); await fetchAndLoad(videosb, "bipbop/bipbop_video", range(1, 3), ".m4s"); ms.endOfStream(); await p; diff --git a/dom/media/mediasource/test/test_PlayEventsAutoPlaying2.html b/dom/media/mediasource/test/test_PlayEventsAutoPlaying2.html index 1f54a0d9bf69..c26779072973 100644 --- a/dom/media/mediasource/test/test_PlayEventsAutoPlaying2.html +++ b/dom/media/mediasource/test/test_PlayEventsAutoPlaying2.html @@ -39,13 +39,13 @@ runWithMSE(async (ms, el) => { }); is(el.readyState, el.HAVE_NOTHING, "readyState is HAVE_NOTHING"); let p = once(el, "loadedmetadata"); - await fetchAndLoad(videosb, "bipbop/bipbop_video", [ "init" ], ".mp4"); + await fetchAndLoad(videosb, "bipbop/bipbop_video", ["init"], ".mp4"); await p; ok(true, "got loadedmetadata event"); // We shift the timestamps slightly to create a small gaps at the start. // one that should normally be ignored. videosb.timestampOffset = 0.1; - p = Promise.all([ "loadeddata", "canplay", "play", "playing" ].map(e => once(el, e))); + p = Promise.all(["loadeddata", "canplay", "play", "playing"].map(e => once(el, e))); await fetchAndLoad(videosb, "bipbop/bipbop_video", range(1, 14), ".m4s"); await p; ok(true, "got all required event"); diff --git a/dom/media/mediasource/test/test_ResumeAfterClearing_mp4.html b/dom/media/mediasource/test/test_ResumeAfterClearing_mp4.html index 14a02e77403c..6fda415012f0 100644 --- a/dom/media/mediasource/test/test_ResumeAfterClearing_mp4.html +++ b/dom/media/mediasource/test/test_ResumeAfterClearing_mp4.html @@ -21,7 +21,7 @@ runWithMSE(async (ms, v) => { ok(false, "Got Error: " + e); SimpleTest.finish(); }); - await fetchAndLoad(sb, "bipbop/bipbop", [ "init" ], ".mp4"); + await fetchAndLoad(sb, "bipbop/bipbop", ["init"], ".mp4"); let p = once(v, "loadeddata"); await fetchAndLoad(sb, "bipbop/bipbop", range(1, 3), ".m4s"); await p; @@ -35,7 +35,7 @@ runWithMSE(async (ms, v) => { await fetchAndLoad(sb, "bipbop/bipbop", range(1, 4), ".m4s"); await p; ms.endOfStream(); - await Promise.all([ once(ms, "sourceended"), once(v, "ended") ]); + await Promise.all([once(ms, "sourceended"), once(v, "ended")]); SimpleTest.finish(SimpleTest); }); diff --git a/dom/media/mediasource/test/test_SeekNoData_mp4.html b/dom/media/mediasource/test/test_SeekNoData_mp4.html index 0591b4268c5a..ca084e366624 100644 --- a/dom/media/mediasource/test/test_SeekNoData_mp4.html +++ b/dom/media/mediasource/test/test_SeekNoData_mp4.html @@ -27,8 +27,8 @@ runWithMSE(async (ms, el) => { is(el.currentTime, 3, "currentTime is default playback start position"); is(el.seeking, false, "seek not started with HAVE_NOTHING"); await Promise.all([ - fetchAndLoad(audiosb, "bipbop/bipbop_audio", [ "init" ], ".mp4"), - fetchAndLoad(videosb, "bipbop/bipbop_video", [ "init" ], ".mp4"), + fetchAndLoad(audiosb, "bipbop/bipbop_audio", ["init"], ".mp4"), + fetchAndLoad(videosb, "bipbop/bipbop_video", ["init"], ".mp4"), once(el, "loadedmetadata") ]); const p = once(el, "seeking"); diff --git a/dom/media/mediasource/test/test_SeekToEnd_mp4.html b/dom/media/mediasource/test/test_SeekToEnd_mp4.html index 65c05d17a810..b7a209ea50fd 100644 --- a/dom/media/mediasource/test/test_SeekToEnd_mp4.html +++ b/dom/media/mediasource/test/test_SeekToEnd_mp4.html @@ -19,15 +19,15 @@ runWithMSE(async (ms, el) => { const videosb = ms.addSourceBuffer("video/mp4"); const audiosb = ms.addSourceBuffer("audio/mp4"); - await fetchAndLoad(videosb, "bipbop/bipbop_video", [ "init" ], ".mp4"); + await fetchAndLoad(videosb, "bipbop/bipbop_video", ["init"], ".mp4"); await fetchAndLoad(videosb, "bipbop/bipbop_video", range(1, 6), ".m4s"); - await fetchAndLoad(audiosb, "bipbop/bipbop_audio", [ "init" ], ".mp4"); + await fetchAndLoad(audiosb, "bipbop/bipbop_audio", ["init"], ".mp4"); is(videosb.buffered.length, 1, "continuous buffered range"); // Ensure we have at least 2s less audio than video. audiosb.appendWindowEnd = videosb.buffered.end(0) - 2; await fetchAndLoad(audiosb, "bipbop/bipbop_audio", range(1, 6), ".m4s"); ms.endOfStream(); - await Promise.all([ once(el, "durationchange"), once(ms, "sourceended") ]); + await Promise.all([once(el, "durationchange"), once(ms, "sourceended")]); ok(true, "endOfStream completed"); // Seek to the middle of the gap where audio is missing. As we are in readyState = ended // seeking must complete. diff --git a/dom/media/mediasource/test/test_SeekToLastFrame_mp4.html b/dom/media/mediasource/test/test_SeekToLastFrame_mp4.html index c6b25ada3bfd..1f9b1b34e3e9 100644 --- a/dom/media/mediasource/test/test_SeekToLastFrame_mp4.html +++ b/dom/media/mediasource/test/test_SeekToLastFrame_mp4.html @@ -16,7 +16,7 @@ runWithMSE(async (ms, el) => { await once(ms, "sourceopen"); ok(true, "Receive a sourceopen event"); const sb = ms.addSourceBuffer("video/mp4"); - await fetchAndLoad(sb, "bipbop/bipbop_480_624kbps-video", [ "init" ], ".mp4"); + await fetchAndLoad(sb, "bipbop/bipbop_480_624kbps-video", ["init"], ".mp4"); await fetchAndLoad(sb, "bipbop/bipbop_480_624kbps-video", range(1, 3), ".m4s"); el.play(); // let seek to the last audio frame. diff --git a/dom/media/mediasource/test/test_SeekTwice_mp4.html b/dom/media/mediasource/test/test_SeekTwice_mp4.html index c7ac087c651c..7d22ad3c4c22 100644 --- a/dom/media/mediasource/test/test_SeekTwice_mp4.html +++ b/dom/media/mediasource/test/test_SeekTwice_mp4.html @@ -18,10 +18,10 @@ runWithMSE(async (ms, el) => { ok(true, "Receive a sourceopen event"); const audiosb = ms.addSourceBuffer("audio/mp4"); const videosb = ms.addSourceBuffer("video/mp4"); - await fetchAndLoad(audiosb, "bipbop/bipbop_audio", [ "init" ], ".mp4"); + await fetchAndLoad(audiosb, "bipbop/bipbop_audio", ["init"], ".mp4"); await fetchAndLoad(audiosb, "bipbop/bipbop_audio", range(1, 5), ".m4s"); await fetchAndLoad(audiosb, "bipbop/bipbop_audio", range(6, 12), ".m4s"); - await fetchAndLoad(videosb, "bipbop/bipbop_video", [ "init" ], ".mp4"); + await fetchAndLoad(videosb, "bipbop/bipbop_video", ["init"], ".mp4"); await fetchAndLoad(videosb, "bipbop/bipbop_video", range(1, 6), ".m4s"); await fetchAndLoad(videosb, "bipbop/bipbop_video", range(7, 14), ".m4s"); let p = once(el, "seeking"); diff --git a/dom/media/mediasource/test/test_SeekedEvent_mp4.html b/dom/media/mediasource/test/test_SeekedEvent_mp4.html index 804d7b1ca297..61a387545300 100644 --- a/dom/media/mediasource/test/test_SeekedEvent_mp4.html +++ b/dom/media/mediasource/test/test_SeekedEvent_mp4.html @@ -14,7 +14,7 @@ SimpleTest.waitForExplicitFinish(); runWithMSE(async (ms, el) => { el.controls = true; - const events = [ "seeked", "loadeddata", "playing" ]; + const events = ["seeked", "loadeddata", "playing"]; let eventCount = 0; events.forEach(type => el.addEventListener(type, () => is(events[eventCount++], type, "events must come in order"))); @@ -23,20 +23,20 @@ runWithMSE(async (ms, el) => { const videosb = ms.addSourceBuffer("video/mp4"); is(el.readyState, el.HAVE_NOTHING, "readyState is HAVE_NOTHING"); let p = once(el, "loadedmetadata"); - await fetchAndLoad(videosb, "bipbop/bipbop_video", [ "init" ], ".mp4"); + await fetchAndLoad(videosb, "bipbop/bipbop_video", ["init"], ".mp4"); await p; el.play(); videosb.timestampOffset = 2; is(el.readyState, el.HAVE_METADATA, "readyState is HAVE_METADATA"); // Load [2, 3.606). p = once(el, "play"); - await fetchAndLoad(videosb, "bipbop/bipbop_video", [ "1" ], ".m4s"); + await fetchAndLoad(videosb, "bipbop/bipbop_video", ["1"], ".m4s"); await p; - await fetchAndLoad(videosb, "bipbop/bipbop_video", [ "2" ], ".m4s"); + await fetchAndLoad(videosb, "bipbop/bipbop_video", ["2"], ".m4s"); // TODO: readyState should be at least HAVE_CURRENTDATA, see bug 1367993. ok(el.readyState >= el.HAVE_METADATA, "readyState is HAVE_METADATA"); el.currentTime = 2; - await Promise.all([ once(el, "seeked"), once(el, "playing") ]); + await Promise.all([once(el, "seeked"), once(el, "playing")]); ok(true, "completed seek"); is(eventCount, events.length, "Received expected number of events"); SimpleTest.finish(); diff --git a/dom/media/mediasource/test/test_Sequence_mp4.html b/dom/media/mediasource/test/test_Sequence_mp4.html index 6a11f2e83727..99ad7d7a073e 100644 --- a/dom/media/mediasource/test/test_Sequence_mp4.html +++ b/dom/media/mediasource/test/test_Sequence_mp4.html @@ -23,9 +23,9 @@ runWithMSE(async (ms, v) => { }); sb.mode = "sequence"; - await fetchAndLoad(sb, "bipbop/bipbop_video", [ "init" ], ".mp4"); - await fetchAndLoad(sb, "bipbop/bipbop_video", [ "5" ], ".m4s"); - await fetchAndLoad(sb, "bipbop/bipbop_video", [ "2" ], ".m4s"); + await fetchAndLoad(sb, "bipbop/bipbop_video", ["init"], ".mp4"); + await fetchAndLoad(sb, "bipbop/bipbop_video", ["5"], ".m4s"); + await fetchAndLoad(sb, "bipbop/bipbop_video", ["2"], ".m4s"); is(v.buffered.length, 1, "Continuous buffered range"); is(v.buffered.start(0), 0, "Buffered range starts at 0"); ok(sb.timestampOffset > 0, "SourceBuffer.timestampOffset set to allow continuous range"); diff --git a/dom/media/mediasource/test/test_Threshold_mp4.html b/dom/media/mediasource/test/test_Threshold_mp4.html index 719c9afae707..1a18501ca414 100644 --- a/dom/media/mediasource/test/test_Threshold_mp4.html +++ b/dom/media/mediasource/test/test_Threshold_mp4.html @@ -19,9 +19,9 @@ runWithMSE(async (ms, el) => { await once(ms, "sourceopen"); ok(true, "Receive a sourceopen event"); const videosb = ms.addSourceBuffer("video/mp4"); - const vchunks = [ {start: 0, end: 3.203333}, { start: 3.203333, end: 6.406666} ]; + const vchunks = [{start: 0, end: 3.203333}, { start: 3.203333, end: 6.406666}]; - await fetchAndLoad(videosb, "bipbop/bipbop_video", [ "init" ], ".mp4"); + await fetchAndLoad(videosb, "bipbop/bipbop_video", ["init"], ".mp4"); await fetchAndLoad(videosb, "bipbop/bipbop_video", range(1, 5), ".m4s"); // We will insert a gap of threshold videosb.timestampOffset = threshold; diff --git a/dom/media/mediasource/test/test_TimestampOffset_mp4.html b/dom/media/mediasource/test/test_TimestampOffset_mp4.html index 38e908bc4eb8..10747709a9af 100644 --- a/dom/media/mediasource/test/test_TimestampOffset_mp4.html +++ b/dom/media/mediasource/test/test_TimestampOffset_mp4.html @@ -25,13 +25,13 @@ runWithMSE(async (ms, el) => { // chunk 1: segments 5-8 // chunk 2: segments 9-13 // We then fill the timeline so that it seamlessly plays the chunks in order 0, 2, 1. - const vchunks = [ {start: 0, end: 3.2033}, + const vchunks = [{start: 0, end: 3.2033}, { start: 3.2033, end: 6.4066}, - { start: 6.4066, end: 10.01} ]; + { start: 6.4066, end: 10.01}]; const firstvoffset = vchunks[2].end - vchunks[2].start; // Duration of chunk 2 const secondvoffset = -(vchunks[1].end - vchunks[1].start); // -(Duration of chunk 1) - await fetchAndLoad(videosb, "bipbop/bipbop_video", [ "init" ], ".mp4"); + await fetchAndLoad(videosb, "bipbop/bipbop_video", ["init"], ".mp4"); await fetchAndLoad(videosb, "bipbop/bipbop_video", range(1, 5), ".m4s"); is(videosb.buffered.length, 1, "No discontinuity"); isfuzzy(videosb.buffered.start(0), vchunks[0].start, eps, "Chunk start"); @@ -49,7 +49,7 @@ runWithMSE(async (ms, el) => { isfuzzy(videosb.buffered.start(0), vchunks[0].start, eps, "Chunk start"); isfuzzy(videosb.buffered.end(0), vchunks[2].end, eps, "Chunk end"); audiosb.timestampOffset = 3; - await fetchAndLoad(audiosb, "bipbop/bipbop_audio", [ "init" ], ".mp4"); + await fetchAndLoad(audiosb, "bipbop/bipbop_audio", ["init"], ".mp4"); await fetchAndLoad(audiosb, "bipbop/bipbop_audio", range(1, 12), ".m4s"); is(audiosb.buffered.length, 1, "No audio discontinuity"); isfuzzy(audiosb.buffered.start(0), 3, eps, "Audio starts at 3"); @@ -67,7 +67,7 @@ runWithMSE(async (ms, el) => { el.play(); el.currentTime = el.buffered.start(0); ms.endOfStream(); - await Promise.all([ once(el, "ended"), once(el, "seeked") ]); + await Promise.all([once(el, "ended"), once(el, "seeked")]); SimpleTest.finish(); }); diff --git a/dom/media/mediasource/test/test_WaitingOnMissingDataEnded_mp4.html b/dom/media/mediasource/test/test_WaitingOnMissingDataEnded_mp4.html index 33a63fbadf9b..0832ee67b4d2 100644 --- a/dom/media/mediasource/test/test_WaitingOnMissingDataEnded_mp4.html +++ b/dom/media/mediasource/test/test_WaitingOnMissingDataEnded_mp4.html @@ -20,12 +20,12 @@ runWithMSE(async (ms, el) => { SimpleTest.finish(); }); const videosb = ms.addSourceBuffer("video/mp4"); - await fetchAndLoad(videosb, "bipbop/bipbop_video", [ "init" ], ".mp4"); + await fetchAndLoad(videosb, "bipbop/bipbop_video", ["init"], ".mp4"); await fetchAndLoad(videosb, "bipbop/bipbop_video", range(1, 5), ".m4s"); await fetchAndLoad(videosb, "bipbop/bipbop_video", range(6, 8), ".m4s"); is(el.buffered.length, 2, "discontinuous buffered range"); ms.endOfStream(); - await Promise.all([ once(el, "durationchange"), once(ms, "sourceended") ]); + await Promise.all([once(el, "durationchange"), once(ms, "sourceended")]); // HTMLMediaElement fires "waiting" if somebody invokes |play()| before the MDSM // has notified it of available data. Make sure that we get "playing" before // we starting waiting for "waiting". diff --git a/dom/media/mediasource/test/test_WaitingOnMissingData_mp4.html b/dom/media/mediasource/test/test_WaitingOnMissingData_mp4.html index 0ec1c2b2c81e..874266241fc7 100644 --- a/dom/media/mediasource/test/test_WaitingOnMissingData_mp4.html +++ b/dom/media/mediasource/test/test_WaitingOnMissingData_mp4.html @@ -17,10 +17,10 @@ runWithMSE(async (ms, el) => { ok(true, "Receive a sourceopen event"); const audiosb = ms.addSourceBuffer("audio/mp4"); const videosb = ms.addSourceBuffer("video/mp4"); - await fetchAndLoad(audiosb, "bipbop/bipbop_audio", [ "init" ], ".mp4"); + await fetchAndLoad(audiosb, "bipbop/bipbop_audio", ["init"], ".mp4"); await fetchAndLoad(audiosb, "bipbop/bipbop_audio", range(1, 5), ".m4s"); await fetchAndLoad(audiosb, "bipbop/bipbop_audio", range(6, 12), ".m4s"); - await fetchAndLoad(videosb, "bipbop/bipbop_video", [ "init" ], ".mp4"); + await fetchAndLoad(videosb, "bipbop/bipbop_video", ["init"], ".mp4"); await fetchAndLoad(videosb, "bipbop/bipbop_video", range(1, 6), ".m4s"); await fetchAndLoad(videosb, "bipbop/bipbop_video", range(7, 14), ".m4s"); // HTMLMediaElement fires "waiting" if somebody invokes |play()| before the MDSM @@ -43,8 +43,8 @@ runWithMSE(async (ms, el) => { info("Loading more data"); p = once(el, "ended"); await Promise.all([ - fetchAndLoad(audiosb, "bipbop/bipbop_audio", [ 5 ], ".m4s"), - fetchAndLoad(videosb, "bipbop/bipbop_video", [ 6 ], ".m4s") + fetchAndLoad(audiosb, "bipbop/bipbop_audio", [5], ".m4s"), + fetchAndLoad(videosb, "bipbop/bipbop_video", [6], ".m4s") ]); ms.endOfStream(); await p; diff --git a/dom/media/mediasource/test/test_WaitingToEndedTransition_mp4.html b/dom/media/mediasource/test/test_WaitingToEndedTransition_mp4.html index 489895290bd5..4e617e2d4aa0 100644 --- a/dom/media/mediasource/test/test_WaitingToEndedTransition_mp4.html +++ b/dom/media/mediasource/test/test_WaitingToEndedTransition_mp4.html @@ -21,8 +21,8 @@ runWithMSE(async (ms, el) => { // always fired (bug 1233639). audiosb.appendWindowEnd = 3.9; videosb.appendWindowEnd = 3.9; - await fetchAndLoad(audiosb, "bipbop/bipbop_audio", [ "init" ], ".mp4"); - await fetchAndLoad(videosb, "bipbop/bipbop_video", [ "init" ], ".mp4"); + await fetchAndLoad(audiosb, "bipbop/bipbop_audio", ["init"], ".mp4"); + await fetchAndLoad(videosb, "bipbop/bipbop_video", ["init"], ".mp4"); await fetchAndLoad(audiosb, "bipbop/bipbop_audio", range(1, 5), ".m4s"); await fetchAndLoad(videosb, "bipbop/bipbop_video", range(1, 6), ".m4s"); // HTMLMediaElement fires "waiting" if somebody invokes |play()| before the MDSM diff --git a/dom/media/mediasource/test/test_WebMTagsBeforeCluster.html b/dom/media/mediasource/test/test_WebMTagsBeforeCluster.html index 19d484203e63..a20cec6e1d07 100644 --- a/dom/media/mediasource/test/test_WebMTagsBeforeCluster.html +++ b/dom/media/mediasource/test/test_WebMTagsBeforeCluster.html @@ -12,7 +12,7 @@ SimpleTest.waitForExplicitFinish(); -addMSEPrefs([ "media.mediasource.webm.enabled", true ]); +addMSEPrefs(["media.mediasource.webm.enabled", true]); runWithMSE(function(ms, v) { ms.addEventListener("sourceopen", function() {