| 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/common/shelf/shelf_layout_manager.h" | 5 #include "ash/common/shelf/shelf_layout_manager.h" |
| 6 | 6 |
| 7 #include "ash/aura/wm_shelf_aura.h" | 7 #include "ash/aura/wm_shelf_aura.h" |
| 8 #include "ash/aura/wm_window_aura.h" | 8 #include "ash/aura/wm_window_aura.h" |
| 9 #include "ash/common/accelerators/accelerator_controller.h" | 9 #include "ash/common/accelerators/accelerator_controller.h" |
| 10 #include "ash/common/accelerators/accelerator_table.h" | 10 #include "ash/common/accelerators/accelerator_table.h" |
| (...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 815 } | 815 } |
| 816 | 816 |
| 817 // Test the behavior of the shelf when it is auto hidden and it is on the | 817 // Test the behavior of the shelf when it is auto hidden and it is on the |
| 818 // boundary between the primary and the secondary display. | 818 // boundary between the primary and the secondary display. |
| 819 TEST_F(ShelfLayoutManagerTest, AutoHideShelfOnScreenBoundary) { | 819 TEST_F(ShelfLayoutManagerTest, AutoHideShelfOnScreenBoundary) { |
| 820 if (!SupportsMultipleDisplays()) | 820 if (!SupportsMultipleDisplays()) |
| 821 return; | 821 return; |
| 822 | 822 |
| 823 UpdateDisplay("800x600,800x600"); | 823 UpdateDisplay("800x600,800x600"); |
| 824 Shell::GetInstance()->display_manager()->SetLayoutForCurrentDisplays( | 824 Shell::GetInstance()->display_manager()->SetLayoutForCurrentDisplays( |
| 825 test::CreateDisplayLayout(display::DisplayPlacement::RIGHT, 0)); | 825 test::CreateDisplayLayout(display_manager(), |
| 826 display::DisplayPlacement::RIGHT, 0)); |
| 826 // Put the primary monitor's shelf on the display boundary. | 827 // Put the primary monitor's shelf on the display boundary. |
| 827 WmShelf* shelf = GetPrimaryShelf(); | 828 WmShelf* shelf = GetPrimaryShelf(); |
| 828 shelf->SetAlignment(SHELF_ALIGNMENT_RIGHT); | 829 shelf->SetAlignment(SHELF_ALIGNMENT_RIGHT); |
| 829 | 830 |
| 830 // Create a window because the shelf is always shown when no windows are | 831 // Create a window because the shelf is always shown when no windows are |
| 831 // visible. | 832 // visible. |
| 832 CreateTestWidget(); | 833 CreateTestWidget(); |
| 833 | 834 |
| 834 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 835 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
| 835 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState()); | 836 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState()); |
| (...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2078 // Open keyboard in sticky mode. | 2079 // Open keyboard in sticky mode. |
| 2079 kb_controller->ShowKeyboard(true); | 2080 kb_controller->ShowKeyboard(true); |
| 2080 layout_manager->OnKeyboardBoundsChanging(keyboard_bounds()); | 2081 layout_manager->OnKeyboardBoundsChanging(keyboard_bounds()); |
| 2081 | 2082 |
| 2082 // Work area should be changed. | 2083 // Work area should be changed. |
| 2083 EXPECT_NE(orig_work_area, | 2084 EXPECT_NE(orig_work_area, |
| 2084 display::Screen::GetScreen()->GetPrimaryDisplay().work_area()); | 2085 display::Screen::GetScreen()->GetPrimaryDisplay().work_area()); |
| 2085 } | 2086 } |
| 2086 | 2087 |
| 2087 } // namespace ash | 2088 } // namespace ash |
| OLD | NEW |