From 31f03aa534d4a0a6c35962b0a8ac4e6d2af7a12a Mon Sep 17 00:00:00 2001 From: alwu Date: Thu, 5 Nov 2020 04:50:13 +0000 Subject: [PATCH] Bug 1674845 - part3 : create 'mochitest' subfolder for autoplay related plain mochitests. r=bryce Differential Revision: https://phabricator.services.mozilla.com/D95880 --- dom/media/autoplay/moz.build | 2 + .../test/mochitest}/AutoplayTestUtils.js | 2 +- .../file_autoplay_gv_play_request_frame.html | 0 .../file_autoplay_gv_play_request_window.html | 2 +- ...file_autoplay_policy_activation_frame.html | 0 ...ile_autoplay_policy_activation_window.html | 2 +- ..._autoplay_policy_eventdown_activation.html | 0 .../file_autoplay_policy_key_blacklist.html | 0 ...lay_policy_play_before_loadedmetadata.html | 0 .../file_autoplay_policy_unmute_pauses.html | 0 .../autoplay/test/mochitest/mochitest.ini | 54 +++++++++++++++++++ .../test/mochitest}/test_autoplay.html | 1 + .../test_autoplay_contentEditable.html | 2 +- .../test_autoplay_gv_play_request.html | 0 .../test/mochitest}/test_autoplay_policy.html | 2 +- .../test_autoplay_policy_activation.html | 0 ..._autoplay_policy_eventdown_activation.html | 0 .../test_autoplay_policy_key_blacklist.html | 0 .../test_autoplay_policy_permission.html | 2 +- ...lay_policy_play_before_loadedmetadata.html | 0 .../test_autoplay_policy_unmute_pauses.html | 0 ...lay_policy_web_audio_AudioParamStream.html | 0 ...icy_web_audio_createMediaStreamSource.html | 0 ...web_audio_mediaElementAudioSourceNode.html | 2 +- ...esumePageInvokedSuspendedAudioContext.html | 2 +- .../mochitest}/test_streams_autoplay.html | 1 + dom/media/test/mochitest.ini | 28 ---------- tools/lint/rejected-words.yml | 6 +-- 28 files changed, 69 insertions(+), 39 deletions(-) rename dom/media/{test => autoplay/test/mochitest}/AutoplayTestUtils.js (95%) rename dom/media/{test => autoplay/test/mochitest}/file_autoplay_gv_play_request_frame.html (100%) rename dom/media/{test => autoplay/test/mochitest}/file_autoplay_gv_play_request_window.html (95%) rename dom/media/{test => autoplay/test/mochitest}/file_autoplay_policy_activation_frame.html (100%) rename dom/media/{test => autoplay/test/mochitest}/file_autoplay_policy_activation_window.html (96%) rename dom/media/{test => autoplay/test/mochitest}/file_autoplay_policy_eventdown_activation.html (100%) rename dom/media/{test => autoplay/test/mochitest}/file_autoplay_policy_key_blacklist.html (100%) rename dom/media/{test => autoplay/test/mochitest}/file_autoplay_policy_play_before_loadedmetadata.html (100%) rename dom/media/{test => autoplay/test/mochitest}/file_autoplay_policy_unmute_pauses.html (100%) create mode 100644 dom/media/autoplay/test/mochitest/mochitest.ini rename dom/media/{test => autoplay/test/mochitest}/test_autoplay.html (95%) rename dom/media/{test => autoplay/test/mochitest}/test_autoplay_contentEditable.html (96%) rename dom/media/{test => autoplay/test/mochitest}/test_autoplay_gv_play_request.html (100%) rename dom/media/{test => autoplay/test/mochitest}/test_autoplay_policy.html (99%) rename dom/media/{test => autoplay/test/mochitest}/test_autoplay_policy_activation.html (100%) rename dom/media/{test => autoplay/test/mochitest}/test_autoplay_policy_eventdown_activation.html (100%) rename dom/media/{test => autoplay/test/mochitest}/test_autoplay_policy_key_blacklist.html (100%) rename dom/media/{test => autoplay/test/mochitest}/test_autoplay_policy_permission.html (95%) rename dom/media/{test => autoplay/test/mochitest}/test_autoplay_policy_play_before_loadedmetadata.html (100%) rename dom/media/{test => autoplay/test/mochitest}/test_autoplay_policy_unmute_pauses.html (100%) rename dom/media/{test => autoplay/test/mochitest}/test_autoplay_policy_web_audio_AudioParamStream.html (100%) rename dom/media/{test => autoplay/test/mochitest}/test_autoplay_policy_web_audio_createMediaStreamSource.html (100%) rename dom/media/{test => autoplay/test/mochitest}/test_autoplay_policy_web_audio_mediaElementAudioSourceNode.html (98%) rename dom/media/{test => autoplay/test/mochitest}/test_autoplay_policy_web_audio_notResumePageInvokedSuspendedAudioContext.html (98%) rename dom/media/{test => autoplay/test/mochitest}/test_streams_autoplay.html (95%) diff --git a/dom/media/autoplay/moz.build b/dom/media/autoplay/moz.build index 82f9eeaee83d..1324cb2acef8 100644 --- a/dom/media/autoplay/moz.build +++ b/dom/media/autoplay/moz.build @@ -23,6 +23,8 @@ XPIDL_SOURCES += [ "nsIAutoplay.idl", ] +MOCHITEST_MANIFESTS += ["test/mochitest/mochitest.ini"] + include("/ipc/chromium/chromium-config.mozbuild") FINAL_LIBRARY = "xul" diff --git a/dom/media/test/AutoplayTestUtils.js b/dom/media/autoplay/test/mochitest/AutoplayTestUtils.js similarity index 95% rename from dom/media/test/AutoplayTestUtils.js rename to dom/media/autoplay/test/mochitest/AutoplayTestUtils.js index 3970af530e9f..aa8990c9d912 100644 --- a/dom/media/test/AutoplayTestUtils.js +++ b/dom/media/autoplay/test/mochitest/AutoplayTestUtils.js @@ -1,4 +1,4 @@ -/* import-globals-from manifest.js */ +/* import-globals-from ../../../test/manifest.js */ function playAndPostResult(muted, parent_window) { let element = document.createElement("video"); diff --git a/dom/media/test/file_autoplay_gv_play_request_frame.html b/dom/media/autoplay/test/mochitest/file_autoplay_gv_play_request_frame.html similarity index 100% rename from dom/media/test/file_autoplay_gv_play_request_frame.html rename to dom/media/autoplay/test/mochitest/file_autoplay_gv_play_request_frame.html diff --git a/dom/media/test/file_autoplay_gv_play_request_window.html b/dom/media/autoplay/test/mochitest/file_autoplay_gv_play_request_window.html similarity index 95% rename from dom/media/test/file_autoplay_gv_play_request_window.html rename to dom/media/autoplay/test/mochitest/file_autoplay_gv_play_request_window.html index 13f5700ba5ee..56e4e1031c4e 100644 --- a/dom/media/test/file_autoplay_gv_play_request_window.html +++ b/dom/media/autoplay/test/mochitest/file_autoplay_gv_play_request_window.html @@ -40,7 +40,7 @@ async function createChildFrame(testInfo) { let frame = document.createElement("iframe"); let origin = testInfo.iframe == "same-orgin" ? "http://mochi.test:8888" : "http://example.org"; - frame.src = origin + "/tests/dom/media/test/file_autoplay_gv_play_request_frame.html"; + frame.src = origin + "/tests/dom/media/autoplay/test/mochitest/file_autoplay_gv_play_request_frame.html"; document.body.appendChild(frame); info(`waiting for iframe loading`); is((await nextWindowMessage()).data, "ready", "iframe has finished loading"); diff --git a/dom/media/test/file_autoplay_policy_activation_frame.html b/dom/media/autoplay/test/mochitest/file_autoplay_policy_activation_frame.html similarity index 100% rename from dom/media/test/file_autoplay_policy_activation_frame.html rename to dom/media/autoplay/test/mochitest/file_autoplay_policy_activation_frame.html diff --git a/dom/media/test/file_autoplay_policy_activation_window.html b/dom/media/autoplay/test/mochitest/file_autoplay_policy_activation_window.html similarity index 96% rename from dom/media/test/file_autoplay_policy_activation_window.html rename to dom/media/autoplay/test/mochitest/file_autoplay_policy_activation_window.html index 07d5277de045..60c5a0cec1d3 100644 --- a/dom/media/test/file_autoplay_policy_activation_window.html +++ b/dom/media/autoplay/test/mochitest/file_autoplay_policy_activation_window.html @@ -21,7 +21,7 @@ let frame = document.createElement("iframe"); let origin = testInfo.same_origin_child ? "http://mochi.test:8888" : "http://example.org"; - frame.src = origin + "/tests/dom/media/test/file_autoplay_policy_activation_frame.html"; + frame.src = origin + "/tests/dom/media/autoplay/test/mochitest/file_autoplay_policy_activation_frame.html"; // Wait for it to load... document.body.appendChild(frame); is((await nextWindowMessage()).data, "ready", "Expected a 'ready' message"); diff --git a/dom/media/test/file_autoplay_policy_eventdown_activation.html b/dom/media/autoplay/test/mochitest/file_autoplay_policy_eventdown_activation.html similarity index 100% rename from dom/media/test/file_autoplay_policy_eventdown_activation.html rename to dom/media/autoplay/test/mochitest/file_autoplay_policy_eventdown_activation.html diff --git a/dom/media/test/file_autoplay_policy_key_blacklist.html b/dom/media/autoplay/test/mochitest/file_autoplay_policy_key_blacklist.html similarity index 100% rename from dom/media/test/file_autoplay_policy_key_blacklist.html rename to dom/media/autoplay/test/mochitest/file_autoplay_policy_key_blacklist.html diff --git a/dom/media/test/file_autoplay_policy_play_before_loadedmetadata.html b/dom/media/autoplay/test/mochitest/file_autoplay_policy_play_before_loadedmetadata.html similarity index 100% rename from dom/media/test/file_autoplay_policy_play_before_loadedmetadata.html rename to dom/media/autoplay/test/mochitest/file_autoplay_policy_play_before_loadedmetadata.html diff --git a/dom/media/test/file_autoplay_policy_unmute_pauses.html b/dom/media/autoplay/test/mochitest/file_autoplay_policy_unmute_pauses.html similarity index 100% rename from dom/media/test/file_autoplay_policy_unmute_pauses.html rename to dom/media/autoplay/test/mochitest/file_autoplay_policy_unmute_pauses.html diff --git a/dom/media/autoplay/test/mochitest/mochitest.ini b/dom/media/autoplay/test/mochitest/mochitest.ini new file mode 100644 index 000000000000..f25b12e953f8 --- /dev/null +++ b/dom/media/autoplay/test/mochitest/mochitest.ini @@ -0,0 +1,54 @@ +[DEFAULT] +subsuite = media +tags = autoplay +support-files = + ../../../test/manifest.js + ../../../test/320x240.ogv + ../../../test/bogus.duh + ../../../test/detodos-short.opus + ../../../test/flac-s24.flac + ../../../test/gizmo.mp4 + ../../../test/gizmo.webm + ../../../test/gizmo-noaudio.mp4 + ../../../test/gizmo-noaudio.webm + ../../../test/gizmo-short.mp4 + ../../../test/r11025_s16_c1-short.wav + ../../../test/sample.3g2 + ../../../test/sample.3gp + ../../../test/short.mp4 + ../../../test/seek-short.webm + ../../../test/small-shot.flac + ../../../test/small-shot.m4a + ../../../test/small-shot.mp3 + ../../../test/small-shot-mp3.mp4 + ../../../test/small-shot.ogg + ../../../test/vp9-short.webm + AutoplayTestUtils.js + file_autoplay_gv_play_request_frame.html + file_autoplay_gv_play_request_window.html + file_autoplay_policy_activation_frame.html + file_autoplay_policy_activation_window.html + file_autoplay_policy_eventdown_activation.html + file_autoplay_policy_play_before_loadedmetadata.html + file_autoplay_policy_unmute_pauses.html + file_autoplay_policy_key_blacklist.html + +[test_autoplay.html] +[test_autoplay_contentEditable.html] +[test_autoplay_gv_play_request.html] +skip-if = toolkit != 'android' +[test_autoplay_policy.html] +[test_autoplay_policy_activation.html] +[test_autoplay_policy_play_before_loadedmetadata.html] +skip-if = toolkit == 'android' # bug 1591121 +[test_autoplay_policy_eventdown_activation.html] +[test_autoplay_policy_permission.html] +[test_autoplay_policy_unmute_pauses.html] +[test_autoplay_policy_key_blacklist.html] +skip-if = (verify && debug && (os == 'win')) # bug 1424903 +[test_autoplay_policy_web_audio_notResumePageInvokedSuspendedAudioContext.html] +[test_autoplay_policy_web_audio_mediaElementAudioSourceNode.html] +[test_autoplay_policy_web_audio_AudioParamStream.html] +[test_autoplay_policy_web_audio_createMediaStreamSource.html] +[test_streams_autoplay.html] +tags=mtg capturestream diff --git a/dom/media/test/test_autoplay.html b/dom/media/autoplay/test/mochitest/test_autoplay.html similarity index 95% rename from dom/media/test/test_autoplay.html rename to dom/media/autoplay/test/mochitest/test_autoplay.html index 35ae84b62c73..aa936f976de9 100644 --- a/dom/media/test/test_autoplay.html +++ b/dom/media/autoplay/test/mochitest/test_autoplay.html @@ -11,6 +11,7 @@