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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/media/autoplay-crossorigin.html

Issue 2496593002: Adding an experimental flag to block autoplay with sound in cross-origin iframes (Closed)
Patch Set: nits Created 4 years 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>Verify that autoplaying HTMLMediaElement with sound from a cross origin i frame is blocked by crossOriginMediaPlaybackRequiresUserGesture</title>
3 <script src='../resources/testharness.js'></script>
4 <script src='../resources/testharnessreport.js'></script>
5 <body></body>
6 <script>
7 async_test(t => {
8 window.addEventListener('message', t.step_func(e => {
9 if (e.data.videoId != 'video-muted')
10 return;
11 assert_equals('play', e.data.msg);
12 t.done();
13 }));
14 }, "test that muted video in cross-origin iframe should autoplay");
15
16 async_test(t => {
17 window.addEventListener('message', t.step_func(e => {
18 if (e.data.videoId != 'video')
19 return;
20 assert_equals('canplay', e.data.msg);
21 assert_true(e.data.isPaused);
22 assert_greater_than_equal(e.data.readyState, HTMLMediaElement.HAVE_ENOUGH_DA TA);
23 t.done();
24 }));
25 }, "test that muted video in cross-origin iframe should autoplay");
26
27 var f = document.createElement('iframe');
28 f.src = 'http://localhost:8000/media/resources/autoplay-crossorigin-iframe.html' ;
29 f.width=10000;
30 f.height=10000;
31 document.body.appendChild(f);
32 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698