Commit 9f8a70be authored by Sam Rawlins's avatar Sam Rawlins Committed by Alexander Aprelev

Bump mockito to 3.0.0-beta (#18462)

* Bump mockito to 3.0.0-beta

* Few fixes

* fix test

* Bump image

* Fix

* New packages update

* With matcher pinned

* No more typed
parent bec91216
...@@ -21,7 +21,7 @@ dependencies: ...@@ -21,7 +21,7 @@ dependencies:
dev_dependencies: dev_dependencies:
test: 0.12.41 test: 0.12.41
mockito: 3.0.0-alpha+5 mockito: 3.0.0-beta
analyzer: 0.31.2-alpha.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" analyzer: 0.31.2-alpha.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
boolean_selector: 1.0.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" boolean_selector: 1.0.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...@@ -61,4 +61,4 @@ dev_dependencies: ...@@ -61,4 +61,4 @@ dev_dependencies:
web_socket_channel: 1.0.8 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" web_socket_channel: 1.0.8 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
yaml: 2.1.14 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" yaml: 2.1.14 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
# PUBSPEC CHECKSUM: 049d # PUBSPEC CHECKSUM: 77d2
...@@ -84,32 +84,32 @@ class FakeProcessManager extends Mock implements ProcessManager { ...@@ -84,32 +84,32 @@ class FakeProcessManager extends Mock implements ProcessManager {
// expected to be called. // expected to be called.
// TODO(gspencer): make this more general so that any call will be captured. // TODO(gspencer): make this more general so that any call will be captured.
when(start( when(start(
typed(captureAny), any,
environment: typed(captureAny, named: 'environment'), environment: anyNamed('environment'),
workingDirectory: typed(captureAny, named: 'workingDirectory'), workingDirectory: anyNamed('workingDirectory'),
)).thenAnswer(_nextProcess); )).thenAnswer(_nextProcess);
when(start(typed(captureAny))).thenAnswer(_nextProcess); when(start(any)).thenAnswer(_nextProcess);
when(run( when(run(
typed(captureAny), any,
environment: typed(captureAny, named: 'environment'), environment: anyNamed('environment'),
workingDirectory: typed(captureAny, named: 'workingDirectory'), workingDirectory: anyNamed('workingDirectory'),
)).thenAnswer(_nextResult); )).thenAnswer(_nextResult);
when(run(typed(captureAny))).thenAnswer(_nextResult); when(run(any)).thenAnswer(_nextResult);
when(runSync( when(runSync(
typed(captureAny), any,
environment: typed(captureAny, named: 'environment'), environment: anyNamed('environment'),
workingDirectory: typed(captureAny, named: 'workingDirectory') workingDirectory: anyNamed('workingDirectory')
)).thenAnswer(_nextResultSync); )).thenAnswer(_nextResultSync);
when(runSync(typed(captureAny))).thenAnswer(_nextResultSync); when(runSync(any)).thenAnswer(_nextResultSync);
when(killPid(typed(captureAny), typed(captureAny))).thenReturn(true); when(killPid(any, any)).thenReturn(true);
when(canRun(captureAny, workingDirectory: typed(captureAny, named: 'workingDirectory'))) when(canRun(any, workingDirectory: anyNamed('workingDirectory')))
.thenReturn(true); .thenReturn(true);
} }
} }
...@@ -130,7 +130,7 @@ class FakeProcess extends Mock implements Process { ...@@ -130,7 +130,7 @@ class FakeProcess extends Mock implements Process {
final int desiredExitCode; final int desiredExitCode;
void _setupMock() { void _setupMock() {
when(kill(typed(captureAny))).thenReturn(true); when(kill(any)).thenReturn(true);
} }
@override @override
......
...@@ -142,9 +142,9 @@ void main() { ...@@ -142,9 +142,9 @@ void main() {
await creator.createArchive(); await creator.createArchive();
expect( expect(
verify(processManager.start( verify(processManager.start(
typed(captureAny), captureAny,
workingDirectory: typed(captureAny, named: 'workingDirectory'), workingDirectory: captureAnyNamed('workingDirectory'),
environment: typed(captureAny, named: 'environment'), environment: captureAnyNamed('environment'),
)).captured[2]['PUB_CACHE'], )).captured[2]['PUB_CACHE'],
endsWith(path.join('flutter', '.pub-cache')), endsWith(path.join('flutter', '.pub-cache')),
); );
......
...@@ -13,7 +13,7 @@ dev_dependencies: ...@@ -13,7 +13,7 @@ dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
mockito: 3.0.0-alpha+5 mockito: 3.0.0-beta
analyzer: 0.31.2-alpha.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" analyzer: 0.31.2-alpha.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args: 1.4.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" args: 1.4.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...@@ -66,4 +66,4 @@ dev_dependencies: ...@@ -66,4 +66,4 @@ dev_dependencies:
flutter: flutter:
uses-material-design: true uses-material-design: true
# PUBSPEC CHECKSUM: 3f92 # PUBSPEC CHECKSUM: 8dc7
...@@ -11,12 +11,12 @@ MockHttpClient createMockImageHttpClient(SecurityContext _) { ...@@ -11,12 +11,12 @@ MockHttpClient createMockImageHttpClient(SecurityContext _) {
final MockHttpClientRequest request = new MockHttpClientRequest(); final MockHttpClientRequest request = new MockHttpClientRequest();
final MockHttpClientResponse response = new MockHttpClientResponse(); final MockHttpClientResponse response = new MockHttpClientResponse();
final MockHttpHeaders headers = new MockHttpHeaders(); final MockHttpHeaders headers = new MockHttpHeaders();
when(client.getUrl(typed(any))).thenAnswer((_) => new Future<HttpClientRequest>.value(request)); when(client.getUrl(any)).thenAnswer((_) => new Future<HttpClientRequest>.value(request));
when(request.headers).thenReturn(headers); when(request.headers).thenReturn(headers);
when(request.close()).thenAnswer((_) => new Future<HttpClientResponse>.value(response)); when(request.close()).thenAnswer((_) => new Future<HttpClientResponse>.value(response));
when(response.contentLength).thenReturn(kTransparentImage.length); when(response.contentLength).thenReturn(kTransparentImage.length);
when(response.statusCode).thenReturn(HttpStatus.ok); when(response.statusCode).thenReturn(HttpStatus.ok);
when(response.listen(typed(any))).thenAnswer((Invocation invocation) { when(response.listen(any)).thenAnswer((Invocation invocation) {
final void Function(List<int>) onData = invocation.positionalArguments[0]; final void Function(List<int>) onData = invocation.positionalArguments[0];
final void Function() onDone = invocation.namedArguments[#onDone]; final void Function() onDone = invocation.namedArguments[#onDone];
final void Function(Object, [StackTrace]) onError = invocation.namedArguments[#onError]; final void Function(Object, [StackTrace]) onError = invocation.namedArguments[#onError];
......
...@@ -24,7 +24,7 @@ dependencies: ...@@ -24,7 +24,7 @@ dependencies:
dev_dependencies: dev_dependencies:
test: 0.12.41 test: 0.12.41
mockito: 3.0.0-alpha+5 mockito: 3.0.0-beta
analyzer: 0.31.2-alpha.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" analyzer: 0.31.2-alpha.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
boolean_selector: 1.0.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" boolean_selector: 1.0.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...@@ -62,4 +62,4 @@ dev_dependencies: ...@@ -62,4 +62,4 @@ dev_dependencies:
web_socket_channel: 1.0.8 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" web_socket_channel: 1.0.8 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
yaml: 2.1.14 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" yaml: 2.1.14 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
# PUBSPEC CHECKSUM: 5d71 # PUBSPEC CHECKSUM: d9a6
...@@ -18,7 +18,7 @@ dev_dependencies: ...@@ -18,7 +18,7 @@ dev_dependencies:
sdk: flutter sdk: flutter
flutter_goldens: flutter_goldens:
sdk: flutter sdk: flutter
mockito: 3.0.0-alpha+5 mockito: 3.0.0-beta
analyzer: 0.31.2-alpha.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" analyzer: 0.31.2-alpha.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args: 1.4.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" args: 1.4.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...@@ -75,4 +75,4 @@ dev_dependencies: ...@@ -75,4 +75,4 @@ dev_dependencies:
environment: environment:
sdk: '>=1.19.0 <2.0.0' sdk: '>=1.19.0 <2.0.0'
# PUBSPEC CHECKSUM: b1ad # PUBSPEC CHECKSUM: 91e2
...@@ -36,7 +36,7 @@ void main() { ...@@ -36,7 +36,7 @@ void main() {
refreshIndicator = new Container(); refreshIndicator = new Container();
when(mockHelper.builder( when(mockHelper.builder(
typed(any), typed(any), typed(any), typed(any), typed(any))) any, any, any, any, any))
.thenAnswer((Invocation i) { .thenAnswer((Invocation i) {
final RefreshIndicatorMode refreshState = i.positionalArguments[1]; final RefreshIndicatorMode refreshState = i.positionalArguments[1];
final double pulledExtent = i.positionalArguments[2]; final double pulledExtent = i.positionalArguments[2];
...@@ -129,7 +129,7 @@ void main() { ...@@ -129,7 +129,7 @@ void main() {
// The function is referenced once while passing into CupertinoRefreshControl // The function is referenced once while passing into CupertinoRefreshControl
// and is called. // and is called.
verify(mockHelper.builder( verify(mockHelper.builder(
typed(any), any,
RefreshIndicatorMode.drag, RefreshIndicatorMode.drag,
50.0, 50.0,
100.0, // Default value. 100.0, // Default value.
...@@ -205,23 +205,23 @@ void main() { ...@@ -205,23 +205,23 @@ void main() {
verifyInOrder(<void>[ verifyInOrder(<void>[
mockHelper.builder( mockHelper.builder(
typed(any), any,
RefreshIndicatorMode.drag, RefreshIndicatorMode.drag,
50.0, 50.0,
100.0, // Default value. 100.0, // Default value.
60.0, // Default value. 60.0, // Default value.
), ),
mockHelper.builder( mockHelper.builder(
typed(any), any,
RefreshIndicatorMode.drag, RefreshIndicatorMode.drag,
typed(argThat(moreOrLessEquals(48.36801747187993))), argThat(moreOrLessEquals(48.36801747187993)),
100.0, // Default value. 100.0, // Default value.
60.0, // Default value. 60.0, // Default value.
), ),
mockHelper.builder( mockHelper.builder(
typed(any), any,
RefreshIndicatorMode.drag, RefreshIndicatorMode.drag,
typed(argThat(moreOrLessEquals(44.63031931875867))), argThat(moreOrLessEquals(44.63031931875867)),
100.0, // Default value. 100.0, // Default value.
60.0, // Default value. 60.0, // Default value.
), ),
...@@ -271,23 +271,23 @@ void main() { ...@@ -271,23 +271,23 @@ void main() {
verifyInOrder(<void>[ verifyInOrder(<void>[
mockHelper.builder( mockHelper.builder(
typed(any), any,
RefreshIndicatorMode.drag, RefreshIndicatorMode.drag,
99.0, 99.0,
100.0, // Default value. 100.0, // Default value.
60.0, // Default value. 60.0, // Default value.
), ),
mockHelper.builder( mockHelper.builder(
typed(any), any,
RefreshIndicatorMode.drag, RefreshIndicatorMode.drag,
typed(argThat(moreOrLessEquals(86.78169))), argThat(moreOrLessEquals(86.78169)),
100.0, // Default value. 100.0, // Default value.
60.0, // Default value. 60.0, // Default value.
), ),
mockHelper.builder( mockHelper.builder(
typed(any), any,
RefreshIndicatorMode.armed, RefreshIndicatorMode.armed,
typed(argThat(moreOrLessEquals(105.80452021305739))), argThat(moreOrLessEquals(105.80452021305739)),
100.0, // Default value. 100.0, // Default value.
60.0, // Default value. 60.0, // Default value.
), ),
...@@ -330,7 +330,7 @@ void main() { ...@@ -330,7 +330,7 @@ void main() {
verifyInOrder(<void>[ verifyInOrder(<void>[
mockHelper.builder( mockHelper.builder(
typed(any), any,
RefreshIndicatorMode.armed, RefreshIndicatorMode.armed,
150.0, 150.0,
100.0, // Default value. 100.0, // Default value.
...@@ -338,9 +338,9 @@ void main() { ...@@ -338,9 +338,9 @@ void main() {
), ),
mockHelper.refreshTask(), mockHelper.refreshTask(),
mockHelper.builder( mockHelper.builder(
typed(any), any,
RefreshIndicatorMode.armed, RefreshIndicatorMode.armed,
typed(argThat(moreOrLessEquals(127.10396988577114))), argThat(moreOrLessEquals(127.10396988577114)),
100.0, // Default value. 100.0, // Default value.
60.0, // Default value. 60.0, // Default value.
), ),
...@@ -349,7 +349,7 @@ void main() { ...@@ -349,7 +349,7 @@ void main() {
// Reaches refresh state and sliver's at 60.0 in height after a while. // Reaches refresh state and sliver's at 60.0 in height after a while.
await tester.pump(const Duration(seconds: 1)); await tester.pump(const Duration(seconds: 1));
verify(mockHelper.builder( verify(mockHelper.builder(
typed(any), any,
RefreshIndicatorMode.refresh, RefreshIndicatorMode.refresh,
60.0, 60.0,
100.0, // Default value. 100.0, // Default value.
...@@ -368,7 +368,7 @@ void main() { ...@@ -368,7 +368,7 @@ void main() {
await tester.pump(); await tester.pump();
verify(mockHelper.builder( verify(mockHelper.builder(
typed(any), any,
RefreshIndicatorMode.done, RefreshIndicatorMode.done,
60.0, 60.0,
100.0, // Default value. 100.0, // Default value.
...@@ -404,7 +404,7 @@ void main() { ...@@ -404,7 +404,7 @@ void main() {
await tester.pump(); await tester.pump();
verify(mockHelper.builder( verify(mockHelper.builder(
typed(any), any,
RefreshIndicatorMode.armed, RefreshIndicatorMode.armed,
150.0, 150.0,
100.0, // Default value. 100.0, // Default value.
...@@ -422,7 +422,7 @@ void main() { ...@@ -422,7 +422,7 @@ void main() {
// Refresh indicator still being told to layout the same way. // Refresh indicator still being told to layout the same way.
verify(mockHelper.builder( verify(mockHelper.builder(
typed(any), any,
RefreshIndicatorMode.refresh, RefreshIndicatorMode.refresh,
60.0, 60.0,
100.0, // Default value. 100.0, // Default value.
...@@ -483,7 +483,7 @@ void main() { ...@@ -483,7 +483,7 @@ void main() {
await tester.drag(find.text('0'), const Offset(0.0, 150.0)); await tester.drag(find.text('0'), const Offset(0.0, 150.0));
await tester.pump(); await tester.pump();
verify(mockHelper.builder( verify(mockHelper.builder(
typed(any), any,
RefreshIndicatorMode.armed, RefreshIndicatorMode.armed,
150.0, 150.0,
100.0, // Default value. 100.0, // Default value.
...@@ -500,7 +500,7 @@ void main() { ...@@ -500,7 +500,7 @@ void main() {
// Let it snap back to occupy the indicator's final sliver space only. // Let it snap back to occupy the indicator's final sliver space only.
await tester.pump(const Duration(seconds: 2)); await tester.pump(const Duration(seconds: 2));
verify(mockHelper.builder( verify(mockHelper.builder(
typed(any), any,
RefreshIndicatorMode.refresh, RefreshIndicatorMode.refresh,
60.0, 60.0,
100.0, // Default value. 100.0, // Default value.
...@@ -518,7 +518,7 @@ void main() { ...@@ -518,7 +518,7 @@ void main() {
refreshCompleter.complete(null); refreshCompleter.complete(null);
await tester.pump(); await tester.pump();
verify(mockHelper.builder( verify(mockHelper.builder(
typed(any), any,
RefreshIndicatorMode.done, RefreshIndicatorMode.done,
60.0, 60.0,
100.0, // Default value. 100.0, // Default value.
...@@ -564,7 +564,7 @@ void main() { ...@@ -564,7 +564,7 @@ void main() {
refreshCompleter.complete(null); refreshCompleter.complete(null);
await tester.pump(); await tester.pump();
verify(mockHelper.builder( verify(mockHelper.builder(
typed(any), any,
RefreshIndicatorMode.done, RefreshIndicatorMode.done,
150.0, // Still overscrolled here. 150.0, // Still overscrolled here.
100.0, // Default value. 100.0, // Default value.
...@@ -575,7 +575,7 @@ void main() { ...@@ -575,7 +575,7 @@ void main() {
await tester.pump(const Duration(milliseconds: 100)); await tester.pump(const Duration(milliseconds: 100));
// The refresh indicator is still building. // The refresh indicator is still building.
verify(mockHelper.builder( verify(mockHelper.builder(
typed(any), any,
RefreshIndicatorMode.done, RefreshIndicatorMode.done,
91.31180913199277, 91.31180913199277,
100.0, // Default value. 100.0, // Default value.
...@@ -594,7 +594,7 @@ void main() { ...@@ -594,7 +594,7 @@ void main() {
// Instead, it's still in the done state because the sliver never // Instead, it's still in the done state because the sliver never
// fully retracted. // fully retracted.
verify(mockHelper.builder( verify(mockHelper.builder(
typed(any), any,
RefreshIndicatorMode.done, RefreshIndicatorMode.done,
147.3772721631821, 147.3772721631821,
100.0, // Default value. 100.0, // Default value.
...@@ -613,7 +613,7 @@ void main() { ...@@ -613,7 +613,7 @@ void main() {
await tester.drag(find.text('0'), const Offset(0.0, 40.0)); await tester.drag(find.text('0'), const Offset(0.0, 40.0));
await tester.pump(); await tester.pump();
verify(mockHelper.builder( verify(mockHelper.builder(
typed(any), any,
RefreshIndicatorMode.drag, RefreshIndicatorMode.drag,
40.0, 40.0,
100.0, // Default value. 100.0, // Default value.
...@@ -656,7 +656,7 @@ void main() { ...@@ -656,7 +656,7 @@ void main() {
refreshCompleter.complete(null); refreshCompleter.complete(null);
await tester.pump(); await tester.pump();
verify(mockHelper.builder( verify(mockHelper.builder(
typed(any), any,
RefreshIndicatorMode.done, RefreshIndicatorMode.done,
150.0, // Still overscrolled here. 150.0, // Still overscrolled here.
100.0, // Default value. 100.0, // Default value.
...@@ -717,7 +717,7 @@ void main() { ...@@ -717,7 +717,7 @@ void main() {
// Refresh indicator still being told to layout the same way. // Refresh indicator still being told to layout the same way.
verify(mockHelper.builder( verify(mockHelper.builder(
typed(any), any,
RefreshIndicatorMode.refresh, RefreshIndicatorMode.refresh,
60.0, 60.0,
100.0, // Default value. 100.0, // Default value.
...@@ -752,7 +752,7 @@ void main() { ...@@ -752,7 +752,7 @@ void main() {
await tester.pump(); await tester.pump();
verify(mockHelper.builder( verify(mockHelper.builder(
typed(any), any,
RefreshIndicatorMode.drag, RefreshIndicatorMode.drag,
4.615384615384642, 4.615384615384642,
100.0, // Default value. 100.0, // Default value.
...@@ -829,7 +829,7 @@ void main() { ...@@ -829,7 +829,7 @@ void main() {
await tester.drag(find.text('0'), const Offset(0.0, 150.0)); await tester.drag(find.text('0'), const Offset(0.0, 150.0));
await tester.pump(); await tester.pump();
verify(mockHelper.builder( verify(mockHelper.builder(
typed(any), any,
RefreshIndicatorMode.armed, RefreshIndicatorMode.armed,
150.0, 150.0,
100.0, // Default value. 100.0, // Default value.
...@@ -838,7 +838,7 @@ void main() { ...@@ -838,7 +838,7 @@ void main() {
await tester.pump(const Duration(milliseconds: 10)); await tester.pump(const Duration(milliseconds: 10));
verify(mockHelper.builder( verify(mockHelper.builder(
typed(any), any,
RefreshIndicatorMode.done, // Goes to done on the next frame. RefreshIndicatorMode.done, // Goes to done on the next frame.
148.6463892921364, 148.6463892921364,
100.0, // Default value. 100.0, // Default value.
......
...@@ -14,7 +14,7 @@ void main() { ...@@ -14,7 +14,7 @@ void main() {
setUp(() { setUp(() {
response = new MockHttpClientResponse(); response = new MockHttpClientResponse();
when(response.listen( when(response.listen(
typed(any), any,
onDone: anyNamed('onDone'), onDone: anyNamed('onDone'),
onError: anyNamed('onError'), onError: anyNamed('onError'),
cancelOnError: anyNamed('cancelOnError') cancelOnError: anyNamed('cancelOnError')
...@@ -64,7 +64,7 @@ void main() { ...@@ -64,7 +64,7 @@ void main() {
test('forwards errors from HttpClientResponse', () async { test('forwards errors from HttpClientResponse', () async {
when(response.listen( when(response.listen(
typed(any), any,
onDone: anyNamed('onDone'), onDone: anyNamed('onDone'),
onError: anyNamed('onError'), onError: anyNamed('onError'),
cancelOnError: anyNamed('cancelOnError') cancelOnError: anyNamed('cancelOnError')
......
...@@ -31,7 +31,7 @@ void main() { ...@@ -31,7 +31,7 @@ void main() {
final CustomPaint customPaint = tester.widget(find.byType(CustomPaint)); final CustomPaint customPaint = tester.widget(find.byType(CustomPaint));
final MockCanvas canvas = new MockCanvas(); final MockCanvas canvas = new MockCanvas();
customPaint.painter.paint(canvas, const Size(48.0, 48.0)); customPaint.painter.paint(canvas, const Size(48.0, 48.0));
verify(canvas.drawPath(typed(any), typed(argThat(hasColor(0xFF666666))))); verify(canvas.drawPath(any, argThat(hasColor(0xFF666666))));
}); });
testWidgets('IconTheme opacity', (WidgetTester tester) async { testWidgets('IconTheme opacity', (WidgetTester tester) async {
...@@ -53,7 +53,7 @@ void main() { ...@@ -53,7 +53,7 @@ void main() {
final CustomPaint customPaint = tester.widget(find.byType(CustomPaint)); final CustomPaint customPaint = tester.widget(find.byType(CustomPaint));
final MockCanvas canvas = new MockCanvas(); final MockCanvas canvas = new MockCanvas();
customPaint.painter.paint(canvas, const Size(48.0, 48.0)); customPaint.painter.paint(canvas, const Size(48.0, 48.0));
verify(canvas.drawPath(typed(any), typed(argThat(hasColor(0x80666666))))); verify(canvas.drawPath(any, argThat(hasColor(0x80666666))));
}); });
testWidgets('color overrides IconTheme color', (WidgetTester tester) async { testWidgets('color overrides IconTheme color', (WidgetTester tester) async {
...@@ -75,7 +75,7 @@ void main() { ...@@ -75,7 +75,7 @@ void main() {
final CustomPaint customPaint = tester.widget(find.byType(CustomPaint)); final CustomPaint customPaint = tester.widget(find.byType(CustomPaint));
final MockCanvas canvas = new MockCanvas(); final MockCanvas canvas = new MockCanvas();
customPaint.painter.paint(canvas, const Size(48.0, 48.0)); customPaint.painter.paint(canvas, const Size(48.0, 48.0));
verify(canvas.drawPath(typed(any), typed(argThat(hasColor(0xFF0000FF))))); verify(canvas.drawPath(any, argThat(hasColor(0xFF0000FF))));
}); });
testWidgets('IconTheme size', (WidgetTester tester) async { testWidgets('IconTheme size', (WidgetTester tester) async {
...@@ -187,8 +187,8 @@ void main() { ...@@ -187,8 +187,8 @@ void main() {
final CustomPaint customPaint = tester.widget(find.byType(CustomPaint)); final CustomPaint customPaint = tester.widget(find.byType(CustomPaint));
final MockCanvas canvas = new MockCanvas(); final MockCanvas canvas = new MockCanvas();
customPaint.painter.paint(canvas, const Size(48.0, 48.0)); customPaint.painter.paint(canvas, const Size(48.0, 48.0));
verifyNever(canvas.rotate(typed(any))); verifyNever(canvas.rotate(any));
verifyNever(canvas.translate(typed(any), typed(any))); verifyNever(canvas.translate(any, any));
}); });
testWidgets('Inherited text direction overridden', (WidgetTester tester) async { testWidgets('Inherited text direction overridden', (WidgetTester tester) async {
......
...@@ -631,16 +631,16 @@ void main() { ...@@ -631,16 +631,16 @@ void main() {
controller.selection = new TextSelection.collapsed(offset: controller.text.length); controller.selection = new TextSelection.collapsed(offset: controller.text.length);
controls = new MockTextSelectionControls(); controls = new MockTextSelectionControls();
when(controls.buildHandle(typed(any), typed(any), typed(any))).thenReturn(new Container()); when(controls.buildHandle(any, any, any)).thenReturn(new Container());
when(controls.buildToolbar(typed(any), typed(any), typed(any), typed(any))).thenReturn(new Container()); when(controls.buildToolbar(any, any, any, any)).thenReturn(new Container());
}); });
testWidgets('are exposed', (WidgetTester tester) async { testWidgets('are exposed', (WidgetTester tester) async {
final SemanticsTester semantics = new SemanticsTester(tester); final SemanticsTester semantics = new SemanticsTester(tester);
when(controls.canCopy(typed(any))).thenReturn(false); when(controls.canCopy(any)).thenReturn(false);
when(controls.canCut(typed(any))).thenReturn(false); when(controls.canCut(any)).thenReturn(false);
when(controls.canPaste(typed(any))).thenReturn(false); when(controls.canPaste(any)).thenReturn(false);
await _buildApp(controls, tester); await _buildApp(controls, tester);
await tester.tap(find.byType(EditableText)); await tester.tap(find.byType(EditableText));
...@@ -654,7 +654,7 @@ void main() { ...@@ -654,7 +654,7 @@ void main() {
], ],
)); ));
when(controls.canCopy(typed(any))).thenReturn(true); when(controls.canCopy(any)).thenReturn(true);
await _buildApp(controls, tester); await _buildApp(controls, tester);
expect(semantics, includesNodeWith( expect(semantics, includesNodeWith(
value: 'test', value: 'test',
...@@ -665,8 +665,8 @@ void main() { ...@@ -665,8 +665,8 @@ void main() {
], ],
)); ));
when(controls.canCopy(typed(any))).thenReturn(false); when(controls.canCopy(any)).thenReturn(false);
when(controls.canPaste(typed(any))).thenReturn(true); when(controls.canPaste(any)).thenReturn(true);
await _buildApp(controls, tester); await _buildApp(controls, tester);
expect(semantics, includesNodeWith( expect(semantics, includesNodeWith(
value: 'test', value: 'test',
...@@ -677,8 +677,8 @@ void main() { ...@@ -677,8 +677,8 @@ void main() {
], ],
)); ));
when(controls.canPaste(typed(any))).thenReturn(false); when(controls.canPaste(any)).thenReturn(false);
when(controls.canCut(typed(any))).thenReturn(true); when(controls.canCut(any)).thenReturn(true);
await _buildApp(controls, tester); await _buildApp(controls, tester);
expect(semantics, includesNodeWith( expect(semantics, includesNodeWith(
value: 'test', value: 'test',
...@@ -689,9 +689,9 @@ void main() { ...@@ -689,9 +689,9 @@ void main() {
], ],
)); ));
when(controls.canCopy(typed(any))).thenReturn(true); when(controls.canCopy(any)).thenReturn(true);
when(controls.canCut(typed(any))).thenReturn(true); when(controls.canCut(any)).thenReturn(true);
when(controls.canPaste(typed(any))).thenReturn(true); when(controls.canPaste(any)).thenReturn(true);
await _buildApp(controls, tester); await _buildApp(controls, tester);
expect(semantics, includesNodeWith( expect(semantics, includesNodeWith(
value: 'test', value: 'test',
...@@ -710,9 +710,9 @@ void main() { ...@@ -710,9 +710,9 @@ void main() {
testWidgets('can copy/cut/paste with a11y', (WidgetTester tester) async { testWidgets('can copy/cut/paste with a11y', (WidgetTester tester) async {
final SemanticsTester semantics = new SemanticsTester(tester); final SemanticsTester semantics = new SemanticsTester(tester);
when(controls.canCopy(typed(any))).thenReturn(true); when(controls.canCopy(any)).thenReturn(true);
when(controls.canCut(typed(any))).thenReturn(true); when(controls.canCut(any)).thenReturn(true);
when(controls.canPaste(typed(any))).thenReturn(true); when(controls.canPaste(any)).thenReturn(true);
await _buildApp(controls, tester); await _buildApp(controls, tester);
await tester.tap(find.byType(EditableText)); await tester.tap(find.byType(EditableText));
await tester.pump(); await tester.pump();
...@@ -754,13 +754,13 @@ void main() { ...@@ -754,13 +754,13 @@ void main() {
), ignoreRect: true, ignoreTransform: true)); ), ignoreRect: true, ignoreTransform: true));
owner.performAction(expectedNodeId, SemanticsAction.copy); owner.performAction(expectedNodeId, SemanticsAction.copy);
verify(controls.handleCopy(typed(any))).called(1); verify(controls.handleCopy(any)).called(1);
owner.performAction(expectedNodeId, SemanticsAction.cut); owner.performAction(expectedNodeId, SemanticsAction.cut);
verify(controls.handleCut(typed(any))).called(1); verify(controls.handleCut(any)).called(1);
owner.performAction(expectedNodeId, SemanticsAction.paste); owner.performAction(expectedNodeId, SemanticsAction.paste);
verify(controls.handlePaste(typed(any))).called(1); verify(controls.handlePaste(any)).called(1);
semantics.dispose(); semantics.dispose();
}); });
......
...@@ -27,12 +27,12 @@ void main() { ...@@ -27,12 +27,12 @@ void main() {
verify(headers.add('flutter', 'flutter')).called(1); verify(headers.add('flutter', 'flutter')).called(1);
}, createHttpClient: (SecurityContext _) { }, createHttpClient: (SecurityContext _) {
when(client.getUrl(typed(any))).thenAnswer((_) => new Future<HttpClientRequest>.value(request)); when(client.getUrl(any)).thenAnswer((_) => new Future<HttpClientRequest>.value(request));
when(request.headers).thenReturn(headers); when(request.headers).thenReturn(headers);
when(request.close()).thenAnswer((_) => new Future<HttpClientResponse>.value(response)); when(request.close()).thenAnswer((_) => new Future<HttpClientResponse>.value(response));
when(response.contentLength).thenReturn(kTransparentImage.length); when(response.contentLength).thenReturn(kTransparentImage.length);
when(response.statusCode).thenReturn(HttpStatus.ok); when(response.statusCode).thenReturn(HttpStatus.ok);
when(response.listen(typed(any))).thenAnswer((Invocation invocation) { when(response.listen(any)).thenAnswer((Invocation invocation) {
final void Function(List<int>) onData = invocation.positionalArguments[0]; final void Function(List<int>) onData = invocation.positionalArguments[0];
final void Function() onDone = invocation.namedArguments[#onDone]; final void Function() onDone = invocation.namedArguments[#onDone];
final void Function(Object, [StackTrace]) onError = invocation.namedArguments[#onError]; final void Function(Object, [StackTrace]) onError = invocation.namedArguments[#onError];
......
...@@ -66,7 +66,7 @@ dependencies: ...@@ -66,7 +66,7 @@ dependencies:
dev_dependencies: dev_dependencies:
test: 0.12.41 test: 0.12.41
mockito: 3.0.0-alpha+5 mockito: 3.0.0-beta
quiver: 0.29.0+1 quiver: 0.29.0+1
# PUBSPEC CHECKSUM: 1909 # PUBSPEC CHECKSUM: a03e
...@@ -40,7 +40,7 @@ void main() { ...@@ -40,7 +40,7 @@ void main() {
when(mockClient.getVM()).thenAnswer((_) => new Future<MockVM>.value(mockVM)); when(mockClient.getVM()).thenAnswer((_) => 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()).thenAnswer((_) => new Future<MockIsolate>.value(mockIsolate));
when(mockIsolate.invokeExtension(typed(any), typed(any))).thenAnswer( when(mockIsolate.invokeExtension(any, any)).thenAnswer(
(Invocation invocation) => makeMockResponse(<String, dynamic>{'status': 'ok'})); (Invocation invocation) => makeMockResponse(<String, dynamic>{'status': 'ok'}));
vmServiceConnectFunction = (String url) { vmServiceConnectFunction = (String url) {
return new Future<VMServiceClientConnection>.value( return new Future<VMServiceClientConnection>.value(
...@@ -124,7 +124,7 @@ void main() { ...@@ -124,7 +124,7 @@ void main() {
}); });
test('checks the health of the driver extension', () async { test('checks the health of the driver extension', () async {
when(mockIsolate.invokeExtension(typed(any), typed(any))).thenAnswer( when(mockIsolate.invokeExtension(any, any)).thenAnswer(
(Invocation invocation) => makeMockResponse(<String, dynamic>{'status': 'ok'})); (Invocation invocation) => makeMockResponse(<String, dynamic>{'status': 'ok'}));
final Health result = await driver.checkHealth(); final Health result = await driver.checkHealth();
expect(result.status, HealthStatus.ok); expect(result.status, HealthStatus.ok);
...@@ -142,7 +142,7 @@ void main() { ...@@ -142,7 +142,7 @@ void main() {
}); });
test('finds by ValueKey', () async { test('finds by ValueKey', () async {
when(mockIsolate.invokeExtension(typed(any), typed(any))).thenAnswer((Invocation i) { when(mockIsolate.invokeExtension(any, any)).thenAnswer((Invocation i) {
expect(i.positionalArguments[1], <String, String>{ expect(i.positionalArguments[1], <String, String>{
'command': 'tap', 'command': 'tap',
'timeout': _kSerializedTestTimeout, 'timeout': _kSerializedTestTimeout,
...@@ -162,7 +162,7 @@ void main() { ...@@ -162,7 +162,7 @@ void main() {
}); });
test('sends the tap command', () async { test('sends the tap command', () async {
when(mockIsolate.invokeExtension(typed(any), typed(any))).thenAnswer((Invocation i) { when(mockIsolate.invokeExtension(any, any)).thenAnswer((Invocation i) {
expect(i.positionalArguments[1], <String, dynamic>{ expect(i.positionalArguments[1], <String, dynamic>{
'command': 'tap', 'command': 'tap',
'timeout': _kSerializedTestTimeout, 'timeout': _kSerializedTestTimeout,
...@@ -181,7 +181,7 @@ void main() { ...@@ -181,7 +181,7 @@ void main() {
}); });
test('sends the getText command', () async { test('sends the getText command', () async {
when(mockIsolate.invokeExtension(typed(any), typed(any))).thenAnswer((Invocation i) { when(mockIsolate.invokeExtension(any, any)).thenAnswer((Invocation i) {
expect(i.positionalArguments[1], <String, dynamic>{ expect(i.positionalArguments[1], <String, dynamic>{
'command': 'get_text', 'command': 'get_text',
'timeout': _kSerializedTestTimeout, 'timeout': _kSerializedTestTimeout,
...@@ -204,7 +204,7 @@ void main() { ...@@ -204,7 +204,7 @@ void main() {
}); });
test('sends the waitFor command', () async { test('sends the waitFor command', () async {
when(mockIsolate.invokeExtension(typed(any), typed(any))).thenAnswer((Invocation i) { when(mockIsolate.invokeExtension(any, any)).thenAnswer((Invocation i) {
expect(i.positionalArguments[1], <String, dynamic>{ expect(i.positionalArguments[1], <String, dynamic>{
'command': 'waitFor', 'command': 'waitFor',
'finderType': 'ByTooltipMessage', 'finderType': 'ByTooltipMessage',
...@@ -219,7 +219,7 @@ void main() { ...@@ -219,7 +219,7 @@ void main() {
group('waitUntilNoTransientCallbacks', () { group('waitUntilNoTransientCallbacks', () {
test('sends the waitUntilNoTransientCallbacks command', () async { test('sends the waitUntilNoTransientCallbacks command', () async {
when(mockIsolate.invokeExtension(typed(any), typed(any))).thenAnswer((Invocation i) { when(mockIsolate.invokeExtension(any, any)).thenAnswer((Invocation i) {
expect(i.positionalArguments[1], <String, dynamic>{ expect(i.positionalArguments[1], <String, dynamic>{
'command': 'waitUntilNoTransientCallbacks', 'command': 'waitUntilNoTransientCallbacks',
'timeout': _kSerializedTestTimeout, 'timeout': _kSerializedTestTimeout,
...@@ -356,7 +356,7 @@ void main() { ...@@ -356,7 +356,7 @@ void main() {
group('sendCommand error conditions', () { group('sendCommand error conditions', () {
test('local timeout', () async { test('local timeout', () async {
when(mockIsolate.invokeExtension(typed(any), typed(any))).thenAnswer((Invocation i) { when(mockIsolate.invokeExtension(any, any)).thenAnswer((Invocation i) {
// completer never competed to trigger timeout // completer never competed to trigger timeout
return new Completer<Map<String, dynamic>>().future; return new Completer<Map<String, dynamic>>().future;
}); });
...@@ -370,7 +370,7 @@ void main() { ...@@ -370,7 +370,7 @@ void main() {
}); });
test('remote error', () async { test('remote error', () async {
when(mockIsolate.invokeExtension(typed(any), typed(any))).thenAnswer((Invocation i) { when(mockIsolate.invokeExtension(any, any)).thenAnswer((Invocation i) {
return makeMockResponse(<String, dynamic>{ return makeMockResponse(<String, dynamic>{
'message': 'This is a failure' 'message': 'This is a failure'
}, isError: true); }, isError: true);
......
...@@ -62,9 +62,9 @@ dependencies: ...@@ -62,9 +62,9 @@ dependencies:
yaml: 2.1.14 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" yaml: 2.1.14 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
dev_dependencies: dev_dependencies:
mockito: 3.0.0-alpha+5 mockito: 3.0.0-beta
environment: environment:
sdk: '>=1.19.0 <2.0.0' sdk: '>=1.19.0 <2.0.0'
# PUBSPEC CHECKSUM: 6256 # PUBSPEC CHECKSUM: 4e8b
...@@ -46,13 +46,13 @@ void main() { ...@@ -46,13 +46,13 @@ void main() {
group('prepare', () { group('prepare', () {
test('performs minimal work if versions match', () async { test('performs minimal work if versions match', () async {
when(process.run(typed(captureAny), workingDirectory: typed(captureAny, named: 'workingDirectory'))) when(process.run(any, workingDirectory: anyNamed('workingDirectory')))
.thenAnswer((_) => new Future<io.ProcessResult>.value(io.ProcessResult(123, 0, _kGoldensVersion, ''))); .thenAnswer((_) => new Future<io.ProcessResult>.value(io.ProcessResult(123, 0, _kGoldensVersion, '')));
await goldens.prepare(); await goldens.prepare();
// Verify that we only spawned `git rev-parse HEAD` // Verify that we only spawned `git rev-parse HEAD`
final VerificationResult verifyProcessRun = final VerificationResult verifyProcessRun =
verify(process.run(typed(captureAny), workingDirectory: typed(captureAny, named: 'workingDirectory'))); verify(process.run(captureAny, workingDirectory: captureAnyNamed('workingDirectory')));
verifyProcessRun.called(1); verifyProcessRun.called(1);
expect(verifyProcessRun.captured.first, <String>['git', 'rev-parse', 'HEAD']); expect(verifyProcessRun.captured.first, <String>['git', 'rev-parse', 'HEAD']);
expect(verifyProcessRun.captured.last, _kRepositoryRoot); expect(verifyProcessRun.captured.last, _kRepositoryRoot);
......
...@@ -15,7 +15,7 @@ dependencies: ...@@ -15,7 +15,7 @@ dependencies:
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
mockito: 3.0.0-alpha+5 mockito: 3.0.0-beta
analyzer: 0.31.2-alpha.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" analyzer: 0.31.2-alpha.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args: 1.4.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" args: 1.4.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...@@ -64,4 +64,4 @@ dev_dependencies: ...@@ -64,4 +64,4 @@ dev_dependencies:
web_socket_channel: 1.0.8 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" web_socket_channel: 1.0.8 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
yaml: 2.1.14 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" yaml: 2.1.14 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
# PUBSPEC CHECKSUM: e074 # PUBSPEC CHECKSUM: e3a9
...@@ -27,7 +27,7 @@ import '../runner/flutter_command.dart'; ...@@ -27,7 +27,7 @@ import '../runner/flutter_command.dart';
/// ``` /// ```
const Map<String, String> _kManuallyPinnedDependencies = const <String, String>{ const Map<String, String> _kManuallyPinnedDependencies = const <String, String>{
// Add pinned packages here. // Add pinned packages here.
'mockito': '3.0.0-alpha+5', // TODO(aam): https://github.com/dart-lang/mockito/issues/110 'mockito': '3.0.0-beta', // TODO(aam): https://github.com/dart-lang/mockito/issues/110
'matcher': '0.12.2', // TODO(ianh): https://github.com/flutter/flutter/issues/18608, https://github.com/dart-lang/matcher/pull/88 'matcher': '0.12.2', // TODO(ianh): https://github.com/flutter/flutter/issues/18608, https://github.com/dart-lang/matcher/pull/88
}; };
......
...@@ -78,11 +78,11 @@ dependencies: ...@@ -78,11 +78,11 @@ dependencies:
dev_dependencies: dev_dependencies:
collection: 1.14.6 collection: 1.14.6
mockito: 3.0.0-alpha+5 mockito: 3.0.0-beta
file_testing: 2.0.0 file_testing: 2.0.0
dartdoc: dartdoc:
# Exclude this package from the hosted API docs. # Exclude this package from the hosted API docs.
nodoc: true nodoc: true
# PUBSPEC CHECKSUM: 3ac4 # PUBSPEC CHECKSUM: baf9
...@@ -106,7 +106,7 @@ void main() { ...@@ -106,7 +106,7 @@ void main() {
verify(mockClock.now()).called(2); verify(mockClock.now()).called(2);
expect( expect(
verify(mockUsage.sendTiming(captureAny, captureAny, captureAny, label: captureAny)).captured, verify(mockUsage.sendTiming(captureAny, captureAny, captureAny, label: captureAnyNamed('label'))).captured,
<dynamic>['flutter', 'doctor', const Duration(milliseconds: 1000), 'success'] <dynamic>['flutter', 'doctor', const Duration(milliseconds: 1000), 'success']
); );
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
...@@ -125,7 +125,7 @@ void main() { ...@@ -125,7 +125,7 @@ void main() {
verify(mockClock.now()).called(2); verify(mockClock.now()).called(2);
expect( expect(
verify(mockUsage.sendTiming(captureAny, captureAny, captureAny, label: captureAny)).captured, verify(mockUsage.sendTiming(captureAny, captureAny, captureAny, label: captureAnyNamed('label'))).captured,
<dynamic>['flutter', 'doctor', const Duration(milliseconds: 1000), 'warning'] <dynamic>['flutter', 'doctor', const Duration(milliseconds: 1000), 'warning']
); );
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
......
...@@ -88,7 +88,7 @@ Use the 'android' tool to install them: ...@@ -88,7 +88,7 @@ Use the 'android' tool to install them:
setUp(() { setUp(() {
hardware = 'unknown'; hardware = 'unknown';
buildCharacteristics = 'unused'; buildCharacteristics = 'unused';
when(mockProcessManager.run(typedArgThat(contains('getprop')), when(mockProcessManager.run(argThat(contains('getprop')),
stderrEncoding: anyNamed('stderrEncoding'), stderrEncoding: anyNamed('stderrEncoding'),
stdoutEncoding: anyNamed('stdoutEncoding'))).thenAnswer((_) { stdoutEncoding: anyNamed('stdoutEncoding'))).thenAnswer((_) {
final StringBuffer buf = new StringBuffer() final StringBuffer buf = new StringBuffer()
......
...@@ -74,7 +74,7 @@ void main() { ...@@ -74,7 +74,7 @@ void main() {
final AndroidSdk sdk = AndroidSdk.locateAndroidSdk(); final AndroidSdk sdk = AndroidSdk.locateAndroidSdk();
when(processManager.canRun(sdk.sdkManagerPath)).thenReturn(true); when(processManager.canRun(sdk.sdkManagerPath)).thenReturn(true);
when(processManager.runSync(<String>[sdk.sdkManagerPath, '--version'], when(processManager.runSync(<String>[sdk.sdkManagerPath, '--version'],
environment: typedArgThat(isNotNull, named: 'environment'))) environment: argThat(isNotNull, named: 'environment')))
.thenReturn(new ProcessResult(1, 0, '26.1.1\n', '')); .thenReturn(new ProcessResult(1, 0, '26.1.1\n', ''));
expect(sdk.sdkManagerVersion, '26.1.1'); expect(sdk.sdkManagerVersion, '26.1.1');
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
...@@ -89,7 +89,7 @@ void main() { ...@@ -89,7 +89,7 @@ void main() {
final AndroidSdk sdk = AndroidSdk.locateAndroidSdk(); final AndroidSdk sdk = AndroidSdk.locateAndroidSdk();
when(processManager.canRun(sdk.sdkManagerPath)).thenReturn(true); when(processManager.canRun(sdk.sdkManagerPath)).thenReturn(true);
when(processManager.runSync(<String>[sdk.sdkManagerPath, '--version'], when(processManager.runSync(<String>[sdk.sdkManagerPath, '--version'],
environment: typedArgThat(isNotNull, named: 'environment'))) environment: argThat(isNotNull, named: 'environment')))
.thenReturn(new ProcessResult(1, 1, '26.1.1\n', 'Mystery error')); .thenReturn(new ProcessResult(1, 1, '26.1.1\n', 'Mystery error'));
expect(sdk.sdkManagerVersion, isNull); expect(sdk.sdkManagerVersion, isNull);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
......
...@@ -142,7 +142,7 @@ void main() { ...@@ -142,7 +142,7 @@ void main() {
testUsingContext('creates swift Podfile if swift', () { testUsingContext('creates swift Podfile if swift', () {
when(mockXcodeProjectInterpreter.isInstalled).thenReturn(true); when(mockXcodeProjectInterpreter.isInstalled).thenReturn(true);
when(mockXcodeProjectInterpreter.getBuildSettings(typed(any), typed(any))).thenReturn(<String, String>{ when(mockXcodeProjectInterpreter.getBuildSettings(any, any)).thenReturn(<String, String>{
'SWIFT_VERSION': '4.0', 'SWIFT_VERSION': '4.0',
}); });
...@@ -204,7 +204,7 @@ void main() { ...@@ -204,7 +204,7 @@ void main() {
iosEngineDir: 'engine/path', iosEngineDir: 'engine/path',
); );
verifyNever(mockProcessManager.run( verifyNever(mockProcessManager.run(
typedArgThat(containsAllInOrder(<String>['pod', 'install'])), argThat(containsAllInOrder(<String>['pod', 'install'])),
workingDirectory: anyNamed('workingDirectory'), workingDirectory: anyNamed('workingDirectory'),
environment: anyNamed('environment'), environment: anyNamed('environment'),
)); ));
...@@ -226,7 +226,7 @@ void main() { ...@@ -226,7 +226,7 @@ void main() {
} catch(e) { } catch(e) {
expect(e, const isInstanceOf<ToolExit>()); expect(e, const isInstanceOf<ToolExit>());
verifyNever(mockProcessManager.run( verifyNever(mockProcessManager.run(
typedArgThat(containsAllInOrder(<String>['pod', 'install'])), argThat(containsAllInOrder(<String>['pod', 'install'])),
workingDirectory: anyNamed('workingDirectory'), workingDirectory: anyNamed('workingDirectory'),
environment: anyNamed('environment'), environment: anyNamed('environment'),
)); ));
...@@ -437,7 +437,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -437,7 +437,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
); );
expect(didInstall, isFalse); expect(didInstall, isFalse);
verifyNever(mockProcessManager.run( verifyNever(mockProcessManager.run(
typedArgThat(containsAllInOrder(<String>['pod', 'install'])), argThat(containsAllInOrder(<String>['pod', 'install'])),
workingDirectory: anyNamed('workingDirectory'), workingDirectory: anyNamed('workingDirectory'),
environment: anyNamed('environment'), environment: anyNamed('environment'),
)); ));
......
...@@ -72,7 +72,7 @@ void main() { ...@@ -72,7 +72,7 @@ void main() {
when(mockProcessManager.runSync(<String>['which', 'openssl'])) when(mockProcessManager.runSync(<String>['which', 'openssl']))
.thenReturn(exitsHappy); .thenReturn(exitsHappy);
when(mockProcessManager.runSync( when(mockProcessManager.runSync(
typedArgThat(contains('find-identity')), argThat(contains('find-identity')),
environment: anyNamed('environment'), environment: anyNamed('environment'),
workingDirectory: anyNamed('workingDirectory'), workingDirectory: anyNamed('workingDirectory'),
)).thenReturn(exitsHappy); )).thenReturn(exitsHappy);
...@@ -97,7 +97,7 @@ void main() { ...@@ -97,7 +97,7 @@ void main() {
when(mockProcessManager.runSync(<String>['which', 'openssl'])) when(mockProcessManager.runSync(<String>['which', 'openssl']))
.thenReturn(exitsHappy); .thenReturn(exitsHappy);
when(mockProcessManager.runSync( when(mockProcessManager.runSync(
typedArgThat(contains('find-identity')), argThat(contains('find-identity')),
environment: anyNamed('environment'), environment: anyNamed('environment'),
workingDirectory: anyNamed('workingDirectory'), workingDirectory: anyNamed('workingDirectory'),
)).thenReturn(new ProcessResult( )).thenReturn(new ProcessResult(
...@@ -124,7 +124,7 @@ void main() { ...@@ -124,7 +124,7 @@ void main() {
final MockStream mockStdErr = new MockStream(); final MockStream mockStdErr = new MockStream();
when(mockProcessManager.start( when(mockProcessManager.start(
typedArgThat(contains('openssl')), argThat(contains('openssl')),
environment: anyNamed('environment'), environment: anyNamed('environment'),
workingDirectory: anyNamed('workingDirectory'), workingDirectory: anyNamed('workingDirectory'),
)).thenAnswer((Invocation invocation) => new Future<Process>.value(mockProcess)); )).thenAnswer((Invocation invocation) => new Future<Process>.value(mockProcess));
...@@ -156,7 +156,7 @@ void main() { ...@@ -156,7 +156,7 @@ void main() {
when(mockProcessManager.runSync(<String>['which', 'openssl'])) when(mockProcessManager.runSync(<String>['which', 'openssl']))
.thenReturn(exitsHappy); .thenReturn(exitsHappy);
when(mockProcessManager.runSync( when(mockProcessManager.runSync(
typedArgThat(contains('find-identity')), argThat(contains('find-identity')),
environment: anyNamed('environment'), environment: anyNamed('environment'),
workingDirectory: anyNamed('workingDirectory'), workingDirectory: anyNamed('workingDirectory'),
)).thenReturn(new ProcessResult( )).thenReturn(new ProcessResult(
...@@ -183,7 +183,7 @@ void main() { ...@@ -183,7 +183,7 @@ void main() {
final MockStream mockStdErr = new MockStream(); final MockStream mockStdErr = new MockStream();
when(mockProcessManager.start( when(mockProcessManager.start(
typedArgThat(contains('openssl')), argThat(contains('openssl')),
environment: anyNamed('environment'), environment: anyNamed('environment'),
workingDirectory: anyNamed('workingDirectory'), workingDirectory: anyNamed('workingDirectory'),
)).thenAnswer((Invocation invocation) => new Future<Process>.value(mockProcess)); )).thenAnswer((Invocation invocation) => new Future<Process>.value(mockProcess));
...@@ -219,7 +219,7 @@ void main() { ...@@ -219,7 +219,7 @@ void main() {
when(mockProcessManager.runSync(<String>['which', 'openssl'])) when(mockProcessManager.runSync(<String>['which', 'openssl']))
.thenReturn(exitsHappy); .thenReturn(exitsHappy);
when(mockProcessManager.runSync( when(mockProcessManager.runSync(
typedArgThat(contains('find-identity')), argThat(contains('find-identity')),
environment: anyNamed('environment'), environment: anyNamed('environment'),
workingDirectory: anyNamed('workingDirectory'), workingDirectory: anyNamed('workingDirectory'),
)).thenReturn(new ProcessResult( )).thenReturn(new ProcessResult(
...@@ -250,7 +250,7 @@ void main() { ...@@ -250,7 +250,7 @@ void main() {
final MockStream mockOpenSslStdErr = new MockStream(); final MockStream mockOpenSslStdErr = new MockStream();
when(mockProcessManager.start( when(mockProcessManager.start(
typedArgThat(contains('openssl')), argThat(contains('openssl')),
environment: anyNamed('environment'), environment: anyNamed('environment'),
workingDirectory: anyNamed('workingDirectory'), workingDirectory: anyNamed('workingDirectory'),
)).thenAnswer((Invocation invocation) => new Future<Process>.value(mockOpenSslProcess)); )).thenAnswer((Invocation invocation) => new Future<Process>.value(mockOpenSslProcess));
...@@ -293,7 +293,7 @@ void main() { ...@@ -293,7 +293,7 @@ void main() {
when(mockProcessManager.runSync(<String>['which', 'openssl'])) when(mockProcessManager.runSync(<String>['which', 'openssl']))
.thenReturn(exitsHappy); .thenReturn(exitsHappy);
when(mockProcessManager.runSync( when(mockProcessManager.runSync(
typedArgThat(contains('find-identity')), argThat(contains('find-identity')),
environment: anyNamed('environment'), environment: anyNamed('environment'),
workingDirectory: anyNamed('workingDirectory'), workingDirectory: anyNamed('workingDirectory'),
)).thenReturn(new ProcessResult( )).thenReturn(new ProcessResult(
...@@ -324,7 +324,7 @@ void main() { ...@@ -324,7 +324,7 @@ void main() {
final MockStream mockOpenSslStdErr = new MockStream(); final MockStream mockOpenSslStdErr = new MockStream();
when(mockProcessManager.start( when(mockProcessManager.start(
typedArgThat(contains('openssl')), argThat(contains('openssl')),
environment: anyNamed('environment'), environment: anyNamed('environment'),
workingDirectory: anyNamed('workingDirectory'), workingDirectory: anyNamed('workingDirectory'),
)).thenAnswer((Invocation invocation) => new Future<Process>.value(mockOpenSslProcess)); )).thenAnswer((Invocation invocation) => new Future<Process>.value(mockOpenSslProcess));
...@@ -361,7 +361,7 @@ void main() { ...@@ -361,7 +361,7 @@ void main() {
when(mockProcessManager.runSync(<String>['which', 'openssl'])) when(mockProcessManager.runSync(<String>['which', 'openssl']))
.thenReturn(exitsHappy); .thenReturn(exitsHappy);
when(mockProcessManager.runSync( when(mockProcessManager.runSync(
typedArgThat(contains('find-identity')), argThat(contains('find-identity')),
environment: anyNamed('environment'), environment: anyNamed('environment'),
workingDirectory: anyNamed('workingDirectory'), workingDirectory: anyNamed('workingDirectory'),
)).thenReturn(new ProcessResult( )).thenReturn(new ProcessResult(
...@@ -390,7 +390,7 @@ void main() { ...@@ -390,7 +390,7 @@ void main() {
final MockStream mockOpenSslStdErr = new MockStream(); final MockStream mockOpenSslStdErr = new MockStream();
when(mockProcessManager.start( when(mockProcessManager.start(
typedArgThat(contains('openssl')), argThat(contains('openssl')),
environment: anyNamed('environment'), environment: anyNamed('environment'),
workingDirectory: anyNamed('workingDirectory'), workingDirectory: anyNamed('workingDirectory'),
)).thenAnswer((Invocation invocation) => new Future<Process>.value(mockOpenSslProcess)); )).thenAnswer((Invocation invocation) => new Future<Process>.value(mockOpenSslProcess));
...@@ -431,7 +431,7 @@ void main() { ...@@ -431,7 +431,7 @@ void main() {
when(mockProcessManager.runSync(<String>['which', 'openssl'])) when(mockProcessManager.runSync(<String>['which', 'openssl']))
.thenReturn(exitsHappy); .thenReturn(exitsHappy);
when(mockProcessManager.runSync( when(mockProcessManager.runSync(
typedArgThat(contains('find-identity')), argThat(contains('find-identity')),
environment: anyNamed('environment'), environment: anyNamed('environment'),
workingDirectory: anyNamed('workingDirectory'), workingDirectory: anyNamed('workingDirectory'),
)).thenReturn(new ProcessResult( )).thenReturn(new ProcessResult(
...@@ -463,7 +463,7 @@ void main() { ...@@ -463,7 +463,7 @@ void main() {
final MockStream mockOpenSslStdErr = new MockStream(); final MockStream mockOpenSslStdErr = new MockStream();
when(mockProcessManager.start( when(mockProcessManager.start(
typedArgThat(contains('openssl')), argThat(contains('openssl')),
environment: anyNamed('environment'), environment: anyNamed('environment'),
workingDirectory: anyNamed('workingDirectory'), workingDirectory: anyNamed('workingDirectory'),
)).thenAnswer((Invocation invocation) => new Future<Process>.value(mockOpenSslProcess)); )).thenAnswer((Invocation invocation) => new Future<Process>.value(mockOpenSslProcess));
......
...@@ -82,7 +82,7 @@ void main() { ...@@ -82,7 +82,7 @@ void main() {
testUsingContext('idevicescreenshot captures and returns screenshot', () async { testUsingContext('idevicescreenshot captures and returns screenshot', () async {
when(mockOutputFile.path).thenReturn(outputPath); when(mockOutputFile.path).thenReturn(outputPath);
when(mockProcessManager.run(typed(any), environment: null, workingDirectory: null)).thenAnswer( when(mockProcessManager.run(any, environment: null, workingDirectory: null)).thenAnswer(
(Invocation invocation) => new Future<ProcessResult>.value(new ProcessResult(4, 0, '', ''))); (Invocation invocation) => new Future<ProcessResult>.value(new ProcessResult(4, 0, '', '')));
await iMobileDevice.takeScreenshot(mockOutputFile); await iMobileDevice.takeScreenshot(mockOutputFile);
......
...@@ -175,7 +175,7 @@ void main() { ...@@ -175,7 +175,7 @@ void main() {
mockProcessManager = new MockProcessManager(); mockProcessManager = new MockProcessManager();
// Let everything else return exit code 0 so process.dart doesn't crash. // Let everything else return exit code 0 so process.dart doesn't crash.
when( when(
mockProcessManager.run(typed(any), environment: null, workingDirectory: null) mockProcessManager.run(any, environment: null, workingDirectory: null)
).thenAnswer((Invocation invocation) => ).thenAnswer((Invocation invocation) =>
new Future<ProcessResult>.value(new ProcessResult(2, 0, '', '')) new Future<ProcessResult>.value(new ProcessResult(2, 0, '', ''))
); );
...@@ -229,7 +229,7 @@ void main() { ...@@ -229,7 +229,7 @@ void main() {
setUp(() { setUp(() {
mockProcessManager = new MockProcessManager(); mockProcessManager = new MockProcessManager();
when(mockProcessManager.start(typed(any), environment: null, workingDirectory: null)) when(mockProcessManager.start(any, environment: null, workingDirectory: null))
.thenAnswer((Invocation invocation) => new Future<Process>.value(new MockProcess())); .thenAnswer((Invocation invocation) => new Future<Process>.value(new MockProcess()));
}); });
...@@ -237,7 +237,7 @@ void main() { ...@@ -237,7 +237,7 @@ void main() {
final IOSSimulator device = new IOSSimulator('x', name: 'iPhone SE', category: 'iOS 9.3'); final IOSSimulator device = new IOSSimulator('x', name: 'iPhone SE', category: 'iOS 9.3');
await launchDeviceLogTool(device); await launchDeviceLogTool(device);
expect( expect(
verify(mockProcessManager.start(typed(captureAny), environment: null, workingDirectory: null)).captured.single, verify(mockProcessManager.start(captureAny, environment: null, workingDirectory: null)).captured.single,
contains('tail'), contains('tail'),
); );
}, },
...@@ -249,7 +249,7 @@ void main() { ...@@ -249,7 +249,7 @@ void main() {
final IOSSimulator device = new IOSSimulator('x', name: 'iPhone SE', category: 'iOS 11.0'); final IOSSimulator device = new IOSSimulator('x', name: 'iPhone SE', category: 'iOS 11.0');
await launchDeviceLogTool(device); await launchDeviceLogTool(device);
expect( expect(
verify(mockProcessManager.start(typed(captureAny), environment: null, workingDirectory: null)).captured.single, verify(mockProcessManager.start(captureAny, environment: null, workingDirectory: null)).captured.single,
contains('/usr/bin/log'), contains('/usr/bin/log'),
); );
}, },
...@@ -271,7 +271,7 @@ void main() { ...@@ -271,7 +271,7 @@ void main() {
final IOSSimulator device = new IOSSimulator('x', name: 'iPhone SE', category: 'iOS 9.3'); final IOSSimulator device = new IOSSimulator('x', name: 'iPhone SE', category: 'iOS 9.3');
await launchSystemLogTool(device); await launchSystemLogTool(device);
expect( expect(
verify(mockProcessManager.start(typed(captureAny), environment: null, workingDirectory: null)).captured.single, verify(mockProcessManager.start(captureAny, environment: null, workingDirectory: null)).captured.single,
contains('tail'), contains('tail'),
); );
}, },
......
...@@ -282,7 +282,7 @@ Information about project "Runner": ...@@ -282,7 +282,7 @@ Information about project "Runner":
} }
testUsingOsxContext('sets ARCHS=armv7 when armv7 local engine is set', () async { testUsingOsxContext('sets ARCHS=armv7 when armv7 local engine is set', () async {
when(mockArtifacts.getArtifactPath(Artifact.flutterFramework, TargetPlatform.ios, typed(any))).thenReturn('engine'); when(mockArtifacts.getArtifactPath(Artifact.flutterFramework, TargetPlatform.ios, any)).thenReturn('engine');
when(mockArtifacts.engineOutPath).thenReturn(fs.path.join('out', 'ios_profile_arm')); when(mockArtifacts.engineOutPath).thenReturn(fs.path.join('out', 'ios_profile_arm'));
const BuildInfo buildInfo = const BuildInfo(BuildMode.debug, null, const BuildInfo buildInfo = const BuildInfo(BuildMode.debug, null,
previewDart2: true, previewDart2: true,
...@@ -302,7 +302,7 @@ Information about project "Runner": ...@@ -302,7 +302,7 @@ Information about project "Runner":
}); });
testUsingOsxContext('sets TRACK_WIDGET_CREATION=true when trackWidgetCreation is true', () async { testUsingOsxContext('sets TRACK_WIDGET_CREATION=true when trackWidgetCreation is true', () async {
when(mockArtifacts.getArtifactPath(Artifact.flutterFramework, TargetPlatform.ios, typed(any))).thenReturn('engine'); when(mockArtifacts.getArtifactPath(Artifact.flutterFramework, TargetPlatform.ios, any)).thenReturn('engine');
when(mockArtifacts.engineOutPath).thenReturn(fs.path.join('out', 'ios_profile_arm')); when(mockArtifacts.engineOutPath).thenReturn(fs.path.join('out', 'ios_profile_arm'));
const BuildInfo buildInfo = const BuildInfo(BuildMode.debug, null, const BuildInfo buildInfo = const BuildInfo(BuildMode.debug, null,
previewDart2: true, previewDart2: true,
...@@ -323,7 +323,7 @@ Information about project "Runner": ...@@ -323,7 +323,7 @@ Information about project "Runner":
}); });
testUsingOsxContext('does not set TRACK_WIDGET_CREATION when trackWidgetCreation is false', () async { testUsingOsxContext('does not set TRACK_WIDGET_CREATION when trackWidgetCreation is false', () async {
when(mockArtifacts.getArtifactPath(Artifact.flutterFramework, TargetPlatform.ios, typed(any))).thenReturn('engine'); when(mockArtifacts.getArtifactPath(Artifact.flutterFramework, TargetPlatform.ios, any)).thenReturn('engine');
when(mockArtifacts.engineOutPath).thenReturn(fs.path.join('out', 'ios_profile_arm')); when(mockArtifacts.engineOutPath).thenReturn(fs.path.join('out', 'ios_profile_arm'));
const BuildInfo buildInfo = const BuildInfo(BuildMode.debug, null, const BuildInfo buildInfo = const BuildInfo(BuildMode.debug, null,
previewDart2: true, previewDart2: true,
...@@ -343,7 +343,7 @@ Information about project "Runner": ...@@ -343,7 +343,7 @@ Information about project "Runner":
}); });
testUsingOsxContext('sets ARCHS=armv7 when armv7 local engine is set', () async { testUsingOsxContext('sets ARCHS=armv7 when armv7 local engine is set', () async {
when(mockArtifacts.getArtifactPath(Artifact.flutterFramework, TargetPlatform.ios, typed(any))).thenReturn('engine'); when(mockArtifacts.getArtifactPath(Artifact.flutterFramework, TargetPlatform.ios, any)).thenReturn('engine');
when(mockArtifacts.engineOutPath).thenReturn(fs.path.join('out', 'ios_profile')); when(mockArtifacts.engineOutPath).thenReturn(fs.path.join('out', 'ios_profile'));
const BuildInfo buildInfo = const BuildInfo(BuildMode.debug, null, const BuildInfo buildInfo = const BuildInfo(BuildMode.debug, null,
previewDart2: true, previewDart2: true,
......
...@@ -61,7 +61,7 @@ void main() { ...@@ -61,7 +61,7 @@ void main() {
expect( expect(
verify(usage.sendTiming( verify(usage.sendTiming(
typed(captureAny), typed(captureAny), typed(captureAny), captureAny, captureAny, captureAny,
label: captureAnyNamed('label'))).captured, label: captureAnyNamed('label'))).captured,
<dynamic>['flutter', 'dummy', const Duration(milliseconds: 1000), null] <dynamic>['flutter', 'dummy', const Duration(milliseconds: 1000), null]
); );
...@@ -80,8 +80,8 @@ void main() { ...@@ -80,8 +80,8 @@ void main() {
await flutterCommand.run(); await flutterCommand.run();
verify(clock.now()).called(2); verify(clock.now()).called(2);
verifyNever(usage.sendTiming( verifyNever(usage.sendTiming(
typed(captureAny), typed(captureAny), typed(captureAny), any, any, any,
label: captureAnyNamed('label'))); label: anyNamed('label')));
}, },
overrides: <Type, Generator>{ overrides: <Type, Generator>{
Clock: () => clock, Clock: () => clock,
...@@ -106,7 +106,7 @@ void main() { ...@@ -106,7 +106,7 @@ void main() {
verify(clock.now()).called(2); verify(clock.now()).called(2);
expect( expect(
verify(usage.sendTiming( verify(usage.sendTiming(
typed(captureAny), typed(captureAny), typed(captureAny), captureAny, captureAny, captureAny,
label: captureAnyNamed('label'))).captured, label: captureAnyNamed('label'))).captured,
<dynamic>[ <dynamic>[
'flutter', 'flutter',
...@@ -137,7 +137,7 @@ void main() { ...@@ -137,7 +137,7 @@ void main() {
expect( expect(
verify(usage.sendTiming( verify(usage.sendTiming(
typed(captureAny), typed(captureAny), typed(captureAny), captureAny, captureAny, captureAny,
label: captureAnyNamed('label'))).captured, label: captureAnyNamed('label'))).captured,
<dynamic>[ <dynamic>[
'flutter', 'flutter',
......
...@@ -65,7 +65,7 @@ dependencies: ...@@ -65,7 +65,7 @@ dependencies:
yaml: 2.1.14 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" yaml: 2.1.14 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
dev_dependencies: dev_dependencies:
mockito: 3.0.0-alpha+5 mockito: 3.0.0-beta
test: 0.12.41 test: 0.12.41
# PUBSPEC CHECKSUM: 6256 # PUBSPEC CHECKSUM: 4e8b
...@@ -20,7 +20,7 @@ void main() { ...@@ -20,7 +20,7 @@ void main() {
setUp(() { setUp(() {
mockRunner = new MockSshCommandRunner(); mockRunner = new MockSshCommandRunner();
// 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))).thenAnswer((_) => when(mockRunner.run(any)).thenAnswer((_) =>
new Future<List<String>>.value( new Future<List<String>>.value(
<String>['123\n\n\n', '456 ', '789'])); <String>['123\n\n\n', '456 ', '789']));
const String address = 'fe80::8eae:4cff:fef4:9247'; const String address = 'fe80::8eae:4cff:fef4:9247';
...@@ -90,7 +90,7 @@ void main() { ...@@ -90,7 +90,7 @@ void main() {
final MockPeer mp = new MockPeer(); final MockPeer mp = new MockPeer();
mockPeerConnections.add(mp); mockPeerConnections.add(mp);
uriConnections.add(uri); uriConnections.add(uri);
when(mp.sendRequest(typed<String>(any), typed<String>(any))) when(mp.sendRequest(any, any))
// The local ports match the desired indices for now, so get the // The local ports match the desired indices for now, so get the
// canned response from the URI port. // canned response from the URI port.
.thenAnswer((_) => new Future<Map<String, dynamic>>( .thenAnswer((_) => new Future<Map<String, dynamic>>(
......
...@@ -84,8 +84,7 @@ void main() { ...@@ -84,8 +84,7 @@ void main() {
}; };
Future<json_rpc.Peer> mockVmConnectionFunction(Uri uri) { Future<json_rpc.Peer> mockVmConnectionFunction(Uri uri) {
when(mockPeer.sendRequest( when(mockPeer.sendRequest(any, any))
typed<String>(any), typed<Map<String, dynamic>>(any)))
.thenAnswer((_) => new Future<Map<String, dynamic>>( .thenAnswer((_) => new Future<Map<String, dynamic>>(
() => flutterViewCannedResponses)); () => flutterViewCannedResponses));
return new Future<json_rpc.Peer>(() => mockPeer); return new Future<json_rpc.Peer>(() => mockPeer);
...@@ -133,8 +132,7 @@ void main() { ...@@ -133,8 +132,7 @@ void main() {
}; };
Future<json_rpc.Peer> mockVmConnectionFunction(Uri uri) { Future<json_rpc.Peer> mockVmConnectionFunction(Uri uri) {
when(mockPeer.sendRequest( when(mockPeer.sendRequest(any, any))
typed<String>(any), typed<Map<String, dynamic>>(any)))
.thenAnswer((_) => new Future<Map<String, dynamic>>( .thenAnswer((_) => new Future<Map<String, dynamic>>(
() => flutterViewCannedResponseMissingId)); () => flutterViewCannedResponseMissingId));
return new Future<json_rpc.Peer>(() => mockPeer); return new Future<json_rpc.Peer>(() => mockPeer);
...@@ -171,8 +169,7 @@ void main() { ...@@ -171,8 +169,7 @@ void main() {
}; };
Future<json_rpc.Peer> mockVmConnectionFunction(Uri uri) { Future<json_rpc.Peer> mockVmConnectionFunction(Uri uri) {
when(mockPeer.sendRequest( when(mockPeer.sendRequest(any, any))
typed<String>(any), typed<Map<String, dynamic>>(any)))
.thenAnswer((_) => new Future<Map<String, dynamic>>( .thenAnswer((_) => new Future<Map<String, dynamic>>(
() => flutterViewCannedResponseMissingIsolateName)); () => flutterViewCannedResponseMissingIsolateName));
return new Future<json_rpc.Peer>(() => mockPeer); return new Future<json_rpc.Peer>(() => mockPeer);
...@@ -206,8 +203,7 @@ void main() { ...@@ -206,8 +203,7 @@ void main() {
const Duration timeoutTime = const Duration(milliseconds: 100); const Duration timeoutTime = const Duration(milliseconds: 100);
Future<json_rpc.Peer> mockVmConnectionFunction(Uri uri) { Future<json_rpc.Peer> mockVmConnectionFunction(Uri uri) {
// Return a command that will never complete. // Return a command that will never complete.
when(mockPeer.sendRequest( when(mockPeer.sendRequest(any, any))
typed<String>(any), typed<Map<String, dynamic>>(any)))
.thenAnswer((_) => new Completer<Map<String, dynamic>>().future); .thenAnswer((_) => new Completer<Map<String, dynamic>>().future);
return new Future<json_rpc.Peer>(() => mockPeer); return new Future<json_rpc.Peer>(() => mockPeer);
} }
......
...@@ -40,7 +40,7 @@ void main() { ...@@ -40,7 +40,7 @@ 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(any)).thenAnswer(
(_) => new Future<MockProcessResult>.value(mockProcessResult)); (_) => new Future<MockProcessResult>.value(mockProcessResult));
}); });
...@@ -57,7 +57,7 @@ void main() { ...@@ -57,7 +57,7 @@ void main() {
when(mockProcessResult.exitCode).thenReturn(0); when(mockProcessResult.exitCode).thenReturn(0);
await runner.run('ls /whatever'); await runner.run('ls /whatever');
final List<String> passedCommand = final List<String> passedCommand =
verify(mockProcessManager.run(typed(captureAny))).captured.single; verify(mockProcessManager.run(captureAny)).captured.single;
expect(passedCommand, contains('$ipV6Addr%$interface')); expect(passedCommand, contains('$ipV6Addr%$interface'));
}); });
...@@ -72,7 +72,7 @@ void main() { ...@@ -72,7 +72,7 @@ void main() {
when(mockProcessResult.exitCode).thenReturn(0); when(mockProcessResult.exitCode).thenReturn(0);
await runner.run('ls /whatever'); await runner.run('ls /whatever');
final List<String> passedCommand = final List<String> passedCommand =
verify(mockProcessManager.run(typed(captureAny))).captured.single; verify(mockProcessManager.run(captureAny)).captured.single;
expect(passedCommand, contains(ipV6Addr)); expect(passedCommand, contains(ipV6Addr));
}); });
...@@ -114,7 +114,7 @@ void main() { ...@@ -114,7 +114,7 @@ void main() {
when(mockProcessResult.exitCode).thenReturn(0); when(mockProcessResult.exitCode).thenReturn(0);
await runner.run('ls /whatever'); await runner.run('ls /whatever');
final List<String> passedCommand = final List<String> passedCommand =
verify(mockProcessManager.run(typed(captureAny))).captured.single; verify(mockProcessManager.run(captureAny)).captured.single;
expect(passedCommand, contains('-F')); expect(passedCommand, contains('-F'));
final int indexOfFlag = passedCommand.indexOf('-F'); final int indexOfFlag = passedCommand.indexOf('-F');
final String passedConfig = passedCommand[indexOfFlag + 1]; final String passedConfig = passedCommand[indexOfFlag + 1];
...@@ -131,7 +131,7 @@ void main() { ...@@ -131,7 +131,7 @@ void main() {
when(mockProcessResult.exitCode).thenReturn(0); when(mockProcessResult.exitCode).thenReturn(0);
await runner.run('ls /whatever'); await runner.run('ls /whatever');
final List<String> passedCommand = final List<String> passedCommand =
verify(mockProcessManager.run(typed(captureAny))).captured.single; verify(mockProcessManager.run(captureAny)).captured.single;
final int indexOfFlag = passedCommand.indexOf('-F'); final int indexOfFlag = passedCommand.indexOf('-F');
expect(indexOfFlag, equals(-1)); expect(indexOfFlag, equals(-1));
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment