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

Side by Side 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 unified diff | Download patch
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <meta charset="utf-8"> 2 <meta charset="utf-8">
3 <title>data URL and scripts</title> 3 <title>Test data URL and scripts errors</title>
4 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharness.js"></script>
5 <script src="/resources/testharnessreport.js"></script> 5 <script src="/resources/testharnessreport.js"></script>
6 <div id=log></div> 6 <div id=log></div>
7 <script> 7 <script>
8 setup({allow_uncaught_exception:true}) 8 setup({allow_uncaught_exception:true});
9 async_test(t => { 9 async_test(function(t) {
10 var counter = 1 10 var counter = 1
11 window.onerror = t.step_func((message, x, xx, xxx, e) => { 11 window.onerror = t.step_func((message, url, lineno, colno, e) => {
12 assert_not_equals(message, "Script error.") // Cannot be "muted" as data U RLs are same-origin 12 // Test that error is not muted as data URLs have a response type of "defa ult"
13 // and errors should only be muted if the response type is "opaque" or "op aqueredirect"
14 assert_not_equals(message, "Script error.")
15 assert_not_equals(url, null);
16 assert_not_equals(url, "");
17 assert_equals(typeof lineno, "number");
18 assert_not_equals(lineno, 0);
19 assert_equals(typeof colno, "number");
20 assert_not_equals(colno, 0);
13 assert_equals(typeof e, "number") 21 assert_equals(typeof e, "number")
14 assert_equals(e, counter) 22 assert_equals(e, counter)
15 if (counter == 3) { 23 if (counter == 3) {
16 t.done() 24 t.done()
17 } 25 }
18 counter++ 26 counter++
19 }) 27 });
20 }) 28 });
21 </script> 29 </script>
22 <script src="data:,throw 1"></script> 30 <script src="data:,throw 1"></script>
23 <script src="data:,throw 2" crossorigin></script> 31 <script src="data:,throw 2" crossorigin></script>
24 <script src="data:,throw 3" crossorigin=use-credentials></script> 32 <script src="data:,throw 3" crossorigin=use-credentials></script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698