Commit c13ad6e2 authored by scherkus's avatar scherkus Committed by Commit bot

Replace the only use of media::MockStatisticsCB with a bound method.

No need to keep useless helper mocks around. This also helps clean up
VideoRendererImpl's unit tests in preparation for switching to the
scheduler.

Review URL: https://codereview.chromium.org/566853006

Cr-Commit-Position: refs/heads/master@{#294704}
parent 9bb65868
......@@ -94,8 +94,4 @@ MockDecryptor::MockDecryptor() {}
MockDecryptor::~MockDecryptor() {}
MockStatisticsCB::MockStatisticsCB() {}
MockStatisticsCB::~MockStatisticsCB() {}
} // namespace media
......@@ -240,15 +240,6 @@ class MockDecryptor : public Decryptor {
DISALLOW_COPY_AND_ASSIGN(MockDecryptor);
};
// Helper mock statistics callback.
class MockStatisticsCB {
public:
MockStatisticsCB();
~MockStatisticsCB();
MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics));
};
} // namespace media
#endif // MEDIA_BASE_MOCK_FILTERS_H_
......@@ -65,8 +65,6 @@ class VideoRendererImplTest : public ::testing::Test {
EXPECT_CALL(demuxer_stream_, Read(_)).WillRepeatedly(
RunCallback<0>(DemuxerStream::kOk,
scoped_refptr<DecoderBuffer>(new DecoderBuffer(0))));
EXPECT_CALL(statistics_cb_object_, OnStatistics(_))
.Times(AnyNumber());
}
virtual ~VideoRendererImplTest() {}
......@@ -103,8 +101,8 @@ class VideoRendererImplTest : public ::testing::Test {
&demuxer_stream_,
low_delay,
status_cb,
base::Bind(&MockStatisticsCB::OnStatistics,
base::Unretained(&statistics_cb_object_)),
base::Bind(&VideoRendererImplTest::OnStatisticsUpdate,
base::Unretained(this)),
base::Bind(&StrictMock<MockCB>::BufferingStateChange,
base::Unretained(&mock_cb_)),
ended_event_.GetClosure(),
......@@ -251,7 +249,6 @@ class VideoRendererImplTest : public ::testing::Test {
scoped_ptr<VideoRendererImpl> renderer_;
MockVideoDecoder* decoder_; // Owned by |renderer_|.
NiceMock<MockDemuxerStream> demuxer_stream_;
MockStatisticsCB statistics_cb_object_;
// Use StrictMock<T> to catch missing/extra callbacks.
class MockCB {
......@@ -294,6 +291,8 @@ class VideoRendererImplTest : public ::testing::Test {
message_loop_.PostTask(FROM_HERE, callback);
}
void OnStatisticsUpdate(const PipelineStatistics& stats) {}
base::MessageLoop message_loop_;
// Used to protect |time_|.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment