chromium/third_party/blink/web_tests/http/tests/navigation/resources/form-submit-in-opener-iframe.html

<script>
var otherDocument = opener.frames[0].document;

var form = otherDocument.createElement("form");
form.setAttribute("action", "notify-done.html");
form.setAttribute("name", "TestForm");
form.setAttribute("target", "testFrame");
form.setAttribute("method", "post");
var button = otherDocument.createElement("input");
button.setAttribute("type", "submit");
form.appendChild(button);
otherDocument.body.appendChild(form);

form.submit();
window.close();
</script>