forked from firka/flutter
[flutter_tools] refactor the IOSDevicePortForwarder and move tests out of devices_test.dart (#52772)
Updates the IOSDevicePortForwarder to no longer depend on context, or on an IOSDevice instance. Instead, it receives all necessary configuration through the constructor. Moves the IOSDevicePortForwarder to a separate file.
This commit is contained in:
@@ -30,9 +30,7 @@ class FakeCommand {
|
||||
this.completer,
|
||||
}) : assert(command != null),
|
||||
assert(duration != null),
|
||||
assert(exitCode != null),
|
||||
assert(stdout != null),
|
||||
assert(stderr != null);
|
||||
assert(exitCode != null);
|
||||
|
||||
/// The exact commands that must be matched for this [FakeCommand] to be
|
||||
/// considered correct.
|
||||
@@ -139,8 +137,12 @@ class _FakeProcess implements Process {
|
||||
}
|
||||
return _exitCode;
|
||||
}),
|
||||
stderr = Stream<List<int>>.value(utf8.encode(_stderr)),
|
||||
stdout = Stream<List<int>>.value(utf8.encode(_stdout));
|
||||
stderr = _stderr == null
|
||||
? const Stream<List<int>>.empty()
|
||||
: Stream<List<int>>.value(utf8.encode(_stderr)),
|
||||
stdout = _stdout == null
|
||||
? const Stream<List<int>>.empty()
|
||||
: Stream<List<int>>.value(utf8.encode(_stdout));
|
||||
|
||||
final int _exitCode;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user