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 #include "media/renderers/audio_renderer_impl.h" | 5 #include "media/renderers/audio_renderer_impl.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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 CHECK(!ended_); | 125 CHECK(!ended_); |
126 ended_ = true; | 126 ended_ = true; |
127 } | 127 } |
128 void OnStatisticsUpdate(const PipelineStatistics& stats) override { | 128 void OnStatisticsUpdate(const PipelineStatistics& stats) override { |
129 last_statistics_.audio_memory_usage += stats.audio_memory_usage; | 129 last_statistics_.audio_memory_usage += stats.audio_memory_usage; |
130 } | 130 } |
131 MOCK_METHOD1(OnBufferingStateChange, void(BufferingState)); | 131 MOCK_METHOD1(OnBufferingStateChange, void(BufferingState)); |
132 MOCK_METHOD0(OnWaitingForDecryptionKey, void(void)); | 132 MOCK_METHOD0(OnWaitingForDecryptionKey, void(void)); |
133 MOCK_METHOD1(OnVideoNaturalSizeChange, void(const gfx::Size&)); | 133 MOCK_METHOD1(OnVideoNaturalSizeChange, void(const gfx::Size&)); |
134 MOCK_METHOD1(OnVideoOpacityChange, void(bool)); | 134 MOCK_METHOD1(OnVideoOpacityChange, void(bool)); |
| 135 MOCK_METHOD1(OnDurationChange, void(base::TimeDelta)); |
135 | 136 |
136 void InitializeRenderer(const PipelineStatusCB& pipeline_status_cb) { | 137 void InitializeRenderer(const PipelineStatusCB& pipeline_status_cb) { |
137 EXPECT_CALL(*this, OnWaitingForDecryptionKey()).Times(0); | 138 EXPECT_CALL(*this, OnWaitingForDecryptionKey()).Times(0); |
138 EXPECT_CALL(*this, OnVideoNaturalSizeChange(_)).Times(0); | 139 EXPECT_CALL(*this, OnVideoNaturalSizeChange(_)).Times(0); |
139 EXPECT_CALL(*this, OnVideoOpacityChange(_)).Times(0); | 140 EXPECT_CALL(*this, OnVideoOpacityChange(_)).Times(0); |
140 renderer_->Initialize(&demuxer_stream_, nullptr, this, pipeline_status_cb); | 141 renderer_->Initialize(&demuxer_stream_, nullptr, this, pipeline_status_cb); |
141 } | 142 } |
142 | 143 |
143 void Initialize() { | 144 void Initialize() { |
144 EXPECT_CALL(*decoder_, Initialize(_, _, _, _)) | 145 EXPECT_CALL(*decoder_, Initialize(_, _, _, _)) |
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
980 // Advance far enough that we shouldn't be clamped to current time (tested | 981 // Advance far enough that we shouldn't be clamped to current time (tested |
981 // already above). | 982 // already above). |
982 tick_clock_->Advance(kOneSecond); | 983 tick_clock_->Advance(kOneSecond); |
983 EXPECT_EQ( | 984 EXPECT_EQ( |
984 current_time + timestamp_helper.GetFrameDuration(frames_to_consume.value), | 985 current_time + timestamp_helper.GetFrameDuration(frames_to_consume.value), |
985 CurrentMediaWallClockTime(&is_time_moving)); | 986 CurrentMediaWallClockTime(&is_time_moving)); |
986 EXPECT_TRUE(is_time_moving); | 987 EXPECT_TRUE(is_time_moving); |
987 } | 988 } |
988 | 989 |
989 } // namespace media | 990 } // namespace media |
OLD | NEW |