[flutter driver tests] Making hermetic; factoring away test driver

This change makes the flutter driver tests hermetic and factors away the
wrapping in the test driver module and test runner service. Locally at least,
this seems to remove the flakage. In a followup we'll want to add tests that
re-expose the legitimate problems discovered in DX-710.

DX-710 #done
DX-634 #done
IN-991 #done

Test: fx set x64 --available topaz/bundles/buildbot
      fx run-test driver_example_mod_tests
      fx run-test slider_mod_tests
      fx shell runtests
Change-Id: I6571b6415742804776eac7ccb2be42fabd7297ed
diff --git a/examples/test/driver_example_mod/BUILD.gn b/examples/test/driver_example_mod/BUILD.gn
index e65adbd..8ba69e4 100644
--- a/examples/test/driver_example_mod/BUILD.gn
+++ b/examples/test/driver_example_mod/BUILD.gn
@@ -3,7 +3,7 @@
 # found in the LICENSE file.
 
 import("//build/dart/dart_fuchsia_test.gni")
-import("//build/dart/dart_remote_test.gni")
+import("//build/testing/environments.gni")
 import("//topaz/runtime/flutter_runner/flutter_app.gni")
 
 # The main app.
@@ -38,26 +38,31 @@
   ]
 }
 
-# Example of a target test. This can be run on the Fuchsia device using the
-# dart_runner command packaged in //garnet/packages/products/devtools
-#
-# The target application must be runnning on the machine.
-dart_fuchsia_test("driver_example_mod_target_tests") {
-  # TODO(IN-991): Use environments rather than this hack.
-  package_only = true
-
-  sources = []
+# Example of a flutter driver target test. This can be run on the Fuchsia
+# device using fx run-test. The target application must be available on the
+# machine.
+dart_fuchsia_test("driver_example_mod_tests") {
   deps = [
-    ":driver_example_mod_dart_library",
-    "//sdk/fidl/fuchsia.testing.runner",
+    "//sdk/fidl/fuchsia.sys",
     "//third_party/dart-pkg/git/flutter/packages/flutter_driver",
     "//third_party/dart-pkg/pub/test",
+    "//topaz/public/dart/fuchsia_services",
   ]
 
   meta = [
     {
-      path = rebase_path("meta/driver_example_mod_target_tests.cmx")
-      dest = "driver_example_mod_target_tests.cmx"
+      path = rebase_path("meta/driver_example_mod_tests.cmx")
+      dest = "driver_example_mod_tests.cmx"
     },
   ]
+
+  environments = []
+
+  # Flutter driver is only available in debug builds.
+  if (is_debug) {
+    environments += [
+      nuc_env,
+      vim2_env,
+    ]
+  }
 }
diff --git a/examples/test/driver_example_mod/README.md b/examples/test/driver_example_mod/README.md
index 9e5f84c..3fc0df6 100644
--- a/examples/test/driver_example_mod/README.md
+++ b/examples/test/driver_example_mod/README.md
@@ -11,11 +11,11 @@
 mod), run the following:
 
 ```
-$ fx set x64 --packages topaz/packages/all \
-    --packages topaz/packages/examples/tests
+$ fx set [x64|arm64] --available topaz/bundles/buildbot
 ```
 
-This will include the package with the topaz build when you run
+This will include the package and its dependencies with the topaz build when
+you run
 
 ```
 $ fx full-build
@@ -23,15 +23,9 @@
 
 ## Testing
 
-This mod is referenced in
-`//topaz/tests/modular_integration_tests/topaz_modular_integration_tests.json`,
-using the `driver_example_mod` as the mod under test, and the test code built
-from this `BUILD.gn` file as the integration testing code to be run against
-`driver_example_mod`.
-
-You can run these tests using the following command (so long as you've added
-`//topaz/packages/tests/all` as one of the packages for your build):
+You can run these tests using the following command (so long as you've included
+`//topaz/packages/examples/tests` as one of the packages for your build):
 
 ```
-$ fx shell /pkgfs/packages/topaz_modular_integration_tests/0/bin/run_topaz_modular_integration_tests.sh
+$ fx run-test driver_example_mod_tests
 ```
diff --git a/examples/test/driver_example_mod/lib/src/driver_example_model.dart b/examples/test/driver_example_mod/lib/src/driver_example_model.dart
index 2563e92..484854b 100644
--- a/examples/test/driver_example_mod/lib/src/driver_example_model.dart
+++ b/examples/test/driver_example_mod/lib/src/driver_example_model.dart
@@ -1,6 +1,7 @@
 // Copyright 2018 The Fuchsia Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
+
 import 'package:lib.widgets.dart/model.dart';
 
 class DriverExampleModel extends Model {
diff --git a/examples/test/driver_example_mod/meta/driver_example_mod.cmx b/examples/test/driver_example_mod/meta/driver_example_mod.cmx
index 23d4a84..54a41b0 100644
--- a/examples/test/driver_example_mod/meta/driver_example_mod.cmx
+++ b/examples/test/driver_example_mod/meta/driver_example_mod.cmx
@@ -4,20 +4,16 @@
     },
     "sandbox": {
         "services": [
-            "fuchsia.cobalt.LoggerFactory",
             "fuchsia.fonts.Provider",
             "fuchsia.logger.LogSink",
             "fuchsia.modular.Clipboard",
             "fuchsia.modular.ContextWriter",
             "fuchsia.modular.ModuleContext",
-            "fuchsia.netstack.Netstack",
             "fuchsia.sys.Environment",
-            "fuchsia.testing.runner.TestRunner",
             "fuchsia.ui.input.ImeService",
             "fuchsia.ui.policy.Presenter",
             "fuchsia.ui.scenic.Scenic",
-            "fuchsia.ui.viewsv1.ViewManager",
-            "fuchsia.wlan.service.Wlan"
+            "fuchsia.ui.viewsv1.ViewManager"
         ]
     }
 }
diff --git a/examples/test/driver_example_mod/meta/driver_example_mod_target_tests.cmx b/examples/test/driver_example_mod/meta/driver_example_mod_target_tests.cmx
deleted file mode 100644
index 7835670..0000000
--- a/examples/test/driver_example_mod/meta/driver_example_mod_target_tests.cmx
+++ /dev/null
@@ -1,15 +0,0 @@
-{
-    "program": {
-        "data": "data/driver_example_mod_target_tests"
-    },
-    "sandbox": {
-        "features": [
-            "root-ssl-certificates",
-            "shell"
-        ],
-        "services": [
-            "fuchsia.sys.Environment",
-            "fuchsia.testing.runner.TestRunner"
-        ]
-    }
-}
diff --git a/examples/test/driver_example_mod/meta/driver_example_mod_tests.cmx b/examples/test/driver_example_mod/meta/driver_example_mod_tests.cmx
new file mode 100644
index 0000000..4a706a1
--- /dev/null
+++ b/examples/test/driver_example_mod/meta/driver_example_mod_tests.cmx
@@ -0,0 +1,31 @@
+{
+    "facets": {
+        "fuchsia.test": {
+            "injected-services": {
+                "fuchsia.fonts.Provider": "fuchsia-pkg://fuchsia.com/fonts#meta/fonts.cmx",
+                "fuchsia.sysmem.Allocator": "fuchsia-pkg://fuchsia.com/sysmem_connector#meta/sysmem_connector.cmx",
+                "fuchsia.tracelink.Registry": "fuchsia-pkg://fuchsia.com/trace_manager#meta/trace_manager.cmx",
+                "fuchsia.ui.input.ImeService": "fuchsia-pkg://fuchsia.com/ime_service#meta/ime_service.cmx",
+                "fuchsia.ui.policy.Presenter": "fuchsia-pkg://fuchsia.com/root_presenter#meta/root_presenter.cmx",
+                "fuchsia.ui.scenic.Scenic": "fuchsia-pkg://fuchsia.com/scenic#meta/scenic.cmx",
+                "fuchsia.ui.viewsv1.ViewManager": "fuchsia-pkg://fuchsia.com/view_manager#meta/view_manager.cmx",
+                "fuchsia.vulkan.loader.Loader": "fuchsia-pkg://fuchsia.com/vulkan_loader#meta/vulkan_loader.cmx"
+            },
+            "system-services": [
+                "fuchsia.net.SocketProvider"
+            ]
+        }
+    },
+    "program": {
+        "data": "data/driver_example_mod_tests"
+    },
+    "sandbox": {
+        "features": [
+            "shell"
+        ],
+        "services": [
+            "fuchsia.net.SocketProvider",
+            "fuchsia.sys.Environment"
+        ]
+    }
+}
diff --git a/examples/test/driver_example_mod/test/driver_example_mod_test.dart b/examples/test/driver_example_mod/test/driver_example_mod_test.dart
index 57c3d96..d8fd6f6 100644
--- a/examples/test/driver_example_mod/test/driver_example_mod_test.dart
+++ b/examples/test/driver_example_mod/test/driver_example_mod_test.dart
@@ -2,38 +2,56 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-import 'package:fidl_fuchsia_testing_runner/fidl_async.dart';
+import 'package:fidl/fidl.dart';
+import 'package:fidl_fuchsia_sys/fidl_async.dart';
 import 'package:flutter_driver/flutter_driver.dart';
-import 'package:fuchsia_modular/service_connection.dart';
 import 'package:fuchsia_remote_debug_protocol/logging.dart';
 import 'package:fuchsia_services/services.dart';
 import 'package:test/test.dart';
 
+const Pattern _isolatePattern = 'driver_example_mod';
+const _testAppUrl =
+    'fuchsia-pkg://fuchsia.com/driver_example_mod#meta/driver_example_mod.cmx';
+const _basemgrUrl = 'fuchsia-pkg://fuchsia.com/basemgr#meta/basemgr.cmx';
+
+// Starts basemgr with dev shells. This should be called from within a
+// try/finally or similar construct that closes the component controller.
+Future<void> _startBasemgr(
+    InterfaceRequest<ComponentController> controllerRequest,
+    String rootModUrl) async {
+  final context = StartupContext.fromStartupInfo();
+
+  final launchInfo = LaunchInfo(url: _basemgrUrl, arguments: [
+    '--base_shell=fuchsia-pkg://fuchsia.com/dev_base_shell#meta/dev_base_shell.cmx',
+    '--session_shell=fuchsia-pkg://fuchsia.com/dev_session_shell#meta/dev_session_shell.cmx',
+    '--session_shell_args=--root_module=$rootModUrl',
+    '--story_shell=fuchsia-pkg://fuchsia.com/dev_story_shell#meta/dev_story_shell.cmx'
+  ]);
+  await context.launcher.createComponent(launchInfo, controllerRequest);
+}
+
 void main() {
   group('driver example tests', () {
+    final controller = ComponentControllerProxy();
     FlutterDriver driver;
-    TestRunnerProxy testRunner;
 
     setUpAll(() async {
       // TODO(DX-561): Update logging messages in
       // fuchsia_remote_debug_protocol so that this doesn't need to be set to
       // `all`.
       Logger.globalLevel = LoggingLevel.all;
-      testRunner = new TestRunnerProxy();
-      connectToEnvironmentService(testRunner);
-      const Pattern isolatePattern = 'driver_example_mod';
+
+      await _startBasemgr(controller.ctrl.request(), _testAppUrl);
+
       driver = await FlutterDriver.connect(
-          fuchsiaModuleTarget: isolatePattern,
+          fuchsiaModuleTarget: _isolatePattern,
           printCommunication: true,
           logCommunicationToFile: false);
     });
 
     tearDownAll(() async {
       await driver?.close();
-      // Must be invoked before closing the connection to this interface;
-      // otherwise the TestRunner service will assume that the connection broke
-      // due to the test crashing.
-      await testRunner.done();
+      controller.ctrl.close();
     });
 
     test('driver connection', () {
diff --git a/packages/examples/tests b/packages/examples/tests
index 6600671..be220bb 100644
--- a/packages/examples/tests
+++ b/packages/examples/tests
@@ -1,7 +1,8 @@
 {
   "packages": [
-    "//topaz/examples/test/driver_example_mod:driver_example_mod",
-    "//topaz/examples/test/driver_example_mod:driver_example_mod_target_tests",
+    "//topaz/examples/test/driver_example_mod",
+    "//topaz/examples/test/driver_example_mod:driver_example_mod_tests",
+    "//topaz/public/dart/fuchsia_modular/examples/slider_mod",
     "//topaz/public/dart/fuchsia_modular/examples/slider_mod:slider_mod_tests"
   ]
 }
diff --git a/packages/tests/all b/packages/tests/all
index 2a3ee09..a232bb0 100644
--- a/packages/tests/all
+++ b/packages/tests/all
@@ -1,6 +1,7 @@
 {
     "imports": [
         "garnet/packages/tests/run_test_component",
+        "topaz/packages/examples/tests",
         "topaz/packages/tests/auth_provider_tests",
         "topaz/packages/tests/bindings_tests",
         "topaz/packages/tests/crasher_dart",
@@ -16,7 +17,6 @@
         "topaz/packages/tests/flutter_screencap_test",
         "topaz/packages/tests/flutter_screencap_test_app",
         "topaz/packages/tests/key_listener_test",
-        "topaz/packages/tests/modular_integration_tests",
         "topaz/packages/tests/scenic",
         "topaz/packages/tests/sledge",
         "topaz/packages/tests/web_runner_tests"
diff --git a/packages/tests/modular_integration_tests b/packages/tests/modular_integration_tests
deleted file mode 100644
index c45e450..0000000
--- a/packages/tests/modular_integration_tests
+++ /dev/null
@@ -1,9 +0,0 @@
-{
-    "imports": [
-        "peridot/packages/prod/integration_testing",
-        "topaz/packages/examples/tests"
-    ],
-    "packages": [
-        "//topaz/tests/modular_integration_tests:topaz_modular_integration_tests"
-    ]
-}
diff --git a/public/dart/fuchsia_modular/examples/slider_mod/BUILD.gn b/public/dart/fuchsia_modular/examples/slider_mod/BUILD.gn
index d29bdc7..22054cf 100644
--- a/public/dart/fuchsia_modular/examples/slider_mod/BUILD.gn
+++ b/public/dart/fuchsia_modular/examples/slider_mod/BUILD.gn
@@ -3,6 +3,7 @@
 # found in the LICENSE file.
 
 import("//build/dart/dart_fuchsia_test.gni")
+import("//build/testing/environments.gni")
 import("//topaz/runtime/flutter_runner/flutter_app.gni")
 
 flutter_app("slider_mod") {
@@ -44,23 +45,18 @@
   ]
 }
 
-# Ensure this target is properly defined under:
-#   //topaz/tests/modular_integration_tests/topaz_modular_integration_tests.json
-# Runs these tests using:
-#   fx shell /pkgfs/packages/topaz_modular_integration_tests/0/bin/run_topaz_modular_integration_tests.sh slider_mod_tests
+# This can be run on the Fuchsia device using fx run-test. The slider mod must
+# be available on the machine.
 dart_fuchsia_test("slider_mod_tests") {
-  # TODO(IN-991): Use environments rather than this hack.
-  package_only = true
-
   sources = [
     "slider_mod_widget_test.dart",
   ]
 
   deps = [
-    ":slider_mod_dart_library",
-    "//sdk/fidl/fuchsia.testing.runner",
+    "//sdk/fidl/fuchsia.sys",
     "//third_party/dart-pkg/git/flutter/packages/flutter_driver",
     "//third_party/dart-pkg/pub/test",
+    "//topaz/public/dart/fuchsia_services",
   ]
 
   meta = [
@@ -69,4 +65,14 @@
       dest = "slider_mod_tests.cmx"
     },
   ]
+
+  environments = []
+
+  # Flutter driver is only available in debug builds.
+  if (is_debug) {
+    environments += [
+      nuc_env,
+      vim2_env,
+    ]
+  }
 }
diff --git a/public/dart/fuchsia_modular/examples/slider_mod/meta/slider_mod.cmx b/public/dart/fuchsia_modular/examples/slider_mod/meta/slider_mod.cmx
index 5318f02..9223b26 100644
--- a/public/dart/fuchsia_modular/examples/slider_mod/meta/slider_mod.cmx
+++ b/public/dart/fuchsia_modular/examples/slider_mod/meta/slider_mod.cmx
@@ -1,4 +1,11 @@
 {
+    "facets": {
+        "fuchsia.module": {
+            "@version": 2,
+            "intent_filters": [],
+            "suggestion_headline": "Show a slider"
+        }
+    },
     "program": {
         "data": "data/slider_mod"
     },
@@ -11,18 +18,10 @@
             "fuchsia.modular.ContextWriter",
             "fuchsia.modular.ModuleContext",
             "fuchsia.sys.Environment",
-            "fuchsia.testing.runner.TestRunner",
             "fuchsia.ui.input.ImeService",
             "fuchsia.ui.policy.Presenter",
             "fuchsia.ui.scenic.Scenic",
             "fuchsia.ui.viewsv1.ViewManager"
         ]
-    },
-    "facets": {
-        "fuchsia.module": {
-            "@version": 2,
-            "suggestion_headline": "Show a slider",
-            "intent_filters": []
-        }
     }
 }
diff --git a/public/dart/fuchsia_modular/examples/slider_mod/meta/slider_mod_tests.cmx b/public/dart/fuchsia_modular/examples/slider_mod/meta/slider_mod_tests.cmx
index 48f21da..8f0bd37 100644
--- a/public/dart/fuchsia_modular/examples/slider_mod/meta/slider_mod_tests.cmx
+++ b/public/dart/fuchsia_modular/examples/slider_mod/meta/slider_mod_tests.cmx
@@ -1,15 +1,31 @@
 {
+    "facets": {
+        "fuchsia.test": {
+            "injected-services": {
+                "fuchsia.fonts.Provider": "fuchsia-pkg://fuchsia.com/fonts#meta/fonts.cmx",
+                "fuchsia.sysmem.Allocator": "fuchsia-pkg://fuchsia.com/sysmem_connector#meta/sysmem_connector.cmx",
+                "fuchsia.tracelink.Registry": "fuchsia-pkg://fuchsia.com/trace_manager#meta/trace_manager.cmx",
+                "fuchsia.ui.input.ImeService": "fuchsia-pkg://fuchsia.com/ime_service#meta/ime_service.cmx",
+                "fuchsia.ui.policy.Presenter": "fuchsia-pkg://fuchsia.com/root_presenter#meta/root_presenter.cmx",
+                "fuchsia.ui.scenic.Scenic": "fuchsia-pkg://fuchsia.com/scenic#meta/scenic.cmx",
+                "fuchsia.ui.viewsv1.ViewManager": "fuchsia-pkg://fuchsia.com/view_manager#meta/view_manager.cmx",
+                "fuchsia.vulkan.loader.Loader": "fuchsia-pkg://fuchsia.com/vulkan_loader#meta/vulkan_loader.cmx"
+            },
+            "system-services": [
+                "fuchsia.net.SocketProvider"
+            ]
+        }
+    },
     "program": {
         "data": "data/slider_mod_tests"
     },
     "sandbox": {
         "features": [
-            "root-ssl-certificates",
             "shell"
         ],
         "services": [
-            "fuchsia.sys.Environment",
-            "fuchsia.testing.runner.TestRunner"
+            "fuchsia.net.SocketProvider",
+            "fuchsia.sys.Environment"
         ]
     }
 }
diff --git a/public/dart/fuchsia_modular/examples/slider_mod/test/slider_mod_widget_test.dart b/public/dart/fuchsia_modular/examples/slider_mod/test/slider_mod_widget_test.dart
index c459110..5dc9a9b 100644
--- a/public/dart/fuchsia_modular/examples/slider_mod/test/slider_mod_widget_test.dart
+++ b/public/dart/fuchsia_modular/examples/slider_mod/test/slider_mod_widget_test.dart
@@ -2,16 +2,37 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+import 'package:fidl/fidl.dart';
+import 'package:fidl_fuchsia_sys/fidl_async.dart';
 import 'package:flutter_driver/flutter_driver.dart';
 import 'package:fuchsia_remote_debug_protocol/logging.dart';
-import 'package:fidl_fuchsia_testing_runner/fidl_async.dart';
 import 'package:fuchsia_services/services.dart';
-import 'package:fuchsia_modular/service_connection.dart';
 import 'package:test/test.dart';
 
+const Pattern _isolatePattern = 'slider_mod';
+const _testAppUrl = 'fuchsia-pkg://fuchsia.com/slider_mod#meta/slider_mod.cmx';
+const _basemgrUrl = 'fuchsia-pkg://fuchsia.com/basemgr#meta/basemgr.cmx';
+
+// Starts basemgr with dev shells. This should be called from within a
+// try/finally or similar construct that closes the component controller.
+Future<void> _startBasemgr(
+    InterfaceRequest<ComponentController> controllerRequest,
+    String rootModUrl) async {
+  final context = StartupContext.fromStartupInfo();
+
+  final launchInfo = LaunchInfo(url: _basemgrUrl, arguments: [
+    '--base_shell=fuchsia-pkg://fuchsia.com/dev_base_shell#meta/dev_base_shell.cmx',
+    '--session_shell=fuchsia-pkg://fuchsia.com/dev_session_shell#meta/dev_session_shell.cmx',
+    '--session_shell_args=--root_module=$rootModUrl',
+    '--story_shell=fuchsia-pkg://fuchsia.com/dev_story_shell#meta/dev_story_shell.cmx'
+  ]);
+  await context.launcher.createComponent(launchInfo, controllerRequest);
+}
+
 void main() {
+  final controller = ComponentControllerProxy();
   FlutterDriver driver;
-  TestRunnerProxy testRunner;
+
   // The following boilerplate is a one time setup required to make
   // flutter_driver work in Fuchsia.
   //
@@ -19,27 +40,20 @@
   // instance of the Dart VM, and spawns an Isolate (isolated Dart execution
   // context) containing your module.
   setUpAll(() async {
-    // Connect to the fuchsia test runner
-    testRunner = new TestRunnerProxy();
-    connectToEnvironmentService(testRunner);
-
-    // The mod under test
-    const Pattern isolatePattern = 'slider_mod';
     Logger.globalLevel = LoggingLevel.all;
 
+    await _startBasemgr(controller.ctrl.request(), _testAppUrl);
+
     // Creates an object you can use to search for your mod on the machine
     driver = await FlutterDriver.connect(
-        fuchsiaModuleTarget: isolatePattern,
+        fuchsiaModuleTarget: _isolatePattern,
         printCommunication: true,
         logCommunicationToFile: false);
   });
 
   tearDownAll(() async {
     await driver?.close();
-    // Must be invoked before closing the connection to this interface;
-    // otherwise the TestRunner service will assume that the connection broke
-    // due to the test crashing.
-    await testRunner.done();
+    controller.ctrl.close();
   });
 
   test(
diff --git a/runtime/dart/dart_component.gni b/runtime/dart/dart_component.gni
index c7d3355..a7871f8 100644
--- a/runtime/dart/dart_component.gni
+++ b/runtime/dart/dart_component.gni
@@ -440,13 +440,7 @@
       }
 
       if (flutter_driver_extendable) {
-        deps += [
-          "//sdk/fidl/fuchsia.modular",
-          "//sdk/fidl/fuchsia.testing.runner",
-          "//third_party/dart-pkg/git/flutter/packages/flutter_driver",
-          "//topaz/public/lib/app/dart",
-          "//topaz/public/lib/module/dart",
-        ]
+        deps += [ "//third_party/dart-pkg/git/flutter/packages/flutter_driver" ]
 
         non_dart_deps +=
             [ ":${kernel_name}_extensions_wrapper($target_toolchain)" ]
diff --git a/runtime/flutter_runner/build/gen_debug_wrapper_main.py b/runtime/flutter_runner/build/gen_debug_wrapper_main.py
index a3d3500..ec75491 100755
--- a/runtime/flutter_runner/build/gen_debug_wrapper_main.py
+++ b/runtime/flutter_runner/build/gen_debug_wrapper_main.py
@@ -32,8 +32,6 @@
 // ignore_for_file: avoid_relative_lib_imports
 import 'dart:async';
 
-import 'package:fidl_fuchsia_testing_runner/fidl_async.dart';
-import 'package:fuchsia_services/services.dart';
 import 'package:flutter_driver/driver_extension.dart';
 ''')
   outfile.write("import '%s' as flutter_app_main;\n" % args.main_dart)
@@ -44,12 +42,7 @@
     print('Overriding app main method because flutter_driver_extendable '
         'is enabled in the build file');
 
-    // TODO(DX-634): don't reply on testRunner if possible
-    final TestRunnerProxy testRunner = TestRunnerProxy();
-    connectToEnvironmentService(testRunner);
     try {
-      await testRunner.done();
-
       // Enables Flutter Driver VM service extension
       //
       // This extension is required for tests that use package:flutter_driver
diff --git a/tests/modular_integration_tests/BUILD.gn b/tests/modular_integration_tests/BUILD.gn
deleted file mode 100644
index 314a422..0000000
--- a/tests/modular_integration_tests/BUILD.gn
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright 2018 The Fuchsia Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import("//build/package.gni")
-import("//build/testing/environments.gni")
-
-# Builds the modular integration testing shell script into a package that runs
-# all Topaz modular integration tests.
-package("topaz_modular_integration_tests") {
-  testonly = true
-
-  tests = [
-    {
-      disabled = true # Flaky: FLK-91
-
-      name = rebase_path("run_topaz_modular_integration_tests.sh")
-      dest = "run_topaz_modular_integration_tests.sh"
-      environments = [
-        nuc_env,
-        vim2_env,
-      ]
-    },
-  ]
-
-  resources = [
-    {
-      path = rebase_path("topaz_modular_integration_tests.json")
-      dest = "topaz_modular_integration_tests.json"
-    },
-  ]
-}
diff --git a/tests/modular_integration_tests/README.md b/tests/modular_integration_tests/README.md
deleted file mode 100644
index 83c4410..0000000
--- a/tests/modular_integration_tests/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-# Topaz Integration Tests
-
-The topaz integration tests use the basemgr to launch a module, then run a
-test against said module.
-
-## Adding Tests
-
-This module assumes you've read how to use the flutter and fuchsia driver code,
-and have made the appropriate modules to run your own tests:
-
-*   [`flutter_driver` example](https://flutter.io/testing/)
-
-*   [`fuchsia_driver` source and docs](https://fuchsia.googlesource.com/topaz/+/master/public/lib/fuchsia_driver/)
-
-If you'd like to test a module, you'll need to add a dependency in
-`packages/tests/modular_integration_tests` (there is an example mod included).
-
-Then, you'll want to target the test(s) in the
-`//topaz/tests/modular_integration_tets/topaz_modular_integration_tests.json`
-file. The first test target should provide a pretty complete example. Here are
-the relevant flags you'll probably want:
-
-*   `--test` should be enabled so that timeouts are possible (this will prevent
-    tests from hanging indefinitely).
-
-*   `--enable_presenter` must be set if you wish to draw to the GPU. This is
-    required if you wish to simulate touching, scrolling, etc, via
-    `flutter_driver`.
-
-*   `--base_shell_args=--test_timeout_ms=[timeout]` This will set the timeout
-    for the test. It is recommended to set this to at least 60000 (one minute),
-    as in its curret state, the integration testing framework is in its early
-    stages and can take a while to complete.
-
-*   `--session_shell_args` These will be broken down based on what they do:
-
-    *   `--root_module` This should almost always be `test_driver_module`, which
-        will run you module as well as the testing application.
-
-    *   `--module_under_test_url` This is the URL for the mod you're testing.
-
-    *   `--test_driver_url` This is the URL for the test which will connect to
-        the `module_under_test_url` and run integration tests against it. As an
-        example: this component will connect to the Dart VM that the module
-        under test is running on, then run integration tests, like sending touch
-        events or testing specific widgets.
-
-The account provider, base shell, session shell, etc, will likely remain
-unchanged except under specific circumstances beyond the scope of this readme.
-
-## Running Tests Manually
-
-After following the above, you can run the integration tests manually by way of
-the following command (note that this shouldn't be run on Qemu. It _will_ crash.
-The path to this binary is also subject to change.):
-
-```
-fx shell /pkgfs/packages/topaz_modular_integration_tests/0/test/run_topaz_modular_integration_tests.sh
-```
diff --git a/tests/modular_integration_tests/run_topaz_modular_integration_tests.sh b/tests/modular_integration_tests/run_topaz_modular_integration_tests.sh
deleted file mode 100644
index 3124149..0000000
--- a/tests/modular_integration_tests/run_topaz_modular_integration_tests.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/boot/bin/sh
-# Copyright 2018 The Fuchsia Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-set -o errexit
-
-# In the event of previous failures from other scripts or other components using
-# the GPU, ensure that all components using the display have been shut down.
-killall basemgr* || true
-killall root_presenter* || true
-killall scenic* || true
-
-run_integration_tests --test_file=/pkgfs/packages/topaz_modular_integration_tests/0/data/topaz_modular_integration_tests.json "$@"
-
-# Shut down these components again to ensure ownership by the flutter_runner
-# has been relinquished.
-killall basemgr* || true
-killall root_presenter* || true
-killall scenic* || true
diff --git a/tests/modular_integration_tests/topaz_modular_integration_tests.json b/tests/modular_integration_tests/topaz_modular_integration_tests.json
deleted file mode 100644
index ffe8aa7..0000000
--- a/tests/modular_integration_tests/topaz_modular_integration_tests.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
-  "tests": [
-    {
-      "name": "driver_example_mod_tap_tests",
-      "exec": [
-        "fuchsia-pkg://fuchsia.com/basemgr#meta/basemgr.cmx",
-        "--test",
-        "--enable_presenter",
-        "--base_shell=fuchsia-pkg://fuchsia.com/dev_base_shell#meta/dev_base_shell.cmx",
-        "--base_shell_args=--test_timeout_ms=300000",
-        "--session_shell=fuchsia-pkg://fuchsia.com/dev_session_shell#meta/dev_session_shell.cmx",
-        "--session_shell_args=--root_module=fuchsia-pkg://fuchsia.com/test_driver_module#meta/test_driver_module.cmx,--module_under_test_url=fuchsia-pkg://fuchsia.com/driver_example_mod#meta/driver_example_mod.cmx,--test_driver_url=fuchsia-pkg://fuchsia.com/driver_example_mod_target_tests#meta/driver_example_mod_target_tests.cmx",
-        "--story_shell=fuchsia-pkg://fuchsia.com/dev_story_shell#meta/dev_story_shell.cmx"
-      ]
-    },
-    {
-      "name": "slider_mod_tests",
-      "exec": [
-        "fuchsia-pkg://fuchsia.com/basemgr#meta/basemgr.cmx",
-        "--test",
-        "--enable_presenter",
-        "--base_shell=fuchsia-pkg://fuchsia.com/dev_base_shell#meta/dev_base_shell.cmx",
-        "--base_shell_args=--test_timeout_ms=300000",
-        "--session_shell=fuchsia-pkg://fuchsia.com/dev_session_shell#meta/dev_session_shell.cmx",
-        "--session_shell_args=--root_module=fuchsia-pkg://fuchsia.com/test_driver_module#meta/test_driver_module.cmx,--module_under_test_url=fuchsia-pkg://fuchsia.com/slider_mod#meta/slider_mod.cmx,--test_driver_url=fuchsia-pkg://fuchsia.com/slider_mod_tests#meta/slider_mod_tests.cmx",
-        "--story_shell=fuchsia-pkg://fuchsia.com/dev_story_shell#meta/dev_story_shell.cmx"
-      ]
-    }
-  ]
-}