| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 // some sanity check. | 126 // some sanity check. |
| 127 scoped_refptr<DecoderBuffer> CreateFakeVideoBufferForTest( | 127 scoped_refptr<DecoderBuffer> CreateFakeVideoBufferForTest( |
| 128 const VideoDecoderConfig& config, | 128 const VideoDecoderConfig& config, |
| 129 base::TimeDelta timestamp, | 129 base::TimeDelta timestamp, |
| 130 base::TimeDelta duration); | 130 base::TimeDelta duration); |
| 131 | 131 |
| 132 // Verify if a fake video DecoderBuffer is valid. | 132 // Verify if a fake video DecoderBuffer is valid. |
| 133 bool VerifyFakeVideoBufferForTest(const scoped_refptr<DecoderBuffer>& buffer, | 133 bool VerifyFakeVideoBufferForTest(const scoped_refptr<DecoderBuffer>& buffer, |
| 134 const VideoDecoderConfig& config); | 134 const VideoDecoderConfig& config); |
| 135 | 135 |
| 136 // Used to verify that the each call to A() is followed by a call to B(), | |
| 137 // before the next call to A(). There may be any number of pairs (including 0). | |
| 138 class CallbackPairChecker { | |
| 139 public: | |
| 140 CallbackPairChecker(); | |
| 141 ~CallbackPairChecker(); | |
| 142 void RecordACalled(); | |
| 143 void RecordBCalled(); | |
| 144 | |
| 145 private: | |
| 146 bool expecting_b_; | |
| 147 }; | |
| 148 | |
| 149 } // namespace media | 136 } // namespace media |
| 150 | 137 |
| 151 #endif // MEDIA_BASE_TEST_HELPERS_H_ | 138 #endif // MEDIA_BASE_TEST_HELPERS_H_ |
| OLD | NEW |