diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources')
20 files changed, 197 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-001-iframe-1.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-001-iframe-1.html new file mode 100644 index 0000000000..04dd74f1a5 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-001-iframe-1.html @@ -0,0 +1,5 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>HTML Test: browsing context name - parent</title> +<link rel="author" title="Intel" href="http://www.intel.com/"> +<iframe src="open-in-_parent.html"></iframe> diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-002-iframe.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-002-iframe.html new file mode 100644 index 0000000000..52da8986b0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-002-iframe.html @@ -0,0 +1,4 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>HTML Test: browsing context name - parent: nested context</title> +<iframe name="iframeChild" src="open-in-_parent.html"></iframe> diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-002-window.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-002-window.html new file mode 100644 index 0000000000..558193742f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-002-window.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>HTML Test: browsing context name - parent: top-level context</title> +<iframe name="iframeParent" src="choose-_parent-002-iframe.html"></iframe> +<script> +// Relay a message from child context to opener context +window.addEventListener('message', e => { + if (window.opener) { + window.opener.postMessage(e.data, '*'); + } +}); +</script> diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-003-iframe.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-003-iframe.html new file mode 100644 index 0000000000..1412dc2e79 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-003-iframe.html @@ -0,0 +1,6 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>HTML Test: browsing context name - parent</title> +<script> +window.open("post-to-opener.html", "_parent"); +</script> diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-003-window.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-003-window.html new file mode 100644 index 0000000000..bd1802aed6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-003-window.html @@ -0,0 +1,4 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>HTML Test: browsing context name - parent: top-level context (gets replaced)</title> +<iframe name="iframeOpener" src="choose-_parent-003-iframe.html"></iframe> diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-004-iframe-1.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-004-iframe-1.html new file mode 100644 index 0000000000..7a8cbecb27 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-004-iframe-1.html @@ -0,0 +1,14 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>HTML Test: browsing context name - parent</title> +<script src="/common/PrefixedLocalStorage.js"></script> +<body> +<script> +var prefixedStorage = new PrefixedLocalStorageResource({ + close_on_cleanup: true +}); +var iframe = document.createElement('iframe'); +iframe.src = prefixedStorage.url('choose-_parent-004-iframe-2.html'); +document.body.appendChild(iframe); +</script> +</body> diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-004-iframe-2.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-004-iframe-2.html new file mode 100644 index 0000000000..33ead5a538 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-004-iframe-2.html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>HTML Test: browsing context name - parent (case-insensitive)</title> +<script src="/common/PrefixedLocalStorage.js"></script> +<script> +var prefixedStorage = new PrefixedLocalStorageResource(); +window.open(prefixedStorage.url('report-is-top.html'), '_pARent'); + +</script> diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_self-001-iframe.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_self-001-iframe.html new file mode 100644 index 0000000000..0ad79d6e16 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_self-001-iframe.html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>HTML Test: browsing context name - self</title> +<link rel="author" title="Intel" href="http://www.intel.com/"> +<script> +window.name = 'myownself'; +var win = window.open('post-to-top.html', '_self'); +win.close(); +</script> diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_self-002-iframe.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_self-002-iframe.html new file mode 100644 index 0000000000..9d88305e09 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_self-002-iframe.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>HTML Test: browsing context name - self (case-insensitive)</title> +<link rel="author" title="Intel" href="http://www.intel.com/"> +<script src="/common/PrefixedLocalStorage.js"></script> +<script> +var prefixedStorage = new PrefixedLocalStorageResource({ + close_on_cleanup: true +}); +var win = window.open(prefixedStorage.url('report-is-top.html'), '_sElF'); +</script> diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_top-002-window.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_top-002-window.html new file mode 100644 index 0000000000..d71384b72f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_top-002-window.html @@ -0,0 +1,16 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<script src="/common/PrefixedLocalStorage.js"></script> +<title>HTML Test: browsing context name - _top</title> +<body> +<script> +var prefixedStorage = new PrefixedLocalStorageResource({ + close_on_cleanup:true +}); +window.name = 'topWin2'; +var iframe = document.createElement('iframe'); +iframe.src = prefixedStorage.url('open-in-_top.html'); +// Append iframe that will open another document into `_top` (this context) +document.body.appendChild(iframe); +</script> +</body> diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_top-003-iframe-1.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_top-003-iframe-1.html new file mode 100644 index 0000000000..aecc2fd88a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_top-003-iframe-1.html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>HTML Test: browsing context name - top (case-insensitive)</title> +<script src="/common/PrefixedLocalStorage.js"></script> +<body> +</body> +<script> +var prefixedStorage = new PrefixedLocalStorageResource({ + close_on_cleanup: true +}); +window.name = 'topWin'; +var iframe = document.createElement('iframe'); +iframe.src = prefixedStorage.url('choose-_top-003-iframe-2.html'); +document.body.appendChild(iframe); +</script> diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_top-003-iframe-2.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_top-003-iframe-2.html new file mode 100644 index 0000000000..a1a7e1dda7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_top-003-iframe-2.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>HTML Test: browsing context name - top (case-insensitive)</title> +<script src="/common/PrefixedLocalStorage.js"></script> +<script> +var prefixedStorage = new PrefixedLocalStorageResource({ + close_on_cleanup: true +}); +window.open(prefixedStorage.url("report-is-top.html"), "_ToP"); +</script> diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-default-002-iframe.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-default-002-iframe.html new file mode 100644 index 0000000000..567e4ea310 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-default-002-iframe.html @@ -0,0 +1,17 @@ +<!DOCTYPE html> +<html> +<meta charset="utf-8"> +<title>HTML Test: browsing context name - Empty string</title> +<link rel="author" title="Intel" href="http://www.intel.com/"> +<body onload="followLink()"> +</body> +<script> +function followLink() { + var a = document.createElement('a'); + a.href = 'post-to-top.html'; + a.target = ''; // Target is empty string + document.body.appendChild(a); + a.click(); +} +</script> +</html> diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-existing-001-iframe.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-existing-001-iframe.html new file mode 100644 index 0000000000..cb0b554854 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-existing-001-iframe.html @@ -0,0 +1,7 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>This is a test page</title> +<link rel="author" title="Intel" href="http://www.intel.com/"> +<script> +window.open("post-to-top.html", "iExist"); +</script> diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/open-in-_parent.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/open-in-_parent.html new file mode 100644 index 0000000000..81d0735c60 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/open-in-_parent.html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>HTML Test: browsing context name - parent</title> +<link rel="author" title="Intel" href="http://www.intel.com/"> +<script> + +window.open("post-to-top.html", "_parent"); + +</script> diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/open-in-_top.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/open-in-_top.html new file mode 100644 index 0000000000..929d52d15e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/open-in-_top.html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<script src="/common/PrefixedLocalStorage.js"></script> +<title>HTML Test: browsing context name - _top</title> +<script> +var prefixedStorage = new PrefixedLocalStorageResource(); +window.name = 'topWin1'; +window.open(prefixedStorage.url('report-is-top.html'), '_top'); +</script> diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/post-to-opener.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/post-to-opener.html new file mode 100644 index 0000000000..3e9b7aaccb --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/post-to-opener.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>HTML Test: post window's name to top browsing context</title> +<link rel="author" title="Intel" href="http://www.intel.com/"> +<script> +if (window.opener) { + window.opener.postMessage({ + name: window.name, + isTop: (window.top === window) + }, "*"); +} +</script> diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/post-to-top.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/post-to-top.html new file mode 100644 index 0000000000..aebb57b019 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/post-to-top.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>HTML Test: post window's name to top browsing context</title> +<link rel="author" title="Intel" href="http://www.intel.com/"> +<script> +top.postMessage({ + name: window.name, + isTop: (window.top === window) +}, "*"); +</script> diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/report-has-opener.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/report-has-opener.html new file mode 100644 index 0000000000..37d8cedc6d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/report-has-opener.html @@ -0,0 +1,8 @@ +<!doctype html> +<script src="/common/PrefixedLocalStorage.js"></script> +<script> +var prefixedStorage = new PrefixedLocalStorageResource({ + close_on_cleanup: true +}); +prefixedStorage.setItem('hasOpener', window.opener !== null); +</script> diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/report-is-top.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/report-is-top.html new file mode 100644 index 0000000000..8711235982 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/report-is-top.html @@ -0,0 +1,10 @@ +<!doctype html> +<meta charset="utf-8"> +<script src="/common/PrefixedLocalStorage.js"></script> +<script> +var prefixedStorage = new PrefixedLocalStorageResource({ + close_on_cleanup: true +}); +prefixedStorage.setItem('isTop', window === window.top); +prefixedStorage.setItem('name', window.name); +</script> |