summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/dom/Geolocation/script-tests/notimer-after-unload.js
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/fast/dom/Geolocation/script-tests/notimer-after-unload.js')
-rw-r--r--LayoutTests/fast/dom/Geolocation/script-tests/notimer-after-unload.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/LayoutTests/fast/dom/Geolocation/script-tests/notimer-after-unload.js b/LayoutTests/fast/dom/Geolocation/script-tests/notimer-after-unload.js
new file mode 100644
index 0000000..278e027
--- /dev/null
+++ b/LayoutTests/fast/dom/Geolocation/script-tests/notimer-after-unload.js
@@ -0,0 +1,21 @@
+description("Tests that no timers will trigger for navigator.geolocation object after onunload.");
+
+if (window.layoutTestController) layoutTestController.setGeolocationPermission(true);
+
+document.body.onload = function() {
+ location = "data:text/html,You should have seen one unload alert appear.<script>window.setTimeout('if (window.layoutTestController) layoutTestController.notifyDone();', 100);</" + "script>";
+}
+
+document.body.onunload = function() {
+ navigator.geolocation.getCurrentPosition(
+ function(p) {alert('FAIL: Unexpected Geolocation success callback.');},
+ function(e) {alert('FAIL: Unexpected Geolocation error callback.' + e.code + e.message);},
+ {timeout: 0, maximumAge:0}
+ );
+ alert("unload-called");
+}
+
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;
+
+if (window.layoutTestController) layoutTestController.waitUntilDone();