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

Unified Diff: LayoutTests/http/tests/xmlhttprequest/set-bad-headervalue.html

Issue 1018903002: Show deprecation warnings for header values in XHR according to RFC 7230 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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 | LayoutTests/http/tests/xmlhttprequest/set-bad-headervalue-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/xmlhttprequest/set-bad-headervalue.html
diff --git a/LayoutTests/http/tests/xmlhttprequest/set-bad-headervalue.html b/LayoutTests/http/tests/xmlhttprequest/set-bad-headervalue.html
new file mode 100644
index 0000000000000000000000000000000000000000..aeca10f2a9fe9bc8ba460e8ebda8bfaddbce1ed3
--- /dev/null
+++ b/LayoutTests/http/tests/xmlhttprequest/set-bad-headervalue.html
@@ -0,0 +1,44 @@
+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>XMLHttpRequest: setRequestHeader() value argument checks</title>
+ <script src="../resources/testharness.js"></script>
+ <script src="../resources/testharnessreport.js"></script>
+ <!-- Test based on http://w3c-test.org/web-platform-tests/master/XMLHttpRequest/setrequestheader-bogus-value.htm This test should be removed once wpt XMLHttpRequest is imported if both tests are in sync -->
+ </head>
+ <body>
+ <div id="log">
+ <script type="text/javascript">
+ function try_value(value, expectError) {
+ test(function() {
+ var client = new XMLHttpRequest();
+ client.open("GET", "...");
+ if (expectError)
+ assert_throws("SyntaxError", function() { client.setRequestHeader("x-test", value) }, ' given value ' + value+', ');
tyoshino (SeeGerritForStatus) 2015/03/24 11:43:12 I know that this was just copied from W3C, but let
shiva.jm 2015/04/14 04:55:42 Done.
+ else
+ client.setRequestHeader("x-test", value);
+ })
+ }
+
+ try_value("t\rt", true);
+ try_value("t\nt", true);
+ try_value("�ス�", true);
hiroshige 2015/03/20 08:54:52 This test fails on trybots (i.e. no exception is t
shiva.jm 2015/03/23 05:21:24 Yes right, in my local linux machine, these test p
+ try_value("t\bt", true);
+ try_value("t\vt", true);
+ try_value("t\tt", false);
+ try_value("t t", false);
+ try_value(" t", true);
+ try_value("t ", true);
+ try_value("\xd0\xa1", false);
+ try_value("\x7f", true);
+
+ test(function() {
+ var client = new XMLHttpRequest()
+ client.open("GET", "...")
+ assert_throws({name:'TypeError'}, function() { client.setRequestHeader("x-test") })
+ })
+
+ </script>
+ </body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/http/tests/xmlhttprequest/set-bad-headervalue-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698