OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE HTML> |
| 2 <script src="/js-test-resources/js-test.js"></script> |
| 3 <script> |
| 4 description("No credentials should be prompted for on seeing a 401 for <img c
rossorigin>."); |
| 5 |
| 6 window.jsTestIsAsync = true; |
| 7 if (window.testRunner) |
| 8 testRunner.dumpAsText(); |
| 9 |
| 10 var testCount = 2; |
| 11 |
| 12 function finish() { |
| 13 if (--testCount == 0) |
| 14 finishJSTest(); |
| 15 } |
| 16 |
| 17 function pass() { |
| 18 testPassed("Non-CORS image resource failed to load"); |
| 19 finish(); |
| 20 } |
| 21 function fail(mode) { |
| 22 testFailed("Expected cross-origin access check failure for crossorigin='" +
mode + "' CORS fetch."); |
| 23 finish(); |
| 24 } |
| 25 </script> |
| 26 <img src="http://localhost:8000/security/resources/img-basic-auth.php?uid=41532"
crossorigin="anonymous" onload="fail('anonymous')" onerror="pass()"> |
| 27 <img src="http://localhost:8000/security/resources/img-basic-auth.php?uid=41533"
crossorigin="use-credentials" onload="fail('use-credentials')" onerror="pass()"
> |
OLD | NEW |