| 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/root_window_controller.h" | 5 #include "ash/root_window_controller.h" |
| 6 | 6 |
| 7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
| 8 #include "ash/shelf/shelf_layout_manager.h" |
| 8 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 9 #include "ash/shell_delegate.h" | 10 #include "ash/shell_delegate.h" |
| 10 #include "ash/shell_window_ids.h" | 11 #include "ash/shell_window_ids.h" |
| 11 #include "ash/system/tray/system_tray_delegate.h" | 12 #include "ash/system/tray/system_tray_delegate.h" |
| 12 #include "ash/test/ash_test_base.h" | 13 #include "ash/test/ash_test_base.h" |
| 13 #include "ash/wm/system_modal_container_layout_manager.h" | 14 #include "ash/wm/system_modal_container_layout_manager.h" |
| 14 #include "ash/wm/window_properties.h" | 15 #include "ash/wm/window_properties.h" |
| 15 #include "ash/wm/window_util.h" | 16 #include "ash/wm/window_util.h" |
| 16 #include "ui/aura/client/focus_change_observer.h" | 17 #include "ui/aura/client/focus_change_observer.h" |
| 17 #include "ui/aura/client/focus_client.h" | 18 #include "ui/aura/client/focus_client.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 #define MAYBE_MoveWindows_Basic DISABLED_MoveWindows_Basic | 123 #define MAYBE_MoveWindows_Basic DISABLED_MoveWindows_Basic |
| 123 #else | 124 #else |
| 124 #define MAYBE_MoveWindows_Basic MoveWindows_Basic | 125 #define MAYBE_MoveWindows_Basic MoveWindows_Basic |
| 125 #endif | 126 #endif |
| 126 | 127 |
| 127 TEST_F(RootWindowControllerTest, MAYBE_MoveWindows_Basic) { | 128 TEST_F(RootWindowControllerTest, MAYBE_MoveWindows_Basic) { |
| 128 UpdateDisplay("600x600,500x500"); | 129 UpdateDisplay("600x600,500x500"); |
| 129 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); | 130 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); |
| 130 internal::RootWindowController* controller = | 131 internal::RootWindowController* controller = |
| 131 Shell::GetPrimaryRootWindowController(); | 132 Shell::GetPrimaryRootWindowController(); |
| 132 controller->SetShelfAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 133 internal::ShelfLayoutManager* shelf_layout_manager = |
| 134 controller->shelf_layout_manager(); |
| 135 shelf_layout_manager->SetAutoHideBehavior( |
| 136 ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
| 133 | 137 |
| 134 views::Widget* normal = CreateTestWidget(gfx::Rect(650, 10, 100, 100)); | 138 views::Widget* normal = CreateTestWidget(gfx::Rect(650, 10, 100, 100)); |
| 135 EXPECT_EQ(root_windows[1], normal->GetNativeView()->GetRootWindow()); | 139 EXPECT_EQ(root_windows[1], normal->GetNativeView()->GetRootWindow()); |
| 136 EXPECT_EQ("650,10 100x100", normal->GetWindowBoundsInScreen().ToString()); | 140 EXPECT_EQ("650,10 100x100", normal->GetWindowBoundsInScreen().ToString()); |
| 137 EXPECT_EQ("50,10 100x100", | 141 EXPECT_EQ("50,10 100x100", |
| 138 normal->GetNativeView()->GetBoundsInRootWindow().ToString()); | 142 normal->GetNativeView()->GetBoundsInRootWindow().ToString()); |
| 139 | 143 |
| 140 views::Widget* maximized = CreateTestWidget(gfx::Rect(700, 10, 100, 100)); | 144 views::Widget* maximized = CreateTestWidget(gfx::Rect(700, 10, 100, 100)); |
| 141 maximized->Maximize(); | 145 maximized->Maximize(); |
| 142 EXPECT_EQ(root_windows[1], maximized->GetNativeView()->GetRootWindow()); | 146 EXPECT_EQ(root_windows[1], maximized->GetNativeView()->GetRootWindow()); |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 Widget* w2 = | 394 Widget* w2 = |
| 391 Widget::CreateWindowWithParentAndBounds(NULL, | 395 Widget::CreateWindowWithParentAndBounds(NULL, |
| 392 w1->GetNativeWindow(), | 396 w1->GetNativeWindow(), |
| 393 gfx::Rect(0, 1, 150, 151)); | 397 gfx::Rect(0, 1, 150, 151)); |
| 394 w2->Show(); | 398 w2->Show(); |
| 395 EXPECT_TRUE(controller->IsImmersiveMode()); | 399 EXPECT_TRUE(controller->IsImmersiveMode()); |
| 396 } | 400 } |
| 397 | 401 |
| 398 } // namespace test | 402 } // namespace test |
| 399 } // namespace ash | 403 } // namespace ash |
| OLD | NEW |