1 description("Tests that no timers will trigger for navigator.geolocation object after onunload.");
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);
9 document
.body
.onload = function() {
10 location
= "data:text/html,You should have seen one unload alert appear.<script>window.setTimeout('if (window.testRunner) testRunner.notifyDone();', 100);</script>";
13 document
.body
.onunload = function() {
14 navigator
.geolocation
.getCurrentPosition(
15 function(p
) {alert('FAIL: Unexpected Geolocation success callback.');},
16 function(e
) {alert('FAIL: Unexpected Geolocation error callback.' + e
.code
+ e
.message
);},
17 {timeout
: 0, maximumAge
:0}
19 alert("unload-called");
22 window
.jsTestIsAsync
= true;