| 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 } | 38 } |
| 37 | 39 |
| 38 aura::Window* CreateTestWindow(const gfx::Rect& bounds) { | 40 aura::Window* CreateTestWindow(const gfx::Rect& bounds) { |
| 39 return aura::test::CreateTestWindowWithBounds(bounds, NULL); | 41 return aura::test::CreateTestWindowWithBounds(bounds, NULL); |
| 40 } | 42 } |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 // Enlarging the root window does not change the window bounds. | 140 // Enlarging the root window does not change the window bounds. |
| 139 gfx::Rect old_bounds = window->bounds(); | 141 gfx::Rect old_bounds = window->bounds(); |
| 140 Shell::GetRootWindow()->SetHostSize(gfx::Size(800, 600)); | 142 Shell::GetRootWindow()->SetHostSize(gfx::Size(800, 600)); |
| 141 EXPECT_EQ(old_bounds.width(), window->bounds().width()); | 143 EXPECT_EQ(old_bounds.width(), window->bounds().width()); |
| 142 EXPECT_EQ(old_bounds.height(), window->bounds().height()); | 144 EXPECT_EQ(old_bounds.height(), window->bounds().height()); |
| 143 } | 145 } |
| 144 | 146 |
| 145 } // namespace | 147 } // namespace |
| 146 | 148 |
| 147 } // namespace ash | 149 } // namespace ash |
| OLD | NEW |