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

Side by Side Diff: media/blink/webmediaplayer_impl_unittest.cc

Issue 2696663002: Media Remoting: Don't auto suspend the media pipeline. (Closed)
Patch Set: Fix tests. Created 3 years, 10 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/blink/webmediaplayer_impl.cc ('k') | media/remoting/renderer_controller.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/blink/webmediaplayer_impl.h" 5 #include "media/blink/webmediaplayer_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 wmpi_->pipeline_metadata_.has_video = has_video; 245 wmpi_->pipeline_metadata_.has_video = has_video;
246 } 246 }
247 247
248 void OnMetadata(PipelineMetadata metadata) { wmpi_->OnMetadata(metadata); } 248 void OnMetadata(PipelineMetadata metadata) { wmpi_->OnMetadata(metadata); }
249 249
250 void OnVideoNaturalSizeChange(const gfx::Size& size) { 250 void OnVideoNaturalSizeChange(const gfx::Size& size) {
251 wmpi_->OnVideoNaturalSizeChange(size); 251 wmpi_->OnVideoNaturalSizeChange(size);
252 } 252 }
253 253
254 WebMediaPlayerImpl::PlayState ComputePlayState() { 254 WebMediaPlayerImpl::PlayState ComputePlayState() {
255 return wmpi_->UpdatePlayState_ComputePlayState(false, false, false, false); 255 return wmpi_->UpdatePlayState_ComputePlayState(false, true, false, false);
256 } 256 }
257 257
258 WebMediaPlayerImpl::PlayState ComputePlayState_FrameHidden() { 258 WebMediaPlayerImpl::PlayState ComputePlayState_FrameHidden() {
259 return wmpi_->UpdatePlayState_ComputePlayState(false, true, false, true);
260 }
261
262 WebMediaPlayerImpl::PlayState ComputePlayState_Suspended() {
263 return wmpi_->UpdatePlayState_ComputePlayState(false, true, true, false);
264 }
265
266 WebMediaPlayerImpl::PlayState ComputePlayState_Remote() {
267 return wmpi_->UpdatePlayState_ComputePlayState(true, true, false, false);
268 }
269
270 WebMediaPlayerImpl::PlayState ComputePlayState_BackgroundedStreaming() {
259 return wmpi_->UpdatePlayState_ComputePlayState(false, false, false, true); 271 return wmpi_->UpdatePlayState_ComputePlayState(false, false, false, true);
260 } 272 }
261 273
262 WebMediaPlayerImpl::PlayState ComputePlayState_Suspended() {
263 return wmpi_->UpdatePlayState_ComputePlayState(false, false, true, false);
264 }
265
266 WebMediaPlayerImpl::PlayState ComputePlayState_Remote() {
267 return wmpi_->UpdatePlayState_ComputePlayState(true, false, false, false);
268 }
269
270 WebMediaPlayerImpl::PlayState ComputePlayState_BackgroundedStreaming() {
271 return wmpi_->UpdatePlayState_ComputePlayState(false, true, false, true);
272 }
273
274 bool IsSuspended() { return wmpi_->pipeline_controller_.IsSuspended(); } 274 bool IsSuspended() { return wmpi_->pipeline_controller_.IsSuspended(); }
275 275
276 void AddBufferedRanges() { 276 void AddBufferedRanges() {
277 wmpi_->buffered_data_source_host_.AddBufferedByteRange(0, 1); 277 wmpi_->buffered_data_source_host_.AddBufferedByteRange(0, 1);
278 } 278 }
279 279
280 void SetDelegateState(WebMediaPlayerImpl::DelegateState state) { 280 void SetDelegateState(WebMediaPlayerImpl::DelegateState state) {
281 wmpi_->SetDelegateState(state, false); 281 wmpi_->SetDelegateState(state, false);
282 } 282 }
283 283
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 781
782 // Average keyframe distance is too big. 782 // Average keyframe distance is too big.
783 SetVideoKeyframeDistanceAverage(base::TimeDelta::FromSeconds(100)); 783 SetVideoKeyframeDistanceAverage(base::TimeDelta::FromSeconds(100));
784 SetDuration(base::TimeDelta::FromSeconds(300)); 784 SetDuration(base::TimeDelta::FromSeconds(300));
785 EXPECT_FALSE(IsBackgroundOptimizationCandidate()); 785 EXPECT_FALSE(IsBackgroundOptimizationCandidate());
786 EXPECT_FALSE(ShouldPauseVideoWhenHidden()); 786 EXPECT_FALSE(ShouldPauseVideoWhenHidden());
787 EXPECT_FALSE(ShouldDisableVideoWhenHidden()); 787 EXPECT_FALSE(ShouldDisableVideoWhenHidden());
788 } 788 }
789 789
790 } // namespace media 790 } // namespace media
OLDNEW
« no previous file with comments | « media/blink/webmediaplayer_impl.cc ('k') | media/remoting/renderer_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698