dom/tests/mochitest/geolocation/test_garbageWatch.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=482260
     5 -->
     6 <head>
     7   <title>Test for garbage data returned from location provider </title>
     8   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <script type="text/javascript" src="geolocation_common.js"></script>
    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=455327">Mozilla Bug 482260</a>
    15 <p id="display"></p>
    16 <div id="content" style="display: none">
    18 </div>
    19 <pre id="test">
    20 <script class="testbody" type="text/javascript">
    21 /** Test for Bug  **/
    23 SimpleTest.waitForExplicitFinish();
    25 resume_geolocationProvider(function() {
    26   force_prompt(true, test1);
    27 });
    29 function test1() {
    30   start_sending_garbage(test2);
    31 }
    33 function successCallback(pos){
    34   ok(false, "success should have never been called.");
    35   stop_sending_garbage(function() {SimpleTest.finish();});
    36 }
    38 function errorCallback(err) {
    39   ok(err.code == err.TIMEOUT, "ensure error is a timeout.");
    40   stop_sending_garbage(function() { SimpleTest.finish(); });
    41 }
    43 var options = {
    44     maximumAge: 0,
    45     timeout: 1000,
    46 };
    48 function test2() {
    49   navigator.geolocation.watchPosition(successCallback,
    50                                       errorCallback,
    51                                       options);
    52 }
    53 </script>
    54 </pre>
    55 </body>
    56 </html>

mercurial