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

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

Issue 2075303002: [DO NOT COMMIT] Initial MediaPlayerRenderer plumbing and basic features (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 (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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 CHECK(!ended_); 124 CHECK(!ended_);
125 ended_ = true; 125 ended_ = true;
126 } 126 }
127 void OnStatisticsUpdate(const PipelineStatistics& stats) override { 127 void OnStatisticsUpdate(const PipelineStatistics& stats) override {
128 last_statistics_.audio_memory_usage += stats.audio_memory_usage; 128 last_statistics_.audio_memory_usage += stats.audio_memory_usage;
129 } 129 }
130 MOCK_METHOD1(OnBufferingStateChange, void(BufferingState)); 130 MOCK_METHOD1(OnBufferingStateChange, void(BufferingState));
131 MOCK_METHOD0(OnWaitingForDecryptionKey, void(void)); 131 MOCK_METHOD0(OnWaitingForDecryptionKey, void(void));
132 MOCK_METHOD1(OnVideoNaturalSizeChange, void(const gfx::Size&)); 132 MOCK_METHOD1(OnVideoNaturalSizeChange, void(const gfx::Size&));
133 MOCK_METHOD1(OnVideoOpacityChange, void(bool)); 133 MOCK_METHOD1(OnVideoOpacityChange, void(bool));
134 MOCK_METHOD1(OnDurationChange, void(base::TimeDelta));
134 135
135 void InitializeRenderer(const PipelineStatusCB& pipeline_status_cb) { 136 void InitializeRenderer(const PipelineStatusCB& pipeline_status_cb) {
136 EXPECT_CALL(*this, OnWaitingForDecryptionKey()).Times(0); 137 EXPECT_CALL(*this, OnWaitingForDecryptionKey()).Times(0);
137 EXPECT_CALL(*this, OnVideoNaturalSizeChange(_)).Times(0); 138 EXPECT_CALL(*this, OnVideoNaturalSizeChange(_)).Times(0);
138 EXPECT_CALL(*this, OnVideoOpacityChange(_)).Times(0); 139 EXPECT_CALL(*this, OnVideoOpacityChange(_)).Times(0);
139 renderer_->Initialize(&demuxer_stream_, nullptr, this, pipeline_status_cb); 140 renderer_->Initialize(&demuxer_stream_, nullptr, this, pipeline_status_cb);
140 } 141 }
141 142
142 void Initialize() { 143 void Initialize() {
143 EXPECT_CALL(*decoder_, Initialize(_, _, _, _)) 144 EXPECT_CALL(*decoder_, Initialize(_, _, _, _))
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 // Advance far enough that we shouldn't be clamped to current time (tested 943 // Advance far enough that we shouldn't be clamped to current time (tested
943 // already above). 944 // already above).
944 tick_clock_->Advance(kOneSecond); 945 tick_clock_->Advance(kOneSecond);
945 EXPECT_EQ( 946 EXPECT_EQ(
946 current_time + timestamp_helper.GetFrameDuration(frames_to_consume.value), 947 current_time + timestamp_helper.GetFrameDuration(frames_to_consume.value),
947 CurrentMediaWallClockTime(&is_time_moving)); 948 CurrentMediaWallClockTime(&is_time_moving));
948 EXPECT_TRUE(is_time_moving); 949 EXPECT_TRUE(is_time_moving);
949 } 950 }
950 951
951 } // namespace media 952 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698