OLD | NEW |
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <p>Test that a subresource with a crossorigin=use-credentials attribute loads th
e expected CORS enabled resources.</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=use-credentials attribut
e loads the expected CORS enabled resources."); |
| 9 </script> |
4 <script src="resources/link-crossorigin-common.js"></script> | 10 <script src="resources/link-crossorigin-common.js"></script> |
5 <link crossorigin="use-credentials" rel="subresource" href="http://localhost:808
0/security/resources/abe-allow-credentials.php" onload="pass()" onerror="fail()"
> | 11 <link crossorigin="use-credentials" rel="subresource" href="http://localhost:808
0/security/resources/abe-allow-credentials.php" onload="pass()" onerror="fail()"
> |
6 <link crossorigin="use-credentials" rel="subresource" href="http://localhost:808
0/security/resources/abe-allow-star.php" onload="fail()" onerror="pass()"> | 12 <link crossorigin="use-credentials" rel="subresource" href="http://localhost:808
0/security/resources/abe-allow-star.php" 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 = pass; | 18 link.rel = "subresource"; |
13 link.onerror = fail; | 19 link.crossOrigin = "anonymous"; |
14 link.href = "http://localhost:8080/security/resources/abe-allow-credentials.php?
1"; | 20 link.onload = pass; |
15 document.body.appendChild(link); | 21 link.onerror = fail; |
| 22 link.href = "http://localhost:8080/security/resources/abe-allow-credentials.
php?1"; |
| 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:8080/security/resources/abe-allow-star.php?1"; | 30 link.href = "http://localhost:8080/security/resources/abe-allow-star.php?1"; |
23 document.body.appendChild(link); | 31 document.body.appendChild(link); |
| 32 } |
| 33 window.onload = runTest; |
24 </script> | 34 </script> |
| 35 </body> |
| 36 </html> |
OLD | NEW |