OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <title>Tests that all geofencing methods always reject.</title> | |
3 <script src="../resources/testharness.js"></script> | |
4 <script src="../resources/testharnessreport.js"></script> | |
5 <script> | |
6 // Copied from http/tests/serviceworker/resources/worker-test-harness.js, can be | |
7 // removed once this makes it into testharness.js itself. | |
8 function promise_test(func, name, properties) { | |
9 properties = properties || {}; | |
10 var test = async_test(name, properties); | |
11 Promise.resolve(test.step(func, test, test)) | |
12 .then(function() { test.done(); }) | |
13 .catch(test.step_func(function(value) { | |
14 throw value; | |
15 })); | |
16 } | |
17 | |
18 promise_test(function(test) { | |
19 return navigator.geofencing.registerRegion( | |
20 new CircularGeofencingRegion({latitude: 37.421999, | |
21 longitude: -122.084015})) | |
22 .then(test.unreached_func('Promise should not have resolved')) | |
23 .catch(function() { }); | |
24 }, 'registerRegion should fail'); | |
25 | |
26 promise_test(function(test) { | |
27 return navigator.geofencing.unregisterRegion("") | |
28 .then(test.unreached_func('Promise should not have resolved')) | |
29 .catch(function() { }); | |
30 }, 'unregisterRegion should fail'); | |
31 | |
32 promise_test(function(test) { | |
33 return navigator.geofencing.getRegisteredRegions() | |
34 .then(test.unreached_func('Promise should not have resolved')) | |
35 .catch(function() { }); | |
36 }, 'getRegisteredRegions should fail'); | |
37 | |
38 </script> | |
OLD | NEW |