| Index: third_party/WebKit/LayoutTests/fast/dom/Geolocation/reentrant-error.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/reentrant-error.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/reentrant-error.html
|
| index b735a7684b49d95445651ecce7dc2c04a4d69ab4..8492a6ebbce06df19e0970f58ab373642b8f3b5a 100644
|
| --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/reentrant-error.html
|
| +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/reentrant-error.html
|
| @@ -6,6 +6,53 @@
|
| <script src="resources/geolocation-mock.js"></script>
|
| </head>
|
| <body>
|
| -<script src="script-tests/reentrant-error.js"></script>
|
| +<script>
|
| +description("Tests that reentrant calls to Geolocation methods from the error callback are OK.");
|
| +
|
| +var mockMessage = 'test';
|
| +
|
| +var error;
|
| +
|
| +geolocationServiceMock.then(mock => {
|
| + mock.setGeolocationPermission(true);
|
| + mock.setGeolocationPositionUnavailableError(mockMessage);
|
| +
|
| + var errorCallbackInvoked = false;
|
| + navigator.geolocation.getCurrentPosition(function(p) {
|
| + testFailed('Success callback invoked unexpectedly');
|
| + finishJSTest();
|
| + }, function(e) {
|
| + if (errorCallbackInvoked) {
|
| + testFailed('Error callback invoked unexpectedly');
|
| + finishJSTest();
|
| + }
|
| + errorCallbackInvoked = true;
|
| +
|
| + error = e;
|
| + shouldBe('error.code', 'error.POSITION_UNAVAILABLE');
|
| + shouldBe('error.message', 'mockMessage');
|
| + debug('');
|
| + continueTest();
|
| + });
|
| +
|
| + function continueTest() {
|
| + mockMessage += ' repeat';
|
| +
|
| + mock.setGeolocationPositionUnavailableError(mockMessage);
|
| +
|
| + navigator.geolocation.getCurrentPosition(function(p) {
|
| + testFailed('Success callback invoked unexpectedly');
|
| + finishJSTest();
|
| + }, function(e) {
|
| + error = e;
|
| + shouldBe('error.code', 'error.POSITION_UNAVAILABLE');
|
| + shouldBe('error.message', 'mockMessage');
|
| + finishJSTest();
|
| + });
|
| + }
|
| +});
|
| +
|
| +window.jsTestIsAsync = true;
|
| +</script>
|
| </body>
|
| </html>
|
|
|