diff options
Diffstat (limited to 'LayoutTests/fast/dom/Geolocation/resources')
20 files changed, 0 insertions, 770 deletions
diff --git a/LayoutTests/fast/dom/Geolocation/resources/TEMPLATE.html b/LayoutTests/fast/dom/Geolocation/resources/TEMPLATE.html deleted file mode 100644 index fcb8be1..0000000 --- a/LayoutTests/fast/dom/Geolocation/resources/TEMPLATE.html +++ /dev/null @@ -1,13 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<link rel="stylesheet" href="../../js/resources/js-test-style.css"> -<script src="../../js/resources/js-test-pre.js"></script> -</head> -<body> -<p id="description"></p> -<div id="console"></div> -<script src="YOUR_JS_FILE_HERE"></script> -<script src="resources/js-test-post.js"></script> -</body> -</html> diff --git a/LayoutTests/fast/dom/Geolocation/resources/argument-types.js b/LayoutTests/fast/dom/Geolocation/resources/argument-types.js deleted file mode 100644 index 956e3d6..0000000 --- a/LayoutTests/fast/dom/Geolocation/resources/argument-types.js +++ /dev/null @@ -1,119 +0,0 @@ -description("Tests the acceptable types for arguments to Geolocation methods."); - -function shouldNotThrow(expression) -{ - try { - eval(expression); - testPassed(expression + " did not throw exception."); - } catch(e) { - testFailed(expression + " should not throw exception. Threw exception " + e); - } -} - -function test(expression, expressionShouldThrow, expectedException) { - if (expressionShouldThrow) { - if (expectedException) - shouldThrow(expression, '(function() { return "' + expectedException + '"; })();'); - else - shouldThrow(expression, '(function() { return "Error: TYPE_MISMATCH_ERR: DOM Exception 17"; })();'); - } else { - shouldNotThrow(expression); - } -} - -var emptyFunction = function() {}; - -function ObjectThrowingException() {}; -ObjectThrowingException.prototype.valueOf = function() { - throw new Error('valueOf threw exception'); -} -ObjectThrowingException.prototype.__defineGetter__("enableHighAccuracy", function() { - throw new Error('enableHighAccuracy getter exception'); -}); -var objectThrowingException = new ObjectThrowingException(); - - -test('navigator.geolocation.getCurrentPosition()', true); - -test('navigator.geolocation.getCurrentPosition(undefined)', true); -test('navigator.geolocation.getCurrentPosition(null)', true); -test('navigator.geolocation.getCurrentPosition({})', true); -test('navigator.geolocation.getCurrentPosition(objectThrowingException)', true); -test('navigator.geolocation.getCurrentPosition(emptyFunction)', false); -test('navigator.geolocation.getCurrentPosition(Math.abs)', false); -test('navigator.geolocation.getCurrentPosition(true)', true); -test('navigator.geolocation.getCurrentPosition(42)', true); -test('navigator.geolocation.getCurrentPosition(Infinity)', true); -test('navigator.geolocation.getCurrentPosition(-Infinity)', true); -test('navigator.geolocation.getCurrentPosition("string")', true); - -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined)', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, null)', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, {})', true); -test('navigator.geolocation.getCurrentPosition(emptyFunction, objectThrowingException)', true); -test('navigator.geolocation.getCurrentPosition(emptyFunction, emptyFunction)', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, Math.abs)', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, true)', true); -test('navigator.geolocation.getCurrentPosition(emptyFunction, 42)', true); -test('navigator.geolocation.getCurrentPosition(emptyFunction, Infinity)', true); -test('navigator.geolocation.getCurrentPosition(emptyFunction, -Infinity)', true); -test('navigator.geolocation.getCurrentPosition(emptyFunction, "string")', true); - -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, undefined)', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, null)', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, objectThrowingException)', true, 'Error: enableHighAccuracy getter exception'); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, emptyFunction)', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, true)', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, 42)', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, Infinity)', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, -Infinity)', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, "string")', false); - -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:undefined})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:null})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:{}})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:objectThrowingException})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:emptyFunction})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:true})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:42})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:Infinity})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:-Infinity})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:"string"})', false); - -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:undefined})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:null})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:{}})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:objectThrowingException})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:emptyFunction})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:true})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:42})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:Infinity})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:-Infinity})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:"string"})', false); - -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:undefined})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:null})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:{}})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:objectThrowingException})', true, 'Error: valueOf threw exception'); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:emptyFunction})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:true})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:42})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:Infinity})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:-Infinity})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:"string"})', false); - -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:undefined})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:null})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:{}})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:objectThrowingException})', true, 'Error: valueOf threw exception'); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:emptyFunction})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:true})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:42})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:Infinity})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:-Infinity})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:"string"})', false); - -var isAsynchronous = false; -var successfullyParsed = true; - diff --git a/LayoutTests/fast/dom/Geolocation/resources/callback-exception.js b/LayoutTests/fast/dom/Geolocation/resources/callback-exception.js deleted file mode 100644 index d5cd682..0000000 --- a/LayoutTests/fast/dom/Geolocation/resources/callback-exception.js +++ /dev/null @@ -1,36 +0,0 @@ -description("Tests that when an exception is thrown in the success callback, the error callback is not invoked. Note that this test throws an exception which is not caught."); - -var mockLatitude = 51.478; -var mockLongitude = -0.166; -var mockAccuracy = 100; - -window.layoutTestController.setGeolocationPermission(true); -window.layoutTestController.setMockGeolocationPosition(mockLatitude, - mockLongitude, - mockAccuracy); - -var position; -navigator.geolocation.getCurrentPosition(function(p) { - position = p - shouldBe('position.coords.latitude', 'mockLatitude'); - shouldBe('position.coords.longitude', 'mockLongitude'); - shouldBe('position.coords.accuracy', 'mockAccuracy'); - - // Yield to allow for the error callback to be invoked. The timer - // must be started before the exception is thrown. - window.setTimeout(completeTest, 0); - throw new Error('Exception in success callback'); -}, function(e) { - testFailed('Error callback invoked unexpectedly'); - window.layoutTestController.notifyDone(); -}); - -function completeTest() -{ - debug('<br /><span class="pass">TEST COMPLETE</span>'); - window.layoutTestController.notifyDone(); -} -window.layoutTestController.waitUntilDone(); - -var isAsynchronous = true; -var successfullyParsed = true; diff --git a/LayoutTests/fast/dom/Geolocation/resources/enabled.js b/LayoutTests/fast/dom/Geolocation/resources/enabled.js deleted file mode 100644 index 4e99984..0000000 --- a/LayoutTests/fast/dom/Geolocation/resources/enabled.js +++ /dev/null @@ -1,18 +0,0 @@ -description("Tests that the navigator.geolocation object is present."); - -function hasGeolocationProperty() -{ - for (var property in navigator) { - if (property == "geolocation") - return true; - } - return false; -} - -shouldBeTrue("typeof navigator.geolocation == 'object'"); -shouldBeTrue("hasGeolocationProperty()"); -shouldBeTrue("'geolocation' in navigator"); -shouldBeTrue("navigator.hasOwnProperty('geolocation')"); - -var isAsynchronous = false; -var successfullyParsed = true; diff --git a/LayoutTests/fast/dom/Geolocation/resources/error.js b/LayoutTests/fast/dom/Geolocation/resources/error.js deleted file mode 100644 index c76570b..0000000 --- a/LayoutTests/fast/dom/Geolocation/resources/error.js +++ /dev/null @@ -1,27 +0,0 @@ -description("Tests Geolocation error callback using the mock service."); - -var mockCode = 0; -var mockMessage = "debug"; - -window.layoutTestController.setMockGeolocationError(mockCode, mockMessage); - -var error; -navigator.geolocation.getCurrentPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - debug('<br /><span class="pass">TEST COMPLETE</span>'); - window.layoutTestController.notifyDone(); -}, function(e) { - error = e - shouldBe('error.code', 'mockCode'); - shouldBe('error.message', 'mockMessage'); - shouldBe('error.UNKNOWN_ERROR', 'undefined'); - shouldBe('error.PERMISSION_DENIED', '1'); - shouldBe('error.POSITION_UNAVAILABLE', '2'); - shouldBe('error.TIMEOUT', '3'); - debug('<br /><span class="pass">TEST COMPLETE</span>'); - window.layoutTestController.notifyDone(); -}); -window.layoutTestController.waitUntilDone(); - -var isAsynchronous = true; -var successfullyParsed = true; diff --git a/LayoutTests/fast/dom/Geolocation/resources/js-test-post.js b/LayoutTests/fast/dom/Geolocation/resources/js-test-post.js deleted file mode 100644 index 558f149..0000000 --- a/LayoutTests/fast/dom/Geolocation/resources/js-test-post.js +++ /dev/null @@ -1,4 +0,0 @@ -shouldBeTrue("successfullyParsed"); -if (!isAsynchronous) { - debug('<br /><span class="pass">TEST COMPLETE</span>'); -} diff --git a/LayoutTests/fast/dom/Geolocation/resources/maximum-age.js b/LayoutTests/fast/dom/Geolocation/resources/maximum-age.js deleted file mode 100644 index f48aa0d..0000000 --- a/LayoutTests/fast/dom/Geolocation/resources/maximum-age.js +++ /dev/null @@ -1,81 +0,0 @@ -description("Tests that the PositionOptions.maximumAge parameter is correctly applied."); - -var mockLatitude = 51.478; -var mockLongitude = -0.166; -var mockAccuracy = 100.0; - -var mockCode = 1; -var mockMessage = 'test'; - -var position; -var error; - -function checkPosition(p) { - debug(''); - position = p; - shouldBe('position.coords.latitude', 'mockLatitude'); - shouldBe('position.coords.longitude', 'mockLongitude'); - shouldBe('position.coords.accuracy', 'mockAccuracy'); -} - -function checkError(e) { - debug(''); - error = e; - shouldBe('error.code', 'mockCode'); - shouldBe('error.message', 'mockMessage'); -} - -window.layoutTestController.setGeolocationPermission(true); -window.layoutTestController.setMockGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy); - -// Initialize the cached Position -navigator.geolocation.getCurrentPosition(function(p) { - checkPosition(p); - testZeroMaximumAge(); -}, function(e) { - testFailed('Error callback invoked unexpectedly'); - window.layoutTestController.notifyDone(); -}); - -function testZeroMaximumAge() { - // Update the position provided by the mock service. - window.layoutTestController.setMockGeolocationPosition(++mockLatitude, ++mockLongitude, ++mockAccuracy); - // The default maximumAge is zero, so we expect the updated position from the service. - navigator.geolocation.getCurrentPosition(function(p) { - checkPosition(p); - testNonZeroMaximumAge(); - }, function(e) { - testFailed('Error callback invoked unexpectedly'); - window.layoutTestController.notifyDone(); - }); -} - -function testNonZeroMaximumAge() { - // Update the mock service to report an error. - window.layoutTestController.setMockGeolocationError(mockCode, mockMessage); - // The maximumAge is non-zero, so we expect the cached position, not the error from the service. - navigator.geolocation.getCurrentPosition(function(p) { - checkPosition(p); - testZeroMaximumAgeError(); - }, function(e) { - testFailed('Error callback invoked unexpectedly'); - window.layoutTestController.notifyDone(); - }, {maximumAge: 1000}); -} - -function testZeroMaximumAgeError() { - // The default maximumAge is zero, so we expect the error from the service. - navigator.geolocation.getCurrentPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - window.layoutTestController.notifyDone(); - }, function(e) { - checkError(e); - debug('<br /><span class="pass">TEST COMPLETE</span>'); - window.layoutTestController.notifyDone(); - }); -} - -window.layoutTestController.waitUntilDone(); - -var isAsynchronous = true; -var successfullyParsed = true; diff --git a/LayoutTests/fast/dom/Geolocation/resources/permission-denied-already-clear-watch.js b/LayoutTests/fast/dom/Geolocation/resources/permission-denied-already-clear-watch.js deleted file mode 100644 index 1e980a5..0000000 --- a/LayoutTests/fast/dom/Geolocation/resources/permission-denied-already-clear-watch.js +++ /dev/null @@ -1,42 +0,0 @@ -description("Tests that when Geolocation permission has been denied prior to a call to watchPosition, and the watch is cleared in the error callback, there is no crash. This a regression test for https://bugs.webkit.org/show_bug.cgi?id=32111."); - -// Prime the Geolocation instance by denying permission. -window.layoutTestController.setGeolocationPermission(false); -window.layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100); - -var error; -navigator.geolocation.getCurrentPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - window.layoutTestController.notifyDone(); -}, function(e) { - error = e - shouldBe('error.code', 'error.PERMISSION_DENIED'); - shouldBe('error.message', '"User denied Geolocation"'); - debug(''); - continueTest(); -}); - -function continueTest() -{ - // Make another request, with permission already denied. - var watchId = navigator.geolocation.watchPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - window.layoutTestController.notifyDone(); - }, function(e) { - error = e - shouldBe('error.code', 'error.PERMISSION_DENIED'); - shouldBe('error.message', '"User denied Geolocation"'); - navigator.geolocation.clearWatch(watchId); - window.setTimeout(completeTest, 0); - }); -} - -function completeTest() -{ - debug('<br /><span class="pass">TEST COMPLETE</span>'); - window.layoutTestController.notifyDone(); -} -window.layoutTestController.waitUntilDone(); - -var isAsynchronous = true; -var successfullyParsed = true; diff --git a/LayoutTests/fast/dom/Geolocation/resources/permission-denied-already-error.js b/LayoutTests/fast/dom/Geolocation/resources/permission-denied-already-error.js deleted file mode 100644 index 77c8259..0000000 --- a/LayoutTests/fast/dom/Geolocation/resources/permission-denied-already-error.js +++ /dev/null @@ -1,38 +0,0 @@ -description("Tests that when Geolocation permission has been denied prior to a call to a Geolocation method, the error callback is invoked with code PERMISSION_DENIED, when the Geolocation service encounters an error."); - -// Prime the Geolocation instance by denying permission. -window.layoutTestController.setGeolocationPermission(false); -window.layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100); - -var error; -navigator.geolocation.getCurrentPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - window.layoutTestController.notifyDone(); -}, function(e) { - error = e - shouldBe('error.code', 'error.PERMISSION_DENIED'); - shouldBe('error.message', '"User denied Geolocation"'); - debug(''); - continueTest(); -}); - -function continueTest() -{ - // Make another request, with permission already denied. - window.layoutTestController.setMockGeolocationError(0, 'test'); - - navigator.geolocation.getCurrentPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - window.layoutTestController.notifyDone(); - }, function(e) { - error = e - shouldBe('error.code', 'error.PERMISSION_DENIED'); - shouldBe('error.message', '"User denied Geolocation"'); - debug('<br /><span class="pass">TEST COMPLETE</span>'); - window.layoutTestController.notifyDone(); - }); -} -window.layoutTestController.waitUntilDone(); - -var isAsynchronous = true; -var successfullyParsed = true; diff --git a/LayoutTests/fast/dom/Geolocation/resources/permission-denied-already-success.js b/LayoutTests/fast/dom/Geolocation/resources/permission-denied-already-success.js deleted file mode 100644 index 966c64d..0000000 --- a/LayoutTests/fast/dom/Geolocation/resources/permission-denied-already-success.js +++ /dev/null @@ -1,36 +0,0 @@ -description("Tests that when Geolocation permission has been denied prior to a call to a Geolocation method, the error callback is invoked with code PERMISSION_DENIED, when the Geolocation service has a good position."); - -// Prime the Geolocation instance by denying permission. -window.layoutTestController.setGeolocationPermission(false); -window.layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100); - -var error; -navigator.geolocation.getCurrentPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - window.layoutTestController.notifyDone(); -}, function(e) { - error = e - shouldBe('error.code', 'error.PERMISSION_DENIED'); - shouldBe('error.message', '"User denied Geolocation"'); - debug(''); - continueTest(); -}); - -function continueTest() -{ - // Make another request, with permission already denied. - navigator.geolocation.getCurrentPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - window.layoutTestController.notifyDone(); - }, function(e) { - error = e - shouldBe('error.code', 'error.PERMISSION_DENIED'); - shouldBe('error.message', '"User denied Geolocation"'); - debug('<br /><span class="pass">TEST COMPLETE</span>'); - window.layoutTestController.notifyDone(); - }); -} -window.layoutTestController.waitUntilDone(); - -var isAsynchronous = true; -var successfullyParsed = true; diff --git a/LayoutTests/fast/dom/Geolocation/resources/permission-denied-stops-watches.js b/LayoutTests/fast/dom/Geolocation/resources/permission-denied-stops-watches.js deleted file mode 100644 index 89e5004..0000000 --- a/LayoutTests/fast/dom/Geolocation/resources/permission-denied-stops-watches.js +++ /dev/null @@ -1,38 +0,0 @@ -description("Tests that when Geolocation permission is denied, watches are stopped, as well as one-shots."); - -// Configure the mock Geolocation service to report a position to cause permission -// to be requested, then deny it. -window.layoutTestController.setGeolocationPermission(false); -window.layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100.0); - -var error; -var errorCallbackInvoked = false; -navigator.geolocation.watchPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - window.layoutTestController.notifyDone(); -}, function(e) { - if (errorCallbackInvoked) { - testFailed('Error callback invoked unexpectedly : ' + error.message); - window.layoutTestController.notifyDone(); - } - errorCallbackInvoked = true; - - error = e - shouldBe('error.code', 'error.PERMISSION_DENIED'); - shouldBe('error.message', '"User denied Geolocation"'); - - // Update the mock Geolocation service to report a new position, then - // yield to allow a chance for the success callback to be invoked. - window.layoutTestController.setMockGeolocationPosition(55.478, -0.166, 100); - window.setTimeout(completeTest, 0); -}); - -function completeTest() -{ - debug('<br /><span class="pass">TEST COMPLETE</span>'); - window.layoutTestController.notifyDone(); -} -window.layoutTestController.waitUntilDone(); - -var isAsynchronous = true; -var successfullyParsed = true; diff --git a/LayoutTests/fast/dom/Geolocation/resources/permission-denied.js b/LayoutTests/fast/dom/Geolocation/resources/permission-denied.js deleted file mode 100644 index 1915469..0000000 --- a/LayoutTests/fast/dom/Geolocation/resources/permission-denied.js +++ /dev/null @@ -1,20 +0,0 @@ -description("Tests Geolocation when permission is denied, using the mock service."); - -window.layoutTestController.setGeolocationPermission(false); -window.layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100); - -var error; -navigator.geolocation.getCurrentPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - window.layoutTestController.notifyDone(); -}, function(e) { - error = e - shouldBe('error.code', 'error.PERMISSION_DENIED'); - shouldBe('error.message', '"User denied Geolocation"'); - debug('<br /><span class="pass">TEST COMPLETE</span>'); - window.layoutTestController.notifyDone(); -}); -window.layoutTestController.waitUntilDone(); - -var isAsynchronous = true; -var successfullyParsed = true; diff --git a/LayoutTests/fast/dom/Geolocation/resources/position-string.js b/LayoutTests/fast/dom/Geolocation/resources/position-string.js deleted file mode 100644 index 6365fca..0000000 --- a/LayoutTests/fast/dom/Geolocation/resources/position-string.js +++ /dev/null @@ -1,30 +0,0 @@ -description("Tests formatting of position.toString()."); - -var mockLatitude = 51.478; -var mockLongitude = -0.166; -var mockAccuracy = 100.0; - -window.layoutTestController.setGeolocationPermission(true); -window.layoutTestController.setMockGeolocationPosition(mockLatitude, - mockLongitude, - mockAccuracy); - -var position; -navigator.geolocation.getCurrentPosition(function(p) { - // shouldBe can't use local variables yet. - position = p - shouldBe('position.coords.latitude', 'mockLatitude'); - shouldBe('position.coords.longitude', 'mockLongitude'); - shouldBe('position.coords.accuracy', 'mockAccuracy'); - shouldBe('position.toString()', '"[object Geoposition]"'); - shouldBe('position.coords.toString()', '"[object Coordinates]"'); - debug('<br /><span class="pass">TEST COMPLETE</span>'); - window.layoutTestController.notifyDone(); -}, function(e) { - testFailed('Error callback invoked unexpectedly'); - window.layoutTestController.notifyDone(); -}); -window.layoutTestController.waitUntilDone(); - -var isAsynchronous = true; -var successfullyParsed = true; diff --git a/LayoutTests/fast/dom/Geolocation/resources/reentrant-error.js b/LayoutTests/fast/dom/Geolocation/resources/reentrant-error.js deleted file mode 100644 index 32858bf..0000000 --- a/LayoutTests/fast/dom/Geolocation/resources/reentrant-error.js +++ /dev/null @@ -1,47 +0,0 @@ -description("Tests that reentrant calls to Geolocation methods from the error callback are OK."); - -var mockCode = 0; -var mockMessage = 'test'; - -window.layoutTestController.setMockGeolocationError(mockCode, mockMessage); - -var error; -var errorCallbackInvoked = false; -navigator.geolocation.getCurrentPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - window.layoutTestController.notifyDone(); -}, function(e) { - if (errorCallbackInvoked) { - testFailed('Error callback invoked unexpectedly'); - window.layoutTestController.notifyDone(); - } - errorCallbackInvoked = true; - - error = e; - shouldBe('error.code', 'mockCode'); - shouldBe('error.message', 'mockMessage'); - debug(''); - continueTest(); -}); - -function continueTest() { - mockCode += 1; - mockMessage += ' repeat'; - - window.layoutTestController.setMockGeolocationError(mockCode, mockMessage); - - navigator.geolocation.getCurrentPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - window.layoutTestController.notifyDone(); - }, function(e) { - error = e; - shouldBe('error.code', 'mockCode'); - shouldBe('error.message', 'mockMessage'); - debug('<br /><span class="pass">TEST COMPLETE</span>'); - window.layoutTestController.notifyDone(); - }); -} -window.layoutTestController.waitUntilDone(); - -var isAsynchronous = true; -var successfullyParsed = true; diff --git a/LayoutTests/fast/dom/Geolocation/resources/reentrant-success.js b/LayoutTests/fast/dom/Geolocation/resources/reentrant-success.js deleted file mode 100644 index 12dfe39..0000000 --- a/LayoutTests/fast/dom/Geolocation/resources/reentrant-success.js +++ /dev/null @@ -1,52 +0,0 @@ -description("Tests that reentrant calls to Geolocation methods from the success callback are OK."); - -var mockLatitude = 51.478; -var mockLongitude = -0.166; -var mockAccuracy = 100.0; - -window.layoutTestController.setGeolocationPermission(true); -window.layoutTestController.setMockGeolocationPosition(mockLatitude, - mockLongitude, - mockAccuracy); - -var position; -var successCallbackInvoked = false; -navigator.geolocation.getCurrentPosition(function(p) { - if (successCallbackInvoked) { - testFailed('Success callback invoked unexpectedly'); - window.layoutTestController.notifyDone(); - } - successCallbackInvoked = true; - - position = p; - shouldBe('position.coords.latitude', 'mockLatitude'); - shouldBe('position.coords.longitude', 'mockLongitude'); - shouldBe('position.coords.accuracy', 'mockAccuracy'); - debug(''); - continueTest(); -}, function(e) { - testFailed('Error callback invoked unexpectedly'); - window.layoutTestController.notifyDone(); -}); - -function continueTest() { - window.layoutTestController.setMockGeolocationPosition(++mockLatitude, - ++mockLongitude, - ++mockAccuracy); - - navigator.geolocation.getCurrentPosition(function(p) { - position = p; - shouldBe('position.coords.latitude', 'mockLatitude'); - shouldBe('position.coords.longitude', 'mockLongitude'); - shouldBe('position.coords.accuracy', 'mockAccuracy'); - debug('<br /><span class="pass">TEST COMPLETE</span>'); - window.layoutTestController.notifyDone(); - }, function(e) { - testFailed('Error callback invoked unexpectedly'); - window.layoutTestController.notifyDone(); - }); -} -window.layoutTestController.waitUntilDone(); - -var isAsynchronous = true; -var successfullyParsed = true; diff --git a/LayoutTests/fast/dom/Geolocation/resources/success.js b/LayoutTests/fast/dom/Geolocation/resources/success.js deleted file mode 100644 index c5f566f..0000000 --- a/LayoutTests/fast/dom/Geolocation/resources/success.js +++ /dev/null @@ -1,27 +0,0 @@ -description("Tests Geolocation success callback using the mock service."); - -var mockLatitude = 51.478; -var mockLongitude = -0.166; -var mockAccuracy = 100; - -window.layoutTestController.setGeolocationPermission(true); -window.layoutTestController.setMockGeolocationPosition(mockLatitude, - mockLongitude, - mockAccuracy); - -var position; -navigator.geolocation.getCurrentPosition(function(p) { - position = p - shouldBe('position.coords.latitude', 'mockLatitude'); - shouldBe('position.coords.longitude', 'mockLongitude'); - shouldBe('position.coords.accuracy', 'mockAccuracy'); - debug('<br /><span class="pass">TEST COMPLETE</span>'); - window.layoutTestController.notifyDone(); -}, function(e) { - testFailed('Error callback invoked unexpectedly'); - window.layoutTestController.notifyDone(); -}); -window.layoutTestController.waitUntilDone(); - -var isAsynchronous = true; -var successfullyParsed = true; diff --git a/LayoutTests/fast/dom/Geolocation/resources/timeout-clear-watch.js b/LayoutTests/fast/dom/Geolocation/resources/timeout-clear-watch.js deleted file mode 100644 index e9d247a..0000000 --- a/LayoutTests/fast/dom/Geolocation/resources/timeout-clear-watch.js +++ /dev/null @@ -1,27 +0,0 @@ -description("Tests that when a watch times out and is cleared from the error callback, there is no crash. This a regression test for https://bugs.webkit.org/show_bug.cgi?id=32111."); - -window.layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100.0); - -var error; -var watchId = navigator.geolocation.watchPosition(function() { - testFailed('Success callback invoked unexpectedly'); - window.layoutTestController.notifyDone(); -}, function(e) { - error = e - shouldBe('error.code', 'error.TIMEOUT'); - shouldBe('error.message', '"Timeout expired"'); - navigator.geolocation.clearWatch(watchId); - window.setTimeout(completeTest, 0); -}, { - timeout: 0 -}); - -function completeTest() -{ - debug('<br /><span class="pass">TEST COMPLETE</span>'); - window.layoutTestController.notifyDone(); -} -window.layoutTestController.waitUntilDone(); - -var isAsynchronous = true; -var successfullyParsed = true; diff --git a/LayoutTests/fast/dom/Geolocation/resources/timeout-zero.js b/LayoutTests/fast/dom/Geolocation/resources/timeout-zero.js deleted file mode 100644 index 8a930d9..0000000 --- a/LayoutTests/fast/dom/Geolocation/resources/timeout-zero.js +++ /dev/null @@ -1,21 +0,0 @@ -description("Tests that when timeout is zero (and maximumAge is too), the error callback is called immediately with code TIMEOUT."); - -layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100.0); - -var error; -navigator.geolocation.getCurrentPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - window.layoutTestController.notifyDone(); -}, function(e) { - error = e - shouldBe('error.code', 'error.TIMEOUT'); - shouldBe('error.message', '"Timeout expired"'); - debug('<br /><span class="pass">TEST COMPLETE</span>'); - window.layoutTestController.notifyDone(); -}, { - timeout: 0 -}); -window.layoutTestController.waitUntilDone(); - -var isAsynchronous = true; -var successfullyParsed = true; diff --git a/LayoutTests/fast/dom/Geolocation/resources/timeout.js b/LayoutTests/fast/dom/Geolocation/resources/timeout.js deleted file mode 100644 index d4fa1a7..0000000 --- a/LayoutTests/fast/dom/Geolocation/resources/timeout.js +++ /dev/null @@ -1,29 +0,0 @@ -description("Tests that when timeout is non-zero, the success callback is called as expected."); - -var mockLatitude = 51.478; -var mockLongitude = -0.166; -var mockAccuracy = 100.0; - -window.layoutTestController.setGeolocationPermission(true); -window.layoutTestController.setMockGeolocationPosition(mockLatitude, - mockLongitude, - mockAccuracy); - -var position; -navigator.geolocation.getCurrentPosition(function(p) { - position = p; - shouldBe('position.coords.latitude', 'mockLatitude'); - shouldBe('position.coords.longitude', 'mockLongitude'); - shouldBe('position.coords.accuracy', 'mockAccuracy'); - debug('<br /><span class="pass">TEST COMPLETE</span>'); - window.layoutTestController.notifyDone(); -}, function(e) { - testFailed('Error callback invoked unexpectedly'); - window.layoutTestController.notifyDone(); -}, { - timeout: 1000 -}); -window.layoutTestController.waitUntilDone(); - -var isAsynchronous = true; -var successfullyParsed = true; diff --git a/LayoutTests/fast/dom/Geolocation/resources/watch.js b/LayoutTests/fast/dom/Geolocation/resources/watch.js deleted file mode 100644 index dbf4272..0000000 --- a/LayoutTests/fast/dom/Geolocation/resources/watch.js +++ /dev/null @@ -1,65 +0,0 @@ -description("Tests that watchPosition correctly reports position updates and errors from the Geolocation service."); - -var mockLatitude = 51.478; -var mockLongitude = -0.166; -var mockAccuracy = 100.0; - -var mockCode = 1; -var mockMessage = 'test'; - -var position; -var error; - -function checkPosition(p) { - position = p; - shouldBe('position.coords.latitude', 'mockLatitude'); - shouldBe('position.coords.longitude', 'mockLongitude'); - shouldBe('position.coords.accuracy', 'mockAccuracy'); - debug(''); -} - -function checkError(e) { - error = e; - shouldBe('error.code', 'mockCode'); - shouldBe('error.message', 'mockMessage'); - debug(''); -} - -window.layoutTestController.setGeolocationPermission(true); -window.layoutTestController.setMockGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy); - -var state = 0; -navigator.geolocation.watchPosition(function(p) { - switch (state++) { - case 0: - checkPosition(p); - window.layoutTestController.setMockGeolocationPosition(++mockLatitude, ++mockLongitude, ++mockAccuracy); - break; - case 1: - checkPosition(p); - window.layoutTestController.setMockGeolocationError(mockCode, mockMessage); - break; - case 3: - checkPosition(p); - debug('<br /><span class="pass">TEST COMPLETE</span>'); - window.layoutTestController.notifyDone(); - break; - default: - testFailed('Success callback invoked unexpectedly'); - window.layoutTestController.notifyDone(); - } -}, function(e) { - switch (state++) { - case 2: - checkError(e); - window.layoutTestController.setMockGeolocationPosition(++mockLatitude, ++mockLongitude, ++mockAccuracy); - break; - default: - testFailed('Error callback invoked unexpectedly'); - window.layoutTestController.notifyDone(); - } -}); -window.layoutTestController.waitUntilDone(); - -var isAsynchronous = true; -var successfullyParsed = true; |