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

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

Issue 760223003: Stub implementation of Permissions API module. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix win compile Created 6 years 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: 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
new file mode 100644
index 0000000000000000000000000000000000000000..8ab2df9954c78c21d4415f6d21b1854e0f3c224a
--- /dev/null
+++ b/LayoutTests/http/tests/permissions/resources/test-query.js
@@ -0,0 +1,32 @@
+if (self.importScripts) {
+ importScripts('helpers.js');
+
+ if (get_current_scope() == 'ServiceWorker')
+ importScripts('../../serviceworker/resources/worker-testharness.js');
+ else
+ importScripts('../../resources/testharness.js');
+}
+
+async_test(function(test) {
+ Permissions.query('geolocation').then(function() {
+ assert_unreached('Permissions.query() should not succeed (for now).')
+ }, function(e) {
+ assert_true(e instanceof DOMException);
+ assert_equals('NotSupportedError', e.name);
+ }).then(function() {
+ test.done();
+ });
+}, 'Check the Permissions.query() normal behavior in ' + get_current_scope() + ' scope.');
+
+async_test(function(test) {
+ Permissions.query('unknown-keyword').then(function() {
+ assert_unreached('Permissions.query() should not succeed (for now).')
+ }, function(e) {
+ assert_true(e instanceof TypeError);
+ assert_equals('TypeError', e.name);
+ }).then(function() {
+ test.done();
+ });
+}, 'Check the Permissions.query() with wrong keyword in ' + get_current_scope() + ' scope.');
+
+done();

Powered by Google App Engine
This is Rietveld 408576698