summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorfischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-30 15:09:52 +0000
committerfischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-30 15:09:52 +0000
commit08a77cd3d169e297cf1c13670821600867aa5043 (patch)
tree59ff22fe83ebb2460c4d1e20460823fae1c45963 /media
parent95a33ed6cb8688573249f7cd7032d23518879c6d (diff)
downloadchromium_src-08a77cd3d169e297cf1c13670821600867aa5043.zip
chromium_src-08a77cd3d169e297cf1c13670821600867aa5043.tar.gz
chromium_src-08a77cd3d169e297cf1c13670821600867aa5043.tar.bz2
Follow-up cleanup promised during r103376's CR.
- mock_task.{h,cc} is gone. - MockCallback is now MockClosure, and its commentary brought up to date (the commentary checked in was a mix of old and attempt-at-new that never materialized) - NewExpectedCallback is NewExpectedClosure. A bit of background on FooCallback vs. FooCB: when acolwell@ & I did the first conversions to the new world, everything was named FooCallback. I proposed using FooCB for the migrated ones as a way to both easily visually differentiate as well as save characters (!). Now that we have an additional "don't typedef Closures" guideline I like having FooCB for non-closure new-style callbacks, and FooClosure for new-style closures. BUG=none TEST=trybots Review URL: http://codereview.chromium.org/8085017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103464 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r--media/base/composite_filter_unittest.cc54
-rw-r--r--media/base/mock_callback.cc10
-rw-r--r--media/base/mock_callback.h16
-rw-r--r--media/base/mock_task.cc22
-rw-r--r--media/base/mock_task.h103
-rw-r--r--media/filters/audio_renderer_base_unittest.cc10
-rw-r--r--media/filters/ffmpeg_audio_decoder_unittest.cc6
-rw-r--r--media/filters/ffmpeg_demuxer_unittest.cc6
-rw-r--r--media/filters/ffmpeg_video_decoder_unittest.cc11
-rw-r--r--media/filters/file_data_source_unittest.cc6
-rw-r--r--media/filters/video_renderer_base_unittest.cc20
-rw-r--r--media/media.gyp2
-rw-r--r--media/video/ffmpeg_video_decode_engine_unittest.cc1
13 files changed, 69 insertions, 198 deletions
diff --git a/media/base/composite_filter_unittest.cc b/media/base/composite_filter_unittest.cc
index 52b80db..23b7f56 100644
--- a/media/base/composite_filter_unittest.cc
+++ b/media/base/composite_filter_unittest.cc
@@ -260,9 +260,9 @@ void CompositeFilterTest::ExpectSuccess(MethodToCall method_to_call,
}
// Make method call on the composite.
- StrictMock<MockCallback>* callback = new StrictMock<MockCallback>();
+ StrictMock<MockClosure>* callback = new StrictMock<MockClosure>();
DoFilterCall(method_to_call, composite_.get(), seek_time,
- base::Bind(&MockCallback::Run, callback),
+ base::Bind(&MockClosure::Run, callback),
PIPELINE_OK);
if (is_parallel_call) {
@@ -318,7 +318,7 @@ void CompositeFilterTest::ExpectInvalidStateFail(MethodToCall method_to_call,
.WillOnce(Return());
}
- DoFilterCall(method_to_call, composite_, seek_time, NewExpectedCallback(),
+ DoFilterCall(method_to_call, composite_, seek_time, NewExpectedClosure(),
PIPELINE_ERROR_INVALID_STATE);
// Make sure that neither of the filters were called by
@@ -405,7 +405,7 @@ TEST_F(CompositeFilterTest, TestPlay) {
// Try calling Play() again to make sure that we simply get a callback.
// We are already in the Play() state so there is no point calling the
// filters.
- composite_->Play(NewExpectedCallback());
+ composite_->Play(NewExpectedClosure());
// Verify that neither of the filter callbacks were set.
EXPECT_FALSE(HasFilter1Callback());
@@ -417,7 +417,7 @@ TEST_F(CompositeFilterTest, TestPlay) {
// At this point we should be in the kStopped state.
// Try calling Stop() again to make sure neither filter is called.
- composite_->Stop(NewExpectedCallback());
+ composite_->Stop(NewExpectedClosure());
// Verify that neither of the filter callbacks were set.
EXPECT_FALSE(HasFilter1Callback());
@@ -436,8 +436,8 @@ TEST_F(CompositeFilterTest, TestPlayErrors) {
EXPECT_CALL(*filter_1_, Play(_));
// Call Play() on the composite.
- StrictMock<MockCallback>* callback = new StrictMock<MockCallback>();
- composite_->Play(base::Bind(&MockCallback::Run, callback));
+ StrictMock<MockClosure>* callback = new StrictMock<MockClosure>();
+ composite_->Play(base::Bind(&MockClosure::Run, callback));
EXPECT_CALL(*filter_2_, Play(_));
@@ -484,7 +484,7 @@ TEST_F(CompositeFilterTest, TestPause) {
// Try calling Pause() again to make sure that the filters aren't called
// because we are already in the paused state.
- composite_->Pause(NewExpectedCallback());
+ composite_->Pause(NewExpectedClosure());
// Verify that neither of the filter callbacks were set.
EXPECT_FALSE(HasFilter1Callback());
@@ -515,8 +515,8 @@ TEST_F(CompositeFilterTest, TestPauseErrors) {
EXPECT_CALL(*filter_1_, Pause(_));
// Call Pause() on the composite.
- StrictMock<MockCallback>* callback = new StrictMock<MockCallback>();
- composite_->Pause(base::Bind(&MockCallback::Run, callback));
+ StrictMock<MockClosure>* callback = new StrictMock<MockClosure>();
+ composite_->Pause(base::Bind(&MockClosure::Run, callback));
// Simulate an error by calling SetError() on |filter_1_|'s FilterHost
// interface.
@@ -582,8 +582,8 @@ TEST_F(CompositeFilterTest, TestFlushErrors) {
EXPECT_CALL(*filter_2_, Flush(_));
// Call Flush() on the composite.
- StrictMock<MockCallback>* callback = new StrictMock<MockCallback>();
- composite_->Flush(base::Bind(&MockCallback::Run, callback));
+ StrictMock<MockClosure>* callback = new StrictMock<MockClosure>();
+ composite_->Flush(base::Bind(&MockClosure::Run, callback));
// Simulate an error by calling SetError() on |filter_1_|'s FilterHost
// interface.
@@ -649,8 +649,8 @@ TEST_F(CompositeFilterTest, TestStop) {
EXPECT_CALL(*filter_1_, Stop(_));
- StrictMock<MockCallback>* callback = new StrictMock<MockCallback>();
- composite_->Stop(base::Bind(&MockCallback::Run, callback));
+ StrictMock<MockClosure>* callback = new StrictMock<MockClosure>();
+ composite_->Stop(base::Bind(&MockClosure::Run, callback));
// Have |filter_1_| signal an error.
filter_1_->host()->SetError(PIPELINE_ERROR_READ);
@@ -672,13 +672,13 @@ TEST_F(CompositeFilterTest, TestStopWhilePlayPending) {
EXPECT_CALL(*filter_1_, Play(_));
- StrictMock<MockCallback>* callback = new StrictMock<MockCallback>();
- composite_->Play(base::Bind(&MockCallback::Run, callback));
+ StrictMock<MockClosure>* callback = new StrictMock<MockClosure>();
+ composite_->Play(base::Bind(&MockClosure::Run, callback));
// Note: Play() is pending on |filter_1_| right now.
- callback = new StrictMock<MockCallback>();
- composite_->Stop(base::Bind(&MockCallback::Run, callback));
+ callback = new StrictMock<MockClosure>();
+ composite_->Stop(base::Bind(&MockClosure::Run, callback));
EXPECT_CALL(*filter_1_, Stop(_));
@@ -705,13 +705,13 @@ TEST_F(CompositeFilterTest, TestStopWhileFlushPending) {
EXPECT_CALL(*filter_1_, Flush(_));
EXPECT_CALL(*filter_2_, Flush(_));
- StrictMock<MockCallback>* callback = new StrictMock<MockCallback>();
- composite_->Flush(base::Bind(&MockCallback::Run, callback));
+ StrictMock<MockClosure>* callback = new StrictMock<MockClosure>();
+ composite_->Flush(base::Bind(&MockClosure::Run, callback));
// Note: |filter_1_| and |filter_2_| have pending Flush() calls at this point.
- callback = new StrictMock<MockCallback>();
- composite_->Stop(base::Bind(&MockCallback::Run, callback));
+ callback = new StrictMock<MockClosure>();
+ composite_->Stop(base::Bind(&MockClosure::Run, callback));
// Run callback to indicate that |filter_1_|'s Flush() has completed.
RunFilter1Callback();
@@ -769,23 +769,23 @@ TEST_F(CompositeFilterTest, TestEmptyComposite) {
composite_->set_host(mock_filter_host_.get());
// Issue a Play() and expect no errors.
- composite_->Play(NewExpectedCallback());
+ composite_->Play(NewExpectedClosure());
// Issue a Pause() and expect no errors.
- composite_->Pause(NewExpectedCallback());
+ composite_->Pause(NewExpectedClosure());
// Issue a Flush() and expect no errors.
- composite_->Flush(NewExpectedCallback());
+ composite_->Flush(NewExpectedClosure());
// Issue a Seek() and expect no errors.
composite_->Seek(base::TimeDelta::FromSeconds(5),
NewExpectedStatusCB(PIPELINE_OK));
// Issue a Play() and expect no errors.
- composite_->Play(NewExpectedCallback());
+ composite_->Play(NewExpectedClosure());
// Issue a Stop() and expect no errors.
- composite_->Stop(NewExpectedCallback());
+ composite_->Stop(NewExpectedClosure());
}
} // namespace media
diff --git a/media/base/mock_callback.cc b/media/base/mock_callback.cc
index fe991f8..58cc98e 100644
--- a/media/base/mock_callback.cc
+++ b/media/base/mock_callback.cc
@@ -11,13 +11,13 @@ using ::testing::StrictMock;
namespace media {
-MockCallback::MockCallback() {}
-MockCallback::~MockCallback() {}
+MockClosure::MockClosure() {}
+MockClosure::~MockClosure() {}
-base::Closure NewExpectedCallback() {
- StrictMock<MockCallback>* callback = new StrictMock<MockCallback>();
+base::Closure NewExpectedClosure() {
+ StrictMock<MockClosure>* callback = new StrictMock<MockClosure>();
EXPECT_CALL(*callback, Run());
- return base::Bind(&MockCallback::Run, callback);
+ return base::Bind(&MockClosure::Run, callback);
}
class MockStatusCB : public base::RefCountedThreadSafe<MockStatusCB> {
diff --git a/media/base/mock_callback.h b/media/base/mock_callback.h
index adee5c6..6d50844 100644
--- a/media/base/mock_callback.h
+++ b/media/base/mock_callback.h
@@ -11,20 +11,20 @@
namespace media {
-// Utility class that presents a base::Closure interface (through as_closure())
-// and the ability to set a gMock expectation of being called (through
-// ExpectCall).
-class MockCallback : public base::RefCountedThreadSafe<MockCallback> {
+// Utility mock for testing methods expecting Closures. See
+// NewExpectedClosure() below for a helper suitable when expectation order is
+// not checked (or when the expectation can be set at mock construction time).
+class MockClosure : public base::RefCountedThreadSafe<MockClosure> {
public:
- MockCallback();
- virtual ~MockCallback();
+ MockClosure();
+ virtual ~MockClosure();
MOCK_METHOD0(Run, void());
private:
- DISALLOW_COPY_AND_ASSIGN(MockCallback);
+ DISALLOW_COPY_AND_ASSIGN(MockClosure);
};
// Return a callback that expects to be run once.
-base::Closure NewExpectedCallback();
+base::Closure NewExpectedClosure();
base::Callback<void(PipelineStatus)> NewExpectedStatusCB(PipelineStatus status);
} // namespace media
diff --git a/media/base/mock_task.cc b/media/base/mock_task.cc
deleted file mode 100644
index f9f8823..0000000
--- a/media/base/mock_task.cc
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "media/base/mock_task.h"
-
-namespace media {
-
-TaskMocker::TaskMocker()
- : outstanding_tasks_(0) {
-}
-
-TaskMocker::~TaskMocker() {
- CHECK(outstanding_tasks_ == 0)
- << "If outstanding_tasks_ is not zero, tasks have been leaked.";
-}
-
-Task* TaskMocker::CreateTask() {
- return new CountingTask(this);
-}
-
-} // namespace media
diff --git a/media/base/mock_task.h b/media/base/mock_task.h
deleted file mode 100644
index 53b66b7..0000000
--- a/media/base/mock_task.h
+++ /dev/null
@@ -1,103 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// This file provides some utility classes that help with testing APIs which use
-// callbacks.
-//
-// -- InvokeRunnable --
-// The InvokeRunnable is an action that can be used a gMock mock object to
-// invoke the Run() method on mock argument. Example:
-//
-// class MockFoo : public Foo {
-// public:
-// MOCK_METHOD0(DoSomething, void(Task* done_cb));
-// };
-//
-// EXPECT_CALL(foo, DoSomething(_)).WillOnce(WithArg<0>(InvokeRunnable()));
-//
-// Then you pass "foo" to something that will eventually call DoSomething().
-// The mock action will ensure that passed in done_cb is invoked.
-//
-//
-// -- TaskMocker --
-// The TaskMocker class lets you create mock callbacks. Callbacks are
-// difficult to mock because ownership of the callback object is often passed
-// to the funciton being invoked. TaskMocker solves this by providing a
-// GetTask() function that creates a new, single-use task that delegates to
-// the originating TaskMocker object. Expectations are placed on the
-// originating TaskMocker object. Each callback retrieved by GetTask() is
-// tracked to ensure that it is properly deleted. The TaskMocker expects to
-// outlive all the callbacks retrieved by GetTask().
-//
-// Example:
-//
-// TaskMocker done_cb;
-// EXPECT_CALL(done_cb, Run()).Times(3);
-//
-// func1(done_cb.GetTask());
-// func2(done_cb.GetTask());
-// func3(done_cb.GetTask());
-//
-// // All 3 callbacks from GetTask() should be deleted before done_cb goes out
-// // of scope.
-//
-// This class is not threadsafe.
-//
-// TODO(ajwong): Is it even worth bothering with gmock here?
-// TODO(ajwong): Move MockCallback here and merge the implementation
-// differences.
-
-#ifndef MEDIA_BASE_MOCK_TASK_H_
-#define MEDIA_BASE_MOCK_TASK_H_
-
-#include "base/task.h"
-#include "testing/gmock/include/gmock/gmock.h"
-
-namespace media {
-
-ACTION(InvokeRunnable) {
- arg0->Run();
- delete arg0;
-}
-
-class TaskMocker {
- public:
- TaskMocker();
- ~TaskMocker();
-
- Task* CreateTask();
-
- MOCK_METHOD0(Run, void());
-
- private:
- friend class CountingTask;
- class CountingTask : public Task {
- public:
- CountingTask(TaskMocker* origin)
- : origin_(origin) {
- origin_->outstanding_tasks_++;
- }
-
- virtual void Run() {
- origin_->Run();
- }
-
- virtual ~CountingTask() {
- origin_->outstanding_tasks_--;
- }
-
- private:
- TaskMocker* origin_;
-
- DISALLOW_COPY_AND_ASSIGN(CountingTask);
- };
-
- int outstanding_tasks_;
-
- DISALLOW_COPY_AND_ASSIGN(TaskMocker);
-};
-
-} // namespace media
-
-#endif //MEDIA_BASE_MOCK_TASK_H_
diff --git a/media/filters/audio_renderer_base_unittest.cc b/media/filters/audio_renderer_base_unittest.cc
index 7c1e6c9..cfa0850 100644
--- a/media/filters/audio_renderer_base_unittest.cc
+++ b/media/filters/audio_renderer_base_unittest.cc
@@ -68,7 +68,7 @@ class AudioRendererBaseTest : public ::testing::Test {
virtual ~AudioRendererBaseTest() {
// Expect a call into the subclass.
EXPECT_CALL(*renderer_, OnStop());
- renderer_->Stop(NewExpectedCallback());
+ renderer_->Stop(NewExpectedClosure());
}
protected:
@@ -103,7 +103,7 @@ TEST_F(AudioRendererBaseTest, Initialize_Failed) {
EXPECT_CALL(host_, SetError(PIPELINE_ERROR_INITIALIZATION_FAILED));
// Initialize, we expect to have no reads.
- renderer_->Initialize(decoder_, NewExpectedCallback());
+ renderer_->Initialize(decoder_, NewExpectedClosure());
EXPECT_EQ(0u, pending_reads_);
}
@@ -115,7 +115,7 @@ TEST_F(AudioRendererBaseTest, Initialize_Successful) {
.WillOnce(Return(true));
// Initialize, we shouldn't have any reads.
- renderer_->Initialize(decoder_, NewExpectedCallback());
+ renderer_->Initialize(decoder_, NewExpectedClosure());
EXPECT_EQ(0u, pending_reads_);
// Now seek to trigger prerolling, verifying the callback hasn't been
@@ -143,7 +143,7 @@ TEST_F(AudioRendererBaseTest, OneCompleteReadCycle) {
.WillOnce(Return(true));
// Initialize, we shouldn't have any reads.
- renderer_->Initialize(decoder_, NewExpectedCallback());
+ renderer_->Initialize(decoder_, NewExpectedClosure());
EXPECT_EQ(0u, pending_reads_);
// Now seek to trigger prerolling, verifying the callback hasn't been
@@ -166,7 +166,7 @@ TEST_F(AudioRendererBaseTest, OneCompleteReadCycle) {
}
// Then set the renderer to play state.
- renderer_->Play(NewExpectedCallback());
+ renderer_->Play(NewExpectedClosure());
renderer_->SetPlaybackRate(1.0f);
EXPECT_EQ(1.0f, renderer_->GetPlaybackRate());
diff --git a/media/filters/ffmpeg_audio_decoder_unittest.cc b/media/filters/ffmpeg_audio_decoder_unittest.cc
index a365be9..0e67c63 100644
--- a/media/filters/ffmpeg_audio_decoder_unittest.cc
+++ b/media/filters/ffmpeg_audio_decoder_unittest.cc
@@ -73,7 +73,7 @@ class FFmpegAudioDecoderTest : public testing::Test {
.WillOnce(ReturnRef(config_));
decoder_->Initialize(demuxer_,
- NewExpectedCallback(),
+ NewExpectedClosure(),
base::Bind(&MockStatisticsCallback::OnStatistics,
base::Unretained(&statistics_callback_)));
@@ -81,7 +81,7 @@ class FFmpegAudioDecoderTest : public testing::Test {
}
void Stop() {
- decoder_->Stop(NewExpectedCallback());
+ decoder_->Stop(NewExpectedClosure());
message_loop_.RunAllPending();
}
@@ -138,7 +138,7 @@ TEST_F(FFmpegAudioDecoderTest, Initialize) {
TEST_F(FFmpegAudioDecoderTest, Flush) {
Initialize();
- decoder_->Flush(NewExpectedCallback());
+ decoder_->Flush(NewExpectedClosure());
message_loop_.RunAllPending();
Stop();
diff --git a/media/filters/ffmpeg_demuxer_unittest.cc b/media/filters/ffmpeg_demuxer_unittest.cc
index 34e3802..04fd6f3 100644
--- a/media/filters/ffmpeg_demuxer_unittest.cc
+++ b/media/filters/ffmpeg_demuxer_unittest.cc
@@ -52,7 +52,7 @@ class FFmpegDemuxerTest : public testing::Test {
virtual ~FFmpegDemuxerTest() {
// Call Stop() to shut down internal threads.
- demuxer_->Stop(NewExpectedCallback());
+ demuxer_->Stop(NewExpectedClosure());
// Finish up any remaining tasks.
message_loop_.RunAllPending();
@@ -388,7 +388,7 @@ TEST_F(FFmpegDemuxerTest, Stop) {
demuxer_->GetStream(DemuxerStream::AUDIO);
ASSERT_TRUE(audio);
- demuxer_->Stop(NewExpectedCallback());
+ demuxer_->Stop(NewExpectedClosure());
// Expect all calls in sequence.
InSequence s;
@@ -520,7 +520,7 @@ TEST_F(FFmpegDemuxerTest, ProtocolRead) {
// This read complete signal is generated when demuxer is stopped.
EXPECT_CALL(*demuxer, SignalReadCompleted(DataSource::kReadError));
- demuxer->Stop(NewExpectedCallback());
+ demuxer->Stop(NewExpectedClosure());
message_loop_.RunAllPending();
}
diff --git a/media/filters/ffmpeg_video_decoder_unittest.cc b/media/filters/ffmpeg_video_decoder_unittest.cc
index 8938fd3..23d14f7 100644
--- a/media/filters/ffmpeg_video_decoder_unittest.cc
+++ b/media/filters/ffmpeg_video_decoder_unittest.cc
@@ -13,7 +13,6 @@
#include "media/base/mock_callback.h"
#include "media/base/mock_filter_host.h"
#include "media/base/mock_filters.h"
-#include "media/base/mock_task.h"
#include "media/base/video_frame.h"
#include "media/ffmpeg/ffmpeg_common.h"
#include "media/filters/ffmpeg_video_decoder.h"
@@ -168,7 +167,7 @@ class FFmpegVideoDecoderTest : public testing::Test {
.WillOnce(EngineUninitialize(engine_));
}
- decoder_->Stop(NewExpectedCallback());
+ decoder_->Stop(NewExpectedClosure());
// Finish up any remaining tasks.
message_loop_.RunAllPending();
@@ -183,7 +182,7 @@ class FFmpegVideoDecoderTest : public testing::Test {
.WillOnce(EngineInitialize(engine_, true));
decoder_->Initialize(demuxer_,
- NewExpectedCallback(), NewStatisticsCallback());
+ NewExpectedClosure(), NewStatisticsCallback());
message_loop_.RunAllPending();
}
@@ -221,7 +220,7 @@ TEST_F(FFmpegVideoDecoderTest, Initialize_GetAVStreamFails) {
EXPECT_CALL(host_, SetError(PIPELINE_ERROR_DECODE));
decoder_->Initialize(demuxer_,
- NewExpectedCallback(), NewStatisticsCallback());
+ NewExpectedClosure(), NewStatisticsCallback());
message_loop_.RunAllPending();
}
@@ -237,7 +236,7 @@ TEST_F(FFmpegVideoDecoderTest, Initialize_EngineFails) {
EXPECT_CALL(host_, SetError(PIPELINE_ERROR_DECODE));
decoder_->Initialize(demuxer_,
- NewExpectedCallback(), NewStatisticsCallback());
+ NewExpectedClosure(), NewStatisticsCallback());
message_loop_.RunAllPending();
}
@@ -403,7 +402,7 @@ TEST_F(FFmpegVideoDecoderTest, DoSeek) {
// Expect a flush.
EXPECT_CALL(*engine_, Flush())
.WillOnce(EngineFlush(engine_));
- decoder_->Flush(NewExpectedCallback());
+ decoder_->Flush(NewExpectedClosure());
// Expect Seek and verify the results.
EXPECT_CALL(*engine_, Seek())
diff --git a/media/filters/file_data_source_unittest.cc b/media/filters/file_data_source_unittest.cc
index ee4dfc0..9d781a3 100644
--- a/media/filters/file_data_source_unittest.cc
+++ b/media/filters/file_data_source_unittest.cc
@@ -59,7 +59,7 @@ TEST(FileDataSourceTest, OpenFile) {
filter->set_host(&host);
EXPECT_EQ(PIPELINE_OK, filter->Initialize(TestFileURL()));
- filter->Stop(NewExpectedCallback());
+ filter->Stop(NewExpectedClosure());
}
// Use the mock filter host to directly call the Read and GetPosition methods.
@@ -94,7 +94,7 @@ TEST(FileDataSourceTest, ReadData) {
&ReadCallbackHandler::ReadCallback, base::Unretained(&handler)));
EXPECT_EQ('5', ten_bytes[0]);
- filter->Stop(NewExpectedCallback());
+ filter->Stop(NewExpectedClosure());
}
// Test that FileDataSource does nothing on Seek().
@@ -104,7 +104,7 @@ TEST(FileDataSourceTest, Seek) {
scoped_refptr<FileDataSource> filter(new FileDataSource());
filter->Seek(kZero, NewExpectedStatusCB(PIPELINE_OK));
- filter->Stop(NewExpectedCallback());
+ filter->Stop(NewExpectedClosure());
}
} // namespace media
diff --git a/media/filters/video_renderer_base_unittest.cc b/media/filters/video_renderer_base_unittest.cc
index 71db8e2..c2b3423 100644
--- a/media/filters/video_renderer_base_unittest.cc
+++ b/media/filters/video_renderer_base_unittest.cc
@@ -73,7 +73,7 @@ class VideoRendererBaseTest : public ::testing::Test {
.WillOnce(DoAll(OnStop(), Return()))
.RetiresOnSaturation();
- renderer_->Stop(NewExpectedCallback());
+ renderer_->Stop(NewExpectedClosure());
}
}
@@ -99,7 +99,7 @@ class VideoRendererBaseTest : public ::testing::Test {
// Initialize, we shouldn't have any reads.
renderer_->Initialize(decoder_,
- NewExpectedCallback(), NewStatisticsCallback());
+ NewExpectedClosure(), NewStatisticsCallback());
EXPECT_EQ(0u, read_queue_.size());
// Now seek to trigger prerolling.
@@ -135,9 +135,9 @@ class VideoRendererBaseTest : public ::testing::Test {
}
void Flush() {
- renderer_->Pause(NewExpectedCallback());
+ renderer_->Pause(NewExpectedClosure());
- renderer_->Flush(NewExpectedCallback());
+ renderer_->Flush(NewExpectedClosure());
}
void CreateError() {
@@ -214,7 +214,7 @@ TEST_F(VideoRendererBaseTest, Initialize_Failed) {
// Initialize, we expect to have no reads.
renderer_->Initialize(decoder_,
- NewExpectedCallback(), NewStatisticsCallback());
+ NewExpectedClosure(), NewStatisticsCallback());
EXPECT_EQ(0u, read_queue_.size());
}
@@ -227,13 +227,13 @@ TEST_F(VideoRendererBaseTest, Initialize_Successful) {
TEST_F(VideoRendererBaseTest, Play) {
Initialize();
- renderer_->Play(NewExpectedCallback());
+ renderer_->Play(NewExpectedClosure());
Flush();
}
TEST_F(VideoRendererBaseTest, Error_Playing) {
Initialize();
- renderer_->Play(NewExpectedCallback());
+ renderer_->Play(NewExpectedClosure());
EXPECT_CALL(host_, SetError(PIPELINE_ERROR_DECODE));
CreateError();
@@ -276,7 +276,7 @@ TEST_F(VideoRendererBaseTest, Seek_RightAfter) {
// decoder error.
TEST_F(VideoRendererBaseTest, GetCurrentFrame_AfterError) {
Initialize();
- renderer_->Play(NewExpectedCallback());
+ renderer_->Play(NewExpectedClosure());
EXPECT_CALL(host_, SetError(PIPELINE_ERROR_DECODE));
CreateError();
@@ -291,7 +291,7 @@ TEST_F(VideoRendererBaseTest, GetCurrentFrame_AfterError) {
// of a paint operation.
TEST_F(VideoRendererBaseTest, Error_DuringPaint) {
Initialize();
- renderer_->Play(NewExpectedCallback());
+ renderer_->Play(NewExpectedClosure());
scoped_refptr<VideoFrame> frame;
renderer_->GetCurrentFrame(&frame);
@@ -318,7 +318,7 @@ TEST_F(VideoRendererBaseTest, GetCurrentFrame_AfterStop) {
.WillOnce(DoAll(OnStop(), Return()))
.RetiresOnSaturation();
- renderer_->Stop(NewExpectedCallback());
+ renderer_->Stop(NewExpectedClosure());
scoped_refptr<VideoFrame> frame;
renderer_->GetCurrentFrame(&frame);
diff --git a/media/media.gyp b/media/media.gyp
index 1d36fe7..598378b 100644
--- a/media/media.gyp
+++ b/media/media.gyp
@@ -555,8 +555,6 @@
'base/filter_collection_unittest.cc',
'base/h264_bitstream_converter_unittest.cc',
'base/mock_reader.h',
- 'base/mock_task.cc',
- 'base/mock_task.h',
'base/pipeline_impl_unittest.cc',
'base/pts_heap_unittest.cc',
'base/pts_stream_unittest.cc',
diff --git a/media/video/ffmpeg_video_decode_engine_unittest.cc b/media/video/ffmpeg_video_decode_engine_unittest.cc
index 8e171e1..4b46ee7 100644
--- a/media/video/ffmpeg_video_decode_engine_unittest.cc
+++ b/media/video/ffmpeg_video_decode_engine_unittest.cc
@@ -5,7 +5,6 @@
#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
#include "media/base/data_buffer.h"
-#include "media/base/mock_task.h"
#include "media/base/pipeline.h"
#include "media/base/test_data_util.h"
#include "media/filters/ffmpeg_glue.h"