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

Unified Diff: media/filters/decrypting_audio_decoder_unittest.cc

Issue 11342031: Add DecryptingDemuxerStream. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: needs to add RegisterKeyAddedCB() Created 8 years, 2 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 a77438a810be5e47b121bae8a27859cf828bd78a..9f4e4016a12e4beb6482bfe64dc168979073ca2d 100644
--- a/media/filters/decrypting_audio_decoder_unittest.cc
+++ b/media/filters/decrypting_audio_decoder_unittest.cc
@@ -20,7 +20,6 @@
using ::testing::_;
using ::testing::AtMost;
-using ::testing::Invoke;
using ::testing::IsNull;
using ::testing::ReturnRef;
using ::testing::SaveArg;
@@ -87,7 +86,7 @@ MATCHER(IsEndOfStream, "") {
class DecryptingAudioDecoderTest : public testing::Test {
public:
DecryptingAudioDecoderTest()
- : decoder_(new StrictMock<DecryptingAudioDecoder>(
+ : decoder_(new DecryptingAudioDecoder(
ddorwin 2012/11/13 01:08:49 Just curious, why did you drop StrictMock?
xhwang 2012/11/13 21:10:21 DecryptingAudioDecoder is a concrete class, not a
base::Bind(&Identity<scoped_refptr<base::MessageLoopProxy> >,
message_loop_.message_loop_proxy()),
base::Bind(
@@ -99,7 +98,6 @@ class DecryptingAudioDecoderTest : public testing::Test {
decoded_frame_(NULL),
end_of_stream_frame_(new DataBuffer(0)),
decoded_frame_list_() {
- // TODO(xhwang): Fix this after DataBuffer(data, size) is public.
scoped_refptr<DataBuffer> buffer = new DataBuffer(kFakeAudioFrameSize);
buffer->SetDataSize(kFakeAudioFrameSize);
ddorwin 2012/11/13 01:08:49 // Frame contains random data.
xhwang 2012/11/13 21:10:21 Done.
decoded_frame_ = buffer;
ddorwin 2012/11/13 01:08:49 Do we even need the local variable |buffer|?
xhwang 2012/11/13 21:10:21 We can only call SetDataSize() on a DataBuffer, no
@@ -124,10 +122,10 @@ class DecryptingAudioDecoderTest : public testing::Test {
EXPECT_CALL(*this, RequestDecryptorNotification(_))
.WillOnce(RunCallback0(decryptor_.get()));
- config_.Initialize(kCodecVorbis, 16, CHANNEL_LAYOUT_STEREO, 44100,
- NULL, 0, true, true);
+ AudioDecoderConfig config(kCodecVorbis, 16, CHANNEL_LAYOUT_STEREO, 44100,
+ NULL, 0, true);
+ InitializeAndExpectStatus(config, PIPELINE_OK);
- InitializeAndExpectStatus(config_, PIPELINE_OK);
EXPECT_EQ(16, decoder_->bits_per_channel());
EXPECT_EQ(CHANNEL_LAYOUT_STEREO, decoder_->channel_layout());
EXPECT_EQ(44100, decoder_->samples_per_second());
@@ -204,7 +202,7 @@ class DecryptingAudioDecoderTest : public testing::Test {
void EnterWaitingForKeyState() {
EXPECT_CALL(*demuxer_, Read(_))
.WillRepeatedly(ReturnBuffer(encrypted_buffer_));
- EXPECT_CALL(*decryptor_, DecryptAndDecodeAudio(_, _))
+ EXPECT_CALL(*decryptor_, DecryptAndDecodeAudio(encrypted_buffer_, _))
.WillRepeatedly(RunCallback2(Decryptor::kNoKey,
Decryptor::AudioBuffers()));
decoder_->Read(base::Bind(&DecryptingAudioDecoderTest::FrameReady,
@@ -235,11 +233,10 @@ class DecryptingAudioDecoderTest : public testing::Test {
const scoped_refptr<Buffer>&));
MessageLoop message_loop_;
- scoped_refptr<StrictMock<DecryptingAudioDecoder> > decoder_;
+ scoped_refptr<DecryptingAudioDecoder> decoder_;
scoped_ptr<StrictMock<MockDecryptor> > decryptor_;
scoped_refptr<StrictMock<MockDemuxerStream> > demuxer_;
MockStatisticsCB statistics_cb_;
- AudioDecoderConfig config_;
DemuxerStream::ReadCB pending_demuxer_read_cb_;
Decryptor::DecoderInitCB pending_init_cb_;

Powered by Google App Engine
This is Rietveld 408576698