| 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 28 matching lines...) Expand all Loading... |
| 39 ~DragWindowResizerTest() override {} | 39 ~DragWindowResizerTest() override {} |
| 40 | 40 |
| 41 void SetUp() override { | 41 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()->SetDisplayWorkAreaInsetsForTesting(root, |
| 50 gfx::Insets()); |
| 50 window_.reset(new aura::Window(&delegate_)); | 51 window_.reset(new aura::Window(&delegate_)); |
| 51 window_->SetType(ui::wm::WINDOW_TYPE_NORMAL); | 52 window_->SetType(ui::wm::WINDOW_TYPE_NORMAL); |
| 52 window_->Init(ui::LAYER_NOT_DRAWN); | 53 window_->Init(ui::LAYER_NOT_DRAWN); |
| 53 ParentWindowInPrimaryRootWindow(window_.get()); | 54 ParentWindowInPrimaryRootWindow(window_.get()); |
| 54 window_->set_id(1); | 55 window_->set_id(1); |
| 55 | 56 |
| 56 always_on_top_window_.reset(new aura::Window(&delegate2_)); | 57 always_on_top_window_.reset(new aura::Window(&delegate2_)); |
| 57 always_on_top_window_->SetType(ui::wm::WINDOW_TYPE_NORMAL); | 58 always_on_top_window_->SetType(ui::wm::WINDOW_TYPE_NORMAL); |
| 58 always_on_top_window_->SetProperty(aura::client::kAlwaysOnTopKey, true); | 59 always_on_top_window_->SetProperty(aura::client::kAlwaysOnTopKey, true); |
| 59 always_on_top_window_->Init(ui::LAYER_NOT_DRAWN); | 60 always_on_top_window_->Init(ui::LAYER_NOT_DRAWN); |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 ASSERT_TRUE(resizer.get()); | 620 ASSERT_TRUE(resizer.get()); |
| 620 resizer->Drag(CalculateDragPoint(*resizer, 399, 200), 0); | 621 resizer->Drag(CalculateDragPoint(*resizer, 399, 200), 0); |
| 621 EXPECT_TRUE(TestIfMouseWarpsAt(gfx::Point(399, 200))); | 622 EXPECT_TRUE(TestIfMouseWarpsAt(gfx::Point(399, 200))); |
| 622 EXPECT_EQ("401,200", | 623 EXPECT_EQ("401,200", |
| 623 aura::Env::GetInstance()->last_mouse_location().ToString()); | 624 aura::Env::GetInstance()->last_mouse_location().ToString()); |
| 624 resizer->CompleteDrag(); | 625 resizer->CompleteDrag(); |
| 625 } | 626 } |
| 626 } | 627 } |
| 627 | 628 |
| 628 } // namespace ash | 629 } // namespace ash |
| OLD | NEW |