Fixes for test failures in Dart 2 mode (#18122)

This commit is contained in:
Keerti Parthasarathy
2018-06-05 12:38:30 -07:00
committed by GitHub
parent 12eeb94c89
commit da7670c2ee
13 changed files with 60 additions and 42 deletions

View File

@@ -60,7 +60,9 @@ void main() {
verify(clock.now()).called(2);
expect(
verify(usage.sendTiming(captureAny, captureAny, captureAny, label: captureAny)).captured,
verify(usage.sendTiming(
typed(captureAny), typed(captureAny), typed(captureAny),
label: captureAnyNamed('label'))).captured,
<dynamic>['flutter', 'dummy', const Duration(milliseconds: 1000), null]
);
},
@@ -77,7 +79,9 @@ void main() {
new DummyFlutterCommand(noUsagePath: true);
await flutterCommand.run();
verify(clock.now()).called(2);
verifyNever(usage.sendTiming(captureAny, captureAny, captureAny, label: captureAny));
verifyNever(usage.sendTiming(
typed(captureAny), typed(captureAny), typed(captureAny),
label: captureAnyNamed('label')));
},
overrides: <Type, Generator>{
Clock: () => clock,
@@ -101,7 +105,9 @@ void main() {
await flutterCommand.run();
verify(clock.now()).called(2);
expect(
verify(usage.sendTiming(captureAny, captureAny, captureAny, label: captureAny)).captured,
verify(usage.sendTiming(
typed(captureAny), typed(captureAny), typed(captureAny),
label: captureAnyNamed('label'))).captured,
<dynamic>[
'flutter',
'dummy',
@@ -130,8 +136,15 @@ void main() {
verify(clock.now()).called(2);
expect(
verify(usage.sendTiming(captureAny, captureAny, captureAny, label: captureAny)).captured,
<dynamic>['flutter', 'dummy', const Duration(milliseconds: 1000), 'fail']
verify(usage.sendTiming(
typed(captureAny), typed(captureAny), typed(captureAny),
label: captureAnyNamed('label'))).captured,
<dynamic>[
'flutter',
'dummy',
const Duration(milliseconds: 1000),
'fail'
]
);
}
},