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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 MOCK_METHOD1(OnError, void(PipelineStatus)); | 120 MOCK_METHOD1(OnError, void(PipelineStatus)); |
121 void OnEnded() override { | 121 void OnEnded() override { |
122 CHECK(!ended_); | 122 CHECK(!ended_); |
123 ended_ = true; | 123 ended_ = true; |
124 } | 124 } |
125 void OnStatisticsUpdate(const PipelineStatistics& stats) override { | 125 void OnStatisticsUpdate(const PipelineStatistics& stats) override { |
126 last_statistics_.audio_memory_usage += stats.audio_memory_usage; | 126 last_statistics_.audio_memory_usage += stats.audio_memory_usage; |
127 } | 127 } |
128 MOCK_METHOD1(OnBufferingStateChange, void(BufferingState)); | 128 MOCK_METHOD1(OnBufferingStateChange, void(BufferingState)); |
129 MOCK_METHOD0(OnWaitingForDecryptionKey, void(void)); | 129 MOCK_METHOD0(OnWaitingForDecryptionKey, void(void)); |
| 130 MOCK_METHOD1(OnVideoNaturalSizeChange, void(const gfx::Size&)); |
| 131 MOCK_METHOD1(OnVideoOpacityChange, void(bool)); |
130 | 132 |
131 void InitializeRenderer(const PipelineStatusCB& pipeline_status_cb) { | 133 void InitializeRenderer(const PipelineStatusCB& pipeline_status_cb) { |
132 EXPECT_CALL(*this, OnWaitingForDecryptionKey()).Times(0); | 134 EXPECT_CALL(*this, OnWaitingForDecryptionKey()).Times(0); |
| 135 EXPECT_CALL(*this, OnVideoNaturalSizeChange(_)).Times(0); |
| 136 EXPECT_CALL(*this, OnVideoOpacityChange(_)).Times(0); |
133 renderer_->Initialize(&demuxer_stream_, nullptr, this, pipeline_status_cb); | 137 renderer_->Initialize(&demuxer_stream_, nullptr, this, pipeline_status_cb); |
134 } | 138 } |
135 | 139 |
136 void Initialize() { | 140 void Initialize() { |
137 EXPECT_CALL(*decoder_, Initialize(_, _, _, _)) | 141 EXPECT_CALL(*decoder_, Initialize(_, _, _, _)) |
138 .WillOnce(DoAll(SaveArg<3>(&output_cb_), RunCallback<2>(true))); | 142 .WillOnce(DoAll(SaveArg<3>(&output_cb_), RunCallback<2>(true))); |
139 InitializeWithStatus(PIPELINE_OK); | 143 InitializeWithStatus(PIPELINE_OK); |
140 | 144 |
141 next_timestamp_.reset(new AudioTimestampHelper(kInputSamplesPerSecond)); | 145 next_timestamp_.reset(new AudioTimestampHelper(kInputSamplesPerSecond)); |
142 } | 146 } |
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
937 // Advance far enough that we shouldn't be clamped to current time (tested | 941 // Advance far enough that we shouldn't be clamped to current time (tested |
938 // already above). | 942 // already above). |
939 tick_clock_->Advance(kOneSecond); | 943 tick_clock_->Advance(kOneSecond); |
940 EXPECT_EQ( | 944 EXPECT_EQ( |
941 current_time + timestamp_helper.GetFrameDuration(frames_to_consume.value), | 945 current_time + timestamp_helper.GetFrameDuration(frames_to_consume.value), |
942 CurrentMediaWallClockTime(&is_time_moving)); | 946 CurrentMediaWallClockTime(&is_time_moving)); |
943 EXPECT_TRUE(is_time_moving); | 947 EXPECT_TRUE(is_time_moving); |
944 } | 948 } |
945 | 949 |
946 } // namespace media | 950 } // namespace media |
OLD | NEW |