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

Unified Diff: ash/shelf/shelf_layout_manager_unittest.cc

Issue 100903002: Ignore fullscreen windows which are behind other windows for fullscreen mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years 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
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 1009ce98d7d55ec4398c5b35945de90c6b90cd87..220a257dad3949d6a25e994f0f9636d3703c00f7 100644
--- a/ash/shelf/shelf_layout_manager_unittest.cc
+++ b/ash/shelf/shelf_layout_manager_unittest.cc
@@ -1296,8 +1296,8 @@ TEST_F(ShelfLayoutManagerTest, OpenAppListWithShelfAutoHideState) {
EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
}
-// Makes sure shelf will be hidden when app list opens as shelf is in HIDDEN
-// state, and toggling app list won't change shelf visibility state.
+// Toggling the app list removes activation from the fullscreen window and so
+// the shelf should be visible while the app list is shown.
TEST_F(ShelfLayoutManagerTest, OpenAppListWithShelfHiddenState) {
Shell* shell = Shell::GetInstance();
ShelfLayoutManager* shelf = GetShelfLayoutManager();
@@ -1318,7 +1318,7 @@ TEST_F(ShelfLayoutManagerTest, OpenAppListWithShelfHiddenState) {
// Toggle app list to show.
shell->ToggleAppList(NULL);
EXPECT_TRUE(shell->GetAppListTargetVisibility());
- EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state());
+ EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state());
// Toggle app list to hide.
shell->ToggleAppList(NULL);
@@ -1326,6 +1326,31 @@ TEST_F(ShelfLayoutManagerTest, OpenAppListWithShelfHiddenState) {
EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state());
}
+// Tests that the shelf is only hidden for an active fullscreen window and
+// toggles visibility when another window is activated.
+TEST_F(ShelfLayoutManagerTest, ActiveFullscreenWindowHidesShelf) {
+ ShelfLayoutManager* shelf = GetShelfLayoutManager();
+
+ // Create a window and make it full screen.
+ aura::Window* window1 = CreateTestWindow();
+ window1->SetBounds(gfx::Rect(0, 0, 100, 100));
+ window1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
+ window1->Show();
+
+ aura::Window* window2 = CreateTestWindow();
+ window2->SetBounds(gfx::Rect(0, 0, 100, 100));
+ window2->Show();
+
+ wm::GetWindowState(window1)->Activate();
+ EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state());
+
+ wm::GetWindowState(window2)->Activate();
+ EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state());
+
+ wm::GetWindowState(window1)->Activate();
+ EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state());
+}
+
#if defined(OS_WIN)
// RootWindow and Display can't resize on Windows Ash. http://crbug.com/165962
#define MAYBE_SetAlignment DISABLED_SetAlignment

Powered by Google App Engine
This is Rietveld 408576698