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

print launching on device message (#39748)

parent af851ab6
......@@ -57,7 +57,7 @@ class ResidentWebRunner extends ResidentRunner {
@required DebuggingOptions debuggingOptions,
}) : super(
<FlutterDevice>[],
target: target,
target: target ?? fs.path.join('lib', 'main.dart'),
debuggingOptions: debuggingOptions,
ipv6: ipv6,
stayResident: true,
......@@ -158,6 +158,8 @@ class ResidentWebRunner extends ResidentRunner {
printError(message);
return 1;
}
final String modeName = debuggingOptions.buildInfo.friendlyModeName;
printStatus('Launching ${getDisplayPath(target)} on ${device.name} in $modeName mode...');
Status buildStatus;
try {
buildStatus = logger.startProgress('Building application for the web...', timeout: null);
......
......@@ -28,12 +28,13 @@ void main() {
ResidentWebRunner residentWebRunner;
MockDebugConnection mockDebugConnection;
MockVmService mockVmService;
MockWebDevice mockWebDevice;
setUp(() {
mockWebFs = MockFlutterWebFs();
mockDebugConnection = MockDebugConnection();
mockVmService = MockVmService();
final MockWebDevice mockWebDevice = MockWebDevice();
mockWebDevice = MockWebDevice();
testbed = Testbed(
setup: () {
residentWebRunner = ResidentWebRunner(
......@@ -357,6 +358,20 @@ void main() {
await residentWebRunner.exit();
await residentWebRunner.exit();
}));
test('Prints target and device name on run', () => testbed.run(() async {
_setupMocks();
when(mockWebDevice.name).thenReturn('Chromez');
final Completer<DebugConnectionInfo> connectionInfoCompleter = Completer<DebugConnectionInfo>();
unawaited(residentWebRunner.run(
connectionInfoCompleter: connectionInfoCompleter,
));
await connectionInfoCompleter.future;
final BufferLogger bufferLogger = logger;
expect(bufferLogger.statusText, contains('Launching ${fs.path.join('lib', 'main.dart')} on Chromez in debug mode'));
}));
}
......
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