Index: LayoutTests/http/tests/security/img-crossorigin-no-credentials-prompt.html |
diff --git a/LayoutTests/http/tests/security/img-crossorigin-no-credentials-prompt.html b/LayoutTests/http/tests/security/img-crossorigin-no-credentials-prompt.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..74f5b0ec661785d792e6403da236077a7f208b26 |
--- /dev/null |
+++ b/LayoutTests/http/tests/security/img-crossorigin-no-credentials-prompt.html |
@@ -0,0 +1,27 @@ |
+<!DOCTYPE HTML> |
+<script src="/js-test-resources/js-test.js"></script> |
+<script> |
+description("No credentials should be prompted for on seeing a 401 for <img crossorigin>."); |
+ |
+window.jsTestIsAsync = true; |
+if (window.testRunner) |
+ testRunner.dumpAsText(); |
+ |
+var testCount = 2; |
+ |
+function finish() { |
+ if (--testCount == 0) |
+ finishJSTest(); |
+} |
+ |
+function pass() { |
+ testPassed("Non-CORS image resource failed to load"); |
+ finish(); |
+} |
+function fail(mode) { |
+ testFailed("Expected cross-origin access check failure for crossorigin='" + mode + "' CORS fetch."); |
+ finish(); |
+} |
+</script> |
+<img src="http://localhost:8000/security/resources/img-basic-auth.php?uid=41532" crossorigin="anonymous" onload="fail('anonymous')" onerror="pass()"> |
+<img src="http://localhost:8000/security/resources/img-basic-auth.php?uid=41533" crossorigin="use-credentials" onload="fail('use-credentials')" onerror="pass()"> |