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 if (window.layoutTestController) { 4 layoutTestController.setGeolocationPermission(true); 5 layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100); 6 } 7 8 function onFirstIframeLoaded() { 9 iframeGeolocation = iframe.contentWindow.navigator.geolocation; 10 iframe.src = 'resources/disconnected-frame-already-inner2.html'; 11 } 12 13 var error; 14 function onSecondIframeLoaded() { 15 iframeGeolocation.getCurrentPosition(function () { 16 testFailed('Success callback invoked unexpectedly'); 17 finishJSTest(); 18 }, function(e) { 19 testFailed('Error callback invoked unexpectedly'); 20 finishJSTest(); 21 }); 22 setTimeout(finishTest, 1000); 23 } 24 25 function finishTest() { 26 debug('Method called on Geolocation object with disconnected Frame.'); 27 finishJSTest(); 28 } 29 30 var iframe = document.createElement('iframe'); 31 iframe.src = 'resources/disconnected-frame-already-inner1.html'; 32 document.body.appendChild(iframe); 33 34 window.jsTestIsAsync = true; 35 window.successfullyParsed = true; 36