OLD | NEW |
(Empty) | |
| 1 // Any copyright is dedicated to the Public Domain. |
| 2 // http://creativecommons.org/publicdomain/zero/1.0/ |
| 3 |
| 4 if (self.importScripts) { |
| 5 importScripts('helpers.js'); |
| 6 |
| 7 if (get_current_scope() == 'ServiceWorker') |
| 8 importScripts('../../serviceworker/resources/worker-testharness.js'); |
| 9 else |
| 10 importScripts('../../resources/testharness.js'); |
| 11 } |
| 12 |
| 13 async_test(function(test) { |
| 14 Permissions.query('geolocation').then(function() { |
| 15 assert_unreached('Permissions.query() should not succeed (for now).') |
| 16 }, function(e) { |
| 17 assert_true(e instanceof DOMException); |
| 18 assert_equals('NotSupportedError', e.name); |
| 19 }).then(function() { |
| 20 test.done(); |
| 21 }); |
| 22 }, 'Check the Permissions.query() normal behavior in ' + get_current_scope() + '
scope.'); |
| 23 |
| 24 async_test(function(test) { |
| 25 Permissions.query('unknown-keyword').then(function() { |
| 26 assert_unreached('Permissions.query() should not succeed (for now).') |
| 27 }, function(e) { |
| 28 assert_true(e instanceof TypeError); |
| 29 assert_equals('TypeError', e.name); |
| 30 }).then(function() { |
| 31 test.done(); |
| 32 }); |
| 33 }, 'Check the Permissions.query() with wrong keyword in ' + get_current_scope()
+ ' scope.'); |
| 34 |
| 35 done(); |
OLD | NEW |