Chromium Code Reviews| 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 | |
|
xhwang
2014/08/09 00:56:03
We are not tracking "the number of calls" since we
jrummell
2014/08/11 21:47:15
Done.
| |
| 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 { | |
|
xhwang
2014/08/09 00:56:03
Naming bikeshedding.. In our use case, this is rea
jrummell
2014/08/11 21:47:15
Like CallbackPairChecker.
| |
| 132 public: | |
| 133 MatchingCallbackVerifier(); | |
| 134 ~MatchingCallbackVerifier(); | |
| 135 void RecordACalled(); | |
| 136 void RecordBCalled(); | |
| 137 | |
| 138 private: | |
| 139 bool expecting_b_; | |
| 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 |