OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script src="/js-test-resources/js-test-pre.js"></script> |
| 5 <link id="target" rel="import" href="http://localhost:8000/htmlimports/resources
/cors-having-crossorigin-scripts.cgi"> |
| 6 </head> |
| 7 <body> |
| 8 <script> |
| 9 description("This test ensures that crossorigin-marked script elements are block
ed properly"); |
| 10 window.jsTestIsAsync = true; |
| 11 |
| 12 function testAndDone() |
| 13 { |
| 14 shouldBe("document.externalScriptHasRun", "undefined"); |
| 15 shouldBe("document.corsExternalScriptHasRun", "undefined"); |
| 16 shouldBeTrue("document.corsExternalScriptForLocalhostHasRun"); |
| 17 finishJSTest(); |
| 18 } |
| 19 |
| 20 var retryCount = 0; |
| 21 |
| 22 // This should be called run-check.js |
| 23 function check() |
| 24 { |
| 25 if (!document.corsExternalScriptForLocalhostHasRun) { |
| 26 retryCount++; |
| 27 if (10 < retryCount) { |
| 28 console.log("FAIL: Retried too many times."); |
| 29 return finishJSTest(); |
| 30 } |
| 31 |
| 32 return setTimeout(check, 100); |
| 33 } |
| 34 |
| 35 testAndDone(); |
| 36 } |
| 37 |
| 38 </script> |
| 39 <script src="/js-test-resources/js-test-post.js"></script> |
| 40 </body> |
| 41 </html> |
OLD | NEW |