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

Unified Diff: content/renderer/media/webmediaplayer_ms_unittest.cc

Issue 2536893002: Reset WebMediaPlayerMS video layer on rotation change (Closed)
Patch Set: Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/media/webmediaplayer_ms.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/webmediaplayer_ms_unittest.cc
diff --git a/content/renderer/media/webmediaplayer_ms_unittest.cc b/content/renderer/media/webmediaplayer_ms_unittest.cc
index ca98f859cd60f99000aa6a9e424fb4291e024b3a..a7419b8edc079e799406d734b0aaef447c36be6e 100644
--- a/content/renderer/media/webmediaplayer_ms_unittest.cc
+++ b/content/renderer/media/webmediaplayer_ms_unittest.cc
@@ -730,13 +730,13 @@ INSTANTIATE_TEST_CASE_P(,
// During this test, we check that when we send rotated video frames, it applies
// to player's natural size.
-TEST_F(WebMediaPlayerMSTest, RotatedVideoFrame) {
+TEST_F(WebMediaPlayerMSTest, RotationChange) {
MockMediaStreamVideoRenderer* provider = LoadAndGetFrameProvider(true);
- static int tokens[] = {0, 33, 66};
+ const int kTestBrake = static_cast<int>(FrameType::TEST_BRAKE);
+ static int tokens[] = {0, 33, kTestBrake};
std::vector<int> timestamps(tokens, tokens + sizeof(tokens) / sizeof(int));
provider->QueueFrames(timestamps, false, false, 17, media::VIDEO_ROTATION_90);
-
EXPECT_CALL(*this, DoSetWebLayer(true));
EXPECT_CALL(*this, DoStartRendering());
EXPECT_CALL(*this, DoReadyStateChanged(
@@ -747,12 +747,23 @@ TEST_F(WebMediaPlayerMSTest, RotatedVideoFrame) {
CheckSizeChanged(gfx::Size(kStandardWidth, kStandardHeight)));
message_loop_controller_.RunAndWaitForStatus(
media::PipelineStatus::PIPELINE_OK);
- const blink::WebSize& natural_size = player_->naturalSize();
+ blink::WebSize natural_size = player_->naturalSize();
// Check that height and width are flipped.
EXPECT_EQ(kStandardHeight, natural_size.width);
EXPECT_EQ(kStandardWidth, natural_size.height);
- testing::Mock::VerifyAndClearExpectations(this);
+ // Change rotation.
+ provider->QueueFrames(timestamps, false, false, 17, media::VIDEO_ROTATION_0);
+ EXPECT_CALL(*this, DoSetWebLayer(true));
+ EXPECT_CALL(*this, DoStopRendering());
+ EXPECT_CALL(*this, DoStartRendering());
+ message_loop_controller_.RunAndWaitForStatus(
+ media::PipelineStatus::PIPELINE_OK);
+ natural_size = player_->naturalSize();
+ EXPECT_EQ(kStandardHeight, natural_size.height);
+ EXPECT_EQ(kStandardWidth, natural_size.width);
+
+ testing::Mock::VerifyAndClearExpectations(this);
EXPECT_CALL(*this, DoSetWebLayer(false));
EXPECT_CALL(*this, DoStopRendering());
}
« no previous file with comments | « content/renderer/media/webmediaplayer_ms.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698