OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
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 </script> | 9 </script> |
10 </head> | 10 </head> |
11 <body> | 11 <body> |
12 <pre id="console"></pre> | 12 <pre id="console"></pre> |
13 <script> | 13 <script> |
14 function log(msg) | 14 function log(msg) |
15 { | 15 { |
16 document.getElementById("console").appendChild(document.createTextNode
(msg + "\n")); | 16 document.getElementById("console").appendChild(document.createTextNode
(msg + "\n")); |
17 } | 17 } |
18 | 18 |
19 var protectedResource = "http://127.0.0.1:8000/security/contentSecurityPol
icy/resources/generate-csp-report.html"; | 19 var protectedResource = "http://127.0.0.1:8000/security/contentSecurityPol
icy/resources/generate-csp-report.php"; |
20 var xhr = new XMLHttpRequest(); | 20 var xhr = new XMLHttpRequest(); |
21 xhr.responseType = "document"; | 21 xhr.responseType = "document"; |
22 xhr.onreadystatechange = function () { | 22 xhr.onreadystatechange = function () { |
23 if (xhr.readyState == 4) { | 23 if (xhr.readyState == 4) { |
24 log("PASS: " + this.response); | 24 log("PASS: " + this.response); |
25 if (window.testRunner) | 25 if (window.testRunner) |
26 testRunner.notifyDone(); | 26 testRunner.notifyDone(); |
27 } | 27 } |
28 }; | 28 }; |
29 xhr.open("GET", protectedResource, true); | 29 xhr.open("GET", protectedResource, true); |
30 xhr.send(); | 30 xhr.send(); |
31 </script> | 31 </script> |
32 <p>Loading a frameless document (like those generated via XMLHttpRequest) | 32 <p>Loading a frameless document (like those generated via XMLHttpRequest) |
33 shouldn't crash the CSP parser.</p> | 33 shouldn't crash the CSP parser.</p> |
34 </body> | 34 </body> |
35 </html> | 35 </html> |
OLD | NEW |