Index: media/cdm/ppapi/cdm_file_io_test.h |
diff --git a/media/cdm/ppapi/cdm_file_io_test.h b/media/cdm/ppapi/cdm_file_io_test.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a9f3826604f2830ee2615b802474abb990e25f7c |
--- /dev/null |
+++ b/media/cdm/ppapi/cdm_file_io_test.h |
@@ -0,0 +1,49 @@ |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef MEDIA_CDM_PPAPI_CDM_FILE_IO_TEST_H_ |
+#define MEDIA_CDM_PPAPI_CDM_FILE_IO_TEST_H_ |
+ |
+#include "base/callback.h" |
+#include "base/compiler_specific.h" |
+#include "media/cdm/ppapi/api/content_decryption_module.h" |
+#include "media/cdm/ppapi/clear_key_cdm_common.h" |
ddorwin
2013/12/11 21:16:17
The comment below says "a CDM", but this include a
xhwang
2013/12/13 02:51:47
Done.
|
+ |
+namespace media { |
+ |
+// Tests cdm::FileIO implementation. This class needs to be used in a CDM |
+// implementation to work. The caller calls CdmFileIoTest::Run() to start the |
+// test, where the test result is reported in the completion callback. |
+class CdmFileIOTest : public cdm::FileIOClient { |
+ public: |
+ typedef base::Callback<void(bool success)> CompletionCB; |
+ |
+ explicit CdmFileIOTest(ClearKeyCdmHost* cdm_host); |
+ virtual ~CdmFileIOTest(); |
+ |
+ // cdm::FileIOClient implementation. |
+ virtual void OnOpenComplete(Status status) OVERRIDE; |
+ virtual void OnReadComplete(Status status, |
+ const uint8_t* data, uint32_t data_size) OVERRIDE; |
+ virtual void OnWriteComplete(Status status) OVERRIDE; |
+ |
+ // Start tests. When tests are completed, the result will be reported in the |
+ // |completion_cb|. |
+ void Run( CompletionCB completion_cb); |
ddorwin
2013/12/11 21:16:17
extra space after (
xhwang
2013/12/13 02:51:47
Done.
|
+ |
+ private: |
+ void OnTestComplete(bool success); |
+ |
+ ClearKeyCdmHost* cdm_host_; |
+ cdm::FileIO* cdm_file_io_; |
+ CompletionCB completion_cb_; |
+ |
+ std::vector<uint8_t> test_data_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN (CdmFileIOTest); |
+}; |
+ |
+} // namespace media |
+ |
+#endif // MEDIA_CDM_PPAPI_CDM_FILE_IO_TEST_H_ |