clear-watch-invalid-id-crash.js revision 68513a70bcd92384395513322f1b801e7bf9c729
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
9document.body.onload = function() {
10    navigator.geolocation.watchPosition(function() {});
11    navigator.geolocation.clearWatch(0);
12    location = "data:text/html,TEST COMPLETE<script>if(window.layoutTestController) layoutTestController.notifyDone();</script>";
13}
14
15window.jsTestIsAsync = true;
16window.successfullyParsed = true;
17