blob: 239fe25fbfc9ca9431949bc6b0b30bba94991612 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<title>video-playback-restriction-play-before-load</title>
<script src=media-file.js></script>
<script src=video-test.js></script>
<script>
function runTest()
{
video = document.getElementsByTagName('video')[0];
if (window.internals)
run('internals.setMediaElementRestrictions(video, "RequireUserGestureForAudioRateChange")');
waitForEventAndFail('error');
run("video.src = findMediaFile('video', 'content/test')");
run('video.play().then(resolvePromise, rejectPromise)');
}
function resolvePromise()
{
failTest("Promise incorrectly resolved.");
}
function rejectPromise()
{
consoleWrite("Promise correctly rejected.");
endTest();
}
</script>
</head>
<body onload="runTest()">
<p>Test that, when RequireUserGestureForAudioRateChange is set, starting playback of an audio file requires a user gesture.</p>
<video controls autoplay></audio>
</body>
</html>