blob: 2a0b9c1e508e945a03dd6dc6dbda09df3d7ffa0c [file] [log] [blame]
<!DOCTYPE html><!-- webkit-test-runner [ enableModernMediaControls=false ] -->
<html>
<head>
<title>media-controls-timeline-set-controls-property</title>
<script src="media-controls.js"></script>
<script src="media-file.js"></script>
<script src="video-test.js"></script>
<script>
var x;
var y;
var seekCount = 0;
var moveInterval;
function runTest()
{
findMediaElement();
waitForEvent('playing', beginScrubbing);
video.src = findMediaFile('video', 'content/test');
video.play();
}
function beginScrubbing()
{
if (window.eventSender) {
var timelineCoordinate;
try {
timelineCoordinate = mediaControlsButtonCoordinates(video, 'timeline');
} catch (exception) {
failTest(exception.description);
return;
}
x = timelineCoordinate[0];
y = timelineCoordinate[1];
eventSender.dragMode = false;
eventSender.mouseMoveTo(x, y);
eventSender.mouseDown();
}
waitForEvent('pause', pause);
waitForEvent('seeked', seeked)
}
function pause()
{
video.controls = 'true';
moveInterval = setInterval(move, 100);
}
function move()
{
if (window.eventSender) {
x += 10;
eventSender.mouseMoveTo(x, y);
}
}
function seeked()
{
++seekCount;
if (seekCount < 3)
return;
clearInterval(moveInterval);
if (window.eventSender)
eventSender.mouseUp();
endTest();
}
</script>
</head>
<body onload="runTest()">
<p>Test that dragging the timeline slider after setting video.controls=true causes seeks.</p>
<video controls style="width: 500px"></video>
</body>
</html>