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

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

Issue 2622803002: Clean-up: media::PipelineMetadata stores the rotated video size. (Closed)
Patch Set: Addressed comments. Created 3 years, 11 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/remoting_renderer_controller.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 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 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 ASSERT_EQ(blink::WebSize(1920, 1080), wmpi_->naturalSize()); 671 ASSERT_EQ(blink::WebSize(1920, 1080), wmpi_->naturalSize());
672 } 672 }
673 673
674 TEST_F(WebMediaPlayerImplTest, NaturalSizeChange_Rotated) { 674 TEST_F(WebMediaPlayerImplTest, NaturalSizeChange_Rotated) {
675 InitializeWebMediaPlayerImpl(); 675 InitializeWebMediaPlayerImpl();
676 PipelineMetadata metadata; 676 PipelineMetadata metadata;
677 metadata.has_video = true; 677 metadata.has_video = true;
678 metadata.natural_size = gfx::Size(320, 240); 678 metadata.natural_size = gfx::Size(320, 240);
679 metadata.video_rotation = VIDEO_ROTATION_90; 679 metadata.video_rotation = VIDEO_ROTATION_90;
680 680
681 OnMetadata(metadata);
682 ASSERT_EQ(blink::WebSize(320, 240), wmpi_->naturalSize());
683
681 // For 90/270deg rotations, the natural size should be transposed. 684 // For 90/270deg rotations, the natural size should be transposed.
682 OnMetadata(metadata);
683 ASSERT_EQ(blink::WebSize(240, 320), wmpi_->naturalSize());
684
685 OnVideoNaturalSizeChange(gfx::Size(1920, 1080)); 685 OnVideoNaturalSizeChange(gfx::Size(1920, 1080));
686 ASSERT_EQ(blink::WebSize(1080, 1920), wmpi_->naturalSize()); 686 ASSERT_EQ(blink::WebSize(1080, 1920), wmpi_->naturalSize());
687 } 687 }
688 688
689 // Audible backgrounded videos are not suspended if delegate_ allows it. 689 // Audible backgrounded videos are not suspended if delegate_ allows it.
690 TEST_F(WebMediaPlayerImplTest, ComputePlayState_BackgroundedVideoPlaying) { 690 TEST_F(WebMediaPlayerImplTest, ComputePlayState_BackgroundedVideoPlaying) {
691 InitializeWebMediaPlayerImpl(); 691 InitializeWebMediaPlayerImpl();
692 WebMediaPlayerImpl::PlayState state; 692 WebMediaPlayerImpl::PlayState state;
693 SetMetadata(true, true); 693 SetMetadata(true, true);
694 SetReadyState(blink::WebMediaPlayer::ReadyStateHaveFutureData); 694 SetReadyState(blink::WebMediaPlayer::ReadyStateHaveFutureData);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 EXPECT_CALL(delegate_, DidPlay(_, true, false, false, _)); 749 EXPECT_CALL(delegate_, DidPlay(_, true, false, false, _));
750 client_.set_is_autoplaying_muted(true); 750 client_.set_is_autoplaying_muted(true);
751 SetDelegateState(WebMediaPlayerImpl::DelegateState::PLAYING); 751 SetDelegateState(WebMediaPlayerImpl::DelegateState::PLAYING);
752 752
753 EXPECT_CALL(delegate_, DidPlay(_, true, true, false, _)); 753 EXPECT_CALL(delegate_, DidPlay(_, true, true, false, _));
754 client_.set_is_autoplaying_muted(false); 754 client_.set_is_autoplaying_muted(false);
755 wmpi_->setVolume(1.0); 755 wmpi_->setVolume(1.0);
756 } 756 }
757 757
758 } // namespace media 758 } // namespace media
OLDNEW
« no previous file with comments | « media/blink/webmediaplayer_impl.cc ('k') | media/remoting/remoting_renderer_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698