mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Revert "More thenReturn to thenAnswer when mocking Futures"
This reverts commit 194d2cf417
as we are reverting engine roll.
This commit is contained in:
parent
194d2cf417
commit
52c9e96b30
@ -29,7 +29,7 @@ void main() {
|
||||
void expectLogContains(String message) {
|
||||
expect(log.map((LogRecord r) => '$r'), anyElement(contains(message)));
|
||||
}
|
||||
|
||||
|
||||
setUp(() {
|
||||
log = <LogRecord>[];
|
||||
logSub = flutterDriverLog.listen(log.add);
|
||||
@ -37,9 +37,9 @@ void main() {
|
||||
mockVM = new MockVM();
|
||||
mockIsolate = new MockIsolate();
|
||||
mockPeer = new MockPeer();
|
||||
when(mockClient.getVM()).thenAnswer((_) => new Future<MockVM>.value(mockVM));
|
||||
when(mockClient.getVM()).thenReturn(new Future<MockVM>.value(mockVM));
|
||||
when(mockVM.isolates).thenReturn(<VMRunnableIsolate>[mockIsolate]);
|
||||
when(mockIsolate.loadRunnable()).thenAnswer((_) => new Future<MockIsolate>.value(mockIsolate));
|
||||
when(mockIsolate.loadRunnable()).thenReturn(new Future<MockIsolate>.value(mockIsolate));
|
||||
when(mockIsolate.invokeExtension(typed(any), typed(any))).thenAnswer(
|
||||
(Invocation invocation) => makeMockResponse(<String, dynamic>{'status': 'ok'}));
|
||||
vmServiceConnectFunction = (String url) {
|
||||
|
@ -31,7 +31,7 @@ void main() {
|
||||
const String interface = 'eno1';
|
||||
// Adds some extra junk to make sure the strings will be cleaned up.
|
||||
when(mockRunner.run(typed(any)))
|
||||
.thenAnswer((_) => new Future<List<String>>.value(
|
||||
.thenReturn(new Future<List<String>>.value(
|
||||
<String>['123\n\n\n', '456 ', '789']));
|
||||
when(mockRunner.address).thenReturn(address);
|
||||
when(mockRunner.interface).thenReturn(interface);
|
||||
|
@ -40,8 +40,8 @@ void main() {
|
||||
setUp(() {
|
||||
mockProcessManager = new MockProcessManager();
|
||||
mockProcessResult = new MockProcessResult();
|
||||
when(mockProcessManager.run(typed(any))).thenAnswer(
|
||||
(_) => new Future<MockProcessResult>.value(mockProcessResult));
|
||||
when(mockProcessManager.run(typed(any))).thenReturn(
|
||||
new Future<MockProcessResult>.value(mockProcessResult));
|
||||
});
|
||||
|
||||
test('verify interface is appended to ipv6 address', () async {
|
||||
|
Loading…
Reference in New Issue
Block a user