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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/Geolocation/reentrant-permission-denied.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 due to a PERMISSION_DENIED error are OK.");
11
12 var error;
13
14 geolocationServiceMock.then(mock => {
15 mock.setGeolocationPermission(false);
16 mock.setGeolocationPosition(51.478, -0.166, 100.0);
17
18 function checkPermissionError(e) {
19 error = e;
20 shouldBe('error.code', 'error.PERMISSION_DENIED');
21 shouldBe('error.message', '"User denied Geolocation"');
22 }
23
24 var errorCallbackInvoked = false;
25 navigator.geolocation.getCurrentPosition(function(p) {
26 testFailed('Success callback invoked unexpectedly');
27 finishJSTest();
28 }, function(e) {
29 if (errorCallbackInvoked) {
30 testFailed('Error callback invoked unexpectedly');
31 finishJSTest();
32 }
33 errorCallbackInvoked = true;
34 checkPermissionError(e);
35 continueTest();
36 });
37
38 function continueTest() {
39 navigator.geolocation.getCurrentPosition(function(p) {
40 testFailed('Success callback invoked unexpectedly');
41 finishJSTest();
42 }, function(e) {
43 checkPermissionError(e);
44 finishJSTest();
45 });
46 }
47 });
48
49 window.jsTestIsAsync = true;
50 </script>
51 </body>
52 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698