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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "ui/aura/client/aura_constants.h" | 9 #include "ui/aura/client/aura_constants.h" |
10 #include "ui/aura/root_window.h" | 10 #include "ui/aura/root_window.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 public: | 22 public: |
23 BaseLayoutManagerTest() : layout_manager_(NULL) {} | 23 BaseLayoutManagerTest() : layout_manager_(NULL) {} |
24 virtual ~BaseLayoutManagerTest() {} | 24 virtual ~BaseLayoutManagerTest() {} |
25 | 25 |
26 virtual void SetUp() OVERRIDE { | 26 virtual void SetUp() OVERRIDE { |
27 aura::test::AuraTestBase::SetUp(); | 27 aura::test::AuraTestBase::SetUp(); |
28 aura::RootWindow::GetInstance()->screen()->set_work_area_insets( | 28 aura::RootWindow::GetInstance()->screen()->set_work_area_insets( |
29 gfx::Insets(1, 2, 3, 4)); | 29 gfx::Insets(1, 2, 3, 4)); |
30 aura::RootWindow::GetInstance()->SetHostSize(gfx::Size(800, 600)); | 30 aura::RootWindow::GetInstance()->SetHostSize(gfx::Size(800, 600)); |
31 container_.reset(new aura::Window(NULL)); | 31 container_.reset(new aura::Window(NULL)); |
32 container_->Init(ui::Layer::LAYER_HAS_NO_TEXTURE); | 32 container_->Init(ui::Layer::LAYER_NOT_DRAWN); |
33 container_->SetBounds(gfx::Rect(0, 0, 500, 500)); | 33 container_->SetBounds(gfx::Rect(0, 0, 500, 500)); |
34 layout_manager_ = new internal::BaseLayoutManager(); | 34 layout_manager_ = new internal::BaseLayoutManager(); |
35 container_->SetLayoutManager(layout_manager_); | 35 container_->SetLayoutManager(layout_manager_); |
36 } | 36 } |
37 | 37 |
38 aura::Window* CreateTestWindow(const gfx::Rect& bounds) { | 38 aura::Window* CreateTestWindow(const gfx::Rect& bounds) { |
39 return aura::test::CreateTestWindowWithBounds(bounds, container_.get()); | 39 return aura::test::CreateTestWindowWithBounds(bounds, container_.get()); |
40 } | 40 } |
41 | 41 |
42 private: | 42 private: |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 EXPECT_LE(window->bounds().height(), work_area.height()); | 126 EXPECT_LE(window->bounds().height(), work_area.height()); |
127 | 127 |
128 // Enlarging the root window does not change the window bounds. | 128 // Enlarging the root window does not change the window bounds. |
129 gfx::Rect old_bounds = window->bounds(); | 129 gfx::Rect old_bounds = window->bounds(); |
130 aura::RootWindow::GetInstance()->SetHostSize(gfx::Size(800, 600)); | 130 aura::RootWindow::GetInstance()->SetHostSize(gfx::Size(800, 600)); |
131 EXPECT_EQ(old_bounds.width(), window->bounds().width()); | 131 EXPECT_EQ(old_bounds.width(), window->bounds().width()); |
132 EXPECT_EQ(old_bounds.height(), window->bounds().height()); | 132 EXPECT_EQ(old_bounds.height(), window->bounds().height()); |
133 } | 133 } |
134 | 134 |
135 } // namespace ash | 135 } // namespace ash |
OLD | NEW |