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