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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/data-url.html

Issue 2690933003: Don't sanitize errors if the protocol is "data:" (Closed)
Patch Set: Removed the runtime-error-data-url-expected.txt file since both tests in it are now passing 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
Index: third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/data-url.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/data-url.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/data-url.html
index 86190b6cf9f03cf00445d6b7c5e6f48aa6107f8c..6fad50527177e756db35842e054bf19d6e4dfbe4 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/data-url.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/data-url.html
@@ -1,23 +1,31 @@
<!doctype html>
<meta charset="utf-8">
-<title>data URL and scripts</title>
+<title>Test data URL and scripts errors</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
- setup({allow_uncaught_exception:true})
- async_test(t => {
+ setup({allow_uncaught_exception:true});
+ async_test(function(t) {
var counter = 1
- window.onerror = t.step_func((message, x, xx, xxx, e) => {
- assert_not_equals(message, "Script error.") // Cannot be "muted" as data URLs are same-origin
+ window.onerror = t.step_func((message, url, lineno, colno, e) => {
+ // Test that error is not muted as data URLs have a response type of "default"
+ // and errors should only be muted if the response type is "opaque" or "opaqueredirect"
+ assert_not_equals(message, "Script error.")
+ assert_not_equals(url, null);
+ assert_not_equals(url, "");
+ assert_equals(typeof lineno, "number");
+ assert_not_equals(lineno, 0);
+ assert_equals(typeof colno, "number");
+ assert_not_equals(colno, 0);
assert_equals(typeof e, "number")
assert_equals(e, counter)
if (counter == 3) {
t.done()
}
counter++
- })
- })
+ });
+ });
</script>
<script src="data:,throw 1"></script>
<script src="data:,throw 2" crossorigin></script>

Powered by Google App Engine
This is Rietveld 408576698