Home | History | Annotate | Download | only in script-tests
      1 description("Tests that no timers will trigger for navigator.geolocation object after onunload.");
      2 
      3 if (window.layoutTestController) layoutTestController.setGeolocationPermission(true);
      4 
      5 document.body.onload = function() {
      6     location = "data:text/html,You should have seen one unload alert appear.<script>window.setTimeout('if (window.layoutTestController) layoutTestController.notifyDone();', 100);</script>";
      7 }
      8 
      9 document.body.onunload = function() {
     10     navigator.geolocation.getCurrentPosition(
     11         function(p) {alert('FAIL: Unexpected Geolocation success callback.');},
     12         function(e) {alert('FAIL: Unexpected Geolocation error callback.' + e.code + e.message);},
     13         {timeout: 0, maximumAge:0}
     14     );
     15     alert("unload-called");
     16 }
     17 
     18 window.jsTestIsAsync = true;
     19 window.successfullyParsed = true;
     20