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