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/screen_ash.h" | 5 #include "ash/screen_ash.h" |
6 | 6 |
7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
| 9 #include "ash/shelf/shelf_layout_manager.h" |
| 10 #include "ash/shelf/shelf_widget.h" |
9 #include "ash/shell.h" | 11 #include "ash/shell.h" |
10 #include "ash/test/ash_test_base.h" | 12 #include "ash/test/ash_test_base.h" |
11 #include "ash/wm/window_util.h" | 13 #include "ash/wm/window_util.h" |
12 #include "ui/aura/env.h" | 14 #include "ui/aura/env.h" |
13 #include "ui/aura/root_window.h" | 15 #include "ui/aura/root_window.h" |
14 #include "ui/aura/window.h" | 16 #include "ui/aura/window.h" |
15 #include "ui/views/widget/widget.h" | 17 #include "ui/views/widget/widget.h" |
16 #include "ui/views/widget/widget_delegate.h" | 18 #include "ui/views/widget/widget_delegate.h" |
17 | 19 |
18 namespace ash { | 20 namespace ash { |
19 namespace test { | 21 namespace test { |
20 | 22 |
21 typedef test::AshTestBase ScreenAshTest; | 23 typedef test::AshTestBase ScreenAshTest; |
22 | 24 |
23 TEST_F(ScreenAshTest, Bounds) { | 25 TEST_F(ScreenAshTest, Bounds) { |
24 UpdateDisplay("600x600,500x500"); | 26 UpdateDisplay("600x600,500x500"); |
25 Shell::GetPrimaryRootWindowController()->SetShelfAutoHideBehavior( | 27 Shell::GetPrimaryRootWindowController()->shelf_layout_manager()-> |
26 ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 28 SetAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
27 | 29 |
28 views::Widget* primary = views::Widget::CreateWindowWithContextAndBounds( | 30 views::Widget* primary = views::Widget::CreateWindowWithContextAndBounds( |
29 NULL, CurrentContext(), gfx::Rect(10, 10, 100, 100)); | 31 NULL, CurrentContext(), gfx::Rect(10, 10, 100, 100)); |
30 primary->Show(); | 32 primary->Show(); |
31 views::Widget* secondary = views::Widget::CreateWindowWithContextAndBounds( | 33 views::Widget* secondary = views::Widget::CreateWindowWithContextAndBounds( |
32 NULL, CurrentContext(), gfx::Rect(610, 10, 100, 100)); | 34 NULL, CurrentContext(), gfx::Rect(610, 10, 100, 100)); |
33 secondary->Show(); | 35 secondary->Show(); |
34 | 36 |
35 // Maximized bounds | 37 // Maximized bounds |
36 EXPECT_EQ("0,0 600x597", | 38 EXPECT_EQ("0,0 600x597", |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 ScreenAsh::ConvertRectToScreen( | 95 ScreenAsh::ConvertRectToScreen( |
94 primary->GetNativeView(), gfx::Rect(30, 30, 100, 100)).ToString()); | 96 primary->GetNativeView(), gfx::Rect(30, 30, 100, 100)).ToString()); |
95 EXPECT_EQ( | 97 EXPECT_EQ( |
96 "650,50 100x100", | 98 "650,50 100x100", |
97 ScreenAsh::ConvertRectToScreen( | 99 ScreenAsh::ConvertRectToScreen( |
98 secondary->GetNativeView(), gfx::Rect(40, 40, 100, 100)).ToString()); | 100 secondary->GetNativeView(), gfx::Rect(40, 40, 100, 100)).ToString()); |
99 } | 101 } |
100 | 102 |
101 } // namespace test | 103 } // namespace test |
102 } // namespace ash | 104 } // namespace ash |
OLD | NEW |