Index: LayoutTests/http/tests/security/link-crossorigin-stylesheet-anonymous.html |
diff --git a/LayoutTests/http/tests/security/link-crossorigin-stylesheet-anonymous.html b/LayoutTests/http/tests/security/link-crossorigin-stylesheet-anonymous.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c4bd3b7f42ae0525bc51c529b871d4d7db979c17 |
--- /dev/null |
+++ b/LayoutTests/http/tests/security/link-crossorigin-stylesheet-anonymous.html |
@@ -0,0 +1,24 @@ |
+<!DOCTYPE HTML> |
+<p>Test that a linked stylesheet with a crossorigin=anonymous attribute loads a CORS enabled resource.</p> |
+<pre></pre> |
+<script src="resources/link-crossorigin-common.js"></script> |
+<link crossorigin="anonymous" rel="stylesheet" href="http://localhost:8080/security/resources/green-background-allow-star.php" onload="pass()" onerror="fail()"> |
+<link crossorigin="anonymous" rel="stylesheet" href="http://localhost:8080/security/resources/green-background-allow-credentials.php" onload="pass()" onerror="fail()"> |
+<script> |
+// Test that dynamically inserted <link> elements are handled the same way. |
+var link = document.createElement("link"); |
+link.rel = "stylesheet"; |
+link.crossOrigin = "anonymous"; |
+link.onload = pass; |
+link.onerror = fail; |
+link.href = "http://localhost:8080/security/resources/green-background-allow-star.php"; |
+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.php"; |
+document.body.appendChild(link); |
+</script> |