OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <title>Tests that all geofencing methods exposed on a service worker registratio
n always reject if no geofencing service is available.</title> | |
3 <script src="../resources/testharness.js"></script> | |
4 <script src="../resources/testharnessreport.js"></script> | |
5 <script src="../serviceworker/resources/test-helpers.js"></script> | |
6 <script> | |
7 var sw_url = 'resources/emptyworker.js'; | |
8 var sw_scope = 'resources/service-worker-scope' + window.location.pathname; | |
9 | |
10 testRunner.setGeofencingMockProvider(false); | |
11 | |
12 promise_test(function(test) { | |
13 return promise_rejects( | |
14 test, | |
15 'AbortError', | |
16 service_worker_unregister_and_register(test, sw_url, sw_scope + '/register
') | |
17 .then(function(r) { | |
18 return r.geofencing.registerRegion( | |
19 new CircularGeofencingRegion({latitude: 37.421999, | |
20 longitude: -122.084015})); | |
21 }), | |
22 'registerRegion should fail with an AbortError'); | |
23 }, 'registerRegion should fail'); | |
24 | |
25 promise_test(function(test) { | |
26 return promise_rejects( | |
27 test, | |
28 'AbortError', | |
29 service_worker_unregister_and_register(test, sw_url, sw_scope + '/unregist
er') | |
30 .then(function(r) { | |
31 return r.geofencing.unregisterRegion(''); | |
32 }), | |
33 'unregisterRegion should fail with an AbortError'); | |
34 }, 'unregisterRegion should fail'); | |
35 | |
36 promise_test(function(test) { | |
37 return promise_rejects( | |
38 test, | |
39 'AbortError', | |
40 service_worker_unregister_and_register(test, sw_url, sw_scope + '/getregio
ns') | |
41 .then(function(r) { | |
42 return r.geofencing.getRegisteredRegions(); | |
43 }), | |
44 'getRegisteredRegions should fail with an AbortError'); | |
45 }, 'getRegisteredRegions should fail'); | |
46 | |
47 </script> | |
OLD | NEW |