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

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

Issue 2243683002: Add OnDurationChange() to RenderClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@media_player_simplified
Patch Set: Fixed typo Created 4 years, 4 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
« no previous file with comments | « media/mojo/services/mojo_renderer_service.cc ('k') | media/renderers/renderer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « media/mojo/services/mojo_renderer_service.cc ('k') | media/renderers/renderer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698