Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Unified Diff: mash/wm/frame/move_loop_unittest.cc

Issue 1814533002: Use ui::Event instead of mojom::EventPtr in mash/wm. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_eventptr
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mash/wm/frame/move_loop.cc ('k') | mash/wm/root_window_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mash/wm/frame/move_loop_unittest.cc
diff --git a/mash/wm/frame/move_loop_unittest.cc b/mash/wm/frame/move_loop_unittest.cc
index a9ad9b7e28c96e01f08bf191993be47ad28ddfc4..4ddaca6b8eaa5004bfae2b648429922f85f7156a 100644
--- a/mash/wm/frame/move_loop_unittest.cc
+++ b/mash/wm/frame/move_loop_unittest.cc
@@ -20,22 +20,6 @@ using MoveLoopTest = testing::Test;
namespace mash {
namespace wm {
-namespace {
-
-mus::mojom::EventPtr CreatePointerDownEvent(const gfx::Point& location) {
- const ui::TouchEvent event(ui::ET_TOUCH_PRESSED, location, 1,
- base::TimeDelta());
- return mus::mojom::Event::From(static_cast<const ui::Event&>(event));
-}
-
-mus::mojom::EventPtr CreatePointerMove(const gfx::Point& location) {
- const ui::TouchEvent event(ui::ET_TOUCH_MOVED, location, 1,
- base::TimeDelta());
- return mus::mojom::Event::From(static_cast<const ui::Event&>(event));
-}
-
-} // namespace
-
TEST_F(MoveLoopTest, Move) {
struct TestData {
// One of the HitTestCompat values.
@@ -62,13 +46,18 @@ TEST_F(MoveLoopTest, Move) {
mus::TestWindow window;
window.SetBounds(gfx::Rect(100, 200, 300, 400));
gfx::Point pointer_location(51, 52);
+ ui::PointerEvent pointer_down_event(
+ ui::ET_POINTER_DOWN, ui::EventPointerType::POINTER_TYPE_TOUCH,
+ pointer_location, pointer_location, ui::EF_NONE, 1, base::TimeDelta());
scoped_ptr<MoveLoop> move_loop =
- MoveLoop::Create(&window, data[i].ht_location,
- *CreatePointerDownEvent(pointer_location));
+ MoveLoop::Create(&window, data[i].ht_location, pointer_down_event);
ASSERT_TRUE(move_loop.get()) << i;
pointer_location.Offset(data[i].delta_x, data[i].delta_y);
+ ui::PointerEvent pointer_move_event(
+ ui::ET_POINTER_MOVED, ui::EventPointerType::POINTER_TYPE_TOUCH,
+ pointer_location, pointer_location, ui::EF_NONE, 1, base::TimeDelta());
ASSERT_EQ(MoveLoop::MoveResult::CONTINUE,
- move_loop->Move(*CreatePointerMove(pointer_location)))
+ move_loop->Move(pointer_move_event))
<< i;
ASSERT_EQ(data[i].expected_bounds, window.bounds());
}
« no previous file with comments | « mash/wm/frame/move_loop.cc ('k') | mash/wm/root_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698