| <title>video-playback-restriction-play-before-load</title> |
| <script src=media-file.js></script> |
| <script src=video-test.js></script> |
| video = document.getElementsByTagName('video')[0]; |
| 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."); |
| consoleWrite("Promise correctly rejected."); |
| <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> |