haikuwebkit/LayoutTests/fast/web-share/share-canShare-insecure.html

25 lines
666 B
HTML
Raw Permalink Normal View History

Add canShare function for Web Share API v2 https://bugs.webkit.org/show_bug.cgi?id=207491 Patch by Nikos Mouchtaris <nmouchtaris@apple.com> on 2020-02-24 Reviewed by Tim Horton. LayoutTests/imported/w3c: Imported new web platform tests for canShare function. * resources/import-expectations.json: * web-platform-tests/web-share/OWNERS: Removed. * web-platform-tests/web-share/idlharness.https.html: Removed. * web-platform-tests/web-share/resources/manual-helper.js: (setupManualShareTest): (callWhenButtonClicked): * web-platform-tests/web-share/resources/w3c-import.log: * web-platform-tests/web-share/share-empty.https.html: * web-platform-tests/web-share/share-url-invalid.https.html: * web-platform-tests/web-share/share-without-user-gesture.https.html: * web-platform-tests/web-share/w3c-import.log: Source/WebCore: Added files member to share data and canShare function to navigator.cpp. Can share function should always be used before call to share, and can be used to check if file sharing is implemented by passing a share data object with only files. Imported new Web Platform Tests to test new function. * page/Navigator.cpp: (WebCore::Navigator::canShare): Will currently return false for only file share data objects, since file sharing is currently not implemented. (WebCore::Navigator::share): Changed to use canShare to determine if data is shareable. * page/Navigator.h: * page/NavigatorShare.idl: * page/ShareData.h: * page/ShareData.idl: Canonical link: https://commits.webkit.org/221110@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257289 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-02-25 01:22:00 +00:00
<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
<head>
<title>PointerLock interface tests.</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../../resources/ui-helper.js"></script>
</head>
<body>
<div id="log"></div>
<script>
if (window.internals){
internals.markContextAsInsecure();
}
test(function() {
assert_false("canShare" in navigator);
},'canShare should not exist in insecure context');
test(function() {
assert_false("share" in navigator);
},'share should not exist in insecure context');
</script>
</body>
</html>