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

Side by Side Diff: media/base/pipeline_unittest.cc

Issue 416393003: Make Demuxer::Stop() synchronous. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix android Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/base/pipeline.cc ('k') | media/filters/chunk_demuxer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <vector> 5 #include <vector>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/test/simple_test_tick_clock.h" 10 #include "base/test/simple_test_tick_clock.h"
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 269
270 void DestroyPipeline() { 270 void DestroyPipeline() {
271 // In real code Pipeline could be destroyed on a different thread. All weak 271 // In real code Pipeline could be destroyed on a different thread. All weak
272 // pointers must have been invalidated before the stop callback returns. 272 // pointers must have been invalidated before the stop callback returns.
273 DCHECK(!pipeline_->HasWeakPtrsForTesting()); 273 DCHECK(!pipeline_->HasWeakPtrsForTesting());
274 pipeline_.reset(); 274 pipeline_.reset();
275 } 275 }
276 276
277 void ExpectDemuxerStop() { 277 void ExpectDemuxerStop() {
278 if (demuxer_) 278 if (demuxer_)
279 EXPECT_CALL(*demuxer_, Stop(_)).WillOnce(RunClosure<0>()); 279 EXPECT_CALL(*demuxer_, Stop());
280 } 280 }
281 281
282 void ExpectPipelineStopAndDestroyPipeline() { 282 void ExpectPipelineStopAndDestroyPipeline() {
283 // After the Pipeline is stopped, it could be destroyed any time. Always 283 // After the Pipeline is stopped, it could be destroyed any time. Always
284 // destroy the pipeline immediately after OnStop() to test this. 284 // destroy the pipeline immediately after OnStop() to test this.
285 EXPECT_CALL(callbacks_, OnStop()) 285 EXPECT_CALL(callbacks_, OnStop())
286 .WillOnce(Invoke(this, &PipelineTest::DestroyPipeline)); 286 .WillOnce(Invoke(this, &PipelineTest::DestroyPipeline));
287 } 287 }
288 288
289 MOCK_METHOD2(OnAddTextTrack, void(const TextTrackConfig&, 289 MOCK_METHOD2(OnAddTextTrack, void(const TextTrackConfig&,
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 TEST_F(PipelineTest, StopWithoutStart) { 364 TEST_F(PipelineTest, StopWithoutStart) {
365 ExpectPipelineStopAndDestroyPipeline(); 365 ExpectPipelineStopAndDestroyPipeline();
366 pipeline_->Stop( 366 pipeline_->Stop(
367 base::Bind(&CallbackHelper::OnStop, base::Unretained(&callbacks_))); 367 base::Bind(&CallbackHelper::OnStop, base::Unretained(&callbacks_)));
368 message_loop_.RunUntilIdle(); 368 message_loop_.RunUntilIdle();
369 } 369 }
370 370
371 TEST_F(PipelineTest, StartThenStopImmediately) { 371 TEST_F(PipelineTest, StartThenStopImmediately) {
372 EXPECT_CALL(*demuxer_, Initialize(_, _, _)) 372 EXPECT_CALL(*demuxer_, Initialize(_, _, _))
373 .WillOnce(RunCallback<1>(PIPELINE_OK)); 373 .WillOnce(RunCallback<1>(PIPELINE_OK));
374 EXPECT_CALL(*demuxer_, Stop(_)) 374 EXPECT_CALL(*demuxer_, Stop());
375 .WillOnce(RunClosure<0>());
376 375
377 EXPECT_CALL(callbacks_, OnStart(_)); 376 EXPECT_CALL(callbacks_, OnStart(_));
378 StartPipeline(); 377 StartPipeline();
379 378
380 // Expect a stop callback if we were started. 379 // Expect a stop callback if we were started.
381 ExpectPipelineStopAndDestroyPipeline(); 380 ExpectPipelineStopAndDestroyPipeline();
382 pipeline_->Stop( 381 pipeline_->Stop(
383 base::Bind(&CallbackHelper::OnStop, base::Unretained(&callbacks_))); 382 base::Bind(&CallbackHelper::OnStop, base::Unretained(&callbacks_)));
384 message_loop_.RunUntilIdle(); 383 message_loop_.RunUntilIdle();
385 } 384 }
386 385
387 TEST_F(PipelineTest, DemuxerErrorDuringStop) { 386 TEST_F(PipelineTest, DemuxerErrorDuringStop) {
388 CreateAudioStream(); 387 CreateAudioStream();
389 MockDemuxerStreamVector streams; 388 MockDemuxerStreamVector streams;
390 streams.push_back(audio_stream()); 389 streams.push_back(audio_stream());
391 390
392 SetDemuxerExpectations(&streams); 391 SetDemuxerExpectations(&streams);
393 SetRendererExpectations(); 392 SetRendererExpectations();
394 393
395 StartPipelineAndExpect(PIPELINE_OK); 394 StartPipelineAndExpect(PIPELINE_OK);
396 395
397 EXPECT_CALL(*demuxer_, Stop(_)) 396 EXPECT_CALL(*demuxer_, Stop())
398 .WillOnce(DoAll(InvokeWithoutArgs(this, &PipelineTest::OnDemuxerError), 397 .WillOnce(InvokeWithoutArgs(this, &PipelineTest::OnDemuxerError));
399 RunClosure<0>()));
400 ExpectPipelineStopAndDestroyPipeline(); 398 ExpectPipelineStopAndDestroyPipeline();
401 399
402 pipeline_->Stop( 400 pipeline_->Stop(
403 base::Bind(&CallbackHelper::OnStop, base::Unretained(&callbacks_))); 401 base::Bind(&CallbackHelper::OnStop, base::Unretained(&callbacks_)));
404 message_loop_.RunUntilIdle(); 402 message_loop_.RunUntilIdle();
405 } 403 }
406 404
407 TEST_F(PipelineTest, URLNotFound) { 405 TEST_F(PipelineTest, URLNotFound) {
408 EXPECT_CALL(*demuxer_, Initialize(_, _, _)) 406 EXPECT_CALL(*demuxer_, Initialize(_, _, _))
409 .WillOnce(RunCallback<1>(PIPELINE_ERROR_URL_NOT_FOUND)); 407 .WillOnce(RunCallback<1>(PIPELINE_ERROR_URL_NOT_FOUND));
410 EXPECT_CALL(*demuxer_, Stop(_)) 408 EXPECT_CALL(*demuxer_, Stop());
411 .WillOnce(RunClosure<0>());
412 409
413 StartPipelineAndExpect(PIPELINE_ERROR_URL_NOT_FOUND); 410 StartPipelineAndExpect(PIPELINE_ERROR_URL_NOT_FOUND);
414 } 411 }
415 412
416 TEST_F(PipelineTest, NoStreams) { 413 TEST_F(PipelineTest, NoStreams) {
417 EXPECT_CALL(*demuxer_, Initialize(_, _, _)) 414 EXPECT_CALL(*demuxer_, Initialize(_, _, _))
418 .WillOnce(RunCallback<1>(PIPELINE_OK)); 415 .WillOnce(RunCallback<1>(PIPELINE_OK));
419 EXPECT_CALL(*demuxer_, Stop(_)) 416 EXPECT_CALL(*demuxer_, Stop());
420 .WillOnce(RunClosure<0>());
421 417
422 StartPipelineAndExpect(PIPELINE_ERROR_COULD_NOT_RENDER); 418 StartPipelineAndExpect(PIPELINE_ERROR_COULD_NOT_RENDER);
423 } 419 }
424 420
425 TEST_F(PipelineTest, AudioStream) { 421 TEST_F(PipelineTest, AudioStream) {
426 CreateAudioStream(); 422 CreateAudioStream();
427 MockDemuxerStreamVector streams; 423 MockDemuxerStreamVector streams;
428 streams.push_back(audio_stream()); 424 streams.push_back(audio_stream());
429 425
430 SetDemuxerExpectations(&streams); 426 SetDemuxerExpectations(&streams);
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 CreateAudioStream(); 517 CreateAudioStream();
522 MockDemuxerStreamVector streams; 518 MockDemuxerStreamVector streams;
523 streams.push_back(audio_stream()); 519 streams.push_back(audio_stream());
524 520
525 SetDemuxerExpectations(&streams, base::TimeDelta::FromSeconds(3000)); 521 SetDemuxerExpectations(&streams, base::TimeDelta::FromSeconds(3000));
526 SetRendererExpectations(); 522 SetRendererExpectations();
527 523
528 // Initialize then seek! 524 // Initialize then seek!
529 StartPipelineAndExpect(PIPELINE_OK); 525 StartPipelineAndExpect(PIPELINE_OK);
530 526
531 EXPECT_CALL(*demuxer_, Stop(_)) 527 EXPECT_CALL(*demuxer_, Stop());
532 .WillOnce(RunClosure<0>());
533 EXPECT_CALL(callbacks_, OnError(_)); 528 EXPECT_CALL(callbacks_, OnError(_));
534 529
535 static_cast<DemuxerHost*>(pipeline_.get()) 530 static_cast<DemuxerHost*>(pipeline_.get())
536 ->OnDemuxerError(PIPELINE_ERROR_ABORT); 531 ->OnDemuxerError(PIPELINE_ERROR_ABORT);
537 message_loop_.RunUntilIdle(); 532 message_loop_.RunUntilIdle();
538 533
539 pipeline_->Seek( 534 pipeline_->Seek(
540 base::TimeDelta::FromMilliseconds(100), 535 base::TimeDelta::FromMilliseconds(100),
541 base::Bind(&CallbackHelper::OnSeek, base::Unretained(&callbacks_))); 536 base::Bind(&CallbackHelper::OnSeek, base::Unretained(&callbacks_)));
542 message_loop_.RunUntilIdle(); 537 message_loop_.RunUntilIdle();
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 base::TimeDelta seek_time = base::TimeDelta::FromSeconds(5); 637 base::TimeDelta seek_time = base::TimeDelta::FromSeconds(5);
643 638
644 EXPECT_CALL(callbacks_, OnBufferingStateChange(BUFFERING_HAVE_NOTHING)); 639 EXPECT_CALL(callbacks_, OnBufferingStateChange(BUFFERING_HAVE_NOTHING));
645 EXPECT_CALL(*renderer_, Flush(_)) 640 EXPECT_CALL(*renderer_, Flush(_))
646 .WillOnce(DoAll(SetBufferingState(&buffering_state_cb_, 641 .WillOnce(DoAll(SetBufferingState(&buffering_state_cb_,
647 BUFFERING_HAVE_NOTHING), 642 BUFFERING_HAVE_NOTHING),
648 RunClosure<0>())); 643 RunClosure<0>()));
649 644
650 EXPECT_CALL(*demuxer_, Seek(seek_time, _)) 645 EXPECT_CALL(*demuxer_, Seek(seek_time, _))
651 .WillOnce(RunCallback<1>(PIPELINE_ERROR_READ)); 646 .WillOnce(RunCallback<1>(PIPELINE_ERROR_READ));
652 EXPECT_CALL(*demuxer_, Stop(_)) 647 EXPECT_CALL(*demuxer_, Stop());
653 .WillOnce(RunClosure<0>());
654 648
655 pipeline_->Seek(seek_time, base::Bind(&CallbackHelper::OnSeek, 649 pipeline_->Seek(seek_time, base::Bind(&CallbackHelper::OnSeek,
656 base::Unretained(&callbacks_))); 650 base::Unretained(&callbacks_)));
657 EXPECT_CALL(callbacks_, OnSeek(PIPELINE_ERROR_READ)); 651 EXPECT_CALL(callbacks_, OnSeek(PIPELINE_ERROR_READ));
658 message_loop_.RunUntilIdle(); 652 message_loop_.RunUntilIdle();
659 } 653 }
660 654
661 // Invoked function OnError. This asserts that the pipeline does not enqueue 655 // Invoked function OnError. This asserts that the pipeline does not enqueue
662 // non-teardown related tasks while tearing down. 656 // non-teardown related tasks while tearing down.
663 static void TestNoCallsAfterError( 657 static void TestNoCallsAfterError(
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 690
697 // Seek() isn't called as the demuxer errors out first. 691 // Seek() isn't called as the demuxer errors out first.
698 EXPECT_CALL(*renderer_, Flush(_)) 692 EXPECT_CALL(*renderer_, Flush(_))
699 .WillOnce(DoAll(SetBufferingState(&buffering_state_cb_, 693 .WillOnce(DoAll(SetBufferingState(&buffering_state_cb_,
700 BUFFERING_HAVE_NOTHING), 694 BUFFERING_HAVE_NOTHING),
701 RunClosure<0>())); 695 RunClosure<0>()));
702 EXPECT_CALL(callbacks_, OnBufferingStateChange(BUFFERING_HAVE_NOTHING)); 696 EXPECT_CALL(callbacks_, OnBufferingStateChange(BUFFERING_HAVE_NOTHING));
703 697
704 EXPECT_CALL(*demuxer_, Seek(seek_time, _)) 698 EXPECT_CALL(*demuxer_, Seek(seek_time, _))
705 .WillOnce(RunCallback<1>(PIPELINE_ERROR_READ)); 699 .WillOnce(RunCallback<1>(PIPELINE_ERROR_READ));
706 EXPECT_CALL(*demuxer_, Stop(_)) 700 EXPECT_CALL(*demuxer_, Stop());
707 .WillOnce(RunClosure<0>());
708 701
709 pipeline_->Seek(seek_time, base::Bind(&CallbackHelper::OnSeek, 702 pipeline_->Seek(seek_time, base::Bind(&CallbackHelper::OnSeek,
710 base::Unretained(&callbacks_))); 703 base::Unretained(&callbacks_)));
711 EXPECT_CALL(callbacks_, OnSeek(PIPELINE_ERROR_READ)); 704 EXPECT_CALL(callbacks_, OnSeek(PIPELINE_ERROR_READ));
712 message_loop_.RunUntilIdle(); 705 message_loop_.RunUntilIdle();
713 } 706 }
714 707
715 TEST_F(PipelineTest, DestroyAfterStop) { 708 TEST_F(PipelineTest, DestroyAfterStop) {
716 CreateAudioStream(); 709 CreateAudioStream();
717 MockDemuxerStreamVector streams; 710 MockDemuxerStreamVector streams;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 EXPECT_CALL(*demuxer_, Initialize(_, _, _)) 805 EXPECT_CALL(*demuxer_, Initialize(_, _, _))
813 .WillOnce(DoAll(Stop(pipeline_.get(), stop_cb), 806 .WillOnce(DoAll(Stop(pipeline_.get(), stop_cb),
814 RunCallback<1>(PIPELINE_OK))); 807 RunCallback<1>(PIPELINE_OK)));
815 ExpectPipelineStopAndDestroyPipeline(); 808 ExpectPipelineStopAndDestroyPipeline();
816 } else { 809 } else {
817 status = DEMUXER_ERROR_COULD_NOT_OPEN; 810 status = DEMUXER_ERROR_COULD_NOT_OPEN;
818 EXPECT_CALL(*demuxer_, Initialize(_, _, _)) 811 EXPECT_CALL(*demuxer_, Initialize(_, _, _))
819 .WillOnce(RunCallback<1>(status)); 812 .WillOnce(RunCallback<1>(status));
820 } 813 }
821 814
822 EXPECT_CALL(*demuxer_, Stop(_)).WillOnce(RunClosure<0>()); 815 EXPECT_CALL(*demuxer_, Stop());
823 return status; 816 return status;
824 } 817 }
825 818
826 CreateAudioStream(); 819 CreateAudioStream();
827 CreateVideoStream(); 820 CreateVideoStream();
828 MockDemuxerStreamVector streams; 821 MockDemuxerStreamVector streams;
829 streams.push_back(audio_stream()); 822 streams.push_back(audio_stream());
830 streams.push_back(video_stream()); 823 streams.push_back(video_stream());
831 SetDemuxerExpectations(&streams, base::TimeDelta::FromSeconds(3000)); 824 SetDemuxerExpectations(&streams, base::TimeDelta::FromSeconds(3000));
832 825
833 EXPECT_CALL(*renderer_, HasAudio()).WillRepeatedly(Return(true)); 826 EXPECT_CALL(*renderer_, HasAudio()).WillRepeatedly(Return(true));
834 EXPECT_CALL(*renderer_, HasVideo()).WillRepeatedly(Return(true)); 827 EXPECT_CALL(*renderer_, HasVideo()).WillRepeatedly(Return(true));
835 828
836 if (state == kInitRenderer) { 829 if (state == kInitRenderer) {
837 if (stop_or_error == kStop) { 830 if (stop_or_error == kStop) {
838 EXPECT_CALL(*renderer_, Initialize(_, _, _, _, _, _)) 831 EXPECT_CALL(*renderer_, Initialize(_, _, _, _, _, _))
839 .WillOnce(DoAll(Stop(pipeline_.get(), stop_cb), 832 .WillOnce(DoAll(Stop(pipeline_.get(), stop_cb),
840 RunCallback<0>(PIPELINE_OK))); 833 RunCallback<0>(PIPELINE_OK)));
841 ExpectPipelineStopAndDestroyPipeline(); 834 ExpectPipelineStopAndDestroyPipeline();
842 } else { 835 } else {
843 status = PIPELINE_ERROR_INITIALIZATION_FAILED; 836 status = PIPELINE_ERROR_INITIALIZATION_FAILED;
844 EXPECT_CALL(*renderer_, Initialize(_, _, _, _, _, _)) 837 EXPECT_CALL(*renderer_, Initialize(_, _, _, _, _, _))
845 .WillOnce(RunCallback<0>(status)); 838 .WillOnce(RunCallback<0>(status));
846 } 839 }
847 840
848 EXPECT_CALL(*demuxer_, Stop(_)).WillOnce(RunClosure<0>()); 841 EXPECT_CALL(*demuxer_, Stop());
849 return status; 842 return status;
850 } 843 }
851 844
852 EXPECT_CALL(*renderer_, Initialize(_, _, _, _, _, _)) 845 EXPECT_CALL(*renderer_, Initialize(_, _, _, _, _, _))
853 .WillOnce(DoAll(SaveArg<4>(&buffering_state_cb_), 846 .WillOnce(DoAll(SaveArg<4>(&buffering_state_cb_),
854 RunCallback<0>(PIPELINE_OK))); 847 RunCallback<0>(PIPELINE_OK)));
855 848
856 EXPECT_CALL(callbacks_, OnMetadata(_)); 849 EXPECT_CALL(callbacks_, OnMetadata(_));
857 850
858 // If we get here it's a successful initialization. 851 // If we get here it's a successful initialization.
859 EXPECT_CALL(*renderer_, SetPlaybackRate(0.0f)); 852 EXPECT_CALL(*renderer_, SetPlaybackRate(0.0f));
860 EXPECT_CALL(*renderer_, SetVolume(1.0f)); 853 EXPECT_CALL(*renderer_, SetVolume(1.0f));
861 EXPECT_CALL(*renderer_, StartPlayingFrom(base::TimeDelta())) 854 EXPECT_CALL(*renderer_, StartPlayingFrom(base::TimeDelta()))
862 .WillOnce(SetBufferingState(&buffering_state_cb_, 855 .WillOnce(SetBufferingState(&buffering_state_cb_,
863 BUFFERING_HAVE_ENOUGH)); 856 BUFFERING_HAVE_ENOUGH));
864 857
865 if (status == PIPELINE_OK) 858 if (status == PIPELINE_OK)
866 EXPECT_CALL(callbacks_, OnBufferingStateChange(BUFFERING_HAVE_ENOUGH)); 859 EXPECT_CALL(callbacks_, OnBufferingStateChange(BUFFERING_HAVE_ENOUGH));
867 860
868 return status; 861 return status;
869 } 862 }
870 863
871 void DoSeek(TeardownState state, StopOrError stop_or_error) { 864 void DoSeek(TeardownState state, StopOrError stop_or_error) {
872 InSequence s; 865 InSequence s;
873 PipelineStatus status = SetSeekExpectations(state, stop_or_error); 866 PipelineStatus status = SetSeekExpectations(state, stop_or_error);
874 867
875 EXPECT_CALL(*demuxer_, Stop(_)).WillOnce(RunClosure<0>()); 868 EXPECT_CALL(*demuxer_, Stop());
876 EXPECT_CALL(callbacks_, OnSeek(status)); 869 EXPECT_CALL(callbacks_, OnSeek(status));
877 870
878 if (status == PIPELINE_OK) { 871 if (status == PIPELINE_OK) {
879 ExpectPipelineStopAndDestroyPipeline(); 872 ExpectPipelineStopAndDestroyPipeline();
880 } 873 }
881 874
882 pipeline_->Seek(base::TimeDelta::FromSeconds(10), base::Bind( 875 pipeline_->Seek(base::TimeDelta::FromSeconds(10), base::Bind(
883 &CallbackHelper::OnSeek, base::Unretained(&callbacks_))); 876 &CallbackHelper::OnSeek, base::Unretained(&callbacks_)));
884 message_loop_.RunUntilIdle(); 877 message_loop_.RunUntilIdle();
885 } 878 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
931 return status; 924 return status;
932 } 925 }
933 926
934 NOTREACHED() << "State not supported: " << state; 927 NOTREACHED() << "State not supported: " << state;
935 return status; 928 return status;
936 } 929 }
937 930
938 void DoStopOrError(StopOrError stop_or_error) { 931 void DoStopOrError(StopOrError stop_or_error) {
939 InSequence s; 932 InSequence s;
940 933
941 EXPECT_CALL(*demuxer_, Stop(_)).WillOnce(RunClosure<0>()); 934 EXPECT_CALL(*demuxer_, Stop());
942 935
943 switch (stop_or_error) { 936 switch (stop_or_error) {
944 case kStop: 937 case kStop:
945 ExpectPipelineStopAndDestroyPipeline(); 938 ExpectPipelineStopAndDestroyPipeline();
946 pipeline_->Stop(base::Bind( 939 pipeline_->Stop(base::Bind(
947 &CallbackHelper::OnStop, base::Unretained(&callbacks_))); 940 &CallbackHelper::OnStop, base::Unretained(&callbacks_)));
948 break; 941 break;
949 942
950 case kError: 943 case kError:
951 EXPECT_CALL(callbacks_, OnError(PIPELINE_ERROR_READ)); 944 EXPECT_CALL(callbacks_, OnError(PIPELINE_ERROR_READ));
952 pipeline_->SetErrorForTesting(PIPELINE_ERROR_READ); 945 pipeline_->SetErrorForTesting(PIPELINE_ERROR_READ);
953 break; 946 break;
954 947
955 case kErrorAndStop: 948 case kErrorAndStop:
956 EXPECT_CALL(callbacks_, OnError(PIPELINE_ERROR_READ)); 949 EXPECT_CALL(callbacks_, OnError(PIPELINE_ERROR_READ));
957 ExpectPipelineStopAndDestroyPipeline(); 950 ExpectPipelineStopAndDestroyPipeline();
958 pipeline_->SetErrorForTesting(PIPELINE_ERROR_READ); 951 pipeline_->SetErrorForTesting(PIPELINE_ERROR_READ);
952 message_loop_.RunUntilIdle();
959 pipeline_->Stop(base::Bind( 953 pipeline_->Stop(base::Bind(
960 &CallbackHelper::OnStop, base::Unretained(&callbacks_))); 954 &CallbackHelper::OnStop, base::Unretained(&callbacks_)));
961 break; 955 break;
962 } 956 }
963 957
964 message_loop_.RunUntilIdle(); 958 message_loop_.RunUntilIdle();
965 } 959 }
966 960
967 DISALLOW_COPY_AND_ASSIGN(PipelineTeardownTest); 961 DISALLOW_COPY_AND_ASSIGN(PipelineTeardownTest);
968 }; 962 };
(...skipping 11 matching lines...) Expand all
980 974
981 INSTANTIATE_TEARDOWN_TEST(Error, InitDemuxer); 975 INSTANTIATE_TEARDOWN_TEST(Error, InitDemuxer);
982 INSTANTIATE_TEARDOWN_TEST(Error, InitRenderer); 976 INSTANTIATE_TEARDOWN_TEST(Error, InitRenderer);
983 INSTANTIATE_TEARDOWN_TEST(Error, Flushing); 977 INSTANTIATE_TEARDOWN_TEST(Error, Flushing);
984 INSTANTIATE_TEARDOWN_TEST(Error, Seeking); 978 INSTANTIATE_TEARDOWN_TEST(Error, Seeking);
985 INSTANTIATE_TEARDOWN_TEST(Error, Playing); 979 INSTANTIATE_TEARDOWN_TEST(Error, Playing);
986 980
987 INSTANTIATE_TEARDOWN_TEST(ErrorAndStop, Playing); 981 INSTANTIATE_TEARDOWN_TEST(ErrorAndStop, Playing);
988 982
989 } // namespace media 983 } // namespace media
OLDNEW
« no previous file with comments | « media/base/pipeline.cc ('k') | media/filters/chunk_demuxer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698