| 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" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 gfx::Insets(1, 2, 3, 4)); | 37 gfx::Insets(1, 2, 3, 4)); |
| 38 Shell::GetPrimaryRootWindow()->SetHostSize(gfx::Size(800, 600)); | 38 Shell::GetPrimaryRootWindow()->SetHostSize(gfx::Size(800, 600)); |
| 39 aura::Window* default_container = Shell::GetContainer( | 39 aura::Window* default_container = Shell::GetContainer( |
| 40 Shell::GetPrimaryRootWindow(), | 40 Shell::GetPrimaryRootWindow(), |
| 41 internal::kShellWindowId_DefaultContainer); | 41 internal::kShellWindowId_DefaultContainer); |
| 42 default_container->SetLayoutManager(new internal::BaseLayoutManager( | 42 default_container->SetLayoutManager(new internal::BaseLayoutManager( |
| 43 Shell::GetPrimaryRootWindow())); | 43 Shell::GetPrimaryRootWindow())); |
| 44 } | 44 } |
| 45 | 45 |
| 46 aura::Window* CreateTestWindow(const gfx::Rect& bounds) { | 46 aura::Window* CreateTestWindow(const gfx::Rect& bounds) { |
| 47 return aura::test::CreateTestWindowWithBounds(bounds, NULL); | 47 return CreateTestWindowInShellWithBounds(bounds); |
| 48 } | 48 } |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 DISALLOW_COPY_AND_ASSIGN(BaseLayoutManagerTest); | 51 DISALLOW_COPY_AND_ASSIGN(BaseLayoutManagerTest); |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 // Tests normal->maximize->normal. | 54 // Tests normal->maximize->normal. |
| 55 TEST_F(BaseLayoutManagerTest, Maximize) { | 55 TEST_F(BaseLayoutManagerTest, Maximize) { |
| 56 gfx::Rect bounds(100, 100, 200, 200); | 56 gfx::Rect bounds(100, 100, 200, 200); |
| 57 scoped_ptr<aura::Window> window(CreateTestWindow(bounds)); | 57 scoped_ptr<aura::Window> window(CreateTestWindow(bounds)); |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 GetRestoreBoundsInParent(window.get()).ToString()); | 229 GetRestoreBoundsInParent(window.get()).ToString()); |
| 230 EXPECT_TRUE(wm::IsWindowMaximized(window.get())); | 230 EXPECT_TRUE(wm::IsWindowMaximized(window.get())); |
| 231 | 231 |
| 232 wm::RestoreWindow(window.get()); | 232 wm::RestoreWindow(window.get()); |
| 233 EXPECT_EQ(bounds.ToString(), window->bounds().ToString()); | 233 EXPECT_EQ(bounds.ToString(), window->bounds().ToString()); |
| 234 } | 234 } |
| 235 | 235 |
| 236 } // namespace | 236 } // namespace |
| 237 | 237 |
| 238 } // namespace ash | 238 } // namespace ash |
| OLD | NEW |