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) {
|
void expectLogContains(String message) {
|
||||||
expect(log.map((LogRecord r) => '$r'), anyElement(contains(message)));
|
expect(log.map((LogRecord r) => '$r'), anyElement(contains(message)));
|
||||||
}
|
}
|
||||||
|
|
||||||
setUp(() {
|
setUp(() {
|
||||||
log = <LogRecord>[];
|
log = <LogRecord>[];
|
||||||
logSub = flutterDriverLog.listen(log.add);
|
logSub = flutterDriverLog.listen(log.add);
|
||||||
@ -37,9 +37,9 @@ void main() {
|
|||||||
mockVM = new MockVM();
|
mockVM = new MockVM();
|
||||||
mockIsolate = new MockIsolate();
|
mockIsolate = new MockIsolate();
|
||||||
mockPeer = new MockPeer();
|
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(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(
|
when(mockIsolate.invokeExtension(typed(any), typed(any))).thenAnswer(
|
||||||
(Invocation invocation) => makeMockResponse(<String, dynamic>{'status': 'ok'}));
|
(Invocation invocation) => makeMockResponse(<String, dynamic>{'status': 'ok'}));
|
||||||
vmServiceConnectFunction = (String url) {
|
vmServiceConnectFunction = (String url) {
|
||||||
|
@ -31,7 +31,7 @@ void main() {
|
|||||||
const String interface = 'eno1';
|
const String interface = 'eno1';
|
||||||
// Adds some extra junk to make sure the strings will be cleaned up.
|
// Adds some extra junk to make sure the strings will be cleaned up.
|
||||||
when(mockRunner.run(typed(any)))
|
when(mockRunner.run(typed(any)))
|
||||||
.thenAnswer((_) => new Future<List<String>>.value(
|
.thenReturn(new Future<List<String>>.value(
|
||||||
<String>['123\n\n\n', '456 ', '789']));
|
<String>['123\n\n\n', '456 ', '789']));
|
||||||
when(mockRunner.address).thenReturn(address);
|
when(mockRunner.address).thenReturn(address);
|
||||||
when(mockRunner.interface).thenReturn(interface);
|
when(mockRunner.interface).thenReturn(interface);
|
||||||
|
@ -40,8 +40,8 @@ void main() {
|
|||||||
setUp(() {
|
setUp(() {
|
||||||
mockProcessManager = new MockProcessManager();
|
mockProcessManager = new MockProcessManager();
|
||||||
mockProcessResult = new MockProcessResult();
|
mockProcessResult = new MockProcessResult();
|
||||||
when(mockProcessManager.run(typed(any))).thenAnswer(
|
when(mockProcessManager.run(typed(any))).thenReturn(
|
||||||
(_) => new Future<MockProcessResult>.value(mockProcessResult));
|
new Future<MockProcessResult>.value(mockProcessResult));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('verify interface is appended to ipv6 address', () async {
|
test('verify interface is appended to ipv6 address', () async {
|
||||||
|
Loading…
Reference in New Issue
Block a user