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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>Test for autoplay of muted video</title>
3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script>
5 <script src="media-file.js"></script>
6 <script>
7 window.internals.settings.setMediaPlaybackRequiresUserGesture(true);
8 window.internals.runtimeFlags.autoplayMutedVideosEnabled = true;
9
10 function createMutedVideoElement() {
11 var e = document.createElement('video');
12 e.src = findMediaFile('video', 'content/test');
13 e.muted = true;
14 return e;
15 }
16
17 async_test(function(t)
18 {
19 var e = createMutedVideoElement();
20 e.autoplay = true;
21
22 var expectedEvents = [
23 'canplay', 'play', 'playing'];
24 var eventWatcher = new EventWatcher(t, e, expectedEvents);
25 eventWatcher.wait_for(expectedEvents)
26 .then(t.step_func_done(function()
27 {
28 assert_false(e.paused);
29 }));
30 }, "muted-autoplay");
31
32 promise_test(function()
33 {
34 return createMutedVideoElement().play();
35 }, "muted-playjs");
36 </script>
OLDNEW
« 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