Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Unified Diff: LayoutTests/http/tests/xmlhttprequest/post-formdata.html

Issue 157363003: Implement Blob.close(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/xmlhttprequest/post-formdata.html
diff --git a/LayoutTests/http/tests/xmlhttprequest/post-formdata.html b/LayoutTests/http/tests/xmlhttprequest/post-formdata.html
index 8777ddcb6813c9455c9d67d97bdddbb1dd696904..afc52a0a3e86c2302ba73104bd8aa26ad0c54818 100644
--- a/LayoutTests/http/tests/xmlhttprequest/post-formdata.html
+++ b/LayoutTests/http/tests/xmlhttprequest/post-formdata.html
@@ -13,6 +13,14 @@ var xhrFormDataTestCases = [{
data: { bareBlob: new Blob(['blob-value']) },
result: 'bareBlob=blob:application/octet-stream:blob-value'
}, {
+ data: { bareBlob: new Blob(['blob-value']) },
+ beforeConstruct: function (t) { t.data.bareBlob.close(); },
+ result: 'bareBlob=blob:application/octet-stream:'
+}, {
+ data: { bareBlob: new Blob(['blob-value']) },
+ beforeSend: function (t) { t.data.bareBlob.close(); },
+ result: 'bareBlob=blob:application/octet-stream:'
+}, {
data: { mimeBlob: new Blob(['blob-value'], { type: 'text/html' }) },
result: 'mimeBlob=blob:text/html:blob-value'
}, {
@@ -27,6 +35,14 @@ var xhrFormDataTestCases = [{
data: { bareFile: new File(['file-value'], 'file-name.txt') },
result: 'bareFile=file-name.txt:application/octet-stream:file-value'
}, {
+ data: { bareFile: new File(['file-value'], 'file-name.txt') },
+ beforeConstruct: function (t) { t.data.bareFile.close(); },
+ result: 'bareFile=file-name.txt:application/octet-stream:'
+}, {
+ data: { bareFile: new File(['file-value'], 'file-name.txt') },
+ beforeSend: function (t) { t.data.bareFile.close(); },
+ result: 'bareFile=file-name.txt:application/octet-stream:'
+}, {
data: {
mimeFile: new File(['file-value'], 'file-name.html', { type: 'text/html' })
},
@@ -71,6 +87,8 @@ function runAsyncTests() {
var testCase = xhrFormDataTestCases[asyncTestCase];
var formData = new FormData();
+ if (testCase.beforeConstruct)
+ testCase.beforeConstruct(testCase);
for (var fieldName in testCase.data) {
fieldValue = testCase.data[fieldName];
if (fieldValue.constructor === Object)
@@ -82,6 +100,8 @@ function runAsyncTests() {
xhr = new XMLHttpRequest();
xhr.onloadend = reportResult;
xhr.open("POST", xhrFormDataTestUrl, true);
+ if (testCase.beforeSend)
+ testCase.beforeSend(testCase);
xhr.send(formData);
}

Powered by Google App Engine
This is Rietveld 408576698