blob: c17dce6227f807c6d965f4c8af5060b7c202c154 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<p>
Test that a forwarded user gesture can be consumed by any timeout,
not just the first.
</p>
<button id="button" onclick="popup()">Click Here</button>
<div id="console"></div>
<script>
function timer1() {
}
function timer2() {
var win = window.open("about:blank", "window");
if (!win)
document.getElementById("console").innerText = "FAILED";
else
document.getElementById("console").innerText = "PASSED";
if (window.testRunner)
testRunner.notifyDone();
}
function popup() {
setTimeout(timer1, 0);
setTimeout(timer2, 10);
}
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.setCanOpenWindows();
testRunner.setPopupBlockingEnabled(true);
testRunner.setCloseRemainingWindowsWhenComplete(true);
testRunner.waitUntilDone();
var button = document.getElementById("button");
if (window.eventSender) {
eventSender.mouseMoveTo(button.offsetLeft + button.offsetWidth / 2, button.offsetTop + button.offsetHeight / 2);
eventSender.mouseDown();
eventSender.mouseUp();
}
}
</script>
</body>
</html>