Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <title>Tests that all geofencing methods exposed on a service worker registratio n always reject.</title> | |
| 3 <script src="../resources/testharness.js"></script> | |
| 4 <script src="../resources/testharnessreport.js"></script> | |
| 5 <script src="../resources/testharness-helpers.js"></script> | |
| 6 <script src="../serviceworker/resources/test-helpers.js"></script> | |
| 7 <script> | |
| 8 var sw_url = 'resources/emptyworker.js'; | |
| 9 var sw_scope = '/service-worker-scope' + window.location.pathname; | |
| 10 | |
| 11 promise_test(function(test) { | |
| 12 return assert_promise_rejects( | |
| 13 service_worker_unregister_and_register(test, sw_url, sw_scope + '/register ') | |
| 14 .then(function(r) { | |
| 15 return r.geofencing.registerRegion( | |
| 16 new CircularGeofencingRegion({latitude: 37.421999, | |
| 17 longitude: -122.084015})); | |
| 18 }), | |
| 19 'AbortError', | |
| 20 'registerRegion should fail with an AbortError'); | |
| 21 }, 'registerRegion should fail'); | |
| 22 | |
| 23 promise_test(function(test) { | |
| 24 return assert_promise_rejects( | |
| 25 service_worker_unregister_and_register(test, sw_url, sw_scope + '/unregist er') | |
| 26 .then(function(r) { | |
| 27 return r.geofencing.unregisterRegion(''); | |
|
jsbell
2014/10/14 17:19:23
nit: 2 more spaces.
Marijn Kruisselbrink
2014/10/14 18:21:07
Done.
| |
| 28 }), | |
| 29 'AbortError', | |
| 30 'unregisterRegion should fail with an AbortError'); | |
| 31 }, 'unregisterRegion should fail'); | |
| 32 | |
| 33 promise_test(function(test) { | |
| 34 return assert_promise_rejects( | |
| 35 service_worker_unregister_and_register(test, sw_url, sw_scope + '/getregio ns') | |
| 36 .then(function(r) { | |
| 37 return r.geofencing.getRegisteredRegions(); | |
|
michaeln
2014/10/14 01:16:15
indent here doesn't match the indent on line 15, i
jsbell
2014/10/14 17:19:23
Should be 4. 2 from wrapping the contents of `then
Marijn Kruisselbrink
2014/10/14 18:21:07
Done.
| |
| 38 }), | |
| 39 'AbortError', | |
| 40 'getRegisteredRegions should fail with an AbortError'); | |
| 41 }, 'getRegisteredRegions should fail'); | |
| 42 | |
| 43 </script> | |
| OLD | NEW |