| Index: third_party/WebKit/LayoutTests/fast/dom/Geolocation/reentrant-permission-denied.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/reentrant-permission-denied.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/reentrant-permission-denied.html
|
| index 4f4c84b85e5d9ba1ccd4da9a6aa978692a882be3..33a2770d845bb65e7862949e1500e2e2e376d53c 100644
|
| --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/reentrant-permission-denied.html
|
| +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/reentrant-permission-denied.html
|
| @@ -6,6 +6,47 @@
|
| <script src="resources/geolocation-mock.js"></script>
|
| </head>
|
| <body>
|
| -<script src="script-tests/reentrant-permission-denied.js"></script>
|
| +<script>
|
| +description("Tests that reentrant calls to Geolocation methods from the error callback due to a PERMISSION_DENIED error are OK.");
|
| +
|
| +var error;
|
| +
|
| +geolocationServiceMock.then(mock => {
|
| + mock.setGeolocationPermission(false);
|
| + mock.setGeolocationPosition(51.478, -0.166, 100.0);
|
| +
|
| + function checkPermissionError(e) {
|
| + error = e;
|
| + shouldBe('error.code', 'error.PERMISSION_DENIED');
|
| + shouldBe('error.message', '"User denied Geolocation"');
|
| + }
|
| +
|
| + 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;
|
| + checkPermissionError(e);
|
| + continueTest();
|
| + });
|
| +
|
| + function continueTest() {
|
| + navigator.geolocation.getCurrentPosition(function(p) {
|
| + testFailed('Success callback invoked unexpectedly');
|
| + finishJSTest();
|
| + }, function(e) {
|
| + checkPermissionError(e);
|
| + finishJSTest();
|
| + });
|
| + }
|
| +});
|
| +
|
| +window.jsTestIsAsync = true;
|
| +</script>
|
| </body>
|
| </html>
|
|
|