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

Side by Side Diff: LayoutTests/http/tests/security/link-crossorigin-subresource-no-cors.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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <p>Test that a subresource with a crossorigin attribute does not load a cross-or igin resource that isn't CORS enabled.</p> 2 <html>
3 <pre></pre> 3 <head>
4 <script src="/js-test-resources/js-test.js"></script>
5 </head>
6 <body>
7 <script>
8 description("Test that a subresource with a crossorigin attribute does not load a cross-origin resource that isn't CORS enabled.");
9 </script>
4 <script src="resources/link-crossorigin-common.js"></script> 10 <script src="resources/link-crossorigin-common.js"></script>
5 <link crossorigin="anonymous" rel="subresource" href="http://localhost:8000/secu rity/resources/abe.png?1" onload="fail()" onerror="pass()"> 11 <link crossorigin="anonymous" rel="subresource" href="http://localhost:8000/secu rity/resources/abe.png?1" onload="fail()" onerror="pass()">
6 <link crossorigin="use-credentials" rel="subresource" href="http://localhost:800 0/security/resources/abe.png?2" onload="fail()" onerror="pass()"> 12 <link crossorigin="use-credentials" rel="subresource" href="http://localhost:800 0/security/resources/abe.png?2" onload="fail()" onerror="pass()">
7 <script> 13 <script>
8 // Test that dynamically inserted <link> elements are handled the same way. 14 function runTest()
9 var link = document.createElement("link"); 15 {
10 link.rel = "subresource"; 16 // Test that dynamically inserted <link> elements are handled the same way.
11 link.crossOrigin = "anonymous"; 17 var link = document.createElement("link");
12 link.onload = fail; 18 link.rel = "subresource";
13 link.onerror = pass; 19 link.crossOrigin = "anonymous";
14 link.href = "http://localhost:8000/security/resources/abe.png?3"; 20 link.onload = fail;
15 document.body.appendChild(link); 21 link.onerror = pass;
22 link.href = "http://localhost:8000/security/resources/abe.png?3";
23 document.body.appendChild(link);
16 24
17 link = document.createElement("link"); 25 link = document.createElement("link");
18 link.rel = "subresource"; 26 link.rel = "subresource";
19 link.crossOrigin = "use-credentials"; 27 link.crossOrigin = "use-credentials";
20 link.onload = fail; 28 link.onload = fail;
21 link.onerror = pass; 29 link.onerror = pass;
22 link.href = "http://localhost:8000/security/resources/abe.png?4"; 30 link.href = "http://localhost:8000/security/resources/abe.png?4";
23 document.body.appendChild(link); 31 document.body.appendChild(link);
32 }
33 window.onload = runTest;
24 </script> 34 </script>
35 </body>
36 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698