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

Side by Side 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, 9 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 <script src="../resources/mojo-helpers.js"></script> 4 <script src="../resources/mojo-helpers.js"></script>
5 <script src="resources/mock-share-service.js"></script> 5 <script src="resources/mock-share-service.js"></script>
6 <script> 6 <script>
7 7
8 share_test((t, mock) => { 8 share_test((t, webshare, mock) => {
9 mock.pushShareResult('the title', 'the message', 'data:the url', 'error from b rowser'); 9 mock.pushShareResult('the title', 'the message', 'data:the url',
10 webshare.ShareError.CANCELED);
11 // promise_rejects doesn't test the exception message, so just undefined.
10 return callWithKeyDown(() => promise_rejects( 12 return callWithKeyDown(() => promise_rejects(
11 t, new DOMException('error from browser', 'AbortError'), 13 t, new DOMException(undefined, 'AbortError'),
12 navigator.share({title: 'the title', text: 'the message', url: 'data:the u rl'}))); 14 navigator.share({title: 'the title', text: 'the message', url: 'data:the u rl'})));
13 }, 'share with browser-side error'); 15 }, 'share with user cancellation');
16
17 share_test((t, webshare, mock) => {
18 mock.pushShareResult('the title', 'the message', 'data:the url',
19 webshare.ShareError.INTERNAL_ERROR);
20 return callWithKeyDown(() => promise_rejects(
21 t, new DOMException(undefined, 'AbortError'),
22 navigator.share({title: 'the title', text: 'the message', url: 'data:the u rl'})));
23 }, 'share with invalid url template');
14 24
15 </script> 25 </script>
OLDNEW
« 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