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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "media/base/pipeline_status.h" | 10 #include "media/base/pipeline_status.h" |
11 #include "media/base/sample_format.h" | |
11 #include "media/base/video_decoder_config.h" | 12 #include "media/base/video_decoder_config.h" |
12 #include "testing/gmock/include/gmock/gmock.h" | 13 #include "testing/gmock/include/gmock/gmock.h" |
13 #include "ui/gfx/size.h" | 14 #include "ui/gfx/size.h" |
14 | 15 |
15 namespace base { | 16 namespace base { |
16 class MessageLoop; | 17 class MessageLoop; |
18 class TimeDelta; | |
17 } | 19 } |
18 | 20 |
19 namespace media { | 21 namespace media { |
20 | 22 |
23 class AudioBuffer; | |
24 | |
21 // Return a callback that expects to be run once. | 25 // Return a callback that expects to be run once. |
22 base::Closure NewExpectedClosure(); | 26 base::Closure NewExpectedClosure(); |
23 PipelineStatusCB NewExpectedStatusCB(PipelineStatus status); | 27 PipelineStatusCB NewExpectedStatusCB(PipelineStatus status); |
24 | 28 |
25 // Helper class for running a message loop until a callback has run. Useful for | 29 // Helper class for running a message loop until a callback has run. Useful for |
26 // testing classes that run on more than a single thread. | 30 // testing classes that run on more than a single thread. |
27 // | 31 // |
28 // Events are intended for single use and cannot be reset. | 32 // Events are intended for single use and cannot be reset. |
29 class WaitableMessageLoopEvent { | 33 class WaitableMessageLoopEvent { |
30 public: | 34 public: |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
72 static VideoDecoderConfig LargeEncrypted(); | 76 static VideoDecoderConfig LargeEncrypted(); |
73 | 77 |
74 // Returns coded size for Normal and Large config. | 78 // Returns coded size for Normal and Large config. |
75 static gfx::Size NormalCodedSize(); | 79 static gfx::Size NormalCodedSize(); |
76 static gfx::Size LargeCodedSize(); | 80 static gfx::Size LargeCodedSize(); |
77 | 81 |
78 private: | 82 private: |
79 DISALLOW_IMPLICIT_CONSTRUCTORS(TestVideoConfig); | 83 DISALLOW_IMPLICIT_CONSTRUCTORS(TestVideoConfig); |
80 }; | 84 }; |
81 | 85 |
86 template <class T> | |
87 scoped_refptr<AudioBuffer> MakeInterleavedAudioBuffer( | |
scherkus (not reviewing)
2013/06/20 23:36:24
given these are public methods let's get some docs
jrummell
2013/06/21 01:17:22
Done.
| |
88 SampleFormat format, | |
89 int channels, | |
90 T start, | |
91 T increment, | |
92 int frames, | |
93 const base::TimeDelta start_time); | |
scherkus (not reviewing)
2013/06/20 23:36:24
is this supposed to be const-ref?
otherwise you c
jrummell
2013/06/21 01:17:22
Done.
| |
94 | |
95 template <class T> | |
96 scoped_refptr<AudioBuffer> MakePlanarAudioBuffer( | |
97 SampleFormat format, | |
98 int channels, | |
99 T start, | |
100 T increment, | |
101 int frames, | |
102 const base::TimeDelta start_time); | |
scherkus (not reviewing)
2013/06/20 23:36:24
ditto
jrummell
2013/06/21 01:17:22
Done.
| |
103 | |
82 } // namespace media | 104 } // namespace media |
83 | 105 |
84 #endif // MEDIA_BASE_TEST_HELPERS_H_ | 106 #endif // MEDIA_BASE_TEST_HELPERS_H_ |
OLD | NEW |