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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/response-content.js

Issue 2163273002: [Fetch] Accept URLSearchParams in Response constructor (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: var => const, an => a, -TODO Created 4 years, 5 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/fetch/Response.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/response-content.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/response-content.js b/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/response-content.js
index 75727e42244d19c33d816c114b4346e33c390bba..0a9fe017fef3e0479d55208bf873148cdd0d1d3f 100644
--- a/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/response-content.js
+++ b/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/response-content.js
@@ -115,6 +115,23 @@ promise_test(function() {
}, 'Behavior of Response with FormData content');
promise_test(function() {
+ const urlSearchParams = new URLSearchParams();
+ urlSearchParams.append('sample string', '1234567890');
+ urlSearchParams.append('sample string 2', '1234567890 & 2');
+ var response = new Response(urlSearchParams);
+ assert_equals(
+ response.headers.get('Content-Type'),
+ 'application/x-www-form-urlencoded;charset=UTF-8',
+ 'A Response constructed with a URLSearchParams should have a Content-Type.');
+ return response.text()
+ .then(function(result) {
+ assert_equals(
+ result, 'sample+string=1234567890&sample+string+2=1234567890+%26+2',
+ 'Creating a Response with URLSearchParams body must succeed.');
+ });
+ }, 'Behavior of Response with URLSearchParams content');
+
+promise_test(function() {
var headers = new Headers;
headers.set('Content-Language', 'ja');
var response = new Response(
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/fetch/Response.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698