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

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: Renamed the flag to autoplay-muted-videos 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.cpp » ('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-muted.html b/third_party/WebKit/LayoutTests/media/autoplay-muted.html
new file mode 100644
index 0000000000000000000000000000000000000000..3ac13cbffad04950725f67645c0bd43cd19010e6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/autoplay-muted.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<title>Test for autoplay of muted video</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
+<script>
+ window.internals.settings.setMediaPlaybackRequiresUserGesture(true);
+ window.internals.runtimeFlags.autoplayMutedVideosEnabled = true;
+
+ function createMutedVideoElement() {
+ var e = document.createElement('video');
+ e.src = findMediaFile('video', 'content/test');
+ e.muted = true;
+ return e;
+ }
+
+ async_test(function(t)
+ {
+ var e = createMutedVideoElement();
+ e.autoplay = true;
+
+ var expectedEvents = [
+ 'canplay', 'play', 'playing'];
+ var eventWatcher = new EventWatcher(t, e, expectedEvents);
+ eventWatcher.wait_for(expectedEvents)
+ .then(t.step_func_done(function()
+ {
+ assert_false(e.paused);
+ }));
+ }, "muted-autoplay");
+
+ promise_test(function()
+ {
+ return createMutedVideoElement().play();
+ }, "muted-playjs");
+</script>
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | third_party/WebKit/Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698