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

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

Issue 2309403002: Use the URL passed to navigator.share(). (Closed)
Patch Set: rebase Created 4 years, 3 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, 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, mock) => {
13 mock.pushShareResult('the title', 'the message', null); 13 mock.pushShareResult('the title', 'the message', 'data:the url', null);
14 return callWithKeyDown(() => navigator.share({title: 'the title', text: 'the m essage', 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, mock) => {
18 mock.pushShareResult('the title', 'the message', null); 18 mock.pushShareResult('the title', 'the message', 'data:the url', null);
19 return callWithKeyDown(() => navigator.share({title: 'the title', text: 'the m essage'}, '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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698