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

Unified Diff: LayoutTests/http/tests/security/script-onerror-crossorigin-no-cors.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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/security/script-onerror-crossorigin-no-cors.html
diff --git a/LayoutTests/http/tests/security/script-onerror-crossorigin-no-cors.html b/LayoutTests/http/tests/security/script-onerror-crossorigin-no-cors.html
index 45e3d0cff13289e9345c052149d3591f75d7a411..22fe1a6d515c8055be04f4547ef8c80f3c84d6be 100644
--- a/LayoutTests/http/tests/security/script-onerror-crossorigin-no-cors.html
+++ b/LayoutTests/http/tests/security/script-onerror-crossorigin-no-cors.html
@@ -2,25 +2,26 @@
<head>
</head>
<body>
- <script src="../../js-test-resources/js-test.js"></script>
+ <script src="/js-test-resources/js-test.js"></script>
<script>
window.jsTestIsAsync = true;
- description("The test passes if 'window.onerror' gets sanitized information about an exception thrown in a script loaded with a 'crossorigin' attribute, and delivered without valid CORS headers.");
+ description("The test passes if 'window.onerror' is not invoked on a script loaded with a 'crossorigin' attribute, but delivered without valid CORS headers.");
+
+ var still_running = true;
+ function shutdown() {
+ if (still_running) {
+ finishJSTest();
+ still_running = false;
+ }
+ }
window.onerror = function(msg, url, line, column, error) {
- window.msg = msg;
- window.url = url;
- window.line = line;
- window.column = column;
- window.errorObject = error;
- shouldBeEqualToString("msg", "Script error.");
- shouldBeEqualToString("url", "");
- shouldBe("line", "0");
- shouldBe("column", "0");
- shouldBeNull("window.errorObject");
- finishJSTest();
+ window.fail = "FAIL";
+ shouldBeUndefined("window.fail");
+ shutdown();
}
</script>
<script crossorigin="anonymous" src="http://localhost:8000/security/resources/cors-script.php?fail=true&cors=false"></script>
+ <script>shutdown();</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698