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

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

Issue 1978973002: Moves video frame callbacks from VideoFrameCompositor to Renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addresses comments Created 4 years, 7 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.h » ('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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « media/mojo/services/mojo_renderer_service.cc ('k') | media/renderers/renderer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698