blob: 5d2acbcc513da991b4702671b8b5a37e5c5ae5d1 [file] [log] [blame]
<!DOCTYPE html>
<head>
<script src="../../resources/js-test-pre.js"></script>
<script>
var newWindow;
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.setCanOpenWindows();
testRunner.waitUntilDone();
testRunner.setPopupBlockingEnabled(true);
}
function clickHandler() {
newWindow = window.open("about:blank");
self.focus();
debug("Test calling window.open() directly. A popup should be allowed.");
shouldBeNonNull("newWindow");
if (window.testRunner)
testRunner.notifyDone();
}
function clickButton() {
var button = document.getElementById("test");
var buttonX = button.offsetLeft + button.offsetWidth / 2;
var buttonY = button.offsetTop + button.offsetHeight / 2;
if (window.eventSender) {
eventSender.mouseMoveTo(buttonX, buttonY);
eventSender.mouseDown();
eventSender.mouseUp();
}
}
</script>
</head>
<body onload="clickButton()">
<button id="test" onclick="clickHandler()">Click Here</button>
<div id="console"></div>
</body>