| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../../../resources/js-test.js"></script> |
| 5 <script src="../../../resources/mojo-helpers.js"></script> |
| 6 <script src="resources/geolocation-mock.js"></script> |
| 7 </head> |
| 8 <body> |
| 9 <script> |
| 1 description("Tests that when timeout value is over maximum of unsigned, the succ
ess callback is called as expected."); | 10 description("Tests that when timeout value is over maximum of unsigned, the succ
ess callback is called as expected."); |
| 2 | 11 |
| 3 var mockLatitude = 51.478; | 12 var mockLatitude = 51.478; |
| 4 var mockLongitude = -0.166; | 13 var mockLongitude = -0.166; |
| 5 var mockAccuracy = 100.0; | 14 var mockAccuracy = 100.0; |
| 6 | 15 |
| 7 var position; | 16 var position; |
| 8 | 17 |
| 9 geolocationServiceMock.then(mock => { | 18 geolocationServiceMock.then(mock => { |
| 10 mock.setGeolocationPermission(true); | 19 mock.setGeolocationPermission(true); |
| 11 mock.setGeolocationPosition(mockLatitude, | 20 mock.setGeolocationPosition(mockLatitude, |
| 12 mockLongitude, | 21 mockLongitude, |
| 13 mockAccuracy); | 22 mockAccuracy); |
| 14 | 23 |
| 15 navigator.geolocation.getCurrentPosition(function(p) { | 24 navigator.geolocation.getCurrentPosition(function(p) { |
| 16 position = p; | 25 position = p; |
| 17 shouldBe('position.coords.latitude', 'mockLatitude'); | 26 shouldBe('position.coords.latitude', 'mockLatitude'); |
| 18 shouldBe('position.coords.longitude', 'mockLongitude'); | 27 shouldBe('position.coords.longitude', 'mockLongitude'); |
| 19 shouldBe('position.coords.accuracy', 'mockAccuracy'); | 28 shouldBe('position.coords.accuracy', 'mockAccuracy'); |
| 20 finishJSTest(); | 29 finishJSTest(); |
| 21 }, function(e) { | 30 }, function(e) { |
| 22 testFailed('Error callback invoked unexpectedly'); | 31 testFailed('Error callback invoked unexpectedly'); |
| 23 finishJSTest(); | 32 finishJSTest(); |
| 24 }, { | 33 }, { |
| 25 timeout: 4294967296 | 34 timeout: 4294967296 |
| 26 }); | 35 }); |
| 27 }); | 36 }); |
| 28 | 37 |
| 29 window.jsTestIsAsync = true; | 38 window.jsTestIsAsync = true; |
| 39 </script> |
| 40 </body> |
| 41 </html> |
| OLD | NEW |