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

Unified Diff: media/test/pipeline_integration_test_base.cc

Issue 1904793002: Move Pipeline permanent callbacks into Pipeline::Client interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: post stop callback Created 4 years, 7 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/test/pipeline_integration_test_base.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/test/pipeline_integration_test_base.cc
diff --git a/media/test/pipeline_integration_test_base.cc b/media/test/pipeline_integration_test_base.cc
index e40ac6b90632105c16d7200b55d6ad033225f9a3..a87f1810baac2e25e54cf74333dd3d81ba1ad08e 100644
--- a/media/test/pipeline_integration_test_base.cc
+++ b/media/test/pipeline_integration_test_base.cc
@@ -124,9 +124,9 @@ PipelineStatus PipelineIntegrationTestBase::StartInternal(
EXPECT_CALL(*this, OnMetadata(_))
.Times(AtMost(1))
.WillRepeatedly(SaveArg<0>(&metadata_));
- EXPECT_CALL(*this, OnBufferingStateChanged(BUFFERING_HAVE_ENOUGH))
+ EXPECT_CALL(*this, OnBufferingStateChange(BUFFERING_HAVE_ENOUGH))
.Times(AnyNumber());
- EXPECT_CALL(*this, OnBufferingStateChanged(BUFFERING_HAVE_NOTHING))
+ EXPECT_CALL(*this, OnBufferingStateChange(BUFFERING_HAVE_NOTHING))
.Times(AnyNumber());
CreateDemuxer(std::move(data_source));
@@ -141,20 +141,9 @@ PipelineStatus PipelineIntegrationTestBase::StartInternal(
// media files are provided in advance.
EXPECT_CALL(*this, OnWaitingForDecryptionKey()).Times(0);
- pipeline_->Start(
- demuxer_.get(), CreateRenderer(),
- base::Bind(&PipelineIntegrationTestBase::OnEnded, base::Unretained(this)),
- base::Bind(&PipelineIntegrationTestBase::OnError, base::Unretained(this)),
- base::Bind(&PipelineIntegrationTestBase::OnStatusCallback,
- base::Unretained(this)),
- base::Bind(&PipelineIntegrationTestBase::OnMetadata,
- base::Unretained(this)),
- base::Bind(&PipelineIntegrationTestBase::OnBufferingStateChanged,
- base::Unretained(this)),
- base::Closure(), base::Bind(&PipelineIntegrationTestBase::OnAddTextTrack,
- base::Unretained(this)),
- base::Bind(&PipelineIntegrationTestBase::OnWaitingForDecryptionKey,
- base::Unretained(this)));
+ pipeline_->Start(demuxer_.get(), CreateRenderer(), this,
+ base::Bind(&PipelineIntegrationTestBase::OnStatusCallback,
+ base::Unretained(this)));
message_loop_.Run();
return pipeline_status_;
}
@@ -202,7 +191,7 @@ void PipelineIntegrationTestBase::Pause() {
bool PipelineIntegrationTestBase::Seek(base::TimeDelta seek_time) {
ended_ = false;
- EXPECT_CALL(*this, OnBufferingStateChanged(BUFFERING_HAVE_ENOUGH))
+ EXPECT_CALL(*this, OnBufferingStateChange(BUFFERING_HAVE_ENOUGH))
.WillOnce(InvokeWithoutArgs(&message_loop_, &base::MessageLoop::QuitNow));
pipeline_->Seek(seek_time, base::Bind(&PipelineIntegrationTestBase::OnSeeked,
base::Unretained(this), seek_time));
@@ -220,7 +209,7 @@ bool PipelineIntegrationTestBase::Suspend() {
bool PipelineIntegrationTestBase::Resume(base::TimeDelta seek_time) {
ended_ = false;
- EXPECT_CALL(*this, OnBufferingStateChanged(BUFFERING_HAVE_ENOUGH))
+ EXPECT_CALL(*this, OnBufferingStateChange(BUFFERING_HAVE_ENOUGH))
.WillOnce(InvokeWithoutArgs(&message_loop_, &base::MessageLoop::QuitNow));
pipeline_->Resume(CreateRenderer(), seek_time,
base::Bind(&PipelineIntegrationTestBase::OnSeeked,
@@ -231,8 +220,8 @@ bool PipelineIntegrationTestBase::Resume(base::TimeDelta seek_time) {
void PipelineIntegrationTestBase::Stop() {
DCHECK(pipeline_->IsRunning());
- pipeline_->Stop(base::MessageLoop::QuitWhenIdleClosure());
- message_loop_.Run();
+ pipeline_->Stop();
+ message_loop_.RunUntilIdle();
}
void PipelineIntegrationTestBase::FailTest(PipelineStatus status) {
« no previous file with comments | « media/test/pipeline_integration_test_base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698