Unverified Commit d6440156 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

Revert "set web device name to Chrome (#34856)" (#34884)

parent 19d7925f
......@@ -27,9 +27,9 @@ class WebApplicationPackage extends ApplicationPackage {
Directory get webSourcePath => flutterProject.directory.childDirectory('web');
}
class ChromeDevice extends Device {
ChromeDevice() : super(
'chrome',
class WebDevice extends Device {
WebDevice() : super(
'web',
category: Category.web,
platformType: PlatformType.web,
ephemeral: false,
......@@ -74,7 +74,7 @@ class ChromeDevice extends Device {
bool isSupported() => flutterWebEnabled && canFindChrome();
@override
String get name => 'Chrome';
String get name => 'web';
@override
DevicePortForwarder get portForwarder => const NoOpDevicePortForwarder();
......@@ -143,9 +143,9 @@ class ChromeDevice extends Device {
}
class WebDevices extends PollingDeviceDiscovery {
WebDevices() : super('chrome');
WebDevices() : super('web');
final ChromeDevice _webDevice = ChromeDevice();
final WebDevice _webDevice = WebDevice();
@override
bool get canListAnything => flutterWebEnabled;
......
......@@ -13,7 +13,7 @@ import '../src/common.dart';
import '../src/context.dart';
void main() {
group(ChromeDevice, () {
group(WebDevice, () {
MockChromeLauncher mockChromeLauncher;
MockPlatform mockPlatform;
MockProcessManager mockProcessManager;
......@@ -26,27 +26,13 @@ void main() {
return null;
});
});
test('Defaults', () async {
final ChromeDevice device = ChromeDevice();
expect(device.name, 'Chrome');
expect(device.id, 'chrome');
expect(device.supportsHotReload, true);
expect(device.supportsHotRestart, true);
expect(device.supportsStartPaused, true);
expect(device.supportsFlutterExit, true);
expect(device.supportsScreenshot, false);
expect(await device.isLocalEmulator, false);
});
testUsingContext('Invokes version command on non-Windows platforms', () async{
when(mockPlatform.isWindows).thenReturn(false);
when(mockProcessManager.canRun('chrome.foo')).thenReturn(true);
when(mockProcessManager.run(<String>['chrome.foo', '--version'])).thenAnswer((Invocation invocation) async {
return MockProcessResult(0, 'ABC');
});
final ChromeDevice webDevice = ChromeDevice();
final WebDevice webDevice = WebDevice();
expect(webDevice.isSupported(), true);
expect(await webDevice.sdkNameAndVersion, 'ABC');
......@@ -67,7 +53,7 @@ void main() {
])).thenAnswer((Invocation invocation) async {
return MockProcessResult(0, r'HKEY_CURRENT_USER\Software\Google\Chrome\BLBeacon\ version REG_SZ 74.0.0 A');
});
final ChromeDevice webDevice = ChromeDevice();
final WebDevice webDevice = WebDevice();
expect(webDevice.isSupported(), true);
expect(await webDevice.sdkNameAndVersion, 'Google Chrome 74.0.0');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment