OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Tests that all geofencing methods exposed on a service worker registratio
n always reject.</title> | 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> | 3 <script src="../resources/testharness.js"></script> |
4 <script src="../resources/testharnessreport.js"></script> | 4 <script src="../resources/testharnessreport.js"></script> |
5 <script src="../resources/testharness-helpers.js"></script> | 5 <script src="../resources/testharness-helpers.js"></script> |
6 <script src="../serviceworker/resources/test-helpers.js"></script> | 6 <script src="../serviceworker/resources/test-helpers.js"></script> |
7 <script> | 7 <script> |
8 var sw_url = 'resources/emptyworker.js'; | 8 var sw_url = 'resources/emptyworker.js'; |
9 var sw_scope = 'resources/service-worker-scope' + window.location.pathname; | 9 var sw_scope = 'resources/service-worker-scope' + window.location.pathname; |
10 | 10 |
| 11 testRunner.setGeofencingMockProvider(false); |
| 12 |
11 promise_test(function(test) { | 13 promise_test(function(test) { |
12 return assert_promise_rejects( | 14 return assert_promise_rejects( |
13 service_worker_unregister_and_register(test, sw_url, sw_scope + '/register
') | 15 service_worker_unregister_and_register(test, sw_url, sw_scope + '/register
') |
14 .then(function(r) { | 16 .then(function(r) { |
15 return r.geofencing.registerRegion( | 17 return r.geofencing.registerRegion( |
16 new CircularGeofencingRegion({latitude: 37.421999, | 18 new CircularGeofencingRegion({latitude: 37.421999, |
17 longitude: -122.084015})); | 19 longitude: -122.084015})); |
18 }), | 20 }), |
19 'AbortError', | 21 'AbortError', |
20 'registerRegion should fail with an AbortError'); | 22 'registerRegion should fail with an AbortError'); |
(...skipping 13 matching lines...) Expand all Loading... |
34 return assert_promise_rejects( | 36 return assert_promise_rejects( |
35 service_worker_unregister_and_register(test, sw_url, sw_scope + '/getregio
ns') | 37 service_worker_unregister_and_register(test, sw_url, sw_scope + '/getregio
ns') |
36 .then(function(r) { | 38 .then(function(r) { |
37 return r.geofencing.getRegisteredRegions(); | 39 return r.geofencing.getRegisteredRegions(); |
38 }), | 40 }), |
39 'AbortError', | 41 'AbortError', |
40 'getRegisteredRegions should fail with an AbortError'); | 42 'getRegisteredRegions should fail with an AbortError'); |
41 }, 'getRegisteredRegions should fail'); | 43 }, 'getRegisteredRegions should fail'); |
42 | 44 |
43 </script> | 45 </script> |
OLD | NEW |