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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/access-control-preflight-request-header-sorted.html

Issue 1890053002: Exclude simple headers when building Access-Control-Request-Headers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 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
1 <html> 1 <html>
2 <body> 2 <body>
3 <p>Test for bug 452391: Header names in Access-Control-Request-Headers must be s orted.</p> 3 <p>Test for bug 452391: Header names in Access-Control-Request-Headers must be s orted.</p>
4 <script> 4 <script>
5 if (window.testRunner) { 5 if (window.testRunner) {
6 testRunner.dumpAsText(); 6 testRunner.dumpAsText();
7 testRunner.waitUntilDone(); 7 testRunner.waitUntilDone();
8 } 8 }
9 9
10 function sendRequest() 10 function sendRequest()
11 { 11 {
12 var xhr = new XMLHttpRequest; 12 var xhr = new XMLHttpRequest;
13 xhr.open("GET", "http://localhost:8000/xmlhttprequest/resources/access-contr ol-preflight-request-header-sorted.php"); 13 xhr.open("GET", "http://localhost:8000/xmlhttprequest/resources/access-contr ol-preflight-request-header-sorted.php");
14 xhr.setRequestHeader("X-Custom-Test", "foobar"); 14 xhr.setRequestHeader("X-Custom-Test", "foobar");
15 xhr.setRequestHeader("X-Custom-ua", "foobar"); 15 xhr.setRequestHeader("X-Custom-ua", "foobar");
16 xhr.setRequestHeader("X-Custom-V", "foobar"); 16 xhr.setRequestHeader("X-Custom-V", "foobar");
17 xhr.setRequestHeader("X-Custom-s", "foobar"); 17 xhr.setRequestHeader("X-Custom-s", "foobar");
18 xhr.setRequestHeader("X-Custom-U", "foobar"); 18 xhr.setRequestHeader("X-Custom-U", "foobar");
19 // Check that a simple header is also included in the 19 // Check that a simple header is excluded when building the
20 // Access-Control-Request-Headers header. 20 // Access-Control-Request-Headers header.
21 xhr.setRequestHeader("Content-Type", "text/plain"); 21 xhr.setRequestHeader("Content-Type", "text/plain");
22 xhr.onerror = function() { 22 xhr.onerror = function() {
23 document.body.appendChild(document.createTextNode("FAIL: onerror called" )); 23 document.body.appendChild(document.createTextNode("FAIL: onerror called" ));
24 if (window.testRunner) 24 if (window.testRunner)
25 testRunner.notifyDone(); 25 testRunner.notifyDone();
26 } 26 }
27 27
28 xhr.onreadystatechange=function() { 28 xhr.onreadystatechange=function() {
29 if (xhr.readyState==4) { 29 if (xhr.readyState==4) {
30 document.body.appendChild(document.createTextNode(xhr.responseText)) ; 30 document.body.appendChild(document.createTextNode(xhr.responseText)) ;
31 if (window.testRunner) 31 if (window.testRunner)
32 testRunner.notifyDone(); 32 testRunner.notifyDone();
33 } 33 }
34 } 34 }
35 xhr.send(); 35 xhr.send();
36 } 36 }
37 sendRequest(); 37 sendRequest();
38 </script> 38 </script>
39 </body> 39 </body>
40 </html> 40 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/resources/access-control-preflight-request-header-sorted.php » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698