blob: 50b7a1a7d887abbfd20bbad2a11cd8bd82635319 [file] [log] [blame]
<html>
<head>
<script src="media-file.js"></script>
<script src="video-test.js"></script>
<script>
function start()
{
video = document.createElement('video');
run('internals.setMediaElementRestrictions(video, "InvisibleAutoplayNotPermitted")');
video.autoplay = true;
video.muted = true;
consoleWrite('** setting video.src');
video.src = findMediaFile('video', 'content/test');
waitForEvent('play', play)
setTimeout(putInDOM, 250);
}
function putInDOM()
{
run('document.body.appendChild(video)');
failTestIn(250);
}
function play()
{
if (!video.parentNode)
failTest('play event fired before element was put in DOM');
endTest();
}
</script>
</head>
<body onload="start()">
<p>Test that "invisible autoplay not allowed restriction" plays media when scrolled into view.</p>
</body>
</html>