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/workspace/workspace_window_resizer.h" | 5 #include "ash/wm/workspace/workspace_window_resizer.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/test/ash_test_base.h" | 8 #include "ash/test/ash_test_base.h" |
9 #include "ui/aura/root_window.h" | 9 #include "ui/aura/root_window.h" |
10 #include "ui/aura/screen_aura.h" | 10 #include "ui/aura/screen_aura.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 DISALLOW_COPY_AND_ASSIGN(TestWindowDelegate); | 39 DISALLOW_COPY_AND_ASSIGN(TestWindowDelegate); |
40 }; | 40 }; |
41 | 41 |
42 class WorkspaceWindowResizerTest : public test::AshTestBase { | 42 class WorkspaceWindowResizerTest : public test::AshTestBase { |
43 public: | 43 public: |
44 WorkspaceWindowResizerTest() : window_(NULL) {} | 44 WorkspaceWindowResizerTest() : window_(NULL) {} |
45 virtual ~WorkspaceWindowResizerTest() {} | 45 virtual ~WorkspaceWindowResizerTest() {} |
46 | 46 |
47 virtual void SetUp() OVERRIDE { | 47 virtual void SetUp() OVERRIDE { |
| 48 WorkspaceWindowResizer::SetScaleWindowsForTest(false); |
48 AshTestBase::SetUp(); | 49 AshTestBase::SetUp(); |
49 aura::RootWindow* root = Shell::GetInstance()->GetRootWindow(); | 50 aura::RootWindow* root = Shell::GetInstance()->GetRootWindow(); |
50 root->SetBounds(gfx::Rect(0, 0, 800, kRootHeight)); | 51 root->SetBounds(gfx::Rect(0, 0, 800, kRootHeight)); |
51 gfx::Rect root_bounds(root->bounds()); | 52 gfx::Rect root_bounds(root->bounds()); |
52 EXPECT_EQ(kRootHeight, root_bounds.height()); | 53 EXPECT_EQ(kRootHeight, root_bounds.height()); |
53 root->screen()->set_work_area_insets(gfx::Insets()); | 54 root->screen()->set_work_area_insets(gfx::Insets()); |
54 window_.reset(new aura::Window(&delegate_)); | 55 window_.reset(new aura::Window(&delegate_)); |
55 window_->Init(ui::Layer::LAYER_NOT_DRAWN); | 56 window_->Init(ui::Layer::LAYER_NOT_DRAWN); |
56 window_->SetParent(Shell::GetInstance()->GetRootWindow()); | 57 window_->SetParent(Shell::GetInstance()->GetRootWindow()); |
57 } | 58 } |
58 | 59 |
59 virtual void TearDown() OVERRIDE { | 60 virtual void TearDown() OVERRIDE { |
| 61 WorkspaceWindowResizer::SetScaleWindowsForTest(true); |
60 window_.reset(); | 62 window_.reset(); |
61 AshTestBase::TearDown(); | 63 AshTestBase::TearDown(); |
62 } | 64 } |
63 | 65 |
64 protected: | 66 protected: |
65 gfx::Point CalculateDragPoint(const WindowResizer& resizer, | 67 gfx::Point CalculateDragPoint(const WindowResizer& resizer, |
66 int delta_y) const { | 68 int delta_y) const { |
67 gfx::Point location = resizer.initial_location_in_parent(); | 69 gfx::Point location = resizer.initial_location_in_parent(); |
68 location.set_y(location.y() + delta_y); | 70 location.set_y(location.y() + delta_y); |
69 aura::Window::ConvertPointToWindow(window_->parent(), window_.get(), | 71 aura::Window::ConvertPointToWindow(window_->parent(), window_.get(), |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 | 267 |
266 resizer.Drag(CalculateDragPoint(resizer, -100)); | 268 resizer.Drag(CalculateDragPoint(resizer, -100)); |
267 EXPECT_EQ(200, window_->bounds().y()); | 269 EXPECT_EQ(200, window_->bounds().y()); |
268 EXPECT_EQ(300, window_->bounds().height()); | 270 EXPECT_EQ(300, window_->bounds().height()); |
269 } | 271 } |
270 } | 272 } |
271 | 273 |
272 } // namespace | 274 } // namespace |
273 } // namespace test | 275 } // namespace test |
274 } // namespace aura | 276 } // namespace aura |
OLD | NEW |