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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/send-entity-body-charset.html

Issue 2723583005: Support XMLHttpRequest.send(URLSearchParams) (Closed)
Patch Set: rebased upto r454567 Created 3 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: third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/send-entity-body-charset.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/send-entity-body-charset.html b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/send-entity-body-charset.html
new file mode 100644
index 0000000000000000000000000000000000000000..4b803086079b2f69432ad716a140795e243320c8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/send-entity-body-charset.html
@@ -0,0 +1,28 @@
+<!doctype html>
+<html>
+ <head>
+ <title>XMLHttpRequest: send() - data argument</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <link rel="help" href="https://xhr.spec.whatwg.org/#the-send()-method" data-tested-assertations="/following::ol/li[4]" />
+ </head>
+ <body>
+ <div id="log"></div>
+ <script>
+ function requestCharset(input, charset, contentType) {
+ test(function() {
+ var client = new XMLHttpRequest();
+ client.open("POST", "print-content-type.cgi", false);
+ if (contentType)
+ client.setRequestHeader("Content-Type", contentType);
+ client.send(input);
+ assert_true(client.responseText.indexOf("charset=" + charset) >= 0);
+ }, document.title + " (" + input + " requested with charset=" + charset + ")")
+ }
+ requestCharset(1, "UTF-8");
+ requestCharset(1, "UTF-8", "application/javascript;charset=us-ascii");
+ requestCharset(new URLSearchParams([[1, 2], [3, 4]]), "UTF-8");
+ requestCharset(new URLSearchParams([[1, 2], [3, 4]]), "UTF-8", "text/javascript;charset=us-ascii");
+ </script>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698