1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/tests/mochitest/geolocation/test_shutdown.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,63 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=716127 1.8 +--> 1.9 +<head> 1.10 + <title>Test for getCurrentPosition </title> 1.11 + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.12 + <script type="text/javascript" src="geolocation_common.js"></script> 1.13 + 1.14 +<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 1.15 +</head> 1.16 +<body> 1.17 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=716127">Mozilla Bug 716127</a> 1.18 +<p id="display"></p> 1.19 +<div id="content" style="display: none"> 1.20 + 1.21 +</div> 1.22 +<pre id="test"> 1.23 +<script class="testbody" type="text/javascript"> 1.24 + 1.25 +SimpleTest.waitForExplicitFinish(); 1.26 + 1.27 +resume_geolocationProvider(function() { 1.28 + force_prompt(true, test1); 1.29 +}); 1.30 + 1.31 +function successCallback(position) { 1.32 + check_geolocation(position); 1.33 + 1.34 + SpecialPowers.pushPrefEnv({'set': [['geo.timeout', 100]]}, function() { 1.35 + delay_geolocationProvider(1000, function() { 1.36 + force_prompt(true, function() { 1.37 + navigator.geolocation.getCurrentPosition(success2, handle_error, {maximumAge: 0}); 1.38 + }); 1.39 + }); 1.40 + 1.41 + }); 1.42 +} 1.43 + 1.44 +function errorCallback() { 1.45 + ok(false, "unexpected error"); 1.46 + SimpleTest.finish(); 1.47 +} 1.48 + 1.49 +function test1() { 1.50 + navigator.geolocation.getCurrentPosition(successCallback, errorCallback); 1.51 +} 1.52 + 1.53 +function success2(position) { 1.54 + check_geolocation(position); 1.55 + SimpleTest.finish(); 1.56 +} 1.57 + 1.58 +function handle_error() { 1.59 + ok(false, "geolocation provider should not have timed out"); 1.60 + SimpleTest.finish(); 1.61 +} 1.62 +</script> 1.63 +</pre> 1.64 +</body> 1.65 +</html> 1.66 +