3 <meta name=
"timeout" content=
"long">
4 <script src=
"/resources/testharness.js"></script>
5 <script src=
"/resources/testharnessreport.js"></script>
9 name
: "form submission from form should navigate to url with x-www-form-urlencoded",
10 input
: "<input name=foo value=bara>",
11 enctype
: "application/x-www-form-urlencoded",
13 submitaction: function(doc
) { doc
.getElementById("testform").submit(); }
16 name
: "form submission from form should navigate to url with multipart/form-data",
17 input
: "<textarea name=foo>bar</textarea>",
18 enctype
: "multipart/form-data",
20 submitaction: function(doc
) { doc
.getElementById("testform").submit(); }
23 name
: "form submission from form should navigate to url with text/plain",
24 input
: "<textarea name=qux>baz</textarea>",
25 enctype
: "text/plain",
27 submitaction: function(doc
) { doc
.getElementById("testform").submit(); }
30 name
: "form submission from button should navigate to url with x-www-form-urlencoded",
31 input
: "<input name=foo value=bara>",
32 enctype
: "application/x-www-form-urlencoded",
33 submitelement
: "<button id=buttonsubmit type=\"submit\">Submit</button>",
34 submitaction: function(doc
) { doc
.getElementById("buttonsubmit").click(); }
37 name
: "form submission from button should navigate to url with multipart/form-data",
38 input
: "<textarea name=foo>bar</textarea>",
39 enctype
: "multipart/form-data",
40 submitelement
: "<button id=buttonsubmit type=\"submit\">Submit</button>",
41 submitaction: function(doc
) { doc
.getElementById("buttonsubmit").click(); }
44 name
: "form submission from button should navigate to url with text/plain",
45 input
: "<textarea name=qux>baz</textarea>",
46 enctype
: "text/plain",
47 submitelement
: "<button id=buttonsubmit type=\"submit\">Submit</button>",
48 submitaction: function(doc
) { doc
.getElementById("buttonsubmit").click(); }
51 name
: "form submission from input should navigate to url with x-www-form-urlencoded",
52 input
: "<input name=foo value=bara>",
53 enctype
: "application/x-www-form-urlencoded",
54 submitelement
: "<input id=inputsubmit type=\"submit\">Submit</input>",
55 submitaction: function(doc
) { doc
.getElementById("inputsubmit").click(); }
58 name
: "form submission from input should navigate to url with multipart/form-data",
59 input
: "<textarea name=foo>bar</textarea>",
60 enctype
: "multipart/form-data",
61 submitelement
: "<input id=inputsubmit type=\"submit\">Submit</input>",
62 submitaction: function(doc
) { doc
.getElementById("inputsubmit").click(); }
65 name
: "form submission from input should navigate to url with text/plain",
66 input
: "<input name=qux value=baz>",
67 enctype
: "text/plain",
68 submitelement
: "<input id=inputsubmit type=\"submit\">Submit</input>",
69 submitaction: function(doc
) { doc
.getElementById("inputsubmit").click(); }
72 name
: "form submission from submit input should contain submit button value",
73 input
: "<button type=submit name=notclicked value=nope>not clicked</button>",
74 enctype
: "application/x-www-form-urlencoded",
75 submitelement
: "<button id=inputsubmit type=\"submit\" name=foo value=bara>Submit</button>",
76 submitaction: function(doc
) { doc
.getElementById("inputsubmit").click(); }
80 name
: "form submission from submit button should contain submit button value",
81 input
: "<input type=submit name=notclicked value=nope/>",
82 enctype
: "application/x-www-form-urlencoded",
83 submitelement
: "<input id=inputsubmit type=\"submit\" name=foo value=bara >",
84 submitaction: function(doc
) { doc
.getElementById("inputsubmit").click(); }
87 simple_tests
.forEach(function(test_obj
) {
88 test_obj
.test
= async_test(test_obj
.name
);
90 function run_simple_test() {
91 if (simple_tests
.length
== 0) {
94 var test_obj
= simple_tests
.pop();
95 var t
= test_obj
.test
;
96 var testframe
= document
.getElementById("testframe");
97 var testdocument
= testframe
.contentWindow
.document
;
98 testdocument
.body
.innerHTML
=
99 "<form id=testform method=post action=\"/html/semantics/forms/form-submission-0/resources/form-submission.py\" enctype=\"" + test_obj
.enctype
+ "\">" +
101 test_obj
.submitelement
+
103 testframe
.onload = function() {
105 var response
= testframe
.contentDocument
.documentElement
.textContent
;
106 assert_equals(response
, "OK");
111 test_obj
.submitaction(testdocument
);
114 <iframe id=testframe
src=
"/common/blank.html" onload=
"run_simple_test();"></iframe>