test_clearWatch_invalid.html (1129B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=463039 5 --> 6 <head> 7 <title>Test for Bug 463039</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <script type="text/javascript" src="geolocation_common.js"></script> 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 11 </head> 12 <body> 13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=463039">Mozilla Bug 463039</a> 14 <p id="display"></p> 15 <div id="content" style="display: none"> 16 17 </div> 18 <pre id="test"> 19 <script class="testbody" type="text/javascript"> 20 21 SimpleTest.waitForExplicitFinish(); 22 23 resume_geolocationProvider(function() { 24 force_prompt(true, test1); 25 }); 26 27 function test1() { 28 navigator.geolocation.watchPosition(function(){}); 29 30 // there are no watches, but this should never throw 31 for (let x=-10; x<10; x++) { 32 navigator.geolocation.clearWatch(x); 33 ok(1, "clearWatch should not throw"); 34 } 35 36 // lets try something huge 37 navigator.geolocation.clearWatch(Number.MAX_VALUE); 38 ok(1, "clearWatch should not throw"); 39 40 SimpleTest.finish(); 41 } 42 43 </script> 44 </pre> 45 </body> 46 </html>