blob: 7ff81ef17d23d6d6657e22b02523884109fe2d53 [file] [log] [blame]
<!DOCTYPE html>
<title>Verify that autoplaying HTMLMediaElement with sound from a cross origin iframe is blocked by crossOriginMediaPlaybackRequiresUserGesture</title>
<script src='../resources/testharness.js'></script>
<script src='../resources/testharnessreport.js'></script>
<body></body>
<script>
async_test(t => {
window.addEventListener('message', t.step_func(e => {
if (e.data.videoId != 'video-muted')
return;
assert_equals('play', e.data.msg);
t.done();
}));
}, "test that muted video in cross-origin iframe should autoplay");
async_test(t => {
window.addEventListener('message', t.step_func(e => {
if (e.data.videoId != 'video')
return;
assert_equals('canplay', e.data.msg);
assert_true(e.data.isPaused);
assert_greater_than_equal(e.data.readyState, HTMLMediaElement.HAVE_ENOUGH_DATA);
t.done();
}));
}, "test that muted video in cross-origin iframe should autoplay");
var f = document.createElement('iframe');
f.src = 'http://localhost:8000/media/resources/autoplay-crossorigin-iframe.html';
f.width=10000;
f.height=10000;
document.body.appendChild(f);
</script>