blob: cfcdd467de880da1393d2b8d3027e36f393d1bec [file] [log] [blame]
<html>
<head>
<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 step()
{
if (!window.layoutTestController)
return;
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
var audio = document.getElementById('audio');
var right = audio.offsetLeft + audio.offsetWidth;
var bottom = audio.offsetTop + audio.offsetHeight;
var x = right - 8;
var y = bottom - 8;
// step forward, should generate a timeupdate event
log("clicking step forward");
eventSender.mouseMoveTo(x, y);
eventSender.mouseDown();
eventSender.mouseUp();
// click step forward button but don't release
log("clicking step forward");
eventSender.mouseDown();
setTimeout(deleteAudio, 10);
}
</script>
</head>
<body >
This tests that events don't continue to target a step button if the media element is deleted while mouse down on button.
<br>
<input type="button" id="button" value="Click Me!" onmouseup="log('button click!')">
<br>
<audio id="audio" ontimeupdate="log('timeupdate')" onload="step()" controls src="content/test.wav"></audio><br><br>
<div id="console"></div>
</body>
</html>