Commit db21cdbe authored by Xiaoqian Dai's avatar Xiaoqian Dai Committed by Commit Bot

overview gesture: disable it by default.

The overview gesture kDragFromShelfToHomeOrOverview feature is disabled
by default, and is only enabled on the devices that has hotseat feature
enabled (i.e., on Krane and on Dogfood devices).

Bug: 1029991, 997885
Change-Id: I2e783b099160b42b03e452d6e4ec044504973c19
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1946881Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Xiaoqian Dai <xdai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720746}
parent 02eca7b1
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "ash/public/cpp/ash_switches.h" #include "ash/public/cpp/ash_switches.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "chromeos/constants/chromeos_switches.h"
namespace ash { namespace ash {
namespace features { namespace features {
...@@ -104,7 +105,7 @@ const base::Feature kSwipingFromLeftEdgeToGoBack{ ...@@ -104,7 +105,7 @@ const base::Feature kSwipingFromLeftEdgeToGoBack{
"SwipingFromLeftEdgeToGoBack", base::FEATURE_ENABLED_BY_DEFAULT}; "SwipingFromLeftEdgeToGoBack", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kDragFromShelfToHomeOrOverview{ const base::Feature kDragFromShelfToHomeOrOverview{
"DragFromShelfToHomeOrOverview", base::FEATURE_ENABLED_BY_DEFAULT}; "DragFromShelfToHomeOrOverview", base::FEATURE_DISABLED_BY_DEFAULT};
bool IsAllowAmbientEQEnabled() { bool IsAllowAmbientEQEnabled() {
return base::FeatureList::IsEnabled(kAllowAmbientEQ); return base::FeatureList::IsEnabled(kAllowAmbientEQ);
...@@ -202,7 +203,11 @@ bool IsSwipingFromLeftEdgeToGoBackEnabled() { ...@@ -202,7 +203,11 @@ bool IsSwipingFromLeftEdgeToGoBackEnabled() {
} }
bool IsDragFromShelfToHomeOrOverviewEnabled() { bool IsDragFromShelfToHomeOrOverviewEnabled() {
return base::FeatureList::IsEnabled(kDragFromShelfToHomeOrOverview); // The kDragFromShelfToHomeOrOverview feature is only enabled on the devices
// that have hotseat enabled (i.e., on Krane and on Dogfood devices) in M80.
// See crbug.com/1029991 for details.
return base::FeatureList::IsEnabled(kDragFromShelfToHomeOrOverview) ||
chromeos::switches::ShouldShowShelfHotseat();
} }
bool IsReduceDisplayNotificationsEnabled() { bool IsReduceDisplayNotificationsEnabled() {
......
...@@ -3228,6 +3228,46 @@ TEST_P(ShelfLayoutManagerTest, RtlPlacement) { ...@@ -3228,6 +3228,46 @@ TEST_P(ShelfLayoutManagerTest, RtlPlacement) {
base::i18n::SetICUDefaultLocale(locale); base::i18n::SetICUDefaultLocale(locale);
} }
// Tests that after dragging window from top of the home screen down, and back
// up again, home screen is visible.
TEST_P(ShelfLayoutManagerTest, HomeToInAppAndBackHomeDrag) {
TabletModeControllerTestApi().EnterTabletMode();
// Create a test window, and press home button to go home.
std::unique_ptr<aura::Window> window =
AshTestBase::CreateTestWindow(gfx::Rect(0, 0, 400, 400));
wm::ActivateWindow(window.get());
PressHomeButton();
GetAppListTestHelper()->CheckVisibility(true);
if (!chromeos::switches::ShouldShowShelfHotseat()) {
// Start downward drag from the top of the display.
ui::test::EventGenerator* generator = GetEventGenerator();
const gfx::Rect display_bounds =
display::Screen::GetScreen()->GetPrimaryDisplay().bounds();
generator->MoveTouch(display_bounds.top_center());
generator->PressTouch();
// Move touch to the display center - verify that the active window was
// transformed.
EXPECT_TRUE(window->layer()->transform().IsIdentity());
generator->MoveTouchBy(0, 50);
EXPECT_TRUE(window->IsVisible());
EXPECT_FALSE(window->layer()->transform().IsIdentity());
// Move touch back to the top of display, and release touch.
generator->MoveTouch(display_bounds.top_center());
generator->ReleaseTouch();
// Verify that home screen is shown.
GetAppListTestHelper()->CheckVisibility(true);
EXPECT_FALSE(window->IsVisible());
EXPECT_TRUE(window->layer()->transform().IsIdentity());
}
}
class HotseatShelfLayoutManagerTest class HotseatShelfLayoutManagerTest
: public ShelfLayoutManagerTestBase, : public ShelfLayoutManagerTestBase,
public testing::WithParamInterface<ShelfAutoHideBehavior> { public testing::WithParamInterface<ShelfAutoHideBehavior> {
...@@ -3903,51 +3943,6 @@ TEST_P(HotseatShelfLayoutManagerTest, ExitingOvervieHidesHotseat) { ...@@ -3903,51 +3943,6 @@ TEST_P(HotseatShelfLayoutManagerTest, ExitingOvervieHidesHotseat) {
EXPECT_EQ(HotseatState::kHidden, GetShelfLayoutManager()->hotseat_state()); EXPECT_EQ(HotseatState::kHidden, GetShelfLayoutManager()->hotseat_state());
} }
// Tests that after dragging window from top of the home screen down, and back
// up again, the hotseat is shown on the home screen.
TEST_P(HotseatShelfLayoutManagerTest, HomeToInAppAndBackHomeDrag) {
base::test::ScopedFeatureList scoped_features;
scoped_features.InitAndDisableFeature(
features::kDragFromShelfToHomeOrOverview);
GetPrimaryShelf()->SetAutoHideBehavior(GetParam());
TabletModeControllerTestApi().EnterTabletMode();
// Create a test window, and press home button to go home.
std::unique_ptr<aura::Window> window =
AshTestBase::CreateTestWindow(gfx::Rect(0, 0, 400, 400));
wm::ActivateWindow(window.get());
PressHomeButton();
GetAppListTestHelper()->CheckVisibility(true);
EXPECT_EQ(HotseatState::kShown, GetShelfLayoutManager()->hotseat_state());
// Start downward drag from the top of the display.
ui::test::EventGenerator* generator = GetEventGenerator();
const gfx::Rect display_bounds =
display::Screen::GetScreen()->GetPrimaryDisplay().bounds();
generator->MoveTouch(display_bounds.top_center());
generator->PressTouch();
// Move touch to the display center - verify that the active window was
// transformed.
EXPECT_TRUE(window->layer()->transform().IsIdentity());
generator->MoveTouchBy(0, 50);
EXPECT_TRUE(window->IsVisible());
EXPECT_FALSE(window->layer()->transform().IsIdentity());
// Move touch back to the top of display, and release touch.
generator->MoveTouch(display_bounds.top_center());
generator->ReleaseTouch();
// Verify that both home screen and hotseat are shown.
GetAppListTestHelper()->CheckVisibility(true);
EXPECT_EQ(HotseatState::kShown, GetShelfLayoutManager()->hotseat_state());
EXPECT_FALSE(window->IsVisible());
EXPECT_TRUE(window->layer()->transform().IsIdentity());
}
// Tests that swiping downward, towards the bezel, from a variety of points // Tests that swiping downward, towards the bezel, from a variety of points
// results in hiding the hotseat. // results in hiding the hotseat.
TEST_F(HotseatShelfLayoutManagerTest, HotseatHidesWhenSwipedToBezel) { TEST_F(HotseatShelfLayoutManagerTest, HotseatHidesWhenSwipedToBezel) {
......
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