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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/usb/insecure-context.html

Issue 2698083008: Make the navigator.usb attribute accessible only in secure contexts. (Closed)
Patch Set: Moved [NoInterfaceObject] change to a separate patch. Created 3 years, 10 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
Index: third_party/WebKit/LayoutTests/http/tests/usb/insecure-context.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/usb/insecure-context.html b/third_party/WebKit/LayoutTests/http/tests/usb/insecure-context.html
new file mode 100644
index 0000000000000000000000000000000000000000..06afc29e628b32f349c060c4796a9a6a39a7f3e3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/usb/insecure-context.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/resources/get-host-info.js"></script>
+<script>
+'use strict';
+
+if (window.location.origin != get_host_info().UNAUTHENTICATED_ORIGIN) {
+ window.location = get_host_info().UNAUTHENTICATED_ORIGIN +
+ window.location.pathname;
+} else {
+ test(t => {
+ assert_false(window.isSecureContext);
+ assert_true(navigator.usb == undefined);
+ }, 'navigator.usb is not present in an insecure context');
+}
+</script>

Powered by Google App Engine
This is Rietveld 408576698