dom/tests/mochitest/geolocation/test_errorcheck.html

branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
equal deleted inserted replaced
-1:000000000000 0:40628a6a62ae
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=684722
5 -->
6 <head>
7 <title>Test for ErrorChecking </title>
8 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
9 <script type="text/javascript" src="geolocation_common.js"></script>
10
11 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
12 </head>
13 <body>
14 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=684722">Mozilla Bug 684722</a>
15 <p id="display"></p>
16 <div id="content" style="display: none">
17
18 </div>
19 <pre id="test">
20 <script class="testbody" type="text/javascript">
21
22 SimpleTest.waitForExplicitFinish();
23
24 resume_geolocationProvider(function() {
25 force_prompt(true, test1);
26 });
27
28 function test1() {
29 send404_geolocationProvider(test2);
30 }
31
32 function errorCallback(error) {
33 is(error.code,
34 SpecialPowers.Ci.nsIDOMGeoPositionError.POSITION_UNAVAILABLE, "Geolocation error handler fired");
35 SimpleTest.finish();
36 }
37
38 function successCallback(position) {
39 test2();
40 }
41
42 function test2() {
43 navigator.geolocation.getCurrentPosition(successCallback, errorCallback);
44 }
45 </script>
46 </pre>
47 </body>
48 </html>
49

mercurial