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

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

Issue 804553003: Implement Permissions.query() and static PermissionStatus. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review comments Created 5 years, 9 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/modules/modules.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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();
OLDNEW
« no previous file with comments | « no previous file | Source/modules/modules.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698