OLD | NEW |
(Empty) | |
| 1 <p>Test that a script element with a crossorigin attribute does not load a cross
-origin script when the resource sharing check fails on the response.</p> |
| 2 <pre></pre> |
| 3 <script> |
| 4 if (window.testRunner) { |
| 5 testRunner.dumpAsText(); |
| 6 testRunner.waitUntilDone(); |
| 7 } |
| 8 |
| 9 var result = "PASS"; |
| 10 |
| 11 function must_not_fire() { |
| 12 result = "FAIL"; |
| 13 } |
| 14 |
| 15 function finish() { |
| 16 document.querySelector("pre").innerHTML = result; |
| 17 if (window.testRunner) |
| 18 testRunner.notifyDone(); |
| 19 } |
| 20 </script> |
| 21 <!-- This script should _not_ load, nor fire onload. --> |
| 22 <script crossorigin="anonymous" src="http://localhost:8000/security/resources/co
rs-script.php?cors=false&value=FAIL" onload="must_not_fire()" onerror="finish();
"></script> |
OLD | NEW |