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

Side by Side Diff: LayoutTests/http/tests/security/script-crossorigin-loads-correctly.html

Issue 47923008: Block execution of failed 'crossorigin' <script>s. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 7 years, 1 month 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 <body> 1 <body>
2 <p>This test passes if the script loads correctly.</p> 2 <p>This test passes if the script loads correctly.</p>
3 <pre></pre> 3 <pre></pre>
4 <script> 4 <script>
5 if (window.testRunner) { 5 if (window.testRunner) {
6 testRunner.dumpAsText(); 6 testRunner.dumpAsText();
7 testRunner.waitUntilDone(); 7 testRunner.waitUntilDone();
8 } 8 }
9 9
10 function done(msg) { 10 function done(msg) {
11 document.querySelector("pre").innerHTML = msg; 11 document.querySelector("pre").innerHTML = msg;
12 if (window.testRunner) 12 if (window.testRunner)
13 testRunner.notifyDone(); 13 testRunner.notifyDone();
14 } 14 }
15 15
16 var script = document.createElement("script"); 16 var script = document.createElement("script");
17 script.crossOrigin = ""; 17 script.crossOrigin = "anonymous";
18 script.src = "http://localhost:8000/security/resources/cors-script.php"; 18 script.src = "http://localhost:8000/security/resources/cors-script.php";
19 script.onload = function() { done("PASS"); } 19 script.onload = function() { done("PASS"); }
20 script.onerror = function() { done("FAIL");} 20 script.onerror = function() { done("FAIL");}
21 document.body.appendChild(script); 21 document.body.appendChild(script);
22 </script> 22 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698