Skip to content

Commit 0722fb3

Browse files
committed
Automated g4 rollback of changelist 367295097.
*** Reason for rollback *** Roll forward after fixes *** Original change description *** Automated g4 rollback of changelist 367238585. *** Reason for rollback *** Broke https://test.corp.google.com/ui#cl=365134781&flags=CAMQBQ==&id=OCL:365134781:BASE:367271161:1617822936639:6a37b0ed&t=//chrome/cloudcast/client/gamerx/audio/test:active_controller_audio_service_test_ddc_headless-chrome-linux *** Original change description *** Import #376 *** *** PiperOrigin-RevId: 367657308
1 parent bd5b883 commit 0722fb3

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

lib/src/mock.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,10 @@ _InOrderVerification get verifyInOrder {
997997
throw StateError(_verifyCalls.join());
998998
}
999999
_verificationInProgress = true;
1000-
return <T>(List<T> _) {
1000+
return <T>(List<T> responses) {
1001+
if (responses.length != _verifyCalls.length) {
1002+
fail('Used on a non-mockito object');
1003+
}
10011004
_verificationInProgress = false;
10021005
var verificationResults = <VerificationResult>[];
10031006
var time = DateTime.fromMillisecondsSinceEpoch(0);

test/verify_test.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,12 @@ void main() {
206206
'2 verify calls have been stored.')));
207207
}
208208
});
209+
210+
test('should fail when called with non-mock-call parameter', () {
211+
expectFail('Used on a non-mockito object', () {
212+
verifyInOrder(['a string is not a mock call']);
213+
});
214+
});
209215
});
210216

211217
group('verify should fail when no matching call is found', () {
@@ -457,6 +463,12 @@ void main() {
457463
});
458464
});
459465

466+
test('should fail when given non-mock-call parameters', () {
467+
expectFail('Used on a non-mockito object', () {
468+
verifyInOrder(['a string is not a mock call']);
469+
});
470+
});
471+
460472
test('verify been used as an argument fails', () {
461473
mock.methodWithoutArgs();
462474
mock.getter;

0 commit comments

Comments
 (0)