Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/timeout.js

Issue 2642873002: Moves mojo.define -> gin.define. (Closed)
Patch Set: rebaseline Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 description("Tests that when timeout is non-zero, the success callback is called as expected."); 1 description("Tests that when timeout is non-zero, the success callback is called as expected.");
2 2
3 var mockLatitude = 51.478; 3 var mockLatitude = 51.478;
4 var mockLongitude = -0.166; 4 var mockLongitude = -0.166;
5 var mockAccuracy = 100.0; 5 var mockAccuracy = 100.0;
6 6
7 if (!window.testRunner || !window.mojo)
8 debug('This test can not run without testRunner or mojo');
9
10 var position; 7 var position;
11 8
12 geolocationServiceMock.then(mock => { 9 geolocationServiceMock.then(mock => {
13 mock.setGeolocationPermission(true); 10 mock.setGeolocationPermission(true);
14 mock.setGeolocationPosition(mockLatitude, 11 mock.setGeolocationPosition(mockLatitude,
15 mockLongitude, 12 mockLongitude,
16 mockAccuracy); 13 mockAccuracy);
17 14
18 navigator.geolocation.getCurrentPosition(function(p) { 15 navigator.geolocation.getCurrentPosition(function(p) {
19 position = p; 16 position = p;
20 shouldBe('position.coords.latitude', 'mockLatitude'); 17 shouldBe('position.coords.latitude', 'mockLatitude');
21 shouldBe('position.coords.longitude', 'mockLongitude'); 18 shouldBe('position.coords.longitude', 'mockLongitude');
22 shouldBe('position.coords.accuracy', 'mockAccuracy'); 19 shouldBe('position.coords.accuracy', 'mockAccuracy');
23 finishJSTest(); 20 finishJSTest();
24 }, function(e) { 21 }, function(e) {
25 testFailed('Error callback invoked unexpectedly'); 22 testFailed('Error callback invoked unexpectedly');
26 finishJSTest(); 23 finishJSTest();
27 }, { 24 }, {
28 timeout: 1000 25 timeout: 1000
29 }); 26 });
30 }); 27 });
31 28
32 window.jsTestIsAsync = true; 29 window.jsTestIsAsync = true;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698