Index: LayoutTests/http/tests/security/link-crossorigin-subresource-no-cors.html |
diff --git a/LayoutTests/http/tests/security/link-crossorigin-subresource-no-cors.html b/LayoutTests/http/tests/security/link-crossorigin-subresource-no-cors.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..03c5e011e6a437d8dd3d68ab9caf975ca4dd834d |
--- /dev/null |
+++ b/LayoutTests/http/tests/security/link-crossorigin-subresource-no-cors.html |
@@ -0,0 +1,24 @@ |
+<!DOCTYPE HTML> |
+<p>Test that a subresource with a crossorigin attribute does not load a cross-origin resource that isn't CORS enabled.</p> |
+<pre></pre> |
+<script src="resources/link-crossorigin-common.js"></script> |
+<link crossorigin="anonymous" rel="subresource" href="http://localhost:8000/security/resources/abe.png?1" onload="fail()" onerror="pass()"> |
+<link crossorigin="use-credentials" rel="subresource" href="http://localhost:8000/security/resources/abe.png?2" onload="fail()" onerror="pass()"> |
+<script> |
+// Test that dynamically inserted <link> elements are handled the same way. |
+var link = document.createElement("link"); |
+link.rel = "subresource"; |
+link.crossOrigin = "anonymous"; |
+link.onload = fail; |
+link.onerror = pass; |
+link.href = "http://localhost:8000/security/resources/abe.png?3"; |
+document.body.appendChild(link); |
+ |
+link = document.createElement("link"); |
+link.rel = "subresource"; |
+link.crossOrigin = "use-credentials"; |
+link.onload = fail; |
+link.onerror = pass; |
+link.href = "http://localhost:8000/security/resources/abe.png?4"; |
+document.body.appendChild(link); |
+</script> |