Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1235)

Unified Diff: media/base/mock_filters.h

Issue 10534096: Generalize AesDecryptor to make it more spec compliant. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/base/mock_filters.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/mock_filters.h
diff --git a/media/base/mock_filters.h b/media/base/mock_filters.h
index 626392c2facddbf94051747e2f0e654b6c35eb9b..cf8fa2859cc89e69cdaa0e980e65bfa770585747 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,41 @@ 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
+ // (http://code.google.com/p/googletest/issues/detail?id=395) or when we use
+ // std::string instead of scoped_array<uint8> (http://crbug.com/130689).
+ 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(NeedKeyMock, 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 NeedKey(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 {
« no previous file with comments | « no previous file | media/base/mock_filters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698