summaryrefslogtreecommitdiffstats
path: root/media/base/pipeline_impl_unittest.cc
diff options
context:
space:
mode:
authorscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-15 17:18:05 +0000
committerscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-15 17:18:05 +0000
commit9670691da1ff13fc4c0cd69fab4369b448f9019a (patch)
tree2317e355463e2215a0247f142f39d3c3abeb096b /media/base/pipeline_impl_unittest.cc
parent7fd25315869cf0520d9dd813d407c58ff5c5508a (diff)
downloadchromium_src-9670691da1ff13fc4c0cd69fab4369b448f9019a.zip
chromium_src-9670691da1ff13fc4c0cd69fab4369b448f9019a.tar.gz
chromium_src-9670691da1ff13fc4c0cd69fab4369b448f9019a.tar.bz2
Removed the bool parameter from PipelineCallback and cleaned up WebMediaPlayerImpl::Proxy.
This forces clients to check Pipeline::GetError() instead of using a simple true/false check for success. Also the bool parameter wasn't being used for Seek() and Stop() callbacks, further hinting at its removal. BUG=16009 TEST=media_unittests pass, layout tests pass Review URL: http://codereview.chromium.org/149584 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20738 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/pipeline_impl_unittest.cc')
-rw-r--r--media/base/pipeline_impl_unittest.cc34
1 files changed, 17 insertions, 17 deletions
diff --git a/media/base/pipeline_impl_unittest.cc b/media/base/pipeline_impl_unittest.cc
index 12cb40c..b673cfb 100644
--- a/media/base/pipeline_impl_unittest.cc
+++ b/media/base/pipeline_impl_unittest.cc
@@ -27,9 +27,9 @@ class CallbackHelper {
CallbackHelper() {}
virtual ~CallbackHelper() {}
- MOCK_METHOD1(OnStart, void(bool result));
- MOCK_METHOD1(OnSeek, void(bool result));
- MOCK_METHOD1(OnStop, void(bool result));
+ MOCK_METHOD0(OnStart, void());
+ MOCK_METHOD0(OnSeek, void());
+ MOCK_METHOD0(OnStop, void());
private:
DISALLOW_COPY_AND_ASSIGN(CallbackHelper);
@@ -54,7 +54,7 @@ class PipelineImplTest : public ::testing::Test {
}
// Expect a stop callback if we were started.
- EXPECT_CALL(callbacks_, OnStop(true));
+ EXPECT_CALL(callbacks_, OnStop());
pipeline_.Stop(NewCallback(reinterpret_cast<CallbackHelper*>(&callbacks_),
&CallbackHelper::OnStop));
message_loop_.RunAllPending();
@@ -127,10 +127,10 @@ class PipelineImplTest : public ::testing::Test {
}
// Sets up expectations on the callback and initializes the pipeline. Called
- // afters tests have set expectations any filters they wish to use.
- void InitializePipeline(bool callback_result) {
+ // after tests have set expectations any filters they wish to use.
+ void InitializePipeline() {
// Expect an initialization callback.
- EXPECT_CALL(callbacks_, OnStart(callback_result));
+ EXPECT_CALL(callbacks_, OnStart());
pipeline_.Start(mocks_, "",
NewCallback(reinterpret_cast<CallbackHelper*>(&callbacks_),
&CallbackHelper::OnStart));
@@ -220,13 +220,13 @@ TEST_F(PipelineImplTest, NeverInitializes) {
// verify that nothing has been called, then set our expectation for the call
// made during tear down.
Mock::VerifyAndClear(&callbacks_);
- EXPECT_CALL(callbacks_, OnStart(false));
+ EXPECT_CALL(callbacks_, OnStart());
}
TEST_F(PipelineImplTest, RequiredFilterMissing) {
mocks_->set_creation_successful(false);
- InitializePipeline(false);
+ InitializePipeline();
EXPECT_FALSE(pipeline_.IsInitialized());
EXPECT_EQ(PIPELINE_ERROR_REQUIRED_FILTER_MISSING,
pipeline_.GetError());
@@ -239,7 +239,7 @@ TEST_F(PipelineImplTest, URLNotFound) {
Return(false)));
EXPECT_CALL(*mocks_->data_source(), Stop());
- InitializePipeline(false);
+ InitializePipeline();
EXPECT_FALSE(pipeline_.IsInitialized());
EXPECT_EQ(PIPELINE_ERROR_URL_NOT_FOUND, pipeline_.GetError());
}
@@ -259,7 +259,7 @@ TEST_F(PipelineImplTest, NoStreams) {
.WillRepeatedly(Return(0));
EXPECT_CALL(*mocks_->demuxer(), Stop());
- InitializePipeline(false);
+ InitializePipeline();
EXPECT_FALSE(pipeline_.IsInitialized());
EXPECT_EQ(PIPELINE_ERROR_COULD_NOT_RENDER, pipeline_.GetError());
}
@@ -275,7 +275,7 @@ TEST_F(PipelineImplTest, AudioStream) {
InitializeAudioDecoder(stream);
InitializeAudioRenderer();
- InitializePipeline(true);
+ InitializePipeline();
EXPECT_TRUE(pipeline_.IsInitialized());
EXPECT_EQ(PIPELINE_OK, pipeline_.GetError());
EXPECT_TRUE(pipeline_.IsRendered(media::mime_type::kMajorTypeAudio));
@@ -293,7 +293,7 @@ TEST_F(PipelineImplTest, VideoStream) {
InitializeVideoDecoder(stream);
InitializeVideoRenderer();
- InitializePipeline(true);
+ InitializePipeline();
EXPECT_TRUE(pipeline_.IsInitialized());
EXPECT_EQ(PIPELINE_OK, pipeline_.GetError());
EXPECT_FALSE(pipeline_.IsRendered(media::mime_type::kMajorTypeAudio));
@@ -316,7 +316,7 @@ TEST_F(PipelineImplTest, AudioVideoStream) {
InitializeVideoDecoder(video_stream);
InitializeVideoRenderer();
- InitializePipeline(true);
+ InitializePipeline();
EXPECT_TRUE(pipeline_.IsInitialized());
EXPECT_EQ(PIPELINE_OK, pipeline_.GetError());
EXPECT_TRUE(pipeline_.IsRendered(media::mime_type::kMajorTypeAudio));
@@ -349,10 +349,10 @@ TEST_F(PipelineImplTest, Seek) {
EXPECT_CALL(*mocks_->video_renderer(), Seek(expected));
// We expect a successful seek callback.
- EXPECT_CALL(callbacks_, OnSeek(true));
+ EXPECT_CALL(callbacks_, OnSeek());
// Initialize then seek!
- InitializePipeline(true);
+ InitializePipeline();
pipeline_.Seek(expected,
NewCallback(reinterpret_cast<CallbackHelper*>(&callbacks_),
&CallbackHelper::OnSeek));
@@ -375,7 +375,7 @@ TEST_F(PipelineImplTest, SetVolume) {
EXPECT_CALL(*mocks_->audio_renderer(), SetVolume(expected));
// Initialize then set volume!
- InitializePipeline(true);
+ InitializePipeline();
pipeline_.SetVolume(expected);
}