Skip to content

Commit

Permalink
Bug 1674845 - part3 : create 'mochitest' subfolder for autoplay relat…
Browse files Browse the repository at this point in the history
…ed plain mochitests. r=bryce

Differential Revision: https://phabricator.services.mozilla.com/D95880
  • Loading branch information
alastor0325 committed Nov 5, 2020
1 parent 35d0af6 commit 31f03aa
Show file tree
Hide file tree
Showing 28 changed files with 69 additions and 39 deletions.
2 changes: 2 additions & 0 deletions dom/media/autoplay/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ XPIDL_SOURCES += [
"nsIAutoplay.idl",
]

MOCHITEST_MANIFESTS += ["test/mochitest/mochitest.ini"]

include("/ipc/chromium/chromium-config.mozbuild")

FINAL_LIBRARY = "xul"
Original file line number Diff line number Diff line change
@@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
54 changes: 54 additions & 0 deletions dom/media/autoplay/test/mochitest/mochitest.ini
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<video id='v2' autoplay></video><audio id='a2' autoplay></audio>
<pre id="test">
<script class="testbody" type="text/javascript">
/* import-globals-from ../../../test/manifest.js */
var v1 = document.getElementById('v1');
var a1 = document.getElementById('a1');
var v2 = document.getElementById('v2');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<pre id="test">

<script>

/* import-globals-from ../../../test/manifest.js */
var manager = new MediaTestManager;

var tokens = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<pre id="test">

<script>

/* import-globals-from ../../../test/manifest.js */
let manager = new MediaTestManager;

gTestPrefs.push(["media.autoplay.default", SpecialPowers.Ci.nsIAutoplay.BLOCKED],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
async function testPlayInOrigin(testCase) {
// Run test in a new window, to ensure its user gesture
// activation state isn't tainted by preceeding tests.
let url = testCase.origin + "/tests/dom/media/test/file_autoplay_policy_activation_frame.html";
let url = testCase.origin + "/tests/dom/media/autoplay/test/mochitest/file_autoplay_policy_activation_frame.html";
let child = window.open(url, "", "width=500,height=500");
is((await nextWindowMessage()).data, "ready", "Expected a 'ready' message");
child.postMessage("play-audible", testCase.origin);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</head>
<body>
<script>

/* import-globals-from ../../../test/manifest.js */
/**
* This test is used to ensure blocked AudioContext would be resumed when the
* source media element of MediaElementAudioSouceNode which has been created and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</head>
<body>
<script>

/* import-globals-from ../../../test/manifest.js */
/**
* This test is used to ensure we won't resume AudioContext which is suspended
* by page (it means calling suspend() explicitly) when calling
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<body>
<pre id="test">
<script class="testbody" type="text/javascript">
/* import-globals-from ../../../test/manifest.js */
SimpleTest.waitForExplicitFinish();

var media = getPlayableVideo(gSmallTests);
Expand Down
28 changes: 0 additions & 28 deletions dom/media/test/mochitest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ support-files =
320x240.ogv^headers^
448636.ogv
448636.ogv^headers^
AutoplayTestUtils.js
A4.ogv
A4.ogv^headers^
VID_0001.ogg
Expand Down Expand Up @@ -450,14 +449,6 @@ support-files =
eme.js
empty_size.mp3
file_access_controls.html
file_autoplay_gv_play_request_frame.html
file_autoplay_gv_play_request_window.html
file_autoplay_policy_eventdown_activation.html
file_autoplay_policy_key_blacklist.html
file_autoplay_policy_unmute_pauses.html
file_autoplay_policy_activation_window.html
file_autoplay_policy_activation_frame.html
file_autoplay_policy_play_before_loadedmetadata.html
flac-s24.flac
flac-s24.flac^headers^
flac-noheader-s16.flac
Expand Down Expand Up @@ -720,23 +711,6 @@ support-files =
[test_audio2.html]
[test_audioDocumentTitle.html]
skip-if = true # bug 475110 - disabled since we don't play Wave files standalone
[test_autoplay.html]
[test_autoplay_contentEditable.html]
[test_autoplay_policy.html]
[test_autoplay_policy_activation.html]
[test_autoplay_policy_eventdown_activation.html]
[test_autoplay_gv_play_request.html]
skip-if = toolkit != 'android'
[test_autoplay_policy_key_blacklist.html]
skip-if = (verify && debug && (os == 'win')) # bug 1424903
[test_autoplay_policy_unmute_pauses.html]
[test_autoplay_policy_play_before_loadedmetadata.html]
skip-if = toolkit == 'android'
[test_autoplay_policy_permission.html]
[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_buffered.html]
[test_bug448534.html]
[test_bug463162.xhtml]
Expand Down Expand Up @@ -1090,8 +1064,6 @@ tags=seektonextframe
[test_source_null.html]
[test_source_write.html]
[test_standalone.html]
[test_streams_autoplay.html]
tags=mtg capturestream
[test_streams_capture_origin.html]
tags=mtg capturestream
[test_streams_element_capture.html]
Expand Down
6 changes: 3 additions & 3 deletions tools/lint/rejected-words.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ avoid-blacklist-and-whitelist:
- dom/media/platforms/apple/AppleVTDecoder.cpp
- dom/media/platforms/wmf/DXVA2Manager.cpp
- dom/media/platforms/wmf/WMFVideoMFTManager.cpp
- dom/media/test/file_autoplay_policy_key_blacklist.html
- dom/media/test/test_autoplay_policy_key_blacklist.html
- dom/media/test/test_autoplay_policy_permission.html
- dom/media/autoplay/test/mochitest/file_autoplay_policy_key_blacklist.html
- dom/media/autoplay/test/mochitest/test_autoplay_policy_key_blacklist.html
- dom/media/autoplay/test/mochitest/test_autoplay_policy_permission.html
- dom/media/webm/WebMDecoder.cpp
- dom/media/webrtc/jsapi/PeerConnectionMedia.cpp
- dom/media/webrtc/libwebrtcglue/VideoConduit.cpp
Expand Down

0 comments on commit 31f03aa

Please sign in to comment.