Index: ppapi/tests/test_video_decoder.h |
diff --git a/ppapi/tests/test_video_decoder.h b/ppapi/tests/test_video_decoder.h |
index 15e0b3917d5ac57624e7b7bf1859a94422cd5e84..385497e7eae6b16340a9a4dbb0bc026cbce05f3e 100644 |
--- a/ppapi/tests/test_video_decoder.h |
+++ b/ppapi/tests/test_video_decoder.h |
@@ -2,18 +2,33 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+// This file contains implementation the Pepper Video Decoder API tester. Tester |
+// is simple realization of Chromium's TestCase class that implements a test |
+// case for Pepper plugin interface. |
+ |
#ifndef PPAPI_TESTS_TEST_VIDEO_DECODER_H_ |
#define PPAPI_TESTS_TEST_VIDEO_DECODER_H_ |
+#include <string> |
+ |
#include "ppapi/c/pp_stdint.h" |
+#include "ppapi/cpp/completion_callback.h" |
+#include "ppapi/cpp/dev/graphics_3d_client_dev.h" |
+#include "ppapi/cpp/dev/video_decoder_dev.h" |
+#include "ppapi/examples/video_decoder/video_decoder_session.h" |
#include "ppapi/tests/test_case.h" |
+#include "ppapi/tests/test_utils.h" |
+#include "ppapi/tests/testing_instance.h" |
-struct PPB_Var; |
-struct PPB_VideoDecoder_Dev; |
+class TestVideoSource; |
-class TestVideoDecoder : public TestCase { |
+// Main class for video decoder Pepper plugin tester. |
+class TestVideoDecoder : public TestCase, |
+ public VideoDecoderSessionClient { |
public: |
- TestVideoDecoder(TestingInstance* instance) : TestCase(instance) {} |
+ explicit TestVideoDecoder(TestingInstance* instance) |
+ : TestCase(instance), |
+ cb_factory_(this) {} |
// TestCase implementation. |
virtual bool Init(); |
@@ -22,11 +37,30 @@ class TestVideoDecoder : public TestCase { |
void QuitMessageLoop(); |
private: |
- std::string TestCreate(); |
+ std::string TestH264(); |
+ // Variables to hold the test status. |
+ int32_t test_result_; |
+ bool test_completed_; |
+ // Video decoder session that actually runs the decoder. |
+ VideoDecoderSession* video_decoder_session_; |
+ // Source for the video bitstream. |
+ VideoBitstreamInterface* video_bitstream_source_; |
+ // Target for the decoded pictures. |
+ DisplayInterface* display_interface_; |
+ // Callback factory for generating completion callbacks. |
+ pp::CompletionCallbackFactory<TestVideoDecoder> cb_factory_; |
+ // Wait for the completion of test. |
+ int32_t WaitForCompletion(); |
+ |
+ // VideoDecoderSessionClient implementation. |
+ virtual void OnSessionCompleted(int32_t result); |
- // Used by the tests that access the C API directly. |
- const PPB_VideoDecoder_Dev* video_decoder_interface_; |
- const PPB_Var* var_interface_; |
+ // Callbacks for functions controlling the session. |
+ void OnInitializeCompleted(int32_t result); |
+ void OnRunCompleted(int32_t result); |
+ void OnStopCompleted(int32_t result); |
+ void OnFlushCompleted(int32_t result); |
+ void OnTeardownCompleted(int32_t result); |
}; |
#endif // PPAPI_TESTS_TEST_VIDEO_DECODER_H_ |