[Clipboard API] Import web-platform-tests/clipboard-apis
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Oct 2019 20:32:55 +0000 (20:32 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Oct 2019 20:32:55 +0000 (20:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=202642

Reviewed by Ryosuke Niwa.

Upstream tests and current test expectations from `web-platform-tests/clipboard-apis/`.

* resources/import-expectations.json:
* web-platform-tests/clipboard-apis/META.yml: Added.
* web-platform-tests/clipboard-apis/async-interfaces.https-expected.txt: Added.
* web-platform-tests/clipboard-apis/async-interfaces.https.html: Added.
* web-platform-tests/clipboard-apis/async-navigator-clipboard-basics.https-expected.txt: Added.
* web-platform-tests/clipboard-apis/async-navigator-clipboard-basics.https.html: Added.
* web-platform-tests/clipboard-apis/async-write-dttext-read-dttext-manual.https-expected.txt: Added.
* web-platform-tests/clipboard-apis/async-write-dttext-read-dttext-manual.https.html: Added.
* web-platform-tests/clipboard-apis/async-write-dttext-read-text-manual.https-expected.txt: Added.
* web-platform-tests/clipboard-apis/async-write-dttext-read-text-manual.https.html: Added.
* web-platform-tests/clipboard-apis/async-write-text-read-dttext-manual.https-expected.txt: Added.
* web-platform-tests/clipboard-apis/async-write-text-read-dttext-manual.https.html: Added.
* web-platform-tests/clipboard-apis/async-write-text-read-text-manual.https-expected.txt: Added.
* web-platform-tests/clipboard-apis/async-write-text-read-text-manual.https.html: Added.
* web-platform-tests/clipboard-apis/clipboard-events-synthetic-expected.txt: Added.
* web-platform-tests/clipboard-apis/clipboard-events-synthetic.html: Added.
* web-platform-tests/clipboard-apis/w3c-import.log: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250856 268f45cc-cd09-0410-ab3c-d52691b4dbfc

26 files changed:
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/resources/import-expectations.json
LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/META.yml [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-interfaces.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-interfaces.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-navigator-clipboard-basics.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-navigator-clipboard-basics.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-write-dttext-read-dttext-manual.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-write-dttext-read-dttext-manual.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-write-dttext-read-text-manual.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-write-dttext-read-text-manual.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-write-text-read-dttext-manual.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-write-text-read-dttext-manual.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-write-text-read-text-manual.https-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-write-text-read-text-manual.https.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/clipboard-events-synthetic-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/clipboard-events-synthetic.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/w3c-import.log [new file with mode: 0644]
LayoutTests/platform/ios-wk1/imported/w3c/web-platform-tests/clipboard-apis/async-interfaces.https-expected.txt [new file with mode: 0644]
LayoutTests/platform/ios-wk1/imported/w3c/web-platform-tests/clipboard-apis/async-navigator-clipboard-basics.https-expected.txt [new file with mode: 0644]
LayoutTests/platform/ios-wk1/imported/w3c/web-platform-tests/clipboard-apis/async-write-text-read-dttext-manual.https-expected.txt [new file with mode: 0644]
LayoutTests/platform/ios-wk1/imported/w3c/web-platform-tests/clipboard-apis/async-write-text-read-text-manual.https-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/clipboard-apis/async-interfaces.https-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/clipboard-apis/async-navigator-clipboard-basics.https-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/clipboard-apis/async-write-text-read-dttext-manual.https-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/clipboard-apis/async-write-text-read-text-manual.https-expected.txt [new file with mode: 0644]

index 043395a..2b43ce2 100644 (file)
@@ -1,3 +1,30 @@
+2019-10-08  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        [Clipboard API] Import web-platform-tests/clipboard-apis
+        https://bugs.webkit.org/show_bug.cgi?id=202642
+
+        Reviewed by Ryosuke Niwa.
+
+        Upstream tests and current test expectations from `web-platform-tests/clipboard-apis/`.
+
+        * resources/import-expectations.json:
+        * web-platform-tests/clipboard-apis/META.yml: Added.
+        * web-platform-tests/clipboard-apis/async-interfaces.https-expected.txt: Added.
+        * web-platform-tests/clipboard-apis/async-interfaces.https.html: Added.
+        * web-platform-tests/clipboard-apis/async-navigator-clipboard-basics.https-expected.txt: Added.
+        * web-platform-tests/clipboard-apis/async-navigator-clipboard-basics.https.html: Added.
+        * web-platform-tests/clipboard-apis/async-write-dttext-read-dttext-manual.https-expected.txt: Added.
+        * web-platform-tests/clipboard-apis/async-write-dttext-read-dttext-manual.https.html: Added.
+        * web-platform-tests/clipboard-apis/async-write-dttext-read-text-manual.https-expected.txt: Added.
+        * web-platform-tests/clipboard-apis/async-write-dttext-read-text-manual.https.html: Added.
+        * web-platform-tests/clipboard-apis/async-write-text-read-dttext-manual.https-expected.txt: Added.
+        * web-platform-tests/clipboard-apis/async-write-text-read-dttext-manual.https.html: Added.
+        * web-platform-tests/clipboard-apis/async-write-text-read-text-manual.https-expected.txt: Added.
+        * web-platform-tests/clipboard-apis/async-write-text-read-text-manual.https.html: Added.
+        * web-platform-tests/clipboard-apis/clipboard-events-synthetic-expected.txt: Added.
+        * web-platform-tests/clipboard-apis/clipboard-events-synthetic.html: Added.
+        * web-platform-tests/clipboard-apis/w3c-import.log: Added.
+
 2019-10-08  Alexey Shvayka  <shvaikalesh@gmail.com>
 
         Accept two values in the overflow shorthand
 2019-10-08  Alexey Shvayka  <shvaikalesh@gmail.com>
 
         Accept two values in the overflow shorthand
index 9eb9d43..a821deb 100644 (file)
@@ -40,7 +40,7 @@
     "web-platform-tests/browser-payment-api": "skip", 
     "web-platform-tests/clear-site-data": "skip", 
     "web-platform-tests/clipboard": "skip", 
     "web-platform-tests/browser-payment-api": "skip", 
     "web-platform-tests/clear-site-data": "skip", 
     "web-platform-tests/clipboard": "skip", 
-    "web-platform-tests/clipboard-apis": "skip", 
+    "web-platform-tests/clipboard-apis": "import", 
     "web-platform-tests/common": "import", 
     "web-platform-tests/compat": "skip", 
     "web-platform-tests/console": "skip", 
     "web-platform-tests/common": "import", 
     "web-platform-tests/compat": "skip", 
     "web-platform-tests/console": "skip", 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/META.yml b/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/META.yml
new file mode 100644 (file)
index 0000000..ecbac54
--- /dev/null
@@ -0,0 +1,3 @@
+spec: https://w3c.github.io/clipboard-apis/
+suggested_reviewers:
+  - garykac
diff --git a/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-interfaces.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-interfaces.https-expected.txt
new file mode 100644 (file)
index 0000000..5b849fb
--- /dev/null
@@ -0,0 +1,46 @@
+
+PASS Test driver 
+PASS Partial interface Navigator: original interface defined 
+PASS Navigator interface: attribute clipboard 
+PASS Navigator interface: navigator must inherit property "clipboard" with the proper type 
+PASS ClipboardEvent interface: existence and properties of interface object 
+PASS ClipboardEvent interface object length 
+PASS ClipboardEvent interface object name 
+PASS ClipboardEvent interface: existence and properties of interface prototype object 
+PASS ClipboardEvent interface: existence and properties of interface prototype object's "constructor" property 
+PASS ClipboardEvent interface: existence and properties of interface prototype object's @@unscopables property 
+PASS ClipboardEvent interface: attribute clipboardData 
+PASS ClipboardEvent must be primary interface of new ClipboardEvent("x") 
+PASS Stringification of new ClipboardEvent("x") 
+PASS ClipboardEvent interface: new ClipboardEvent("x") must inherit property "clipboardData" with the proper type 
+PASS Clipboard interface: existence and properties of interface object 
+PASS Clipboard interface object length 
+PASS Clipboard interface object name 
+PASS Clipboard interface: existence and properties of interface prototype object 
+PASS Clipboard interface: existence and properties of interface prototype object's "constructor" property 
+PASS Clipboard interface: existence and properties of interface prototype object's @@unscopables property 
+PASS Clipboard interface: operation read() 
+PASS Clipboard interface: operation readText() 
+PASS Clipboard interface: operation write(ClipboardItems) 
+PASS Clipboard interface: operation writeText(DOMString) 
+PASS Clipboard must be primary interface of navigator.clipboard 
+PASS Stringification of navigator.clipboard 
+PASS Clipboard interface: navigator.clipboard must inherit property "read()" with the proper type 
+PASS Clipboard interface: navigator.clipboard must inherit property "readText()" with the proper type 
+PASS Clipboard interface: navigator.clipboard must inherit property "write(ClipboardItems)" with the proper type 
+PASS Clipboard interface: calling write(ClipboardItems) on navigator.clipboard with too few arguments must throw TypeError 
+PASS Clipboard interface: navigator.clipboard must inherit property "writeText(DOMString)" with the proper type 
+PASS Clipboard interface: calling writeText(DOMString) on navigator.clipboard with too few arguments must throw TypeError 
+PASS ClipboardItem interface: existence and properties of interface object 
+PASS ClipboardItem interface object length 
+PASS ClipboardItem interface object name 
+PASS ClipboardItem interface: existence and properties of interface prototype object 
+PASS ClipboardItem interface: existence and properties of interface prototype object's "constructor" property 
+PASS ClipboardItem interface: existence and properties of interface prototype object's @@unscopables property 
+FAIL ClipboardItem interface: operation createDelayed([object Object],[object Object], ClipboardItemOptions) assert_own_property: interface object missing static operation expected property "createDelayed" missing
+PASS ClipboardItem interface: attribute presentationStyle 
+FAIL ClipboardItem interface: attribute lastModified assert_true: The prototype object must have a property "lastModified" expected true got false
+FAIL ClipboardItem interface: attribute delayed assert_true: The prototype object must have a property "delayed" expected true got false
+PASS ClipboardItem interface: attribute types 
+PASS ClipboardItem interface: operation getType(DOMString) 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-interfaces.https.html b/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-interfaces.https.html
new file mode 100644 (file)
index 0000000..1f523e5
--- /dev/null
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Clipboard IDL test</title>
+<link rel="help" href="https://w3c.github.io/clipboard-apis/">
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script src=/resources/WebIDLParser.js></script>
+<script src=/resources/idlharness.js></script>
+<script>
+'use strict';
+
+function doTest(idl, dom) {
+  var idl_array = new IdlArray();
+  idl_array.add_untested_idls('interface Navigator {};');
+  idl_array.add_untested_idls('interface EventTarget {};');
+  idl_array.add_untested_idls('dictionary PermissionDescriptor {};');
+  idl_array.add_untested_idls(dom, { only: ['Event', 'EventInit'] });
+  idl_array.add_idls(idl);
+  idl_array.add_objects({
+    Navigator: ['navigator'],
+    Clipboard: ['navigator.clipboard'],
+    ClipboardEvent: ['new ClipboardEvent("x")'],
+  });
+  idl_array.test();
+};
+
+function fetchText(url) {
+  return fetch(url).then((response) => response.text());
+}
+
+promise_test(() => {
+  return Promise.all(
+    [
+      "/interfaces/clipboard-apis.idl",
+      "/interfaces/dom.idl",
+    ].map(fetchText))
+    .then(([idl, dom]) => doTest(idl, dom));
+}, "Test driver");
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-navigator-clipboard-basics.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-navigator-clipboard-basics.https-expected.txt
new file mode 100644 (file)
index 0000000..99aed2e
--- /dev/null
@@ -0,0 +1,11 @@
+
+PASS navigator.clipboard exists 
+FAIL navigator.clipboard.write(DataTransfer) succeeds function is not a constructor (evaluating 'new DataTransfer()')
+PASS navigator.clipboard.write() fails (expect DataTransfer) 
+PASS navigator.clipboard.write(null) fails (expect DataTransfer) 
+PASS navigator.clipboard.write(DOMString) fails (expect DataTransfer) 
+FAIL navigator.clipboard.writeText(DOMString) succeeds promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+PASS navigator.clipboard.writeText() fails (expect DOMString) 
+FAIL navigator.clipboard.read() succeeds promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL navigator.clipboard.readText() succeeds promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-navigator-clipboard-basics.https.html b/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-navigator-clipboard-basics.https.html
new file mode 100644 (file)
index 0000000..3126655
--- /dev/null
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Async Clipboard basic tests</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+
+test(function() {
+  assert_not_equals(navigator.clipboard, undefined);
+  assert_true(navigator.clipboard instanceof Clipboard);
+  assert_equals(navigator.clipboard, navigator.clipboard);
+}, "navigator.clipboard exists");
+
+/* clipboard.write() */
+
+promise_test(function() {
+  var dt = new DataTransfer();
+  dt.items.add("Howdy", "text/plain");
+  return navigator.clipboard.write(dt);
+}, "navigator.clipboard.write(DataTransfer) succeeds");
+
+promise_test(function(t) {
+  return promise_rejects(t, new TypeError(),
+                         navigator.clipboard.write());
+}, "navigator.clipboard.write() fails (expect DataTransfer)");
+
+promise_test(function(t) {
+  return promise_rejects(t, new TypeError(),
+                         navigator.clipboard.write(null));
+}, "navigator.clipboard.write(null) fails (expect DataTransfer)");
+
+promise_test(function(t) {
+  return promise_rejects(t, new TypeError(),
+                         navigator.clipboard.write("Bad string"));
+}, "navigator.clipboard.write(DOMString) fails (expect DataTransfer)");
+
+
+/* clipboard.writeText() */
+
+promise_test(function() {
+  return navigator.clipboard.writeText("New clipboard text");
+}, "navigator.clipboard.writeText(DOMString) succeeds");
+
+promise_test(function(t) {
+  return promise_rejects(t, new TypeError(),
+                         navigator.clipboard.writeText());
+}, "navigator.clipboard.writeText() fails (expect DOMString)");
+
+
+/* clipboard.read() */
+
+promise_test(function() {
+  return navigator.clipboard.read()
+    .then(function(result) {
+      assert_true(result instanceof DataTransfer);
+    });
+}, "navigator.clipboard.read() succeeds");
+
+
+/* clipboard.readText() */
+
+promise_test(function() {
+  return navigator.clipboard.readText()
+    .then(function(result) {
+      assert_equals(typeof result, "string");
+    });
+}, "navigator.clipboard.readText() succeeds");
+
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-write-dttext-read-dttext-manual.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-write-dttext-read-dttext-manual.https-expected.txt
new file mode 100644 (file)
index 0000000..88fd795
--- /dev/null
@@ -0,0 +1,4 @@
+Note: 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.
+
+FAIL Verify write and read clipboard (DataTransfer/text) function is not a constructor (evaluating 'new DataTransfer()')
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-write-dttext-read-dttext-manual.https.html b/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-write-dttext-read-dttext-manual.https.html
new file mode 100644 (file)
index 0000000..1fe946a
--- /dev/null
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Async Clipboard write (dt/text) -> read (dt/text) tests</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+async_test(function(t) {
+  var test_data = "Clipboard write (dt/text) -> read (dt/text) test data";
+  var cb = navigator.clipboard;
+  var dt = new DataTransfer();
+  dt.items.add(test_data, "text/plain");
+
+  cb.write(dt).then(t.step_func(() => {
+    cb.read().then(t.step_func((data) => {
+      assert_equals(data.items.length, 1);
+      data.items[0].getAsString(t.step_func((s) => {
+        assert_equals(s, test_data);
+        t.done();
+      }));
+    }), function() {
+      t.unreached_func("clipboard.read() fail");
+    });
+  }), function() {
+    t.unreached_func("clipboard.write() fail");
+  });
+}, "Verify write and read clipboard (DataTransfer/text)");
+</script>
+Note: 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/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-write-dttext-read-text-manual.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-write-dttext-read-text-manual.https-expected.txt
new file mode 100644 (file)
index 0000000..88fd795
--- /dev/null
@@ -0,0 +1,4 @@
+Note: 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.
+
+FAIL Verify write and read clipboard (DataTransfer/text) function is not a constructor (evaluating 'new DataTransfer()')
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-write-dttext-read-text-manual.https.html b/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-write-dttext-read-text-manual.https.html
new file mode 100644 (file)
index 0000000..b341d92
--- /dev/null
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Async Clipboard write (dt/text) -> readText tests</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+async_test(function(t) {
+  var test_data = "Clipboard write (dt/text) -> readText test data";
+  var cb = navigator.clipboard;
+  var dt = new DataTransfer();
+  dt.items.add(test_data, "text/plain");
+
+  cb.write(dt).then(t.step_func(() => {
+    cb.readText().then(t.step_func((data) => {
+      assert_equals(data, test_data);
+      t.done();
+    }), function() {
+      t.unreached_func("clipboard.read() fail");
+    });
+  }), function() {
+    t.unreached_func("clipboard.write() fail");
+  });
+}, "Verify write and read clipboard (DataTransfer/text)");
+</script>
+Note: 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/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-write-text-read-dttext-manual.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-write-text-read-dttext-manual.https-expected.txt
new file mode 100644 (file)
index 0000000..1bd996f
--- /dev/null
@@ -0,0 +1,6 @@
+Note: 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.
+
+Harness Error (TIMEOUT), message = null
+
+TIMEOUT Verify write and read clipboard (DOMString) Test timed out
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-write-text-read-dttext-manual.https.html b/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-write-text-read-dttext-manual.https.html
new file mode 100644 (file)
index 0000000..ab11ab9
--- /dev/null
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Async Clipboard writeText -> read (dt/text) tests</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+async_test(function(t) {
+  var test_data = "Clipboard writeText -> read(dt/text) test data";
+  var cb = navigator.clipboard;
+  cb.writeText(test_data).then(t.step_func(() => {
+    cb.read().then(t.step_func((data) => {
+      assert_equals(data.items.length, 1);
+      data.items[0].getAsString(t.step_func((s) => {
+        assert_equals(s, test_data);
+        t.done();
+      }));
+    }), function() {
+      t.unreached_func("clipboard.read() fail");
+    });
+  }), function() {
+    t.unreached_func("clipboard.writeText() fail");
+  });
+}, "Verify write and read clipboard (DOMString)");
+</script>
+Note: 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/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-write-text-read-text-manual.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-write-text-read-text-manual.https-expected.txt
new file mode 100644 (file)
index 0000000..1bd996f
--- /dev/null
@@ -0,0 +1,6 @@
+Note: 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.
+
+Harness Error (TIMEOUT), message = null
+
+TIMEOUT Verify write and read clipboard (DOMString) Test timed out
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-write-text-read-text-manual.https.html b/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-write-text-read-text-manual.https.html
new file mode 100644 (file)
index 0000000..a557216
--- /dev/null
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Async Clipboard writeText -> readText tests</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+async_test(function(t) {
+  var test_data = "Clipboard writeText -> readText test data";
+  var cb = navigator.clipboard;
+  cb.writeText(test_data).then(t.step_func(() => {
+    cb.readText().then(t.step_func((data) => {
+      assert_equals(data, test_data);
+      t.done();
+    }), function() {
+      t.unreached_func("clipboard.readText() fail");
+    });
+  }), function() {
+    t.unreached_func("clipboard.writeText() fail");
+  });
+}, "Verify write and read clipboard (DOMString)");
+</script>
+Note: 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/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/clipboard-events-synthetic-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/clipboard-events-synthetic-expected.txt
new file mode 100644 (file)
index 0000000..8a55591
--- /dev/null
@@ -0,0 +1,11 @@
+
+PASS Unspecified synthetic copy event should not be composed. 
+PASS Synthetic copy event can be explicitly composed. 
+PASS Synthetic copy event can be explicitly uncomposed. 
+PASS Unspecified synthetic cut event should not be composed. 
+PASS Synthetic cut event can be explicitly composed. 
+PASS Synthetic cut event can be explicitly uncomposed. 
+PASS Unspecified synthetic paste event should not be composed. 
+PASS Synthetic paste event can be explicitly composed. 
+PASS Synthetic paste event can be explicitly uncomposed. 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/clipboard-events-synthetic.html b/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/clipboard-events-synthetic.html
new file mode 100644 (file)
index 0000000..00f32ae
--- /dev/null
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<title>synthetic clipboard events should not be composed</title>
+<link rel="help" href="https://w3c.github.io/clipboard-apis/#clipboard-event-copy">
+<link rel="help" href="https://w3c.github.io/clipboard-apis/#clipboard-event-cut">
+<link rel="help" href="https://w3c.github.io/clipboard-apis/#clipboard-event-paste">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+const EVENTS = [ 'copy', 'cut', 'paste' ];
+
+EVENTS.forEach(name => {
+  function testEvent(name, init, composed_flag_expectation, name) {
+    async_test(function(test) {
+      document.addEventListener(name, test.step_func_done((e) => {
+        assert_false(e.isTrusted, `synthetic ${name} event is untrusted`);
+        assert_equals(e.composed, composed_flag_expectation,
+                      `composed flag should be ${composed_flag_expectation}`);
+      }));
+      let event = new ClipboardEvent(name, init);
+      document.dispatchEvent(event);
+    }, name);
+  }
+
+  testEvent(name, { bubbles: true, cancellable: true}, false,
+            `Unspecified synthetic ${name} event should not be composed.`);
+  testEvent(name, { bubbles: true, cancelable: true, composed: true }, true,
+            `Synthetic ${name} event can be explicitly composed.`);
+  testEvent(name, { bubbles: true, cancelable: true, composed: false }, false,
+            `Synthetic ${name} event can be explicitly uncomposed.`);
+});
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/w3c-import.log
new file mode 100644 (file)
index 0000000..9e34650
--- /dev/null
@@ -0,0 +1,24 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the WPT github:
+       https://github.com/web-platform-tests/wpt
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/META.yml
+/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-interfaces.https.html
+/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-navigator-clipboard-basics.https.html
+/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-write-dttext-read-dttext-manual.https.html
+/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-write-dttext-read-text-manual.https.html
+/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-write-text-read-dttext-manual.https.html
+/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/async-write-text-read-text-manual.https.html
+/LayoutTests/imported/w3c/web-platform-tests/clipboard-apis/clipboard-events-synthetic.html
diff --git a/LayoutTests/platform/ios-wk1/imported/w3c/web-platform-tests/clipboard-apis/async-interfaces.https-expected.txt b/LayoutTests/platform/ios-wk1/imported/w3c/web-platform-tests/clipboard-apis/async-interfaces.https-expected.txt
new file mode 100644 (file)
index 0000000..e86c4a4
--- /dev/null
@@ -0,0 +1,46 @@
+
+PASS Test driver 
+PASS Partial interface Navigator: original interface defined 
+FAIL Navigator interface: attribute clipboard assert_true: The prototype object must have a property "clipboard" expected true got false
+FAIL Navigator interface: navigator must inherit property "clipboard" with the proper type assert_inherits: property "clipboard" not found in prototype chain
+PASS ClipboardEvent interface: existence and properties of interface object 
+PASS ClipboardEvent interface object length 
+PASS ClipboardEvent interface object name 
+PASS ClipboardEvent interface: existence and properties of interface prototype object 
+PASS ClipboardEvent interface: existence and properties of interface prototype object's "constructor" property 
+PASS ClipboardEvent interface: existence and properties of interface prototype object's @@unscopables property 
+PASS ClipboardEvent interface: attribute clipboardData 
+PASS ClipboardEvent must be primary interface of new ClipboardEvent("x") 
+PASS Stringification of new ClipboardEvent("x") 
+PASS ClipboardEvent interface: new ClipboardEvent("x") must inherit property "clipboardData" with the proper type 
+FAIL Clipboard interface: existence and properties of interface object assert_own_property: self does not have own property "Clipboard" expected property "Clipboard" missing
+FAIL Clipboard interface object length assert_own_property: self does not have own property "Clipboard" expected property "Clipboard" missing
+FAIL Clipboard interface object name assert_own_property: self does not have own property "Clipboard" expected property "Clipboard" missing
+FAIL Clipboard interface: existence and properties of interface prototype object assert_own_property: self does not have own property "Clipboard" expected property "Clipboard" missing
+FAIL Clipboard interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "Clipboard" expected property "Clipboard" missing
+FAIL Clipboard interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "Clipboard" expected property "Clipboard" missing
+FAIL Clipboard interface: operation read() assert_own_property: self does not have own property "Clipboard" expected property "Clipboard" missing
+FAIL Clipboard interface: operation readText() assert_own_property: self does not have own property "Clipboard" expected property "Clipboard" missing
+FAIL Clipboard interface: operation write(ClipboardItems) assert_own_property: self does not have own property "Clipboard" expected property "Clipboard" missing
+FAIL Clipboard interface: operation writeText(DOMString) assert_own_property: self does not have own property "Clipboard" expected property "Clipboard" missing
+FAIL Clipboard must be primary interface of navigator.clipboard assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL Stringification of navigator.clipboard assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL Clipboard interface: navigator.clipboard must inherit property "read()" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL Clipboard interface: navigator.clipboard must inherit property "readText()" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL Clipboard interface: navigator.clipboard must inherit property "write(ClipboardItems)" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL Clipboard interface: calling write(ClipboardItems) on navigator.clipboard with too few arguments must throw TypeError assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL Clipboard interface: navigator.clipboard must inherit property "writeText(DOMString)" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL Clipboard interface: calling writeText(DOMString) on navigator.clipboard with too few arguments must throw TypeError assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL ClipboardItem interface: existence and properties of interface object assert_own_property: self does not have own property "ClipboardItem" expected property "ClipboardItem" missing
+FAIL ClipboardItem interface object length assert_own_property: self does not have own property "ClipboardItem" expected property "ClipboardItem" missing
+FAIL ClipboardItem interface object name assert_own_property: self does not have own property "ClipboardItem" expected property "ClipboardItem" missing
+FAIL ClipboardItem interface: existence and properties of interface prototype object assert_own_property: self does not have own property "ClipboardItem" expected property "ClipboardItem" missing
+FAIL ClipboardItem interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "ClipboardItem" expected property "ClipboardItem" missing
+FAIL ClipboardItem interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "ClipboardItem" expected property "ClipboardItem" missing
+FAIL ClipboardItem interface: operation createDelayed([object Object],[object Object], ClipboardItemOptions) assert_own_property: self does not have own property "ClipboardItem" expected property "ClipboardItem" missing
+FAIL ClipboardItem interface: attribute presentationStyle assert_own_property: self does not have own property "ClipboardItem" expected property "ClipboardItem" missing
+FAIL ClipboardItem interface: attribute lastModified assert_own_property: self does not have own property "ClipboardItem" expected property "ClipboardItem" missing
+FAIL ClipboardItem interface: attribute delayed assert_own_property: self does not have own property "ClipboardItem" expected property "ClipboardItem" missing
+FAIL ClipboardItem interface: attribute types assert_own_property: self does not have own property "ClipboardItem" expected property "ClipboardItem" missing
+FAIL ClipboardItem interface: operation getType(DOMString) assert_own_property: self does not have own property "ClipboardItem" expected property "ClipboardItem" missing
+
diff --git a/LayoutTests/platform/ios-wk1/imported/w3c/web-platform-tests/clipboard-apis/async-navigator-clipboard-basics.https-expected.txt b/LayoutTests/platform/ios-wk1/imported/w3c/web-platform-tests/clipboard-apis/async-navigator-clipboard-basics.https-expected.txt
new file mode 100644 (file)
index 0000000..38fb1ea
--- /dev/null
@@ -0,0 +1,11 @@
+
+FAIL navigator.clipboard exists assert_not_equals: got disallowed value undefined
+FAIL navigator.clipboard.write(DataTransfer) succeeds function is not a constructor (evaluating 'new DataTransfer()')
+FAIL navigator.clipboard.write() fails (expect DataTransfer) undefined is not an object (evaluating 'navigator.clipboard.write')
+FAIL navigator.clipboard.write(null) fails (expect DataTransfer) undefined is not an object (evaluating 'navigator.clipboard.write')
+FAIL navigator.clipboard.write(DOMString) fails (expect DataTransfer) undefined is not an object (evaluating 'navigator.clipboard.write')
+FAIL navigator.clipboard.writeText(DOMString) succeeds undefined is not an object (evaluating 'navigator.clipboard.writeText')
+FAIL navigator.clipboard.writeText() fails (expect DOMString) undefined is not an object (evaluating 'navigator.clipboard.writeText')
+FAIL navigator.clipboard.read() succeeds undefined is not an object (evaluating 'navigator.clipboard.read')
+FAIL navigator.clipboard.readText() succeeds undefined is not an object (evaluating 'navigator.clipboard.readText')
+
diff --git a/LayoutTests/platform/ios-wk1/imported/w3c/web-platform-tests/clipboard-apis/async-write-text-read-dttext-manual.https-expected.txt b/LayoutTests/platform/ios-wk1/imported/w3c/web-platform-tests/clipboard-apis/async-write-text-read-dttext-manual.https-expected.txt
new file mode 100644 (file)
index 0000000..776ad21
--- /dev/null
@@ -0,0 +1,4 @@
+Note: 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.
+
+FAIL Verify write and read clipboard (DOMString) undefined is not an object (evaluating 'cb.writeText')
+
diff --git a/LayoutTests/platform/ios-wk1/imported/w3c/web-platform-tests/clipboard-apis/async-write-text-read-text-manual.https-expected.txt b/LayoutTests/platform/ios-wk1/imported/w3c/web-platform-tests/clipboard-apis/async-write-text-read-text-manual.https-expected.txt
new file mode 100644 (file)
index 0000000..776ad21
--- /dev/null
@@ -0,0 +1,4 @@
+Note: 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.
+
+FAIL Verify write and read clipboard (DOMString) undefined is not an object (evaluating 'cb.writeText')
+
diff --git a/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/clipboard-apis/async-interfaces.https-expected.txt b/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/clipboard-apis/async-interfaces.https-expected.txt
new file mode 100644 (file)
index 0000000..e86c4a4
--- /dev/null
@@ -0,0 +1,46 @@
+
+PASS Test driver 
+PASS Partial interface Navigator: original interface defined 
+FAIL Navigator interface: attribute clipboard assert_true: The prototype object must have a property "clipboard" expected true got false
+FAIL Navigator interface: navigator must inherit property "clipboard" with the proper type assert_inherits: property "clipboard" not found in prototype chain
+PASS ClipboardEvent interface: existence and properties of interface object 
+PASS ClipboardEvent interface object length 
+PASS ClipboardEvent interface object name 
+PASS ClipboardEvent interface: existence and properties of interface prototype object 
+PASS ClipboardEvent interface: existence and properties of interface prototype object's "constructor" property 
+PASS ClipboardEvent interface: existence and properties of interface prototype object's @@unscopables property 
+PASS ClipboardEvent interface: attribute clipboardData 
+PASS ClipboardEvent must be primary interface of new ClipboardEvent("x") 
+PASS Stringification of new ClipboardEvent("x") 
+PASS ClipboardEvent interface: new ClipboardEvent("x") must inherit property "clipboardData" with the proper type 
+FAIL Clipboard interface: existence and properties of interface object assert_own_property: self does not have own property "Clipboard" expected property "Clipboard" missing
+FAIL Clipboard interface object length assert_own_property: self does not have own property "Clipboard" expected property "Clipboard" missing
+FAIL Clipboard interface object name assert_own_property: self does not have own property "Clipboard" expected property "Clipboard" missing
+FAIL Clipboard interface: existence and properties of interface prototype object assert_own_property: self does not have own property "Clipboard" expected property "Clipboard" missing
+FAIL Clipboard interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "Clipboard" expected property "Clipboard" missing
+FAIL Clipboard interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "Clipboard" expected property "Clipboard" missing
+FAIL Clipboard interface: operation read() assert_own_property: self does not have own property "Clipboard" expected property "Clipboard" missing
+FAIL Clipboard interface: operation readText() assert_own_property: self does not have own property "Clipboard" expected property "Clipboard" missing
+FAIL Clipboard interface: operation write(ClipboardItems) assert_own_property: self does not have own property "Clipboard" expected property "Clipboard" missing
+FAIL Clipboard interface: operation writeText(DOMString) assert_own_property: self does not have own property "Clipboard" expected property "Clipboard" missing
+FAIL Clipboard must be primary interface of navigator.clipboard assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL Stringification of navigator.clipboard assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL Clipboard interface: navigator.clipboard must inherit property "read()" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL Clipboard interface: navigator.clipboard must inherit property "readText()" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL Clipboard interface: navigator.clipboard must inherit property "write(ClipboardItems)" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL Clipboard interface: calling write(ClipboardItems) on navigator.clipboard with too few arguments must throw TypeError assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL Clipboard interface: navigator.clipboard must inherit property "writeText(DOMString)" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL Clipboard interface: calling writeText(DOMString) on navigator.clipboard with too few arguments must throw TypeError assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL ClipboardItem interface: existence and properties of interface object assert_own_property: self does not have own property "ClipboardItem" expected property "ClipboardItem" missing
+FAIL ClipboardItem interface object length assert_own_property: self does not have own property "ClipboardItem" expected property "ClipboardItem" missing
+FAIL ClipboardItem interface object name assert_own_property: self does not have own property "ClipboardItem" expected property "ClipboardItem" missing
+FAIL ClipboardItem interface: existence and properties of interface prototype object assert_own_property: self does not have own property "ClipboardItem" expected property "ClipboardItem" missing
+FAIL ClipboardItem interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "ClipboardItem" expected property "ClipboardItem" missing
+FAIL ClipboardItem interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "ClipboardItem" expected property "ClipboardItem" missing
+FAIL ClipboardItem interface: operation createDelayed([object Object],[object Object], ClipboardItemOptions) assert_own_property: self does not have own property "ClipboardItem" expected property "ClipboardItem" missing
+FAIL ClipboardItem interface: attribute presentationStyle assert_own_property: self does not have own property "ClipboardItem" expected property "ClipboardItem" missing
+FAIL ClipboardItem interface: attribute lastModified assert_own_property: self does not have own property "ClipboardItem" expected property "ClipboardItem" missing
+FAIL ClipboardItem interface: attribute delayed assert_own_property: self does not have own property "ClipboardItem" expected property "ClipboardItem" missing
+FAIL ClipboardItem interface: attribute types assert_own_property: self does not have own property "ClipboardItem" expected property "ClipboardItem" missing
+FAIL ClipboardItem interface: operation getType(DOMString) assert_own_property: self does not have own property "ClipboardItem" expected property "ClipboardItem" missing
+
diff --git a/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/clipboard-apis/async-navigator-clipboard-basics.https-expected.txt b/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/clipboard-apis/async-navigator-clipboard-basics.https-expected.txt
new file mode 100644 (file)
index 0000000..38fb1ea
--- /dev/null
@@ -0,0 +1,11 @@
+
+FAIL navigator.clipboard exists assert_not_equals: got disallowed value undefined
+FAIL navigator.clipboard.write(DataTransfer) succeeds function is not a constructor (evaluating 'new DataTransfer()')
+FAIL navigator.clipboard.write() fails (expect DataTransfer) undefined is not an object (evaluating 'navigator.clipboard.write')
+FAIL navigator.clipboard.write(null) fails (expect DataTransfer) undefined is not an object (evaluating 'navigator.clipboard.write')
+FAIL navigator.clipboard.write(DOMString) fails (expect DataTransfer) undefined is not an object (evaluating 'navigator.clipboard.write')
+FAIL navigator.clipboard.writeText(DOMString) succeeds undefined is not an object (evaluating 'navigator.clipboard.writeText')
+FAIL navigator.clipboard.writeText() fails (expect DOMString) undefined is not an object (evaluating 'navigator.clipboard.writeText')
+FAIL navigator.clipboard.read() succeeds undefined is not an object (evaluating 'navigator.clipboard.read')
+FAIL navigator.clipboard.readText() succeeds undefined is not an object (evaluating 'navigator.clipboard.readText')
+
diff --git a/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/clipboard-apis/async-write-text-read-dttext-manual.https-expected.txt b/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/clipboard-apis/async-write-text-read-dttext-manual.https-expected.txt
new file mode 100644 (file)
index 0000000..776ad21
--- /dev/null
@@ -0,0 +1,4 @@
+Note: 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.
+
+FAIL Verify write and read clipboard (DOMString) undefined is not an object (evaluating 'cb.writeText')
+
diff --git a/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/clipboard-apis/async-write-text-read-text-manual.https-expected.txt b/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/clipboard-apis/async-write-text-read-text-manual.https-expected.txt
new file mode 100644 (file)
index 0000000..776ad21
--- /dev/null
@@ -0,0 +1,4 @@
+Note: 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.
+
+FAIL Verify write and read clipboard (DOMString) undefined is not an object (evaluating 'cb.writeText')
+