diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2019-04-18 00:23:38 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-18 00:23:38 -0400 |
commit | 04c93c511b021a1e76512f997992667540657c4e (patch) | |
tree | adef8886d129bb38b7d0b1463bccc83e12d953bb /tests/wpt/web-platform-tests/clipboard-apis/async-write-blobs-read-blobs-manual.https.html | |
parent | eac2607a06db56a468cae357a9ab0ed6a4945d82 (diff) | |
parent | 39f4d8b931cddb42c45161b34241ee679d0f4967 (diff) | |
download | servo-04c93c511b021a1e76512f997992667540657c4e.tar.gz servo-04c93c511b021a1e76512f997992667540657c4e.zip |
Auto merge of #23223 - servo-wpt-sync:wpt_update_18-04-2019, r=servo-wpt-sync
Sync WPT with upstream (18-04-2019)
Automated downstream sync of changes from upstream as of 18-04-2019.
[no-wpt-sync]
Diffstat (limited to 'tests/wpt/web-platform-tests/clipboard-apis/async-write-blobs-read-blobs-manual.https.html')
-rw-r--r-- | tests/wpt/web-platform-tests/clipboard-apis/async-write-blobs-read-blobs-manual.https.html | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/tests/wpt/web-platform-tests/clipboard-apis/async-write-blobs-read-blobs-manual.https.html b/tests/wpt/web-platform-tests/clipboard-apis/async-write-blobs-read-blobs-manual.https.html index 57cf542ca77..b5f0f3d9dc1 100644 --- a/tests/wpt/web-platform-tests/clipboard-apis/async-write-blobs-read-blobs-manual.https.html +++ b/tests/wpt/web-platform-tests/clipboard-apis/async-write-blobs-read-blobs-manual.https.html @@ -3,6 +3,7 @@ <title> Async Clipboard write blobs -> read blobs tests </title> +<link rel="help" href="https://w3c.github.io/clipboard-apis/#async-clipboard-api"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> @@ -19,14 +20,22 @@ promise_test(async t => { assert_equals(blobText.type, 'text/plain'); assert_equals(blobImage.type, 'image/png'); - await navigator.clipboard.write( + const clipboardItemInput = new ClipboardItem( {'text/plain' : blobText, 'image/png' : blobImage}); - const output = await navigator.clipboard.read(); - assert_equals(Object.keys(output).length, 2); - assert_equals(output['text/plain'].type, 'text/plain'); - assert_equals(output['image/png'].type, 'image/png'); -}, 'Verify write and read clipboard (multiple blobs)'); + await navigator.clipboard.write([clipboardItemInput]); + const clipboardItems = await navigator.clipboard.read(); + + assert_equals(clipboardItems.length, 1); + const clipboardItem = clipboardItems[0]; + assert_true(clipboardItem instanceof ClipboardItem); + + assert_equals(clipboardItem.types.length, 2); + const blobTextOutput = await clipboardItem.getType('text/plain'); + const blobImageOutput = await clipboardItem.getType('image/png'); + assert_equals(blobTextOutput.type, 'text/plain'); + assert_equals(blobImageOutput.type, 'image/png'); +}, 'Verify write and read clipboard (multiple types)'); </script> <p> Note: This is a manual test because it writes/reads to the shared system |