| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_BASE_TEST_HELPERS_H_ | 5 #ifndef MEDIA_BASE_TEST_HELPERS_H_ |
| 6 #define MEDIA_BASE_TEST_HELPERS_H_ | 6 #define MEDIA_BASE_TEST_HELPERS_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <memory> |
| 9 | 10 |
| 10 #include "base/callback.h" | 11 #include "base/callback.h" |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "media/base/audio_parameters.h" | 13 #include "media/base/audio_parameters.h" |
| 13 #include "media/base/channel_layout.h" | 14 #include "media/base/channel_layout.h" |
| 14 #include "media/base/media_log.h" | 15 #include "media/base/media_log.h" |
| 15 #include "media/base/pipeline_status.h" | 16 #include "media/base/pipeline_status.h" |
| 16 #include "media/base/sample_format.h" | 17 #include "media/base/sample_format.h" |
| 17 #include "media/base/video_decoder_config.h" | 18 #include "media/base/video_decoder_config.h" |
| 18 #include "testing/gmock/include/gmock/gmock.h" | 19 #include "testing/gmock/include/gmock/gmock.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 61 |
| 61 bool is_signaled() const { return signaled_; } | 62 bool is_signaled() const { return signaled_; } |
| 62 | 63 |
| 63 private: | 64 private: |
| 64 void OnCallback(PipelineStatus status); | 65 void OnCallback(PipelineStatus status); |
| 65 void OnTimeout(); | 66 void OnTimeout(); |
| 66 | 67 |
| 67 base::MessageLoop* message_loop_; | 68 base::MessageLoop* message_loop_; |
| 68 bool signaled_; | 69 bool signaled_; |
| 69 PipelineStatus status_; | 70 PipelineStatus status_; |
| 70 scoped_ptr<base::RunLoop> run_loop_; | 71 std::unique_ptr<base::RunLoop> run_loop_; |
| 71 | 72 |
| 72 DISALLOW_COPY_AND_ASSIGN(WaitableMessageLoopEvent); | 73 DISALLOW_COPY_AND_ASSIGN(WaitableMessageLoopEvent); |
| 73 }; | 74 }; |
| 74 | 75 |
| 75 // Provides pre-canned VideoDecoderConfig. These types are used for tests that | 76 // Provides pre-canned VideoDecoderConfig. These types are used for tests that |
| 76 // don't care about detailed parameters of the config. | 77 // don't care about detailed parameters of the config. |
| 77 class TestVideoConfig { | 78 class TestVideoConfig { |
| 78 public: | 79 public: |
| 79 // Returns a configuration that is invalid. | 80 // Returns a configuration that is invalid. |
| 80 static VideoDecoderConfig Invalid(); | 81 static VideoDecoderConfig Invalid(); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 base::TimeDelta timestamp, | 140 base::TimeDelta timestamp, |
| 140 base::TimeDelta duration); | 141 base::TimeDelta duration); |
| 141 | 142 |
| 142 // Verify if a fake video DecoderBuffer is valid. | 143 // Verify if a fake video DecoderBuffer is valid. |
| 143 bool VerifyFakeVideoBufferForTest(const scoped_refptr<DecoderBuffer>& buffer, | 144 bool VerifyFakeVideoBufferForTest(const scoped_refptr<DecoderBuffer>& buffer, |
| 144 const VideoDecoderConfig& config); | 145 const VideoDecoderConfig& config); |
| 145 | 146 |
| 146 } // namespace media | 147 } // namespace media |
| 147 | 148 |
| 148 #endif // MEDIA_BASE_TEST_HELPERS_H_ | 149 #endif // MEDIA_BASE_TEST_HELPERS_H_ |
| OLD | NEW |