clear-watch-invalid-id-crash.js revision f486d19d62f1bc33246748b14b14a9dfa617b57f
1description("Tests for a crash when clearWatch() is called with a zero ID.<br><br>We call clearWatch() with a request in progress then navigate the page. This accesses the watchers map during cleanup and triggers the crash. This page should not be visible when the test completes."); 2 3if (window.layoutTestController) { 4 layoutTestController.setGeolocationPermission(true); 5 layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100); 6} else 7 debug('This test can not be run without the LayoutTestController'); 8 9navigator.geolocation.watchPosition(function() {}); 10navigator.geolocation.clearWatch(0); 11location = "data:text/html,TEST COMPLETE<script>layoutTestController.notifyDone();</script>"; 12 13window.jsTestIsAsync = true; 14window.successfullyParsed = true; 15