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

Side by Side Diff: LayoutTests/http/tests/security/link-crossorigin-stylesheet-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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <p>Test that a linked stylesheet with a crossorigin=use-credentials attributes l oads expected CORS enabled resources.</p> 2 <html>
3 <pre></pre> 3 <head>
4 <script src="/js-test-resources/js-test.js"></script>
5 <script>
6 description("Test that a linked stylesheet with a crossorigin=use-credentials at tributes loads expected CORS enabled resources.")
7 </script>
4 <script src="resources/link-crossorigin-common.js"></script> 8 <script src="resources/link-crossorigin-common.js"></script>
9 </head>
10 <body>
5 <link crossorigin="use-credentials" rel="stylesheet" href="http://localhost:8080 /security/resources/green-background-allow-credentials.php" onload="pass()" oner ror="fail()"> 11 <link crossorigin="use-credentials" rel="stylesheet" href="http://localhost:8080 /security/resources/green-background-allow-credentials.php" onload="pass()" oner ror="fail()">
6 <link crossorigin="use-credentials" rel="stylesheet" href="http://localhost:8080 /security/resources/green-background-allow-star.php" onload="fail()" onerror="pa ss()"> 12 <link crossorigin="use-credentials" rel="stylesheet" href="http://localhost:8080 /security/resources/green-background-allow-star.php" onload="fail()" onerror="pa ss()">
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 = "stylesheet"; 16 // Test that dynamically inserted <link> elements are handled the same way.
11 link.crossOrigin = "use-credentials"; 17 var link = document.createElement("link");
12 link.onload = pass; 18 link.rel = "stylesheet";
13 link.onerror = fail; 19 link.crossOrigin = "use-credentials";
14 link.href = "http://localhost:8080/security/resources/green-background-allow-cre dentials.php"; 20 link.onload = pass;
15 document.body.appendChild(link); 21 link.onerror = fail;
22 link.href = "http://localhost:8080/security/resources/green-background-allow -credentials.php";
23 document.body.appendChild(link);
16 24
17 link = document.createElement("link"); 25 link = document.createElement("link");
18 link.rel = "stylesheet"; 26 link.rel = "stylesheet";
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:8080/security/resources/green-background-allow-sta r.php"; 30 link.href = "http://localhost:8080/security/resources/green-background-allow -star.php";
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