Commit edacd267 authored by Mounir Lamouri's avatar Mounir Lamouri Committed by Commit Bot

Media Controls: enable feature to use cut-out whenever possible.

It's Android only. Trunk currently allows the user to expand into the
cutout area. With this change, it will instead allow the user to reduce
out of the cutout area.

Bug: 1077400
Change-Id: I99c15f671c0b085dcaf770e594cd06e722192a9b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2218453
Commit-Queue: Mounir Lamouri <mlamouri@chromium.org>
Auto-Submit: Mounir Lamouri <mlamouri@chromium.org>
Reviewed-by: default avatarDavid Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772426}
parent b1cdadd9
...@@ -289,7 +289,11 @@ TEST_F(MediaControlsDisplayCutoutDelegateTest, SingleTouchGesture_Noop) { ...@@ -289,7 +289,11 @@ TEST_F(MediaControlsDisplayCutoutDelegateTest, SingleTouchGesture_Noop) {
// Simulate a single touch gesture and make sure it had no effect. // Simulate a single touch gesture and make sure it had no effect.
SimulateEnterFullscreen(); SimulateEnterFullscreen();
SimulateSingleTouchGesture(); SimulateSingleTouchGesture();
EXPECT_EQ(mojom::ViewportFit::kAuto, CurrentViewportFit()); mojom::ViewportFit expected =
RuntimeEnabledFeatures::MediaControlsUseCutOutByDefaultEnabled()
? mojom::ViewportFit::kCoverForcedByUserAgent
: mojom::ViewportFit::kAuto;
EXPECT_EQ(expected, CurrentViewportFit());
} }
TEST_F(MediaControlsDisplayCutoutDelegateTest, TouchCancelShouldClearState) { TEST_F(MediaControlsDisplayCutoutDelegateTest, TouchCancelShouldClearState) {
...@@ -304,7 +308,11 @@ TEST_F(MediaControlsDisplayCutoutDelegateTest, TouchCancelShouldClearState) { ...@@ -304,7 +308,11 @@ TEST_F(MediaControlsDisplayCutoutDelegateTest, TouchCancelShouldClearState) {
list = CreateTouchListWithTwoPoints(1, 1, -1, -1); list = CreateTouchListWithTwoPoints(1, 1, -1, -1);
SimulateEvent(CreateTouchEventWithList(event_type_names::kTouchcancel, list)); SimulateEvent(CreateTouchEventWithList(event_type_names::kTouchcancel, list));
EXPECT_FALSE(HasGestureState()); EXPECT_FALSE(HasGestureState());
EXPECT_EQ(mojom::ViewportFit::kAuto, CurrentViewportFit()); mojom::ViewportFit expected =
RuntimeEnabledFeatures::MediaControlsUseCutOutByDefaultEnabled()
? mojom::ViewportFit::kCoverForcedByUserAgent
: mojom::ViewportFit::kAuto;
EXPECT_EQ(expected, CurrentViewportFit());
} }
TEST_F(MediaControlsDisplayCutoutDelegateTest, TouchEndShouldClearState) { TEST_F(MediaControlsDisplayCutoutDelegateTest, TouchEndShouldClearState) {
...@@ -319,7 +327,12 @@ TEST_F(MediaControlsDisplayCutoutDelegateTest, TouchEndShouldClearState) { ...@@ -319,7 +327,12 @@ TEST_F(MediaControlsDisplayCutoutDelegateTest, TouchEndShouldClearState) {
list = CreateTouchListWithTwoPoints(1, 1, -1, -1); list = CreateTouchListWithTwoPoints(1, 1, -1, -1);
SimulateEvent(CreateTouchEventWithList(event_type_names::kTouchend, list)); SimulateEvent(CreateTouchEventWithList(event_type_names::kTouchend, list));
EXPECT_FALSE(HasGestureState()); EXPECT_FALSE(HasGestureState());
EXPECT_EQ(mojom::ViewportFit::kAuto, CurrentViewportFit());
mojom::ViewportFit expected =
RuntimeEnabledFeatures::MediaControlsUseCutOutByDefaultEnabled()
? mojom::ViewportFit::kCoverForcedByUserAgent
: mojom::ViewportFit::kAuto;
EXPECT_EQ(expected, CurrentViewportFit());
} }
TEST_F(MediaControlsDisplayCutoutDelegateTest, DefaultExpand) { TEST_F(MediaControlsDisplayCutoutDelegateTest, DefaultExpand) {
......
...@@ -1049,7 +1049,8 @@ ...@@ -1049,7 +1049,8 @@
status: {"Android": "stable"}, status: {"Android": "stable"},
}, },
{ {
name: "MediaControlsUseCutOutByDefault" name: "MediaControlsUseCutOutByDefault",
status: "stable",
}, },
{ {
name: "MediaDocumentDownloadButton", name: "MediaDocumentDownloadButton",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment