tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_manyWatchSerial.html (1206B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=482260
      5 -->
      6 <head>
      7  <title>Test for watchPosition </title>
      8  <script 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=482260">Mozilla Bug 482260</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 "use strict";
     22 
     23 SimpleTest.waitForExplicitFinish();
     24 
     25 resume_geolocationProvider(function() {
     26  force_prompt(true, test1);
     27 });
     28 
     29 var watchID = 0;
     30 var completeCount = 10;
     31 
     32 
     33 function successCallback(position) {
     34  check_geolocation(position);
     35 
     36  navigator.geolocation.clearWatch(watchID);
     37 
     38  completeCount--;
     39 
     40  if (completeCount==0) {
     41    ok(1, "all watchPosition successCallbacks called");
     42    SimpleTest.finish();
     43    return;
     44  }
     45 
     46  watchID = navigator.geolocation.watchPosition(successCallback);
     47 }
     48 
     49 function test1() {
     50  watchID = navigator.geolocation.watchPosition(successCallback);
     51 }
     52 </script>
     53 </pre>
     54 </body>
     55 </html>