[dart sdk] remove connectToEnvironmentService

MS-2335 #done

Change-Id: I41a4271111d43eab882b6a37e351f5dd157c11ca
diff --git a/public/dart/fuchsia_services/BUILD.gn b/public/dart/fuchsia_services/BUILD.gn
index de06885..4c5d6cc 100644
--- a/public/dart/fuchsia_services/BUILD.gn
+++ b/public/dart/fuchsia_services/BUILD.gn
@@ -15,7 +15,6 @@
 
   sources = [
     "services.dart",
-    "src/environment_service_connection.dart",
     "src/incoming.dart",
     "src/internal/_startup_context_impl.dart",
     "src/outgoing.dart",
@@ -36,7 +35,6 @@
 
 flutter_test("fuchsia_services_package_unittests") {
   sources = [
-    "environment_service_connection_test.dart",
     "service_provider_impl_test.dart",
     "startup_context_test.dart",
   ]
diff --git a/public/dart/fuchsia_services/lib/services.dart b/public/dart/fuchsia_services/lib/services.dart
index 9fdac2c..3a6db80 100644
--- a/public/dart/fuchsia_services/lib/services.dart
+++ b/public/dart/fuchsia_services/lib/services.dart
@@ -3,7 +3,6 @@
 // found in the LICENSE file.
 
 /// The base-level functionality required by any component on Fuchsia.
-export 'src/environment_service_connection.dart';
 export 'src/incoming.dart';
 export 'src/outgoing.dart';
 export 'src/service_provider_impl.dart';
diff --git a/public/dart/fuchsia_services/lib/src/environment_service_connection.dart b/public/dart/fuchsia_services/lib/src/environment_service_connection.dart
deleted file mode 100644
index 68a6209..0000000
--- a/public/dart/fuchsia_services/lib/src/environment_service_connection.dart
+++ /dev/null
@@ -1,19 +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 'package:fidl/fidl.dart';
-
-import 'startup_context.dart';
-
-/// Deprecated: Connects to the environment service specified by [serviceProxy].
-///
-/// Environment services are services that are implemented by the framework
-/// itself.
-///
-/// Deprecated, instead use
-/// `StartupContext.fromStartupInfo().incoming.connectToService`
-// TODO(MS-2335) remove this class
-void connectToEnvironmentService<T>(AsyncProxy<T> serviceProxy) {
-  StartupContext.fromStartupInfo().incoming.connectToService(serviceProxy);
-}
diff --git a/public/dart/fuchsia_services/test/environment_service_connection_test.dart b/public/dart/fuchsia_services/test/environment_service_connection_test.dart
deleted file mode 100644
index 0ef8a86..0000000
--- a/public/dart/fuchsia_services/test/environment_service_connection_test.dart
+++ /dev/null
@@ -1,29 +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.
-
-// ignore_for_file: implementation_imports
-import 'package:fidl/fidl.dart';
-import 'package:fuchsia_services/services.dart';
-import 'package:test/test.dart';
-
-void main() {
-  group('connectToEnvironmentService', () {
-    test('throws if serviceProxy is null', () {
-      expect(
-          () =>
-              StartupContext.fromStartupInfo().incoming.connectToService(null),
-          throwsArgumentError);
-    });
-  });
-}
-
-class FakeAsyncProxy<T> extends AsyncProxy<T> {
-  String serviceName;
-  String interfaceName;
-  FakeAsyncProxy(this.serviceName, this.interfaceName)
-      : super(AsyncProxyController(
-          $serviceName: serviceName,
-          $interfaceName: interfaceName,
-        ));
-}