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