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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/Geolocation/success.html

Issue 2667393002: Stop using script-tests in fast/dom/. (Closed)
Patch Set: . Created 3 years, 11 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/success.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/success.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/success.html
index d65f5cc8189e2e9e2daa2e54c38b8d3f7e6c1c24..2f3f8547add2beb4dfb24c461db4f98f6a007074 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/success.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/success.html
@@ -6,6 +6,34 @@
<script src="resources/geolocation-mock.js"></script>
</head>
<body>
-<script src="script-tests/success.js"></script>
+<script>
+description("Tests Geolocation success callback using the mock service.");
+
+var mockLatitude = 51.478;
+var mockLongitude = -0.166;
+var mockAccuracy = 100;
+
+var position;
+
+geolocationServiceMock.then(mock => {
+ mock.setGeolocationPermission(true);
+ mock.setGeolocationPosition(mockLatitude,
+ mockLongitude,
+ mockAccuracy);
+
+ navigator.geolocation.getCurrentPosition(function(p) {
+ position = p;
+ shouldBe('position.coords.latitude', 'mockLatitude');
+ shouldBe('position.coords.longitude', 'mockLongitude');
+ shouldBe('position.coords.accuracy', 'mockAccuracy');
+ finishJSTest();
+ }, function(e) {
+ testFailed('Error callback invoked unexpectedly');
+ finishJSTest();
+ });
+});
+
+window.jsTestIsAsync = true;
+</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698