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