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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/powerfulFeatureRestrictions/webshare-on-insecure-origin.html

Issue 2349253004: Restrict WebShare to secure contexts. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webshare/NavigatorShare.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/security/powerfulFeatureRestrictions/webshare-on-insecure-origin.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/powerfulFeatureRestrictions/webshare-on-insecure-origin.html b/third_party/WebKit/LayoutTests/http/tests/security/powerfulFeatureRestrictions/webshare-on-insecure-origin.html
new file mode 100644
index 0000000000000000000000000000000000000000..cf813cd9c398d79dbf0ce6897ed5ccc42912c4ab
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/security/powerfulFeatureRestrictions/webshare-on-insecure-origin.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/resources/get-host-info.js"></script>
+<script src="/js-test-resources/mojo-helpers.js"></script>
+<script src="/webshare/js-test-resources/mock-share-service.js"></script>
+<script>
+if (window.location.origin != get_host_info().UNAUTHENTICATED_ORIGIN) {
+ window.location = get_host_info().UNAUTHENTICATED_ORIGIN + window.location.pathname;
+} else {
+ share_test((t, mock) => {
+ return callWithKeyDown(() => promise_rejects(
+ t, 'SecurityError', navigator.share({})));
+ }, "Requires secure context");
+}
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webshare/NavigatorShare.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698