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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/permissions/resources/test-query.js

Issue 2458453002: [sensors] Add Permission guard to the generic sensor apis.
Patch Set: Mikhail+alex comments Created 4 years, 1 month 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/permissions/resources/test-query.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/permissions/resources/test-query.js b/third_party/WebKit/LayoutTests/http/tests/permissions/resources/test-query.js
index fe16ccd5b08f617412692929c64cd9eac1a233c9..674715d9e3d8b8f5991e774a67b4d3363ac748ed 100644
--- a/third_party/WebKit/LayoutTests/http/tests/permissions/resources/test-query.js
+++ b/third_party/WebKit/LayoutTests/http/tests/permissions/resources/test-query.js
@@ -35,6 +35,16 @@ async_test(function(test) {
}, 'Test geolocation permission in ' + get_current_scope() + ' scope.');
async_test(function(test) {
+ navigator.permissions.query({name:'sensors'}).then(function(result) {
+ assert_true(result instanceof PermissionStatus);
+ assert_equals(result.state, 'denied');
+ test.done();
+ }).catch(function() {
+ assert_unreached('querying sensors permission should not fail.')
+ });
+}, 'Test sensors permission in ' + get_current_scope() + ' scope.');
+
+async_test(function(test) {
navigator.permissions.query({name:'midi'}).then(function(result) {
assert_true(result instanceof PermissionStatus);
assert_equals(result.state, 'denied');

Powered by Google App Engine
This is Rietveld 408576698