Changeset 60667 in webkit
- Timestamp:
- Jun 4, 2010 2:32:19 AM (14 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r60664 r60667 1 2010-06-04 Steve Block <steveblock@google.com> 2 3 Reviewed by Jeremy Orlow. 4 5 Geolocation LayoutTests should make more careful use of LayoutTestController 6 https://bugs.webkit.org/show_bug.cgi?id=39994 7 8 Guards calls to LayoutTestController methods with 'if (window.layoutTestController)' 9 and adds test output to make it clear if the test can not pass without LayoutTestController. 10 Also removes superfluous calls to LayoutTestController.waitUntilDone(), which are now made 11 by js-test-post.js. 12 13 * fast/dom/Geolocation/callback-exception-expected.txt: 14 * fast/dom/Geolocation/script-tests/callback-exception.js: 15 * fast/dom/Geolocation/script-tests/error.js: 16 * fast/dom/Geolocation/script-tests/maximum-age.js: 17 * fast/dom/Geolocation/script-tests/notimer-after-unload.js: 18 * fast/dom/Geolocation/script-tests/permission-denied-already-clear-watch.js: 19 * fast/dom/Geolocation/script-tests/permission-denied-already-error.js: 20 * fast/dom/Geolocation/script-tests/permission-denied-already-success.js: 21 * fast/dom/Geolocation/script-tests/permission-denied-stops-watches.js: 22 * fast/dom/Geolocation/script-tests/permission-denied.js: 23 * fast/dom/Geolocation/script-tests/position-string.js: 24 * fast/dom/Geolocation/script-tests/reentrant-error.js: 25 * fast/dom/Geolocation/script-tests/reentrant-success.js: 26 * fast/dom/Geolocation/script-tests/success.js: 27 * fast/dom/Geolocation/script-tests/timeout-clear-watch.js: 28 * fast/dom/Geolocation/script-tests/timeout-zero.js: 29 * fast/dom/Geolocation/script-tests/timeout.js: 30 * fast/dom/Geolocation/script-tests/watch.js: 31 1 32 2010-06-04 Qi Zhang <qi.2.zhang@nokia.com> 2 33 -
trunk/LayoutTests/fast/dom/Geolocation/callback-exception-expected.txt
r59926 r60667 1 CONSOLE MESSAGE: line 2 2: Error: Exception in success callback1 CONSOLE MESSAGE: line 25: Error: Exception in success callback 2 2 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. 3 3 -
trunk/LayoutTests/fast/dom/Geolocation/script-tests/callback-exception.js
r59926 r60667 5 5 var mockAccuracy = 100; 6 6 7 window.layoutTestController.setGeolocationPermission(true); 8 window.layoutTestController.setMockGeolocationPosition(mockLatitude, 9 mockLongitude, 10 mockAccuracy); 7 if (window.layoutTestController) { 8 layoutTestController.setGeolocationPermission(true); 9 layoutTestController.setMockGeolocationPosition(mockLatitude, 10 mockLongitude, 11 mockAccuracy); 12 } else 13 debug('This test can not be run without the LayoutTestController'); 11 14 12 15 var position; 13 16 navigator.geolocation.getCurrentPosition(function(p) { 14 position = p 17 position = p; 15 18 shouldBe('position.coords.latitude', 'mockLatitude'); 16 19 shouldBe('position.coords.longitude', 'mockLongitude'); … … 26 29 }); 27 30 28 window.layoutTestController.waitUntilDone();29 30 31 window.jsTestIsAsync = true; 31 32 window.successfullyParsed = true; -
trunk/LayoutTests/fast/dom/Geolocation/script-tests/error.js
r60488 r60667 4 4 var mockMessage = "debug"; 5 5 6 window.layoutTestController.setGeolocationPermission(true); 7 window.layoutTestController.setMockGeolocationError(mockCode, mockMessage); 6 if (window.layoutTestController) { 7 layoutTestController.setGeolocationPermission(true); 8 layoutTestController.setMockGeolocationError(mockCode, mockMessage); 9 } else 10 debug('This test can not be run without the LayoutTestController'); 8 11 9 12 var error; … … 12 15 finishJSTest(); 13 16 }, function(e) { 14 error = e 17 error = e; 15 18 shouldBe('error.code', 'mockCode'); 16 19 shouldBe('error.message', 'mockMessage'); … … 21 24 finishJSTest(); 22 25 }); 23 window.layoutTestController.waitUntilDone();24 26 25 27 window.jsTestIsAsync = true; -
trunk/LayoutTests/fast/dom/Geolocation/script-tests/maximum-age.js
r60488 r60667 26 26 } 27 27 28 window.layoutTestController.setGeolocationPermission(true); 29 window.layoutTestController.setMockGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy); 28 if (window.layoutTestController) { 29 layoutTestController.setGeolocationPermission(true); 30 layoutTestController.setMockGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy); 31 } else 32 debug('This test can not be run without the LayoutTestController'); 30 33 31 34 // Initialize the cached Position … … 40 43 function testZeroMaximumAge() { 41 44 // Update the position provided by the mock service. 42 window.layoutTestController.setMockGeolocationPosition(++mockLatitude, ++mockLongitude, ++mockAccuracy); 45 if (window.layoutTestController) 46 layoutTestController.setMockGeolocationPosition(++mockLatitude, ++mockLongitude, ++mockAccuracy); 43 47 // The default maximumAge is zero, so we expect the updated position from the service. 44 48 navigator.geolocation.getCurrentPosition(function(p) { … … 53 57 function testNonZeroMaximumAge() { 54 58 // Update the mock service to report an error. 55 window.layoutTestController.setMockGeolocationError(mockCode, mockMessage); 59 if (window.layoutTestController) 60 layoutTestController.setMockGeolocationError(mockCode, mockMessage); 56 61 // The maximumAge is non-zero, so we expect the cached position, not the error from the service. 57 62 navigator.geolocation.getCurrentPosition(function(p) { … … 75 80 } 76 81 77 window.layoutTestController.waitUntilDone();78 79 82 window.jsTestIsAsync = true; 80 83 window.successfullyParsed = true; -
trunk/LayoutTests/fast/dom/Geolocation/script-tests/notimer-after-unload.js
r59926 r60667 18 18 window.jsTestIsAsync = true; 19 19 window.successfullyParsed = true; 20 21 if (window.layoutTestController) layoutTestController.waitUntilDone(); -
trunk/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-clear-watch.js
r59926 r60667 2 2 3 3 // Prime the Geolocation instance by denying permission. 4 window.layoutTestController.setGeolocationPermission(false); 5 window.layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100); 4 if (window.layoutTestController) { 5 layoutTestController.setGeolocationPermission(false); 6 layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100); 7 } else 8 debug('This test can not be run without the LayoutTestController'); 6 9 7 10 var error; … … 10 13 finishJSTest(); 11 14 }, function(e) { 12 error = e 15 error = e; 13 16 shouldBe('error.code', 'error.PERMISSION_DENIED'); 14 17 shouldBe('error.message', '"User denied Geolocation"'); … … 24 27 finishJSTest(); 25 28 }, function(e) { 26 error = e 29 error = e; 27 30 shouldBe('error.code', 'error.PERMISSION_DENIED'); 28 31 shouldBe('error.message', '"User denied Geolocation"'); … … 32 35 } 33 36 34 window.layoutTestController.waitUntilDone();35 36 37 window.jsTestIsAsync = true; 37 38 window.successfullyParsed = true; -
trunk/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-error.js
r59926 r60667 2 2 3 3 // Prime the Geolocation instance by denying permission. 4 window.layoutTestController.setGeolocationPermission(false); 5 window.layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100); 4 if (window.layoutTestController) { 5 layoutTestController.setGeolocationPermission(false); 6 layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100); 7 } else 8 debug('This test can not be run without the LayoutTestController'); 6 9 7 10 var error; … … 10 13 finishJSTest(); 11 14 }, function(e) { 12 error = e 15 error = e; 13 16 shouldBe('error.code', 'error.PERMISSION_DENIED'); 14 17 shouldBe('error.message', '"User denied Geolocation"'); … … 20 23 { 21 24 // Make another request, with permission already denied. 22 window.layoutTestController.setMockGeolocationError(0, 'test'); 25 if (window.layoutTestController) 26 layoutTestController.setMockGeolocationError(0, 'test'); 23 27 24 28 navigator.geolocation.getCurrentPosition(function(p) { … … 26 30 finishJSTest(); 27 31 }, function(e) { 28 error = e 32 error = e; 29 33 shouldBe('error.code', 'error.PERMISSION_DENIED'); 30 34 shouldBe('error.message', '"User denied Geolocation"'); … … 32 36 }); 33 37 } 34 window.layoutTestController.waitUntilDone();35 38 36 39 window.jsTestIsAsync = true; -
trunk/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-success.js
r59926 r60667 2 2 3 3 // Prime the Geolocation instance by denying permission. 4 window.layoutTestController.setGeolocationPermission(false); 5 window.layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100); 4 if (window.layoutTestController) { 5 layoutTestController.setGeolocationPermission(false); 6 layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100); 7 } else 8 debug('This test can not be run without the LayoutTestController'); 6 9 7 10 var error; … … 10 13 finishJSTest(); 11 14 }, function(e) { 12 error = e 15 error = e; 13 16 shouldBe('error.code', 'error.PERMISSION_DENIED'); 14 17 shouldBe('error.message', '"User denied Geolocation"'); … … 24 27 finishJSTest(); 25 28 }, function(e) { 26 error = e 29 error = e; 27 30 shouldBe('error.code', 'error.PERMISSION_DENIED'); 28 31 shouldBe('error.message', '"User denied Geolocation"'); … … 30 33 }); 31 34 } 32 window.layoutTestController.waitUntilDone();33 35 34 36 window.jsTestIsAsync = true; -
trunk/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-stops-watches.js
r59926 r60667 3 3 // Configure the mock Geolocation service to report a position to cause permission 4 4 // to be requested, then deny it. 5 window.layoutTestController.setGeolocationPermission(false); 6 window.layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100.0); 5 if (window.layoutTestController) { 6 layoutTestController.setGeolocationPermission(false); 7 layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100.0); 8 } else 9 debug('This test can not be run without the LayoutTestController'); 7 10 8 11 var error; … … 18 21 errorCallbackInvoked = true; 19 22 20 error = e 23 error = e; 21 24 shouldBe('error.code', 'error.PERMISSION_DENIED'); 22 25 shouldBe('error.message', '"User denied Geolocation"'); … … 24 27 // Update the mock Geolocation service to report a new position, then 25 28 // yield to allow a chance for the success callback to be invoked. 26 window.layoutTestController.setMockGeolocationPosition(55.478, -0.166, 100); 29 if (window.layoutTestController) 30 layoutTestController.setMockGeolocationPosition(55.478, -0.166, 100); 27 31 window.setTimeout(finishJSTest, 0); 28 32 }); 29 33 30 window.layoutTestController.waitUntilDone();31 34 32 35 window.jsTestIsAsync = true; -
trunk/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied.js
r59926 r60667 1 1 description("Tests Geolocation when permission is denied, using the mock service."); 2 2 3 window.layoutTestController.setGeolocationPermission(false); 4 window.layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100); 3 if (window.layoutTestController) { 4 layoutTestController.setGeolocationPermission(false); 5 layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100.0); 6 } else 7 debug('This test can not be run without the LayoutTestController'); 5 8 6 9 var error; … … 9 12 finishJSTest(); 10 13 }, function(e) { 11 error = e 14 error = e; 12 15 shouldBe('error.code', 'error.PERMISSION_DENIED'); 13 16 shouldBe('error.message', '"User denied Geolocation"'); 14 17 finishJSTest(); 15 18 }); 16 window.layoutTestController.waitUntilDone();17 19 18 20 window.jsTestIsAsync = true; -
trunk/LayoutTests/fast/dom/Geolocation/script-tests/position-string.js
r59926 r60667 5 5 var mockAccuracy = 100.0; 6 6 7 window.layoutTestController.setGeolocationPermission(true); 8 window.layoutTestController.setMockGeolocationPosition(mockLatitude, 9 mockLongitude, 10 mockAccuracy); 7 if (window.layoutTestController) { 8 layoutTestController.setGeolocationPermission(true); 9 layoutTestController.setMockGeolocationPosition(mockLatitude, 10 mockLongitude, 11 mockAccuracy); 12 } else 13 debug('This test can not be run without the LayoutTestController'); 11 14 12 15 var position; 13 16 navigator.geolocation.getCurrentPosition(function(p) { 14 17 // shouldBe can't use local variables yet. 15 position = p 18 position = p; 16 19 shouldBe('position.coords.latitude', 'mockLatitude'); 17 20 shouldBe('position.coords.longitude', 'mockLongitude'); … … 24 27 finishJSTest(); 25 28 }); 26 window.layoutTestController.waitUntilDone();27 29 28 30 window.jsTestIsAsync = true; -
trunk/LayoutTests/fast/dom/Geolocation/script-tests/reentrant-error.js
r60488 r60667 4 4 var mockMessage = 'test'; 5 5 6 window.layoutTestController.setGeolocationPermission(true); 7 window.layoutTestController.setMockGeolocationError(mockCode, mockMessage); 6 if (window.layoutTestController) { 7 layoutTestController.setGeolocationPermission(true); 8 layoutTestController.setMockGeolocationError(mockCode, mockMessage); 9 } else 10 debug('This test can not be run without the LayoutTestController'); 8 11 9 12 var error; … … 30 33 mockMessage += ' repeat'; 31 34 32 window.layoutTestController.setMockGeolocationError(mockCode, mockMessage); 35 if (window.layoutTestController) 36 layoutTestController.setMockGeolocationError(mockCode, mockMessage); 33 37 34 38 navigator.geolocation.getCurrentPosition(function(p) { … … 42 46 }); 43 47 } 44 window.layoutTestController.waitUntilDone();45 48 46 49 window.jsTestIsAsync = true; -
trunk/LayoutTests/fast/dom/Geolocation/script-tests/reentrant-success.js
r59926 r60667 5 5 var mockAccuracy = 100.0; 6 6 7 window.layoutTestController.setGeolocationPermission(true); 8 window.layoutTestController.setMockGeolocationPosition(mockLatitude, 9 mockLongitude, 10 mockAccuracy); 7 if (window.layoutTestController) { 8 layoutTestController.setGeolocationPermission(true); 9 layoutTestController.setMockGeolocationPosition(mockLatitude, 10 mockLongitude, 11 mockAccuracy); 12 } else 13 debug('This test can not be run without the LayoutTestController'); 11 14 12 15 var position; … … 31 34 32 35 function continueTest() { 33 window.layoutTestController.setMockGeolocationPosition(++mockLatitude, 34 ++mockLongitude, 35 ++mockAccuracy); 36 if (window.layoutTestController) 37 layoutTestController.setMockGeolocationPosition(++mockLatitude, 38 ++mockLongitude, 39 ++mockAccuracy); 36 40 37 41 navigator.geolocation.getCurrentPosition(function(p) { … … 46 50 }); 47 51 } 48 window.layoutTestController.waitUntilDone();49 52 50 53 window.jsTestIsAsync = true; -
trunk/LayoutTests/fast/dom/Geolocation/script-tests/success.js
r59926 r60667 5 5 var mockAccuracy = 100; 6 6 7 window.layoutTestController.setGeolocationPermission(true); 8 window.layoutTestController.setMockGeolocationPosition(mockLatitude, 9 mockLongitude, 10 mockAccuracy); 7 if (window.layoutTestController) { 8 layoutTestController.setGeolocationPermission(true); 9 layoutTestController.setMockGeolocationPosition(mockLatitude, 10 mockLongitude, 11 mockAccuracy); 12 } else 13 debug('This test can not be run without the LayoutTestController'); 11 14 12 15 var position; 13 16 navigator.geolocation.getCurrentPosition(function(p) { 14 position = p 17 position = p; 15 18 shouldBe('position.coords.latitude', 'mockLatitude'); 16 19 shouldBe('position.coords.longitude', 'mockLongitude'); … … 21 24 finishJSTest(); 22 25 }); 23 window.layoutTestController.waitUntilDone();24 26 25 27 window.jsTestIsAsync = true; -
trunk/LayoutTests/fast/dom/Geolocation/script-tests/timeout-clear-watch.js
r59926 r60667 1 1 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."); 2 2 3 window.layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100.0); 3 if (window.layoutTestController) 4 layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100.0); 4 5 5 6 var error; … … 8 9 finishJSTest(); 9 10 }, function(e) { 10 error = e 11 error = e; 11 12 shouldBe('error.code', 'error.TIMEOUT'); 12 13 shouldBe('error.message', '"Timeout expired"'); … … 17 18 }); 18 19 19 window.layoutTestController.waitUntilDone();20 20 21 21 window.jsTestIsAsync = true; -
trunk/LayoutTests/fast/dom/Geolocation/script-tests/timeout-zero.js
r59926 r60667 1 1 description("Tests that when timeout is zero (and maximumAge is too), the error callback is called immediately with code TIMEOUT."); 2 2 3 layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100.0); 3 if (window.layoutTestController) 4 layoutTestController.setMockGeolocationPosition(51.478, -0.166, 100.0); 4 5 5 6 var error; … … 8 9 finishJSTest(); 9 10 }, function(e) { 10 error = e 11 error = e; 11 12 shouldBe('error.code', 'error.TIMEOUT'); 12 13 shouldBe('error.message', '"Timeout expired"'); … … 15 16 timeout: 0 16 17 }); 17 window.layoutTestController.waitUntilDone();18 18 19 19 window.jsTestIsAsync = true; -
trunk/LayoutTests/fast/dom/Geolocation/script-tests/timeout.js
r59926 r60667 5 5 var mockAccuracy = 100.0; 6 6 7 window.layoutTestController.setGeolocationPermission(true); 8 window.layoutTestController.setMockGeolocationPosition(mockLatitude, 9 mockLongitude, 10 mockAccuracy); 7 if (window.layoutTestController) { 8 layoutTestController.setGeolocationPermission(true); 9 layoutTestController.setMockGeolocationPosition(mockLatitude, 10 mockLongitude, 11 mockAccuracy); 12 } else 13 debug('This test can not be run without the LayoutTestController'); 11 14 12 15 var position; … … 23 26 timeout: 1000 24 27 }); 25 window.layoutTestController.waitUntilDone();26 28 27 29 window.jsTestIsAsync = true; -
trunk/LayoutTests/fast/dom/Geolocation/script-tests/watch.js
r60488 r60667 26 26 } 27 27 28 window.layoutTestController.setGeolocationPermission(true); 29 window.layoutTestController.setMockGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy); 28 if (window.layoutTestController) { 29 layoutTestController.setGeolocationPermission(true); 30 layoutTestController.setMockGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy); 31 } else 32 debug('This test can not be run without the LayoutTestController'); 30 33 31 34 var state = 0; … … 34 37 case 0: 35 38 checkPosition(p); 36 window.layoutTestController.setMockGeolocationPosition(++mockLatitude, ++mockLongitude, ++mockAccuracy); 39 if (window.layoutTestController) 40 layoutTestController.setMockGeolocationPosition(++mockLatitude, ++mockLongitude, ++mockAccuracy); 37 41 break; 38 42 case 1: 39 43 checkPosition(p); 40 window.layoutTestController.setMockGeolocationError(mockCode, mockMessage); 44 if (window.layoutTestController) 45 layoutTestController.setMockGeolocationError(mockCode, mockMessage); 41 46 break; 42 47 case 3: … … 52 57 case 2: 53 58 checkError(e); 54 window.layoutTestController.setMockGeolocationPosition(++mockLatitude, ++mockLongitude, ++mockAccuracy); 59 if (window.layoutTestController) 60 layoutTestController.setMockGeolocationPosition(++mockLatitude, ++mockLongitude, ++mockAccuracy); 55 61 break; 56 62 default: … … 59 65 } 60 66 }); 61 window.layoutTestController.waitUntilDone();62 67 63 68 window.jsTestIsAsync = true;
Note: See TracChangeset
for help on using the changeset viewer.