OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <script src="../../resources/js-test.js"></script> | 3 <script src="../../resources/js-test.js"></script> |
4 <body> | 4 <body> |
5 <script type="text/javascript"> | 5 <script type="text/javascript"> |
6 description("Test Geolocation API permission callbacks in WebView"); | 6 description("Test Geolocation API permission callbacks in WebView"); |
7 window.jsTestIsAsync = true; | 7 window.jsTestIsAsync = true; |
8 | 8 |
9 function gotPosition() { | 9 function gotPosition() { |
10 testFailed("geolocation should have been denied"); | 10 testFailed("geolocation should have been denied"); |
11 finishJSTest(); | 11 finishJSTest(); |
12 } | 12 } |
13 | 13 |
14 function onError(err) { | 14 function onError(err) { |
15 debug("onError: code=" + err.code + ", message=" + err.message); | 15 debug("onError: code=" + err.code + ", message=" + err.message); |
16 finishJSTest(); | 16 finishJSTest(); |
17 } | 17 } |
18 | 18 |
19 if (navigator.geolocation) { | 19 if (navigator.geolocation) { |
20 navigator.geolocation.getCurrentPosition(gotPosition, onError); | 20 navigator.geolocation.getCurrentPosition(gotPosition, onError); |
21 } else { | 21 } else { |
22 debug('geolocation not supported'); | 22 debug('geolocation not supported'); |
23 finishJSTest(); | 23 finishJSTest(); |
24 } | 24 } |
25 </script> | 25 </script> |
26 </body> | 26 </body> |
27 </html> | 27 </html> |
OLD | NEW |