summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/forms/form-submission-0/form-double-submit-multiple-targets.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/semantics/forms/form-submission-0/form-double-submit-multiple-targets.html')
-rw-r--r--testing/web-platform/tests/html/semantics/forms/form-submission-0/form-double-submit-multiple-targets.html37
1 files changed, 37 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/forms/form-submission-0/form-double-submit-multiple-targets.html b/testing/web-platform/tests/html/semantics/forms/form-submission-0/form-double-submit-multiple-targets.html
new file mode 100644
index 0000000000..2b5a589b53
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/form-submission-0/form-double-submit-multiple-targets.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<link rel="author" title="Joey Arhar" href="mailto:jarhar@chromium.org">
+
+<!-- The expected behavior of this test is not explicitly specified. -->
+
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<form id=myform name=myform action="/formaction.html"></form>
+<iframe id=frame1 name=target1></iframe>
+<iframe id=frame2 name=target2></iframe>
+<iframe id=frame3 name=target3></iframe>
+
+<script>
+
+promise_test(async () => {
+ const frame1LoadPromise = new Promise(resolve => frame1.onload = resolve);
+ const frame2LoadPromise = new Promise(resolve => frame2.onload = resolve);
+ const frame3LoadPromise = new Promise(resolve => frame3.onload = resolve);
+
+ myform.target = 'target1';
+ myform.submit();
+ myform.target = 'target2';
+ myform.submit();
+ myform.target = 'target3';
+ myform.submit();
+
+ await Promise.all([frame1LoadPromise, frame2LoadPromise, frame3LoadPromise]);
+
+ assert_equals(frame1.contentDocument.location.pathname, '/formaction.html');
+ assert_equals(frame2.contentDocument.location.pathname, '/formaction.html');
+ assert_equals(frame3.contentDocument.location.pathname, '/formaction.html');
+
+}, 'Verifies that one form used to target multiple frames in succession navigates all of them.');
+
+</script>