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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/header-value-update/invalid-octets.html

Issue 1378543002: Add UMA for header values in XHR's setRequestHeader() checked against RFC 7230 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update test expectations due to message change. Created 5 years, 3 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/header-value-update/invalid-octets.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/header-value-update/invalid-octets.html b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/header-value-update/invalid-octets.html
new file mode 100644
index 0000000000000000000000000000000000000000..0ed4e4c38ef71af157b25e7f5dcf67ce517dc5d8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/header-value-update/invalid-octets.html
@@ -0,0 +1,28 @@
+<!doctype html>
+<head>
+<script src = "../../resources/testharness.js"></script>
+<script src = "../../resources/testharnessreport.js"></script>
tyoshino (SeeGerritForStatus) 2015/09/29 09:02:24 Majority of the files in this directly are using /
hiroshige 2015/09/29 10:34:10 Done.
+</head>
+<body>
+<script>
+// Header values with control octets that will be rejected by RFC 7230.
+// https://crbug.com/455099
+async_test(function(t) {
+ var xhr = new XMLHttpRequest;
+ xhr.open("GET", "../resources/print-headers.cgi");
+
+ xhr.setRequestHeader('test1', 'a\x01b');
+
+ xhr.onload = t.step_func(function() {
+ // This expectation must be updated once we update header value checks.
+ assert_regexp_match(xhr.responseText, /HTTP_TEST1: a\x01b\r?\n/,
+ 'Whitespaces remains in the middle of the header value.');
tyoshino (SeeGerritForStatus) 2015/09/29 09:02:24 Whitespace -> Control octets?
hiroshige 2015/09/29 10:34:10 Done.
+ t.done();
+ });
+ xhr.onerror = t.unreached_func('should not fail');
+ xhr.send();
+ }, 'setRequestHeader() with control octets');
+
+done();
+</script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698