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

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

Issue 2667393002: Stop using script-tests in fast/dom/. (Closed)
Patch Set: . Created 3 years, 10 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
(Empty)
1 description("Tests formatting of position.toString().");
2
3 var mockLatitude = 51.478;
4 var mockLongitude = -0.166;
5 var mockAccuracy = 100.0;
6
7 var position;
8
9 geolocationServiceMock.then(mock => {
10 mock.setGeolocationPermission(true);
11 mock.setGeolocationPosition(mockLatitude,
12 mockLongitude,
13 mockAccuracy);
14
15 navigator.geolocation.getCurrentPosition(function(p) {
16 // shouldBe can't use local variables yet.
17 position = p;
18 shouldBe('position.coords.latitude', 'mockLatitude');
19 shouldBe('position.coords.longitude', 'mockLongitude');
20 shouldBe('position.coords.accuracy', 'mockAccuracy');
21 shouldBe('position.toString()', '"[object Geoposition]"');
22 shouldBe('position.coords.toString()', '"[object Coordinates]"');
23 finishJSTest();
24 }, function(e) {
25 testFailed('Error callback invoked unexpectedly');
26 finishJSTest();
27 });
28 });
29
30 window.jsTestIsAsync = true;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698