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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/script-dataurl-not-sanitized.html

Issue 2690933003: Don't sanitize errors if the protocol is "data:" (Closed)
Patch Set: Created 3 years, 10 months 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/ExecutionContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/security/script-dataurl-not-sanitized.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/script-dataurl-not-sanitized.html b/third_party/WebKit/LayoutTests/http/tests/security/script-dataurl-not-sanitized.html
new file mode 100644
index 0000000000000000000000000000000000000000..a6d58b186b2e440d29c12d13b9d4c0815fd5df52
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/security/script-dataurl-not-sanitized.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
Mike West 2017/02/14 07:19:07 It looks like there's an existing test in https://
andypaicu2 2017/02/14 09:09:22 Done
+<title>Data URLs error messages are not sanitized</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+async_test(function(t) {
+ window.onerror = t.step_func_done(function(msg, url, line, col, error) {
+ assert_not_equals(msg, 'Script error.');
+ assert_equals(url, "data:application/javascript,throw 'This%20is%20an%20error%20message'");
+ assert_not_equals(line, 0);
+ assert_not_equals(col, 0);
+ assert_not_equals(error, null);
+ });
+}, "Data URLs error messages are not sanitized");
+</script>
+<script src="data:application/javascript,throw 'This%20is%20an%20error%20message'"></script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/ExecutionContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698