Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/header-value-update/normalize-affected-1.html |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/header-value-update/normalize-affected-1.html b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/header-value-update/normalize-affected-1.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3af4a2679a2244e1ae4367bfe1e733083f6c4c6a |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/header-value-update/normalize-affected-1.html |
| @@ -0,0 +1,32 @@ |
| +<!doctype html> |
| +<head> |
| +<script src = "../../resources/testharness.js"></script> |
| +<script src = "../../resources/testharnessreport.js"></script> |
| +</head> |
| +<body> |
| +<script> |
| +// Normalization will remove leading/trailing whitespaces and has effects |
|
tyoshino (SeeGerritForStatus)
2015/09/29 09:02:24
Please explain more background. This comment is ha
hiroshige
2015/09/29 10:34:10
Done.
|
| +// because the whitespaces remain in the middle of header values as we call |
| +// setRequestHeader multiple times. |
| +// https://fetch.spec.whatwg.org/#concept-header-value-normalize |
| +// https://crbug.com/455099 |
| +async_test(function(t) { |
| + var xhr = new XMLHttpRequest; |
| + xhr.open("GET", "../resources/print-headers.cgi"); |
| + |
| + xhr.setRequestHeader('test1', 'a '); |
| + xhr.setRequestHeader('test1', '\tb'); |
| + |
| + 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 , \tb\r?\n/, |
| + 'Whitespaces remains in the middle of the header value.'); |
| + t.done(); |
| + }); |
| + xhr.onerror = t.unreached_func('should not fail'); |
| + xhr.send(); |
| + }, 'multiple setRequestHeader() with leading/trailing whitespaces'); |
| + |
| +done(); |
|
tyoshino (SeeGerritForStatus)
2015/09/29 09:02:24
is this done() needed?
hiroshige
2015/09/29 10:34:10
Done (moved to js-test)
|
| +</script> |
| +</body> |