OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // A new breed of mock media filters, this time using gmock! Feel free to add | 5 // A new breed of mock media filters, this time using gmock! Feel free to add |
6 // actions if you need interesting side-effects. | 6 // actions if you need interesting side-effects. |
7 // | 7 // |
8 // Don't forget you can use StrictMock<> and NiceMock<> if you want the mock | 8 // Don't forget you can use StrictMock<> and NiceMock<> if you want the mock |
9 // filters to fail the test or do nothing when an unexpected method is called. | 9 // filters to fail the test or do nothing when an unexpected method is called. |
10 // http://code.google.com/p/googlemock/wiki/CookBook#Nice_Mocks_and_Strict_Mocks | 10 // http://code.google.com/p/googlemock/wiki/CookBook#Nice_Mocks_and_Strict_Mocks |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 | 188 |
189 private: | 189 private: |
190 DISALLOW_COPY_AND_ASSIGN(MockAudioRenderer); | 190 DISALLOW_COPY_AND_ASSIGN(MockAudioRenderer); |
191 }; | 191 }; |
192 | 192 |
193 class MockDecryptor : public Decryptor { | 193 class MockDecryptor : public Decryptor { |
194 public: | 194 public: |
195 MockDecryptor(); | 195 MockDecryptor(); |
196 virtual ~MockDecryptor(); | 196 virtual ~MockDecryptor(); |
197 | 197 |
198 MOCK_METHOD3(GenerateKeyRequest, void(const std::string& key_system, | 198 MOCK_METHOD3(GenerateKeyRequest, bool(const std::string& key_system, |
199 const uint8* init_data, | 199 const uint8* init_data, |
200 int init_data_length)); | 200 int init_data_length)); |
201 MOCK_METHOD6(AddKey, void(const std::string& key_system, | 201 MOCK_METHOD6(AddKey, void(const std::string& key_system, |
202 const uint8* key, | 202 const uint8* key, |
203 int key_length, | 203 int key_length, |
204 const uint8* init_data, | 204 const uint8* init_data, |
205 int init_data_length, | 205 int init_data_length, |
206 const std::string& session_id)); | 206 const std::string& session_id)); |
207 MOCK_METHOD2(CancelKeyRequest, void(const std::string& key_system, | 207 MOCK_METHOD2(CancelKeyRequest, void(const std::string& key_system, |
208 const std::string& session_id)); | 208 const std::string& session_id)); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 public: | 285 public: |
286 MockStatisticsCB(); | 286 MockStatisticsCB(); |
287 ~MockStatisticsCB(); | 287 ~MockStatisticsCB(); |
288 | 288 |
289 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics)); | 289 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics)); |
290 }; | 290 }; |
291 | 291 |
292 } // namespace media | 292 } // namespace media |
293 | 293 |
294 #endif // MEDIA_BASE_MOCK_FILTERS_H_ | 294 #endif // MEDIA_BASE_MOCK_FILTERS_H_ |
OLD | NEW |