Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(353)

Side by Side Diff: media/renderers/video_renderer_impl_unittest.cc

Issue 2837613004: media: Support better decoder switching (Closed)
Patch Set: Mock*Decoder name Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« media/filters/decoder_stream.cc ('K') | « media/renderers/video_renderer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698