summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/clipboard-apis/resources/page.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
commit0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch)
treea31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /testing/web-platform/tests/clipboard-apis/resources/page.html
parentInitial commit. (diff)
downloadfirefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.tar.xz
firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.zip
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/clipboard-apis/resources/page.html')
-rw-r--r--testing/web-platform/tests/clipboard-apis/resources/page.html26
1 files changed, 26 insertions, 0 deletions
diff --git a/testing/web-platform/tests/clipboard-apis/resources/page.html b/testing/web-platform/tests/clipboard-apis/resources/page.html
new file mode 100644
index 0000000000..35bde8e501
--- /dev/null
+++ b/testing/web-platform/tests/clipboard-apis/resources/page.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<script src="/resources/testdriver.js"></script>
+<script src="/resources/testdriver-action.js"></script>
+<script src="/resources/testdriver-vendor.js"></script>
+<script src="user-activation.js"></script>
+
+<div style="width: 10px; height: 10px"></div>
+<script>
+window.addEventListener("message", async (e) => {
+ if (e.data && e.data[0] == "write") {
+ test_driver.set_test_context(window.parent);
+ await test_driver.set_permission({name: 'clipboard-read'}, 'granted');
+ await test_driver.set_permission({name: 'clipboard-write'}, 'granted');
+ await waitForUserActivation();
+ await navigator.clipboard.write([
+ new ClipboardItem({
+ "text/plain": e.data[1],
+ }),
+ ]).catch(() => {
+ assert_true(false, `should not fail`);
+ });
+ window.parent.postMessage("done", "*");
+ }
+});
+</script>
+</html>