diff --git a/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart b/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart index 23623880ed..1213957c33 100644 --- a/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart +++ b/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart @@ -18,7 +18,6 @@ import '../cache.dart'; import '../convert.dart'; import '../globals.dart' as globals; import '../tester/flutter_tester.dart'; -import '../web/web_device.dart'; class FlutterCommandRunner extends CommandRunner { FlutterCommandRunner({ bool verboseHelp = false }) : super( @@ -112,11 +111,6 @@ class FlutterCommandRunner extends CommandRunner { hide: !verboseHelp, help: 'List the special "flutter-tester" device in device listings. ' 'This headless device is used to test Flutter tooling.'); - argParser.addFlag('show-web-server-device', - negatable: false, - hide: !verboseHelp, - help: 'List the special "web-server" device in device listings.', - ); } @override @@ -215,10 +209,6 @@ class FlutterCommandRunner extends CommandRunner { || topLevelResults['device-id'] == FlutterTesterDevices.kTesterDeviceId) { FlutterTesterDevices.showFlutterTesterDevice = true; } - if (((topLevelResults['show-web-server-device'] as bool?) ?? false) - || topLevelResults['device-id'] == WebServerDevice.kWebServerDeviceId) { - WebServerDevice.showWebServerDevice = true; - } // Set up the tooling configuration. final EngineBuildPaths? engineBuildPaths = await globals.localEngineLocator?.findEnginePath( diff --git a/packages/flutter_tools/lib/src/web/web_device.dart b/packages/flutter_tools/lib/src/web/web_device.dart index 3938a963a3..7a0ea6836a 100644 --- a/packages/flutter_tools/lib/src/web/web_device.dart +++ b/packages/flutter_tools/lib/src/web/web_device.dart @@ -111,7 +111,7 @@ abstract class ChromiumDevice extends Device { Future get emulatorId async => null; @override - bool isSupported() => chromeLauncher.canFindExecutable(); + bool isSupported() => chromeLauncher.canFindExecutable(); @override DevicePortForwarder? get portForwarder => const NoOpDevicePortForwarder(); @@ -357,8 +357,7 @@ class WebDevices extends PollingDeviceDiscovery { } final MicrosoftEdgeDevice? edgeDevice = _edgeDevice; return [ - if (WebServerDevice.showWebServerDevice) - _webServerDevice, + _webServerDevice, if (_chromeDevice.isSupported()) _chromeDevice, if (edgeDevice != null && await edgeDevice._meetsVersionConstraint()) @@ -392,7 +391,6 @@ class WebServerDevice extends Device { ); static const String kWebServerDeviceId = 'web-server'; - static bool showWebServerDevice = false; final Logger _logger; diff --git a/packages/flutter_tools/test/general.shard/web/devices_test.dart b/packages/flutter_tools/test/general.shard/web/devices_test.dart index c5c9b9d4c8..fb13cc1c85 100644 --- a/packages/flutter_tools/test/general.shard/web/devices_test.dart +++ b/packages/flutter_tools/test/general.shard/web/devices_test.dart @@ -189,8 +189,7 @@ void main() { isNot(contains(isA()))); }); - testWithoutContext('Web Server device is listed if enabled via showWebServerDevice', () async { - WebServerDevice.showWebServerDevice = true; + testWithoutContext('Web Server device is listed', () async { final WebDevices webDevices = WebDevices( featureFlags: TestFeatureFlags(isWebEnabled: true), fileSystem: MemoryFileSystem.test(), @@ -205,22 +204,6 @@ void main() { contains(isA())); }); - testWithoutContext('Web Server device is not listed if disabled via showWebServerDevice', () async { - WebServerDevice.showWebServerDevice = false; - final WebDevices webDevices = WebDevices( - featureFlags: TestFeatureFlags(isWebEnabled: true), - fileSystem: MemoryFileSystem.test(), - logger: BufferLogger.test(), - platform: FakePlatform( - environment: {} - ), - processManager: FakeProcessManager.any(), - ); - - expect(await webDevices.pollingGetDevices(), - isNot(contains(isA()))); - }); - testWithoutContext('Chrome invokes version command on non-Windows platforms', () async { final FakeProcessManager processManager = FakeProcessManager.list([ const FakeCommand(