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

Unified Diff: ash/shelf/shelf_layout_manager_unittest.cc

Issue 143023003: Fully support the autohide shelf option for touch UI on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to ToT Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/shelf/shelf_layout_manager.cc ('k') | ash/touch/touch_uma.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 968d036631ff63bee23b6068a16e2d47477813f4..928ff3ea3d4cbb37baf95f289fca52d4e47dd8f8 100644
--- a/ash/shelf/shelf_layout_manager_unittest.cc
+++ b/ash/shelf/shelf_layout_manager_unittest.cc
@@ -1493,6 +1493,48 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetAlignment) {
display.work_area().y() - display.bounds().y());
}
+TEST_F(ShelfLayoutManagerTest, GestureEdgeSwipe) {
+ ShelfLayoutManager* shelf = GetShelfLayoutManager();
+ shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
+ views::Widget* widget = new views::Widget;
+ views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
+ params.bounds = gfx::Rect(0, 0, 200, 200);
+ params.context = CurrentContext();
+ widget->Init(params);
+ widget->Show();
+ widget->Maximize();
+
+ aura::Window* window = widget->GetNativeWindow();
+ shelf->LayoutShelf();
+
+ gfx::Rect shelf_shown = GetShelfWidget()->GetWindowBoundsInScreen();
+ gfx::Rect bounds_shelf = window->bounds();
+ EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state());
+
+ shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
+ shelf->LayoutShelf();
+ 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());
+
+ widget->SetFullscreen(true);
+ wm::GetWindowState(window)->set_hide_shelf_when_fullscreen(false);
+ shelf->UpdateVisibilityState();
+
+ gfx::Rect bounds_fullscreen = window->bounds();
+ EXPECT_TRUE(widget->IsFullscreen());
+ 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());
+}
+
#if defined(OS_WIN)
// RootWindow and Display can't resize on Windows Ash. http://crbug.com/165962
#define MAYBE_GestureDrag DISABLED_GestureDrag
« no previous file with comments | « ash/shelf/shelf_layout_manager.cc ('k') | ash/touch/touch_uma.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698