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

Unified Diff: media/filters/decrypting_audio_decoder_unittest.cc

Issue 339653003: No EOS frame in {Audio|Video}Decoder::OutputCB. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
Index: media/filters/decrypting_audio_decoder_unittest.cc
diff --git a/media/filters/decrypting_audio_decoder_unittest.cc b/media/filters/decrypting_audio_decoder_unittest.cc
index 66aca66042bc6ff8a9d71d05f2bd52a46f902245..2c93f6df62533e5100204f9f92c07277614a7f83 100644
--- a/media/filters/decrypting_audio_decoder_unittest.cc
+++ b/media/filters/decrypting_audio_decoder_unittest.cc
@@ -60,10 +60,6 @@ ACTION_P(RunCallbackIfNotNull, param) {
arg0.Run(param);
}
-MATCHER(IsEndOfStream, "end of stream") {
- return (arg->end_of_stream());
-}
-
} // namespace
class DecryptingAudioDecoderTest : public testing::Test {
@@ -77,7 +73,6 @@ class DecryptingAudioDecoderTest : public testing::Test {
decryptor_(new StrictMock<MockDecryptor>()),
encrypted_buffer_(CreateFakeEncryptedBuffer()),
decoded_frame_(NULL),
- end_of_stream_frame_(AudioBuffer::CreateEOSBuffer()),
decoded_frame_list_() {}
virtual ~DecryptingAudioDecoderTest() {
@@ -143,11 +138,7 @@ class DecryptingAudioDecoderTest : public testing::Test {
const Decryptor::AudioBuffers& audio_frames) {
for (Decryptor::AudioBuffers::const_iterator it = audio_frames.begin();
it != audio_frames.end(); ++it) {
- if ((*it)->end_of_stream()) {
- EXPECT_CALL(*this, FrameReady(IsEndOfStream()));
- } else {
- EXPECT_CALL(*this, FrameReady(*it));
- }
+ EXPECT_CALL(*this, FrameReady(*it));
}
EXPECT_CALL(*this, DecodeDone(status));
@@ -160,24 +151,23 @@ class DecryptingAudioDecoderTest : public testing::Test {
// Sets up expectations and actions to put DecryptingAudioDecoder in an
// active normal decoding state.
void EnterNormalDecodingState() {
- Decryptor::AudioBuffers end_of_stream_frames_(1, end_of_stream_frame_);
-
EXPECT_CALL(*decryptor_, DecryptAndDecodeAudio(_, _))
.WillOnce(RunCallback<1>(Decryptor::kSuccess, decoded_frame_list_))
.WillRepeatedly(RunCallback<1>(Decryptor::kNeedMoreData,
Decryptor::AudioBuffers()));
- DecodeAndExpectFrameReadyWith(encrypted_buffer_, AudioDecoder::kOk,
- Decryptor::AudioBuffers(1, decoded_frame_));
+ DecodeAndExpectFrameReadyWith(encrypted_buffer_,
+ AudioDecoder::kOk,
+ Decryptor::AudioBuffers(1, decoded_frame_));
}
// Sets up expectations and actions to put DecryptingAudioDecoder in an end
// of stream state. This function must be called after
// EnterNormalDecodingState() to work.
void EnterEndOfStreamState() {
- DecodeAndExpectFrameReadyWith(
- DecoderBuffer::CreateEOSBuffer(), AudioDecoder::kOk,
- Decryptor::AudioBuffers(1, end_of_stream_frame_));
+ DecodeAndExpectFrameReadyWith(DecoderBuffer::CreateEOSBuffer(),
+ AudioDecoder::kOk,
+ Decryptor::AudioBuffers());
}
// Make the audio decode callback pending by saving and not firing it.
@@ -257,7 +247,6 @@ class DecryptingAudioDecoderTest : public testing::Test {
// Constant buffer/frames, to be used/returned by |decoder_| and |decryptor_|.
scoped_refptr<DecoderBuffer> encrypted_buffer_;
scoped_refptr<AudioBuffer> decoded_frame_;
- scoped_refptr<AudioBuffer> end_of_stream_frame_;
Decryptor::AudioBuffers decoded_frame_list_;
private:

Powered by Google App Engine
This is Rietveld 408576698