blob: 683f527493e9b2ca40338d9f82fa7812d196ea8b [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<p id="description">Tests that form submissions (via an onclick handler) inside an iframe generate history entries.</p>
<div id="manual-explanation" style="display: none; color: blue">When running this test outside of DRT, please click on the "Submit" button.</div>
<pre id="console"></pre>
<script>
if (window.testRunner) {
testRunner.clearBackForwardList();
testRunner.waitUntilDone();
testRunner.dumpAsText();
testRunner.dumpChildFramesAsText();
}
var formSubmitted = false;
function submitForm()
{
if (formSubmitted) return;
formSubmitted = true;
// Make sure we always generate history entries for the page that we're on.
window.setTimeout(function() {
if (window.eventSender) {
var frameNode = document.getElementById('the-frame');
var submitButtonNode = frameNode.contentWindow.document.getElementById('submit-button');
eventSender.mouseMoveTo(
frameNode.offsetLeft + submitButtonNode.offsetLeft + submitButtonNode.offsetWidth / 2,
frameNode.offsetTop + submitButtonNode.offsetTop + submitButtonNode.offsetHeight / 2);
eventSender.mouseDown();
eventSender.mouseUp();
} else {
document.getElementById('manual-explanation').style.display = '';
}
}, 0);
}
</script>
<iframe id="the-frame" name="the-frame" src="resources/form-with-onclick-submit.html" onload="submitForm()"></iframe>
</body>
</html>