OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 // also lets us test for missing callbacks. | 44 // also lets us test for missing callbacks. |
45 class CallbackHelper : public MockRendererClient { | 45 class CallbackHelper : public MockRendererClient { |
46 public: | 46 public: |
47 CallbackHelper() {} | 47 CallbackHelper() {} |
48 virtual ~CallbackHelper() {} | 48 virtual ~CallbackHelper() {} |
49 | 49 |
50 // Completion callbacks. | 50 // Completion callbacks. |
51 MOCK_METHOD1(OnInitialize, void(PipelineStatus)); | 51 MOCK_METHOD1(OnInitialize, void(PipelineStatus)); |
52 MOCK_METHOD0(OnFlushed, void()); | 52 MOCK_METHOD0(OnFlushed, void()); |
53 MOCK_METHOD1(OnCdmAttached, void(bool)); | 53 MOCK_METHOD1(OnCdmAttached, void(bool)); |
| 54 MOCK_METHOD1(OnDurationChange, void(base::TimeDelta duration)); |
54 | 55 |
55 private: | 56 private: |
56 DISALLOW_COPY_AND_ASSIGN(CallbackHelper); | 57 DISALLOW_COPY_AND_ASSIGN(CallbackHelper); |
57 }; | 58 }; |
58 | 59 |
59 RendererImplTest() | 60 RendererImplTest() |
60 : demuxer_(new StrictMock<MockDemuxer>()), | 61 : demuxer_(new StrictMock<MockDemuxer>()), |
61 video_renderer_(new StrictMock<MockVideoRenderer>()), | 62 video_renderer_(new StrictMock<MockVideoRenderer>()), |
62 audio_renderer_(new StrictMock<MockAudioRenderer>()), | 63 audio_renderer_(new StrictMock<MockAudioRenderer>()), |
63 renderer_impl_( | 64 renderer_impl_( |
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 EXPECT_CALL(*audio_renderer_, Flush(_)).WillOnce(RunClosure<0>()); | 736 EXPECT_CALL(*audio_renderer_, Flush(_)).WillOnce(RunClosure<0>()); |
736 EXPECT_CALL(*audio_renderer_, StartPlaying()).Times(1); | 737 EXPECT_CALL(*audio_renderer_, StartPlaying()).Times(1); |
737 audio_stream_status_change_cb.Run(false, time0); | 738 audio_stream_status_change_cb.Run(false, time0); |
738 | 739 |
739 EXPECT_CALL(*video_renderer_, Flush(_)).WillOnce(RunClosure<0>()); | 740 EXPECT_CALL(*video_renderer_, Flush(_)).WillOnce(RunClosure<0>()); |
740 EXPECT_CALL(*video_renderer_, StartPlayingFrom(_)).Times(1); | 741 EXPECT_CALL(*video_renderer_, StartPlayingFrom(_)).Times(1); |
741 video_stream_status_change_cb.Run(false, time0); | 742 video_stream_status_change_cb.Run(false, time0); |
742 } | 743 } |
743 | 744 |
744 } // namespace media | 745 } // namespace media |
OLD | NEW |