Index: third_party/WebKit/LayoutTests/webshare/share-arity.html |
diff --git a/third_party/WebKit/LayoutTests/webshare/share-arity.html b/third_party/WebKit/LayoutTests/webshare/share-arity.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7ba23f1a94f64938734e8b7a18c3bd8eb4f4caf0 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/webshare/share-arity.html |
@@ -0,0 +1,21 @@ |
+<!DOCTYPE html> |
+<script src="../resources/testharness.js"></script> |
+<script src="../resources/testharnessreport.js"></script> |
+<script src="../resources/mojo-helpers.js"></script> |
+<script src="resources/mock-share-service.js"></script> |
+<script> |
+ |
+share_test((t, mock) => { |
+ return promise_rejects(t, new TypeError(), navigator.share()); |
+}, '0 arguments (promise rejection)'); |
+ |
+share_test((t, mock) => { |
+ return promise_rejects(t, new TypeError(), navigator.share('the title')); |
+}, '1 argument (promise rejection)'); |
+ |
+share_test((t, mock) => { |
+ mock.pushShareResult('the title', 'the message', null); |
+ return navigator.share('the title', 'the message', 'more than required'); |
+}, '3 arguments (extra argument ignored)'); |
+ |
+</script> |