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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/reentrant-error.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 that reentrant calls to Geolocation methods from the error ca llback are OK.");
2
3 var mockMessage = 'test';
4
5 var error;
6
7 geolocationServiceMock.then(mock => {
8 mock.setGeolocationPermission(true);
9 mock.setGeolocationPositionUnavailableError(mockMessage);
10
11 var errorCallbackInvoked = false;
12 navigator.geolocation.getCurrentPosition(function(p) {
13 testFailed('Success callback invoked unexpectedly');
14 finishJSTest();
15 }, function(e) {
16 if (errorCallbackInvoked) {
17 testFailed('Error callback invoked unexpectedly');
18 finishJSTest();
19 }
20 errorCallbackInvoked = true;
21
22 error = e;
23 shouldBe('error.code', 'error.POSITION_UNAVAILABLE');
24 shouldBe('error.message', 'mockMessage');
25 debug('');
26 continueTest();
27 });
28
29 function continueTest() {
30 mockMessage += ' repeat';
31
32 mock.setGeolocationPositionUnavailableError(mockMessage);
33
34 navigator.geolocation.getCurrentPosition(function(p) {
35 testFailed('Success callback invoked unexpectedly');
36 finishJSTest();
37 }, function(e) {
38 error = e;
39 shouldBe('error.code', 'error.POSITION_UNAVAILABLE');
40 shouldBe('error.message', 'mockMessage');
41 finishJSTest();
42 });
43 }
44 });
45
46 window.jsTestIsAsync = true;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698