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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/multiple-requests.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 Geolocation correctly handles multiple concurrent reques ts."); 1 description("Tests that Geolocation correctly handles multiple concurrent reques ts.");
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; 5 var mockAccuracy = 100;
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 var watchCallbackInvoked = false; 8 var watchCallbackInvoked = false;
12 var oneShotCallbackInvoked = false; 9 var oneShotCallbackInvoked = false;
13 10
14 geolocationServiceMock.then(mock => { 11 geolocationServiceMock.then(mock => {
15 mock.setGeolocationPermission(true); 12 mock.setGeolocationPermission(true);
16 mock.setGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy); 13 mock.setGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy);
17 14
18 navigator.geolocation.watchPosition(function(p) { 15 navigator.geolocation.watchPosition(function(p) {
19 shouldBeFalse('watchCallbackInvoked'); 16 shouldBeFalse('watchCallbackInvoked');
(...skipping 17 matching lines...) Expand all
37 position = p; 34 position = p;
38 shouldBe('position.coords.latitude', 'mockLatitude'); 35 shouldBe('position.coords.latitude', 'mockLatitude');
39 shouldBe('position.coords.longitude', 'mockLongitude'); 36 shouldBe('position.coords.longitude', 'mockLongitude');
40 shouldBe('position.coords.accuracy', 'mockAccuracy'); 37 shouldBe('position.coords.accuracy', 'mockAccuracy');
41 if (watchCallbackInvoked && oneShotCallbackInvoked) 38 if (watchCallbackInvoked && oneShotCallbackInvoked)
42 finishJSTest(); 39 finishJSTest();
43 } 40 }
44 }); 41 });
45 42
46 window.jsTestIsAsync = true; 43 window.jsTestIsAsync = true;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698