Index: ash/shelf/shelf_layout_manager_unittest.cc |
diff --git a/ash/shelf/shelf_layout_manager_unittest.cc b/ash/shelf/shelf_layout_manager_unittest.cc |
index 8ee70eccd3ffbeed02a43d5b489d9f83e4393efc..7b3b5d8371cc80034d1030deaca51099787a370f 100644 |
--- a/ash/shelf/shelf_layout_manager_unittest.cc |
+++ b/ash/shelf/shelf_layout_manager_unittest.cc |
@@ -1504,35 +1504,41 @@ TEST_F(ShelfLayoutManagerTest, GestureEdgeSwipe) { |
widget->Show(); |
widget->Maximize(); |
+ aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); |
+ |
aura::Window* window = widget->GetNativeWindow(); |
shelf->LayoutShelf(); |
gfx::Rect shelf_shown = GetShelfWidget()->GetWindowBoundsInScreen(); |
gfx::Rect bounds_shelf = window->bounds(); |
+ |
+ // Edge swipe when SHELF_VISIBLE should not change visibility state. |
+ EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state()); |
+ generator.GestureEdgeSwipe(); |
EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state()); |
+ // Edge swipe when AUTO_HIDE_HIDDEN should change to AUTO_HIDE_SHOWN. |
shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
shelf->LayoutShelf(); |
+ EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state()); |
EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); |
- |
- aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow()); |
generator.GestureEdgeSwipe(); |
- |
- EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state()); |
- EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_NEVER, shelf->auto_hide_behavior()); |
+ EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state()); |
+ EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state()); |
widget->SetFullscreen(true); |
wm::GetWindowState(window)->set_hide_shelf_when_fullscreen(false); |
shelf->UpdateVisibilityState(); |
- gfx::Rect bounds_fullscreen = window->bounds(); |
+ // Edge swipe in fullscreen + AUTO_HIDE_HIDDEN should show the shelf and |
+ // remain fullscreen. |
EXPECT_TRUE(widget->IsFullscreen()); |
+ EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state()); |
EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); |
- |
generator.GestureEdgeSwipe(); |
- EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state()); |
- EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_NEVER, shelf->auto_hide_behavior()); |
- EXPECT_FALSE(widget->IsFullscreen()); |
+ EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state()); |
+ EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state()); |
+ EXPECT_TRUE(widget->IsFullscreen()); |
} |
#if defined(OS_WIN) |