blob: 594a36c561d29b0976592316a27be8eea6da9dac [file] [log] [blame]
<!DOCTYPE HTML>
<p>This test passes if a script resource is loaded twice if asked to fetch it with and without CORS enabled.</p>
<pre></pre>
<!-- Non-CORS enabled script load, supplying credentials. -->
<script src="http://localhost:8000/security/resources/cors-script.php?cors=true&credentials=true&value=1&value_cors=2"></script>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
var expected = "12";
// Copy the 'result' value set by external script.
var outcome = result;
</script>
<!-- CORS enabled script load, supplying credentials. Should not re-use above cached script, as response will differ. -->
<script crossorigin="use-credentials" src="http://localhost:8000/security/resources/cors-script.php?cors=true&credentials=true&value=1&value_cors=2"></script>
<script>
outcome += result;
document.querySelector("pre").innerHTML = outcome === expected ? "PASS" : "FAIL";
if (window.testRunner)
testRunner.notifyDone();
</script>