| OLD | NEW |
| 1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="/js-test-resources/js-test.js"></script> | 4 <script src="/js-test-resources/js-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 description("Test that a linked stylesheet with a crossorigin=use-credentials at
tributes loads expected CORS enabled resources.") | 6 description("Test that a linked stylesheet with a crossorigin=use-credentials at
tributes loads expected CORS enabled resources.") |
| 7 </script> | 7 </script> |
| 8 <script src="resources/link-crossorigin-common.js"></script> | 8 <script src="resources/link-crossorigin-common.js"></script> |
| 9 </head> | 9 </head> |
| 10 <body> | 10 <body> |
| 11 <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?1" onload="pass(event
)" onerror="fail(event)"> |
| 12 <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?1" onload="fail(event)" oner
ror="pass(event)"> |
| 13 <script> | 13 <script> |
| 14 function runTest() | 14 function runTest() |
| 15 { | 15 { |
| 16 // Test that dynamically inserted <link> elements are handled the same way. | 16 // Test that dynamically inserted <link> elements are handled the same way. |
| 17 var link = document.createElement("link"); | 17 var link = document.createElement("link"); |
| 18 link.rel = "stylesheet"; | 18 link.rel = "stylesheet"; |
| 19 link.crossOrigin = "use-credentials"; | 19 link.crossOrigin = "use-credentials"; |
| 20 link.onload = pass; | 20 link.onload = pass; |
| 21 link.onerror = fail; | 21 link.onerror = fail; |
| 22 link.href = "http://localhost:8080/security/resources/green-background-allow
-credentials.php"; | 22 link.href = "http://localhost:8080/security/resources/green-background-allow
-credentials.php?2"; |
| 23 document.body.appendChild(link); | 23 document.body.appendChild(link); |
| 24 | 24 |
| 25 link = document.createElement("link"); | 25 link = document.createElement("link"); |
| 26 link.rel = "stylesheet"; | 26 link.rel = "stylesheet"; |
| 27 link.crossOrigin = "use-credentials"; | 27 link.crossOrigin = "use-credentials"; |
| 28 link.onload = fail; | 28 link.onload = fail; |
| 29 link.onerror = pass; | 29 link.onerror = pass; |
| 30 link.href = "http://localhost:8080/security/resources/green-background-allow
-star.php"; | 30 link.href = "http://localhost:8080/security/resources/green-background-allow
-star.php?2"; |
| 31 document.body.appendChild(link); | 31 document.body.appendChild(link); |
| 32 } | 32 } |
| 33 window.onload = runTest; | 33 window.onload = runTest; |
| 34 </script> | 34 </script> |
| 35 </body> | 35 </body> |
| 36 </html> | 36 </html> |
| OLD | NEW |