| OLD | NEW |
| (Empty) |
| 1 description("Tests that when a request is made on a Geolocation object after its
frame has been disconnected, no callbacks are made and no crash occurs."); | |
| 2 | |
| 3 var iframe = document.createElement('iframe'); | |
| 4 | |
| 5 geolocationServiceMock.then(mock => { | |
| 6 mock.setGeolocationPermission(true); | |
| 7 mock.setGeolocationPosition(51.478, -0.166, 100); | |
| 8 | |
| 9 iframe.src = 'resources/disconnected-frame-already-inner1.html'; | |
| 10 document.body.appendChild(iframe); | |
| 11 }); | |
| 12 | |
| 13 function onFirstIframeLoaded() { | |
| 14 iframeGeolocation = iframe.contentWindow.navigator.geolocation; | |
| 15 iframe.src = 'resources/disconnected-frame-already-inner2.html'; | |
| 16 } | |
| 17 | |
| 18 function onSecondIframeLoaded() { | |
| 19 iframeGeolocation.getCurrentPosition(function () { | |
| 20 testFailed('Success callback invoked unexpectedly'); | |
| 21 finishJSTest(); | |
| 22 }, function(e) { | |
| 23 testFailed('Error callback invoked unexpectedly'); | |
| 24 finishJSTest(); | |
| 25 }); | |
| 26 setTimeout(finishTest, 1000); | |
| 27 } | |
| 28 | |
| 29 function finishTest() { | |
| 30 debug('Method called on Geolocation object with disconnected Frame.'); | |
| 31 finishJSTest(); | |
| 32 } | |
| 33 | |
| 34 window.jsTestIsAsync = true; | |
| OLD | NEW |