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

Unified Diff: LayoutTests/http/tests/security/script-crossorigin-loads-cross-origin-2.xhtml

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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/security/script-crossorigin-loads-cross-origin-2.xhtml
diff --git a/LayoutTests/http/tests/security/script-crossorigin-loads-cross-origin-2.xhtml b/LayoutTests/http/tests/security/script-crossorigin-loads-cross-origin-2.xhtml
new file mode 100644
index 0000000000000000000000000000000000000000..524272f4169ed45bfac0bfdce29599fba9d0563f
--- /dev/null
+++ b/LayoutTests/http/tests/security/script-crossorigin-loads-cross-origin-2.xhtml
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<html xmlns='http://www.w3.org/1999/xhtml'>
+<head>
+<title>crossorigin and XHTML</title>
+</head>
+<body>
+<p>In an XHTML document, test that a script element with a crossorigin attribute loads a cross-origin script correctly when the CORS check passes on the response.</p>
+<pre></pre>
+<script><![CDATA[
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+}
+
+var result = "FAIL";
+var have_reported = false;
+function loaded() {
+ if (!have_reported) {
+ document.querySelector("pre").innerHTML = result;
+ if (window.testRunner)
+ testRunner.notifyDone();
+ have_reported = true;
+ }
+}
+]]></script>
+<!-- This script should load -->
+<script crossorigin="anonymous" src="http://localhost:8000/security/resources/cors-script.php?cors=true&amp;&amp;value=PASS"></script>
+<script><![CDATA[loaded();]]></script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698