From e1091128cd74d59b471d2016ed5542cda6741ac2 Mon Sep 17 00:00:00 2001 From: Keith Yeung Date: Mon, 25 Apr 2016 05:40:54 -0400 Subject: [PATCH] Add tests for submit entity body --- tests/wpt/metadata/MANIFEST.json | 6 +++ .../common/form-submission.py | 12 +++++ .../form-submission-0/submit-entity-body.html | 44 +++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 tests/wpt/web-platform-tests/common/form-submission.py create mode 100644 tests/wpt/web-platform-tests/html/semantics/forms/form-submission-0/submit-entity-body.html diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json index 4fbeada837c..35840679f11 100644 --- a/tests/wpt/metadata/MANIFEST.json +++ b/tests/wpt/metadata/MANIFEST.json @@ -35264,6 +35264,12 @@ "path": "html/dom/documents/dom-tree-accessors/Document.body.html", "url": "/html/dom/documents/dom-tree-accessors/Document.body.html" } + ], + "html/semantics/forms/form-submission-0/submit-entity-body.html": [ + { + "path": "html/semantics/forms/form-submission-0/submit-entity-body.html", + "url": "/html/semantics/forms/form-submission-0/submit-entity-body.html" + } ] } }, diff --git a/tests/wpt/web-platform-tests/common/form-submission.py b/tests/wpt/web-platform-tests/common/form-submission.py new file mode 100644 index 00000000000..eb9c654444b --- /dev/null +++ b/tests/wpt/web-platform-tests/common/form-submission.py @@ -0,0 +1,12 @@ +def main(request, response): + if request.headers.get('Content-Type') == 'application/x-www-form-urlencoded': + if request.body == 'foo=bara': + return 'OK' + else: + return 'FAIL' + else: + if request.POST.first('foo') == 'bar': + return 'OK' + else: + return 'FAIL' + 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 new file mode 100644 index 00000000000..a94244c7e67 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/semantics/forms/form-submission-0/submit-entity-body.html @@ -0,0 +1,44 @@ + + + + + +