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

Side by Side Diff: third_party/WebKit/LayoutTests/webshare/share-arity.html

Issue 2207343002: Update navigator.share API to match draft specs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webshare/share-error.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, mock) => {
9 return promise_rejects(t, new TypeError(), navigator.share()); 9 return promise_rejects(t, new TypeError(), navigator.share());
10 }, '0 arguments (promise rejection)'); 10 }, '0 arguments (promise rejection)');
11 11
12 share_test((t, mock) => { 12 share_test((t, mock) => {
13 return promise_rejects(t, new TypeError(), navigator.share('the title')); 13 mock.pushShareResult('the title', 'the message', null);
14 }, '1 argument (promise rejection)'); 14 return navigator.share({title: 'the title', text: 'the message', unused: 'unex pected field'});
15 }, 'extra ShareData field (extra field ignored)');
15 16
16 share_test((t, mock) => { 17 share_test((t, mock) => {
17 mock.pushShareResult('the title', 'the message', null); 18 mock.pushShareResult('the title', 'the message', null);
18 return navigator.share('the title', 'the message', 'more than required'); 19 return navigator.share({title: 'the title', text: 'the message'}, 'more than r equired');
19 }, '3 arguments (extra argument ignored)'); 20 }, '2 arguments (extra argument ignored)');
20 21
21 </script> 22 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webshare/share-error.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698