mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Add XHR support for FormData
This commit is contained in:
parent
c420a870c1
commit
184b522230
13 changed files with 173 additions and 174 deletions
|
@ -1,8 +0,0 @@
|
|||
[FormData-append.html]
|
||||
type: testharness
|
||||
[Passing a String object to FormData.append should work.]
|
||||
expected: FAIL
|
||||
|
||||
[testFormDataAppendEmptyBlob]
|
||||
expected: FAIL
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
[formdata-delete.htm]
|
||||
type: testharness
|
||||
[testFormDataDeleteFromFormNonExistentKey]
|
||||
expected: FAIL
|
||||
|
||||
[testFormDataDeleteFromFormOtherKey]
|
||||
expected: FAIL
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
[formdata-get.htm]
|
||||
type: testharness
|
||||
[testFormDataGetFromForm]
|
||||
expected: FAIL
|
||||
|
||||
[testFormDataGetAllFromForm]
|
||||
expected: FAIL
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
[formdata-has.htm]
|
||||
type: testharness
|
||||
[testFormDataHasFromForm]
|
||||
expected: FAIL
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
[formdata-set.htm]
|
||||
type: testharness
|
||||
[Passing a String object to FormData.set should work]
|
||||
expected: FAIL
|
||||
|
||||
[testFormDataSetEmptyBlob]
|
||||
expected: FAIL
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
[formdata.htm]
|
||||
type: testharness
|
||||
[formdata with string]
|
||||
expected: FAIL
|
||||
|
||||
[formdata with named string]
|
||||
expected: FAIL
|
||||
|
||||
[formdata from form]
|
||||
expected: FAIL
|
||||
|
|
@ -21,7 +21,7 @@ def main(request, response):
|
|||
boundary = content_type[1].strip("boundary=")
|
||||
|
||||
body = "--" + boundary + "\r\nContent-Disposition: form-data; name=\"file-input\"; filename=\"upload.txt\""
|
||||
body += "\r\n" + "text/plain\r\n\r\nHello\r\n--" + boundary + "--"
|
||||
body += "\r\n" + "content-type: text/plain\r\n\r\nHello\r\n--" + boundary + "--"
|
||||
|
||||
if body != request.body:
|
||||
return fail("request body doesn't match: " + body + "+++++++" + request.body)
|
||||
|
|
|
@ -80,8 +80,14 @@
|
|||
assert_equals(fd.get('key'), "null");
|
||||
}, 'testFormDataAppendToFormNull2');
|
||||
test(function() {
|
||||
assert_object_equals(create_formdata(['key', new Blob(), 'blank.txt']).get('key'),
|
||||
new File(new Blob(), 'blank.txt'));
|
||||
var f1 = create_formdata(['key', new Blob(), 'blank.txt']).get('key');
|
||||
var f2 = new File([new Blob()], 'blank.txt');
|
||||
|
||||
var fileAttrs = ['name', 'size', 'type'];
|
||||
|
||||
fileAttrs.forEach(function(attr) {
|
||||
assert_equals(f1[attr], f2[attr], attr + " should be equal");
|
||||
});
|
||||
}, 'testFormDataAppendEmptyBlob');
|
||||
|
||||
function create_formdata() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue