blob: b563ccb0ab19db8b2750b56e9ad6e466e012f3bf [file] [log] [blame]
<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="../resources/mojo-helpers.js"></script>
<script src="resources/mock-share-service.js"></script>
<script>
share_test((t, mock) => {
return callWithKeyDown(() => promise_rejects(t, new TypeError(), navigator.share()));
}, '0 arguments (promise rejection)');
share_test((t, mock) => {
mock.pushShareResult('the title', 'the message', 'data:the url', null);
return callWithKeyDown(() => navigator.share({title: 'the title', text: 'the message', url: 'data:the url', unused: 'unexpected field'}));
}, 'extra ShareData field (extra field ignored)');
share_test((t, mock) => {
mock.pushShareResult('the title', 'the message', 'data:the url', null);
return callWithKeyDown(() => navigator.share({title: 'the title', text: 'the message', url: 'data:the url'}, 'more than required'));
}, '2 arguments (extra argument ignored)');
</script>