diff options
author | fischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-27 20:12:36 +0000 |
---|---|---|
committer | fischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-27 20:12:36 +0000 |
commit | 4fce30e2f72df63df4cfdcfc8270599c9f6171a5 (patch) | |
tree | 19bf782eb844db67aea2e6098401153f2444d805 /media/base/pipeline_unittest.cc | |
parent | 395e79f77223b4470b9634edc02a693572b3e797 (diff) | |
download | chromium_src-4fce30e2f72df63df4cfdcfc8270599c9f6171a5.zip chromium_src-4fce30e2f72df63df4cfdcfc8270599c9f6171a5.tar.gz chromium_src-4fce30e2f72df63df4cfdcfc8270599c9f6171a5.tar.bz2 |
Don't report errors twice to pipeline clients.
Also convert Pipeline::Stop() to take a Closure instead of a PipelineStatusCB since the status is always OK for a Stop.
Review URL: http://codereview.chromium.org/9863028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129256 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/pipeline_unittest.cc')
-rw-r--r-- | media/base/pipeline_unittest.cc | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/media/base/pipeline_unittest.cc b/media/base/pipeline_unittest.cc index 82e7154..1d83996 100644 --- a/media/base/pipeline_unittest.cc +++ b/media/base/pipeline_unittest.cc @@ -47,7 +47,7 @@ class CallbackHelper { MOCK_METHOD1(OnStart, void(PipelineStatus)); MOCK_METHOD1(OnSeek, void(PipelineStatus)); - MOCK_METHOD1(OnStop, void(PipelineStatus)); + MOCK_METHOD0(OnStop, void()); MOCK_METHOD1(OnEnded, void(PipelineStatus)); MOCK_METHOD1(OnError, void(PipelineStatus)); @@ -88,7 +88,7 @@ class PipelineTest : public ::testing::Test { } // Expect a stop callback if we were started. - EXPECT_CALL(callbacks_, OnStop(PIPELINE_OK)); + EXPECT_CALL(callbacks_, OnStop()); pipeline_->Stop(base::Bind(&CallbackHelper::OnStop, base::Unretained(&callbacks_))); message_loop_.RunAllPending(); @@ -318,8 +318,6 @@ TEST_F(PipelineTest, NeverInitializes) { } TEST_F(PipelineTest, RequiredFilterMissing) { - EXPECT_CALL(callbacks_, OnError(PIPELINE_ERROR_REQUIRED_FILTER_MISSING)); - // Sets up expectations on the callback and initializes the pipeline. Called // after tests have set expectations any filters they wish to use. // Expect an initialization callback. @@ -341,12 +339,6 @@ TEST_F(PipelineTest, RequiredFilterMissing) { } TEST_F(PipelineTest, URLNotFound) { - // TODO(acolwell,fischman): Since OnStart() is getting called with an error - // code already, OnError() doesn't also need to get called. Fix the pipeline - // (and it's consumers!) so that OnError doesn't need to be called after - // another callback has already reported the error. Same applies to NoStreams - // below. - EXPECT_CALL(callbacks_, OnError(PIPELINE_ERROR_URL_NOT_FOUND)); InitializePipeline(PIPELINE_ERROR_URL_NOT_FOUND); EXPECT_FALSE(pipeline_->IsInitialized()); } @@ -356,9 +348,6 @@ TEST_F(PipelineTest, NoStreams) { // we cannot fully initialize the pipeline. EXPECT_CALL(*mocks_->demuxer(), Stop(_)) .WillOnce(Invoke(&RunStopFilterCallback)); - // TODO(acolwell,fischman): see TODO in URLNotFound above. - EXPECT_CALL(callbacks_, OnError(PIPELINE_ERROR_COULD_NOT_RENDER)); - InitializePipeline(PIPELINE_OK, PIPELINE_ERROR_COULD_NOT_RENDER); EXPECT_FALSE(pipeline_->IsInitialized()); } @@ -743,7 +732,6 @@ TEST_F(PipelineTest, ErrorDuringSeek) { pipeline_->Seek(seek_time,base::Bind(&CallbackHelper::OnSeek, base::Unretained(&callbacks_))); EXPECT_CALL(callbacks_, OnSeek(PIPELINE_ERROR_READ)); - EXPECT_CALL(callbacks_, OnError(PIPELINE_ERROR_READ)); message_loop_.RunAllPending(); } @@ -793,7 +781,6 @@ TEST_F(PipelineTest, NoMessageDuringTearDownFromError) { pipeline_->Seek(seek_time,base::Bind(&CallbackHelper::OnSeek, base::Unretained(&callbacks_))); EXPECT_CALL(callbacks_, OnSeek(PIPELINE_ERROR_READ)); - EXPECT_CALL(callbacks_, OnError(PIPELINE_ERROR_READ)); message_loop_.RunAllPending(); } |