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

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: Fix assignment statement. #oops 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..070d9e76cd07d035f551fea346da7fc337db9f7c 100644
--- a/third_party/WebKit/LayoutTests/webshare/share-error.html
+++ b/third_party/WebKit/LayoutTests/webshare/share-error.html
@@ -5,11 +5,21 @@
<script src="resources/mock-share-service.js"></script>
<script>
-share_test((t, mock) => {
- mock.pushShareResult('the title', 'the message', 'data:the url', 'error from browser');
+share_test((t, webshare, mock) => {
+ mock.pushShareResult('the title', 'the message', 'data:the url',
+ webshare.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, webshare, mock) => {
+ mock.pushShareResult('the title', 'the message', 'data:the url',
+ webshare.ShareError.INTERNAL_ERROR);
+ 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>
« no previous file with comments | « third_party/WebKit/LayoutTests/webshare/share-arity.html ('k') | third_party/WebKit/LayoutTests/webshare/share-success.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698