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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/Geolocation/reentrant-error.html

Issue 2671933003: Move Geolocation out from 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 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 <script src="../../../resources/mojo-helpers.js"></script>
6 <script src="resources/geolocation-mock.js"></script>
7 </head>
8 <body>
9 <script>
10 description("Tests that reentrant calls to Geolocation methods from the error ca llback are OK.");
11
12 var mockMessage = 'test';
13
14 var error;
15
16 geolocationServiceMock.then(mock => {
17 mock.setGeolocationPermission(true);
18 mock.setGeolocationPositionUnavailableError(mockMessage);
19
20 var errorCallbackInvoked = false;
21 navigator.geolocation.getCurrentPosition(function(p) {
22 testFailed('Success callback invoked unexpectedly');
23 finishJSTest();
24 }, function(e) {
25 if (errorCallbackInvoked) {
26 testFailed('Error callback invoked unexpectedly');
27 finishJSTest();
28 }
29 errorCallbackInvoked = true;
30
31 error = e;
32 shouldBe('error.code', 'error.POSITION_UNAVAILABLE');
33 shouldBe('error.message', 'mockMessage');
34 debug('');
35 continueTest();
36 });
37
38 function continueTest() {
39 mockMessage += ' repeat';
40
41 mock.setGeolocationPositionUnavailableError(mockMessage);
42
43 navigator.geolocation.getCurrentPosition(function(p) {
44 testFailed('Success callback invoked unexpectedly');
45 finishJSTest();
46 }, function(e) {
47 error = e;
48 shouldBe('error.code', 'error.POSITION_UNAVAILABLE');
49 shouldBe('error.message', 'mockMessage');
50 finishJSTest();
51 });
52 }
53 });
54
55 window.jsTestIsAsync = true;
56 </script>
57 </body>
58 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698