blob: 4d91e21509a4765b3abcb4e53b0b3a5b6dc83b52 [file] [log] [blame]
<!DOCTYPE HTML>
<html>
<head>
<script src="/js-test-resources/js-test.js"></script>
<script>
description("Test that CORS-fetched stylesheets (crossorigin=use-credentials) handle @import as expected.");
window.testCount = 3;
</script>
<script src="resources/link-crossorigin-common.js"></script>
</head>
<link crossorigin="use-credentials" rel="stylesheet" href="http://localhost:8080/security/resources/green-background-allow-credentials-import.php?1" onload="pass(event)" onerror="fail(event)">
<script>
function runTest()
{
// Test that dynamically inserted <link> elements are handled the same way.
var link = document.createElement("link");
link.rel = "stylesheet";
link.crossOrigin = "use-credentials";
link.onload = pass;
link.onerror = fail;
link.href = "http://localhost:8000/security/resources/green-background-allow-credentials-import.php?2";
document.body.appendChild(link);
link = document.createElement("link");
link.rel = "stylesheet";
link.crossOrigin = "use-credentials";
link.onload = pass;
link.onerror = fail;
link.href = "http://localhost:8080/security/resources/green-background-allow-credentials-import.php?3";
document.body.appendChild(link);
}
window.onload = runTest;
</script>
</body>
</html>