| 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/common/accelerators/accelerator_controller.h" | 7 #include "ash/common/accelerators/accelerator_controller.h" |
| 8 #include "ash/common/accelerators/accelerator_table.h" | 8 #include "ash/common/accelerators/accelerator_table.h" |
| 9 #include "ash/common/focus_cycler.h" | 9 #include "ash/common/focus_cycler.h" |
| 10 #include "ash/common/material_design/material_design_controller.h" | 10 #include "ash/common/material_design/material_design_controller.h" |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 // Swipe-up to hide. This should have no effect because there are no visible | 574 // Swipe-up to hide. This should have no effect because there are no visible |
| 575 // windows. | 575 // windows. |
| 576 end = below_start - delta; | 576 end = below_start - delta; |
| 577 generator.GestureScrollSequenceWithCallback( | 577 generator.GestureScrollSequenceWithCallback( |
| 578 below_start, end, kTimeDelta, kNumScrollSteps, | 578 below_start, end, kTimeDelta, kNumScrollSteps, |
| 579 base::Bind(&ShelfDragCallback::ProcessScroll, | 579 base::Bind(&ShelfDragCallback::ProcessScroll, |
| 580 base::Unretained(&handler))); | 580 base::Unretained(&handler))); |
| 581 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState()); | 581 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState()); |
| 582 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->GetAutoHideState()); | 582 EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->GetAutoHideState()); |
| 583 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior()); | 583 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior()); |
| 584 | |
| 585 // Avoid a CHECK that makes sure SetAutoHideBehavior is not called too | |
| 586 // frequently. This is to help investigate http://crbug.com/665093 . | |
| 587 shelf->count_auto_hide_changes_ = 0; | |
| 588 } | 584 } |
| 589 | 585 |
| 590 // Makes sure SetVisible updates work area and widget appropriately. | 586 // Makes sure SetVisible updates work area and widget appropriately. |
| 591 TEST_F(ShelfLayoutManagerTest, SetVisible) { | 587 TEST_F(ShelfLayoutManagerTest, SetVisible) { |
| 592 ShelfWidget* shelf_widget = GetShelfWidget(); | 588 ShelfWidget* shelf_widget = GetShelfWidget(); |
| 593 ShelfLayoutManager* manager = shelf_widget->shelf_layout_manager(); | 589 ShelfLayoutManager* manager = shelf_widget->shelf_layout_manager(); |
| 594 // Force an initial layout. | 590 // Force an initial layout. |
| 595 manager->LayoutShelf(); | 591 manager->LayoutShelf(); |
| 596 EXPECT_EQ(SHELF_VISIBLE, manager->visibility_state()); | 592 EXPECT_EQ(SHELF_VISIBLE, manager->visibility_state()); |
| 597 | 593 |
| (...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1822 // Open keyboard in sticky mode. | 1818 // Open keyboard in sticky mode. |
| 1823 kb_controller->ShowKeyboard(true); | 1819 kb_controller->ShowKeyboard(true); |
| 1824 layout_manager->OnKeyboardBoundsChanging(keyboard_bounds()); | 1820 layout_manager->OnKeyboardBoundsChanging(keyboard_bounds()); |
| 1825 | 1821 |
| 1826 // Work area should be changed. | 1822 // Work area should be changed. |
| 1827 EXPECT_NE(orig_work_area, | 1823 EXPECT_NE(orig_work_area, |
| 1828 display::Screen::GetScreen()->GetPrimaryDisplay().work_area()); | 1824 display::Screen::GetScreen()->GetPrimaryDisplay().work_area()); |
| 1829 } | 1825 } |
| 1830 | 1826 |
| 1831 } // namespace ash | 1827 } // namespace ash |
| OLD | NEW |