Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / security / script-crossorigin-loads-cross-origin-conditional.html
blob44cce22b9d8c5a665f5941ffaef3d45148281438
1 <!DOCTYPE HTML>
2 <p>Test that script elements that are fetched with CORS enabled and conditionally, pass the expected access controls.</p>
3 <pre></pre>
4 <script>
5 if (window.testRunner) {
6 testRunner.dumpAsText();
7 testRunner.waitUntilDone();
10 function log(msg)
12 document.querySelector("pre").innerHTML = msg;
15 var count = 0;
16 function finish(ok) {
17 // Called by the iframe upon completing the fetch of its script.
18 if (ok && count++ < 2) {
19 document.querySelector("iframe").contentWindow.location.reload();
20 return;
22 log((ok ? "PASS" : "FAIL") + ": crossorigin script repeatedly and conditionally loaded.");
23 if (window.testRunner)
24 testRunner.notifyDone();
26 </script>
27 <iframe src="resources/iframe-crossorigin-script.html""></iframe>