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

Side by Side Diff: third_party/WebKit/LayoutTests/media/autoplay-unmute-offscreen.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 unmuting offscreen video will not allow it to autoplay</title> 2 <title>Test that unmuting offscreen video will not allow it to autoplay</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-file.js"></script> 5 <script src="media-file.js"></script>
6 <body> 6 <body>
7 <script> 7 <script>
8 window.internals.settings.setMediaPlaybackRequiresUserGesture(true); 8 window.internals.settings.setAutoplayPolicy('user-gesture-required');
9 window.internals.runtimeFlags.autoplayMutedVideosEnabled = true; 9 window.internals.runtimeFlags.autoplayMutedVideosEnabled = true;
10 10
11 async_test(function(t) { 11 async_test(function(t) {
12 // Create a video off screen that will be unmuted before moving on screen. 12 // Create a video off screen that will be unmuted before moving on screen.
13 { 13 {
14 var video = document.createElement('video'); 14 var video = document.createElement('video');
15 video.id = 'offscreen-unmute'; 15 video.id = 'offscreen-unmute';
16 video.src = findMediaFile('video', 'content/test'); 16 video.src = findMediaFile('video', 'content/test');
17 video.muted = true; 17 video.muted = true;
18 video.autoplay = true; 18 video.autoplay = true;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 assert_false(offscreenMute.paused); 57 assert_false(offscreenMute.paused);
58 }), 0); 58 }), 0);
59 })); 59 }));
60 } 60 }
61 61
62 offscreenUnmute.addEventListener('canplaythrough', t.step_func(canPlayTrough Handler)); 62 offscreenUnmute.addEventListener('canplaythrough', t.step_func(canPlayTrough Handler));
63 offscreenMute.addEventListener('canplaythrough', t.step_func(canPlayTroughHa ndler)); 63 offscreenMute.addEventListener('canplaythrough', t.step_func(canPlayTroughHa ndler));
64 }); 64 });
65 </script> 65 </script>
66 </body> 66 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698