Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(742)

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/clipboard/async-rw-dt-text-manual.html

Issue 2695593006: Initial stub version of Async Clipboard API (Closed)
Patch Set: Add WPTs; Update naming conventions; Review comments Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/external/wpt/clipboard/async-rw-dt-text-manual.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/clipboard/async-rw-dt-text-manual.html b/third_party/WebKit/LayoutTests/external/wpt/clipboard/async-rw-dt-text-manual.html
new file mode 100644
index 0000000000000000000000000000000000000000..8758d9702f05a1d446cab5ef530ae3bfd12029c2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/clipboard/async-rw-dt-text-manual.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Async Clipboard write/read (DataTransfer/text) tests</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+async_test(function(t) {
+ var test_data = "Exciting DataTransfer/text clipboard data";
+ var cb = navigator.clipboard;
+ var dt = new DataTransfer();
+ dt.items.add(test_data, "text/plain");
+
+ cb.write(dt).then(function() {
foolip 2017/05/15 15:33:27 The spec says "Handle access permissions. Reject p
garykac 2017/05/17 23:51:14 We have a clipboard Permission[1] that is not yet
+ cb.read().then(function(data) {
+ t.step(function(){assert_equals(data.items.length, 1);});
foolip 2017/05/15 15:33:27 None of the explicit t.step should be required. In
garykac 2017/05/17 23:51:14 Done. Thanks! That looks nicer.
+ data.items[0].getAsString(function(s) {
+ t.step(function(){assert_equals(s, test_data);});
+ t.done();
foolip 2017/05/15 15:33:27 This'll be the final and only t.done(). It doesn't
garykac 2017/05/17 23:51:14 Acknowledged.
+ });
+ }, function() {
+ t.step(function(){assert_false(true, "Read fail");});
foolip 2017/05/15 15:33:27 If you stick with async_test you can use t.unreach
garykac 2017/05/17 23:51:14 Done.
+ t.done();
+ });
+ }, function() {
+ t.step(function(){assert_false(true, "Write fail");});
+ t.done();
+ });
+}, "Verify write and read clipboard (DataTransfer/text)");
+</script>
+Note: This is a manual test because it writes/reads to the shared system
foolip 2017/05/15 15:33:27 Can you file bugs on web-platform-tests with type:
garykac 2017/05/17 23:51:14 Filed: https://github.com/w3c/web-platform-tests/i
+clipboard and thus cannot be run async with other tests that might interact
+with the clipboard.

Powered by Google App Engine
This is Rietveld 408576698