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

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

Issue 1057283002: Permissions: use newly supported required attribute on Dictionary properties. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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 | Source/modules/permissions/PermissionDescriptor.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/permissions/resources/test-query.js
diff --git a/LayoutTests/http/tests/permissions/resources/test-query.js b/LayoutTests/http/tests/permissions/resources/test-query.js
index db750cda5d23d9fcea20c9ed3f283436bfc606ff..92ea73187ec1977cbf5bce901a033c9acb705cd6 100644
--- a/LayoutTests/http/tests/permissions/resources/test-query.js
+++ b/LayoutTests/http/tests/permissions/resources/test-query.js
@@ -8,6 +8,23 @@ if (self.importScripts) {
}
async_test(function(test) {
+ // Querying a random permission name should fail.
+ navigator.permissions.query({name:'foobar'}).then(function(result) {
+ assert_unreached('querying a random permission should fail');
+ }, function(error) {
+ assert_equals(error.name, 'TypeError');
+
+ // Querying a permission without a name should fail.
+ return navigator.permissions.query({});
+ }).then(function(result) {
+ assert_unreached('querying a permission without a name should fail');
+ }, function(error) {
+ assert_equals(error.name, 'TypeError');
+ test.done();
+ });
+}, 'Test PermissionDescription WebIDL rules in ' + get_current_scope() + ' scope.');
+
+async_test(function(test) {
navigator.permissions.query({name:'geolocation'}).then(function(result) {
// TODO(mlamouri): test values when some instrumentation are available.
assert_true(result instanceof PermissionStatus);
« no previous file with comments | « no previous file | Source/modules/permissions/PermissionDescriptor.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698