| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/shelf/shelf_layout_manager.h" | 5 #include "ash/shelf/shelf_layout_manager.h" |
| 6 | 6 |
| 7 #include "ash/accelerators/accelerator_controller.h" | 7 #include "ash/accelerators/accelerator_controller.h" |
| 8 #include "ash/accelerators/accelerator_table.h" | 8 #include "ash/accelerators/accelerator_table.h" |
| 9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/display/display_controller.h" | 10 #include "ash/display/display_controller.h" |
| (...skipping 1495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1506 | 1506 |
| 1507 // Hide app list, both shelves should be hidden. | 1507 // Hide app list, both shelves should be hidden. |
| 1508 shell->DismissAppList(); | 1508 shell->DismissAppList(); |
| 1509 EXPECT_FALSE(shell->GetAppListTargetVisibility()); | 1509 EXPECT_FALSE(shell->GetAppListTargetVisibility()); |
| 1510 EXPECT_EQ(SHELF_AUTO_HIDE, shelf_1->visibility_state()); | 1510 EXPECT_EQ(SHELF_AUTO_HIDE, shelf_1->visibility_state()); |
| 1511 EXPECT_EQ(SHELF_AUTO_HIDE, shelf_2->visibility_state()); | 1511 EXPECT_EQ(SHELF_AUTO_HIDE, shelf_2->visibility_state()); |
| 1512 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf_1->auto_hide_state()); | 1512 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf_1->auto_hide_state()); |
| 1513 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf_2->auto_hide_state()); | 1513 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf_2->auto_hide_state()); |
| 1514 } | 1514 } |
| 1515 | 1515 |
| 1516 // Makes sure shelf will be hidden when app list opens as shelf is in HIDDEN | 1516 // Makes sure the shelf will be hidden when we have a fullscreen window, and it |
| 1517 // state, and toggling app list won't change shelf visibility state. | 1517 // will unhide when we open the app list. |
| 1518 TEST_F(ShelfLayoutManagerTest, OpenAppListWithShelfHiddenState) { | 1518 TEST_F(ShelfLayoutManagerTest, OpenAppListWithShelfHiddenState) { |
| 1519 Shell* shell = Shell::GetInstance(); | 1519 Shell* shell = Shell::GetInstance(); |
| 1520 ShelfLayoutManager* shelf = GetShelfLayoutManager(); | 1520 ShelfLayoutManager* shelf = GetShelfLayoutManager(); |
| 1521 // For shelf to be visible, app list is not open in initial state. | 1521 // For shelf to be visible, app list is not open in initial state. |
| 1522 shelf->LayoutShelf(); | 1522 shelf->LayoutShelf(); |
| 1523 | 1523 |
| 1524 // Create a window and make it full screen. | 1524 // Create a window and make it full screen. |
| 1525 aura::Window* window = CreateTestWindow(); | 1525 aura::Window* window = CreateTestWindow(); |
| 1526 window->SetBounds(gfx::Rect(0, 0, 100, 100)); | 1526 window->SetBounds(gfx::Rect(0, 0, 100, 100)); |
| 1527 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); | 1527 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); |
| 1528 window->Show(); | 1528 window->Show(); |
| 1529 wm::ActivateWindow(window); | 1529 wm::ActivateWindow(window); |
| 1530 | 1530 |
| 1531 // App list and shelf is not shown. | 1531 // App list and shelf is not shown. |
| 1532 EXPECT_FALSE(shell->GetAppListTargetVisibility()); | 1532 EXPECT_FALSE(shell->GetAppListTargetVisibility()); |
| 1533 EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state()); | 1533 EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state()); |
| 1534 | 1534 |
| 1535 // Show app list. | 1535 // Show app list. |
| 1536 shell->ShowAppList(NULL); | 1536 shell->ShowAppList(NULL); |
| 1537 EXPECT_TRUE(shell->GetAppListTargetVisibility()); | 1537 EXPECT_TRUE(shell->GetAppListTargetVisibility()); |
| 1538 EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state()); | 1538 EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state()); |
| 1539 | 1539 |
| 1540 // Hide app list. | 1540 // Hide app list. |
| 1541 shell->DismissAppList(); | 1541 shell->DismissAppList(); |
| 1542 EXPECT_FALSE(shell->GetAppListTargetVisibility()); | 1542 EXPECT_FALSE(shell->GetAppListTargetVisibility()); |
| 1543 EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state()); | 1543 EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state()); |
| 1544 } | 1544 } |
| 1545 | 1545 |
| 1546 // Tests the correct behavior of the shelf when there is a system modal window | 1546 // Tests the correct behavior of the shelf when there is a system modal window |
| 1547 // open when we have a single display. | 1547 // open when we have a single display. |
| 1548 TEST_F(ShelfLayoutManagerTest, ShelfWithSystemModalWindowSingleDisplay) { | 1548 TEST_F(ShelfLayoutManagerTest, ShelfWithSystemModalWindowSingleDisplay) { |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2263 shelf->ShutdownStatusAreaWidget(); | 2263 shelf->ShutdownStatusAreaWidget(); |
| 2264 shelf_manager->PrepareForShutdown(); | 2264 shelf_manager->PrepareForShutdown(); |
| 2265 | 2265 |
| 2266 // Deleting a focused maximized window will switch focus to |window2|. This | 2266 // Deleting a focused maximized window will switch focus to |window2|. This |
| 2267 // would normally cause the ShelfLayoutManager to update its state. However | 2267 // would normally cause the ShelfLayoutManager to update its state. However |
| 2268 // during shutdown we want to handle this without crashing. | 2268 // during shutdown we want to handle this without crashing. |
| 2269 delete window1; | 2269 delete window1; |
| 2270 } | 2270 } |
| 2271 | 2271 |
| 2272 } // namespace ash | 2272 } // namespace ash |
| OLD | NEW |