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

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

Powered by Google App Engine
This is Rietveld 408576698