-int UtcDaliControlImplTouchEvent(void)
-{
- ToolkitTestApplication application;
-
- {
- DummyControl dummy = DummyControl::New( true );
- DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
-
- dummy.SetSize( Vector2( 100.0f, 100.0f ) );
- dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(dummy);
-
- application.Render();
- application.SendNotification();
- application.Render();
- application.SendNotification();
-
- DALI_TEST_EQUALS( dummyImpl.touchEventCalled, false, TEST_LOCATION );
- Integration::TouchEvent touchEvent(1);
- Integration::Point point;
- point.SetDeviceId( 1 );
- point.SetState( PointState::DOWN );
- point.SetScreenPosition( Vector2( 20.0f, 20.0f ) );
- touchEvent.AddPoint(point);
- application.ProcessEvent(touchEvent);
- DALI_TEST_EQUALS( dummyImpl.touchEventCalled, true, TEST_LOCATION );
-
- Stage::GetCurrent().Remove(dummy);
- }
-
- // Ensure full code coverage
- {
- DummyControl dummy = DummyControl::New();
-
- dummy.SetSize( Vector2( 100.0f, 100.0f ) );
- dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(dummy);
-
- application.Render();
- application.SendNotification();
- application.Render();
- application.SendNotification();
-
- Integration::TouchEvent touchEvent(1);
- Integration::Point point;
- point.SetDeviceId( 1 );
- point.SetState( PointState::DOWN );
- point.SetScreenPosition( Vector2( 20.0f, 20.0f ) );
- touchEvent.AddPoint(point);
- application.ProcessEvent(touchEvent);
-
- Stage::GetCurrent().Remove(dummy);
- }
- END_TEST;
-}
-