@@ -216,8 +216,8 @@ class VideoRendererImplTest : public testing::Test {
216
216
event.RunAndWait ();
217
217
}
218
218
219
- void WaitForPendingRead () {
220
- SCOPED_TRACE (" WaitForPendingRead ()" );
219
+ void WaitForPendingDecode () {
220
+ SCOPED_TRACE (" WaitForPendingDecode ()" );
221
221
if (!decode_cb_.is_null ())
222
222
return ;
223
223
@@ -231,7 +231,7 @@ class VideoRendererImplTest : public testing::Test {
231
231
DCHECK (wait_for_pending_decode_cb_.is_null ());
232
232
}
233
233
234
- void SatisfyPendingRead () {
234
+ void SatisfyPendingDecode () {
235
235
CHECK (!decode_cb_.is_null ());
236
236
CHECK (!decode_results_.empty ());
237
237
@@ -245,7 +245,7 @@ class VideoRendererImplTest : public testing::Test {
245
245
decode_results_.pop_front ();
246
246
}
247
247
248
- void SatisfyPendingReadWithEndOfStream () {
248
+ void SatisfyPendingDecodeWithEndOfStream () {
249
249
DCHECK (!decode_cb_.is_null ());
250
250
251
251
// Return EOS buffer to trigger EOS frame.
@@ -258,7 +258,7 @@ class VideoRendererImplTest : public testing::Test {
258
258
FROM_HERE,
259
259
base::Bind (base::ResetAndReturn (&decode_cb_), DecodeStatus::OK));
260
260
261
- WaitForPendingRead ();
261
+ WaitForPendingDecode ();
262
262
263
263
message_loop_.PostTask (
264
264
FROM_HERE,
@@ -353,7 +353,7 @@ class VideoRendererImplTest : public testing::Test {
353
353
EXPECT_CALL (mock_cb_, OnBufferingStateChange (BUFFERING_HAVE_ENOUGH))
354
354
.WillOnce (RunClosure (event.GetClosure ()));
355
355
EXPECT_CALL (mock_cb_, OnEnded ());
356
- SatisfyPendingReadWithEndOfStream ();
356
+ SatisfyPendingDecodeWithEndOfStream ();
357
357
event.RunAndWait ();
358
358
}
359
359
@@ -414,7 +414,7 @@ class VideoRendererImplTest : public testing::Test {
414
414
QueueFrames (" 80 100 120 140 160" );
415
415
else
416
416
QueueFrames (" 40 60 80 90" );
417
- SatisfyPendingRead ();
417
+ SatisfyPendingDecode ();
418
418
event.RunAndWait ();
419
419
}
420
420
@@ -449,22 +449,22 @@ class VideoRendererImplTest : public testing::Test {
449
449
CHECK (decode_cb_.is_null ());
450
450
decode_cb_ = decode_cb;
451
451
452
- // Wake up WaitForPendingRead () if needed.
452
+ // Wake up WaitForPendingDecode () if needed.
453
453
if (!wait_for_pending_decode_cb_.is_null ())
454
454
base::ResetAndReturn (&wait_for_pending_decode_cb_).Run ();
455
455
456
456
if (decode_results_.empty ())
457
457
return ;
458
458
459
- SatisfyPendingRead ();
459
+ SatisfyPendingDecode ();
460
460
}
461
461
462
462
void FlushRequested (const base::Closure& callback) {
463
463
DCHECK_EQ (&message_loop_, base::MessageLoop::current ());
464
464
decode_results_.clear ();
465
465
if (!decode_cb_.is_null ()) {
466
466
QueueFrames (" abort" );
467
- SatisfyPendingRead ();
467
+ SatisfyPendingDecode ();
468
468
}
469
469
470
470
message_loop_.PostTask (FROM_HERE, callback);
@@ -479,7 +479,7 @@ class VideoRendererImplTest : public testing::Test {
479
479
VideoDecoder::DecodeCB decode_cb_;
480
480
base::TimeDelta next_frame_timestamp_;
481
481
482
- // Run during DecodeRequested() to unblock WaitForPendingRead ().
482
+ // Run during DecodeRequested() to unblock WaitForPendingDecode ().
483
483
base::Closure wait_for_pending_decode_cb_;
484
484
485
485
std::deque<std::pair<DecodeStatus, scoped_refptr<VideoFrame>>>
@@ -517,14 +517,14 @@ TEST_F(VideoRendererImplTest, InitializeAndStartPlayingFrom) {
517
517
TEST_F (VideoRendererImplTest, InitializeAndEndOfStream) {
518
518
Initialize ();
519
519
StartPlayingFrom (0 );
520
- WaitForPendingRead ();
520
+ WaitForPendingDecode ();
521
521
{
522
522
SCOPED_TRACE (" Waiting for BUFFERING_HAVE_ENOUGH" );
523
523
WaitableMessageLoopEvent event;
524
524
EXPECT_CALL (mock_cb_, OnBufferingStateChange (BUFFERING_HAVE_ENOUGH))
525
525
.WillOnce (RunClosure (event.GetClosure ()));
526
526
EXPECT_CALL (mock_cb_, OnEnded ());
527
- SatisfyPendingReadWithEndOfStream ();
527
+ SatisfyPendingDecodeWithEndOfStream ();
528
528
event.RunAndWait ();
529
529
}
530
530
// Firing a time state changed to true should be ignored...
@@ -594,7 +594,7 @@ TEST_F(VideoRendererImplTest, DecodeError_Playing) {
594
594
AdvanceTimeInMs (10 );
595
595
596
596
QueueFrames (" error" );
597
- SatisfyPendingRead ();
597
+ SatisfyPendingDecode ();
598
598
WaitForError (PIPELINE_ERROR_DECODE);
599
599
Destroy ();
600
600
}
@@ -664,7 +664,7 @@ TEST_F(VideoRendererImplTest, StartPlayingFrom_LowDelay) {
664
664
StartPlayingFrom (10 );
665
665
666
666
QueueFrames (" 20" );
667
- SatisfyPendingRead ();
667
+ SatisfyPendingDecode ();
668
668
669
669
renderer_->OnTimeStateChanged (true );
670
670
time_source_.StartTicking ();
@@ -744,7 +744,7 @@ TEST_F(VideoRendererImplTest, RenderingStopsAfterFirstFrame) {
744
744
StartPlayingFrom (0 );
745
745
746
746
EXPECT_TRUE (IsReadPending ());
747
- SatisfyPendingReadWithEndOfStream ();
747
+ SatisfyPendingDecodeWithEndOfStream ();
748
748
749
749
event.RunAndWait ();
750
750
}
@@ -773,7 +773,7 @@ TEST_F(VideoRendererImplTest, RenderingStopsAfterOneFrameWithEOS) {
773
773
renderer_->OnTimeStateChanged (true );
774
774
775
775
EXPECT_TRUE (IsReadPending ());
776
- SatisfyPendingReadWithEndOfStream ();
776
+ SatisfyPendingDecodeWithEndOfStream ();
777
777
WaitForEnded ();
778
778
779
779
renderer_->OnTimeStateChanged (false );
@@ -807,7 +807,7 @@ TEST_F(VideoRendererImplTest, RenderingStartedThenStopped) {
807
807
808
808
// Consider the case that rendering is faster than we setup the test event.
809
809
// In that case, when we run out of the frames, BUFFERING_HAVE_NOTHING will
810
- // be called. And then during SatisfyPendingReadWithEndOfStream ,
810
+ // be called. And then during SatisfyPendingDecodeWithEndOfStream ,
811
811
// BUFFER_HAVE_ENOUGH will be called again.
812
812
EXPECT_CALL (mock_cb_, OnBufferingStateChange (BUFFERING_HAVE_ENOUGH))
813
813
.Times (testing::AtMost (1 ));
@@ -824,8 +824,8 @@ TEST_F(VideoRendererImplTest, RenderingStartedThenStopped) {
824
824
null_video_sink_->set_background_render (true );
825
825
AdvanceTimeInMs (91 );
826
826
EXPECT_CALL (mock_cb_, FrameReceived (HasTimestamp (90 )));
827
- WaitForPendingRead ();
828
- SatisfyPendingReadWithEndOfStream ();
827
+ WaitForPendingDecode ();
828
+ SatisfyPendingDecodeWithEndOfStream ();
829
829
830
830
// If this wasn't background rendering mode, this would result in two frames
831
831
// being dropped, but since we set background render to true, none should be
@@ -867,15 +867,15 @@ TEST_F(VideoRendererImplTest, UnderflowEvictionBeforeEOS) {
867
867
event.RunAndWait ();
868
868
}
869
869
870
- WaitForPendingRead ();
870
+ WaitForPendingDecode ();
871
871
872
872
// Jump time far enough forward that no frames are valid.
873
873
renderer_->OnTimeStateChanged (false );
874
874
AdvanceTimeInMs (1000 );
875
875
time_source_.StopTicking ();
876
876
877
877
// Providing the end of stream packet should remove all frames and exit.
878
- SatisfyPendingReadWithEndOfStream ();
878
+ SatisfyPendingDecodeWithEndOfStream ();
879
879
EXPECT_CALL (mock_cb_, OnBufferingStateChange (BUFFERING_HAVE_ENOUGH));
880
880
WaitForEnded ();
881
881
Destroy ();
@@ -905,8 +905,8 @@ TEST_F(VideoRendererImplTest, StartPlayingFromThenFlushThenEOS) {
905
905
Flush ();
906
906
907
907
StartPlayingFrom (200 );
908
- WaitForPendingRead ();
909
- SatisfyPendingReadWithEndOfStream ();
908
+ WaitForPendingDecode ();
909
+ SatisfyPendingDecodeWithEndOfStream ();
910
910
EXPECT_CALL (mock_cb_, OnBufferingStateChange (BUFFERING_HAVE_ENOUGH));
911
911
WaitForEnded ();
912
912
Destroy ();
0 commit comments