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

Unified Diff: third_party/WebKit/LayoutTests/webshare/share-error.html

Issue 2703333002: Web Share: Refactor Mojo interface to now return an enum error. (Closed)
Patch Set: Created 3 years, 10 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/webshare/share-error.html
diff --git a/third_party/WebKit/LayoutTests/webshare/share-error.html b/third_party/WebKit/LayoutTests/webshare/share-error.html
index a59ffc6691805f1466d10d00c51f30774e5d647d..c1697e9b5a2084068304b1d67d6fdf4418fcf3cb 100644
--- a/third_party/WebKit/LayoutTests/webshare/share-error.html
+++ b/third_party/WebKit/LayoutTests/webshare/share-error.html
@@ -6,10 +6,20 @@
<script>
share_test((t, mock) => {
- mock.pushShareResult('the title', 'the message', 'data:the url', 'error from browser');
+ mock.pushShareResult('the title', 'the message', 'data:the url',
+ ShareError.CANCELED);
+ // promise_rejects doesn't test the exception message, so just undefined.
return callWithKeyDown(() => promise_rejects(
- t, new DOMException('error from browser', 'AbortError'),
+ t, new DOMException(undefined, 'AbortError'),
navigator.share({title: 'the title', text: 'the message', url: 'data:the url'})));
-}, 'share with browser-side error');
+}, 'share with user cancellation');
+
+share_test((t, mock) => {
+ mock.pushShareResult('the title', 'the message', 'data:the url',
+ ShareError.INVALID_TEMPLATE);
+ return callWithKeyDown(() => promise_rejects(
+ t, new DOMException(undefined, 'AbortError'),
+ navigator.share({title: 'the title', text: 'the message', url: 'data:the url'})));
+}, 'share with invalid url template');
</script>

Powered by Google App Engine
This is Rietveld 408576698