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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/permission-service-connection-error.js

Issue 1367853002: Move GeolocationDispatcher into blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/permission-service-connection-error.js
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/permission-service-connection-error.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/permission-service-connection-error.js
new file mode 100644
index 0000000000000000000000000000000000000000..051273d169ee75d57f68cedf4e20b29ff667dac1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/permission-service-connection-error.js
@@ -0,0 +1,25 @@
+description("Tests Geolocation when the permission service connection fails.");
+
+if (!window.testRunner || !window.mojo)
+ debug('This test can not run without testRunner or mojo');
+
+var error;
+
+geolocationServiceMock.then(mock => {
+
+ mock.rejectPermissionConnections();
+ mock.setGeolocationPermission(false);
+ mock.setGeolocationPosition(51.478, -0.166, 100.0);
+
+ navigator.geolocation.getCurrentPosition(function(p) {
+ testFailed('Success callback invoked unexpectedly');
+ finishJSTest();
+ }, function(e) {
+ error = e;
+ shouldBe('error.code', 'error.PERMISSION_DENIED');
+ shouldBe('error.message', '"User denied Geolocation"');
+ finishJSTest();
+ });
+});
+
+window.jsTestIsAsync = true;

Powered by Google App Engine
This is Rietveld 408576698