Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Unified Diff: LayoutTests/http/tests/security/img-crossorigin-no-credentials-prompt.html

Issue 450263002: Test <img crossorigin> handling of 401 responses. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/http/tests/security/img-crossorigin-no-credentials-prompt-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 &lt;img crossorigin&gt;.");
+
+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()">
« no previous file with comments | « no previous file | LayoutTests/http/tests/security/img-crossorigin-no-credentials-prompt-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698