MCPcopy Create free account
hub / github.com/Snapchat/Valdi / TEST

Function TEST

snap_drawing/test/src/SingleTapGestureRecognizer_tests.cpp:9–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7namespace snap::drawing {
8
9TEST(SingleTapGestureRecognizer, canHandleSingleTap) {
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 singleTapSnapshot = addSingleTapGesture(childView);
16
17 container->dispatchEvent(TouchEventTypeDown, 30, 35);
18 container->dispatchEvent(TouchEventTypeUp, 30, 35);
19
20 ASSERT_EQ(GestureRecognizerStateEnded, singleTapSnapshot->state);
21
22 ASSERT_TRUE(container->root->getTouchDispatcher().isEmpty());
23}
24
25TEST(SingleTapGestureRecognizer, canHandleSingleTapWithDoubleTap) {
26 auto container = makeContainer(0, 0, 100, 100);

Callers

nothing calls this directly

Calls 8

makeContainerFunction · 0.85
createViewFunction · 0.85
addSingleTapGestureFunction · 0.85
addDoubleTapGestureFunction · 0.85
addDragGestureFunction · 0.85
addChildMethod · 0.45
dispatchEventMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected