Further Setter/Getter public API removal from Dali::Actor
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-TextEditor.cpp
index 94cc011..c84000d 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <dali/public-api/rendering/renderer.h>
 #include <dali/devel-api/adaptor-framework/clipboard.h>
 #include <dali/devel-api/adaptor-framework/key-devel.h>
+#include <dali/devel-api/text-abstraction/font-client.h>
 #include <dali/integration-api/events/key-event-integ.h>
 #include <dali/integration-api/events/touch-event-integ.h>
-#include <dali/integration-api/events/tap-gesture-event.h>
-#include <dali/integration-api/events/pan-gesture-event.h>
-#include <dali/integration-api/events/long-press-gesture-event.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h>
@@ -104,19 +102,11 @@ const char* const PROPERTY_NAME_ENABLE_GRAB_HANDLE                   = "enableGr
 const char* const PROPERTY_NAME_MATCH_SYSTEM_LANGUAGE_DIRECTION      = "matchSystemLanguageDirection";
 
 
-const int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND;
-
 const Vector4 PLACEHOLDER_TEXT_COLOR( 0.8f, 0.8f, 0.8f, 0.8f );
 const Dali::Vector4 LIGHT_BLUE( 0.75f, 0.96f, 1.f, 1.f ); // The text highlight color.
 
-const unsigned int CURSOR_BLINK_INTERVAL = 500u; // Cursor blink interval
-const float TO_MILLISECONDS = 1000.f;
-const float TO_SECONDS = 1.f / TO_MILLISECONDS;
 const float RENDER_FRAME_INTERVAL = 16.66f;
 
-const float SCROLL_THRESHOLD = 10.f;
-const float SCROLL_SPEED = 300.f;
-
 const unsigned int DEFAULT_FONT_SIZE = 1152u;
 const std::string DEFAULT_FONT_DIR( "/resources/fonts" );
 
@@ -167,51 +157,6 @@ static void TestInputStyleChangedCallback( TextEditor control, TextEditor::Input
   gInputStyleMask = mask;
 }
 
-// Generate a TapGestureEvent to send to Core.
-Integration::TapGestureEvent GenerateTap(
-    Gesture::State state,
-    unsigned int numberOfTaps,
-    unsigned int numberOfTouches,
-    Vector2 point)
-{
-  Integration::TapGestureEvent tap( state );
-
-  tap.numberOfTaps = numberOfTaps;
-  tap.numberOfTouches = numberOfTouches;
-  tap.point = point;
-
-  return tap;
-}
-
-Integration::LongPressGestureEvent GenerateLongPress(
-    Gesture::State state,
-    unsigned int numberOfTouches,
-    Vector2 point)
-{
-  Integration::LongPressGestureEvent longPress( state );
-
-  longPress.numberOfTouches = numberOfTouches;
-  longPress.point = point;
-  return longPress;
-}
-
-// Generate a PanGestureEvent to send to Core
-Integration::PanGestureEvent GeneratePan( Gesture::State state,
-                                          const Vector2& previousPosition,
-                                          const Vector2& currentPosition,
-                                          unsigned long timeDelta,
-                                          unsigned int numberOfTouches = 1u )
-{
-  Integration::PanGestureEvent pan(state);
-
-  pan.previousPosition = previousPosition;
-  pan.currentPosition = currentPosition;
-  pan.timeDelta = timeDelta;
-  pan.numberOfTouches = numberOfTouches;
-
-  return pan;
-}
-
 // Generate a KeyEvent to send to Core.
 Integration::KeyEvent GenerateKey( const std::string& keyName,
                                    const std::string& logicalKey,
@@ -238,53 +183,6 @@ Integration::KeyEvent GenerateKey( const std::string& keyName,
                                 deviceSubclass );
 }
 
-/**
- * Helper to generate PanGestureEvent
- *
- * @param[in] application Application instance
- * @param[in] state The Gesture State
- * @param[in] pos The current position of touch.
- */
-static void SendPan(ToolkitTestApplication& application, Gesture::State state, const Vector2& pos)
-{
-  static Vector2 last;
-
-  if( (state == Gesture::Started) ||
-      (state == Gesture::Possible) )
-  {
-    last.x = pos.x;
-    last.y = pos.y;
-  }
-
-  application.ProcessEvent( GeneratePan( state, last, pos, 16 ) );
-
-  last.x = pos.x;
-  last.y = pos.y;
-}
-
-/*
- * Simulate time passed by.
- *
- * @note this will always process at least 1 frame (1/60 sec)
- *
- * @param application Test application instance
- * @param duration Time to pass in milliseconds.
- * @return The actual time passed in milliseconds
- */
-static int Wait(ToolkitTestApplication& application, int duration = 0)
-{
-  int time = 0;
-
-  for(int i = 0; i <= ( duration / RENDER_FRAME_INTERVAL); i++)
-  {
-    application.SendNotification();
-    application.Render(RENDER_FRAME_INTERVAL);
-    time += RENDER_FRAME_INTERVAL;
-  }
-
-  return time;
-}
-
 Dali::Integration::Point GetPointDownInside( Vector2& pos )
 {
   Dali::Integration::Point point;
@@ -769,9 +667,9 @@ int UtcDaliTextEditorSetPropertyP(void)
   Property::Map underlineMapSet;
   Property::Map underlineMapGet;
 
-  underlineMapSet.Insert( "enable", "true" );
-  underlineMapSet.Insert( "color", "red" );
-  underlineMapSet.Insert( "height", "1" );
+  underlineMapSet.Insert( "enable", true );
+  underlineMapSet.Insert( "color", Color::RED );
+  underlineMapSet.Insert( "height", 1 );
 
   editor.SetProperty( TextEditor::Property::UNDERLINE, underlineMapSet );
 
@@ -1027,15 +925,13 @@ int utcDaliTextEditorTextChangedP(void)
 
 int utcDaliTextEditorInputStyleChanged01(void)
 {
-  ToolkitTestApplication application;
-  tet_infoline(" utcDaliTextEditorInputStyleChanged01");
-
   // The text-editor emits signals when the input style changes. These changes of style are
   // detected during the relayout process (size negotiation), i.e after the cursor has been moved. Signals
   // can't be emitted during the size negotiation as the callbacks may update the UI.
   // The text-editor adds an idle callback to the adaptor to emit the signals after the size negotiation.
-  // This creates an implementation of the adaptor stub and a queue of idle callbacks.
-  application.CreateAdaptor();
+  // The ToolkitTestApplication creates an implementation of the adaptor stub and a queue of idle callbacks.
+  ToolkitTestApplication application;
+  tet_infoline(" utcDaliTextEditorInputStyleChanged01");
 
   // Load some fonts.
 
@@ -1053,9 +949,9 @@ int utcDaliTextEditorInputStyleChanged01(void)
   DALI_TEST_CHECK( editor );
 
 
-  editor.SetSize( 300.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
+  editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
 
   editor.SetProperty( TextEditor::Property::ENABLE_MARKUP, true );
   editor.SetProperty( TextEditor::Property::TEXT, "<font family='DejaVuSerif' size='18'>He<color value='green'>llo</color> <font weight='bold'>world</font> demo</font>" );
@@ -1080,8 +976,7 @@ int utcDaliTextEditorInputStyleChanged01(void)
   inputStyleChangedSignal = false;
 
   // Create a tap event to touch the text editor.
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 18.f, 25.f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 18.f, 25.f ) ) );
+  TestGenerateTap( application, 18.0f, 25.0f );
 
   // Render and notify
   application.SendNotification();
@@ -1108,8 +1003,7 @@ int utcDaliTextEditorInputStyleChanged01(void)
   inputStyleChangedSignal = false;
 
   // Create a tap event to touch the text editor.
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 30.f, 25.f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 30.f, 25.f ) ) );
+  TestGenerateTap( application, 30.0f, 25.0f );
 
   // Render and notify
   application.SendNotification();
@@ -1126,8 +1020,7 @@ int utcDaliTextEditorInputStyleChanged01(void)
   inputStyleChangedSignal = false;
 
   // Create a tap event to touch the text editor.
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 43.f, 25.f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 43.f, 25.f ) ) );
+  TestGenerateTap( application, 43.0f, 25.0f );
 
   // Render and notify
   application.SendNotification();
@@ -1151,8 +1044,7 @@ int utcDaliTextEditorInputStyleChanged01(void)
   inputStyleChangedSignal = false;
 
   // Create a tap event to touch the text editor.
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 88.f, 25.f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 88.f, 25.f ) ) );
+  TestGenerateTap( application, 88.0f, 25.0f );
 
   // Render and notify
   application.SendNotification();
@@ -1185,8 +1077,7 @@ int utcDaliTextEditorInputStyleChanged01(void)
   inputStyleChangedSignal = false;
 
   // Create a tap event to touch the text editor.
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 115.f, 25.f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 115.f, 25.f ) ) );
+  TestGenerateTap( application, 115.0f, 25.0f );
 
   // Render and notify
   application.SendNotification();
@@ -1203,8 +1094,7 @@ int utcDaliTextEditorInputStyleChanged01(void)
   inputStyleChangedSignal = false;
 
   // Create a tap event to touch the text editor.
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 164.f, 25.f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 164.f, 25.f ) ) );
+  TestGenerateTap( application, 164.0f, 25.0f );
 
   // Render and notify
   application.SendNotification();
@@ -1232,8 +1122,7 @@ int utcDaliTextEditorInputStyleChanged01(void)
   inputStyleChangedSignal = false;
 
   // Create a tap event to touch the text editor.
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 191.f, 25.f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 191.f, 25.f ) ) );
+  TestGenerateTap( application, 191.0f, 25.0f );
 
   // Render and notify
   application.SendNotification();
@@ -1250,15 +1139,13 @@ int utcDaliTextEditorInputStyleChanged01(void)
 
 int utcDaliTextEditorInputStyleChanged02(void)
 {
-  ToolkitTestApplication application;
-  tet_infoline(" utcDaliTextEditorInputStyleChanged02");
-
   // The text-editor emits signals when the input style changes. These changes of style are
   // detected during the relayout process (size negotiation), i.e after the cursor has been moved. Signals
   // can't be emitted during the size negotiation as the callbacks may update the UI.
   // The text-editor adds an idle callback to the adaptor to emit the signals after the size negotiation.
-  // This creates an implementation of the adaptor stub and a queue of idle callbacks.
-  application.CreateAdaptor();
+  // The ToolkitTestApplication creates an implementation of the adaptor stub and a queue of idle callbacks.
+  ToolkitTestApplication application;
+  tet_infoline(" utcDaliTextEditorInputStyleChanged02");
 
   // Load some fonts.
 
@@ -1276,9 +1163,9 @@ int utcDaliTextEditorInputStyleChanged02(void)
   DALI_TEST_CHECK( editor );
 
 
-  editor.SetSize( 300.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
+  editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
 
   editor.SetProperty( TextEditor::Property::ENABLE_MARKUP, true );
   editor.SetProperty( TextEditor::Property::TEXT, "<font family='DejaVuSerif' size='18'>He<color value='blue'> l</color><color value='green'>lo</color> <font weight='bold'>world</font> demo</font>" );
@@ -1303,10 +1190,8 @@ int utcDaliTextEditorInputStyleChanged02(void)
   inputStyleChangedSignal = false;
 
   // Create a tap event to touch the text editor.
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 53.f, 25.f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 53.f, 25.f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 2u, 1u, Vector2( 53.f, 25.f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 2u, 1u, Vector2( 53.f, 25.f ) ) );
+  TestGenerateTap( application, 53.0f, 25.0f, 100 );
+  TestGenerateTap( application, 53.0f, 25.0f, 200 );
 
   // Render and notify
   application.SendNotification();
@@ -1434,8 +1319,7 @@ int utcDaliTextEditorInputStyleChanged02(void)
   DALI_TEST_CHECK( !inputStyleChangedSignal );
 
   // Create a tap event to touch the text editor.
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 63.f, 25.f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 63.f, 25.f ) ) );
+  TestGenerateTap( application, 63.0f, 25.0f, 900 );
 
   // Render and notify
   application.SendNotification();
@@ -1477,8 +1361,7 @@ int utcDaliTextEditorInputStyleChanged02(void)
   editor.SetProperty( TextEditor::Property::FONT_STYLE, fontStyleMapSet );
 
   // Create a tap event to touch the text editor.
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 30.f, 25.f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 30.f, 25.f ) ) );
+  TestGenerateTap( application, 30.0f, 25.0f, 1500 );
 
   // Render and notify
   application.SendNotification();
@@ -1517,9 +1400,9 @@ int utcDaliTextEditorEvent01(void)
 
   Stage::GetCurrent().Add( editor );
 
-  editor.SetSize( 300.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
+  editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
 
   // Avoid a crash when core load gl resources.
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
@@ -1538,8 +1421,7 @@ int utcDaliTextEditorEvent01(void)
   DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::TEXT ), std::string(""), TEST_LOCATION );
 
   // Create a tap event to touch the text editor.
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 150.0f, 25.0f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 150.0f, 25.0f ) ) );
+  TestGenerateTap( application, 150.0f, 25.0f );
 
   // Render and notify
   application.SendNotification();
@@ -1558,10 +1440,10 @@ int utcDaliTextEditorEvent01(void)
   // Create a second text editor and send key events to it.
   TextEditor editor2 = TextEditor::New();
 
-  editor2.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor2.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-  editor2.SetSize( 100.f, 100.f );
-  editor2.SetPosition( 100.f, 100.f );
+  editor2.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  editor2.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+  editor2.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
+  editor2.SetProperty( Actor::Property::POSITION, Vector2( 100.f, 100.f ));
 
   Stage::GetCurrent().Add( editor2 );
 
@@ -1570,8 +1452,7 @@ int utcDaliTextEditorEvent01(void)
   application.Render();
 
   // Create a tap event on the second text editor.
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 150.0f, 125.0f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 150.0f, 125.0f ) ) );
+  TestGenerateTap( application, 150.0f, 125.0f );
 
   // Render and notify
   application.SendNotification();
@@ -1604,9 +1485,9 @@ int utcDaliTextEditorEvent02(void)
 
   Stage::GetCurrent().Add( editor );
 
-  editor.SetSize( 300.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
+  editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
 
   // Avoid a crash when core load gl resources.
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
@@ -1621,8 +1502,7 @@ int utcDaliTextEditorEvent02(void)
   Actor stencil = editor.GetChildAt( 0u );
 
   // Create a tap event to touch the text editor.
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 150.0f, 25.0f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 150.0f, 25.0f ) ) );
+  TestGenerateTap( application, 150.0f, 25.0f, 100 );
 
   // Render and notify
   application.SendNotification();
@@ -1658,7 +1538,7 @@ int utcDaliTextEditorEvent02(void)
   }
 
   // Move the cursor and check the position changes.
-  Vector3 position1 = cursor.GetCurrentPosition();
+  Vector3 position1 = cursor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION );
 
   application.ProcessEvent( GenerateKey( "", "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
   application.ProcessEvent( GenerateKey( "", "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
@@ -1667,7 +1547,7 @@ int utcDaliTextEditorEvent02(void)
   application.SendNotification();
   application.Render();
 
-  Vector3 position2 = cursor.GetCurrentPosition();
+  Vector3 position2 = cursor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION );
 
   DALI_TEST_CHECK( position2.x < position1.x );
 
@@ -1678,34 +1558,32 @@ int utcDaliTextEditorEvent02(void)
   application.SendNotification();
   application.Render();
 
-  Vector3 position3 = cursor.GetCurrentPosition();
+  Vector3 position3 = cursor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION );
 
   DALI_TEST_EQUALS( position1, position3, TEST_LOCATION ); // Should be in the same position1.
 
   // Send some taps and check the cursor positions.
 
   // Try to tap at the beginning.
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 1.f, 25.0f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 1.f, 25.0f ) ) );
+  TestGenerateTap( application, 1.0f, 25.0f, 700 );
 
   // Render and notify
   application.SendNotification();
   application.Render();
 
   // Cursor position should be the same than position1.
-  Vector3 position4 = cursor.GetCurrentPosition();
+  Vector3 position4 = cursor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION );
 
   DALI_TEST_EQUALS( position2, position4, TEST_LOCATION ); // Should be in the same position2.
 
   // Tap away from the start position.
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 16.f, 25.0f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 16.0f, 25.0f ) ) );
+  TestGenerateTap( application, 16.0f, 25.0f, 1400 );
 
   // Render and notify
   application.SendNotification();
   application.Render();
 
-  Vector3 position5 = cursor.GetCurrentPosition();
+  Vector3 position5 = cursor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION );
 
   DALI_TEST_CHECK( position5.x > position4.x );
 
@@ -1719,7 +1597,7 @@ int utcDaliTextEditorEvent02(void)
   application.Render();
 
   // Cursor position should be the same than position2.
-  Vector3 position6 = cursor.GetCurrentPosition();
+  Vector3 position6 = cursor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION );
 
   DALI_TEST_EQUALS( position2, position6, TEST_LOCATION );// Should be in the same position2.
 
@@ -1743,9 +1621,9 @@ int utcDaliTextEditorEvent03(void)
 
   editor.SetProperty( TextEditor::Property::TEXT, "This is a long text for the size of the text-editor." );
   editor.SetProperty( TextEditor::Property::POINT_SIZE, 10.f );
-  editor.SetSize( 30.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 30.f, 50.f ) );
+  editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
 
   // Avoid a crash when core load gl resources.
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
@@ -1757,8 +1635,7 @@ int utcDaliTextEditorEvent03(void)
   // Send some taps and check text controller with clipboard window
   Dali::Clipboard clipboard = Clipboard::Get();
   clipboard.ShowClipboard();
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 3.f, 25.0f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 3.f, 25.0f ) ) );
+  TestGenerateTap( application, 3.0f, 25.0f, 100 );
   clipboard.HideClipboard();
 
   // Render and notify
@@ -1766,16 +1643,14 @@ int utcDaliTextEditorEvent03(void)
   application.Render();
 
   // Tap first to get the focus.
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 3.f, 25.0f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 3.f, 25.0f ) ) );
+  TestGenerateTap( application, 3.0f, 25.0f, 1000 );
 
   // Render and notify
   application.SendNotification();
   application.Render();
 
   // Double tap to select a word.
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 2u, 1u, Vector2( 3.f, 25.0f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 2u, 1u, Vector2( 3.f, 25.0f ) ) );
+  TestGenerateTap( application, 3.0f, 25.0f, 1100 );
 
   // Render and notify
   application.SendNotification();
@@ -1797,8 +1672,8 @@ int utcDaliTextEditorEvent03(void)
   }
 
   // Double tap out of bounds
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 2u, 1u, Vector2( 29.f, 25.0f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 2u, 1u, Vector2( 29.f, 25.0f ) ) );
+  TestGenerateTap( application, 29.0f, 25.0f, 1700 );
+  TestGenerateTap( application, 29.0f, 25.0f, 1800 );
 
   // Render and notify
   application.SendNotification();
@@ -1816,8 +1691,7 @@ int utcDaliTextEditorEvent03(void)
   }
 
   // Long Press
-  application.ProcessEvent( GenerateLongPress( Gesture::Possible, 1u, Vector2( 1.f, 25.0f ) ) );
-  application.ProcessEvent( GenerateLongPress( Gesture::Started,  1u, Vector2( 1.f, 25.0f ) ) );
+  TestGenerateLongPress(application, 1.0f, 25.0f);
 
   // Render and notify
   application.SendNotification();
@@ -1840,9 +1714,9 @@ int utcDaliTextEditorEvent04(void)
 
   editor.SetProperty( TextEditor::Property::TEXT, "Hello\nworl" );
   editor.SetProperty( TextEditor::Property::POINT_SIZE, 10.f );
-  editor.SetSize( 100.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 50.f ) );
+  editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
 
   // Avoid a crash when core load gl resources.
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
@@ -1852,8 +1726,7 @@ int utcDaliTextEditorEvent04(void)
   application.Render();
 
   // Tap on the text editor
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 3.f, 25.0f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 3.f, 25.0f ) ) );
+  TestGenerateTap( application, 3.0f, 25.0f );
 
   // Render and notify
   application.SendNotification();
@@ -1930,9 +1803,9 @@ int utcDaliTextEditorEvent05(void)
 
   editor.SetProperty( TextEditor::Property::TEXT, "Hello\nworl" );
   editor.SetProperty( TextEditor::Property::POINT_SIZE, 10.f );
-  editor.SetSize( 50.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 50.f, 50.f ) );
+  editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
   editor.SetProperty( TextEditor::Property::SMOOTH_SCROLL, true );
   editor.SetProperty( TextEditor::Property::SMOOTH_SCROLL_DURATION, 0.2f );
   editor.SetProperty( TextEditor::Property::ENABLE_SCROLL_BAR, true );
@@ -1947,8 +1820,7 @@ int utcDaliTextEditorEvent05(void)
   application.Render();
 
   // Tap on the text editor
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 3.f, 25.0f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 3.f, 25.0f ) ) );
+  TestGenerateTap( application, 3.0f, 25.0f );
 
   // Render and notify
   application.SendNotification();
@@ -2013,9 +1885,9 @@ int utcDaliTextEditorEvent06(void)
 
   editor.SetProperty( TextEditor::Property::TEXT, "Hello\nworld\nHello world" );
   editor.SetProperty( TextEditor::Property::POINT_SIZE, 10.f );
-  editor.SetSize( 100.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 50.f ) );
+  editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
 
   // Avoid a crash when core load gl resources.
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
@@ -2025,8 +1897,7 @@ int utcDaliTextEditorEvent06(void)
   application.Render();
 
   // Tap on the text editor
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 3.f, 25.0f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 3.f, 25.0f ) ) );
+  TestGenerateTap( application, 3.0f, 25.0f );
 
   // Render and notify
   application.SendNotification();
@@ -2104,9 +1975,9 @@ int utcDaliTextEditorEvent07(void)
 
   editor.SetProperty( TextEditor::Property::TEXT, "Hello\nworld\nHello world" );
   editor.SetProperty( TextEditor::Property::POINT_SIZE, 10.f );
-  editor.SetSize( 100.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 50.f ) );
+  editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
 
   // Avoid a crash when core load gl resources.
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
@@ -2116,8 +1987,7 @@ int utcDaliTextEditorEvent07(void)
   application.Render();
 
   // Tap on the text editor
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 3.f, 25.0f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 3.f, 25.0f ) ) );
+  TestGenerateTap( application, 3.0f, 25.0f );
 
   // Render and notify
   application.SendNotification();
@@ -2249,9 +2119,9 @@ int utcDaliTextEditorEvent08(void)
 
   editor.SetProperty( TextEditor::Property::TEXT, "DALi" );
   editor.SetProperty( TextEditor::Property::POINT_SIZE, 10.f );
-  editor.SetSize( 100.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 50.f ) );
+  editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
 
   // Avoid a crash when core load gl resources.
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
@@ -2261,8 +2131,7 @@ int utcDaliTextEditorEvent08(void)
   application.Render();
 
   // Tap on the text editor
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 3.f, 25.0f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 3.f, 25.0f ) ) );
+  TestGenerateTap( application, 3.0f, 25.0f );
 
   // Render and notify
   application.SendNotification();
@@ -2457,9 +2326,9 @@ int utcDaliTextEditorHandles(void)
   editor.SetProperty( TextEditor::Property::SELECTION_HANDLE_PRESSED_IMAGE_LEFT, imagePropertyMap );
   editor.SetProperty( TextEditor::Property::SELECTION_HANDLE_PRESSED_IMAGE_RIGHT, imagePropertyMap );
 
-  editor.SetSize( 30.f, 500.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 30.f, 500.f ) );
+  editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
 
   // Avoid a crash when core load gl resources.
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
@@ -2469,16 +2338,14 @@ int utcDaliTextEditorHandles(void)
   application.Render();
 
   // Tap first to get the focus.
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 3.f, 25.0f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 3.f, 25.0f ) ) );
+  TestGenerateTap( application, 3.0f, 25.0f, 100 );
 
   // Render and notify
   application.SendNotification();
   application.Render();
 
   // Tap to create the grab handle.
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 3.f, 25.0f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 3.f, 25.0f ) ) );
+  TestGenerateTap( application, 3.0f, 25.0f, 700 );
 
   // Render and notify
   application.SendNotification();
@@ -2489,7 +2356,7 @@ int utcDaliTextEditorHandles(void)
 
   // Get the handle's actor.
   Actor handle = activeLayer.GetChildAt( 1u );
-  handle.SetSize( 100.f, 100.f );
+  handle.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
 
   // Render and notify
   application.SendNotification();
@@ -2506,22 +2373,6 @@ int utcDaliTextEditorHandles(void)
   application.SendNotification();
   application.Render();
 
-  // drag grab handle right
-  SendPan(application, Gesture::Possible, touchPos);
-  SendPan(application, Gesture::Started, touchPos);
-  touchPos.x += 5.0f;
-  Wait(application, 100);
-
-  for(int i = 0;i<20;i++)
-  {
-    SendPan(application, Gesture::Continuing, touchPos);
-    touchPos.x += 5.0f;
-    Wait(application);
-  }
-
-  SendPan(application, Gesture::Finished, touchPos);
-  Wait(application);
-
   // Release the grab handle.
   event = Dali::Integration::TouchEvent();
   event.AddPoint( GetPointUpInside( touchPos ) );
@@ -2532,16 +2383,14 @@ int utcDaliTextEditorHandles(void)
   application.Render();
 
   // Tap first to get the focus.
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 3.f, 25.0f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 3.f, 25.0f ) ) );
+  TestGenerateTap( application, 3.0f, 25.0f, 1400 );
 
   // Render and notify
   application.SendNotification();
   application.Render();
 
   // Double tap to select a word and create the selection handles.
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 2u, 1u, Vector2( 3.f, 25.0f ) ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 2u, 1u, Vector2( 3.f, 25.0f ) ) );
+  TestGenerateTap( application, 3.0f, 25.0f, 1500 );
 
   // Render and notify
   application.SendNotification();
@@ -2558,22 +2407,6 @@ int utcDaliTextEditorHandles(void)
   application.SendNotification();
   application.Render();
 
-  // drag the left selection handle right
-  SendPan(application, Gesture::Possible, touchPos);
-  SendPan(application, Gesture::Started, touchPos);
-  touchPos.x += 5.0f;
-  Wait(application, 100);
-
-  for(int i = 0;i<20;i++)
-  {
-    SendPan(application, Gesture::Continuing, touchPos);
-    touchPos.x += 5.0f;
-    Wait(application);
-  }
-
-  SendPan(application, Gesture::Finished, touchPos);
-  Wait(application);
-
   // Release the left selection handle.
   event = Dali::Integration::TouchEvent();
   event.AddPoint( GetPointUpInside( touchPos ) );
@@ -2604,9 +2437,9 @@ int utcDaliTextEditorUnderPropertyStringP(void)
   // Check the input underline property
   Property::Map underlineMapSet;
   Property::Map underlineMapGet;
-  underlineMapSet.Insert( "enable", "true" );
-  underlineMapSet.Insert( "color", "blue" );
-  underlineMapSet.Insert( "height", "2" );
+  underlineMapSet.Insert( "enable", true );
+  underlineMapSet.Insert( "color", Color::BLUE );
+  underlineMapSet.Insert( "height", 2 );
 
   editor.SetProperty( TextEditor::Property::UNDERLINE, underlineMapSet );
   underlineMapGet = editor.GetProperty<Property::Map>( TextEditor::Property::UNDERLINE );
@@ -2689,11 +2522,11 @@ int utcDaliTextEditorGetPropertyLinecountP(void)
 
   Stage::GetCurrent().Add( editor );
 
-  editor.SetSize( 100.0f, 100.0f );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
   lineCount =  editor.GetProperty<int>( TextEditor::Property::LINE_COUNT );
   DALI_TEST_EQUALS( lineCount, 14, TEST_LOCATION );
 
-  editor.SetSize( 50.0f, 100.0f );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 50.f, 100.f ) );
   lineCount =  editor.GetProperty<int>( TextEditor::Property::LINE_COUNT );
   DALI_TEST_EQUALS( lineCount, 28, TEST_LOCATION );
 
@@ -2712,9 +2545,9 @@ int utcDaliTextEditorScrollStateChangedSignalTest(void)
   Stage::GetCurrent().Add( editor );
 
   editor.SetProperty( TextEditor::Property::POINT_SIZE, 10.f );
-  editor.SetSize( 50.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 50.f, 50.f ) );
+  editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
   editor.SetProperty( TextEditor::Property::ENABLE_SCROLL_BAR, true );
   editor.SetKeyboardFocusable(true);
 
@@ -2749,7 +2582,7 @@ int UtcDaliToolkitTextEditorTextWrapMode(void)
   int lineCount =0 ;
 
   TextEditor editor = TextEditor::New();
-  editor.SetSize( 150.0f, 300.f );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 150.0f, 300.f ) );
   editor.SetProperty( TextEditor::Property::TEXT, "Hello world Hello world" );
 
   Stage::GetCurrent().Add( editor );
@@ -2800,9 +2633,9 @@ int UtcDaliTextEditorSetPaddingProperty(void)
 
   TextEditor editor = TextEditor::New();
   DALI_TEST_CHECK( editor );
-  editor.SetSize( 300.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
+  editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
   Stage::GetCurrent().Add( editor );
 
   application.SendNotification();
@@ -2833,9 +2666,9 @@ int UtcDaliTextEditorEnableShiftSelectionProperty(void)
 
   TextEditor editor = TextEditor::New();
   DALI_TEST_CHECK( editor );
-  editor.SetSize( 300.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
+  editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
   Stage::GetCurrent().Add( editor );
 
   application.SendNotification();
@@ -2861,9 +2694,9 @@ int UtcDaliTextEditorEnableGrabHandleProperty(void)
 
   TextEditor editor = TextEditor::New();
   DALI_TEST_CHECK( editor );
-  editor.SetSize( 300.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
+  editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
   Stage::GetCurrent().Add( editor );
 
   application.SendNotification();
@@ -2889,9 +2722,9 @@ int UtcDaliTextEditorMatchSystemLanguageDirectionProperty(void)
 
   TextEditor editor = TextEditor::New();
   DALI_TEST_CHECK( editor );
-  editor.SetSize( 300.f, 50.f );
-  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  editor.SetProperty( Actor::Property::SIZE, Vector2( 300.f, 50.f ) );
+  editor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+  editor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
   Stage::GetCurrent().Add( editor );
 
   application.SendNotification();