1 description("Tests that when a request is made on a Geolocation object and its Frame is disconnected before a callback is made, no callbacks are made.");
3 if (!window.testRunner || !window.internals)
4 debug('This test can not run without testRunner or internals');
6 internals.setGeolocationClientMock(document);
7 internals.setGeolocationPermission(document, true);
8 internals.setGeolocationPosition(document, 51.478, -0.166, 100);
10 function onIframeLoaded() {
11 iframeGeolocation = iframe.contentWindow.navigator.geolocation;
12 iframe.src = 'data:text/html,This frame should be visible when the test completes';
16 function onIframeUnloaded() {
17 iframeGeolocation.getCurrentPosition(function () {
18 testFailed('Success callback invoked unexpectedly');
21 testFailed('Error callback invoked unexpectedly');
24 setTimeout(function() {
25 testPassed('No callbacks invoked');
30 var iframe = document.createElement('iframe');
31 iframe.src = 'resources/disconnected-frame-inner.html';
32 document.body.appendChild(iframe);
34 window.jsTestIsAsync = true;