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

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: Reflected tyoshino's comments. 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..9055d9def5ea4c29440c40442052c7c0bdeb4407
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/header-value-update/invalid-octets.html
@@ -0,0 +1,26 @@
+<!doctype html>
+<script src="/js-test-resources/js-test.js"></script>
+<script>
+window.jsTestIsAsync = true;
+description('XMLHttpRequest.setRequestHeader() with control octets ' +
+ 'rejected by RFC 7230 should show a deprecation message.');
+// https://crbug.com/455099
+
+var xhr = new XMLHttpRequest;
+xhr.open("GET", "../resources/print-headers.cgi");
+
+// '\x01' is invalid in RFC 7230 and thus deprecation warning should be shown.
+xhr.setRequestHeader('test1', 'a\x01b');
+
+xhr.onload = function() {
+ // This expectation must be updated once we update header value checks.
+ shouldNotBe('xhr.responseText.match(/HTTP_TEST1: a\\x01b\\r?\\n/)',
+ 'null');
+ finishJSTest();
+};
+xhr.onerror = function() {
+ testFailed();
+ finishJSTest();
+};
+xhr.send();
+</script>

Powered by Google App Engine
This is Rietveld 408576698