diff --git a/packages/flutter_driver/test/flutter_driver_test.dart b/packages/flutter_driver/test/flutter_driver_test.dart index 9e2eb40b20b..dcb08dad415 100644 --- a/packages/flutter_driver/test/flutter_driver_test.dart +++ b/packages/flutter_driver/test/flutter_driver_test.dart @@ -29,7 +29,7 @@ void main() { void expectLogContains(String message) { expect(log.map((LogRecord r) => '$r'), anyElement(contains(message))); } - + setUp(() { log = []; 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.value(mockVM)); + when(mockClient.getVM()).thenReturn(new Future.value(mockVM)); when(mockVM.isolates).thenReturn([mockIsolate]); - when(mockIsolate.loadRunnable()).thenAnswer((_) => new Future.value(mockIsolate)); + when(mockIsolate.loadRunnable()).thenReturn(new Future.value(mockIsolate)); when(mockIsolate.invokeExtension(typed(any), typed(any))).thenAnswer( (Invocation invocation) => makeMockResponse({'status': 'ok'})); vmServiceConnectFunction = (String url) { diff --git a/packages/fuchsia_remote_debug_protocol/test/fuchsia_remote_connection_test.dart b/packages/fuchsia_remote_debug_protocol/test/fuchsia_remote_connection_test.dart index b3f9cd79a98..df85bc2ec1a 100644 --- a/packages/fuchsia_remote_debug_protocol/test/fuchsia_remote_connection_test.dart +++ b/packages/fuchsia_remote_debug_protocol/test/fuchsia_remote_connection_test.dart @@ -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>.value( + .thenReturn(new Future>.value( ['123\n\n\n', '456 ', '789'])); when(mockRunner.address).thenReturn(address); when(mockRunner.interface).thenReturn(interface); diff --git a/packages/fuchsia_remote_debug_protocol/test/src/runners/ssh_command_runner_test.dart b/packages/fuchsia_remote_debug_protocol/test/src/runners/ssh_command_runner_test.dart index 6488018434d..83f7fbc56b5 100644 --- a/packages/fuchsia_remote_debug_protocol/test/src/runners/ssh_command_runner_test.dart +++ b/packages/fuchsia_remote_debug_protocol/test/src/runners/ssh_command_runner_test.dart @@ -40,8 +40,8 @@ void main() { setUp(() { mockProcessManager = new MockProcessManager(); mockProcessResult = new MockProcessResult(); - when(mockProcessManager.run(typed(any))).thenAnswer( - (_) => new Future.value(mockProcessResult)); + when(mockProcessManager.run(typed(any))).thenReturn( + new Future.value(mockProcessResult)); }); test('verify interface is appended to ipv6 address', () async {