diff options
Diffstat (limited to 'testing/web-platform/tests/html/semantics/forms/form-submission-target/form-target-iframe.html')
-rw-r--r-- | testing/web-platform/tests/html/semantics/forms/form-submission-target/form-target-iframe.html | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/forms/form-submission-target/form-target-iframe.html b/testing/web-platform/tests/html/semantics/forms/form-submission-target/form-target-iframe.html new file mode 100644 index 0000000000..f37bc33f6f --- /dev/null +++ b/testing/web-platform/tests/html/semantics/forms/form-submission-target/form-target-iframe.html @@ -0,0 +1,29 @@ +<!DOCTYPE html> +<title>Form targetted at iframe</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script> +async_test(function(t) { + window.addEventListener("load", t.step_func(function() { + var frame = document.createElement("iframe"); + frame.name = "frame"; + document.documentElement.appendChild(frame); + var form = document.createElement("form"); + form.target = "frame"; + form.action = "form-target-iframe-helper.py"; + form.method = "POST"; + var input = document.createElement("input"); + input.name = "n"; + form.appendChild(input); + document.documentElement.appendChild(form); + form.submit(); + frame.addEventListener("load", t.step_func(function() { + if (frame.contentWindow.location.href.includes("form-target-iframe-helper.py")) { + assert_equals(frame.contentWindow.document.body.textContent, "OK"); + t.done(); + } + })); + })); +}, "Form targetted at iframe"); +</script> +<body> |