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

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

Issue 2791623004: [sensors][permission] Add new permission types in permission module. (Closed)
Patch Set: Rebase + add blank line in ONWERS file. Created 3 years, 5 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/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..5bdec40b12e6407036989d34424350ce3d0cb451 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
@@ -25,6 +25,42 @@ async_test(function(test) {
}, 'Test PermissionDescription WebIDL rules in ' + get_current_scope() + ' scope.');
async_test(function(test) {
+ navigator.permissions.query({name:'ambient-light-sensor'}).then(function(result) {
+ assert_true(result instanceof PermissionStatus);
+ test.done();
+ }).catch(function() {
+ assert_unreached('querying ambient-light-sensor permission should not fail.')
+ });
+}, 'Test ambient-light-sensor permission in ' + get_current_scope() + ' scope.');
+
+async_test(function(test) {
+ navigator.permissions.query({name:'accelerometer'}).then(function(result) {
+ assert_true(result instanceof PermissionStatus);
+ test.done();
+ }).catch(function() {
+ assert_unreached('querying accelerometer permission should not fail.')
+ });
+}, 'Test accelerometer permission in ' + get_current_scope() + ' scope.');
+
+async_test(function(test) {
+ navigator.permissions.query({name:'gyroscope'}).then(function(result) {
+ assert_true(result instanceof PermissionStatus);
+ test.done();
+ }).catch(function() {
+ assert_unreached('querying gyroscope permission should not fail.')
+ });
+}, 'Test gyroscope permission in ' + get_current_scope() + ' scope.');
+
+async_test(function(test) {
+ navigator.permissions.query({name:'magnetometer'}).then(function(result) {
+ assert_true(result instanceof PermissionStatus);
+ test.done();
+ }).catch(function() {
+ assert_unreached('querying magnetometer permission should not fail.')
+ });
+}, 'Test magnetometer permission in ' + get_current_scope() + ' scope.');
+
+async_test(function(test) {
navigator.permissions.query({name:'geolocation'}).then(function(result) {
assert_true(result instanceof PermissionStatus);
assert_equals(result.state, 'denied');
« no previous file with comments | « content/public/browser/permission_type.h ('k') | third_party/WebKit/Source/modules/permissions/PermissionDescriptor.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698