Switch the Geolocation LayoutTests to the new Mojo JS bindings

This change switches the Geolocation Mojo interface JS bindings to the
new style and updates the LayoutTests accordingly. The Blink Mojo
interfaces are switched to generating both styles of bindings as an
temporary step while some code has not yet been updated.

These tests demonstrate how the DCHECK in ~MojoWatcher is invalid and
so it is removed.

Bug: 699569
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Change-Id: Ie7001384afcdc812218d840c8fd0057360868354
Reviewed-on: https://chromium-review.googlesource.com/560544
Reviewed-by: Kent Tamura <[email protected]>
Reviewed-by: Kentaro Hara <[email protected]>
Reviewed-by: Steve Kobes <[email protected]>
Commit-Queue: Reilly Grant <[email protected]>
Cr-Commit-Position: refs/heads/master@{#485488}
diff --git a/third_party/WebKit/LayoutTests/geolocation-api/cached-position-called-once.html b/third_party/WebKit/LayoutTests/geolocation-api/cached-position-called-once.html
index cd2eb15c..3eb5d6c 100644
--- a/third_party/WebKit/LayoutTests/geolocation-api/cached-position-called-once.html
+++ b/third_party/WebKit/LayoutTests/geolocation-api/cached-position-called-once.html
@@ -2,7 +2,9 @@
 <html>
 <head>
 <script src="../resources/js-test.js"></script>
-<script src="../resources/mojo-helpers.js"></script>
+<script src="file:///gen/layout_test_data/mojo/public/js/mojo_bindings.js"></script>
+<script src="file:///gen/device/geolocation/public/interfaces/geolocation.mojom.js"></script>
+<script src="file:///gen/third_party/WebKit/public/platform/modules/permissions/permission.mojom.js"></script>
 <script src="resources/geolocation-mock.js"></script>
 </head>
 <body>
@@ -38,22 +40,21 @@
     setTimeout(fn, milliseconds);
 }
 
-geolocationMock.then(mock => {
-    mock.setGeolocationPosition(31.478, -0.166, 100);
-    mock.setGeolocationPermission(true);
+let mock = geolocationMock;
+mock.setGeolocationPosition(31.478, -0.166, 100);
+mock.setGeolocationPermission(true);
 
-    // Make a geolocation request to populate the cached value so requests with a
-    // timeout of 0 can succeed.
-    navigator.geolocation.getCurrentPosition(function(position) {
-        // The test terminates at the 3rd reported callback. If the bug still exists
-        // this happens after the 2nd call to getCurrentPosition, one of them is a
-        // repeat of the first.
-        getPosition(0);
-        getPosition(100);
-        getPosition(200);
-    }, function(error) {
-        testFailed('Error callback invoked unexpectedly');
-    });
+// Make a geolocation request to populate the cached value so requests with a
+// timeout of 0 can succeed.
+navigator.geolocation.getCurrentPosition(function(position) {
+    // The test terminates at the 3rd reported callback. If the bug still exists
+    // this happens after the 2nd call to getCurrentPosition, one of them is a
+    // repeat of the first.
+    getPosition(0);
+    getPosition(100);
+    getPosition(200);
+}, function(error) {
+    testFailed('Error callback invoked unexpectedly');
 });
 
 window.jsTestIsAsync = true;