OLD | NEW |
| (Empty) |
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."); | |
3 | |
4 window.jsTestIsAsync = true; | |
5 | |
6 var numPendingRequests; | |
7 var isReload = false; | |
8 | |
9 if ("#reload" == location.hash) | |
10 isReload = true; | |
11 | |
12 if (!window.testRunner || !window.internals) | |
13 debug('This test can not run without testRunner or internals'); | |
14 | |
15 internals.setGeolocationClientMock(document); | |
16 numPendingRequests = internals.numberOfPendingGeolocationPermissionRequests(docu
ment); | |
17 shouldBe('numPendingRequests', '0'); | |
18 | |
19 if (isReload) | |
20 finishJSTest(); | |
21 | |
22 if (!isReload) { | |
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 th
e | |
25 // permission request should still be outstanding by page reload. | |
26 | |
27 function onIframeReady() | |
28 { | |
29 // Make request on remote frame's Geolocation object. | |
30 iframe.contentWindow.navigator.geolocation.getCurrentPosition( | |
31 function(p) { | |
32 testFailed('Permission should not be determined for this page: '
+ p); | |
33 finishJSTest(); | |
34 }); | |
35 | |
36 location.hash = '#reload'; | |
37 location.reload(); | |
38 } | |
39 | |
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); | |
44 } | |
OLD | NEW |