summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fenced-frame/resources/ignore-child-fenced-frame-onload-event-inner.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/fenced-frame/resources/ignore-child-fenced-frame-onload-event-inner.html')
-rw-r--r--testing/web-platform/tests/fenced-frame/resources/ignore-child-fenced-frame-onload-event-inner.html41
1 files changed, 41 insertions, 0 deletions
diff --git a/testing/web-platform/tests/fenced-frame/resources/ignore-child-fenced-frame-onload-event-inner.html b/testing/web-platform/tests/fenced-frame/resources/ignore-child-fenced-frame-onload-event-inner.html
new file mode 100644
index 0000000000..4fe496f29c
--- /dev/null
+++ b/testing/web-platform/tests/fenced-frame/resources/ignore-child-fenced-frame-onload-event-inner.html
@@ -0,0 +1,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>