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/channel_layout.h" | 10 #include "media/base/channel_layout.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 class TimeDelta; | 21 class TimeDelta; |
22 } | 22 } |
23 | 23 |
24 namespace media { | 24 namespace media { |
25 | 25 |
26 class AudioBuffer; | 26 class AudioBuffer; |
27 class DecoderBuffer; | 27 class DecoderBuffer; |
28 | 28 |
29 // Return a callback that expects to be run once. | 29 // Return a callback that expects to be run once. |
30 base::Closure NewExpectedClosure(); | 30 base::Closure NewExpectedClosure(); |
31 base::Callback<void(bool)> NewExpectedBoolCB(bool success); | |
32 PipelineStatusCB NewExpectedStatusCB(PipelineStatus status); | 31 PipelineStatusCB NewExpectedStatusCB(PipelineStatus status); |
33 | 32 |
34 // Helper class for running a message loop until a callback has run. Useful for | 33 // Helper class for running a message loop until a callback has run. Useful for |
35 // testing classes that run on more than a single thread. | 34 // testing classes that run on more than a single thread. |
36 // | 35 // |
37 // Events are intended for single use and cannot be reset. | 36 // Events are intended for single use and cannot be reset. |
38 class WaitableMessageLoopEvent { | 37 class WaitableMessageLoopEvent { |
39 public: | 38 public: |
40 WaitableMessageLoopEvent(); | 39 WaitableMessageLoopEvent(); |
41 ~WaitableMessageLoopEvent(); | 40 ~WaitableMessageLoopEvent(); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 }; | 144 }; |
146 | 145 |
147 // Test implementation of a media log LogCB that sends media log messages to | 146 // Test implementation of a media log LogCB that sends media log messages to |
148 // DVLOG(1). | 147 // DVLOG(1). |
149 void AddLogEntryForTest(MediaLog::MediaLogLevel level, | 148 void AddLogEntryForTest(MediaLog::MediaLogLevel level, |
150 const std::string& message); | 149 const std::string& message); |
151 | 150 |
152 } // namespace media | 151 } // namespace media |
153 | 152 |
154 #endif // MEDIA_BASE_TEST_HELPERS_H_ | 153 #endif // MEDIA_BASE_TEST_HELPERS_H_ |
OLD | NEW |