Chromium Code Reviews| 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 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 702 // Run the animation to completion. | 702 // Run the animation to completion. |
| 703 StepWidgetLayerAnimatorToEnd(shelf); | 703 StepWidgetLayerAnimatorToEnd(shelf); |
| 704 StepWidgetLayerAnimatorToEnd(shelf->status_area_widget()); | 704 StepWidgetLayerAnimatorToEnd(shelf->status_area_widget()); |
| 705 EXPECT_EQ(SHELF_VISIBLE, manager->visibility_state()); | 705 EXPECT_EQ(SHELF_VISIBLE, manager->visibility_state()); |
| 706 display = screen->GetDisplayNearestWindow( | 706 display = screen->GetDisplayNearestWindow( |
| 707 Shell::GetPrimaryRootWindow()); | 707 Shell::GetPrimaryRootWindow()); |
| 708 EXPECT_EQ(shelf_height, display.GetWorkAreaInsets().bottom()); | 708 EXPECT_EQ(shelf_height, display.GetWorkAreaInsets().bottom()); |
| 709 | 709 |
| 710 // Make sure the bounds of the two widgets changed. | 710 // Make sure the bounds of the two widgets changed. |
| 711 launcher_bounds = shelf->GetNativeView()->bounds(); | 711 launcher_bounds = shelf->GetNativeView()->bounds(); |
| 712 int bottom = | 712 EXPECT_LT(launcher_bounds.y(), |
| 713 screen->GetPrimaryDisplay().bounds().bottom() - shelf_height; | 713 screen->GetPrimaryDisplay().bounds().bottom()); |
|
James Cook
2013/08/22 00:19:12
nit: align indent
Harry McCleave
2013/08/27 00:37:00
Done.
| |
| 714 EXPECT_EQ(launcher_bounds.y(), | |
| 715 bottom + (manager->GetIdealBounds().height() - | |
| 716 launcher_bounds.height()) / 2); | |
| 717 status_bounds = shelf->status_area_widget()->GetNativeView()->bounds(); | 714 status_bounds = shelf->status_area_widget()->GetNativeView()->bounds(); |
| 718 EXPECT_EQ(status_bounds.y(), | 715 EXPECT_LT(status_bounds.y(), |
| 719 bottom + shelf_height - status_bounds.height()); | 716 screen->GetPrimaryDisplay().bounds().bottom()); |
|
James Cook
2013/08/22 00:19:12
nit: align indent
Harry McCleave
2013/08/27 00:37:00
Done.
| |
| 720 } | 717 } |
| 721 | 718 |
| 722 // Makes sure LayoutShelf invoked while animating cleans things up. | 719 // Makes sure LayoutShelf invoked while animating cleans things up. |
| 723 TEST_F(ShelfLayoutManagerTest, LayoutShelfWhileAnimating) { | 720 TEST_F(ShelfLayoutManagerTest, LayoutShelfWhileAnimating) { |
| 724 ShelfWidget* shelf = GetShelfWidget(); | 721 ShelfWidget* shelf = GetShelfWidget(); |
| 725 // Force an initial layout. | 722 // Force an initial layout. |
| 726 shelf->shelf_layout_manager()->LayoutShelf(); | 723 shelf->shelf_layout_manager()->LayoutShelf(); |
| 727 EXPECT_EQ(SHELF_VISIBLE, shelf->shelf_layout_manager()->visibility_state()); | 724 EXPECT_EQ(SHELF_VISIBLE, shelf->shelf_layout_manager()->visibility_state()); |
| 728 | 725 |
| 729 // Hide the shelf. | 726 // Hide the shelf. |
| (...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1824 scoped_ptr<aura::Window> w1(CreateTestWindow()); | 1821 scoped_ptr<aura::Window> w1(CreateTestWindow()); |
| 1825 w1->Show(); | 1822 w1->Show(); |
| 1826 wm::ActivateWindow(w1.get()); | 1823 wm::ActivateWindow(w1.get()); |
| 1827 EXPECT_EQ(SHELF_BACKGROUND_OVERLAP, GetShelfWidget()->GetBackgroundType()); | 1824 EXPECT_EQ(SHELF_BACKGROUND_OVERLAP, GetShelfWidget()->GetBackgroundType()); |
| 1828 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); | 1825 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
| 1829 EXPECT_EQ(SHELF_BACKGROUND_OVERLAP, GetShelfWidget()->GetBackgroundType()); | 1826 EXPECT_EQ(SHELF_BACKGROUND_OVERLAP, GetShelfWidget()->GetBackgroundType()); |
| 1830 } | 1827 } |
| 1831 | 1828 |
| 1832 } // namespace internal | 1829 } // namespace internal |
| 1833 } // namespace ash | 1830 } // namespace ash |
| OLD | NEW |