Apply Mockito-related type fixes (#16002)
Type-related fixes in flutter_driver and fuchsia_remote_debug_protocol
tests.
diff --git a/packages/flutter_driver/test/flutter_driver_test.dart b/packages/flutter_driver/test/flutter_driver_test.dart
index 1a92286..42962d8 100644
--- a/packages/flutter_driver/test/flutter_driver_test.dart
+++ b/packages/flutter_driver/test/flutter_driver_test.dart
@@ -37,9 +37,9 @@
mockVM = new MockVM();
mockIsolate = new MockIsolate();
mockPeer = new MockPeer();
- when(mockClient.getVM()).thenReturn(mockVM);
+ when(mockClient.getVM()).thenReturn(new Future<MockVM>.value(mockVM));
when(mockVM.isolates).thenReturn(<VMRunnableIsolate>[mockIsolate]);
- when(mockIsolate.loadRunnable()).thenReturn(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) {
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 7d7bab6..172a9a8 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,8 @@
const String interface = 'eno1';
// Adds some extra junk to make sure the strings will be cleaned up.
when(mockRunner.run(typed(any)))
- .thenReturn(<String>['123\n\n\n', '456 ', '789']);
+ .thenReturn(new Future<List<String>>.value(
+ <String>['123\n\n\n', '456 ', '789']));
when(mockRunner.address).thenReturn(address);
when(mockRunner.interface).thenReturn(interface);
int port = 0;
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 068ce16..83f7fbc 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,7 +40,8 @@
setUp(() {
mockProcessManager = new MockProcessManager();
mockProcessResult = new MockProcessResult();
- when(mockProcessManager.run(typed(any))).thenReturn(mockProcessResult);
+ when(mockProcessManager.run(typed(any))).thenReturn(
+ new Future<MockProcessResult>.value(mockProcessResult));
});
test('verify interface is appended to ipv6 address', () async {