| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 *result_listener << "has timestamp " << arg->timestamp().InMilliseconds(); | 50 *result_listener << "has timestamp " << arg->timestamp().InMilliseconds(); |
| 51 return arg->timestamp().InMilliseconds() == ms; | 51 return arg->timestamp().InMilliseconds() == ms; |
| 52 } | 52 } |
| 53 | 53 |
| 54 class VideoRendererImplTest : public testing::Test { | 54 class VideoRendererImplTest : public testing::Test { |
| 55 public: | 55 public: |
| 56 ScopedVector<VideoDecoder> CreateVideoDecodersForTest() { | 56 ScopedVector<VideoDecoder> CreateVideoDecodersForTest() { |
| 57 decoder_ = new NiceMock<MockVideoDecoder>(); | 57 decoder_ = new NiceMock<MockVideoDecoder>(); |
| 58 ScopedVector<VideoDecoder> decoders; | 58 ScopedVector<VideoDecoder> decoders; |
| 59 decoders.push_back(decoder_); | 59 decoders.push_back(decoder_); |
| 60 EXPECT_CALL(*decoder_, Initialize(_, _, _, _, _)) | 60 ON_CALL(*decoder_, Initialize(_, _, _, _, _)) |
| 61 .WillOnce(DoAll(SaveArg<4>(&output_cb_), | 61 .WillByDefault(DoAll(SaveArg<4>(&output_cb_), |
| 62 RunCallback<3>(expect_init_success_))); | 62 RunCallback<3>(expect_init_success_))); |
| 63 // Monitor decodes from the decoder. | 63 // Monitor decodes from the decoder. |
| 64 ON_CALL(*decoder_, Decode(_, _)) | 64 ON_CALL(*decoder_, Decode(_, _)) |
| 65 .WillByDefault(Invoke(this, &VideoRendererImplTest::DecodeRequested)); | 65 .WillByDefault(Invoke(this, &VideoRendererImplTest::DecodeRequested)); |
| 66 ON_CALL(*decoder_, Reset(_)) | 66 ON_CALL(*decoder_, Reset(_)) |
| 67 .WillByDefault(Invoke(this, &VideoRendererImplTest::FlushRequested)); | 67 .WillByDefault(Invoke(this, &VideoRendererImplTest::FlushRequested)); |
| 68 return decoders; | 68 return decoders; |
| 69 } | 69 } |
| 70 | 70 |
| 71 VideoRendererImplTest() | 71 VideoRendererImplTest() |
| 72 : tick_clock_(new base::SimpleTestTickClock()), | 72 : tick_clock_(new base::SimpleTestTickClock()), |
| (...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1212 QueueFrames("0 10 20 30"); | 1212 QueueFrames("0 10 20 30"); |
| 1213 StartPlayingFrom(0); | 1213 StartPlayingFrom(0); |
| 1214 Flush(); | 1214 Flush(); |
| 1215 ASSERT_EQ(1u, frame_ready_cbs_.size()); | 1215 ASSERT_EQ(1u, frame_ready_cbs_.size()); |
| 1216 // This frame will be discarded. | 1216 // This frame will be discarded. |
| 1217 frame_ready_cbs_.front().Run(); | 1217 frame_ready_cbs_.front().Run(); |
| 1218 Destroy(); | 1218 Destroy(); |
| 1219 } | 1219 } |
| 1220 | 1220 |
| 1221 } // namespace media | 1221 } // namespace media |
| OLD | NEW |