diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/html/webappapis/user-prompts/cannot-show-simple-dialogs | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/html/webappapis/user-prompts/cannot-show-simple-dialogs')
4 files changed, 70 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/webappapis/user-prompts/cannot-show-simple-dialogs/confirm-different-origin-frame.sub.html b/testing/web-platform/tests/html/webappapis/user-prompts/cannot-show-simple-dialogs/confirm-different-origin-frame.sub.html new file mode 100644 index 0000000000..693cde2192 --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/user-prompts/cannot-show-simple-dialogs/confirm-different-origin-frame.sub.html @@ -0,0 +1,24 @@ +<html> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<script> + setup({ single_test: true }); + function handleEvent(e) { + assert_equals(e.data, 'pass'); + done(); + } + function on_iframe_load() { + var frameWin = document.getElementById('confirmFrame').contentWindow; + frameWin.postMessage('Confirm', '*'); + } + window.addEventListener('message', handleEvent); +</script> + +<body> + <iframe id='confirmFrame' + src='http://{{hosts[alt][www]}}:{{ports[http][0]}}/html/webappapis/user-prompts/cannot-show-simple-dialogs/support/confirm.html' + onload='on_iframe_load()'></iframe> +</body> + +</html> diff --git a/testing/web-platform/tests/html/webappapis/user-prompts/cannot-show-simple-dialogs/prompt-different-origin-frame.sub.html b/testing/web-platform/tests/html/webappapis/user-prompts/cannot-show-simple-dialogs/prompt-different-origin-frame.sub.html new file mode 100644 index 0000000000..151def9b5a --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/user-prompts/cannot-show-simple-dialogs/prompt-different-origin-frame.sub.html @@ -0,0 +1,24 @@ +<html> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<script> + setup({ single_test: true }); + function handleEvent(e) { + assert_equals(e.data, 'pass'); + done(); + } + function on_iframe_load() { + var frameWin = document.getElementById('promptFrame').contentWindow; + frameWin.postMessage('Prompt', '*'); + } + window.addEventListener('message', handleEvent); +</script> + +<body> + <iframe id='promptFrame' + src='http://{{hosts[alt][www]}}:{{ports[http][0]}}/html/webappapis/user-prompts/cannot-show-simple-dialogs/support/prompt.html' + onload='on_iframe_load()'></iframe> +</body> + +</html> diff --git a/testing/web-platform/tests/html/webappapis/user-prompts/cannot-show-simple-dialogs/support/confirm.html b/testing/web-platform/tests/html/webappapis/user-prompts/cannot-show-simple-dialogs/support/confirm.html new file mode 100644 index 0000000000..80b2c61b39 --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/user-prompts/cannot-show-simple-dialogs/support/confirm.html @@ -0,0 +1,11 @@ +<script> + function handleEvent(e) { + var conf = window.confirm('Confirm Dialog'); + if (conf == false) { + window.parent.postMessage('pass', '*'); + } else { + window.parent.postMessage('fail', '*'); + } + } + window.addEventListener('message', handleEvent); +</script> diff --git a/testing/web-platform/tests/html/webappapis/user-prompts/cannot-show-simple-dialogs/support/prompt.html b/testing/web-platform/tests/html/webappapis/user-prompts/cannot-show-simple-dialogs/support/prompt.html new file mode 100644 index 0000000000..db40774770 --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/user-prompts/cannot-show-simple-dialogs/support/prompt.html @@ -0,0 +1,11 @@ +<script> + function handleEvent(e) { + var conf = window.prompt('Prompt Dialog'); + if (conf == null) { + window.parent.postMessage('pass', '*'); + } else { + window.parent.postMessage('fail', '*'); + } + } + window.addEventListener('message', handleEvent); +</script> |