Merge "Removed TouchEvent from dali-core" into devel/master
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-ControlImpl.cpp
index 5eed3b7..b1bbe19 100644 (file)
@@ -465,62 +465,6 @@ int UtcDaliControlImplSizeAnimation(void)
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-int UtcDaliControlImplTouchEvent(void)
-{
-  ToolkitTestApplication application;
-
-  {
-    DummyControl dummy = DummyControl::New( true );
-    Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
-
-    dummy.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
-    dummy.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
-    application.GetScene().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 );
-
-    application.GetScene().Remove(dummy);
-  }
-
-  // Ensure full code coverage
-  {
-    DummyControl dummy = DummyControl::New();
-
-    dummy.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
-    dummy.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
-    application.GetScene().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);
-
-    application.GetScene().Remove(dummy);
-  }
-  END_TEST;
-}
-
 int UtcDaliControlImplHoverEvent(void)
 {
   ToolkitTestApplication application;
@@ -826,7 +770,7 @@ int UtcDaliControlImplOnAccessibilityTouchP(void)
   ToolkitTestApplication application;
   Control dummy = Control::New();
   Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( dummy );
-  TouchEvent touch;
+  TouchData touch;
   DALI_TEST_EQUALS( false, controlImpl.OnAccessibilityTouch( touch ), TEST_LOCATION );
 
   END_TEST;
@@ -1337,3 +1281,28 @@ int UtcDaliControlImplAutoClippingWithVisualsAlreadyOnStage(void)
 
   END_TEST;
 }
+
+int UtcDaliControlImplOnPinch(void)
+{
+  ToolkitTestApplication application;
+
+  Control control = Control::New();
+  control.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  control.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  application.GetScene().Add(control);
+
+  application.SendNotification();
+  application.Render();
+
+  Toolkit::Internal::Control& impl = Toolkit::Internal::GetImplementation(control);
+  impl.EnableGestureDetection(Gesture::Pinch);
+
+  // Scale becomes 0.6666666
+  TestStartPinch( application,  Vector2( 5.0f, 20.0f ), Vector2( 35.0f, 20.0f ),
+                                Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 100 );
+
+  DALI_TEST_EQUALS(0.666f, control.GetProperty( Actor::Property::SCALE_X).Get<float>(), 0.01f, TEST_LOCATION);
+
+  END_TEST;
+
+}