blob: a9f478377e065ca8c1a95820413fb4c471e6a22b [file] [log] [blame]
<script src="/js-test-resources/ui-helper.js"></script>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function navigateFrame()
{
window.location.href = 'resources/notify-done.html';
}
window.onload = function()
{
// Simulate a user interaction with the page so that the beforeunload alert shows.
const testButton = document.getElementById("testButton");
UIHelper.activateAt(testButton.offsetLeft + 5, testButton.offsetTop + 5);
}
</script>
<body>
When viewed using the host 127.0.0.1, this page has a sandboxed iframe whose security origin matches the main frame.<br>
The iframe has a beforeunload handler, and that handler should result in the display of the page dismissal dialog since allow-modals is set.<br>
<input id="testButton" type="button" value="Click to navigate" onclick="navigateFrame()">
<iframe sandbox="allow-scripts allow-same-origin allow-modals" src="http://127.0.0.1:8000/misc/resources/iframe-with-beforeunload.html"></iframe><br>
</body>