1 description("Tests that when a page is reloaded, the frame is properly detached from the Geolocation object " +
2 "to ensure that no permission requests are in progress.");
4 window
.jsTestIsAsync
= true;
6 var numPendingRequests
;
9 if ("#reload" == location
.hash
)
12 if (!window
.testRunner
|| !window
.internals
)
13 debug('This test can not run without testRunner or internals');
15 internals
.setGeolocationClientMock(document
);
16 numPendingRequests
= internals
.numberOfPendingGeolocationPermissionRequests(document
);
17 shouldBe('numPendingRequests', '0');
23 // Kick off a position request and then reload the page, this should set up
24 // a permission request. Permission should be undecided at this point, so the
25 // permission request should still be outstanding by page reload.
27 function onIframeReady()
29 // Make request on remote frame's Geolocation object.
30 iframe
.contentWindow
.navigator
.geolocation
.getCurrentPosition(
32 testFailed('Permission should not be determined for this page: ' + p
);
36 location
.hash
= '#reload';
40 debug("Create IFrame");
41 var iframe
= document
.createElement('iframe');
42 iframe
.src
= 'resources/page-reload-cancel-permission-requests-inner.html';
43 document
.body
.appendChild(iframe
);