blob: 2649edcf32008566c8d05352d42057fdedd4fa39 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<script>
var resources = {"audio": "/media/sound_5.mp3", "video":"/media/test.mp4"};
for (const key in resources){
async_test(t => {
let elem = document.body.appendChild(document.createElement(key));
elem.onerror = t.unreached_func(`${key} should load`);
elem.oncanplay = t.step_func(() => {
t.done();
});
elem.src = resources[key];
}, `Should load ${key}`);
async_test(t => {
let elem = document.body.appendChild(document.createElement(key));
elem.onerror = t.step_func(() => {
t.done();
});
elem.oncanplay = t.unreached_func(`${key} should not load`);
elem.src = resources[key] + "?\n<";
}, `Should not load ${key} with dangling markup in URL`);
}
</script>
|