chromium/third_party/blink/web_tests/http/tests/feature-policy/resources/feature-policy-web-share.html

<!DOCTYPE html>
<title>Feature-Policy web-share</title>
<div>web-share</div>
<script>

document.addEventListener('keypress', function() {
  navigator.share({}).catch(error => {
    parent.postMessage({ type: 'result', enabled: error.constructor === TypeError }, '*');
  });
});

window.onload = function() {
  focus();
  eventSender.keyDown('a', []);
}
</script>