mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[flutter_tools] don't trim log messages from the web (#53379)
This commit is contained in:
parent
2717eb6413
commit
be3a4b37b3
@ -672,7 +672,7 @@ class _ResidentWebRunner extends ResidentWebRunner {
|
||||
// thrown if we're not already subscribed.
|
||||
}
|
||||
_stdOutSub = _vmService.onStdoutEvent.listen((vmservice.Event log) {
|
||||
final String message = utf8.decode(base64.decode(log.bytes)).trim();
|
||||
final String message = utf8.decode(base64.decode(log.bytes));
|
||||
globals.printStatus(message);
|
||||
});
|
||||
unawaited(_vmService.registerService('reloadSources', 'FlutterTools'));
|
||||
|
||||
@ -480,6 +480,30 @@ void main() {
|
||||
Usage: () => MockFlutterUsage(),
|
||||
}));
|
||||
|
||||
test('Faithfully displays stdout messages with leading/trailing spaces', () => testbed.run(() async {
|
||||
_setupMocks();
|
||||
final StreamController<Event> stdoutController = StreamController<Event>();
|
||||
when(mockVmService.onStdoutEvent).thenAnswer((Invocation invocation) {
|
||||
return stdoutController.stream;
|
||||
});
|
||||
final Completer<DebugConnectionInfo> connectionInfoCompleter = Completer<DebugConnectionInfo>();
|
||||
unawaited(residentWebRunner.run(
|
||||
connectionInfoCompleter: connectionInfoCompleter,
|
||||
));
|
||||
await connectionInfoCompleter.future;
|
||||
|
||||
stdoutController.add(Event(
|
||||
timestamp: 0,
|
||||
kind: 'Stdout',
|
||||
bytes: base64.encode(utf8.encode(' This is a message with 4 leading and trailing spaces '))),
|
||||
);
|
||||
// Wait one event loop for the stream listener to fire.
|
||||
await null;
|
||||
|
||||
expect(testLogger.statusText,
|
||||
contains(' This is a message with 4 leading and trailing spaces '));
|
||||
}));
|
||||
|
||||
test('Fails on compilation errors in hot restart', () => testbed.run(() async {
|
||||
_setupMocks();
|
||||
final Completer<DebugConnectionInfo> connectionInfoCompleter = Completer<DebugConnectionInfo>();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user