From 90b330158f2e50515af90e49cc29a23a949d110e Mon Sep 17 00:00:00 2001 From: Anupam Snigdha Date: Thu, 9 Dec 2021 16:14:41 +0000 Subject: [PATCH] Bug 1743513 [wpt PR 31785] - Add wpt tests for custom clipboard formats., a=testonly Automatic update from web-platform-tests Add wpt tests for custom clipboard formats. Added test to read/write unsanitized content for well-known formats. Bug: 106449 Change-Id: I266525d48263066746b3c804400f970e6afb5a7e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3292370 Commit-Queue: Anupam Snigdha Reviewed-by: Victor Costan Commit-Queue: Victor Costan Cr-Commit-Position: refs/heads/main@{#949303} -- wpt-commits: 30fac55fa8baa0f1abf98365947dc48a92ce30e0 wpt-pr: 31785 --- ...om-formats-write-read.tentative.https.html | 7 +- ...ml-formats-write-read.tentative.https.html | 66 +++++++++++++++++++ ...xt-formats-write-read.tentative.https.html | 49 ++++++++++++++ 3 files changed, 117 insertions(+), 5 deletions(-) create mode 100644 testing/web-platform/tests/clipboard-apis/async-unsanitized-html-formats-write-read.tentative.https.html create mode 100644 testing/web-platform/tests/clipboard-apis/async-unsanitized-plaintext-formats-write-read.tentative.https.html diff --git a/testing/web-platform/tests/clipboard-apis/async-custom-formats-write-read.tentative.https.html b/testing/web-platform/tests/clipboard-apis/async-custom-formats-write-read.tentative.https.html index 373c4a1294f1..9bb2b9d50ee1 100644 --- a/testing/web-platform/tests/clipboard-apis/async-custom-formats-write-read.tentative.https.html +++ b/testing/web-platform/tests/clipboard-apis/async-custom-formats-write-read.tentative.https.html @@ -12,6 +12,8 @@ 'use strict'; promise_test(async t => { + await test_driver.set_permission({name: 'clipboard-read'}, 'granted'); + await test_driver.set_permission({name: 'clipboard-write'}, 'granted'); const format1 = 'application/x-custom-format-clipboard-test-format-1'; const format2 = 'application/x-custom-format-clipboard-test-format-2'; const blobInput1 = new Blob(['input data 1'], {type: format1}); @@ -49,8 +51,3 @@ promise_test(async t => { assert_equals(data2, 'input data 2'); }, 'Verify write and read clipboard given 2 platform-neutral custom format inputs'); -

- This is a manual test because it writes/reads to the shared system - clipboard and thus cannot be run async with other tests that might interact - with the clipboard. -

diff --git a/testing/web-platform/tests/clipboard-apis/async-unsanitized-html-formats-write-read.tentative.https.html b/testing/web-platform/tests/clipboard-apis/async-unsanitized-html-formats-write-read.tentative.https.html new file mode 100644 index 000000000000..887ba8a484fd --- /dev/null +++ b/testing/web-platform/tests/clipboard-apis/async-unsanitized-html-formats-write-read.tentative.https.html @@ -0,0 +1,66 @@ + + +Async Clipboard unsanitized HTML write -> Async Clipboard unsanitized HTML read test + +Body needed for test_driver.click() + + + + + + diff --git a/testing/web-platform/tests/clipboard-apis/async-unsanitized-plaintext-formats-write-read.tentative.https.html b/testing/web-platform/tests/clipboard-apis/async-unsanitized-plaintext-formats-write-read.tentative.https.html new file mode 100644 index 000000000000..f44ed22618e2 --- /dev/null +++ b/testing/web-platform/tests/clipboard-apis/async-unsanitized-plaintext-formats-write-read.tentative.https.html @@ -0,0 +1,49 @@ + + +Async Clipboard unsanitized write -> Async Clipboard unsanitized read test + +Body needed for test_driver.click() + + + + + +