diff --git a/clipboard-apis/async-custom-formats-write-read.tentative.https.html b/clipboard-apis/async-custom-formats-write-read.tentative.https.html index b6c368f75bc2f2..c91ce0e5c246b0 100644 --- a/clipboard-apis/async-custom-formats-write-read.tentative.https.html +++ b/clipboard-apis/async-custom-formats-write-read.tentative.https.html @@ -14,26 +14,19 @@ 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 format1 = 'web application/x-custom-format-clipboard-test-format-1'; + const format2 = 'web application/x-custom-format-clipboard-test-format-2'; const blobInput1 = new Blob(['input data 1'], {type: format1}); const blobInput2 = new Blob(['input data 2'], {type: format2}); const clipboardItemInput = new ClipboardItem( - {[format1]: blobInput1, [format2]: blobInput2}, - {unsanitized: [format1, format2]}); + {[format1]: blobInput1, [format2]: blobInput2}); await waitForUserActivation(); await navigator.clipboard.write([clipboardItemInput]); - // Items may not be readable on the sanitized clipboard after custom format - // write. - await promise_rejects_dom(t, 'DataError', - navigator.clipboard.read()); - // Items should be readable on a custom format clipboard after custom format // write. await waitForUserActivation(); - const clipboardItems = await navigator.clipboard.read( - {unsanitized: [format1, format2]}); + const clipboardItems = await navigator.clipboard.read(); assert_equals(clipboardItems.length, 1); const clipboardItem = clipboardItems[0]; assert_true(clipboardItem instanceof ClipboardItem); @@ -58,15 +51,29 @@ const customFormatArray = []; const customFormatMap = {}; for (let i = 0; i <= 100; i++) { - customFormatArray.push("CustomFormat" + i); + customFormatArray.push("web text/CustomFormat" + i); const blobInput = new Blob(['input data'], {type: customFormatArray[i]}); customFormatMap[customFormatArray[i]] = blobInput; } - const clipboardItemInput = new ClipboardItem(customFormatMap, - {unsanitized: customFormatArray}); + const clipboardItemInput = new ClipboardItem(customFormatMap); await waitForUserActivation(); await promise_rejects_dom(t, 'NotAllowedError', navigator.clipboard.write([clipboardItemInput])); }, 'navigator.clipboard.write() fails for more than 100 custom formats'); +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}); + const blobInput2 = new Blob(['input data 2'], {type: format2}); + const clipboardItemInput = new ClipboardItem( + {[format1]: blobInput1, [format2]: blobInput2}); + await waitForUserActivation(); + await promise_rejects_dom(t, 'NotAllowedError', + navigator.clipboard.write([clipboardItemInput])); +}, 'navigator.clipboard.write() fails for custom formats without web prefix'); + diff --git a/clipboard-apis/async-html-script-removal.https.html b/clipboard-apis/async-html-script-removal.https.html index 90dc44c9db20e3..44c11add855137 100644 --- a/clipboard-apis/async-html-script-removal.https.html +++ b/clipboard-apis/async-html-script-removal.https.html @@ -4,10 +4,12 @@ Async Clipboard write ([text/html ClipboardItem]) -> readHtml (and remove scripts) tests +Body needed for test_driver.click() + + +Body needed for test_driver.click()

@@ -27,6 +29,7 @@ await test_driver.set_permission({name: 'clipboard-read'}, 'granted'); await test_driver.click(button); + await waitForUserActivation(); const items = await navigator.clipboard.read(); const htmlBlob = await items[0].getType("text/html"); const html = await htmlBlob.text(); @@ -38,3 +41,4 @@ assert_false(loadObserved, 'Should not observe resource loading'); }); + diff --git a/clipboard-apis/async-navigator-clipboard-read-sanitize.https.html b/clipboard-apis/async-navigator-clipboard-read-sanitize.https.html index 9e0ab2ee740f85..cc1836753478b7 100644 --- a/clipboard-apis/async-navigator-clipboard-read-sanitize.https.html +++ b/clipboard-apis/async-navigator-clipboard-read-sanitize.https.html @@ -7,7 +7,9 @@ + +Body needed for test_driver.click()

@@ -29,6 +31,7 @@ await test_driver.set_permission({name: 'clipboard-read'}, 'granted'); await test_driver.click(button); + await waitForUserActivation(); const items = await navigator.clipboard.read(); const htmlBlob = await items[0].getType("text/html"); const html = await htmlBlob.text(); @@ -42,3 +45,4 @@ assert_false(testFailed); }); + diff --git a/clipboard-apis/async-promise-write-blobs-read-blobs.https.html b/clipboard-apis/async-promise-write-blobs-read-blobs.https.html index e4b93c7c5ffb7c..12184c92e0777f 100644 --- a/clipboard-apis/async-promise-write-blobs-read-blobs.https.html +++ b/clipboard-apis/async-promise-write-blobs-read-blobs.https.html @@ -4,10 +4,12 @@ Async Clipboard write blobs -> read blobs with promise tests +Body needed for test_driver.click() + + diff --git a/clipboard-apis/async-unsanitized-plaintext-formats-write-read.tentative.https.html b/clipboard-apis/async-unsanitized-plaintext-formats-write-read.tentative.https.html index f44ed22618e2fd..1c5638ca0a5faf 100644 --- a/clipboard-apis/async-unsanitized-plaintext-formats-write-read.tentative.https.html +++ b/clipboard-apis/async-unsanitized-plaintext-formats-write-read.tentative.https.html @@ -18,32 +18,35 @@ await test_driver.set_permission({name: 'clipboard-write'}, 'granted'); const dataToWrite = 'Test text.'; - const format = 'text/plain'; + const format1 = 'web text/plain'; + const format2 = 'text/plain'; - const blobInput = new Blob([dataToWrite], {type: format}); + const blobInput1 = new Blob([dataToWrite], {type: format1}); + const blobInput2 = new Blob([dataToWrite], {type: format2}); // Blob types are automatically converted to lower-case. - assert_equals(blobInput.type, format.toLowerCase()); + assert_equals(blobInput1.type, format1.toLowerCase()); + assert_equals(blobInput2.type, format2.toLowerCase()); const clipboardItemInput = new ClipboardItem( - {[format]: blobInput}, {unsanitized: [format]}); + {[format1]: blobInput1, [format2]: blobInput2}); await waitForUserActivation(); await navigator.clipboard.write([clipboardItemInput]); // Items should be readable on a system clipboard after custom format write. await waitForUserActivation(); - const clipboardItems = await navigator.clipboard.read( - {unsanitized: [format]}); + const clipboardItems = await navigator.clipboard.read(); assert_equals(clipboardItems.length, 1); const clipboardItem = clipboardItems[0]; assert_true(clipboardItem instanceof ClipboardItem); - const blobOutput = await clipboardItem.getType(format); - assert_equals(blobOutput.type, format); - const data = await (new Response(blobOutput)).text(); - assert_equals(data, dataToWrite); + const blobOutput1 = await clipboardItem.getType(format1); + assert_equals(blobOutput1.type, format1); + const data1 = await (new Response(blobOutput1)).text(); + assert_equals(data1, dataToWrite); // These examples use native text formats, so these formats should be // accessible as text. + await waitForUserActivation(); const textOutput = await navigator.clipboard.readText(); assert_equals(textOutput, dataToWrite); -}, 'Verify write and read unsanitized content to the clipboard given standard format as input'); +}, 'Verify write and read unsanitized content to the clipboard given standard and custom formats as input'); diff --git a/clipboard-apis/async-write-blobs-read-blobs.https.html b/clipboard-apis/async-write-blobs-read-blobs.https.html index 50d23a9c3625d5..8bec558b2b2de8 100644 --- a/clipboard-apis/async-write-blobs-read-blobs.https.html +++ b/clipboard-apis/async-write-blobs-read-blobs.https.html @@ -4,10 +4,12 @@ Async Clipboard write blobs -> read blobs tests +Body needed for test_driver.click() + + + +Body needed for test_driver.click()

The bottom image should display the same image as the top image.

Original Image:

@@ -47,7 +49,9 @@ assert_equals(blobInput.type, 'image/png'); const clipboardItemInput = new ClipboardItem({'image/png' : blobInput}); + await waitForUserActivation(); await navigator.clipboard.write([clipboardItemInput]); + await waitForUserActivation(); const clipboardItems = await navigator.clipboard.read(); assert_equals(clipboardItems.length, 1); @@ -73,7 +77,9 @@ const invalidPngBlob = new Blob(['this text is not a valid png image'], {type: 'image/png'}); const clipboardItemInput = new ClipboardItem({'image/png' : invalidPngBlob}); + await waitForUserActivation(); await promise_rejects_dom(t, 'DataError', navigator.clipboard.write([clipboardItemInput])); }, 'Verify write error on malformed data [image/png ClipboardItem]'); + diff --git a/clipboard-apis/async-write-svg-read-svg.https.html b/clipboard-apis/async-write-svg-read-svg.https.html index 19c91597c111ee..42f6c547b29799 100644 --- a/clipboard-apis/async-write-svg-read-svg.https.html +++ b/clipboard-apis/async-write-svg-read-svg.https.html @@ -4,10 +4,12 @@ Async Clipboard write ([image/svg+xml ClipboardItem]) -> read and write svg tests +Body needed for test_driver.click() + + + + - diff --git a/clipboard-apis/feature-policy/clipboard-read/clipboard-read-enabled-by-feature-policy-attribute-tentative.https.sub.html b/clipboard-apis/feature-policy/clipboard-read/clipboard-read-enabled-by-feature-policy-attribute-tentative.https.sub.html index 15d26842616372..e812854b4c7505 100644 --- a/clipboard-apis/feature-policy/clipboard-read/clipboard-read-enabled-by-feature-policy-attribute-tentative.https.sub.html +++ b/clipboard-apis/feature-policy/clipboard-read/clipboard-read-enabled-by-feature-policy-attribute-tentative.https.sub.html @@ -1,17 +1,19 @@ - +Body needed for test_driver.click() + - diff --git a/clipboard-apis/feature-policy/clipboard-read/clipboard-read-enabled-by-feature-policy-cross-origin-tentative.https.sub.html b/clipboard-apis/feature-policy/clipboard-read/clipboard-read-enabled-by-feature-policy-cross-origin-tentative.https.sub.html index 1b6f4929a19dea..c371ea3b41cb2e 100644 --- a/clipboard-apis/feature-policy/clipboard-read/clipboard-read-enabled-by-feature-policy-cross-origin-tentative.https.sub.html +++ b/clipboard-apis/feature-policy/clipboard-read/clipboard-read-enabled-by-feature-policy-cross-origin-tentative.https.sub.html @@ -1,10 +1,11 @@ - +Body needed for test_driver.click() + - diff --git a/clipboard-apis/feature-policy/clipboard-read/clipboard-read-enabled-by-feature-policy.tentative.https.sub.html b/clipboard-apis/feature-policy/clipboard-read/clipboard-read-enabled-by-feature-policy.tentative.https.sub.html index f8c5bcb129f932..552183cc67d461 100644 --- a/clipboard-apis/feature-policy/clipboard-read/clipboard-read-enabled-by-feature-policy.tentative.https.sub.html +++ b/clipboard-apis/feature-policy/clipboard-read/clipboard-read-enabled-by-feature-policy.tentative.https.sub.html @@ -1,10 +1,11 @@ - +Body needed for test_driver.click() + - diff --git a/clipboard-apis/feature-policy/clipboard-read/clipboard-read-enabled-on-self-origin-by-feature-policy.tentative.https.sub.html b/clipboard-apis/feature-policy/clipboard-read/clipboard-read-enabled-on-self-origin-by-feature-policy.tentative.https.sub.html index 47aa6511ec599b..17dc3628a77220 100644 --- a/clipboard-apis/feature-policy/clipboard-read/clipboard-read-enabled-on-self-origin-by-feature-policy.tentative.https.sub.html +++ b/clipboard-apis/feature-policy/clipboard-read/clipboard-read-enabled-on-self-origin-by-feature-policy.tentative.https.sub.html @@ -1,10 +1,11 @@ - +Body needed for test_driver.click() + - diff --git a/clipboard-apis/feature-policy/clipboard-write/clipboard-write-enabled-by-feature-policy-attribute-cross-origin-tentative.https.sub.html b/clipboard-apis/feature-policy/clipboard-write/clipboard-write-enabled-by-feature-policy-attribute-cross-origin-tentative.https.sub.html index c931bbbb89f32f..e669c8fec4910d 100644 --- a/clipboard-apis/feature-policy/clipboard-write/clipboard-write-enabled-by-feature-policy-attribute-cross-origin-tentative.https.sub.html +++ b/clipboard-apis/feature-policy/clipboard-write/clipboard-write-enabled-by-feature-policy-attribute-cross-origin-tentative.https.sub.html @@ -1,10 +1,11 @@ - +Body needed for test_driver.click() + - diff --git a/clipboard-apis/feature-policy/clipboard-write/clipboard-write-enabled-by-feature-policy-attribute-tentative.https.sub.html b/clipboard-apis/feature-policy/clipboard-write/clipboard-write-enabled-by-feature-policy-attribute-tentative.https.sub.html index a2858c638e6c05..b57dfe3dd2888d 100644 --- a/clipboard-apis/feature-policy/clipboard-write/clipboard-write-enabled-by-feature-policy-attribute-tentative.https.sub.html +++ b/clipboard-apis/feature-policy/clipboard-write/clipboard-write-enabled-by-feature-policy-attribute-tentative.https.sub.html @@ -1,17 +1,19 @@ - +Body needed for test_driver.click() + - diff --git a/clipboard-apis/feature-policy/clipboard-write/clipboard-write-enabled-by-feature-policy-cross-origin-tentative.https.sub.html b/clipboard-apis/feature-policy/clipboard-write/clipboard-write-enabled-by-feature-policy-cross-origin-tentative.https.sub.html index 0f3164d9b02a13..6e7029cc789a63 100644 --- a/clipboard-apis/feature-policy/clipboard-write/clipboard-write-enabled-by-feature-policy-cross-origin-tentative.https.sub.html +++ b/clipboard-apis/feature-policy/clipboard-write/clipboard-write-enabled-by-feature-policy-cross-origin-tentative.https.sub.html @@ -1,10 +1,11 @@ - +Body needed for test_driver.click() + - diff --git a/clipboard-apis/feature-policy/clipboard-write/clipboard-write-enabled-by-feature-policy.tentative.https.sub.html b/clipboard-apis/feature-policy/clipboard-write/clipboard-write-enabled-by-feature-policy.tentative.https.sub.html index 1c6fc49a056605..ca97994c617d0e 100644 --- a/clipboard-apis/feature-policy/clipboard-write/clipboard-write-enabled-by-feature-policy.tentative.https.sub.html +++ b/clipboard-apis/feature-policy/clipboard-write/clipboard-write-enabled-by-feature-policy.tentative.https.sub.html @@ -1,10 +1,11 @@ - +Body needed for test_driver.click() + - diff --git a/clipboard-apis/feature-policy/clipboard-write/clipboard-write-enabled-on-self-origin-by-feature-policy.tentative.https.sub.html b/clipboard-apis/feature-policy/clipboard-write/clipboard-write-enabled-on-self-origin-by-feature-policy.tentative.https.sub.html index 51db5a427d2b41..5615a68ac55af8 100644 --- a/clipboard-apis/feature-policy/clipboard-write/clipboard-write-enabled-on-self-origin-by-feature-policy.tentative.https.sub.html +++ b/clipboard-apis/feature-policy/clipboard-write/clipboard-write-enabled-on-self-origin-by-feature-policy.tentative.https.sub.html @@ -1,10 +1,11 @@ - +Body needed for test_driver.click() + - diff --git a/clipboard-apis/permissions/readText-denied.https.html b/clipboard-apis/permissions/readText-denied.https.html index 935f520e7de2dd..010f4ba21b9533 100644 --- a/clipboard-apis/permissions/readText-denied.https.html +++ b/clipboard-apis/permissions/readText-denied.https.html @@ -2,15 +2,18 @@ navigator.clipboard.readText() fails when permission denied +Body needed for test_driver.click() + + \ No newline at end of file diff --git a/clipboard-apis/permissions/writeText-denied.https.html b/clipboard-apis/permissions/writeText-denied.https.html index 4d0530f0bc2217..5fbcab411748e2 100644 --- a/clipboard-apis/permissions/writeText-denied.https.html +++ b/clipboard-apis/permissions/writeText-denied.https.html @@ -2,15 +2,18 @@ navigator.clipboard.writeText() fails when permission denied +Body needed for test_driver.click() + + \ No newline at end of file diff --git a/clipboard-apis/text-write-read/async-write-read.https.html b/clipboard-apis/text-write-read/async-write-read.https.html index a00c5b27a4d65f..c46e5d43171314 100644 --- a/clipboard-apis/text-write-read/async-write-read.https.html +++ b/clipboard-apis/text-write-read/async-write-read.https.html @@ -5,10 +5,12 @@ read ([text/plain ClipboardItem]) tests +Body needed for test_driver.click() + + + +