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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
118 // some sanity check. | 118 // some sanity check. |
119 scoped_refptr<DecoderBuffer> CreateFakeVideoBufferForTest( | 119 scoped_refptr<DecoderBuffer> CreateFakeVideoBufferForTest( |
120 const VideoDecoderConfig& config, | 120 const VideoDecoderConfig& config, |
121 base::TimeDelta timestamp, | 121 base::TimeDelta timestamp, |
122 base::TimeDelta duration); | 122 base::TimeDelta duration); |
123 | 123 |
124 // Verify if a fake video DecoderBuffer is valid. | 124 // Verify if a fake video DecoderBuffer is valid. |
125 bool VerifyFakeVideoBufferForTest(const scoped_refptr<DecoderBuffer>& buffer, | 125 bool VerifyFakeVideoBufferForTest(const scoped_refptr<DecoderBuffer>& buffer, |
126 const VideoDecoderConfig& config); | 126 const VideoDecoderConfig& config); |
127 | 127 |
128 // Used to verify that the number of calls to A() match the number of calls to | |
129 // B() and that the calls happen in pairs (e.g. B() called after every A() | |
130 // call). There may be any number of pairs (including 0). | |
131 class MatchingCallbackVerifier { | |
132 public: | |
133 MatchingCallbackVerifier(); | |
134 ~MatchingCallbackVerifier(); | |
135 void A(); | |
ddorwin
2014/08/08 21:15:26
nit: I wonder if this should be "RecordACalled" or
jrummell
2014/08/08 23:39:59
Done.
| |
136 void B(); | |
137 | |
138 private: | |
139 bool expecting_B_; | |
ddorwin
2014/08/08 21:15:26
nit: 'b'
jrummell
2014/08/08 23:39:59
Done.
| |
140 }; | |
141 | |
128 } // namespace media | 142 } // namespace media |
129 | 143 |
130 #endif // MEDIA_BASE_TEST_HELPERS_H_ | 144 #endif // MEDIA_BASE_TEST_HELPERS_H_ |
OLD | NEW |