| 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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 DISALLOW_COPY_AND_ASSIGN(MockAudioRenderer); | 210 DISALLOW_COPY_AND_ASSIGN(MockAudioRenderer); |
| 211 }; | 211 }; |
| 212 | 212 |
| 213 class MockDecryptorClient : public DecryptorClient { | 213 class MockDecryptorClient : public DecryptorClient { |
| 214 public: | 214 public: |
| 215 MockDecryptorClient(); | 215 MockDecryptorClient(); |
| 216 virtual ~MockDecryptorClient(); | 216 virtual ~MockDecryptorClient(); |
| 217 | 217 |
| 218 MOCK_METHOD2(KeyAdded, void(const std::string&, const std::string&)); | 218 MOCK_METHOD2(KeyAdded, void(const std::string&, const std::string&)); |
| 219 MOCK_METHOD4(KeyError, void(const std::string&, const std::string&, | 219 MOCK_METHOD4(KeyError, void(const std::string&, const std::string&, |
| 220 AesDecryptor::KeyError, int)); | 220 Decryptor::KeyError, int)); |
| 221 // TODO(xhwang): This is a workaround of the issue that move-only parameters | 221 // TODO(xhwang): This is a workaround of the issue that move-only parameters |
| 222 // are not supported in mocked methods. Remove this when the issue is fixed | 222 // are not supported in mocked methods. Remove this when the issue is fixed |
| 223 // (http://code.google.com/p/googletest/issues/detail?id=395) or when we use | 223 // (http://code.google.com/p/googletest/issues/detail?id=395) or when we use |
| 224 // std::string instead of scoped_array<uint8> (http://crbug.com/130689). | 224 // std::string instead of scoped_array<uint8> (http://crbug.com/130689). |
| 225 MOCK_METHOD5(KeyMessageMock, void(const std::string& key_system, | 225 MOCK_METHOD5(KeyMessageMock, void(const std::string& key_system, |
| 226 const std::string& session_id, | 226 const std::string& session_id, |
| 227 const uint8* message, | 227 const uint8* message, |
| 228 int message_length, | 228 int message_length, |
| 229 const std::string& default_url)); | 229 const std::string& default_url)); |
| 230 MOCK_METHOD4(NeedKeyMock, void(const std::string& key_system, | 230 MOCK_METHOD4(NeedKeyMock, void(const std::string& key_system, |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 public: | 307 public: |
| 308 MockStatisticsCB(); | 308 MockStatisticsCB(); |
| 309 ~MockStatisticsCB(); | 309 ~MockStatisticsCB(); |
| 310 | 310 |
| 311 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics)); | 311 MOCK_METHOD1(OnStatistics, void(const media::PipelineStatistics& statistics)); |
| 312 }; | 312 }; |
| 313 | 313 |
| 314 } // namespace media | 314 } // namespace media |
| 315 | 315 |
| 316 #endif // MEDIA_BASE_MOCK_FILTERS_H_ | 316 #endif // MEDIA_BASE_MOCK_FILTERS_H_ |
| OLD | NEW |