blob: 4fe496f29c84806d0fa41c4d23851cd4878214c6 (
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
|
<!DOCTYPE html>
<title>child frame with delayed onload event</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="utils.js"></script>
<body>
</body>
<script>
(function () {
const [element_type, toplevel_loaded_key, result_key] = parseKeylist();
// Delays the onload event of the iframe for 2 sec.
if (element_type == "iframe") {
const img = document.createElement("img");
img.src = "/common/square.png?pipe=trickle(d2)";
document.body.appendChild(img);
return;
}
const iframe = document.createElement('iframe');
iframe.src = generateURL("ignore-child-fenced-frame-onload-event-inner." +
"html", ["iframe"]);
document.body.append(iframe);
let iframe_loaded = false;
let result = "passed";
window.onload = async function () {
const toplevel_loaded = await readValueFromServer(toplevel_loaded_key);
if (!toplevel_loaded.status || !iframe_loaded)
result = "failed";
writeValueToServer(result_key, result);
}
iframe.onload = function () {
iframe_loaded = true;
}
})();
</script>
</html>
|