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

Side by Side Diff: LayoutTests/http/tests/xmlhttprequest/header-value-update/normalize-affected-3.html

Issue 1342443004: [MIGRATED] Make deprecation warnings on XHR's setRequestHeader more accurate (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@temp1288263003
Patch Set: Reflect tyoshino's comments. Created 5 years, 2 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!doctype html>
2 <head>
3 <script src = "../../resources/testharness.js"></script>
4 <script src = "../../resources/testharnessreport.js"></script>
5 </head>
6 <body>
7 <script>
8 // Normalization will remove leading/trailing whitespaces and has effects
9 // because the whitespaces remain in the middle of header values as we call
10 // setRequestHeader multiple times.
11 // https://fetch.spec.whatwg.org/#concept-header-value-normalize
12 // https://crbug.com/455099
13 async_test(function(t) {
14 var xhr = new XMLHttpRequest;
15 xhr.open("GET", "../resources/print-headers.cgi");
16
17 xhr.setRequestHeader('test1', 'a');
18 xhr.setRequestHeader('test1', '\tb');
19
20 xhr.onload = t.step_func(function() {
21 // This expectation must be updated once we update header value checks.
22 assert_regexp_match(xhr.responseText, /HTTP_TEST1: a, \tb\r?\n/,
23 'Whitespaces remains in the middle of the header value.');
24 t.done();
25 });
26 xhr.onerror = t.unreached_func('should not fail');
27 xhr.send();
28 }, 'multiple setRequestHeader() with leading/trailing whitespaces');
29
30 done();
31 </script>
32 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698