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/position-string.html b/third_party/WebKit/LayoutTests/geolocation-api/position-string.html
index 8e15f533..0705ec4 100644
--- a/third_party/WebKit/LayoutTests/geolocation-api/position-string.html
+++ b/third_party/WebKit/LayoutTests/geolocation-api/position-string.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>
@@ -15,25 +17,24 @@
 
 var position;
 
-geolocationMock.then(mock => {
-    mock.setGeolocationPermission(true);
-    mock.setGeolocationPosition(mockLatitude,
-                                mockLongitude,
-                                mockAccuracy);
+let mock = geolocationMock;
+mock.setGeolocationPermission(true);
+mock.setGeolocationPosition(mockLatitude,
+                            mockLongitude,
+                            mockAccuracy);
 
-    navigator.geolocation.getCurrentPosition(function(p) {
-        // shouldBe can't use local variables yet.
-        position = p;
-        shouldBe('position.coords.latitude', 'mockLatitude');
-        shouldBe('position.coords.longitude', 'mockLongitude');
-        shouldBe('position.coords.accuracy', 'mockAccuracy');
-        shouldBe('position.toString()', '"[object Position]"');
-        shouldBe('position.coords.toString()', '"[object Coordinates]"');
-        finishJSTest();
-    }, function(e) {
-        testFailed('Error callback invoked unexpectedly');
-        finishJSTest();
-    });
+navigator.geolocation.getCurrentPosition(function(p) {
+    // shouldBe can't use local variables yet.
+    position = p;
+    shouldBe('position.coords.latitude', 'mockLatitude');
+    shouldBe('position.coords.longitude', 'mockLongitude');
+    shouldBe('position.coords.accuracy', 'mockAccuracy');
+    shouldBe('position.toString()', '"[object Position]"');
+    shouldBe('position.coords.toString()', '"[object Coordinates]"');
+    finishJSTest();
+}, function(e) {
+    testFailed('Error callback invoked unexpectedly');
+    finishJSTest();
 });
 
 window.jsTestIsAsync = true;