OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_util.h" | 5 #include "ash/screen_util.h" |
6 | 6 |
7 #include "ash/display/display_manager.h" | 7 #include "ash/display/display_manager.h" |
8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf.h" |
10 #include "ash/shelf/shelf_widget.h" | 10 #include "ash/shelf/shelf_widget.h" |
msw
2016/06/01 00:53:23
nit: remove if not needed?
James Cook
2016/06/01 15:53:06
Done.
| |
11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
12 #include "ash/test/ash_test_base.h" | 12 #include "ash/test/ash_test_base.h" |
13 #include "ash/test/display_manager_test_api.h" | 13 #include "ash/test/display_manager_test_api.h" |
14 #include "ash/wm/window_util.h" | 14 #include "ash/wm/window_util.h" |
15 #include "ui/aura/env.h" | 15 #include "ui/aura/env.h" |
16 #include "ui/aura/window.h" | 16 #include "ui/aura/window.h" |
17 #include "ui/aura/window_event_dispatcher.h" | 17 #include "ui/aura/window_event_dispatcher.h" |
18 #include "ui/views/widget/widget.h" | 18 #include "ui/views/widget/widget.h" |
19 #include "ui/views/widget/widget_delegate.h" | 19 #include "ui/views/widget/widget_delegate.h" |
20 | 20 |
21 namespace ash { | 21 namespace ash { |
22 namespace test { | 22 namespace test { |
23 | 23 |
24 typedef test::AshTestBase ScreenUtilTest; | 24 typedef test::AshTestBase ScreenUtilTest; |
25 | 25 |
26 TEST_F(ScreenUtilTest, Bounds) { | 26 TEST_F(ScreenUtilTest, Bounds) { |
27 if (!SupportsMultipleDisplays()) | 27 if (!SupportsMultipleDisplays()) |
28 return; | 28 return; |
29 | 29 |
30 UpdateDisplay("600x600,500x500"); | 30 UpdateDisplay("600x600,500x500"); |
31 Shell::GetPrimaryRootWindowController()->GetShelfLayoutManager()-> | 31 Shell::GetPrimaryRootWindowController()->GetShelf()->SetAutoHideBehavior( |
msw
2016/06/01 00:53:23
q: is this even needed for the test?
msw
2016/06/01 00:53:24
nit: Shelf::ForPrimaryDisplay()?
James Cook
2016/06/01 15:53:06
Removed and updated bounds expectations.
| |
32 SetAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 32 SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
33 | 33 |
34 views::Widget* primary = views::Widget::CreateWindowWithContextAndBounds( | 34 views::Widget* primary = views::Widget::CreateWindowWithContextAndBounds( |
35 NULL, CurrentContext(), gfx::Rect(10, 10, 100, 100)); | 35 NULL, CurrentContext(), gfx::Rect(10, 10, 100, 100)); |
36 primary->Show(); | 36 primary->Show(); |
37 views::Widget* secondary = views::Widget::CreateWindowWithContextAndBounds( | 37 views::Widget* secondary = views::Widget::CreateWindowWithContextAndBounds( |
38 NULL, CurrentContext(), gfx::Rect(610, 10, 100, 100)); | 38 NULL, CurrentContext(), gfx::Rect(610, 10, 100, 100)); |
39 secondary->Show(); | 39 secondary->Show(); |
40 | 40 |
41 // Maximized bounds | 41 // Maximized bounds |
42 EXPECT_EQ("0,0 600x597", | 42 EXPECT_EQ("0,0 600x597", |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
144 .ToString()); | 144 .ToString()); |
145 | 145 |
146 UpdateDisplay("600x500"); | 146 UpdateDisplay("600x500"); |
147 EXPECT_EQ("0,0 600x500", | 147 EXPECT_EQ("0,0 600x500", |
148 ScreenUtil::GetShelfDisplayBoundsInRoot(widget->GetNativeWindow()) | 148 ScreenUtil::GetShelfDisplayBoundsInRoot(widget->GetNativeWindow()) |
149 .ToString()); | 149 .ToString()); |
150 } | 150 } |
151 | 151 |
152 } // namespace test | 152 } // namespace test |
153 } // namespace ash | 153 } // namespace ash |
OLD | NEW |