diff --git a/tests/wpt/web-platform-tests/common/form-submission.py b/tests/wpt/web-platform-tests/common/form-submission.py index eb9c654444b..78f96fe3145 100644 --- a/tests/wpt/web-platform-tests/common/form-submission.py +++ b/tests/wpt/web-platform-tests/common/form-submission.py @@ -4,6 +4,11 @@ def main(request, response): return 'OK' else: return 'FAIL' + elif request.headers.get('Content-Type') == 'text/plain': + if request.body == 'qux=baz\r\n': + return 'OK' + else: + return 'FAIL' else: if request.POST.first('foo') == 'bar': return 'OK' diff --git a/tests/wpt/web-platform-tests/html/semantics/forms/form-submission-0/submit-entity-body.html b/tests/wpt/web-platform-tests/html/semantics/forms/form-submission-0/submit-entity-body.html index 3c6e0b725c2..736ef1318b1 100644 --- a/tests/wpt/web-platform-tests/html/semantics/forms/form-submission-0/submit-entity-body.html +++ b/tests/wpt/web-platform-tests/html/semantics/forms/form-submission-0/submit-entity-body.html @@ -18,6 +18,13 @@ var simple_tests = [ submitelement: "", submitaction: function(doc) { doc.getElementById("testform").submit(); } }, + { + name: "form submission from form should navigate to url with text/plain", + input: "", + enctype: "text/plain", + submitelement: "", + submitaction: function(doc) { doc.getElementById("testform").submit(); } + }, { name: "form submission from button should navigate to url with x-www-form-urlencoded", input: "", @@ -32,6 +39,13 @@ var simple_tests = [ submitelement: "", submitaction: function(doc) { doc.getElementById("buttonsubmit").click(); } }, + { + name: "form submission from button should navigate to url with text/plain", + input: "", + enctype: "text/plain", + submitelement: "", + submitaction: function(doc) { doc.getElementById("buttonsubmit").click(); } + }, { name: "form submission from input should navigate to url with x-www-form-urlencoded", input: "", @@ -46,6 +60,13 @@ var simple_tests = [ submitelement: "Submit", submitaction: function(doc) { doc.getElementById("inputsubmit").click(); } }, + { + name: "form submission from input should navigate to url with text/plain", + input: "", + enctype: "text/plain", + submitelement: "Submit", + submitaction: function(doc) { doc.getElementById("inputsubmit").click(); } + } ]; simple_tests.forEach(function(test_obj) { test_obj.test = async_test(test_obj.name);