diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-09 22:30:27 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-09 22:30:27 +0000 |
commit | 5fc01a15de4f465bb193a0ea7eae5077835e2bfa (patch) | |
tree | c3daffcb82c2721272e524d9d0bc47ca1864bec0 /media/base | |
parent | c9567302bad6b2c15bc683c99b698fad5660e6aa (diff) | |
download | chromium_src-5fc01a15de4f465bb193a0ea7eae5077835e2bfa.zip chromium_src-5fc01a15de4f465bb193a0ea7eae5077835e2bfa.tar.gz chromium_src-5fc01a15de4f465bb193a0ea7eae5077835e2bfa.tar.bz2 |
Manually declare media_format() because gmock does not like mocking non-copyable const references.
TEST=media_unittests should pass
BUG=16008
Review URL: http://codereview.chromium.org/155316
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20328 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base')
-rw-r--r-- | media/base/mock_filters.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/media/base/mock_filters.h b/media/base/mock_filters.h index 07bb34e..bef46a7 100644 --- a/media/base/mock_filters.h +++ b/media/base/mock_filters.h @@ -30,7 +30,7 @@ class MockDataSource : public DataSource { // DataSource implementation. MOCK_METHOD1(Initialize, bool(const std::string& url)); - MOCK_METHOD0(media_format, const MediaFormat&()); + const MediaFormat& media_format() { return media_format_; } MOCK_METHOD2(Read, size_t(uint8* data, size_t size)); MOCK_METHOD1(GetPosition, bool(int64* position_out)); MOCK_METHOD1(SetPosition, bool(int64 position)); @@ -41,6 +41,8 @@ class MockDataSource : public DataSource { virtual ~MockDataSource() {} private: + MediaFormat media_format_; + DISALLOW_COPY_AND_ASSIGN(MockDataSource); }; @@ -70,7 +72,7 @@ class MockDemuxerStream : public DemuxerStream { MockDemuxerStream() {} // DemuxerStream implementation. - MOCK_METHOD0(media_format, const MediaFormat&()); + const MediaFormat& media_format() { return media_format_; } MOCK_METHOD1(Read, void(Callback1<Buffer*>::Type* read_callback)); MOCK_METHOD1(QueryInterface, void*(const char* interface_id)); @@ -78,6 +80,8 @@ class MockDemuxerStream : public DemuxerStream { virtual ~MockDemuxerStream() {} private: + MediaFormat media_format_; + DISALLOW_COPY_AND_ASSIGN(MockDemuxerStream); }; @@ -92,13 +96,15 @@ class MockVideoDecoder : public VideoDecoder { // VideoDecoder implementation. MOCK_METHOD1(Initialize, bool(DemuxerStream* demuxer_stream)); - MOCK_METHOD0(media_format, const MediaFormat&()); + const MediaFormat& media_format() { return media_format_; } MOCK_METHOD1(Read, void(Callback1<VideoFrame*>::Type* read_callback)); protected: virtual ~MockVideoDecoder() {} private: + MediaFormat media_format_; + DISALLOW_COPY_AND_ASSIGN(MockVideoDecoder); }; @@ -113,13 +119,15 @@ class MockAudioDecoder : public AudioDecoder { // AudioDecoder implementation. MOCK_METHOD1(Initialize, bool(DemuxerStream* demuxer_stream)); - MOCK_METHOD0(media_format, const MediaFormat&()); + const MediaFormat& media_format() { return media_format_; } MOCK_METHOD1(Read, void(Callback1<Buffer*>::Type* read_callback)); protected: virtual ~MockAudioDecoder() {} private: + MediaFormat media_format_; + DISALLOW_COPY_AND_ASSIGN(MockAudioDecoder); }; |