blob: dde6010e51d6f1ad838653f9bba14d6bb0691837 [file] [log] [blame]
<!DOCTYPE html><!-- webkit-test-runner [ enableModernMediaControls=false ] -->
<html>
<head>
<script src="media-controls.js"></script>
<script src="media-file.js"></script>
<script src="video-test.js"></script>
<script>
if (window.internals) {
internals.settings.setVideoPlaybackRequiresUserGesture(true);
internals.settings.setRequiresUserGestureToLoadVideo(true);
}
var didUserGesture = false;
function checkDidLoadMetadataAfterUserGesture()
{
if (didUserGesture)
passTest("Did load metadata after user gesture.");
else
failTest("Did load metadata without user gesture");
}
function performClickOnPlayButton()
{
didUserGesture = true;
clickPlayButton(video);
}
function start()
{
findMediaElement();
waitForEvent("loadedmetadata", checkDidLoadMetadataAfterUserGesture);
video.src = findMediaFile("video", "content/test");
window.setTimeout(performClickOnPlayButton, 0);
}
</script>
</head>
<body onload="start()">
<video id="video" controls></video>
</body>
</html>