| OLD | NEW | 
|   1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |   1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 
|   2 <html> |   2 <html> | 
|   3 <head> |   3 <head> | 
|   4 <script src="../resources/js-test.js"></script> |   4 <script src="../resources/js-test.js"></script> | 
|   5 <script src="../resources/mojo-helpers.js"></script> |   5 <script src="../resources/mojo-helpers.js"></script> | 
|   6 <script src="resources/geolocation-mock.js"></script> |   6 <script src="resources/geolocation-mock.js"></script> | 
|   7 </head> |   7 </head> | 
|   8 <body> |   8 <body> | 
|   9 <script> |   9 <script> | 
|  10 description("Tests that no timers will trigger for navigator.geolocation object 
    after onunload."); |  10 description("Tests that no timers will trigger for navigator.geolocation object 
    after onunload."); | 
|  11  |  11  | 
|  12 if (!window.testRunner) |  12 if (!window.testRunner) | 
|  13   debug('This test can not run without testRunner'); |  13   debug('This test can not run without testRunner'); | 
|  14  |  14  | 
|  15 geolocationServiceMock.then(mock => { |  15 geolocationServiceMock.then(mock => { | 
|  16     mock.setGeolocationPermission(true); |  16     mock.setGeolocationPermission(true); | 
|  17  |  17  | 
|  18     location = "data:text/html,You should have seen one unload alert appear.<scr
    ipt>window.setTimeout('if (window.testRunner) testRunner.notifyDone();', 100);</
    " + "script>"; |  18     location = "../fast/events/resources/onunload-single-alert-success.html"; | 
|  19 }); |  19 }); | 
|  20  |  20  | 
|  21 document.body.onunload = function() { |  21 document.body.onunload = function() { | 
|  22     navigator.geolocation.getCurrentPosition( |  22     navigator.geolocation.getCurrentPosition( | 
|  23         function(p) {alert('FAIL: Unexpected Geolocation success callback.');}, |  23         function(p) {alert('FAIL: Unexpected Geolocation success callback.');}, | 
|  24         function(e) {alert('FAIL: Unexpected Geolocation error callback.' + e.co
    de + e.message);}, |  24         function(e) {alert('FAIL: Unexpected Geolocation error callback.' + e.co
    de + e.message);}, | 
|  25         {timeout: 0, maximumAge:0} |  25         {timeout: 0, maximumAge:0} | 
|  26     ); |  26     ); | 
|  27     alert("unload-called"); |  27     alert("unload-called"); | 
|  28 } |  28 } | 
|  29  |  29  | 
|  30 window.jsTestIsAsync = true; |  30 window.jsTestIsAsync = true; | 
|  31 </script> |  31 </script> | 
|  32 </body> |  32 </body> | 
|  33 </html> |  33 </html> | 
| OLD | NEW |