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 each call to A() is followed by a call to B(), |
| 129 // before the next call to A(). There may be any number of pairs (including 0). |
| 130 class CallbackPairChecker { |
| 131 public: |
| 132 CallbackPairChecker(); |
| 133 ~CallbackPairChecker(); |
| 134 void RecordACalled(); |
| 135 void RecordBCalled(); |
| 136 |
| 137 private: |
| 138 bool expecting_b_; |
| 139 }; |
| 140 |
128 } // namespace media | 141 } // namespace media |
129 | 142 |
130 #endif // MEDIA_BASE_TEST_HELPERS_H_ | 143 #endif // MEDIA_BASE_TEST_HELPERS_H_ |
OLD | NEW |