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

[flutter_tools] remove mock processes from batch compile_test (#77731)

parent 07e04484
...@@ -184,12 +184,14 @@ class KernelCompiler { ...@@ -184,12 +184,14 @@ class KernelCompiler {
@required Artifacts artifacts, @required Artifacts artifacts,
@required List<String> fileSystemRoots, @required List<String> fileSystemRoots,
@required String fileSystemScheme, @required String fileSystemScheme,
@visibleForTesting StdoutHandler stdoutHandler,
}) : _logger = logger, }) : _logger = logger,
_fileSystem = fileSystem, _fileSystem = fileSystem,
_artifacts = artifacts, _artifacts = artifacts,
_processManager = processManager, _processManager = processManager,
_fileSystemScheme = fileSystemScheme, _fileSystemScheme = fileSystemScheme,
_fileSystemRoots = fileSystemRoots; _fileSystemRoots = fileSystemRoots,
_stdoutHandler = stdoutHandler ?? StdoutHandler(logger: logger);
final FileSystem _fileSystem; final FileSystem _fileSystem;
final Artifacts _artifacts; final Artifacts _artifacts;
...@@ -197,6 +199,7 @@ class KernelCompiler { ...@@ -197,6 +199,7 @@ class KernelCompiler {
final Logger _logger; final Logger _logger;
final String _fileSystemScheme; final String _fileSystemScheme;
final List<String> _fileSystemRoots; final List<String> _fileSystemRoots;
final StdoutHandler _stdoutHandler;
Future<CompilerOutput> compile({ Future<CompilerOutput> compile({
String sdkRoot, String sdkRoot,
...@@ -310,7 +313,6 @@ class KernelCompiler { ...@@ -310,7 +313,6 @@ class KernelCompiler {
_logger.printTrace(command.join(' ')); _logger.printTrace(command.join(' '));
final Process server = await _processManager.start(command); final Process server = await _processManager.start(command);
final StdoutHandler _stdoutHandler = StdoutHandler(logger: _logger);
server.stderr server.stderr
.transform<String>(utf8.decoder) .transform<String>(utf8.decoder)
.listen(_logger.printError); .listen(_logger.printError);
...@@ -540,11 +542,12 @@ class DefaultResidentCompiler implements ResidentCompiler { ...@@ -540,11 +542,12 @@ class DefaultResidentCompiler implements ResidentCompiler {
this.platformDill, this.platformDill,
List<String> dartDefines, List<String> dartDefines,
this.librariesSpec, this.librariesSpec,
@visibleForTesting StdoutHandler stdoutHandler,
}) : assert(sdkRoot != null), }) : assert(sdkRoot != null),
_logger = logger, _logger = logger,
_processManager = processManager, _processManager = processManager,
_artifacts = artifacts, _artifacts = artifacts,
_stdoutHandler = StdoutHandler(logger: logger), _stdoutHandler = stdoutHandler ?? StdoutHandler(logger: logger),
_platform = platform, _platform = platform,
dartDefines = dartDefines ?? const <String>[], dartDefines = dartDefines ?? const <String>[],
// This is a URI, not a file path, so the forward slash is correct even on Windows. // This is a URI, not a file path, so the forward slash is correct even on Windows.
......
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