summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/clipboard-apis/resources
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/clipboard-apis/resources
parentInitial commit. (diff)
downloadfirefox-upstream.tar.xz
firefox-upstream.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/clipboard-apis/resources')
-rw-r--r--testing/web-platform/tests/clipboard-apis/resources/copied-file.txt1
-rw-r--r--testing/web-platform/tests/clipboard-apis/resources/greenbox.pngbin0 -> 95 bytes
-rw-r--r--testing/web-platform/tests/clipboard-apis/resources/user-activation.js25
3 files changed, 26 insertions, 0 deletions
diff --git a/testing/web-platform/tests/clipboard-apis/resources/copied-file.txt b/testing/web-platform/tests/clipboard-apis/resources/copied-file.txt
new file mode 100644
index 0000000000..56a2838b7d
--- /dev/null
+++ b/testing/web-platform/tests/clipboard-apis/resources/copied-file.txt
@@ -0,0 +1 @@
+copied-file-contents
diff --git a/testing/web-platform/tests/clipboard-apis/resources/greenbox.png b/testing/web-platform/tests/clipboard-apis/resources/greenbox.png
new file mode 100644
index 0000000000..6e555e3b19
--- /dev/null
+++ b/testing/web-platform/tests/clipboard-apis/resources/greenbox.png
Binary files differ
diff --git a/testing/web-platform/tests/clipboard-apis/resources/user-activation.js b/testing/web-platform/tests/clipboard-apis/resources/user-activation.js
new file mode 100644
index 0000000000..ed294bb9cb
--- /dev/null
+++ b/testing/web-platform/tests/clipboard-apis/resources/user-activation.js
@@ -0,0 +1,25 @@
+'use strict';
+
+// In order to use this function, please import testdriver.js and
+// testdriver-vendor.js, and include a <body> element.
+async function waitForUserActivation() {
+ if (window.opener) {
+ throw new Error(
+ "waitForUserActivation() only works in the top-level frame");
+ }
+ const loadedPromise = new Promise(resolve => {
+ if(document.readyState == 'complete') {
+ resolve();
+ return;
+ }
+ window.addEventListener('load', resolve, {once: true});
+ });
+ await loadedPromise;
+
+ const clickedPromise = new Promise(resolve => {
+ document.body.addEventListener('click', resolve, {once: true});
+ });
+
+ test_driver.click(document.body);
+ await clickedPromise;
+}