summaryrefslogtreecommitdiffstats
path: root/dom/html/test/test_nestediframe.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /dom/html/test/test_nestediframe.html
parentInitial commit. (diff)
downloadfirefox-e51783d008170d9ab27d25da98ca3a38b0a41b67.tar.xz
firefox-e51783d008170d9ab27d25da98ca3a38b0a41b67.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/html/test/test_nestediframe.html')
-rw-r--r--dom/html/test/test_nestediframe.html55
1 files changed, 55 insertions, 0 deletions
diff --git a/dom/html/test/test_nestediframe.html b/dom/html/test/test_nestediframe.html
new file mode 100644
index 0000000000..ddbf0ca9dc
--- /dev/null
+++ b/dom/html/test/test_nestediframe.html
@@ -0,0 +1,55 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <title>Test for same URLs nested iframes</title>
+ <script src="/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+<body>
+ test_nestediframe body
+<script>
+
+SimpleTest.waitForExplicitFinish();
+
+function reportState(msg) {
+ if (location.href.includes("#")) {
+ parent.postMessage(msg, "*");
+ return;
+ }
+
+ if (msg == "OK 1") {
+ ok(true, "First frame loaded");
+ } else if (msg == "KO 2") {
+ ok(true, "Second frame load failed");
+ SimpleTest.finish();
+ } else {
+ ok(false, "Unknown message: " + msg);
+ }
+}
+
+addEventListener("message", event => {
+ reportState(event.data);
+});
+
+var recursion;
+if (!location.href.includes("#")) {
+ recursion = 1;
+} else {
+ recursion = parseInt(location.href.split("#")[1]) + 1;
+}
+
+var ifr = document.createElement('iframe');
+ifr.src = location.href.split("#")[0] + "#" + recursion;
+
+ifr.onload = function() {
+ reportState("OK " + recursion);
+}
+ifr.onerror = function() {
+ reportState("KO " + recursion);
+}
+
+document.body.appendChild(ifr);
+
+</script>
+</body>
+</html>