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_manager.h" | 10 #include "ash/display/display_manager.h" |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 | 790 |
791 #if defined(OS_WIN) | 791 #if defined(OS_WIN) |
792 // RootWindow and Display can't resize on Windows Ash. http://crbug.com/165962 | 792 // RootWindow and Display can't resize on Windows Ash. http://crbug.com/165962 |
793 #define MAYBE_AutoHide DISABLED_AutoHide | 793 #define MAYBE_AutoHide DISABLED_AutoHide |
794 #else | 794 #else |
795 #define MAYBE_AutoHide AutoHide | 795 #define MAYBE_AutoHide AutoHide |
796 #endif | 796 #endif |
797 | 797 |
798 // Various assertions around auto-hide. | 798 // Various assertions around auto-hide. |
799 TEST_F(ShelfLayoutManagerTest, MAYBE_AutoHide) { | 799 TEST_F(ShelfLayoutManagerTest, MAYBE_AutoHide) { |
800 aura::RootWindow* root = Shell::GetPrimaryRootWindow(); | 800 aura::Window* root = Shell::GetPrimaryRootWindow(); |
801 aura::test::EventGenerator generator(root, root); | 801 aura::test::EventGenerator generator(root, root); |
802 generator.MoveMouseTo(0, 0); | 802 generator.MoveMouseTo(0, 0); |
803 | 803 |
804 ShelfLayoutManager* shelf = GetShelfLayoutManager(); | 804 ShelfLayoutManager* shelf = GetShelfLayoutManager(); |
805 shelf->SetAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 805 shelf->SetAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
806 views::Widget* widget = new views::Widget; | 806 views::Widget* widget = new views::Widget; |
807 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); | 807 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); |
808 params.bounds = gfx::Rect(0, 0, 200, 200); | 808 params.bounds = gfx::Rect(0, 0, 200, 200); |
809 params.context = CurrentContext(); | 809 params.context = CurrentContext(); |
810 // Widget is now owned by the parent window. | 810 // Widget is now owned by the parent window. |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); | 967 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); |
968 params.bounds = gfx::Rect(0, 0, 200, 200); | 968 params.bounds = gfx::Rect(0, 0, 200, 200); |
969 params.context = CurrentContext(); | 969 params.context = CurrentContext(); |
970 // Widget is now owned by the parent window. | 970 // Widget is now owned by the parent window. |
971 widget->Init(params); | 971 widget->Init(params); |
972 widget->Maximize(); | 972 widget->Maximize(); |
973 widget->Show(); | 973 widget->Show(); |
974 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state()); | 974 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state()); |
975 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); | 975 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); |
976 | 976 |
977 aura::RootWindow* root = Shell::GetPrimaryRootWindow(); | 977 aura::Window* root = Shell::GetPrimaryRootWindow(); |
978 // LayoutShelf() forces the animation to completion, at which point the | 978 // LayoutShelf() forces the animation to completion, at which point the |
979 // launcher should go off the screen. | 979 // launcher should go off the screen. |
980 shelf->LayoutShelf(); | 980 shelf->LayoutShelf(); |
981 EXPECT_EQ(root->bounds().bottom() - ShelfLayoutManager::kAutoHideSize, | 981 EXPECT_EQ(root->bounds().bottom() - ShelfLayoutManager::kAutoHideSize, |
982 GetShelfWidget()->GetWindowBoundsInScreen().y()); | 982 GetShelfWidget()->GetWindowBoundsInScreen().y()); |
983 | 983 |
984 aura::Window* lock_container = Shell::GetContainer( | 984 aura::Window* lock_container = Shell::GetContainer( |
985 Shell::GetPrimaryRootWindow(), | 985 Shell::GetPrimaryRootWindow(), |
986 internal::kShellWindowId_LockScreenContainer); | 986 internal::kShellWindowId_LockScreenContainer); |
987 | 987 |
(...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1870 shelf->SetAlignment(SHELF_ALIGNMENT_LEFT); | 1870 shelf->SetAlignment(SHELF_ALIGNMENT_LEFT); |
1871 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); | 1871 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); |
1872 generator.ClickLeftButton(); | 1872 generator.ClickLeftButton(); |
1873 EXPECT_TRUE(status_area_widget->IsMessageBubbleShown()); | 1873 EXPECT_TRUE(status_area_widget->IsMessageBubbleShown()); |
1874 generator.ClickLeftButton(); | 1874 generator.ClickLeftButton(); |
1875 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); | 1875 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); |
1876 } | 1876 } |
1877 | 1877 |
1878 } // namespace internal | 1878 } // namespace internal |
1879 } // namespace ash | 1879 } // namespace ash |
OLD | NEW |