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

Unified Diff: media/filters/opus_audio_decoder_unittest.cc

Issue 331863004: Revert 276344 "Add callback in VideoDecoder and AudioDecoder to ..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/2049/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
« no previous file with comments | « media/filters/opus_audio_decoder.cc ('k') | media/filters/video_decoder_selector_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/opus_audio_decoder_unittest.cc
===================================================================
--- media/filters/opus_audio_decoder_unittest.cc (revision 277175)
+++ media/filters/opus_audio_decoder_unittest.cc (working copy)
@@ -57,10 +57,7 @@
}
void InitializeDecoder(const AudioDecoderConfig& config) {
- decoder_->Initialize(config,
- NewExpectedStatusCB(PIPELINE_OK),
- base::Bind(&OpusAudioDecoderTest::OnDecoderOutput,
- base::Unretained(this)));
+ decoder_->Initialize(config, NewExpectedStatusCB(PIPELINE_OK));
base::RunLoop().RunUntilIdle();
}
@@ -94,16 +91,22 @@
base::RunLoop().RunUntilIdle();
}
- void OnDecoderOutput(const scoped_refptr<AudioBuffer>& buffer) {
- decoded_audio_.push_back(buffer);
- }
-
- void DecodeFinished(AudioDecoder::Status status) {
+ void DecodeFinished(AudioDecoder::Status status,
+ const scoped_refptr<AudioBuffer>& buffer) {
EXPECT_TRUE(pending_decode_);
pending_decode_ = false;
- // If we have a pending reset, we expect an abort.
- if (pending_reset_) {
+ if (status == AudioDecoder::kNotEnoughData) {
+ EXPECT_TRUE(buffer.get() == NULL);
+ Decode();
+ return;
+ }
+
+ decoded_audio_.push_back(buffer);
+
+ // If we hit a NULL buffer or have a pending reset, we expect an abort.
+ if (buffer.get() == NULL || pending_reset_) {
+ EXPECT_TRUE(buffer.get() == NULL);
EXPECT_EQ(status, AudioDecoder::kAborted);
return;
}
« no previous file with comments | « media/filters/opus_audio_decoder.cc ('k') | media/filters/video_decoder_selector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698