| OLD | NEW |
| (Empty) |
| 1 description("Tests that when a request is made on a Geolocation object and its F
rame is disconnected before a callback is made, no callbacks are made."); | |
| 2 | |
| 3 var error; | |
| 4 var iframe = document.createElement('iframe'); | |
| 5 | |
| 6 function onIframeLoaded() { | |
| 7 iframeGeolocation = iframe.contentWindow.navigator.geolocation; | |
| 8 iframe.src = 'data:text/html,This frame should be visible when the test comp
letes'; | |
| 9 } | |
| 10 | |
| 11 function onIframeUnloaded() { | |
| 12 iframeGeolocation.getCurrentPosition(function () { | |
| 13 testFailed('Success callback invoked unexpectedly'); | |
| 14 finishJSTest(); | |
| 15 }, function(e) { | |
| 16 testFailed('Error callback invoked unexpectedly'); | |
| 17 finishJSTest(); | |
| 18 }); | |
| 19 setTimeout(function() { | |
| 20 testPassed('No callbacks invoked'); | |
| 21 finishJSTest(); | |
| 22 }, 100); | |
| 23 } | |
| 24 | |
| 25 geolocationServiceMock.then(mock => { | |
| 26 mock.setGeolocationPermission(true); | |
| 27 mock.setGeolocationPosition(51.478, -0.166, 100); | |
| 28 | |
| 29 iframe.src = 'resources/disconnected-frame-inner.html'; | |
| 30 document.body.appendChild(iframe); | |
| 31 }); | |
| 32 | |
| 33 window.jsTestIsAsync = true; | |
| OLD | NEW |