mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Add test for encoding text/plain in forms
This commit is contained in:
parent
d1c0af9ae7
commit
5e078870a2
2 changed files with 26 additions and 0 deletions
|
@ -4,6 +4,11 @@ def main(request, response):
|
||||||
return 'OK'
|
return 'OK'
|
||||||
else:
|
else:
|
||||||
return 'FAIL'
|
return 'FAIL'
|
||||||
|
elif request.headers.get('Content-Type') == 'text/plain':
|
||||||
|
if request.body == 'qux=baz\r\n':
|
||||||
|
return 'OK'
|
||||||
|
else:
|
||||||
|
return 'FAIL'
|
||||||
else:
|
else:
|
||||||
if request.POST.first('foo') == 'bar':
|
if request.POST.first('foo') == 'bar':
|
||||||
return 'OK'
|
return 'OK'
|
||||||
|
|
|
@ -18,6 +18,13 @@ var simple_tests = [
|
||||||
submitelement: "",
|
submitelement: "",
|
||||||
submitaction: function(doc) { doc.getElementById("testform").submit(); }
|
submitaction: function(doc) { doc.getElementById("testform").submit(); }
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "form submission from form should navigate to url with text/plain",
|
||||||
|
input: "<textarea name=qux>baz</textarea>",
|
||||||
|
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",
|
name: "form submission from button should navigate to url with x-www-form-urlencoded",
|
||||||
input: "<input name=foo value=bara>",
|
input: "<input name=foo value=bara>",
|
||||||
|
@ -32,6 +39,13 @@ var simple_tests = [
|
||||||
submitelement: "<button id=buttonsubmit type=\"submit\">Submit</button>",
|
submitelement: "<button id=buttonsubmit type=\"submit\">Submit</button>",
|
||||||
submitaction: function(doc) { doc.getElementById("buttonsubmit").click(); }
|
submitaction: function(doc) { doc.getElementById("buttonsubmit").click(); }
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "form submission from button should navigate to url with text/plain",
|
||||||
|
input: "<textarea name=qux>baz</textarea>",
|
||||||
|
enctype: "text/plain",
|
||||||
|
submitelement: "<button id=buttonsubmit type=\"submit\">Submit</button>",
|
||||||
|
submitaction: function(doc) { doc.getElementById("buttonsubmit").click(); }
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "form submission from input should navigate to url with x-www-form-urlencoded",
|
name: "form submission from input should navigate to url with x-www-form-urlencoded",
|
||||||
input: "<input name=foo value=bara>",
|
input: "<input name=foo value=bara>",
|
||||||
|
@ -46,6 +60,13 @@ var simple_tests = [
|
||||||
submitelement: "<input id=inputsubmit type=\"submit\">Submit</input>",
|
submitelement: "<input id=inputsubmit type=\"submit\">Submit</input>",
|
||||||
submitaction: function(doc) { doc.getElementById("inputsubmit").click(); }
|
submitaction: function(doc) { doc.getElementById("inputsubmit").click(); }
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "form submission from input should navigate to url with text/plain",
|
||||||
|
input: "<input name=qux value=baz>",
|
||||||
|
enctype: "text/plain",
|
||||||
|
submitelement: "<input id=inputsubmit type=\"submit\">Submit</input>",
|
||||||
|
submitaction: function(doc) { doc.getElementById("inputsubmit").click(); }
|
||||||
|
}
|
||||||
];
|
];
|
||||||
simple_tests.forEach(function(test_obj) {
|
simple_tests.forEach(function(test_obj) {
|
||||||
test_obj.test = async_test(test_obj.name);
|
test_obj.test = async_test(test_obj.name);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue