summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/long-animation-frame/tentative/loaf-script-block.html
blob: 866eea09e0907622ad62c53c8b5f020566ba559f (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE HTML>
<meta charset=utf-8>
<title>Long Animation Frame Timing: basic</title>
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/utils.js"></script>
<script src="resources/utils.js"></script>

<body>
<h1>Long Animation Frame: script blocks</h1>
<div id="log"></div>
<script>
test_self_script_block(t => {
    const script = document.createElement("script");
    script.innerHTML = `(${busy_wait.toString()})()`;
    document.body.appendChild(script);
}, location.href, "classic-script");

test_self_script_block(t => {
    const script = document.createElement("script");
    script.type = "module";
    script.innerHTML = `(${busy_wait.toString()})()`;
    document.body.appendChild(script);
}, location.href, "module-script");

test_self_script_block(t => {
    const script = document.createElement("script");
    script.src = "resources/busy.js";
    document.body.appendChild(script);
}, new URL("resources/busy.js", location.href).href, "classic-script");

test_self_script_block(t => {
    const uid = token();
    const script = document.createElement("script");
    script.src = `resources/busy.js?token=${uid}`;
    script.type = "module";
    document.body.appendChild(script);
}, new URL("resources/busy.js", location.href).href, "module-script");

test_self_script_block(t => {
    const uid = token();
    const script = document.createElement("script");
    script.type = "module";
    script.innerHTML = `import("./resources/busy.js?import=${uid}");`;
    document.body.appendChild(script);
}, new URL("resources/busy.js?import", location.href).href, "execute-script");

</script>
</body>