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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/error.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 Geolocation error callback using the mock service."); 1 description("Tests Geolocation error callback using the mock service.");
2 2
3 var mockMessage = "debug"; 3 var mockMessage = "debug";
4 4
5 if (!window.testRunner || !window.mojo)
6 debug('This test can not run without testRunner or mojo');
7
8 var error; 5 var error;
9 6
10 geolocationServiceMock.then(mock => { 7 geolocationServiceMock.then(mock => {
11 mock.setGeolocationPermission(true); 8 mock.setGeolocationPermission(true);
12 mock.setGeolocationPositionUnavailableError(mockMessage); 9 mock.setGeolocationPositionUnavailableError(mockMessage);
13 10
14 navigator.geolocation.getCurrentPosition(function(p) { 11 navigator.geolocation.getCurrentPosition(function(p) {
15 testFailed('Success callback invoked unexpectedly'); 12 testFailed('Success callback invoked unexpectedly');
16 finishJSTest(); 13 finishJSTest();
17 }, function(e) { 14 }, function(e) {
18 error = e; 15 error = e;
19 shouldBe('error.code', 'error.POSITION_UNAVAILABLE'); 16 shouldBe('error.code', 'error.POSITION_UNAVAILABLE');
20 shouldBe('error.message', 'mockMessage'); 17 shouldBe('error.message', 'mockMessage');
21 shouldBe('error.UNKNOWN_ERROR', 'undefined'); 18 shouldBe('error.UNKNOWN_ERROR', 'undefined');
22 shouldBe('error.PERMISSION_DENIED', '1'); 19 shouldBe('error.PERMISSION_DENIED', '1');
23 shouldBe('error.POSITION_UNAVAILABLE', '2'); 20 shouldBe('error.POSITION_UNAVAILABLE', '2');
24 shouldBe('error.TIMEOUT', '3'); 21 shouldBe('error.TIMEOUT', '3');
25 finishJSTest(); 22 finishJSTest();
26 }); 23 });
27 }); 24 });
28 25
29 window.jsTestIsAsync = true; 26 window.jsTestIsAsync = true;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698