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
This commit is contained in:
parent
bec912165a
commit
9f8a70be4c
@ -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
|
||||
|
@ -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
|
||||
|
@ -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')),
|
||||
);
|
||||
|
@ -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
|
||||
|
@ -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<HttpClientRequest>.value(request));
|
||||
when(client.getUrl(any)).thenAnswer((_) => new Future<HttpClientRequest>.value(request));
|
||||
when(request.headers).thenReturn(headers);
|
||||
when(request.close()).thenAnswer((_) => new Future<HttpClientResponse>.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<int>) 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 {}
|
||||
class MockHttpHeaders extends Mock implements HttpHeaders {}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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(<void>[
|
||||
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(<void>[
|
||||
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(<void>[
|
||||
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.
|
||||
|
@ -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')
|
||||
|
@ -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 {
|
||||
|
@ -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();
|
||||
});
|
||||
|
@ -27,12 +27,12 @@ void main() {
|
||||
verify(headers.add('flutter', 'flutter')).called(1);
|
||||
|
||||
}, 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.close()).thenAnswer((_) => new Future<HttpClientResponse>.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<int>) 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 {}
|
||||
class MockHttpHeaders extends Mock implements HttpHeaders {}
|
||||
|
@ -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
|
||||
|
@ -40,7 +40,7 @@ void main() {
|
||||
when(mockClient.getVM()).thenAnswer((_) => new Future<MockVM>.value(mockVM));
|
||||
when(mockVM.isolates).thenReturn(<VMRunnableIsolate>[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'}));
|
||||
vmServiceConnectFunction = (String url) {
|
||||
return new Future<VMServiceClientConnection>.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(<String, dynamic>{'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], <String, String>{
|
||||
'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], <String, dynamic>{
|
||||
'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], <String, dynamic>{
|
||||
'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], <String, dynamic>{
|
||||
'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], <String, dynamic>{
|
||||
'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<Map<String, dynamic>>().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(<String, dynamic>{
|
||||
'message': 'This is a failure'
|
||||
}, isError: true);
|
||||
|
@ -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
|
||||
|
@ -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<io.ProcessResult>.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, <String>['git', 'rev-parse', 'HEAD']);
|
||||
expect(verifyProcessRun.captured.last, _kRepositoryRoot);
|
||||
|
@ -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
|
||||
|
@ -27,7 +27,7 @@ import '../runner/flutter_command.dart';
|
||||
/// ```
|
||||
const Map<String, String> _kManuallyPinnedDependencies = const <String, String>{
|
||||
// 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
|
||||
};
|
||||
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
<dynamic>['flutter', 'doctor', const Duration(milliseconds: 1000), 'success']
|
||||
);
|
||||
}, overrides: <Type, Generator>{
|
||||
@ -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,
|
||||
<dynamic>['flutter', 'doctor', const Duration(milliseconds: 1000), 'warning']
|
||||
);
|
||||
}, overrides: <Type, Generator>{
|
||||
|
@ -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()
|
||||
|
@ -74,7 +74,7 @@ void main() {
|
||||
final AndroidSdk sdk = AndroidSdk.locateAndroidSdk();
|
||||
when(processManager.canRun(sdk.sdkManagerPath)).thenReturn(true);
|
||||
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', ''));
|
||||
expect(sdk.sdkManagerVersion, '26.1.1');
|
||||
}, overrides: <Type, Generator>{
|
||||
@ -89,7 +89,7 @@ void main() {
|
||||
final AndroidSdk sdk = AndroidSdk.locateAndroidSdk();
|
||||
when(processManager.canRun(sdk.sdkManagerPath)).thenReturn(true);
|
||||
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'));
|
||||
expect(sdk.sdkManagerVersion, isNull);
|
||||
}, overrides: <Type, Generator>{
|
||||
|
@ -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(<String, String>{
|
||||
when(mockXcodeProjectInterpreter.getBuildSettings(any, any)).thenReturn(<String, String>{
|
||||
'SWIFT_VERSION': '4.0',
|
||||
});
|
||||
|
||||
@ -204,7 +204,7 @@ void main() {
|
||||
iosEngineDir: 'engine/path',
|
||||
);
|
||||
verifyNever(mockProcessManager.run(
|
||||
typedArgThat(containsAllInOrder(<String>['pod', 'install'])),
|
||||
argThat(containsAllInOrder(<String>['pod', 'install'])),
|
||||
workingDirectory: anyNamed('workingDirectory'),
|
||||
environment: anyNamed('environment'),
|
||||
));
|
||||
@ -226,7 +226,7 @@ void main() {
|
||||
} catch(e) {
|
||||
expect(e, const isInstanceOf<ToolExit>());
|
||||
verifyNever(mockProcessManager.run(
|
||||
typedArgThat(containsAllInOrder(<String>['pod', 'install'])),
|
||||
argThat(containsAllInOrder(<String>['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(<String>['pod', 'install'])),
|
||||
argThat(containsAllInOrder(<String>['pod', 'install'])),
|
||||
workingDirectory: anyNamed('workingDirectory'),
|
||||
environment: anyNamed('environment'),
|
||||
));
|
||||
|
@ -72,7 +72,7 @@ void main() {
|
||||
when(mockProcessManager.runSync(<String>['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(<String>['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<Process>.value(mockProcess));
|
||||
@ -156,7 +156,7 @@ void main() {
|
||||
when(mockProcessManager.runSync(<String>['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<Process>.value(mockProcess));
|
||||
@ -219,7 +219,7 @@ void main() {
|
||||
when(mockProcessManager.runSync(<String>['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<Process>.value(mockOpenSslProcess));
|
||||
@ -293,7 +293,7 @@ void main() {
|
||||
when(mockProcessManager.runSync(<String>['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<Process>.value(mockOpenSslProcess));
|
||||
@ -361,7 +361,7 @@ void main() {
|
||||
when(mockProcessManager.runSync(<String>['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<Process>.value(mockOpenSslProcess));
|
||||
@ -431,7 +431,7 @@ void main() {
|
||||
when(mockProcessManager.runSync(<String>['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<Process>.value(mockOpenSslProcess));
|
||||
|
@ -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<ProcessResult>.value(new ProcessResult(4, 0, '', '')));
|
||||
|
||||
await iMobileDevice.takeScreenshot(mockOutputFile);
|
||||
|
@ -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<ProcessResult>.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<Process>.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'),
|
||||
);
|
||||
},
|
||||
|
@ -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,
|
||||
|
@ -61,7 +61,7 @@ void main() {
|
||||
|
||||
expect(
|
||||
verify(usage.sendTiming(
|
||||
typed(captureAny), typed(captureAny), typed(captureAny),
|
||||
captureAny, captureAny, captureAny,
|
||||
label: captureAnyNamed('label'))).captured,
|
||||
<dynamic>['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: <Type, Generator>{
|
||||
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,
|
||||
<dynamic>[
|
||||
'flutter',
|
||||
@ -137,7 +137,7 @@ void main() {
|
||||
|
||||
expect(
|
||||
verify(usage.sendTiming(
|
||||
typed(captureAny), typed(captureAny), typed(captureAny),
|
||||
captureAny, captureAny, captureAny,
|
||||
label: captureAnyNamed('label'))).captured,
|
||||
<dynamic>[
|
||||
'flutter',
|
||||
|
@ -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
|
||||
|
@ -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<List<String>>.value(
|
||||
<String>['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<String>(any), typed<String>(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<Map<String, dynamic>>(
|
||||
|
@ -84,8 +84,7 @@ void main() {
|
||||
};
|
||||
|
||||
Future<json_rpc.Peer> mockVmConnectionFunction(Uri uri) {
|
||||
when(mockPeer.sendRequest(
|
||||
typed<String>(any), typed<Map<String, dynamic>>(any)))
|
||||
when(mockPeer.sendRequest(any, any))
|
||||
.thenAnswer((_) => new Future<Map<String, dynamic>>(
|
||||
() => flutterViewCannedResponses));
|
||||
return new Future<json_rpc.Peer>(() => mockPeer);
|
||||
@ -133,8 +132,7 @@ void main() {
|
||||
};
|
||||
|
||||
Future<json_rpc.Peer> mockVmConnectionFunction(Uri uri) {
|
||||
when(mockPeer.sendRequest(
|
||||
typed<String>(any), typed<Map<String, dynamic>>(any)))
|
||||
when(mockPeer.sendRequest(any, any))
|
||||
.thenAnswer((_) => new Future<Map<String, dynamic>>(
|
||||
() => flutterViewCannedResponseMissingId));
|
||||
return new Future<json_rpc.Peer>(() => mockPeer);
|
||||
@ -171,8 +169,7 @@ void main() {
|
||||
};
|
||||
|
||||
Future<json_rpc.Peer> mockVmConnectionFunction(Uri uri) {
|
||||
when(mockPeer.sendRequest(
|
||||
typed<String>(any), typed<Map<String, dynamic>>(any)))
|
||||
when(mockPeer.sendRequest(any, any))
|
||||
.thenAnswer((_) => new Future<Map<String, dynamic>>(
|
||||
() => flutterViewCannedResponseMissingIsolateName));
|
||||
return new Future<json_rpc.Peer>(() => mockPeer);
|
||||
@ -206,8 +203,7 @@ void main() {
|
||||
const Duration timeoutTime = const Duration(milliseconds: 100);
|
||||
Future<json_rpc.Peer> mockVmConnectionFunction(Uri uri) {
|
||||
// Return a command that will never complete.
|
||||
when(mockPeer.sendRequest(
|
||||
typed<String>(any), typed<Map<String, dynamic>>(any)))
|
||||
when(mockPeer.sendRequest(any, any))
|
||||
.thenAnswer((_) => new Completer<Map<String, dynamic>>().future);
|
||||
return new Future<json_rpc.Peer>(() => mockPeer);
|
||||
}
|
||||
|
@ -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<MockProcessResult>.value(mockProcessResult));
|
||||
});
|
||||
|
||||
@ -57,7 +57,7 @@ void main() {
|
||||
when(mockProcessResult.exitCode).thenReturn(0);
|
||||
await runner.run('ls /whatever');
|
||||
final List<String> 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<String> 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<String> 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<String> passedCommand =
|
||||
verify(mockProcessManager.run(typed(captureAny))).captured.single;
|
||||
verify(mockProcessManager.run(captureAny)).captured.single;
|
||||
final int indexOfFlag = passedCommand.indexOf('-F');
|
||||
expect(indexOfFlag, equals(-1));
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user