| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "mash/wm/frame/move_loop.h" | 5 #include "mash/wm/frame/move_loop.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "components/mus/public/cpp/tests/test_window.h" | 10 #include "components/mus/public/cpp/tests/test_window.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 {HTTOPRIGHT, 6, 5, gfx::Rect(100, 205, 306, 395)}, | 42 {HTTOPRIGHT, 6, 5, gfx::Rect(100, 205, 306, 395)}, |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 for (size_t i = 0; i < arraysize(data); ++i) { | 45 for (size_t i = 0; i < arraysize(data); ++i) { |
| 46 mus::TestWindow window; | 46 mus::TestWindow window; |
| 47 window.SetBounds(gfx::Rect(100, 200, 300, 400)); | 47 window.SetBounds(gfx::Rect(100, 200, 300, 400)); |
| 48 gfx::Point pointer_location(51, 52); | 48 gfx::Point pointer_location(51, 52); |
| 49 ui::PointerEvent pointer_down_event( | 49 ui::PointerEvent pointer_down_event( |
| 50 ui::ET_POINTER_DOWN, ui::EventPointerType::POINTER_TYPE_TOUCH, | 50 ui::ET_POINTER_DOWN, ui::EventPointerType::POINTER_TYPE_TOUCH, |
| 51 pointer_location, pointer_location, ui::EF_NONE, 1, base::TimeDelta()); | 51 pointer_location, pointer_location, ui::EF_NONE, 1, base::TimeDelta()); |
| 52 scoped_ptr<MoveLoop> move_loop = | 52 std::unique_ptr<MoveLoop> move_loop = |
| 53 MoveLoop::Create(&window, data[i].ht_location, pointer_down_event); | 53 MoveLoop::Create(&window, data[i].ht_location, pointer_down_event); |
| 54 ASSERT_TRUE(move_loop.get()) << i; | 54 ASSERT_TRUE(move_loop.get()) << i; |
| 55 pointer_location.Offset(data[i].delta_x, data[i].delta_y); | 55 pointer_location.Offset(data[i].delta_x, data[i].delta_y); |
| 56 ui::PointerEvent pointer_move_event( | 56 ui::PointerEvent pointer_move_event( |
| 57 ui::ET_POINTER_MOVED, ui::EventPointerType::POINTER_TYPE_TOUCH, | 57 ui::ET_POINTER_MOVED, ui::EventPointerType::POINTER_TYPE_TOUCH, |
| 58 pointer_location, pointer_location, ui::EF_NONE, 1, base::TimeDelta()); | 58 pointer_location, pointer_location, ui::EF_NONE, 1, base::TimeDelta()); |
| 59 ASSERT_EQ(MoveLoop::MoveResult::CONTINUE, | 59 ASSERT_EQ(MoveLoop::MoveResult::CONTINUE, |
| 60 move_loop->Move(pointer_move_event)) | 60 move_loop->Move(pointer_move_event)) |
| 61 << i; | 61 << i; |
| 62 ASSERT_EQ(data[i].expected_bounds, window.bounds()); | 62 ASSERT_EQ(data[i].expected_bounds, window.bounds()); |
| 63 } | 63 } |
| 64 } | 64 } |
| 65 | 65 |
| 66 } // namespace wm | 66 } // namespace wm |
| 67 } // namespace mash | 67 } // namespace mash |
| OLD | NEW |