Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 52a384cd39
Fetching contributors…

Cannot retrieve contributors at this time

87 lines (69 sloc) 2.885 kB
<html>
<head>
<script src=media-file.js></script>
<script>
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
}
function log(msg)
{
var console = document.getElementById('console');
console.innerHTML = console.innerHTML + msg + "<br>";
}
function buttonClick()
{
if (document.getElementById('audio'))
log("<br>FAIL: audio element not deleted!!");
log("<br>clicking button");
// click the button
var button = document.getElementById('button');
eventSender.mouseMoveTo(button.offsetLeft + 20, button.offsetTop + 7);
eventSender.mouseDown();
eventSender.mouseUp();
layoutTestController.notifyDone();
}
function deleteAudio()
{
// delete the search
log("<br>deleting audio element");
var audio = document.getElementById('audio');
audio.parentNode.removeChild(audio);
setTimeout(buttonClick, 10);
}
function drag()
{
if (!window.layoutTestController)
return;
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
var audio = document.getElementById('audio');
var middle = audio.offsetLeft + (audio.offsetWidth / 2);
var bottom = audio.offsetTop + audio.offsetHeight;
var x = middle + 16 + 16 + 8;
var y = bottom - 8;
// drag slider, leave the mouse down
log("clicking in controller");
eventSender.mouseMoveTo(x, y);
eventSender.mouseDown();
eventSender.mouseUp();
log("clicking on thumb");
eventSender.mouseDown();
eventSender.mouseMoveTo(x, y + 20);
setTimeout(deleteAudio, 10);
}
function start()
{
setSrcByTagName("audio", findMediaFile("audio", "content/test"));
}
</script>
</head>
<body onload="start()">
This tests that events don't continue to target a slider thumb if the media element is deleted while scrubbing.
<br>
<input type="button" id="button" value="Click Me!" onmouseup="log('button click!')">
<br>
<audio id="audio" ontimeupdate="log('timeupdate')" onload="drag()" controls></audio><br><br>
<div id="console"></div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.