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

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

Issue 461563002: Avoid preloader-induced test flakiness. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove now-redundant window.jsTestIsAsync assignment. 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <script src="/js-test-resources/js-test.js"></script> 2 <p>No credentials should be prompted for on seeing a 401 for &lt;img crossorigin &gt;.</p>
3 <div id=console></div>
3 <script> 4 <script>
4 description("No credentials should be prompted for on seeing a 401 for &lt;img c rossorigin&gt;."); 5 if (window.testRunner) {
5
6 window.jsTestIsAsync = true;
7 if (window.testRunner)
8 testRunner.dumpAsText(); 6 testRunner.dumpAsText();
7 testRunner.waitUntilDone();
8 }
9 9
10 var testCount = 2; 10 var testCount = 2;
11 11
12 function log(msg) {
13 var span = document.createElement("span");
14 document.getElementById("console").appendChild(span);
15 span.innerHTML = msg + "<br/>";
16 }
17
12 function finish() { 18 function finish() {
13 if (--testCount == 0) 19 if (--testCount == 0) {
14 finishJSTest(); 20 log("TEST COMPLETE");
21 if (window.testRunner)
22 testRunner.notifyDone();
23 }
15 } 24 }
16 25
17 function pass() { 26 function pass() {
18 testPassed("Non-CORS image resource failed to load"); 27 log("PASS Non-CORS image resource failed to load");
19 finish(); 28 finish();
20 } 29 }
21 function fail(mode) { 30 function fail(mode) {
22 testFailed("Expected cross-origin access check failure for crossorigin='" + mode + "' CORS fetch."); 31 log("FAIL Expected cross-origin access check failure for crossorigin='" + mo de + "' CORS fetch.");
23 finish(); 32 finish();
24 } 33 }
25 </script> 34 </script>
26 <img src="http://localhost:8000/security/resources/img-basic-auth.php?uid=41532" crossorigin="anonymous" onload="fail('anonymous')" onerror="pass()"> 35 <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()" > 36 <img src="http://localhost:8000/security/resources/img-basic-auth.php?uid=41533" crossorigin="use-credentials" onload="fail('use-credentials')" onerror="pass()" >
OLDNEW
« 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