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

Unified Diff: media/base/pipeline_impl_unittest.cc

Issue 159373: Pipeline will execute a callback whenever an run-time error has happened.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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/base/pipeline_impl.cc ('k') | webkit/glue/webmediaplayer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/pipeline_impl_unittest.cc
===================================================================
--- media/base/pipeline_impl_unittest.cc (revision 21652)
+++ media/base/pipeline_impl_unittest.cc (working copy)
@@ -32,6 +32,7 @@
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 @@
PipelineImplTest()
: pipeline_(new PipelineImpl(&message_loop_)),
mocks_(new MockFilterFactory()) {
+ pipeline_->SetPipelineErrorCallback(NewCallback(
+ reinterpret_cast<CallbackHelper*>(&callbacks_),
+ &CallbackHelper::OnError));
}
virtual ~PipelineImplTest() {
@@ -232,6 +236,7 @@
}
TEST_F(PipelineImplTest, RequiredFilterMissing) {
+ EXPECT_CALL(callbacks_, OnError());
mocks_->set_creation_successful(false);
InitializePipeline();
@@ -245,6 +250,7 @@
.WillOnce(DoAll(SetError(mocks_->data_source(),
PIPELINE_ERROR_URL_NOT_FOUND),
Invoke(&RunFilterCallback)));
+ EXPECT_CALL(callbacks_, OnError());
EXPECT_CALL(*mocks_->data_source(), Stop());
InitializePipeline();
@@ -264,6 +270,7 @@
EXPECT_CALL(*mocks_->demuxer(), GetNumberOfStreams())
.WillRepeatedly(Return(0));
EXPECT_CALL(*mocks_->demuxer(), Stop());
+ EXPECT_CALL(callbacks_, OnError());
InitializePipeline();
EXPECT_FALSE(pipeline_->IsInitialized());
« no previous file with comments | « media/base/pipeline_impl.cc ('k') | webkit/glue/webmediaplayer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698