| 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/drag_window_resizer.h" | 5 #include "ash/wm/drag_window_resizer.h" |
| 6 | 6 |
| 7 #include "ash/display/mouse_cursor_event_filter.h" | 7 #include "ash/display/mouse_cursor_event_filter.h" |
| 8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
| 9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 const int kRootHeight = 600; | 32 const int kRootHeight = 600; |
| 33 | 33 |
| 34 } // namespace | 34 } // namespace |
| 35 | 35 |
| 36 class DragWindowResizerTest : public test::AshTestBase { | 36 class DragWindowResizerTest : public test::AshTestBase { |
| 37 public: | 37 public: |
| 38 DragWindowResizerTest() {} | 38 DragWindowResizerTest() {} |
| 39 virtual ~DragWindowResizerTest() {} | 39 virtual ~DragWindowResizerTest() {} |
| 40 | 40 |
| 41 virtual void SetUp() OVERRIDE { | 41 virtual void SetUp() override { |
| 42 AshTestBase::SetUp(); | 42 AshTestBase::SetUp(); |
| 43 UpdateDisplay(base::StringPrintf("800x%d", kRootHeight)); | 43 UpdateDisplay(base::StringPrintf("800x%d", kRootHeight)); |
| 44 | 44 |
| 45 aura::Window* root = Shell::GetPrimaryRootWindow(); | 45 aura::Window* root = Shell::GetPrimaryRootWindow(); |
| 46 gfx::Rect root_bounds(root->bounds()); | 46 gfx::Rect root_bounds(root->bounds()); |
| 47 EXPECT_EQ(kRootHeight, root_bounds.height()); | 47 EXPECT_EQ(kRootHeight, root_bounds.height()); |
| 48 EXPECT_EQ(800, root_bounds.width()); | 48 EXPECT_EQ(800, root_bounds.width()); |
| 49 Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets()); | 49 Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets()); |
| 50 window_.reset(new aura::Window(&delegate_)); | 50 window_.reset(new aura::Window(&delegate_)); |
| 51 window_->SetType(ui::wm::WINDOW_TYPE_NORMAL); | 51 window_->SetType(ui::wm::WINDOW_TYPE_NORMAL); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 80 ParentWindowInPrimaryRootWindow(transient_parent_.get()); | 80 ParentWindowInPrimaryRootWindow(transient_parent_.get()); |
| 81 ::wm::AddTransientChild(transient_parent_.get(), transient_child_); | 81 ::wm::AddTransientChild(transient_parent_.get(), transient_child_); |
| 82 transient_parent_->set_id(5); | 82 transient_parent_->set_id(5); |
| 83 | 83 |
| 84 panel_window_.reset(new aura::Window(&delegate6_)); | 84 panel_window_.reset(new aura::Window(&delegate6_)); |
| 85 panel_window_->SetType(ui::wm::WINDOW_TYPE_PANEL); | 85 panel_window_->SetType(ui::wm::WINDOW_TYPE_PANEL); |
| 86 panel_window_->Init(aura::WINDOW_LAYER_NOT_DRAWN); | 86 panel_window_->Init(aura::WINDOW_LAYER_NOT_DRAWN); |
| 87 ParentWindowInPrimaryRootWindow(panel_window_.get()); | 87 ParentWindowInPrimaryRootWindow(panel_window_.get()); |
| 88 } | 88 } |
| 89 | 89 |
| 90 virtual void TearDown() OVERRIDE { | 90 virtual void TearDown() override { |
| 91 window_.reset(); | 91 window_.reset(); |
| 92 always_on_top_window_.reset(); | 92 always_on_top_window_.reset(); |
| 93 system_modal_window_.reset(); | 93 system_modal_window_.reset(); |
| 94 transient_parent_.reset(); | 94 transient_parent_.reset(); |
| 95 panel_window_.reset(); | 95 panel_window_.reset(); |
| 96 AshTestBase::TearDown(); | 96 AshTestBase::TearDown(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 protected: | 99 protected: |
| 100 gfx::Point CalculateDragPoint(const WindowResizer& resizer, | 100 gfx::Point CalculateDragPoint(const WindowResizer& resizer, |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 window, gfx::Point(), HTCAPTION)); | 626 window, gfx::Point(), HTCAPTION)); |
| 627 ASSERT_TRUE(resizer.get()); | 627 ASSERT_TRUE(resizer.get()); |
| 628 resizer->Drag(CalculateDragPoint(*resizer, 399, 200), 0); | 628 resizer->Drag(CalculateDragPoint(*resizer, 399, 200), 0); |
| 629 EXPECT_TRUE(WarpMouseCursorIfNecessary(root_windows[0], | 629 EXPECT_TRUE(WarpMouseCursorIfNecessary(root_windows[0], |
| 630 gfx::Point(399, 200))); | 630 gfx::Point(399, 200))); |
| 631 resizer->CompleteDrag(); | 631 resizer->CompleteDrag(); |
| 632 } | 632 } |
| 633 } | 633 } |
| 634 | 634 |
| 635 } // namespace ash | 635 } // namespace ash |
| OLD | NEW |