Commit 8a525c3d authored by Mike West's avatar Mike West Committed by Commit Bot

Deflake http/tests/security/img-crossorigin-no-credentials-prompt.html

Bug: 636248
Change-Id: Ief5b352862b61707bf2f987339ec8975c9022d02
Reviewed-on: https://chromium-review.googlesource.com/702257
Commit-Queue: Mike West <mkwst@chromium.org>
Reviewed-by: default avatarAndy Paicu <andypaicu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506705}
parent 43cb7378
......@@ -1393,9 +1393,6 @@ crbug.com/509025 [ Mac10.10 ] fast/forms/textarea/textarea-newline.html [ Failur
crbug.com/545140 [ Mac10.10 Mac10.11 Retina Mac10.12 ] fast/encoding/denormalised-voiced-japanese-chars.html [ Failure ]
crbug.com/636248 http/tests/security/img-crossorigin-no-credentials-prompt.html [ Failure Pass ]
crbug.com/636248 virtual/mojo-loading/http/tests/security/img-crossorigin-no-credentials-prompt.html [ Failure Pass ]
crbug.com/509025 [ Mac10.10 ] fast/events/context-no-deselect.html [ Failure ]
crbug.com/509025 [ Mac10.10 ] virtual/rootlayerscrolls/scrollbars/rtl/overflow-scroll-rtl.html [ Failure ]
crbug.com/509025 [ Mac10.10 ] virtual/rootlayerscrolls/scrollbars/short-scrollbar.html [ Failure ]
......
CONSOLE ERROR: Access to Image at 'http://localhost:8000/security/resources/img-basic-auth.php?uid=41532' from origin 'http://127.0.0.1:8000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8000' is therefore not allowed access. The response had HTTP status code 401.
CONSOLE ERROR: Access to Image at 'http://localhost:8000/security/resources/img-basic-auth.php?uid=41533' from origin 'http://127.0.0.1:8000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8000' is therefore not allowed access. The response had HTTP status code 401.
No credentials should be prompted for on seeing a 401 for <img crossorigin>.
PASS Non-CORS image resource failed to load
PASS Non-CORS image resource failed to load
TEST COMPLETE
<!DOCTYPE HTML>
<p>No credentials should be prompted for on seeing a 401 for &lt;img crossorigin&gt;.</p>
<div id=console></div>
<head>
<title>No credentials should be prompted for on seeing a 401 for &lt;img crossorigin&gt;.</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
async_test(t => {
var i = document.createElement('img');
i.src = "http://localhost:8000/security/resources/img-basic-auth.php?uid=41532";
i.crossorigin = "anonymous";
i.onload = t.unreached_func("Expected cross-origin access check failure.");
i.onerror = t.step_func_done();
}, 'crossorigin="anonymous"');
var testCount = 2;
function log(msg) {
var span = document.createElement("span");
document.getElementById("console").appendChild(span);
span.innerHTML = msg + "<br/>";
}
function finish() {
if (--testCount == 0) {
log("TEST COMPLETE");
if (window.testRunner)
testRunner.notifyDone();
}
}
function pass() {
log("PASS Non-CORS image resource failed to load");
finish();
}
function fail(mode) {
log("FAIL Expected cross-origin access check failure for crossorigin='" + mode + "' CORS fetch.");
finish();
}
async_test(t => {
var i = document.createElement('img');
i.src = "http://localhost:8000/security/resources/img-basic-auth.php?uid=41533";
i.crossorigin = "use-credentials";
i.onload = t.unreached_func("Expected cross-origin access check failure.");
i.onerror = t.step_func_done();
}, 'crossorigin="use-credentials"');
</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()">
</body>
CONSOLE ERROR: Access to Image at 'http://localhost:8000/security/resources/img-basic-auth.php?uid=41532' from origin 'http://127.0.0.1:8000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8000' is therefore not allowed access. The response had HTTP status code 401.
CONSOLE ERROR: Access to Image at 'http://localhost:8000/security/resources/img-basic-auth.php?uid=41533' from origin 'http://127.0.0.1:8000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8000' is therefore not allowed access. The response had HTTP status code 401.
No credentials should be prompted for on seeing a 401 for <img crossorigin>.
PASS Non-CORS image resource failed to load
PASS Non-CORS image resource failed to load
TEST COMPLETE
CONSOLE ERROR: Access to Image at 'http://localhost:8000/security/resources/img-basic-auth.php?uid=41533' from origin 'http://127.0.0.1:8000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8000' is therefore not allowed access. The response had HTTP status code 401.
CONSOLE ERROR: Access to Image at 'http://localhost:8000/security/resources/img-basic-auth.php?uid=41532' from origin 'http://127.0.0.1:8000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8000' is therefore not allowed access. The response had HTTP status code 401.
No credentials should be prompted for on seeing a 401 for <img crossorigin>.
PASS Non-CORS image resource failed to load
PASS Non-CORS image resource failed to load
TEST COMPLETE
CONSOLE ERROR: Access to Image at 'http://localhost:8000/security/resources/img-basic-auth.php?uid=41532' from origin 'http://127.0.0.1:8000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8000' is therefore not allowed access. The response had HTTP status code 401.
CONSOLE ERROR: Access to Image at 'http://localhost:8000/security/resources/img-basic-auth.php?uid=41533' from origin 'http://127.0.0.1:8000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8000' is therefore not allowed access. The response had HTTP status code 401.
No credentials should be prompted for on seeing a 401 for <img crossorigin>.
PASS Non-CORS image resource failed to load
PASS Non-CORS image resource failed to load
TEST COMPLETE
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment