diff options
Diffstat (limited to 'LayoutTests/fast/dom/Geolocation/script-tests')
-rw-r--r-- | LayoutTests/fast/dom/Geolocation/script-tests/page-reload-cancel-permission-requests.js | 44 | ||||
-rw-r--r-- | LayoutTests/fast/dom/Geolocation/script-tests/window-close-crash.js | 6 |
2 files changed, 44 insertions, 6 deletions
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/page-reload-cancel-permission-requests.js b/LayoutTests/fast/dom/Geolocation/script-tests/page-reload-cancel-permission-requests.js new file mode 100644 index 0000000..7ac291b --- /dev/null +++ b/LayoutTests/fast/dom/Geolocation/script-tests/page-reload-cancel-permission-requests.js @@ -0,0 +1,44 @@ +description("Tests that when a page is reloaded, the frame is properly detached from the Geolocation object " + + "to ensure that no permission requests are in progress."); + +window.jsTestIsAsync = true; + +var numPendingRequests; +var isReload = false; + +if ("#reload" == location.hash) + isReload = true; + +if (window.layoutTestController) { + numPendingRequests = layoutTestController.numberOfPendingGeolocationPermissionRequests(); + shouldBe('numPendingRequests', '0'); + + if (isReload) + finishJSTest(); +} + +if (!isReload) { + // Kick off a position request and then reload the page, this should set up + // a permission request. Permission should be undecided at this point, so the + // permission request should still be outstanding by page reload. + + function onIframeReady() + { + // Make request on remote frame's Geolocation object. + iframe.contentWindow.navigator.geolocation.getCurrentPosition( + function(p) { + testFailed('Permission should not be determined for this page: ' + p); + finishJSTest(); + }); + + location.hash = '#reload'; + location.reload(); + } + + debug("Create IFrame"); + var iframe = document.createElement('iframe'); + iframe.src = 'resources/page-reload-cancel-permission-requests-inner.html'; + document.body.appendChild(iframe); +} + +window.successfullyParsed = true; diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/window-close-crash.js b/LayoutTests/fast/dom/Geolocation/script-tests/window-close-crash.js index b27df61..a8f2bda 100644 --- a/LayoutTests/fast/dom/Geolocation/script-tests/window-close-crash.js +++ b/LayoutTests/fast/dom/Geolocation/script-tests/window-close-crash.js @@ -28,12 +28,6 @@ function waitForWindowToClose() finishJSTest(); } -function failedToCreateWatch(e) -{ - testFailed("Failed to create watch: " + e); - finishJSTest(); -} - debug("Main page opening resources/window-close-popup.html"); otherWindow = window.open("resources/window-close-popup.html"); |