From 9f8a70be4cea69660ffc8bf48fe82a0f98d0ad23 Mon Sep 17 00:00:00 2001 From: Sam Rawlins Date: Thu, 21 Jun 2018 16:23:47 -0700 Subject: [PATCH] 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 --- dev/bots/pubspec.yaml | 4 +- dev/bots/test/fake_process_manager.dart | 30 ++++----- dev/bots/test/prepare_package_test.dart | 6 +- dev/manual_tests/pubspec.yaml | 4 +- dev/manual_tests/test/mock_image_http.dart | 6 +- dev/tools/pubspec.yaml | 4 +- packages/flutter/pubspec.yaml | 4 +- .../flutter/test/cupertino/refresh_test.dart | 62 +++++++++---------- .../foundation/consolidate_response_test.dart | 4 +- .../test/material/animated_icons_test.dart | 10 +-- .../test/widgets/editable_text_test.dart | 38 ++++++------ .../test/widgets/image_headers_test.dart | 6 +- packages/flutter_driver/pubspec.yaml | 4 +- .../test/flutter_driver_test.dart | 18 +++--- packages/flutter_goldens/pubspec.yaml | 4 +- .../test/flutter_goldens_test.dart | 4 +- packages/flutter_localizations/pubspec.yaml | 4 +- .../lib/src/commands/update_packages.dart | 2 +- packages/flutter_tools/pubspec.yaml | 4 +- .../flutter_tools/test/analytics_test.dart | 4 +- .../test/android/android_device_test.dart | 2 +- .../test/android/android_sdk_test.dart | 4 +- .../test/ios/cocoapods_test.dart | 8 +-- .../test/ios/code_signing_test.dart | 26 ++++---- packages/flutter_tools/test/ios/mac_test.dart | 2 +- .../test/ios/simulators_test.dart | 10 +-- .../test/ios/xcodeproj_test.dart | 8 +-- .../test/runner/flutter_command_test.dart | 10 +-- .../pubspec.yaml | 4 +- .../test/fuchsia_remote_connection_test.dart | 4 +- .../test/src/dart/dart_vm_test.dart | 12 ++-- .../src/runners/ssh_command_runner_test.dart | 10 +-- 32 files changed, 159 insertions(+), 163 deletions(-) diff --git a/dev/bots/pubspec.yaml b/dev/bots/pubspec.yaml index fb36bd5613..1bd667124b 100644 --- a/dev/bots/pubspec.yaml +++ b/dev/bots/pubspec.yaml @@ -21,7 +21,7 @@ dependencies: dev_dependencies: 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" boolean_selector: 1.0.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" @@ -61,4 +61,4 @@ dev_dependencies: 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" -# PUBSPEC CHECKSUM: 049d +# PUBSPEC CHECKSUM: 77d2 diff --git a/dev/bots/test/fake_process_manager.dart b/dev/bots/test/fake_process_manager.dart index 54471d9124..be9f78be50 100644 --- a/dev/bots/test/fake_process_manager.dart +++ b/dev/bots/test/fake_process_manager.dart @@ -84,32 +84,32 @@ class FakeProcessManager extends Mock implements ProcessManager { // expected to be called. // TODO(gspencer): make this more general so that any call will be captured. when(start( - typed(captureAny), - environment: typed(captureAny, named: 'environment'), - workingDirectory: typed(captureAny, named: 'workingDirectory'), + any, + environment: anyNamed('environment'), + workingDirectory: anyNamed('workingDirectory'), )).thenAnswer(_nextProcess); - when(start(typed(captureAny))).thenAnswer(_nextProcess); + when(start(any)).thenAnswer(_nextProcess); when(run( - typed(captureAny), - environment: typed(captureAny, named: 'environment'), - workingDirectory: typed(captureAny, named: 'workingDirectory'), + any, + environment: anyNamed('environment'), + workingDirectory: anyNamed('workingDirectory'), )).thenAnswer(_nextResult); - when(run(typed(captureAny))).thenAnswer(_nextResult); + when(run(any)).thenAnswer(_nextResult); when(runSync( - typed(captureAny), - environment: typed(captureAny, named: 'environment'), - workingDirectory: typed(captureAny, named: 'workingDirectory') + any, + environment: anyNamed('environment'), + workingDirectory: anyNamed('workingDirectory') )).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); } } @@ -130,7 +130,7 @@ class FakeProcess extends Mock implements Process { final int desiredExitCode; void _setupMock() { - when(kill(typed(captureAny))).thenReturn(true); + when(kill(any)).thenReturn(true); } @override diff --git a/dev/bots/test/prepare_package_test.dart b/dev/bots/test/prepare_package_test.dart index f1272ce2fb..709eacfe77 100644 --- a/dev/bots/test/prepare_package_test.dart +++ b/dev/bots/test/prepare_package_test.dart @@ -142,9 +142,9 @@ void main() { await creator.createArchive(); expect( verify(processManager.start( - typed(captureAny), - workingDirectory: typed(captureAny, named: 'workingDirectory'), - environment: typed(captureAny, named: 'environment'), + captureAny, + workingDirectory: captureAnyNamed('workingDirectory'), + environment: captureAnyNamed('environment'), )).captured[2]['PUB_CACHE'], endsWith(path.join('flutter', '.pub-cache')), ); diff --git a/dev/manual_tests/pubspec.yaml b/dev/manual_tests/pubspec.yaml index 97b840bcac..180aa7fe21 100644 --- a/dev/manual_tests/pubspec.yaml +++ b/dev/manual_tests/pubspec.yaml @@ -13,7 +13,7 @@ dev_dependencies: flutter_test: 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" args: 1.4.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" @@ -66,4 +66,4 @@ dev_dependencies: flutter: uses-material-design: true -# PUBSPEC CHECKSUM: 3f92 +# PUBSPEC CHECKSUM: 8dc7 diff --git a/dev/manual_tests/test/mock_image_http.dart b/dev/manual_tests/test/mock_image_http.dart index bc788b57e9..e9708ea49a 100644 --- a/dev/manual_tests/test/mock_image_http.dart +++ b/dev/manual_tests/test/mock_image_http.dart @@ -11,12 +11,12 @@ MockHttpClient createMockImageHttpClient(SecurityContext _) { final MockHttpClientRequest request = new MockHttpClientRequest(); final MockHttpClientResponse response = new MockHttpClientResponse(); final MockHttpHeaders headers = new MockHttpHeaders(); - when(client.getUrl(typed(any))).thenAnswer((_) => new Future.value(request)); + when(client.getUrl(any)).thenAnswer((_) => new Future.value(request)); when(request.headers).thenReturn(headers); when(request.close()).thenAnswer((_) => new Future.value(response)); when(response.contentLength).thenReturn(kTransparentImage.length); 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) onData = invocation.positionalArguments[0]; final void Function() onDone = invocation.namedArguments[#onDone]; final void Function(Object, [StackTrace]) onError = invocation.namedArguments[#onError]; @@ -32,4 +32,4 @@ class MockHttpClientRequest extends Mock implements HttpClientRequest {} class MockHttpClientResponse extends Mock implements HttpClientResponse {} -class MockHttpHeaders extends Mock implements HttpHeaders {} \ No newline at end of file +class MockHttpHeaders extends Mock implements HttpHeaders {} diff --git a/dev/tools/pubspec.yaml b/dev/tools/pubspec.yaml index 49a1115c70..c0042c2f30 100644 --- a/dev/tools/pubspec.yaml +++ b/dev/tools/pubspec.yaml @@ -24,7 +24,7 @@ dependencies: dev_dependencies: 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" boolean_selector: 1.0.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" @@ -62,4 +62,4 @@ dev_dependencies: 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" -# PUBSPEC CHECKSUM: 5d71 +# PUBSPEC CHECKSUM: d9a6 diff --git a/packages/flutter/pubspec.yaml b/packages/flutter/pubspec.yaml index f9f10c235d..adf86c88d1 100644 --- a/packages/flutter/pubspec.yaml +++ b/packages/flutter/pubspec.yaml @@ -18,7 +18,7 @@ dev_dependencies: sdk: flutter flutter_goldens: 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" args: 1.4.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" @@ -75,4 +75,4 @@ dev_dependencies: environment: sdk: '>=1.19.0 <2.0.0' -# PUBSPEC CHECKSUM: b1ad +# PUBSPEC CHECKSUM: 91e2 diff --git a/packages/flutter/test/cupertino/refresh_test.dart b/packages/flutter/test/cupertino/refresh_test.dart index 3e5877c2c7..b56d2231f3 100644 --- a/packages/flutter/test/cupertino/refresh_test.dart +++ b/packages/flutter/test/cupertino/refresh_test.dart @@ -36,7 +36,7 @@ void main() { refreshIndicator = new Container(); when(mockHelper.builder( - typed(any), typed(any), typed(any), typed(any), typed(any))) + any, any, any, any, any)) .thenAnswer((Invocation i) { final RefreshIndicatorMode refreshState = i.positionalArguments[1]; final double pulledExtent = i.positionalArguments[2]; @@ -129,7 +129,7 @@ void main() { // The function is referenced once while passing into CupertinoRefreshControl // and is called. verify(mockHelper.builder( - typed(any), + any, RefreshIndicatorMode.drag, 50.0, 100.0, // Default value. @@ -205,23 +205,23 @@ void main() { verifyInOrder([ mockHelper.builder( - typed(any), + any, RefreshIndicatorMode.drag, 50.0, 100.0, // Default value. 60.0, // Default value. ), mockHelper.builder( - typed(any), + any, RefreshIndicatorMode.drag, - typed(argThat(moreOrLessEquals(48.36801747187993))), + argThat(moreOrLessEquals(48.36801747187993)), 100.0, // Default value. 60.0, // Default value. ), mockHelper.builder( - typed(any), + any, RefreshIndicatorMode.drag, - typed(argThat(moreOrLessEquals(44.63031931875867))), + argThat(moreOrLessEquals(44.63031931875867)), 100.0, // Default value. 60.0, // Default value. ), @@ -271,23 +271,23 @@ void main() { verifyInOrder([ mockHelper.builder( - typed(any), + any, RefreshIndicatorMode.drag, 99.0, 100.0, // Default value. 60.0, // Default value. ), mockHelper.builder( - typed(any), + any, RefreshIndicatorMode.drag, - typed(argThat(moreOrLessEquals(86.78169))), + argThat(moreOrLessEquals(86.78169)), 100.0, // Default value. 60.0, // Default value. ), mockHelper.builder( - typed(any), + any, RefreshIndicatorMode.armed, - typed(argThat(moreOrLessEquals(105.80452021305739))), + argThat(moreOrLessEquals(105.80452021305739)), 100.0, // Default value. 60.0, // Default value. ), @@ -330,7 +330,7 @@ void main() { verifyInOrder([ mockHelper.builder( - typed(any), + any, RefreshIndicatorMode.armed, 150.0, 100.0, // Default value. @@ -338,9 +338,9 @@ void main() { ), mockHelper.refreshTask(), mockHelper.builder( - typed(any), + any, RefreshIndicatorMode.armed, - typed(argThat(moreOrLessEquals(127.10396988577114))), + argThat(moreOrLessEquals(127.10396988577114)), 100.0, // Default value. 60.0, // Default value. ), @@ -349,7 +349,7 @@ void main() { // Reaches refresh state and sliver's at 60.0 in height after a while. await tester.pump(const Duration(seconds: 1)); verify(mockHelper.builder( - typed(any), + any, RefreshIndicatorMode.refresh, 60.0, 100.0, // Default value. @@ -368,7 +368,7 @@ void main() { await tester.pump(); verify(mockHelper.builder( - typed(any), + any, RefreshIndicatorMode.done, 60.0, 100.0, // Default value. @@ -404,7 +404,7 @@ void main() { await tester.pump(); verify(mockHelper.builder( - typed(any), + any, RefreshIndicatorMode.armed, 150.0, 100.0, // Default value. @@ -422,7 +422,7 @@ void main() { // Refresh indicator still being told to layout the same way. verify(mockHelper.builder( - typed(any), + any, RefreshIndicatorMode.refresh, 60.0, 100.0, // Default value. @@ -483,7 +483,7 @@ void main() { await tester.drag(find.text('0'), const Offset(0.0, 150.0)); await tester.pump(); verify(mockHelper.builder( - typed(any), + any, RefreshIndicatorMode.armed, 150.0, 100.0, // Default value. @@ -500,7 +500,7 @@ void main() { // Let it snap back to occupy the indicator's final sliver space only. await tester.pump(const Duration(seconds: 2)); verify(mockHelper.builder( - typed(any), + any, RefreshIndicatorMode.refresh, 60.0, 100.0, // Default value. @@ -518,7 +518,7 @@ void main() { refreshCompleter.complete(null); await tester.pump(); verify(mockHelper.builder( - typed(any), + any, RefreshIndicatorMode.done, 60.0, 100.0, // Default value. @@ -564,7 +564,7 @@ void main() { refreshCompleter.complete(null); await tester.pump(); verify(mockHelper.builder( - typed(any), + any, RefreshIndicatorMode.done, 150.0, // Still overscrolled here. 100.0, // Default value. @@ -575,7 +575,7 @@ void main() { await tester.pump(const Duration(milliseconds: 100)); // The refresh indicator is still building. verify(mockHelper.builder( - typed(any), + any, RefreshIndicatorMode.done, 91.31180913199277, 100.0, // Default value. @@ -594,7 +594,7 @@ void main() { // Instead, it's still in the done state because the sliver never // fully retracted. verify(mockHelper.builder( - typed(any), + any, RefreshIndicatorMode.done, 147.3772721631821, 100.0, // Default value. @@ -613,7 +613,7 @@ void main() { await tester.drag(find.text('0'), const Offset(0.0, 40.0)); await tester.pump(); verify(mockHelper.builder( - typed(any), + any, RefreshIndicatorMode.drag, 40.0, 100.0, // Default value. @@ -656,7 +656,7 @@ void main() { refreshCompleter.complete(null); await tester.pump(); verify(mockHelper.builder( - typed(any), + any, RefreshIndicatorMode.done, 150.0, // Still overscrolled here. 100.0, // Default value. @@ -717,7 +717,7 @@ void main() { // Refresh indicator still being told to layout the same way. verify(mockHelper.builder( - typed(any), + any, RefreshIndicatorMode.refresh, 60.0, 100.0, // Default value. @@ -752,7 +752,7 @@ void main() { await tester.pump(); verify(mockHelper.builder( - typed(any), + any, RefreshIndicatorMode.drag, 4.615384615384642, 100.0, // Default value. @@ -829,7 +829,7 @@ void main() { await tester.drag(find.text('0'), const Offset(0.0, 150.0)); await tester.pump(); verify(mockHelper.builder( - typed(any), + any, RefreshIndicatorMode.armed, 150.0, 100.0, // Default value. @@ -838,7 +838,7 @@ void main() { await tester.pump(const Duration(milliseconds: 10)); verify(mockHelper.builder( - typed(any), + any, RefreshIndicatorMode.done, // Goes to done on the next frame. 148.6463892921364, 100.0, // Default value. diff --git a/packages/flutter/test/foundation/consolidate_response_test.dart b/packages/flutter/test/foundation/consolidate_response_test.dart index c967197800..13293ea8ca 100644 --- a/packages/flutter/test/foundation/consolidate_response_test.dart +++ b/packages/flutter/test/foundation/consolidate_response_test.dart @@ -14,7 +14,7 @@ void main() { setUp(() { response = new MockHttpClientResponse(); when(response.listen( - typed(any), + any, onDone: anyNamed('onDone'), onError: anyNamed('onError'), cancelOnError: anyNamed('cancelOnError') @@ -64,7 +64,7 @@ void main() { test('forwards errors from HttpClientResponse', () async { when(response.listen( - typed(any), + any, onDone: anyNamed('onDone'), onError: anyNamed('onError'), cancelOnError: anyNamed('cancelOnError') diff --git a/packages/flutter/test/material/animated_icons_test.dart b/packages/flutter/test/material/animated_icons_test.dart index 8b585b379e..c1e4310491 100644 --- a/packages/flutter/test/material/animated_icons_test.dart +++ b/packages/flutter/test/material/animated_icons_test.dart @@ -31,7 +31,7 @@ void main() { final CustomPaint customPaint = tester.widget(find.byType(CustomPaint)); final MockCanvas canvas = new MockCanvas(); 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 { @@ -53,7 +53,7 @@ void main() { final CustomPaint customPaint = tester.widget(find.byType(CustomPaint)); final MockCanvas canvas = new MockCanvas(); 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 { @@ -75,7 +75,7 @@ void main() { final CustomPaint customPaint = tester.widget(find.byType(CustomPaint)); final MockCanvas canvas = new MockCanvas(); 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 { @@ -187,8 +187,8 @@ void main() { final CustomPaint customPaint = tester.widget(find.byType(CustomPaint)); final MockCanvas canvas = new MockCanvas(); customPaint.painter.paint(canvas, const Size(48.0, 48.0)); - verifyNever(canvas.rotate(typed(any))); - verifyNever(canvas.translate(typed(any), typed(any))); + verifyNever(canvas.rotate(any)); + verifyNever(canvas.translate(any, any)); }); testWidgets('Inherited text direction overridden', (WidgetTester tester) async { diff --git a/packages/flutter/test/widgets/editable_text_test.dart b/packages/flutter/test/widgets/editable_text_test.dart index 2ce90bfe69..9a17829544 100644 --- a/packages/flutter/test/widgets/editable_text_test.dart +++ b/packages/flutter/test/widgets/editable_text_test.dart @@ -631,16 +631,16 @@ void main() { controller.selection = new TextSelection.collapsed(offset: controller.text.length); controls = new MockTextSelectionControls(); - when(controls.buildHandle(typed(any), typed(any), typed(any))).thenReturn(new Container()); - when(controls.buildToolbar(typed(any), typed(any), typed(any), typed(any))).thenReturn(new Container()); + when(controls.buildHandle(any, any, any)).thenReturn(new Container()); + when(controls.buildToolbar(any, any, any, any)).thenReturn(new Container()); }); testWidgets('are exposed', (WidgetTester tester) async { final SemanticsTester semantics = new SemanticsTester(tester); - when(controls.canCopy(typed(any))).thenReturn(false); - when(controls.canCut(typed(any))).thenReturn(false); - when(controls.canPaste(typed(any))).thenReturn(false); + when(controls.canCopy(any)).thenReturn(false); + when(controls.canCut(any)).thenReturn(false); + when(controls.canPaste(any)).thenReturn(false); await _buildApp(controls, tester); await tester.tap(find.byType(EditableText)); @@ -654,7 +654,7 @@ void main() { ], )); - when(controls.canCopy(typed(any))).thenReturn(true); + when(controls.canCopy(any)).thenReturn(true); await _buildApp(controls, tester); expect(semantics, includesNodeWith( value: 'test', @@ -665,8 +665,8 @@ void main() { ], )); - when(controls.canCopy(typed(any))).thenReturn(false); - when(controls.canPaste(typed(any))).thenReturn(true); + when(controls.canCopy(any)).thenReturn(false); + when(controls.canPaste(any)).thenReturn(true); await _buildApp(controls, tester); expect(semantics, includesNodeWith( value: 'test', @@ -677,8 +677,8 @@ void main() { ], )); - when(controls.canPaste(typed(any))).thenReturn(false); - when(controls.canCut(typed(any))).thenReturn(true); + when(controls.canPaste(any)).thenReturn(false); + when(controls.canCut(any)).thenReturn(true); await _buildApp(controls, tester); expect(semantics, includesNodeWith( value: 'test', @@ -689,9 +689,9 @@ void main() { ], )); - when(controls.canCopy(typed(any))).thenReturn(true); - when(controls.canCut(typed(any))).thenReturn(true); - when(controls.canPaste(typed(any))).thenReturn(true); + when(controls.canCopy(any)).thenReturn(true); + when(controls.canCut(any)).thenReturn(true); + when(controls.canPaste(any)).thenReturn(true); await _buildApp(controls, tester); expect(semantics, includesNodeWith( value: 'test', @@ -710,9 +710,9 @@ void main() { testWidgets('can copy/cut/paste with a11y', (WidgetTester tester) async { final SemanticsTester semantics = new SemanticsTester(tester); - when(controls.canCopy(typed(any))).thenReturn(true); - when(controls.canCut(typed(any))).thenReturn(true); - when(controls.canPaste(typed(any))).thenReturn(true); + when(controls.canCopy(any)).thenReturn(true); + when(controls.canCut(any)).thenReturn(true); + when(controls.canPaste(any)).thenReturn(true); await _buildApp(controls, tester); await tester.tap(find.byType(EditableText)); await tester.pump(); @@ -754,13 +754,13 @@ void main() { ), ignoreRect: true, ignoreTransform: true)); owner.performAction(expectedNodeId, SemanticsAction.copy); - verify(controls.handleCopy(typed(any))).called(1); + verify(controls.handleCopy(any)).called(1); owner.performAction(expectedNodeId, SemanticsAction.cut); - verify(controls.handleCut(typed(any))).called(1); + verify(controls.handleCut(any)).called(1); owner.performAction(expectedNodeId, SemanticsAction.paste); - verify(controls.handlePaste(typed(any))).called(1); + verify(controls.handlePaste(any)).called(1); semantics.dispose(); }); diff --git a/packages/flutter/test/widgets/image_headers_test.dart b/packages/flutter/test/widgets/image_headers_test.dart index dfe792e956..d6593bc8a0 100644 --- a/packages/flutter/test/widgets/image_headers_test.dart +++ b/packages/flutter/test/widgets/image_headers_test.dart @@ -27,12 +27,12 @@ void main() { verify(headers.add('flutter', 'flutter')).called(1); }, createHttpClient: (SecurityContext _) { - when(client.getUrl(typed(any))).thenAnswer((_) => new Future.value(request)); + when(client.getUrl(any)).thenAnswer((_) => new Future.value(request)); when(request.headers).thenReturn(headers); when(request.close()).thenAnswer((_) => new Future.value(response)); when(response.contentLength).thenReturn(kTransparentImage.length); 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) onData = invocation.positionalArguments[0]; final void Function() onDone = invocation.namedArguments[#onDone]; final void Function(Object, [StackTrace]) onError = invocation.namedArguments[#onError]; @@ -50,4 +50,4 @@ class MockHttpClientRequest extends Mock implements HttpClientRequest {} class MockHttpClientResponse extends Mock implements HttpClientResponse {} -class MockHttpHeaders extends Mock implements HttpHeaders {} \ No newline at end of file +class MockHttpHeaders extends Mock implements HttpHeaders {} diff --git a/packages/flutter_driver/pubspec.yaml b/packages/flutter_driver/pubspec.yaml index 5a22125214..84d6587a6f 100644 --- a/packages/flutter_driver/pubspec.yaml +++ b/packages/flutter_driver/pubspec.yaml @@ -66,7 +66,7 @@ dependencies: dev_dependencies: test: 0.12.41 - mockito: 3.0.0-alpha+5 + mockito: 3.0.0-beta quiver: 0.29.0+1 -# PUBSPEC CHECKSUM: 1909 +# PUBSPEC CHECKSUM: a03e diff --git a/packages/flutter_driver/test/flutter_driver_test.dart b/packages/flutter_driver/test/flutter_driver_test.dart index c5741f21bb..7ac08b6ba7 100644 --- a/packages/flutter_driver/test/flutter_driver_test.dart +++ b/packages/flutter_driver/test/flutter_driver_test.dart @@ -40,7 +40,7 @@ void main() { when(mockClient.getVM()).thenAnswer((_) => new Future.value(mockVM)); when(mockVM.isolates).thenReturn([mockIsolate]); when(mockIsolate.loadRunnable()).thenAnswer((_) => new Future.value(mockIsolate)); - when(mockIsolate.invokeExtension(typed(any), typed(any))).thenAnswer( + when(mockIsolate.invokeExtension(any, any)).thenAnswer( (Invocation invocation) => makeMockResponse({'status': 'ok'})); vmServiceConnectFunction = (String url) { return new Future.value( @@ -124,7 +124,7 @@ void main() { }); 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({'status': 'ok'})); final Health result = await driver.checkHealth(); expect(result.status, HealthStatus.ok); @@ -142,7 +142,7 @@ void main() { }); 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], { 'command': 'tap', 'timeout': _kSerializedTestTimeout, @@ -162,7 +162,7 @@ void main() { }); 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], { 'command': 'tap', 'timeout': _kSerializedTestTimeout, @@ -181,7 +181,7 @@ void main() { }); 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], { 'command': 'get_text', 'timeout': _kSerializedTestTimeout, @@ -204,7 +204,7 @@ void main() { }); 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], { 'command': 'waitFor', 'finderType': 'ByTooltipMessage', @@ -219,7 +219,7 @@ void main() { group('waitUntilNoTransientCallbacks', () { 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], { 'command': 'waitUntilNoTransientCallbacks', 'timeout': _kSerializedTestTimeout, @@ -356,7 +356,7 @@ void main() { group('sendCommand error conditions', () { 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 return new Completer>().future; }); @@ -370,7 +370,7 @@ void main() { }); test('remote error', () async { - when(mockIsolate.invokeExtension(typed(any), typed(any))).thenAnswer((Invocation i) { + when(mockIsolate.invokeExtension(any, any)).thenAnswer((Invocation i) { return makeMockResponse({ 'message': 'This is a failure' }, isError: true); diff --git a/packages/flutter_goldens/pubspec.yaml b/packages/flutter_goldens/pubspec.yaml index c19ba66c8a..02930cb1f9 100644 --- a/packages/flutter_goldens/pubspec.yaml +++ b/packages/flutter_goldens/pubspec.yaml @@ -62,9 +62,9 @@ dependencies: yaml: 2.1.14 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" dev_dependencies: - mockito: 3.0.0-alpha+5 + mockito: 3.0.0-beta environment: sdk: '>=1.19.0 <2.0.0' -# PUBSPEC CHECKSUM: 6256 +# PUBSPEC CHECKSUM: 4e8b diff --git a/packages/flutter_goldens/test/flutter_goldens_test.dart b/packages/flutter_goldens/test/flutter_goldens_test.dart index 7f5a704166..0c26bf4446 100644 --- a/packages/flutter_goldens/test/flutter_goldens_test.dart +++ b/packages/flutter_goldens/test/flutter_goldens_test.dart @@ -46,13 +46,13 @@ void main() { group('prepare', () { 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.value(io.ProcessResult(123, 0, _kGoldensVersion, ''))); await goldens.prepare(); // Verify that we only spawned `git rev-parse HEAD` final VerificationResult verifyProcessRun = - verify(process.run(typed(captureAny), workingDirectory: typed(captureAny, named: 'workingDirectory'))); + verify(process.run(captureAny, workingDirectory: captureAnyNamed('workingDirectory'))); verifyProcessRun.called(1); expect(verifyProcessRun.captured.first, ['git', 'rev-parse', 'HEAD']); expect(verifyProcessRun.captured.last, _kRepositoryRoot); diff --git a/packages/flutter_localizations/pubspec.yaml b/packages/flutter_localizations/pubspec.yaml index 621bd0307e..c0ddcf7bd3 100644 --- a/packages/flutter_localizations/pubspec.yaml +++ b/packages/flutter_localizations/pubspec.yaml @@ -15,7 +15,7 @@ dependencies: dev_dependencies: flutter_test: 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" args: 1.4.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" @@ -64,4 +64,4 @@ dev_dependencies: 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" -# PUBSPEC CHECKSUM: e074 +# PUBSPEC CHECKSUM: e3a9 diff --git a/packages/flutter_tools/lib/src/commands/update_packages.dart b/packages/flutter_tools/lib/src/commands/update_packages.dart index fa07bf4604..cf14a2af0f 100644 --- a/packages/flutter_tools/lib/src/commands/update_packages.dart +++ b/packages/flutter_tools/lib/src/commands/update_packages.dart @@ -27,7 +27,7 @@ import '../runner/flutter_command.dart'; /// ``` const Map _kManuallyPinnedDependencies = const { // 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 }; diff --git a/packages/flutter_tools/pubspec.yaml b/packages/flutter_tools/pubspec.yaml index 9c5cb2a28b..6d3d7728eb 100644 --- a/packages/flutter_tools/pubspec.yaml +++ b/packages/flutter_tools/pubspec.yaml @@ -78,11 +78,11 @@ dependencies: dev_dependencies: collection: 1.14.6 - mockito: 3.0.0-alpha+5 + mockito: 3.0.0-beta file_testing: 2.0.0 dartdoc: # Exclude this package from the hosted API docs. nodoc: true -# PUBSPEC CHECKSUM: 3ac4 +# PUBSPEC CHECKSUM: baf9 diff --git a/packages/flutter_tools/test/analytics_test.dart b/packages/flutter_tools/test/analytics_test.dart index f4eabaa958..866b418b29 100644 --- a/packages/flutter_tools/test/analytics_test.dart +++ b/packages/flutter_tools/test/analytics_test.dart @@ -106,7 +106,7 @@ void main() { verify(mockClock.now()).called(2); expect( - verify(mockUsage.sendTiming(captureAny, captureAny, captureAny, label: captureAny)).captured, + verify(mockUsage.sendTiming(captureAny, captureAny, captureAny, label: captureAnyNamed('label'))).captured, ['flutter', 'doctor', const Duration(milliseconds: 1000), 'success'] ); }, overrides: { @@ -125,7 +125,7 @@ void main() { verify(mockClock.now()).called(2); expect( - verify(mockUsage.sendTiming(captureAny, captureAny, captureAny, label: captureAny)).captured, + verify(mockUsage.sendTiming(captureAny, captureAny, captureAny, label: captureAnyNamed('label'))).captured, ['flutter', 'doctor', const Duration(milliseconds: 1000), 'warning'] ); }, overrides: { diff --git a/packages/flutter_tools/test/android/android_device_test.dart b/packages/flutter_tools/test/android/android_device_test.dart index 68ffa792c0..5fb766d0e9 100644 --- a/packages/flutter_tools/test/android/android_device_test.dart +++ b/packages/flutter_tools/test/android/android_device_test.dart @@ -88,7 +88,7 @@ Use the 'android' tool to install them: setUp(() { hardware = 'unknown'; buildCharacteristics = 'unused'; - when(mockProcessManager.run(typedArgThat(contains('getprop')), + when(mockProcessManager.run(argThat(contains('getprop')), stderrEncoding: anyNamed('stderrEncoding'), stdoutEncoding: anyNamed('stdoutEncoding'))).thenAnswer((_) { final StringBuffer buf = new StringBuffer() diff --git a/packages/flutter_tools/test/android/android_sdk_test.dart b/packages/flutter_tools/test/android/android_sdk_test.dart index 405f1749a4..a478369a09 100644 --- a/packages/flutter_tools/test/android/android_sdk_test.dart +++ b/packages/flutter_tools/test/android/android_sdk_test.dart @@ -74,7 +74,7 @@ void main() { final AndroidSdk sdk = AndroidSdk.locateAndroidSdk(); when(processManager.canRun(sdk.sdkManagerPath)).thenReturn(true); when(processManager.runSync([sdk.sdkManagerPath, '--version'], - environment: typedArgThat(isNotNull, named: 'environment'))) + environment: argThat(isNotNull, named: 'environment'))) .thenReturn(new ProcessResult(1, 0, '26.1.1\n', '')); expect(sdk.sdkManagerVersion, '26.1.1'); }, overrides: { @@ -89,7 +89,7 @@ void main() { final AndroidSdk sdk = AndroidSdk.locateAndroidSdk(); when(processManager.canRun(sdk.sdkManagerPath)).thenReturn(true); when(processManager.runSync([sdk.sdkManagerPath, '--version'], - environment: typedArgThat(isNotNull, named: 'environment'))) + environment: argThat(isNotNull, named: 'environment'))) .thenReturn(new ProcessResult(1, 1, '26.1.1\n', 'Mystery error')); expect(sdk.sdkManagerVersion, isNull); }, overrides: { diff --git a/packages/flutter_tools/test/ios/cocoapods_test.dart b/packages/flutter_tools/test/ios/cocoapods_test.dart index 14f6907118..3bb165bf6e 100644 --- a/packages/flutter_tools/test/ios/cocoapods_test.dart +++ b/packages/flutter_tools/test/ios/cocoapods_test.dart @@ -142,7 +142,7 @@ void main() { testUsingContext('creates swift Podfile if swift', () { when(mockXcodeProjectInterpreter.isInstalled).thenReturn(true); - when(mockXcodeProjectInterpreter.getBuildSettings(typed(any), typed(any))).thenReturn({ + when(mockXcodeProjectInterpreter.getBuildSettings(any, any)).thenReturn({ 'SWIFT_VERSION': '4.0', }); @@ -204,7 +204,7 @@ void main() { iosEngineDir: 'engine/path', ); verifyNever(mockProcessManager.run( - typedArgThat(containsAllInOrder(['pod', 'install'])), + argThat(containsAllInOrder(['pod', 'install'])), workingDirectory: anyNamed('workingDirectory'), environment: anyNamed('environment'), )); @@ -226,7 +226,7 @@ void main() { } catch(e) { expect(e, const isInstanceOf()); verifyNever(mockProcessManager.run( - typedArgThat(containsAllInOrder(['pod', 'install'])), + argThat(containsAllInOrder(['pod', 'install'])), workingDirectory: anyNamed('workingDirectory'), environment: anyNamed('environment'), )); @@ -437,7 +437,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ); expect(didInstall, isFalse); verifyNever(mockProcessManager.run( - typedArgThat(containsAllInOrder(['pod', 'install'])), + argThat(containsAllInOrder(['pod', 'install'])), workingDirectory: anyNamed('workingDirectory'), environment: anyNamed('environment'), )); diff --git a/packages/flutter_tools/test/ios/code_signing_test.dart b/packages/flutter_tools/test/ios/code_signing_test.dart index 538450acfc..9d12db225a 100644 --- a/packages/flutter_tools/test/ios/code_signing_test.dart +++ b/packages/flutter_tools/test/ios/code_signing_test.dart @@ -72,7 +72,7 @@ void main() { when(mockProcessManager.runSync(['which', 'openssl'])) .thenReturn(exitsHappy); when(mockProcessManager.runSync( - typedArgThat(contains('find-identity')), + argThat(contains('find-identity')), environment: anyNamed('environment'), workingDirectory: anyNamed('workingDirectory'), )).thenReturn(exitsHappy); @@ -97,7 +97,7 @@ void main() { when(mockProcessManager.runSync(['which', 'openssl'])) .thenReturn(exitsHappy); when(mockProcessManager.runSync( - typedArgThat(contains('find-identity')), + argThat(contains('find-identity')), environment: anyNamed('environment'), workingDirectory: anyNamed('workingDirectory'), )).thenReturn(new ProcessResult( @@ -124,7 +124,7 @@ void main() { final MockStream mockStdErr = new MockStream(); when(mockProcessManager.start( - typedArgThat(contains('openssl')), + argThat(contains('openssl')), environment: anyNamed('environment'), workingDirectory: anyNamed('workingDirectory'), )).thenAnswer((Invocation invocation) => new Future.value(mockProcess)); @@ -156,7 +156,7 @@ void main() { when(mockProcessManager.runSync(['which', 'openssl'])) .thenReturn(exitsHappy); when(mockProcessManager.runSync( - typedArgThat(contains('find-identity')), + argThat(contains('find-identity')), environment: anyNamed('environment'), workingDirectory: anyNamed('workingDirectory'), )).thenReturn(new ProcessResult( @@ -183,7 +183,7 @@ void main() { final MockStream mockStdErr = new MockStream(); when(mockProcessManager.start( - typedArgThat(contains('openssl')), + argThat(contains('openssl')), environment: anyNamed('environment'), workingDirectory: anyNamed('workingDirectory'), )).thenAnswer((Invocation invocation) => new Future.value(mockProcess)); @@ -219,7 +219,7 @@ void main() { when(mockProcessManager.runSync(['which', 'openssl'])) .thenReturn(exitsHappy); when(mockProcessManager.runSync( - typedArgThat(contains('find-identity')), + argThat(contains('find-identity')), environment: anyNamed('environment'), workingDirectory: anyNamed('workingDirectory'), )).thenReturn(new ProcessResult( @@ -250,7 +250,7 @@ void main() { final MockStream mockOpenSslStdErr = new MockStream(); when(mockProcessManager.start( - typedArgThat(contains('openssl')), + argThat(contains('openssl')), environment: anyNamed('environment'), workingDirectory: anyNamed('workingDirectory'), )).thenAnswer((Invocation invocation) => new Future.value(mockOpenSslProcess)); @@ -293,7 +293,7 @@ void main() { when(mockProcessManager.runSync(['which', 'openssl'])) .thenReturn(exitsHappy); when(mockProcessManager.runSync( - typedArgThat(contains('find-identity')), + argThat(contains('find-identity')), environment: anyNamed('environment'), workingDirectory: anyNamed('workingDirectory'), )).thenReturn(new ProcessResult( @@ -324,7 +324,7 @@ void main() { final MockStream mockOpenSslStdErr = new MockStream(); when(mockProcessManager.start( - typedArgThat(contains('openssl')), + argThat(contains('openssl')), environment: anyNamed('environment'), workingDirectory: anyNamed('workingDirectory'), )).thenAnswer((Invocation invocation) => new Future.value(mockOpenSslProcess)); @@ -361,7 +361,7 @@ void main() { when(mockProcessManager.runSync(['which', 'openssl'])) .thenReturn(exitsHappy); when(mockProcessManager.runSync( - typedArgThat(contains('find-identity')), + argThat(contains('find-identity')), environment: anyNamed('environment'), workingDirectory: anyNamed('workingDirectory'), )).thenReturn(new ProcessResult( @@ -390,7 +390,7 @@ void main() { final MockStream mockOpenSslStdErr = new MockStream(); when(mockProcessManager.start( - typedArgThat(contains('openssl')), + argThat(contains('openssl')), environment: anyNamed('environment'), workingDirectory: anyNamed('workingDirectory'), )).thenAnswer((Invocation invocation) => new Future.value(mockOpenSslProcess)); @@ -431,7 +431,7 @@ void main() { when(mockProcessManager.runSync(['which', 'openssl'])) .thenReturn(exitsHappy); when(mockProcessManager.runSync( - typedArgThat(contains('find-identity')), + argThat(contains('find-identity')), environment: anyNamed('environment'), workingDirectory: anyNamed('workingDirectory'), )).thenReturn(new ProcessResult( @@ -463,7 +463,7 @@ void main() { final MockStream mockOpenSslStdErr = new MockStream(); when(mockProcessManager.start( - typedArgThat(contains('openssl')), + argThat(contains('openssl')), environment: anyNamed('environment'), workingDirectory: anyNamed('workingDirectory'), )).thenAnswer((Invocation invocation) => new Future.value(mockOpenSslProcess)); diff --git a/packages/flutter_tools/test/ios/mac_test.dart b/packages/flutter_tools/test/ios/mac_test.dart index 4bc6028128..3772ab2a5d 100644 --- a/packages/flutter_tools/test/ios/mac_test.dart +++ b/packages/flutter_tools/test/ios/mac_test.dart @@ -82,7 +82,7 @@ void main() { testUsingContext('idevicescreenshot captures and returns screenshot', () async { 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.value(new ProcessResult(4, 0, '', ''))); await iMobileDevice.takeScreenshot(mockOutputFile); diff --git a/packages/flutter_tools/test/ios/simulators_test.dart b/packages/flutter_tools/test/ios/simulators_test.dart index 6d4bc97091..03fc5304e0 100644 --- a/packages/flutter_tools/test/ios/simulators_test.dart +++ b/packages/flutter_tools/test/ios/simulators_test.dart @@ -175,7 +175,7 @@ void main() { mockProcessManager = new MockProcessManager(); // Let everything else return exit code 0 so process.dart doesn't crash. when( - mockProcessManager.run(typed(any), environment: null, workingDirectory: null) + mockProcessManager.run(any, environment: null, workingDirectory: null) ).thenAnswer((Invocation invocation) => new Future.value(new ProcessResult(2, 0, '', '')) ); @@ -229,7 +229,7 @@ void main() { setUp(() { 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.value(new MockProcess())); }); @@ -237,7 +237,7 @@ void main() { final IOSSimulator device = new IOSSimulator('x', name: 'iPhone SE', category: 'iOS 9.3'); await launchDeviceLogTool(device); expect( - verify(mockProcessManager.start(typed(captureAny), environment: null, workingDirectory: null)).captured.single, + verify(mockProcessManager.start(captureAny, environment: null, workingDirectory: null)).captured.single, contains('tail'), ); }, @@ -249,7 +249,7 @@ void main() { final IOSSimulator device = new IOSSimulator('x', name: 'iPhone SE', category: 'iOS 11.0'); await launchDeviceLogTool(device); 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'), ); }, @@ -271,7 +271,7 @@ void main() { final IOSSimulator device = new IOSSimulator('x', name: 'iPhone SE', category: 'iOS 9.3'); await launchSystemLogTool(device); expect( - verify(mockProcessManager.start(typed(captureAny), environment: null, workingDirectory: null)).captured.single, + verify(mockProcessManager.start(captureAny, environment: null, workingDirectory: null)).captured.single, contains('tail'), ); }, diff --git a/packages/flutter_tools/test/ios/xcodeproj_test.dart b/packages/flutter_tools/test/ios/xcodeproj_test.dart index 31b1bccd43..621e9922c6 100644 --- a/packages/flutter_tools/test/ios/xcodeproj_test.dart +++ b/packages/flutter_tools/test/ios/xcodeproj_test.dart @@ -282,7 +282,7 @@ Information about project "Runner": } 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')); const BuildInfo buildInfo = const BuildInfo(BuildMode.debug, null, previewDart2: true, @@ -302,7 +302,7 @@ Information about project "Runner": }); 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')); const BuildInfo buildInfo = const BuildInfo(BuildMode.debug, null, previewDart2: true, @@ -323,7 +323,7 @@ Information about project "Runner": }); 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')); const BuildInfo buildInfo = const BuildInfo(BuildMode.debug, null, previewDart2: true, @@ -343,7 +343,7 @@ Information about project "Runner": }); 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')); const BuildInfo buildInfo = const BuildInfo(BuildMode.debug, null, previewDart2: true, diff --git a/packages/flutter_tools/test/runner/flutter_command_test.dart b/packages/flutter_tools/test/runner/flutter_command_test.dart index 6aa663eed7..ed66ea1256 100644 --- a/packages/flutter_tools/test/runner/flutter_command_test.dart +++ b/packages/flutter_tools/test/runner/flutter_command_test.dart @@ -61,7 +61,7 @@ void main() { expect( verify(usage.sendTiming( - typed(captureAny), typed(captureAny), typed(captureAny), + captureAny, captureAny, captureAny, label: captureAnyNamed('label'))).captured, ['flutter', 'dummy', const Duration(milliseconds: 1000), null] ); @@ -80,8 +80,8 @@ void main() { await flutterCommand.run(); verify(clock.now()).called(2); verifyNever(usage.sendTiming( - typed(captureAny), typed(captureAny), typed(captureAny), - label: captureAnyNamed('label'))); + any, any, any, + label: anyNamed('label'))); }, overrides: { Clock: () => clock, @@ -106,7 +106,7 @@ void main() { verify(clock.now()).called(2); expect( verify(usage.sendTiming( - typed(captureAny), typed(captureAny), typed(captureAny), + captureAny, captureAny, captureAny, label: captureAnyNamed('label'))).captured, [ 'flutter', @@ -137,7 +137,7 @@ void main() { expect( verify(usage.sendTiming( - typed(captureAny), typed(captureAny), typed(captureAny), + captureAny, captureAny, captureAny, label: captureAnyNamed('label'))).captured, [ 'flutter', diff --git a/packages/fuchsia_remote_debug_protocol/pubspec.yaml b/packages/fuchsia_remote_debug_protocol/pubspec.yaml index 15924bbf44..b71578298d 100644 --- a/packages/fuchsia_remote_debug_protocol/pubspec.yaml +++ b/packages/fuchsia_remote_debug_protocol/pubspec.yaml @@ -65,7 +65,7 @@ dependencies: yaml: 2.1.14 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" dev_dependencies: - mockito: 3.0.0-alpha+5 + mockito: 3.0.0-beta test: 0.12.41 -# PUBSPEC CHECKSUM: 6256 +# PUBSPEC CHECKSUM: 4e8b 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 b729add939..e8294b76a2 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 @@ -20,7 +20,7 @@ void main() { setUp(() { mockRunner = new MockSshCommandRunner(); // 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>.value( ['123\n\n\n', '456 ', '789'])); const String address = 'fe80::8eae:4cff:fef4:9247'; @@ -90,7 +90,7 @@ void main() { final MockPeer mp = new MockPeer(); mockPeerConnections.add(mp); uriConnections.add(uri); - when(mp.sendRequest(typed(any), typed(any))) + when(mp.sendRequest(any, any)) // The local ports match the desired indices for now, so get the // canned response from the URI port. .thenAnswer((_) => new Future>( diff --git a/packages/fuchsia_remote_debug_protocol/test/src/dart/dart_vm_test.dart b/packages/fuchsia_remote_debug_protocol/test/src/dart/dart_vm_test.dart index 874886aef4..62c7f9fd66 100644 --- a/packages/fuchsia_remote_debug_protocol/test/src/dart/dart_vm_test.dart +++ b/packages/fuchsia_remote_debug_protocol/test/src/dart/dart_vm_test.dart @@ -84,8 +84,7 @@ void main() { }; Future mockVmConnectionFunction(Uri uri) { - when(mockPeer.sendRequest( - typed(any), typed>(any))) + when(mockPeer.sendRequest(any, any)) .thenAnswer((_) => new Future>( () => flutterViewCannedResponses)); return new Future(() => mockPeer); @@ -133,8 +132,7 @@ void main() { }; Future mockVmConnectionFunction(Uri uri) { - when(mockPeer.sendRequest( - typed(any), typed>(any))) + when(mockPeer.sendRequest(any, any)) .thenAnswer((_) => new Future>( () => flutterViewCannedResponseMissingId)); return new Future(() => mockPeer); @@ -171,8 +169,7 @@ void main() { }; Future mockVmConnectionFunction(Uri uri) { - when(mockPeer.sendRequest( - typed(any), typed>(any))) + when(mockPeer.sendRequest(any, any)) .thenAnswer((_) => new Future>( () => flutterViewCannedResponseMissingIsolateName)); return new Future(() => mockPeer); @@ -206,8 +203,7 @@ void main() { const Duration timeoutTime = const Duration(milliseconds: 100); Future mockVmConnectionFunction(Uri uri) { // Return a command that will never complete. - when(mockPeer.sendRequest( - typed(any), typed>(any))) + when(mockPeer.sendRequest(any, any)) .thenAnswer((_) => new Completer>().future); return new Future(() => mockPeer); } 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 cdbf25181e..2762515441 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,7 @@ void main() { setUp(() { mockProcessManager = new MockProcessManager(); mockProcessResult = new MockProcessResult(); - when(mockProcessManager.run(typed(any))).thenAnswer( + when(mockProcessManager.run(any)).thenAnswer( (_) => new Future.value(mockProcessResult)); }); @@ -57,7 +57,7 @@ void main() { when(mockProcessResult.exitCode).thenReturn(0); await runner.run('ls /whatever'); final List passedCommand = - verify(mockProcessManager.run(typed(captureAny))).captured.single; + verify(mockProcessManager.run(captureAny)).captured.single; expect(passedCommand, contains('$ipV6Addr%$interface')); }); @@ -72,7 +72,7 @@ void main() { when(mockProcessResult.exitCode).thenReturn(0); await runner.run('ls /whatever'); final List passedCommand = - verify(mockProcessManager.run(typed(captureAny))).captured.single; + verify(mockProcessManager.run(captureAny)).captured.single; expect(passedCommand, contains(ipV6Addr)); }); @@ -114,7 +114,7 @@ void main() { when(mockProcessResult.exitCode).thenReturn(0); await runner.run('ls /whatever'); final List passedCommand = - verify(mockProcessManager.run(typed(captureAny))).captured.single; + verify(mockProcessManager.run(captureAny)).captured.single; expect(passedCommand, contains('-F')); final int indexOfFlag = passedCommand.indexOf('-F'); final String passedConfig = passedCommand[indexOfFlag + 1]; @@ -131,7 +131,7 @@ void main() { when(mockProcessResult.exitCode).thenReturn(0); await runner.run('ls /whatever'); final List passedCommand = - verify(mockProcessManager.run(typed(captureAny))).captured.single; + verify(mockProcessManager.run(captureAny)).captured.single; final int indexOfFlag = passedCommand.indexOf('-F'); expect(indexOfFlag, equals(-1)); });