dom/tests/mochitest/geolocation/test_optional_api_params.html

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

michael@0 1 <!DOCTYPE HTML>
michael@0 2 <html>
michael@0 3 <!--
michael@0 4 https://bugzilla.mozilla.org/show_bug.cgi?id=452566
michael@0 5 -->
michael@0 6 <head>
michael@0 7 <title>Test for Bug 452566</title>
michael@0 8 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
michael@0 9 <script type="text/javascript" src="geolocation_common.js"></script>
michael@0 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
michael@0 11 </head>
michael@0 12 <body>
michael@0 13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=452566">Mozilla Bug 452566</a>
michael@0 14 <p id="display"></p>
michael@0 15 <div id="content" style="display: none">
michael@0 16
michael@0 17 </div>
michael@0 18 <pre id="test">
michael@0 19 <script class="testbody" type="text/javascript">
michael@0 20
michael@0 21 SimpleTest.waitForExplicitFinish();
michael@0 22
michael@0 23 // ensure we are using the right testing provider
michael@0 24 resume_geolocationProvider(function() {
michael@0 25 force_prompt(true, test1);
michael@0 26 });
michael@0 27
michael@0 28 /** Test for Bug 452566 **/
michael@0 29 function test1() {
michael@0 30 ok(navigator.geolocation, "Should have geolocation");
michael@0 31
michael@0 32 var exception = null;
michael@0 33 try {
michael@0 34 navigator.geolocation.getCurrentPosition();
michael@0 35 } catch(ex if ex instanceof TypeError) {
michael@0 36 exception = ex;
michael@0 37 }
michael@0 38 ok(exception, "Should have got an exception");
michael@0 39
michael@0 40 exception = null;
michael@0 41 try {
michael@0 42 navigator.geolocation.getCurrentPosition(function() {});
michael@0 43 } catch(ex if ex instanceof TypeError) {
michael@0 44 exception = ex;
michael@0 45 }
michael@0 46 ok(!exception, exception);
michael@0 47
michael@0 48 exception = null;
michael@0 49 try {
michael@0 50 navigator.geolocation.getCurrentPosition(function() {}, function() {});
michael@0 51 } catch(ex if ex instanceof TypeError) {
michael@0 52 exception = ex;
michael@0 53 }
michael@0 54 ok(!exception, exception);
michael@0 55
michael@0 56 exception = null;
michael@0 57 try {
michael@0 58 navigator.geolocation.getCurrentPosition(function() {}, function() {}, {});
michael@0 59 } catch(ex if ex instanceof TypeError) {
michael@0 60 exception = ex;
michael@0 61 }
michael@0 62 ok(!exception, exception);
michael@0 63
michael@0 64 exception = null;
michael@0 65 try {
michael@0 66 navigator.geolocation.watchPosition();
michael@0 67 } catch(ex if ex instanceof TypeError) {
michael@0 68 exception = ex;
michael@0 69 }
michael@0 70 ok(exception, "Should have got an exception");
michael@0 71
michael@0 72 exception = null;
michael@0 73 try {
michael@0 74 navigator.geolocation.watchPosition(function() {});
michael@0 75 } catch(ex if ex instanceof TypeError) {
michael@0 76 exception = ex;
michael@0 77 }
michael@0 78 ok(!exception, exception);
michael@0 79
michael@0 80 exception = null;
michael@0 81 try {
michael@0 82 navigator.geolocation.watchPosition(function() {}, function() {});
michael@0 83 } catch(ex if ex instanceof TypeError) {
michael@0 84 exception = ex;
michael@0 85 }
michael@0 86 ok(!exception, exception);
michael@0 87
michael@0 88 exception = null;
michael@0 89 try {
michael@0 90 navigator.geolocation.watchPosition(function() {}, function() {}, {});
michael@0 91 } catch(ex if ex instanceof TypeError) {
michael@0 92 exception = ex;
michael@0 93 }
michael@0 94 ok(!exception, exception);
michael@0 95
michael@0 96 SimpleTest.finish();
michael@0 97 }
michael@0 98
michael@0 99 </script>
michael@0 100 </pre>
michael@0 101 </body>
michael@0 102 </html>

mercurial