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

Side by Side Diff: media/cdm/ppapi/cdm_file_io_test.h

Issue 93243003: Add CDM FileIO tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments addressed Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_CDM_PPAPI_CDM_FILE_IO_TEST_H_
6 #define MEDIA_CDM_PPAPI_CDM_FILE_IO_TEST_H_
7
8 #include "base/callback.h"
9 #include "base/compiler_specific.h"
10 #include "media/cdm/ppapi/api/content_decryption_module.h"
11 #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.
12
13 namespace media {
14
15 // Tests cdm::FileIO implementation. This class needs to be used in a CDM
16 // implementation to work. The caller calls CdmFileIoTest::Run() to start the
17 // test, where the test result is reported in the completion callback.
18 class CdmFileIOTest : public cdm::FileIOClient {
19 public:
20 typedef base::Callback<void(bool success)> CompletionCB;
21
22 explicit CdmFileIOTest(ClearKeyCdmHost* cdm_host);
23 virtual ~CdmFileIOTest();
24
25 // cdm::FileIOClient implementation.
26 virtual void OnOpenComplete(Status status) OVERRIDE;
27 virtual void OnReadComplete(Status status,
28 const uint8_t* data, uint32_t data_size) OVERRIDE;
29 virtual void OnWriteComplete(Status status) OVERRIDE;
30
31 // Start tests. When tests are completed, the result will be reported in the
32 // |completion_cb|.
33 void Run( CompletionCB completion_cb);
ddorwin 2013/12/11 21:16:17 extra space after (
xhwang 2013/12/13 02:51:47 Done.
34
35 private:
36 void OnTestComplete(bool success);
37
38 ClearKeyCdmHost* cdm_host_;
39 cdm::FileIO* cdm_file_io_;
40 CompletionCB completion_cb_;
41
42 std::vector<uint8_t> test_data_;
43
44 DISALLOW_COPY_AND_ASSIGN (CdmFileIOTest);
45 };
46
47 } // namespace media
48
49 #endif // MEDIA_CDM_PPAPI_CDM_FILE_IO_TEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698