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

Side by Side Diff: third_party/WebKit/LayoutTests/media/autoplay-when-visible-multiple-times.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 behaviour of autoplay muted videos with regards to visibility</title > 2 <title>Test behaviour of autoplay muted videos with regards to visibility</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 var gCycleCount = 0; 11 var gCycleCount = 0;
12 12
13 var video; 13 var video;
14 14
15 function runStepsWhenInvisible(t) { 15 function runStepsWhenInvisible(t) {
16 assert_true(video.paused); 16 assert_true(video.paused);
17 video.style.top = '0px'; 17 video.style.top = '0px';
18 18
(...skipping 25 matching lines...) Expand all
44 video.autoplay = true; 44 video.autoplay = true;
45 video.loop = true; 45 video.loop = true;
46 video.style.position = 'absolute'; 46 video.style.position = 'absolute';
47 video.style.top = '-10000px'; 47 video.style.top = '-10000px';
48 document.body.appendChild(video); 48 document.body.appendChild(video);
49 } 49 }
50 50
51 video.addEventListener('canplay', t.step_func(_ => runStepsWhenInvisible(t)) , { once : true }); 51 video.addEventListener('canplay', t.step_func(_ => runStepsWhenInvisible(t)) , { once : true });
52 }); 52 });
53 </script> 53 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698