Index: media/base/mock_filters.h |
diff --git a/media/base/mock_filters.h b/media/base/mock_filters.h |
index 626392c2facddbf94051747e2f0e654b6c35eb9b..1b9105a49dd15553fdf1792ff35b8a993a240b9d 100644 |
--- a/media/base/mock_filters.h |
+++ b/media/base/mock_filters.h |
@@ -26,6 +26,7 @@ |
#include "media/base/video_decoder_config.h" |
#include "media/base/video_frame.h" |
#include "media/base/video_renderer.h" |
+#include "media/crypto/decryptor_client.h" |
#include "testing/gmock/include/gmock/gmock.h" |
namespace media { |
@@ -209,6 +210,40 @@ class MockAudioRenderer : public AudioRenderer { |
DISALLOW_COPY_AND_ASSIGN(MockAudioRenderer); |
}; |
+class MockDecryptorClient : public DecryptorClient { |
+ public: |
+ MockDecryptorClient(); |
+ virtual ~MockDecryptorClient(); |
+ |
+ MOCK_METHOD2(KeyAdded, void(const std::string&, const std::string&)); |
+ MOCK_METHOD4(KeyError, void(const std::string&, const std::string&, |
+ AesDecryptor::KeyError, int)); |
+ // TODO(xhwang): This is a workaround of the issue that move-only parameters |
+ // are not supported in mocked methods. Remove this when the issue is fixed. |
+ // See http://code.google.com/p/googletest/issues/detail?id=395 |
scherkus (not reviewing)
2012/06/12 03:15:58
AFAIK this is also due to scoped_array<uint8> -- m
xhwang
2012/06/12 19:01:15
Done.
|
+ MOCK_METHOD5(KeyMessageMock, void(const std::string& key_system, |
+ const std::string& session_id, |
+ const uint8* message, |
+ int message_length, |
+ const std::string& default_url)); |
+ MOCK_METHOD4(KeyNeededMock, void(const std::string& key_system, |
+ const std::string& session_id, |
+ const uint8* init_data, |
+ int init_data_length)); |
+ virtual void KeyMessage(const std::string& key_system, |
+ const std::string& session_id, |
+ scoped_array<uint8> message, |
+ int message_length, |
+ const std::string& default_url) OVERRIDE; |
+ virtual void KeyNeeded(const std::string& key_system, |
+ const std::string& session_id, |
+ scoped_array<uint8> init_data, |
+ int init_data_length) OVERRIDE; |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(MockDecryptorClient); |
+}; |
+ |
// FilterFactory that returns canned instances of mock filters. You can set |
// expectations on the filters and then pass the collection into a pipeline. |
class MockFilterCollection { |