blob: a6748370f4b002bde40fd7703ce02e5f34162dea [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<title>audio-playback-restriction</title>
<script src=media-file.js></script>
<script src=video-test.js></script>
<script>
function runTest()
{
video = document.getElementsByTagName('audio')[0];
if (window.internals)
run('internals.setMediaElementRestrictions(video, "RequireUserGestureForAudioRateChange")');
waitForEventAndFail('error');
waitForEvent('canplaythrough', canplaythrough);
run('video.src = findMediaFile("audio", "content/test")');
}
function canplaythrough()
{
waitForEvent('playing', playing);
run('video.play()');
}
function playing()
{
waitForEventAndFail('pause');
runWithKeyDown('video.muted = false');
setTimeout(endTest, 250);
}
</script>
</head>
<body onload="runTest()">
<p>Test that when RequireUserGestureForAudioRateChange is set, setting muted with a user gesture clears the restriction.</p>
<audio muted controls></audio>
</body>
</html>