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

Side by Side Diff: third_party/WebKit/LayoutTests/media/video-play-require-user-gesture.html

Issue 2850553002: Autoplay: use an autoplay policy setting in Blink. (Closed)
Patch Set: rebase Created 3 years, 7 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Test that video play does not work unless a user gesture is involved in p laying a video.</title> 2 <title>Test that video play does not work unless a user gesture is involved in p laying a video.</title>
3 <script src="../resources/testharness.js"></script> 3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script> 4 <script src="../resources/testharnessreport.js"></script>
5 <script src="media-controls.js"></script> 5 <script src="media-controls.js"></script>
6 <script src="media-file.js"></script> 6 <script src="media-file.js"></script>
7 <script> 7 <script>
8 internals.settings.setMediaPlaybackRequiresUserGesture(true); 8 internals.settings.setAutoplayPolicy('user-gesture-required');
9 </script> 9 </script>
10 <video controls></video> 10 <video controls></video>
11 <script> 11 <script>
12 async_test(function(t) { 12 async_test(function(t) {
13 var userGestureInitiated = false; 13 var userGestureInitiated = false;
14 var video = document.querySelector("video"); 14 var video = document.querySelector("video");
15 15
16 video.oncanplaythrough = t.step_func(function() { 16 video.oncanplaythrough = t.step_func(function() {
17 // No user gesture initiated. 17 // No user gesture initiated.
18 video.play(); 18 video.play();
(...skipping 11 matching lines...) Expand all
30 assert_true(userGestureInitiated); 30 assert_true(userGestureInitiated);
31 video.pause(); 31 video.pause();
32 }); 32 });
33 33
34 video.onpause = t.step_func_done(function() { 34 video.onpause = t.step_func_done(function() {
35 assert_true(video.paused); 35 assert_true(video.paused);
36 }); 36 });
37 37
38 video.src = findMediaFile("video", "content/test"); 38 video.src = findMediaFile("video", "content/test");
39 }); 39 });
40 </script> 40 </script>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/media/play-promise-crash.html ('k') | third_party/WebKit/Source/core/frame/Settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698