| 7 | namespace snap::drawing { |
| 8 | |
| 9 | TEST(DragGestureRecognizer, doesHandleWheel) { |
| 10 | auto container = makeContainer(0, 0, 100, 100); |
| 11 | |
| 12 | auto childView = createView(25, 25, 25, 25); |
| 13 | container->view->addChild(childView); |
| 14 | |
| 15 | auto wheelSnapshot = addWheelGesture(childView); |
| 16 | |
| 17 | container->dispatchEvent(TouchEventTypeWheel, 30, 35, 0, 10); |
| 18 | ASSERT_EQ(GestureRecognizerStateBegan, wheelSnapshot->state); |
| 19 | ASSERT_EQ(5, wheelSnapshot->location.x); |
| 20 | ASSERT_EQ(10, wheelSnapshot->location.y); |
| 21 | ASSERT_EQ(0, wheelSnapshot->direction.dx); |
| 22 | ASSERT_EQ(10, wheelSnapshot->direction.dy); |
| 23 | |
| 24 | container->dispatchEvent(TouchEventTypeWheel, 35, 40, 5, 5); |
| 25 | ASSERT_EQ(GestureRecognizerStateBegan, wheelSnapshot->state); |
| 26 | ASSERT_EQ(10, wheelSnapshot->location.x); |
| 27 | ASSERT_EQ(15, wheelSnapshot->location.y); |
| 28 | ASSERT_EQ(5, wheelSnapshot->direction.dx); |
| 29 | ASSERT_EQ(5, wheelSnapshot->direction.dy); |
| 30 | |
| 31 | ASSERT_TRUE(container->root->getTouchDispatcher().isEmpty()); |
| 32 | } |
| 33 | |
| 34 | } // namespace snap::drawing |
nothing calls this directly
no test coverage detected