blob: e057d32541b2c48d1ceecf066f821cb246c8cfbf [file] [log] [blame]
<!DOCTYPE html>
<html>
<script src="../../resources/testdriver.js"></script>
<script src="../../resources/testdriver-vendor.js"></script>
<body>
<p>
Test that only a single popup is allowed in response to a single
user action. The test passes if only one popup is created.
</p>
<button id="button" onclick="popup()">Click Here</button>
<div id="console"></div>
<script>
function popup() {
window.open("about:blank", "window1");
window.open("about:blank", "window2");
if (window.testRunner) {
if (testRunner.windowCount() == windowCount + 1)
document.getElementById("console").innerText = "PASSED";
else
document.getElementById("console").innerText = "FAILED";
testRunner.notifyDone();
}
}
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.setCanOpenWindows();
testRunner.setPopupBlockingEnabled(true);
testRunner.waitUntilDone();
gc();
windowCount = testRunner.windowCount();
var button = document.getElementById("button");
test_driver.click(button);
}
</script>
</body>
</html>