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

Unified Diff: LayoutTests/http/tests/security/link-crossorigin-subresource-use-credentials.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-use-credentials.html
diff --git a/LayoutTests/http/tests/security/link-crossorigin-subresource-use-credentials.html b/LayoutTests/http/tests/security/link-crossorigin-subresource-use-credentials.html
index 907dbb3878a9022a90c7c0427a15ca77b7f623d0..736b036f468b4459b6efd25973c8b5288fa799d0 100644
--- a/LayoutTests/http/tests/security/link-crossorigin-subresource-use-credentials.html
+++ b/LayoutTests/http/tests/security/link-crossorigin-subresource-use-credentials.html
@@ -1,24 +1,36 @@
<!DOCTYPE HTML>
-<p>Test that a subresource with a crossorigin=use-credentials attribute loads the expected CORS enabled resources.</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=use-credentials attribute loads the expected CORS enabled resources.");
+</script>
<script src="resources/link-crossorigin-common.js"></script>
<link crossorigin="use-credentials" rel="subresource" href="http://localhost:8080/security/resources/abe-allow-credentials.php" onload="pass()" onerror="fail()">
<link crossorigin="use-credentials" rel="subresource" href="http://localhost:8080/security/resources/abe-allow-star.php" 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 = pass;
-link.onerror = fail;
-link.href = "http://localhost:8080/security/resources/abe-allow-credentials.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-credentials.php?1";
+ 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:8080/security/resources/abe-allow-star.php?1";
-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:8080/security/resources/abe-allow-star.php?1";
+ document.body.appendChild(link);
+}
+window.onload = runTest;
</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698