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

Side by Side Diff: LayoutTests/http/tests/xmlhttprequest/header-value-update/normalize-unaffected.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, but has no
9 // effect because the whitespaces are already stripped before the request
10 // is sent to the network.
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 console.error('This error is added to avoid presubmit errors for -expected.txt with no CONSOLE WARNING. This is testing that no CONSOLE WARNING is shown for s etRequestHeader().');
17
18 xhr.setRequestHeader('test1', ' a ');
19 xhr.setRequestHeader('test2', '\ta\t');
20
21 xhr.onload = t.step_func(function() {
22 assert_regexp_match(xhr.responseText, /HTTP_TEST1: a\r?\n/,
23 'Leading/trailing whitespaces (0x20) are already stripped.');
24 assert_regexp_match(xhr.responseText, /HTTP_TEST2: a\r?\n/,
25 'Leading/trailing whitespaces (0x09) are already stripped.');
26 t.done();
27 });
28 xhr.onerror = t.unreached_func('should not fail');
29 xhr.send();
30 }, 'single setRequestHeader() with leading/trailing whitespaces');
31
32 done();
33 </script>
34 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698