| OLD | NEW |
| 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 return callWithKeyDown(() => promise_rejects(t, new TypeError(), navigator.sha
re())); | 9 return callWithKeyDown(() => promise_rejects(t, new TypeError(), navigator.sha
re())); |
| 10 }, '0 arguments (promise rejection)'); | 10 }, '0 arguments (promise rejection)'); |
| 11 | 11 |
| 12 share_test((t, mock) => { | 12 share_test((t, webshare, mock) => { |
| 13 mock.pushShareResult('the title', 'the message', 'data:the url', null); | 13 mock.pushShareResult('the title', 'the message', 'data:the url', webshare.Shar
eError.OK); |
| 14 return callWithKeyDown(() => navigator.share({title: 'the title', text: 'the m
essage', url: 'data:the url', unused: 'unexpected field'})); | 14 return callWithKeyDown(() => navigator.share({title: 'the title', text: 'the m
essage', url: 'data:the url', unused: 'unexpected field'})); |
| 15 }, 'extra ShareData field (extra field ignored)'); | 15 }, 'extra ShareData field (extra field ignored)'); |
| 16 | 16 |
| 17 share_test((t, mock) => { | 17 share_test((t, webshare, mock) => { |
| 18 mock.pushShareResult('the title', 'the message', 'data:the url', null); | 18 mock.pushShareResult('the title', 'the message', 'data:the url', webshare.Shar
eError.OK); |
| 19 return callWithKeyDown(() => navigator.share({title: 'the title', text: 'the m
essage', url: 'data:the url'}, 'more than required')); | 19 return callWithKeyDown(() => navigator.share({title: 'the title', text: 'the m
essage', url: 'data:the url'}, 'more than required')); |
| 20 }, '2 arguments (extra argument ignored)'); | 20 }, '2 arguments (extra argument ignored)'); |
| 21 | 21 |
| 22 </script> | 22 </script> |
| OLD | NEW |