OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <vector> | 5 #include <vector> |
6 | 6 |
7 #include "media/base/mock_filters.h" | 7 #include "media/base/mock_filters.h" |
8 #include "media/base/mock_task.h" | 8 #include "media/base/mock_task.h" |
9 #include "media/filters/decoder_base.h" | 9 #include "media/filters/decoder_base.h" |
10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 class MockDecoderImpl : public media::DecoderBase< | 61 class MockDecoderImpl : public media::DecoderBase< |
62 MockDecoder, MockDecoderOutput> { | 62 MockDecoder, MockDecoderOutput> { |
63 public: | 63 public: |
64 MockDecoderImpl() { | 64 MockDecoderImpl() { |
65 media_format_.SetAsString(media::MediaFormat::kMimeType, "mock"); | 65 media_format_.SetAsString(media::MediaFormat::kMimeType, "mock"); |
66 } | 66 } |
67 | 67 |
68 virtual ~MockDecoderImpl() {} | 68 virtual ~MockDecoderImpl() {} |
69 | 69 |
| 70 virtual media::FilterType filter_type() const { |
| 71 return media::FILTER_VIDEO_DECODER; |
| 72 } |
| 73 |
70 // DecoderBase Implementations. | 74 // DecoderBase Implementations. |
71 MOCK_METHOD3(DoInitialize, | 75 MOCK_METHOD3(DoInitialize, |
72 void(media::DemuxerStream* demuxer_stream, | 76 void(media::DemuxerStream* demuxer_stream, |
73 bool* success, | 77 bool* success, |
74 Task* done_cb)); | 78 Task* done_cb)); |
75 MOCK_METHOD1(DoStop, void(Task* done_cb)); | 79 MOCK_METHOD1(DoStop, void(Task* done_cb)); |
76 MOCK_METHOD2(DoSeek, void(base::TimeDelta time, Task* done_cb)); | 80 MOCK_METHOD2(DoSeek, void(base::TimeDelta time, Task* done_cb)); |
77 MOCK_METHOD1(DoDecode, void(media::Buffer* input)); | 81 MOCK_METHOD1(DoDecode, void(media::Buffer* input)); |
78 | 82 |
79 private: | 83 private: |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 // Stop. | 161 // Stop. |
158 EXPECT_CALL(*decoder, DoStop(_)) | 162 EXPECT_CALL(*decoder, DoStop(_)) |
159 .WillOnce(WithArg<0>(InvokeRunnable())); | 163 .WillOnce(WithArg<0>(InvokeRunnable())); |
160 EXPECT_CALL(callback, OnFilterCallback()); | 164 EXPECT_CALL(callback, OnFilterCallback()); |
161 EXPECT_CALL(callback, OnCallbackDestroyed()); | 165 EXPECT_CALL(callback, OnCallbackDestroyed()); |
162 decoder->Stop(callback.NewCallback()); | 166 decoder->Stop(callback.NewCallback()); |
163 message_loop.RunAllPending(); | 167 message_loop.RunAllPending(); |
164 } | 168 } |
165 | 169 |
166 } // namespace media | 170 } // namespace media |
OLD | NEW |