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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/powerfulFeatureRestrictions/resources/geolocation.html

Issue 1948033003: Convert most geolocation layout tests to use a JS mock implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permission-disconnect
Patch Set: Created 4 years, 7 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/http/tests/security/powerfulFeatureRestrictions/resources/geolocation.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/powerfulFeatureRestrictions/resources/geolocation.html b/third_party/WebKit/LayoutTests/http/tests/security/powerfulFeatureRestrictions/resources/geolocation.html
index 5b8b23bac4fcb6c67d1c7b2602ce9c4577247cb8..61d221e95d0284c52278e8959804db9fddd194c1 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/powerfulFeatureRestrictions/resources/geolocation.html
+++ b/third_party/WebKit/LayoutTests/http/tests/security/powerfulFeatureRestrictions/resources/geolocation.html
@@ -1,25 +1,25 @@
<!DOCTYPE html>
<title>Geolocation On A Secure Origin</title>
+<script src="/js-test-resources/mojo-helpers.js"></script>
+<script src="/fast/dom/Geolocation/js-test-resources/geolocation-mock.js"></script>
<script>
var mockLatitude = 51.478;
var mockLongitude = -0.166;
var mockAccuracy = 100.0;
-if (!window.internals)
- console.error('This test can not run without internals');
+if (!window.mojo)
+ console.error('This test can not run without mojo');
-internals.setGeolocationClientMock(document);
-internals.setGeolocationPermission(document, true);
-internals.setGeolocationPosition(document,
- mockLatitude,
- mockLongitude,
- mockAccuracy);
+geolocationServiceMock.then(mock => {
+ mock.setGeolocationPermission(true);
+ mock.setGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy);
-navigator.geolocation.getCurrentPosition(
- function () {
- window.parent.postMessage({ success: true }, "*");
- },
- function (error) {
- window.parent.postMessage({ message: error.message }, "*");
- }, { maximumAge: 10000 });
+ navigator.geolocation.getCurrentPosition(
+ function () {
+ window.parent.postMessage({ success: true }, "*");
+ },
+ function (error) {
+ window.parent.postMessage({ message: error.message }, "*");
+ }, { maximumAge: 10000 });
+});
</script>

Powered by Google App Engine
This is Rietveld 408576698