blob: 0ca753e0ecf10e25944bd45d0d8744aadb289e28 [file] [log] [blame]
<html>
<head>
<script>
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.setCanOpenWindows();
layoutTestController.dumpChildFramesAsText();
layoutTestController.waitUntilDone();
layoutTestController.setCloseRemainingWindowsWhenComplete()
layoutTestController.setPopupBlockingEnabled(true);
}
function closeWindow(windowToClose)
{
windowToClose.close();
setTimeout(doneHandler, 1);
function doneHandler()
{
if (!windowToClose.closed)
setTimeout(doneHandler, 1);
else if (window.layoutTestController)
layoutTestController.notifyDone();
}
}
function handleClick(event) {
var newWindow = window.open('resources/window-opened.html', 'badName', 'width=100, height=100');
if (newWindow) {
log("Window was opened! Test succeeded!");
closeWindow(newWindow);
}
event.preventDefault();
return false;
}
function test()
{
if (window.layoutTestController) {
eventSender.mouseMoveTo(2, 2);
eventSender.scheduleAsynchronousClick();
}
}
function log(msg)
{
var res = document.getElementById('res');
res.innerHTML = res.innerHTML + msg + "<br>";
}
</script>
</head>
<body style="border: 0; margin: 0" onload="test()">
<iframe style="border: 0; margin: 0" src="resources/popup-blocking-click-in-iframe-otherFrame.html" id="otherFrame"></iframe>
<p>This tests that popup blocking does not supress windows opened in an iframe if the event handler is a function from an enclosing frame.</p>
<p>To run manually click the link in the iframe above with popup blocking enabled.</p>
<div id="res"></div>
</body>
</html>