diff options
author | kylep@chromium.org <kylep@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-30 18:51:52 +0000 |
---|---|---|
committer | kylep@chromium.org <kylep@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-30 18:51:52 +0000 |
commit | db190487d2bc37ef9a2852d948bd8dd4548a98bd (patch) | |
tree | bba60ce128d4e214663cbd45e6620224e2cf3ae4 /media/base/pipeline_impl_unittest.cc | |
parent | 66f16b11638993ead4028e853d5565a74b9acba3 (diff) | |
download | chromium_src-db190487d2bc37ef9a2852d948bd8dd4548a98bd.zip chromium_src-db190487d2bc37ef9a2852d948bd8dd4548a98bd.tar.gz chromium_src-db190487d2bc37ef9a2852d948bd8dd4548a98bd.tar.bz2 |
Pipeline will execute a callback whenever an run-time error has happened.
BUG=16738
TEST=pipeline_impl_unittest.cc
Review URL: http://codereview.chromium.org/160298
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22075 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/pipeline_impl_unittest.cc')
-rw-r--r-- | media/base/pipeline_impl_unittest.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/media/base/pipeline_impl_unittest.cc b/media/base/pipeline_impl_unittest.cc index 7e69ce5..068b095 100644 --- a/media/base/pipeline_impl_unittest.cc +++ b/media/base/pipeline_impl_unittest.cc @@ -32,6 +32,7 @@ class CallbackHelper { MOCK_METHOD0(OnStart, void()); MOCK_METHOD0(OnSeek, void()); MOCK_METHOD0(OnStop, void()); + MOCK_METHOD0(OnError, void()); private: DISALLOW_COPY_AND_ASSIGN(CallbackHelper); @@ -48,6 +49,9 @@ class PipelineImplTest : public ::testing::Test { PipelineImplTest() : pipeline_(new PipelineImpl(&message_loop_)), mocks_(new MockFilterFactory()) { + pipeline_->SetPipelineErrorCallback(NewCallback( + reinterpret_cast<CallbackHelper*>(&callbacks_), + &CallbackHelper::OnError)); } virtual ~PipelineImplTest() { @@ -234,6 +238,7 @@ TEST_F(PipelineImplTest, NeverInitializes) { } TEST_F(PipelineImplTest, RequiredFilterMissing) { + EXPECT_CALL(callbacks_, OnError()); mocks_->set_creation_successful(false); InitializePipeline(); @@ -247,6 +252,7 @@ TEST_F(PipelineImplTest, URLNotFound) { .WillOnce(DoAll(SetError(mocks_->data_source(), PIPELINE_ERROR_URL_NOT_FOUND), Invoke(&RunFilterCallback))); + EXPECT_CALL(callbacks_, OnError()); EXPECT_CALL(*mocks_->data_source(), Stop()); InitializePipeline(); @@ -266,6 +272,7 @@ TEST_F(PipelineImplTest, NoStreams) { EXPECT_CALL(*mocks_->demuxer(), GetNumberOfStreams()) .WillRepeatedly(Return(0)); EXPECT_CALL(*mocks_->demuxer(), Stop()); + EXPECT_CALL(callbacks_, OnError()); InitializePipeline(); EXPECT_FALSE(pipeline_->IsInitialized()); |