blob: 9f927f1d78a506c2398c43fc0b73997e29e8a361 [file] [log] [blame]
[email protected]4f37ced2010-05-20 20:10:121<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2<html>
3<head>
tkentc5e88f02017-02-06 22:47:314<script src="../resources/js-test.js"></script>
5<script src="../resources/mojo-helpers.js"></script>
sammce6687802016-05-13 04:06:576<script src="resources/geolocation-mock.js"></script>
[email protected]4f37ced2010-05-20 20:10:127</head>
8<body>
tkent98122ee2017-02-02 07:38:519<script>
10description("Tests that no timers will trigger for navigator.geolocation object after onunload.");
11
12if (!window.testRunner)
13 debug('This test can not run without testRunner');
14
15geolocationServiceMock.then(mock => {
16 mock.setGeolocationPermission(true);
17
18 location = "data:text/html,You should have seen one unload alert appear.<script>window.setTimeout('if (window.testRunner) testRunner.notifyDone();', 100);</" + "script>";
19});
20
21document.body.onunload = function() {
22 navigator.geolocation.getCurrentPosition(
23 function(p) {alert('FAIL: Unexpected Geolocation success callback.');},
24 function(e) {alert('FAIL: Unexpected Geolocation error callback.' + e.code + e.message);},
25 {timeout: 0, maximumAge:0}
26 );
27 alert("unload-called");
28}
29
30window.jsTestIsAsync = true;
31</script>
[email protected]4f37ced2010-05-20 20:10:1232</body>
33</html>