Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Unified Diff: webrtc/modules/audio_coding/main/acm2/codec_owner_unittest.cc

Issue 1331793003: MockAudioEncoder: Use a dedicated marker method for test expectations (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/audio_coding/codecs/mock/mock_audio_encoder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_coding/main/acm2/codec_owner_unittest.cc
diff --git a/webrtc/modules/audio_coding/main/acm2/codec_owner_unittest.cc b/webrtc/modules/audio_coding/main/acm2/codec_owner_unittest.cc
index 0c510c07706fb9987de6132eeabce22089cd9760..ec1bb0df2be12bb488232789eef10db2a8b031df 100644
--- a/webrtc/modules/audio_coding/main/acm2/codec_owner_unittest.cc
+++ b/webrtc/modules/audio_coding/main/acm2/codec_owner_unittest.cc
@@ -115,19 +115,19 @@ TEST_F(CodecOwnerTest, ExternalEncoder) {
EXPECT_CALL(external_encoder,
EncodeInternal(0, audio, arraysize(encoded), encoded))
.WillOnce(Return(info));
- EXPECT_CALL(external_encoder, Reset());
- EXPECT_CALL(external_encoder, Reset());
+ EXPECT_CALL(external_encoder, Mark("A"));
+ EXPECT_CALL(external_encoder, Mark("B"));
info.encoded_timestamp = 2;
EXPECT_CALL(external_encoder,
EncodeInternal(2, audio, arraysize(encoded), encoded))
.WillOnce(Return(info));
- EXPECT_CALL(external_encoder, Reset());
+ EXPECT_CALL(external_encoder, Die());
}
info = codec_owner_.Encoder()->Encode(0, audio, arraysize(audio),
arraysize(encoded), encoded);
EXPECT_EQ(0u, info.encoded_timestamp);
- external_encoder.Reset(); // Dummy call to mark the sequence of expectations.
+ external_encoder.Mark("A");
// Change to internal encoder.
CodecInst codec_inst = kDefaultCodecInst;
@@ -136,14 +136,13 @@ TEST_F(CodecOwnerTest, ExternalEncoder) {
// Don't expect any more calls to the external encoder.
info = codec_owner_.Encoder()->Encode(1, audio, arraysize(audio),
arraysize(encoded), encoded);
- external_encoder.Reset(); // Dummy call to mark the sequence of expectations.
+ external_encoder.Mark("B");
// Change back to external encoder again.
codec_owner_.SetEncoders(&external_encoder, -1, VADNormal, -1);
info = codec_owner_.Encoder()->Encode(2, audio, arraysize(audio),
arraysize(encoded), encoded);
EXPECT_EQ(2u, info.encoded_timestamp);
- external_encoder.Reset(); // Dummy call to mark the sequence of expectations.
}
} // namespace acm2
« no previous file with comments | « webrtc/modules/audio_coding/codecs/mock/mock_audio_encoder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698