| 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();
|
|
|