Skip to content

Commit dd603c3

Browse files
annevkfoolip
authored andcommitted
Basic <script> and data URL test (#3945)
See whatwg/html#1782 for pointers to more context.
1 parent e7faed0 commit dd603c3

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!doctype html>
2+
<meta charset="utf-8">
3+
<title>data URL and scripts</title>
4+
<script src="/resources/testharness.js"></script>
5+
<script src="/resources/testharnessreport.js"></script>
6+
<div id=log></div>
7+
<script>
8+
setup({allow_uncaught_exception:true})
9+
async_test(t => {
10+
var counter = 1
11+
window.onerror = t.step_func((message, x, xx, xxx, e) => {
12+
assert_not_equals(message, "Script error.") // Cannot be "muted" as data URLs are same-origin
13+
assert_equals(typeof e, "number")
14+
assert_equals(e, counter)
15+
if (counter == 3) {
16+
t.done()
17+
}
18+
counter++
19+
})
20+
})
21+
</script>
22+
<script src="data:,throw 1"></script>
23+
<script src="data:,throw 2" crossorigin></script>
24+
<script src="data:,throw 3" crossorigin=use-credentials></script>

0 commit comments

Comments
 (0)