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/wm/base_layout_manager.h" | 5 #include "ash/wm/base_layout_manager.h" |
6 | 6 |
7 #include "ash/screen_ash.h" | 7 #include "ash/screen_ash.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
10 #include "ash/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "ui/aura/client/aura_constants.h" | 13 #include "ui/aura/client/aura_constants.h" |
14 #include "ui/aura/root_window.h" | 14 #include "ui/aura/root_window.h" |
15 #include "ui/aura/test/test_windows.h" | 15 #include "ui/aura/test/test_windows.h" |
| 16 #include "ui/aura/window.h" |
16 #include "ui/base/ui_base_types.h" | 17 #include "ui/base/ui_base_types.h" |
17 #include "ui/aura/window.h" | 18 #include "ui/gfx/insets.h" |
18 | 19 |
19 namespace ash { | 20 namespace ash { |
20 | 21 |
21 namespace { | 22 namespace { |
22 | 23 |
23 class BaseLayoutManagerTest : public test::AshTestBase { | 24 class BaseLayoutManagerTest : public test::AshTestBase { |
24 public: | 25 public: |
25 BaseLayoutManagerTest() {} | 26 BaseLayoutManagerTest() {} |
26 virtual ~BaseLayoutManagerTest() {} | 27 virtual ~BaseLayoutManagerTest() {} |
27 | 28 |
28 virtual void SetUp() OVERRIDE { | 29 virtual void SetUp() OVERRIDE { |
29 test::AshTestBase::SetUp(); | 30 test::AshTestBase::SetUp(); |
30 Shell::GetInstance()->SetScreenWorkAreaInsets( | 31 Shell::GetInstance()->SetMonitorWorkAreaInsets( |
| 32 Shell::GetRootWindow(), |
31 gfx::Insets(1, 2, 3, 4)); | 33 gfx::Insets(1, 2, 3, 4)); |
32 Shell::GetRootWindow()->SetHostSize(gfx::Size(800, 600)); | 34 Shell::GetRootWindow()->SetHostSize(gfx::Size(800, 600)); |
33 aura::Window* default_container = Shell::GetInstance()->GetContainer( | 35 aura::Window* default_container = Shell::GetInstance()->GetContainer( |
34 internal::kShellWindowId_DefaultContainer); | 36 internal::kShellWindowId_DefaultContainer); |
35 default_container->SetLayoutManager(new internal::BaseLayoutManager( | 37 default_container->SetLayoutManager(new internal::BaseLayoutManager( |
36 Shell::GetRootWindow())); | 38 Shell::GetRootWindow())); |
37 } | 39 } |
38 | 40 |
39 aura::Window* CreateTestWindow(const gfx::Rect& bounds) { | 41 aura::Window* CreateTestWindow(const gfx::Rect& bounds) { |
40 return aura::test::CreateTestWindowWithBounds(bounds, NULL); | 42 return aura::test::CreateTestWindowWithBounds(bounds, NULL); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 // Enlarging the root window does not change the window bounds. | 141 // Enlarging the root window does not change the window bounds. |
140 gfx::Rect old_bounds = window->bounds(); | 142 gfx::Rect old_bounds = window->bounds(); |
141 Shell::GetRootWindow()->SetHostSize(gfx::Size(800, 600)); | 143 Shell::GetRootWindow()->SetHostSize(gfx::Size(800, 600)); |
142 EXPECT_EQ(old_bounds.width(), window->bounds().width()); | 144 EXPECT_EQ(old_bounds.width(), window->bounds().width()); |
143 EXPECT_EQ(old_bounds.height(), window->bounds().height()); | 145 EXPECT_EQ(old_bounds.height(), window->bounds().height()); |
144 } | 146 } |
145 | 147 |
146 } // namespace | 148 } // namespace |
147 | 149 |
148 } // namespace ash | 150 } // namespace ash |
OLD | NEW |