Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Unified Diff: LayoutTests/http/tests/security/link-crossorigin-subresource-anonymous.html

Issue 399653002: Rework CORS <link rel=stylesheet> tests as js-tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Move up window.test_count assignment Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/security/link-crossorigin-subresource-anonymous.html
diff --git a/LayoutTests/http/tests/security/link-crossorigin-subresource-anonymous.html b/LayoutTests/http/tests/security/link-crossorigin-subresource-anonymous.html
index 67f38db0ccc4f2c2782e49447663fbad65d4b70b..a189fe1f3f18eb4a270cfc17848dec18dbe240e4 100644
--- a/LayoutTests/http/tests/security/link-crossorigin-subresource-anonymous.html
+++ b/LayoutTests/http/tests/security/link-crossorigin-subresource-anonymous.html
@@ -1,24 +1,36 @@
<!DOCTYPE HTML>
-<p>Test that a subresource with a crossorigin=anonymous loads a CORS enabled resource.</p>
-<pre></pre>
+<html>
+<head>
+<script src="/js-test-resources/js-test.js"></script>
+</head>
+<body>
+<script>
+description("Test that a subresource with a crossorigin=anonymous loads a CORS enabled resource.");
+</script>
<script src="resources/link-crossorigin-common.js"></script>
<link crossorigin="anonymous" rel="subresource" href="http://localhost:8080/security/resources/abe-allow-star.php" onload="pass()" onerror="fail()">
<link crossorigin="anonymous" rel="subresource" href="http://localhost:8080/security/resources/abe-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 = "subresource";
-link.crossOrigin = "anonymous";
-link.onload = pass;
-link.onerror = fail;
-link.href = "http://localhost:8080/security/resources/abe-allow-star.php?1";
-document.body.appendChild(link);
+function runTest()
+{
+ // Test that dynamically inserted <link> elements are handled the same way.
+ var link = document.createElement("link");
+ link.rel = "subresource";
+ link.crossOrigin = "anonymous";
+ link.onload = pass;
+ link.onerror = fail;
+ link.href = "http://localhost:8080/security/resources/abe-allow-star.php?1";
+ document.body.appendChild(link);
-link = document.createElement("link");
-link.rel = "subresource";
-link.crossOrigin = "anonymous";
-link.onload = pass;
-link.onerror = fail;
-link.href = "http://localhost:8080/security/resources/abe-allow-credentials.php?1";
-document.body.appendChild(link);
+ link = document.createElement("link");
+ link.rel = "subresource";
+ link.crossOrigin = "anonymous";
+ link.onload = pass;
+ link.onerror = fail;
+ link.href = "http://localhost:8080/security/resources/abe-allow-credentials.php?1";
+ document.body.appendChild(link);
+}
+window.onload = runTest;
</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698