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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/position-string.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 formatting of position.toString()."); 1 description("Tests formatting of position.toString().");
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 // shouldBe can't use local variables yet. 16 // shouldBe can't use local variables yet.
20 position = p; 17 position = p;
21 shouldBe('position.coords.latitude', 'mockLatitude'); 18 shouldBe('position.coords.latitude', 'mockLatitude');
22 shouldBe('position.coords.longitude', 'mockLongitude'); 19 shouldBe('position.coords.longitude', 'mockLongitude');
23 shouldBe('position.coords.accuracy', 'mockAccuracy'); 20 shouldBe('position.coords.accuracy', 'mockAccuracy');
24 shouldBe('position.toString()', '"[object Geoposition]"'); 21 shouldBe('position.toString()', '"[object Geoposition]"');
25 shouldBe('position.coords.toString()', '"[object Coordinates]"'); 22 shouldBe('position.coords.toString()', '"[object Coordinates]"');
26 finishJSTest(); 23 finishJSTest();
27 }, function(e) { 24 }, function(e) {
28 testFailed('Error callback invoked unexpectedly'); 25 testFailed('Error callback invoked unexpectedly');
29 finishJSTest(); 26 finishJSTest();
30 }); 27 });
31 }); 28 });
32 29
33 window.jsTestIsAsync = true; 30 window.jsTestIsAsync = true;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698