- application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
- application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
- application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
- DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
- END_TEST;
-}
-
-int UtcDaliLongPressGestureEmitIncorrectStateClear(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- actor.SetSize(100.0f, 100.0f);
- actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
-
- // Render and notify
- application.SendNotification();
- application.Render();
-
- // Attach actor to detector
- SignalData data;
- GestureReceivedFunctor functor( data );
- LongPressGestureDetector detector = LongPressGestureDetector::New();
- detector.Attach(actor);
- detector.DetectedSignal().Connect( &application, functor );
-
- // Try a Clear state
- try
- {
- application.ProcessEvent(GenerateLongPress(Gesture::Clear, 1u, Vector2(50.0f, 10.0f)));
- tet_result(TET_FAIL);
- }
- catch ( Dali::DaliException& e )
- {
- DALI_TEST_ASSERT( e, "false", TEST_LOCATION );
- }
- END_TEST;
-}
-
-int UtcDaliLongPressGestureEmitIncorrectStateContinuing(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- actor.SetSize(100.0f, 100.0f);
- actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
-
- // Render and notify
- application.SendNotification();
- application.Render();
-
- // Attach actor to detector
- SignalData data;
- GestureReceivedFunctor functor( data );
- LongPressGestureDetector detector = LongPressGestureDetector::New();
- detector.Attach(actor);
- detector.DetectedSignal().Connect( &application, functor );
-
- // Try a Continuing state
- try
- {
- application.ProcessEvent(GenerateLongPress(Gesture::Continuing, 1u, Vector2(50.0f, 10.0f)));
- tet_result(TET_FAIL);
- }
- catch ( Dali::DaliException& e )
- {
- DALI_TEST_ASSERT( e, "false", TEST_LOCATION );
- }
- END_TEST;
-}
-
-int UtcDaliLongPressGestureRepeatedState(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- actor.SetSize(100.0f, 100.0f);
- actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
-
- // Render and notify
- application.SendNotification();
- application.Render();
-
- // Attach actor to detector
- SignalData data;
- GestureReceivedFunctor functor( data );
- LongPressGestureDetector detector = LongPressGestureDetector::New();
- detector.Attach(actor);
- detector.DetectedSignal().Connect( &application, functor );
-
- // Two possibles
- application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
- DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
- application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
- DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
-
- // ... Send some finished states, still no signal
- application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
- DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
- application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
- DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
-
- // Send two Started states, should be signalled
- application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
- DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
- application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
- DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
- data.Reset();
- application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
- DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
- data.Reset();
- application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));