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

Side by Side Diff: LayoutTests/http/tests/permissions/chromium/resources/test-change-event.js

Issue 1194963002: Add PermissionStatus.state and deprecate PermissionStatus.status. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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
OLDNEW
1 if (self.importScripts) { 1 if (self.importScripts) {
2 importScripts('../../resources/helpers.js'); 2 importScripts('../../resources/helpers.js');
3 importScripts('testrunner-helpers.js'); 3 importScripts('testrunner-helpers.js');
4 4
5 if (get_current_scope() == 'ServiceWorker') 5 if (get_current_scope() == 'ServiceWorker')
6 importScripts('../../../serviceworker/resources/worker-testharness.js'); 6 importScripts('../../../serviceworker/resources/worker-testharness.js');
7 else 7 else
8 importScripts('../../../resources/testharness.js'); 8 importScripts('../../../resources/testharness.js');
9 } 9 }
10 10
11 async_test(function(t) { 11 async_test(function(t) {
12 setPermission('geolocation', 'granted', location.origin, location.origin).th en(t.step_func(function() { 12 setPermission('geolocation', 'granted', location.origin, location.origin).th en(t.step_func(function() {
13 navigator.permissions.query({name:'geolocation'}).then(t.step_func(funct ion(p) { 13 navigator.permissions.query({name:'geolocation'}).then(t.step_func(funct ion(p) {
14 assert_equals(p.status, 'granted'); 14 assert_equals(p.state, 'granted');
whywhat 2015/06/22 10:42:46 Don't you want to make sure the deprecated but not
mlamouri (slow - plz ping) 2015/06/29 19:26:06 Given that the code is simplistic: just calling st
15 15
16 p.onchange = t.step_func(function() { 16 p.onchange = t.step_func(function() {
17 assert_equals(p.status, 'denied'); 17 assert_equals(p.state, 'denied');
18 18
19 p.onchange = t.step_func(function() { 19 p.onchange = t.step_func(function() {
20 assert_unreached('the permission should not change again.'); 20 assert_unreached('the permission should not change again.');
21 }); 21 });
22 22
23 setPermission('geolocation', 'prompt', 'https://example.com', 'h ttps://example.com'); 23 setPermission('geolocation', 'prompt', 'https://example.com', 'h ttps://example.com');
24 setPermission('geolocation', 'prompt', 'https://example.com', lo cation.origin); 24 setPermission('geolocation', 'prompt', 'https://example.com', lo cation.origin);
25 setPermission('geolocation', 'prompt', location.origin, 'https:/ /example.com'); 25 setPermission('geolocation', 'prompt', location.origin, 'https:/ /example.com');
26 26
27 navigator.permissions.query({name:'geolocation'}).then(t.step_fu nc(function(p) { 27 navigator.permissions.query({name:'geolocation'}).then(t.step_fu nc(function(p) {
28 assert_equals(p.status, 'denied'); 28 assert_equals(p.state, 'denied');
29 t.done(); 29 t.done();
30 })); 30 }));
31 }); 31 });
32 32
33 setPermission('geolocation', 'denied', location.origin, location.ori gin); 33 setPermission('geolocation', 'denied', location.origin, location.ori gin);
34 })); 34 }));
35 })); 35 }));
36 }, 'Testing that the change event is correctly sent. Scope: ' + get_current_scop e()); 36 }, 'Testing that the change event is correctly sent. Scope: ' + get_current_scop e());
37 37
38 done(); 38 done();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698