OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <meta http-equiv="Content-Security-Policy" content="connect-src http://localhost
:8000"<script> | 4 <meta http-equiv="Content-Security-Policy" content="connect-src http://localhost
:8000"<script> |
5 <script> | 5 <script> |
6 if (window.testRunner) | 6 if (window.testRunner) { |
7 testRunner.dumpAsText(); | 7 testRunner.dumpAsText(); |
| 8 testRunner.waitUntilDone(); |
| 9 } |
8 </script> | 10 </script> |
9 </head> | 11 </head> |
10 <body> | 12 <body> |
11 <pre id="console"></pre> | 13 <pre id="console"></pre> |
12 <script> | 14 <script> |
13 function log(msg) | 15 function log(msg) |
14 { | 16 { |
15 document.getElementById("console").appendChild(document.createTextNode(msg +
"\n")); | 17 document.getElementById("console").appendChild(document.createTextNode(msg +
"\n")); |
16 } | 18 } |
17 | 19 |
18 try { | 20 var xhr = new XMLHttpRequest; |
19 var xhr = new XMLHttpRequest; | 21 xhr.open("GET", "http://127.0.0.1:8000/xmlhttprequest/resources/get.txt", true);
|
20 xhr.open("GET", "http://127.0.0.1:8000/xmlhttprequest/resources/get.txt", tr
ue); | 22 xhr.onerror = _ => { log("Pass"); testRunner.notifyDone(); } |
21 log("Fail"); | 23 xhr.onload = _ => { log("Fail"); testRunner.notifyDone(); } |
22 } catch(e) { | 24 xhr.send(); |
23 log("Pass"); | |
24 } | |
25 | 25 |
26 </script> | 26 </script> |
27 <p>This test passes if the malformed meta tag doesn't cause a crash and the reso
urce is blocked.</p> | 27 <p>This test passes if the malformed meta tag doesn't cause a crash and the reso
urce is blocked.</p> |
28 </body> | 28 </body> |
29 </html> | 29 </html> |
OLD | NEW |