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

Unified Diff: media/filters/fake_video_decoder_unittest.cc

Issue 239893002: Allow multiple concurrent Decode() requests in VideoDecoder interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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/fake_video_decoder_unittest.cc
diff --git a/media/filters/fake_video_decoder_unittest.cc b/media/filters/fake_video_decoder_unittest.cc
index 4f50b453f385fe7958bf481ca78317e949d24e33..e4729b53a9a2185b3652a271bda65814e127bebd 100644
--- a/media/filters/fake_video_decoder_unittest.cc
+++ b/media/filters/fake_video_decoder_unittest.cc
@@ -21,7 +21,7 @@ static const int kDurationMs = 30;
class FakeVideoDecoderTest : public testing::Test {
public:
FakeVideoDecoderTest()
- : decoder_(new FakeVideoDecoder(kDecodingDelay, false)),
+ : decoder_(new FakeVideoDecoder(kDecodingDelay, false, 1)),
xhwang 2014/04/25 00:36:03 It'll be nice to also test with max_parallel_decod
Sergey Ulanov 2014/04/26 00:59:29 Done.
num_input_buffers_(0),
num_decoded_frames_(0),
decode_status_(VideoDecoder::kNotEnoughData),
@@ -56,8 +56,7 @@ class FakeVideoDecoderTest : public testing::Test {
void FrameReady(VideoDecoder::Status status,
const scoped_refptr<VideoFrame>& frame) {
DCHECK(is_decode_pending_);
- ASSERT_TRUE(status == VideoDecoder::kOk ||
- status == VideoDecoder::kNotEnoughData);
+
is_decode_pending_ = false;
decode_status_ = status;
frame_decoded_ = frame;
@@ -70,7 +69,7 @@ class FakeVideoDecoderTest : public testing::Test {
PENDING,
OK,
NOT_ENOUGH_DATA,
- ABROTED,
+ ABORTED,
EOS
};
@@ -91,9 +90,9 @@ class FakeVideoDecoderTest : public testing::Test {
ASSERT_EQ(VideoDecoder::kNotEnoughData, decode_status_);
ASSERT_FALSE(frame_decoded_);
break;
- case ABROTED:
+ case ABORTED:
EXPECT_FALSE(is_decode_pending_);
- ASSERT_EQ(VideoDecoder::kOk, decode_status_);
+ ASSERT_EQ(VideoDecoder::kAborted, decode_status_);
EXPECT_FALSE(frame_decoded_);
break;
case EOS:
@@ -144,7 +143,7 @@ class FakeVideoDecoderTest : public testing::Test {
void EnterPendingReadState() {
// Pass the initial NOT_ENOUGH_DATA stage.
ReadOneFrame();
- decoder_->HoldNextDecode();
+ decoder_->HoldDecode();
ReadOneFrame();
ExpectReadResult(PENDING);
}
@@ -244,7 +243,7 @@ TEST_F(FakeVideoDecoderTest, Read_DecodingDelay) {
}
TEST_F(FakeVideoDecoderTest, Read_ZeroDelay) {
- decoder_.reset(new FakeVideoDecoder(0, false));
+ decoder_.reset(new FakeVideoDecoder(0, false, 1));
Initialize();
while (num_input_buffers_ < kTotalBuffers) {
@@ -255,7 +254,7 @@ TEST_F(FakeVideoDecoderTest, Read_ZeroDelay) {
TEST_F(FakeVideoDecoderTest, Read_Pending_NotEnoughData) {
Initialize();
- decoder_->HoldNextDecode();
+ decoder_->HoldDecode();
ReadOneFrame();
ExpectReadResult(PENDING);
SatisfyReadAndExpect(NOT_ENOUGH_DATA);
@@ -295,7 +294,7 @@ TEST_F(FakeVideoDecoderTest, Reset_DuringPendingRead) {
Initialize();
EnterPendingReadState();
ResetAndExpect(PENDING);
- SatisfyRead();
+ SatisfyReadAndExpect(ABORTED);
}
TEST_F(FakeVideoDecoderTest, Reset_Pending) {
@@ -308,7 +307,7 @@ TEST_F(FakeVideoDecoderTest, Reset_PendingDuringPendingRead) {
Initialize();
EnterPendingReadState();
EnterPendingResetState();
- SatisfyRead();
+ SatisfyReadAndExpect(ABORTED);
SatisfyReset();
}
@@ -344,7 +343,7 @@ TEST_F(FakeVideoDecoderTest, Stop_DuringPendingReadAndPendingReset) {
}
TEST_F(FakeVideoDecoderTest, GetDecodeOutput) {
- decoder_.reset(new FakeVideoDecoder(kDecodingDelay, true));
+ decoder_.reset(new FakeVideoDecoder(kDecodingDelay, true, 1));
Initialize();
while (num_input_buffers_ < kTotalBuffers) {

Powered by Google App Engine
This is Rietveld 408576698