Chromium Code Reviews| Index: LayoutTests/http/tests/security/link-crossorigin-stylesheet-no-cors.html |
| diff --git a/LayoutTests/http/tests/security/link-crossorigin-stylesheet-no-cors.html b/LayoutTests/http/tests/security/link-crossorigin-stylesheet-no-cors.html |
| index c17f2239870bce191f010496201061b933c0bac9..f7c0972a6e838b5b6c7f5bdd84716f097798b33c 100644 |
| --- a/LayoutTests/http/tests/security/link-crossorigin-stylesheet-no-cors.html |
| +++ b/LayoutTests/http/tests/security/link-crossorigin-stylesheet-no-cors.html |
| @@ -1,8 +1,12 @@ |
| <!DOCTYPE HTML> |
| -<p>Test that a linked stylesheet with a crossorigin attribute does not load a cross-origin resource that isn't CORS enabled.</p> |
| -<pre></pre> |
| -<script>window.test_count = 8;</script> |
| +<html> |
| +<head> |
| +<script src="/js-test-resources/js-test.js"></script> |
| <script src="resources/link-crossorigin-common.js"></script> |
| +<script>window.test_count = 8;</script> |
|
tyoshino (SeeGerritForStatus)
2014/07/17 04:04:12
it seems link-crossorigin-common.js is expecting t
sof
2014/07/17 07:03:18
Good catch; fixed.
|
| +</head> |
| +<body> |
| +<p>Test that a linked stylesheet with a crossorigin attribute does not load a cross-origin resource that isn't CORS enabled.</p> |
| <link crossorigin="anonymous" rel="stylesheet" href="http://localhost:8080/security/resources/green-background.css?1" onload="fail()" onerror="pass()"> |
| <link crossorigin="use-credentials" rel="stylesheet" href="http://localhost:8080/security/resources/green-background.css?2" onload="fail()" onerror="pass()"> |
| <!-- Check that from-cache loads are also failing (and does not generate separate loads.) --> |
| @@ -12,20 +16,26 @@ |
| <link crossorigin="anonymous" rel="stylesheet" href="resources/green-background.css?3" onload="pass()" onerror="fail()"> |
| <link crossorigin="use-credentials" rel="stylesheet" href="resources/green-background.css?4" 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 = fail; |
| -link.onerror = pass; |
| -link.href = "http://localhost:8080/security/resources/green-background.css?8"; |
| -document.body.appendChild(link); |
| +function runTest() |
| +{ |
| + // Test that dynamically inserted <link> elements are handled the same way. |
| + var link = document.createElement("link"); |
| + link.rel = "stylesheet"; |
| + link.crossOrigin = "anonymous"; |
| + link.onload = fail; |
| + link.onerror = pass; |
| + link.href = "http://localhost:8080/security/resources/green-background.css?8"; |
| + document.body.appendChild(link); |
| -link = document.createElement("link"); |
| -link.rel = "stylesheet"; |
| -link.crossOrigin = "use-credentials"; |
| -link.onload = fail; |
| -link.onerror = pass; |
| -link.href = "http://localhost:8080/security/resources/green-background.css?9"; |
| -document.body.appendChild(link); |
| + link = document.createElement("link"); |
| + link.rel = "stylesheet"; |
| + link.crossOrigin = "use-credentials"; |
| + link.onload = fail; |
| + link.onerror = pass; |
| + link.href = "http://localhost:8080/security/resources/green-background.css?9"; |
| + document.body.appendChild(link); |
| +} |
| +window.onload = runTest; |
| </script> |
| +</body> |
| +</html> |