summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/clipboard-apis
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
commit8dd16259287f58f9273002717ec4d27e97127719 (patch)
tree3863e62a53829a84037444beab3abd4ed9dfc7d0 /testing/web-platform/tests/clipboard-apis
parentReleasing progress-linux version 126.0.1-1~progress7.99u1. (diff)
downloadfirefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz
firefox-8dd16259287f58f9273002717ec4d27e97127719.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/clipboard-apis')
-rw-r--r--testing/web-platform/tests/clipboard-apis/clipboard-item.https.html41
1 files changed, 24 insertions, 17 deletions
diff --git a/testing/web-platform/tests/clipboard-apis/clipboard-item.https.html b/testing/web-platform/tests/clipboard-apis/clipboard-item.https.html
index 7e148703a2..78acd1104a 100644
--- a/testing/web-platform/tests/clipboard-apis/clipboard-item.https.html
+++ b/testing/web-platform/tests/clipboard-apis/clipboard-item.https.html
@@ -96,21 +96,28 @@ promise_test(async () => {
assert_equals(text, 'xxx');
}, "getType(DOMString invalid type) converts DOMString to Blob");
-promise_test(async () => {
- assert_true(ClipboardItem.supports('text/plain'));
- assert_true(ClipboardItem.supports('text/html'));
- assert_true(ClipboardItem.supports('image/png'));
- assert_true(ClipboardItem.supports('image/svg+xml'));
- assert_false(ClipboardItem.supports('web '));
- assert_false(ClipboardItem.supports('web')); // without space.
- assert_false(ClipboardItem.supports('web foo'));
- assert_false(ClipboardItem.supports('foo/bar'));
- assert_true(ClipboardItem.supports('web foo/bar'));
- assert_true(ClipboardItem.supports('web text/html'));
- assert_false(ClipboardItem.supports('weB text/html'));
- assert_false(ClipboardItem.supports(' web text/html'));
- assert_false(ClipboardItem.supports('not a/real type'));
- assert_false(ClipboardItem.supports(''));
- assert_false(ClipboardItem.supports(' '));
-}, "supports(DOMString) returns true for types that are supported, false otherwise");
+[
+ // mandatory data types
+ ['text/plain', true],
+ ['text/html', true],
+ ['image/png', true],
+ // optional data types
+ ['image/svg+xml', true],
+ ['web foo/bar', true],
+ ['web text/html', true],
+ // invalid types
+ ['web ', false],
+ ['web', false],
+ ['web foo', false],
+ ['foo/bar', false],
+ ['weB text/html', false],
+ [' web text/html', false],
+ ['not a/real type', false],
+ ['', false],
+ [' ', false],
+].forEach(([type, result]) => {
+ promise_test(async () => {
+ assert_equals(ClipboardItem.supports(type), result);
+ }, `supports(${type}) returns ${result ? "true" : "false"}`);
+});
</script>