Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Unified Diff: third_party/WebKit/LayoutTests/media/autoplay-muted.html

Issue 2039773003: [Android] Added a runtime flag to enable autoplay of muted videos. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: An attempt to add a layout test. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | third_party/WebKit/Source/core/html/HTMLMediaElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/media/autoplay-muted.html
diff --git a/third_party/WebKit/LayoutTests/media/autoplay.html b/third_party/WebKit/LayoutTests/media/autoplay-muted.html
similarity index 51%
copy from third_party/WebKit/LayoutTests/media/autoplay.html
copy to third_party/WebKit/LayoutTests/media/autoplay-muted.html
index ca59be325e0c3c18f55759b24e6354649e8b6360..bd957771ad6f3d102ddc9a5fd5a96d82f5f77307 100644
--- a/third_party/WebKit/LayoutTests/media/autoplay.html
+++ b/third_party/WebKit/LayoutTests/media/autoplay-muted.html
@@ -1,17 +1,16 @@
-<!doctype html>
-<!-- original: https://github.com/w3c/web-platform-tests/blob/6b3893bb99f70e4238011dbcd1f380891e89ec5e/html/semantics/embedded-content-0/media-elements/autoplay.html -->
-<title>autoplay</title>
-<script src="../resources/testharness.js"></script>
+<!DOCTYPE html>
+<title>Test for autoplay of muted video</title>
+<script src="../resource/testharness.js"></script>
mlamouri (slow - plz ping) 2016/06/07 15:40:14 You have a typo here I think :(
whywhat 2016/06/07 17:40:15 Right, fixed :)
<script src="../resources/testharnessreport.js"></script>
<script src="media-file.js"></script>
-<div id="log"></div>
<script>
-function autoplay_test(tagName, src)
-{
- async_test(function(t)
+ window.internals.settings.setMediaPlaybackRequiresUserGesture(true);
+
+ async_test(function(t))
{
- var e = document.createElement(tagName);
- e.src = src;
+ var e = document.createElement('video');
+ e.src = findMediaFile('video', 'content/test');
+ e.muted = true;
e.autoplay = true;
var actual_events = [];
var expected_events = ['canplay', 'play', 'playing', 'canplaythrough'];
@@ -28,9 +27,14 @@ function autoplay_test(tagName, src)
}
}));
});
- }, tagName + '.autoplay');
-}
+ }, "muted-autoplay");
-autoplay_test('audio', findMediaFile('audio', 'content/test'));
-autoplay_test('video', findMediaFile('video', 'content/test'));
+ async_test(function(t))
+ {
+ if (window.internals && internals.runtimeFlags.videosAsImagesEnabled) {
+ var e = document.createElement('video');
+ e.src = findMediaFile('video', 'content/test');
+ e.muted = true;
+ e.play().then(function() { t.done(); });
+ }, "muted-playjs");
</script>
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | third_party/WebKit/Source/core/html/HTMLMediaElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698