[dali_1.2.32] Merge branch 'devel/master'
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-CustomActor.cpp
index 8d08607..db7fca7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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/integration-api/events/touch-event-integ.h>
 #include <dali/integration-api/events/hover-event-integ.h>
-#include <dali/integration-api/events/mouse-wheel-event-integ.h>
+#include <dali/integration-api/events/wheel-event-integ.h>
 #include <dali/integration-api/events/key-event-integ.h>
-
+#include <dali/public-api/object/type-registry-helper.h>
 #include "dali-test-suite-utils/dali-test-suite-utils.h"
+#include "test-custom-actor.h"
 
 using namespace Dali;
 
@@ -39,697 +40,10 @@ void custom_actor_test_cleanup(void)
   test_return_value = TET_PASS;
 }
 
-namespace
-{
-
-std::vector< std::string > MasterCallStack;
-
-} // anon namespace
-
-// TypeRegistry needs custom actor Implementations to have the same name (namespaces are ignored so we use one here)
-namespace Impl
-{
-
-struct TestCustomActor : public CustomActorImpl
-{
-  /**
-   * Constructor
-   */
-  TestCustomActor()
-  : CustomActorImpl( true ), // requires touch
-    mDaliProperty( Property::INVALID_INDEX ),
-    mSizeSet( Vector3::ZERO ),
-    mTargetSize( Vector3::ZERO )
-  {
-    SetRequiresMouseWheelEvents(true);
-    SetRequiresHoverEvents(true);
-  }
-
-  /**
-   * Destructor
-   */
-  virtual ~TestCustomActor()
-  {
-  }
-
-  void Initialize( const char* name = NULL )
-  {
-    mDaliProperty = Self().RegisterProperty( "Dali", std::string("no"), Property::READ_WRITE);
-
-    OnInitialize( name );
-  }
-
-  virtual void OnInitialize( const char* name ) {}
-
-  /**
-   * Resets the call stack
-   */
-  void ResetCallStack()
-  {
-    mSizeSet = Vector3();
-    mTargetSize = Vector3();
-    mMethodsCalled.clear();
-  }
-
-  void AddToCallStacks( const char* method )
-  {
-    mMethodsCalled.push_back( method );
-
-    // Combine Actor name with method string
-    std::string nameAndMethod( Self().GetName() );
-    if ( 0 == nameAndMethod.size() )
-    {
-      nameAndMethod = "Unknown: ";
-    }
-    else
-    {
-      nameAndMethod += ": ";
-    }
-    nameAndMethod += method;
-
-    MasterCallStack.push_back( nameAndMethod );
-  }
-
-  // From CustomActorImpl
-  virtual void OnStageConnection()
-  {
-    AddToCallStacks("OnStageConnection");
-  }
-  virtual void OnStageDisconnection()
-  {
-    AddToCallStacks("OnStageDisconnection");
-  }
-  virtual void OnChildAdd(Actor& child)
-  {
-    AddToCallStacks("OnChildAdd");
-  }
-  virtual void OnChildRemove(Actor& child)
-  {
-    AddToCallStacks("OnChildRemove");
-  }
-  virtual void OnPropertySet( Property::Index index, Property::Value propertyValue )
-  {
-    AddToCallStacks("OnPropertySet");
-  }
-  virtual void OnSizeSet(const Vector3& targetSize)
-  {
-    mSizeSet = targetSize;
-    AddToCallStacks("OnSizeSet");
-  }
-  virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize)
-  {
-    mTargetSize = targetSize;
-    AddToCallStacks("OnSizeAnimation");
-  }
-  virtual bool OnTouchEvent(const TouchEvent& event)
-  {
-    AddToCallStacks("OnTouchEvent");
-    return true;
-  }
-  virtual bool OnHoverEvent(const HoverEvent& event)
-  {
-    AddToCallStacks("OnHoverEvent");
-    return true;
-  }
-  virtual bool OnMouseWheelEvent(const MouseWheelEvent& event)
-  {
-    AddToCallStacks("OnMouseWheelEvent");
-    return true;
-  }
-  virtual bool OnKeyEvent(const KeyEvent& event)
-  {
-    AddToCallStacks("OnKeyEvent");
-    return true;
-  }
-  virtual void OnKeyInputFocusGained()
-  {
-    AddToCallStacks("OnKeyInputFocusGained");
-  }
-  virtual void OnKeyInputFocusLost()
-  {
-    AddToCallStacks("OnKeyInputFocusLost");
-  }
-  virtual Vector3 GetNaturalSize()
-  {
-    return Vector3( 0.0f, 0.0f, 0.0f );
-  }
-
-  virtual float GetHeightForWidth( float width )
-  {
-    return 0.0f;
-  }
-
-  virtual float GetWidthForHeight( float height )
-  {
-    return 0.0f;
-  }
-
-  virtual void OnRelayout( const Vector2& size, RelayoutContainer& container )
-  {
-  }
-
-  virtual void OnSetResizePolicy( ResizePolicy policy, Dimension dimension )
-  {
-  }
-
-  virtual void OnCalculateRelayoutSize( Dimension dimension )
-  {
-  }
-
-  virtual float CalculateChildSize( const Dali::Actor& child, Dimension dimension )
-  {
-    return 0.0f;
-  }
-
-  virtual void OnLayoutNegotiated( float size, Dimension dimension )
-  {
-  }
-
-  virtual bool RelayoutDependentOnChildren( Dimension dimension = ALL_DIMENSIONS )
-  {
-    return false;
-  }
-
-  void SetDaliProperty(std::string s)
-  {
-    Self().SetProperty(mDaliProperty, s) ;
-  }
-
-  Property::Index mDaliProperty;
-  std::vector< std::string > mMethodsCalled;
-  Vector3 mSizeSet;
-  Vector3 mTargetSize;
-};
-
-/**
- * Variant which adds a new child during OnStageConnection
- */
-struct TestCustomActorVariant1 : public TestCustomActor
-{
-  /**
-   * Constructor
-   */
-  TestCustomActorVariant1( Actor childToAdd )
-  : mChildToAdd( childToAdd )
-  {
-  }
-
-  // From CustomActorImpl
-  virtual void OnStageConnection()
-  {
-    // Chain up first
-    TestCustomActor::OnStageConnection();
-
-    // Add the child
-    Self().Add( mChildToAdd );
-  }
-
-  Actor mChildToAdd;
-};
-
-/**
- * Variant which removes children during OnStageConnection
- */
-struct TestCustomActorVariant2 : public TestCustomActor
-{
-  /**
-   * Constructor
-   */
-  TestCustomActorVariant2()
-  {
-  }
-
-  // From CustomActorImpl
-  virtual void OnStageConnection()
-  {
-    // Chain up first
-    TestCustomActor::OnStageConnection();
-
-    // Remove all the children
-    for( unsigned int i=0, num=Self().GetChildCount(); i<num; ++i )
-    {
-      Self().Remove( Self().GetChildAt(0) );
-    }
-  }
-};
-
-/**
- * Variant which adds a new child during OnStageDisconnection
- */
-struct TestCustomActorVariant3 : public TestCustomActor
-{
-  /**
-   * Constructor
-   */
-  TestCustomActorVariant3( Actor childToAdd )
-  : mChildToAdd( childToAdd )
-  {
-  }
-
-  // From CustomActorImpl
-  virtual void OnStageDisconnection()
-  {
-    // Chain up first
-    TestCustomActor::OnStageDisconnection();
-
-    // Add the child
-    Self().Add( mChildToAdd );
-  }
-
-  Actor mChildToAdd;
-};
-
-/**
- * Variant which removes children during OnStageDisconnection
- */
-struct TestCustomActorVariant4 : public TestCustomActor
-{
-  /**
-   * Constructor
-   */
-  TestCustomActorVariant4()
-  {
-  }
-
-  // From CustomActorImpl
-  virtual void OnStageDisconnection()
-  {
-    // Chain up first
-    TestCustomActor::OnStageDisconnection();
-
-    // Remove all the children
-    for( unsigned int i=0, num=Self().GetChildCount(); i<num; ++i )
-    {
-      Self().Remove( Self().GetChildAt(0) );
-    }
-  }
-};
-
-/**
- * Variant which removes its parent from Stage during OnStageConnection
- */
-struct TestCustomActorVariant5 : public TestCustomActor
-{
-  /**
-   * Constructor
-   */
-  TestCustomActorVariant5()
-  {
-  }
-
-  // From CustomActorImpl
-  virtual void OnStageConnection()
-  {
-    // Chain up first
-    TestCustomActor::OnStageConnection();
-
-    // Take parent off-stage
-    Actor parent = Self().GetParent();
-    if ( parent )
-    {
-      Stage::GetCurrent().Remove( parent );
-    }
-  }
-};
-
-/**
- * Variant which adds its parent to Stage during OnStageDisconnection
- */
-struct TestCustomActorVariant6 : public TestCustomActor
-{
-  /**
-   * Constructor
-   */
-  TestCustomActorVariant6()
-  {
-  }
-
-  // From CustomActorImpl
-  virtual void OnStageDisconnection()
-  {
-    // Chain up first
-    TestCustomActor::OnStageDisconnection();
-
-    // Put parent on-stage
-    Actor parent = Self().GetParent();
-    if ( parent )
-    {
-      Stage::GetCurrent().Add( parent );
-    }
-  }
-};
-
-/**
- * Variant which reparents its children into a separate container
- */
-struct TestCustomActorVariant7 : public TestCustomActor
-{
-  /**
-   * Constructor
-   */
-  TestCustomActorVariant7()
-  {
-  }
-
-  virtual void OnInitialize( const char* name )
-  {
-    // We need to do this early, before the OnChildAdd is recorded
-    Self().SetName( name );
-
-    mContainer = Actor::New();
-    mContainer.SetName( "Container" );
-    Self().Add( mContainer );
-  }
-
-  // From CustomActorImpl
-  virtual void OnChildAdd(Actor& child)
-  {
-    // Chain up first
-    TestCustomActor::OnChildAdd(child);
-
-    // Reparent child
-    if ( child != mContainer )
-    {
-      mContainer.Add( child );
-    }
-  }
-
-  Actor mContainer;
-};
-
-/**
- * Variant which attempts to interfere with the reparenting of a child to another container
- */
-struct TestCustomActorVariant8 : public TestCustomActor
-{
-  /**
-   * Constructor
-   */
-  TestCustomActorVariant8( Actor rival )
-  : mRivalContainer( rival )
-  {
-  }
-
-  // From CustomActorImpl
-  virtual void OnChildRemove(Actor& child)
-  {
-    // Chain up first
-    TestCustomActor::OnChildRemove(child);
-
-    mRivalContainer.Remove( child ); // attempt to block reparenting to rival (should be a NOOP)
-  }
-
-  Actor mRivalContainer;
-};
-
-// Need a class that doesn't override virtual methods
-class SimpleTestCustomActor : public CustomActorImpl
-{
-public:
-
-  /**
-   * Constructor
-   */
-  SimpleTestCustomActor()
-  : CustomActorImpl( true ) // requires touch
-  {
-  }
-
-  /**
-   * Destructor
-   */
-  virtual ~SimpleTestCustomActor()
-  {
-  }
-
-  // From CustomActorImpl
-  virtual void OnStageConnection()
-  {
-  }
-  virtual void OnStageDisconnection()
-  {
-  }
-  virtual void OnChildAdd(Actor& child)
-  {
-  }
-  virtual void OnChildRemove(Actor& child)
-  {
-  }
-  virtual void OnSizeSet(const Vector3& targetSize)
-  {
-  }
-  virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize)
-  {
-  }
-  virtual bool OnTouchEvent(const TouchEvent& event)
-  {
-    return true;
-  }
-  virtual bool OnHoverEvent(const HoverEvent& event)
-  {
-    return true;
-  }
-  virtual bool OnMouseWheelEvent(const MouseWheelEvent& event)
-  {
-    return true;
-  }
-  virtual bool OnKeyEvent(const KeyEvent& event)
-  {
-    return true;
-  }
-  virtual void OnKeyInputFocusGained()
-  {
-  }
-  virtual void OnKeyInputFocusLost()
-  {
-  }
-
-  virtual Vector3 GetNaturalSize()
-  {
-    return Vector3( 0.0f, 0.0f, 0.0f );
-  }
-
-  virtual float GetHeightForWidth( float width )
-  {
-    return 0.0f;
-  }
-
-  virtual float GetWidthForHeight( float height )
-  {
-    return 0.0f;
-  }
-
-  virtual void OnRelayout( const Vector2& size, RelayoutContainer& container )
-  {
-  }
-
-  virtual void OnSetResizePolicy( ResizePolicy policy, Dimension dimension )
-  {
-  }
-
-  virtual void OnCalculateRelayoutSize( Dimension dimension )
-  {
-  }
-
-  virtual float CalculateChildSize( const Dali::Actor& child, Dimension dimension )
-  {
-    return 0.0f;
-  }
-
-  virtual void OnLayoutNegotiated( float size, Dimension dimension )
-  {
-  }
-
-  virtual bool RelayoutDependentOnChildren( Dimension dimension = ALL_DIMENSIONS )
-  {
-    return false;
-  }
-};
-
-} ; // namespace Impl
-
-
-namespace
-{
-
-/**
- * Test custom actor handle
- */
-class TestCustomActor : public CustomActor
-{
-public:
-
-  static TestCustomActor New()
-  {
-    Impl::TestCustomActor* impl = new Impl::TestCustomActor;
-    TestCustomActor custom( *impl ); // takes ownership
-
-    impl->Initialize();
-
-    return custom;
-  }
-
-  static TestCustomActor NewVariant1( Actor childToAdd )
-  {
-    Impl::TestCustomActor* impl = new Impl::TestCustomActorVariant1( childToAdd );
-    TestCustomActor custom( *impl ); // takes ownership
-
-    impl->Initialize();
-
-    return custom;
-  }
-
-  static TestCustomActor NewVariant2()
-  {
-    Impl::TestCustomActor* impl = new Impl::TestCustomActorVariant2();
-    TestCustomActor custom( *impl ); // takes ownership
-
-    impl->Initialize();
-
-    return custom;
-  }
-
-  static TestCustomActor NewVariant3( Actor childToAdd )
-  {
-    Impl::TestCustomActor* impl = new Impl::TestCustomActorVariant3( childToAdd );
-    TestCustomActor custom( *impl ); // takes ownership
-
-    impl->Initialize();
-
-    return custom;
-  }
-
-  static TestCustomActor NewVariant4()
-  {
-    Impl::TestCustomActor* impl = new Impl::TestCustomActorVariant4();
-    TestCustomActor custom( *impl ); // takes ownership
-
-    impl->Initialize();
-
-    return custom;
-  }
-
-  static TestCustomActor NewVariant5()
-  {
-    Impl::TestCustomActor* impl = new Impl::TestCustomActorVariant5();
-    TestCustomActor custom( *impl ); // takes ownership
-
-    impl->Initialize();
-
-    return custom;
-  }
-
-  static TestCustomActor NewVariant6()
-  {
-    Impl::TestCustomActor* impl = new Impl::TestCustomActorVariant6();
-    TestCustomActor custom( *impl ); // takes ownership
-
-    impl->Initialize();
-
-    return custom;
-  }
-
-  static TestCustomActor NewVariant7( const char* name )
-  {
-    Impl::TestCustomActor* impl = new Impl::TestCustomActorVariant7();
-    TestCustomActor custom( *impl ); // takes ownership
-
-    impl->Initialize( name );
-
-    return custom;
-  }
-
-  static TestCustomActor NewVariant8( Actor rival )
-  {
-    Impl::TestCustomActor* impl = new Impl::TestCustomActorVariant8( rival );
-    TestCustomActor custom( *impl ); // takes ownership
-
-    impl->Initialize();
-
-    return custom;
-  }
-
-  virtual ~TestCustomActor()
-  {
-  }
-
-  Impl::TestCustomActor& GetImpl()
-  {
-    return static_cast<Impl::TestCustomActor&>(GetImplementation());
-  }
-
-  std::vector< std::string >& GetMethodsCalled()
-  {
-    return GetImpl().mMethodsCalled;
-  }
-
-  void ResetCallStack()
-  {
-    GetImpl().ResetCallStack();
-  }
-
-  void SetDaliProperty(std::string s)
-  {
-    GetImpl().SetDaliProperty(s);
-  }
-
-  Vector3 GetSize()
-  {
-    return GetImpl().mSizeSet;
-  }
-
-  Vector3 GetTargetSize()
-  {
-    return GetImpl().mTargetSize;
-  }
-
-  virtual Vector3 GetNaturalSize()
-  {
-    return Vector3( 0.0f, 0.0f, 0.0f );
-  }
-
-  virtual float GetHeightForWidth( float width )
-  {
-    return 0.0f;
-  }
-
-  virtual float GetWidthForHeight( float height )
-  {
-    return 0.0f;
-  }
-
-  virtual void OnRelayout( const Vector2& size, RelayoutContainer& container )
-  {
-  }
-
-  virtual void OnLayoutNegotiated( float size, Dimension dimension )
-  {
-  }
-
-  virtual void OnCalculateRelayoutSize( Dimension dimension )
-  {
-  }
-
-private:
-
-  TestCustomActor( Impl::TestCustomActor& impl ) : CustomActor( impl )
-  {
-  }
-};
-
 
 
 using namespace Dali;
 
-BaseHandle CreateActor()
-{
-  return TestCustomActor::New();
-}
-
-Dali::TypeRegistration mType( typeid(TestCustomActor), typeid(Dali::CustomActor), CreateActor );
-
-} // anon namespace
-
 
 int UtcDaliCustomActorDestructor(void)
 {
@@ -745,8 +59,8 @@ int UtcDaliCustomActorDestructor(void)
 int UtcDaliCustomActorImplDestructor(void)
 {
   TestApplication application;
-  CustomActorImpl* actor = new Impl::TestCustomActor();
-  delete actor;
+  CustomActorImpl* actor = new Test::Impl::TestCustomActor();
+  CustomActor customActor( *actor ); // Will automatically unref at the end of this function
 
   DALI_TEST_CHECK( true );
   END_TEST;
@@ -758,7 +72,7 @@ int UtcDaliCustomActorDownCast(void)
   TestApplication application;
   tet_infoline("Testing Dali::CustomActor::DownCast()");
 
-  TestCustomActor custom = TestCustomActor::New();
+  Test::TestCustomActor custom = Test::TestCustomActor::New();
 
   Actor anActor = Actor::New();
   anActor.Add( custom );
@@ -803,7 +117,7 @@ int UtcDaliCustomActorOnStageConnectionDisconnection(void)
   TestApplication application;
   tet_infoline("Testing Dali::CustomActor::OnStageConnection() & OnStageDisconnection");
 
-  TestCustomActor custom = TestCustomActor::New();
+  Test::TestCustomActor custom = Test::TestCustomActor::New();
   DALI_TEST_EQUALS( 0, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
 
   // add the custom actor to stage
@@ -843,26 +157,26 @@ int UtcDaliCustomActorOnStageConnectionOrder(void)
    * OnStageConnection should be received for A, B, D, E, C, and finally F
    */
 
-  TestCustomActor actorA = TestCustomActor::New();
+  Test::TestCustomActor actorA = Test::TestCustomActor::New();
   actorA.SetName( "ActorA" );
 
-  TestCustomActor actorB = TestCustomActor::New();
+  Test::TestCustomActor actorB = Test::TestCustomActor::New();
   actorB.SetName( "ActorB" );
   actorA.Add( actorB );
 
-  TestCustomActor actorC = TestCustomActor::New();
+  Test::TestCustomActor actorC = Test::TestCustomActor::New();
   actorC.SetName( "ActorC" );
   actorA.Add( actorC );
 
-  TestCustomActor actorD = TestCustomActor::New();
+  Test::TestCustomActor actorD = Test::TestCustomActor::New();
   actorD.SetName( "ActorD" );
   actorB.Add( actorD );
 
-  TestCustomActor actorE = TestCustomActor::New();
+  Test::TestCustomActor actorE = Test::TestCustomActor::New();
   actorE.SetName( "ActorE" );
   actorB.Add( actorE );
 
-  TestCustomActor actorF = TestCustomActor::New();
+  Test::TestCustomActor actorF = Test::TestCustomActor::New();
   actorF.SetName( "ActorF" );
   actorC.Add( actorF );
 
@@ -935,27 +249,27 @@ int UtcDaliCustomActorOnStageDisconnectionOrder(void)
    * OnStageDisconnection should be received for D, E, B, F, C, and finally A.
    */
 
-  TestCustomActor actorA = TestCustomActor::New();
+  Test::TestCustomActor actorA = Test::TestCustomActor::New();
   actorA.SetName( "ActorA" );
   stage.Add( actorA );
 
-  TestCustomActor actorB = TestCustomActor::New();
+  Test::TestCustomActor actorB = Test::TestCustomActor::New();
   actorB.SetName( "ActorB" );
   actorA.Add( actorB );
 
-  TestCustomActor actorC = TestCustomActor::New();
+  Test::TestCustomActor actorC = Test::TestCustomActor::New();
   actorC.SetName( "ActorC" );
   actorA.Add( actorC );
 
-  TestCustomActor actorD = TestCustomActor::New();
+  Test::TestCustomActor actorD = Test::TestCustomActor::New();
   actorD.SetName( "ActorD" );
   actorB.Add( actorD );
 
-  TestCustomActor actorE = TestCustomActor::New();
+  Test::TestCustomActor actorE = Test::TestCustomActor::New();
   actorE.SetName( "ActorE" );
   actorB.Add( actorE );
 
-  TestCustomActor actorF = TestCustomActor::New();
+  Test::TestCustomActor actorF = Test::TestCustomActor::New();
   actorF.SetName( "ActorF" );
   actorC.Add( actorF );
 
@@ -1026,10 +340,10 @@ int UtcDaliCustomActorAddDuringOnStageConnection(void)
    * The actorB is provided as the child
    */
 
-  TestCustomActor actorB = TestCustomActor::New();
+  Test::TestCustomActor actorB = Test::TestCustomActor::New();
   actorB.SetName( "ActorB" );
 
-  TestCustomActor actorA = TestCustomActor::NewVariant1( actorB );
+  Test::TestCustomActor actorA = Test::TestCustomActor::NewVariant1( actorB );
   actorA.SetName( "ActorA" );
   stage.Add( actorA );
 
@@ -1076,14 +390,14 @@ int UtcDaliCustomActorRemoveDuringOnStageConnection(void)
    * Actors B & C are provided as the children
    */
 
-  TestCustomActor actorA = TestCustomActor::NewVariant2();
+  Test::TestCustomActor actorA = Test::TestCustomActor::NewVariant2();
   actorA.SetName( "ActorA" );
 
-  TestCustomActor actorB = TestCustomActor::New();
+  Test::TestCustomActor actorB = Test::TestCustomActor::New();
   actorB.SetName( "ActorB" );
   actorA.Add( actorB );
 
-  TestCustomActor actorC = TestCustomActor::New();
+  Test::TestCustomActor actorC = Test::TestCustomActor::New();
   actorC.SetName( "ActorC" );
   actorA.Add( actorC );
 
@@ -1138,10 +452,10 @@ int UtcDaliCustomActorAddDuringOnStageDisconnection(void)
    * The actorB is provided as the child
    */
 
-  TestCustomActor actorB = TestCustomActor::New();
+  Test::TestCustomActor actorB = Test::TestCustomActor::New();
   actorB.SetName( "ActorB" );
 
-  TestCustomActor actorA = TestCustomActor::NewVariant3( actorB );
+  Test::TestCustomActor actorA = Test::TestCustomActor::NewVariant3( actorB );
   actorA.SetName( "ActorA" );
   stage.Add( actorA );
 
@@ -1191,11 +505,11 @@ int UtcDaliCustomActorRemoveDuringOnStageDisconnection(void)
    * The actorB is provided as the child
    */
 
-  TestCustomActor actorA = TestCustomActor::NewVariant4();
+  Test::TestCustomActor actorA = Test::TestCustomActor::NewVariant4();
   actorA.SetName( "ActorA" );
   stage.Add( actorA );
 
-  TestCustomActor actorB = TestCustomActor::New();
+  Test::TestCustomActor actorB = Test::TestCustomActor::New();
   actorB.SetName( "ActorB" );
   actorA.Add( actorB );
 
@@ -1249,10 +563,10 @@ int UtcDaliCustomActorRemoveParentDuringOnStageConnection(void)
    * The child actor is interrupting the parent's connection to stage, therefore the parent should not get an OnStageDisconnection()
    */
 
-  TestCustomActor actorA = TestCustomActor::New();
+  Test::TestCustomActor actorA = Test::TestCustomActor::New();
   actorA.SetName( "ActorA" );
 
-  TestCustomActor actorB = TestCustomActor::NewVariant5();
+  Test::TestCustomActor actorB = Test::TestCustomActor::NewVariant5();
   actorB.SetName( "ActorB" );
   actorA.Add( actorB );
 
@@ -1297,11 +611,11 @@ int UtcDaliCustomActorAddParentDuringOnStageDisconnection(void)
    * The child actor is interrupting the disconnection, such that parent should not get a OnStageDisconnection()
    */
 
-  TestCustomActor actorA = TestCustomActor::New();
+  Test::TestCustomActor actorA = Test::TestCustomActor::New();
   actorA.SetName( "ActorA" );
   stage.Add( actorA );
 
-  TestCustomActor actorB = TestCustomActor::NewVariant6();
+  Test::TestCustomActor actorB = Test::TestCustomActor::NewVariant6();
   actorB.SetName( "ActorB" );
   actorA.Add( actorB );
 
@@ -1338,7 +652,7 @@ int UtcDaliCustomActorOnChildAddRemove(void)
   TestApplication application;
   tet_infoline("Testing Dali::CustomActor::OnChildAdd() & OnChildRemove()");
 
-  TestCustomActor custom = TestCustomActor::New();
+  Test::TestCustomActor custom = Test::TestCustomActor::New();
   DALI_TEST_EQUALS( 0, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
 
   Actor aChild = Actor::New();
@@ -1367,10 +681,10 @@ int UtcDaliCustomActorReparentDuringOnChildAdd(void)
    * The actorB is the child of actorA
    */
 
-  TestCustomActor actorA = TestCustomActor::NewVariant7( "ActorA" );
+  Test::TestCustomActor actorA = Test::TestCustomActor::NewVariant7( "ActorA" );
   stage.Add( actorA );
 
-  TestCustomActor actorB = TestCustomActor::New();
+  Test::TestCustomActor actorB = Test::TestCustomActor::New();
   actorB.SetName( "ActorB" );
   actorA.Add( actorB );
 
@@ -1451,11 +765,11 @@ int UtcDaliCustomActorRemoveDuringOnChildRemove(void)
    * This should be a NOOP since the reparenting has not occured yet
    */
 
-  TestCustomActor actorB = TestCustomActor::New();
+  Test::TestCustomActor actorB = Test::TestCustomActor::New();
   actorB.SetName( "ActorB" );
   stage.Add( actorB );
 
-  TestCustomActor actorA = TestCustomActor::NewVariant8( actorB );
+  Test::TestCustomActor actorA = Test::TestCustomActor::NewVariant8( actorB );
   actorA.SetName( "ActorA" );
   stage.Add( actorA );
 
@@ -1490,17 +804,21 @@ int UtcDaliCustomActorRemoveDuringOnChildRemove(void)
   DALI_TEST_EQUALS( "OnChildRemove",        actorA.GetMethodsCalled()[ 2 ], TEST_LOCATION ); // The actorB added to actorA
   // mContainer will then receive OnChildAdd
 
-  DALI_TEST_EQUALS( 2, (int)(actorB.GetMethodsCalled().size()), TEST_LOCATION );
+  DALI_TEST_EQUALS( 3, (int)(actorB.GetMethodsCalled().size()), TEST_LOCATION );
   DALI_TEST_EQUALS( "OnStageConnection",    actorB.GetMethodsCalled()[ 0 ], TEST_LOCATION );
-  DALI_TEST_EQUALS( "OnChildAdd",           actorB.GetMethodsCalled()[ 1 ], TEST_LOCATION );
+  // The derived class are always notified, no matter the child is successfully removed or not
+  DALI_TEST_EQUALS( "OnChildRemove",        actorB.GetMethodsCalled()[ 1 ], TEST_LOCATION );
+  DALI_TEST_EQUALS( "OnChildAdd",           actorB.GetMethodsCalled()[ 2 ], TEST_LOCATION );
 
-  DALI_TEST_EQUALS( 5, (int)(MasterCallStack.size()), TEST_LOCATION );
+  DALI_TEST_EQUALS( 6, (int)(MasterCallStack.size()), TEST_LOCATION );
 
   DALI_TEST_EQUALS( "ActorB: OnStageConnection",    MasterCallStack[ 0 ], TEST_LOCATION );
   DALI_TEST_EQUALS( "ActorA: OnStageConnection",    MasterCallStack[ 1 ], TEST_LOCATION );
   DALI_TEST_EQUALS( "ActorA: OnChildAdd",           MasterCallStack[ 2 ], TEST_LOCATION );
   DALI_TEST_EQUALS( "ActorA: OnChildRemove",        MasterCallStack[ 3 ], TEST_LOCATION );
-  DALI_TEST_EQUALS( "ActorB: OnChildAdd",           MasterCallStack[ 4 ], TEST_LOCATION );
+  // The derived class are always notified, no matter the child is successfully removed or not
+  DALI_TEST_EQUALS( "ActorB: OnChildRemove",        MasterCallStack[ 4 ], TEST_LOCATION );
+  DALI_TEST_EQUALS( "ActorB: OnChildAdd",           MasterCallStack[ 5 ], TEST_LOCATION );
 
   // Excercise the message passing to Update thread
 
@@ -1515,10 +833,10 @@ int UtcDaliCustomActorOnPropertySet(void)
   TestApplication application;
   tet_infoline("Testing Dali::CustomActor::OnPropertySet()");
 
-  TestCustomActor custom = TestCustomActor::New();
+  Test::TestCustomActor custom = Test::TestCustomActor::New();
   DALI_TEST_EQUALS( 0, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
 
-  custom.SetDaliProperty("yes") ;
+  custom.SetDaliProperty("yes");
 
   DALI_TEST_EQUALS( 1, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
   DALI_TEST_EQUALS( "OnPropertySet", custom.GetMethodsCalled()[ 0 ], TEST_LOCATION );
@@ -1530,7 +848,7 @@ int UtcDaliCustomActorOnSizeSet(void)
   TestApplication application;
   tet_infoline("Testing Dali::CustomActor::OnSizeSet()");
 
-  TestCustomActor custom = TestCustomActor::New();
+  Test::TestCustomActor custom = Test::TestCustomActor::New();
   DALI_TEST_EQUALS( 0, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
 
   custom.SetSize( Vector2( 9.0f, 10.0f ) );
@@ -1553,23 +871,54 @@ int UtcDaliCustomActorOnSizeAnimation(void)
   TestApplication application;
   tet_infoline("Testing Dali::CustomActor::OnSizeAnimation()");
 
-  TestCustomActor custom = TestCustomActor::New();
+  Test::TestCustomActor custom = Test::TestCustomActor::New();
   DALI_TEST_EQUALS( 0, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
 
   Animation anim = Animation::New( 1.0f );
-  anim.Resize( custom, Vector3( 8.0f, 9.0f, 10.0f ) );
+  anim.AnimateTo( Property( custom, Actor::Property::SIZE ), Vector3( 8.0f, 9.0f, 10.0f ) );
+  anim.Play();
+
+  application.SendNotification();
+  application.Render( static_cast<unsigned int>( 1000.0f ) );
+
   DALI_TEST_EQUALS( 1, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
   DALI_TEST_EQUALS( "OnSizeAnimation", custom.GetMethodsCalled()[ 0 ], TEST_LOCATION );
   DALI_TEST_EQUALS( 8.0f, custom.GetTargetSize().width, TEST_LOCATION );
   DALI_TEST_EQUALS( 9.0f, custom.GetTargetSize().height, TEST_LOCATION );
   DALI_TEST_EQUALS( 10.0f, custom.GetTargetSize().depth, TEST_LOCATION );
+  END_TEST;
+}
+
+int UtcDaliCustomActorSizeComponentAnimation(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Size component animation");
+
+  Test::TestCustomActor custom = Test::TestCustomActor::New();
+  float intialWidth( 10.0f );
+
+  DALI_TEST_EQUALS( 0, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
+  custom.SetSize( intialWidth, 10.0f); // First method
+
+  Animation anim = Animation::New( 1.0f );
+
+  DALI_TEST_EQUALS( 1, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
+
+  anim.AnimateTo( Property( custom, Actor::Property::SIZE_WIDTH ), 20.0f );
+
+  DALI_TEST_EQUALS( 1, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
+
+  anim.Play();   // Triggers second method ( OnSizeAnimation )
+
+  application.SendNotification();
+  application.Render( static_cast<unsigned int>( 1000.0f ) );
 
-  anim.Resize( custom, 1.0f, 2.0f );
   DALI_TEST_EQUALS( 2, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
+
   DALI_TEST_EQUALS( "OnSizeAnimation", custom.GetMethodsCalled()[ 1 ], TEST_LOCATION );
-  DALI_TEST_EQUALS( 1.0f, custom.GetTargetSize().width, TEST_LOCATION );
-  DALI_TEST_EQUALS( 2.0f, custom.GetTargetSize().height, TEST_LOCATION );
+
   END_TEST;
+
 }
 
 int UtcDaliCustomActorOnTouchEvent(void)
@@ -1577,7 +926,7 @@ int UtcDaliCustomActorOnTouchEvent(void)
   TestApplication application;
   tet_infoline("Testing Dali::CustomActor::OnTouchEvent()");
 
-  TestCustomActor custom = TestCustomActor::New();
+  Test::TestCustomActor custom = Test::TestCustomActor::New();
   DALI_TEST_EQUALS( 0, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
 
   // set size for custom actor
@@ -1593,7 +942,9 @@ int UtcDaliCustomActorOnTouchEvent(void)
   application.Render();
 
   // simulate a touch event
-  Dali::TouchPoint point( 0, TouchPoint::Down, 1, 1 );
+  Dali::Integration::Point point;
+  point.SetState( PointState::DOWN );
+  point.SetScreenPosition( Vector2( 1, 1 ) );
   Dali::Integration::TouchEvent event;
   event.AddPoint( point );
   application.ProcessEvent( event );
@@ -1608,7 +959,7 @@ int UtcDaliCustomActorOnHoverEvent(void)
   TestApplication application;
   tet_infoline("Testing Dali::CustomActor::OnHoverEvent()");
 
-  TestCustomActor custom = TestCustomActor::New();
+  Test::TestCustomActor custom = Test::TestCustomActor::New();
   DALI_TEST_EQUALS( 0, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
 
   // set size for custom actor
@@ -1624,7 +975,9 @@ int UtcDaliCustomActorOnHoverEvent(void)
   application.Render();
 
   // simulate a hover event
-  Dali::TouchPoint point( 0, TouchPoint::Motion, 1, 1 );
+  Dali::Integration::Point point;
+  point.SetState( PointState::MOTION );
+  point.SetScreenPosition( Vector2( 1, 1 ) );
   Dali::Integration::HoverEvent event;
   event.AddPoint( point );
   application.ProcessEvent( event );
@@ -1634,12 +987,12 @@ int UtcDaliCustomActorOnHoverEvent(void)
   END_TEST;
 }
 
-int UtcDaliCustomActorOnMouseWheelEvent(void)
+int UtcDaliCustomActorOnWheelEvent(void)
 {
   TestApplication application;
-  tet_infoline("Testing Dali::CustomActor::OnMouseWheelEvent()");
+  tet_infoline("Testing Dali::CustomActor::OnWheelEvent()");
 
-  TestCustomActor custom = TestCustomActor::New();
+  Test::TestCustomActor custom = Test::TestCustomActor::New();
   DALI_TEST_EQUALS( 0, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
 
   // set size for custom actor
@@ -1654,26 +1007,26 @@ int UtcDaliCustomActorOnMouseWheelEvent(void)
   application.SendNotification();
   application.Render();
 
-  // simulate a mouse wheel event
+  // simulate a wheel event
   Vector2 screenCoordinates( 10.0f, 10.0f );
-  Integration::MouseWheelEvent event(0, 0u, screenCoordinates, 1, 1000u);
+  Integration::WheelEvent event( Integration::WheelEvent::MOUSE_WHEEL, 0, 0u, screenCoordinates, 1, 1000u );
   application.ProcessEvent( event );
 
   DALI_TEST_EQUALS( 1, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
-  DALI_TEST_EQUALS( "OnMouseWheelEvent", custom.GetMethodsCalled()[ 0 ], TEST_LOCATION );
+  DALI_TEST_EQUALS( "OnWheelEvent", custom.GetMethodsCalled()[ 0 ], TEST_LOCATION );
   END_TEST;
 }
 
 int UtcDaliCustomActorImplOnPropertySet(void)
 {
   TestApplication application;
-  CustomActorImpl* impl = new Impl::SimpleTestCustomActor();
+  CustomActorImpl* impl = new Test::Impl::SimpleTestCustomActor();
+  CustomActor customActor( *impl ); // Will automatically unref at the end of this function
 
   impl->OnPropertySet( 0, 0 );
 
   DALI_TEST_CHECK( true );
 
-  delete impl;
   END_TEST;
 }
 
@@ -1681,11 +1034,11 @@ int UtcDaliCustomActorGetImplementation(void)
 {
   TestApplication application;
 
-  TestCustomActor custom = TestCustomActor::New();
+  Test::TestCustomActor custom = Test::TestCustomActor::New();
   CustomActorImpl& impl = custom.GetImplementation();
   impl.GetOwner();  // Test
 
-  const TestCustomActor constCustom = TestCustomActor::New();
+  const Test::TestCustomActor constCustom = Test::TestCustomActor::New();
   const CustomActorImpl& constImpl = constCustom.GetImplementation();
   constImpl.GetOwner();  // Test
 
@@ -1698,13 +1051,13 @@ int UtcDaliCustomActorDoAction(void)
   TestApplication application;
   tet_infoline("Testing Dali::CustomActor::DoAction()");
 
-  TestCustomActor custom = TestCustomActor::New();
+  Test::TestCustomActor custom = Test::TestCustomActor::New();
 
   BaseHandle customActorObject = custom;
 
   DALI_TEST_CHECK(customActorObject);
 
-  std::vector<Property::Value> attributes;
+  Property::Map attributes;
 
   // Check that an invalid command is not performed
   DALI_TEST_CHECK(customActorObject.DoAction("invalidCommand", attributes) == false);
@@ -1734,3 +1087,237 @@ int UtcDaliCustomActorDoAction(void)
   DALI_TEST_CHECK(custom.IsVisible() == true);
   END_TEST;
 }
+
+int UtcDaliCustomActorCustomActor(void)
+{
+  Dali::CustomActor customA;
+  Dali::CustomActor customB( customA );
+
+  DALI_TEST_CHECK( customA == customB );
+
+  END_TEST;
+}
+
+int UtcDaliCustomActorImplRelayoutRequest(void)
+{
+  TestApplication application;
+
+  DALI_TEST_CHECK( gOnRelayout == false );
+
+  Test::TestCustomActor custom = Test::TestCustomActor::NewNegoSize();
+  Stage::GetCurrent().Add(custom);
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_CHECK( gOnRelayout == true );
+  gOnRelayout = false;
+
+  custom.TestRelayoutRequest();
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_CHECK( gOnRelayout == true );
+
+  END_TEST;
+}
+
+int UtcDaliCustomActorImplGetHeightForWidthBase(void)
+{
+  TestApplication application;
+  Test::TestCustomActor custom = Test::TestCustomActor::NewNegoSize();
+
+  float width = 300.0f;
+
+  application.SendNotification();
+  application.Render();
+
+  float v = custom.TestGetHeightForWidthBase( width );
+
+  DALI_TEST_CHECK( v == width );
+
+  END_TEST;
+}
+
+int UtcDaliCustomActorImplGetWidthForHeightBase(void)
+{
+  TestApplication application;
+  Test::TestCustomActor custom = Test::TestCustomActor::NewNegoSize();
+
+  float height = 300.0f;
+
+  application.SendNotification();
+  application.Render();
+
+  float v = custom.TestGetWidthForHeightBase( height );
+
+  DALI_TEST_CHECK( v == height );
+
+  END_TEST;
+}
+
+int UtcDaliCustomActorImplCalculateChildSizeBase(void)
+{
+  TestApplication application;
+  Test::TestCustomActor custom = Test::TestCustomActor::NewNegoSize();
+
+  Actor child = Actor::New();
+  child.SetResizePolicy(Dali::ResizePolicy::FIXED, Dali::Dimension::ALL_DIMENSIONS);
+  child.SetSize(150, 150);
+
+  application.SendNotification();
+  application.Render();
+
+  float v = custom.TestCalculateChildSizeBase( child, Dali::Dimension::ALL_DIMENSIONS );
+  DALI_TEST_CHECK( v == 0.0f );
+
+  END_TEST;
+}
+
+int UtcDaliCustomActorImplRelayoutDependentOnChildrenBase(void)
+{
+  TestApplication application;
+  Test::TestCustomActor custom = Test::TestCustomActor::NewNegoSize();
+  custom.SetResizePolicy(Dali::ResizePolicy::FIT_TO_CHILDREN, Dali::Dimension::ALL_DIMENSIONS);
+
+  bool v = custom.TestRelayoutDependentOnChildrenBase( Dali::Dimension::ALL_DIMENSIONS );
+  DALI_TEST_CHECK( v == true );
+
+  application.SendNotification();
+  application.Render();
+
+  custom.SetResizePolicy(Dali::ResizePolicy::FIXED, Dali::Dimension::ALL_DIMENSIONS);
+  v = custom.TestRelayoutDependentOnChildrenBase( Dali::Dimension::WIDTH );
+  DALI_TEST_CHECK( v == false );
+
+  // why is this here?
+  application.SendNotification();
+  application.Render();
+
+  END_TEST;
+}
+
+int UtcDaliCustomActorTypeRegistry(void)
+{
+  TestApplication application;
+
+  // Register Type
+  TypeInfo type;
+  type = TypeRegistry::Get().GetTypeInfo( "CustomActor" );
+  DALI_TEST_CHECK( type );
+  BaseHandle handle = type.CreateInstance();
+
+  std::string name;
+  std::string exception;
+
+  try
+  {
+    name = handle.GetTypeName();
+    tet_result(TET_FAIL);
+  }
+  catch( DaliException& e )
+  {
+    exception = e.condition;
+    DALI_TEST_EQUALS( exception, "handle && \"BaseObject handle is empty\"", TEST_LOCATION );
+  }
+
+  END_TEST;
+}
+
+
+int UtcDaliCustomActorGetExtensionP(void)
+{
+  TestApplication application;
+
+  Test::TestCustomActor custom = Test::TestCustomActor::NewVariant5();
+
+  DALI_TEST_CHECK( NULL == custom.GetImplementation().GetExtension() );
+
+  END_TEST;
+}
+
+int UtcDaliCustomActorOnConnectionDepth(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Dali::CustomActor::OnStageConnection() hierarchy depth");
+
+  Stage stage = Stage::GetCurrent();
+
+  /* Build tree of actors:
+   *
+   *                      Depth
+   *
+   *       A (parent)       1
+   *      / \
+   *     B   C              2
+   *    / \   \
+   *   D   E   F            3
+   *
+   * OnStageConnection should return 1 for A, 2 for B and C, and 3 for D, E and F.
+   */
+
+  Test::TestCustomActor actorA = Test::TestCustomActor::New();
+  stage.Add( actorA );
+
+  Test::TestCustomActor actorB = Test::TestCustomActor::New();
+  actorA.Add( actorB );
+
+  Test::TestCustomActor actorC = Test::TestCustomActor::New();
+  actorA.Add( actorC );
+
+  Test::TestCustomActor actorD = Test::TestCustomActor::New();
+  actorB.Add( actorD );
+
+  Test::TestCustomActor actorE = Test::TestCustomActor::New();
+  actorB.Add( actorE );
+
+  Test::TestCustomActor actorF = Test::TestCustomActor::New();
+  actorC.Add( actorF );
+
+  // Excercise the message passing to Update thread
+  application.SendNotification();
+  application.Render();
+  application.Render();
+
+  DALI_TEST_EQUALS( 1u, actorA.GetDepth(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 2u, actorB.GetDepth(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 2u, actorC.GetDepth(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 3u, actorD.GetDepth(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 3u, actorE.GetDepth(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 3u, actorF.GetDepth(), TEST_LOCATION );
+
+  END_TEST;
+}
+
+
+int UtcDaliCustomActorSetGetProperty(void)
+{
+  TestApplication application; // Need the type registry
+
+  Test::TestCustomActor actor = Test::TestCustomActor::New();
+  Stage::GetCurrent().Add( actor );
+
+  actor.SetProperty( Test::TestCustomActor::Property::TEST_PROPERTY1, 0.5f );
+  actor.SetProperty( Test::TestCustomActor::Property::TEST_PROPERTY2, Color::WHITE );
+  actor.SetProperty( Test::DevelTestCustomActor::Property::DEVEL_TEST_PROPERTY3, Color::BLUE );
+  actor.SetProperty( Test::DevelTestCustomActor::Property::DEVEL_TEST_PROPERTY4, 20 );
+  actor.SetProperty( Test::DevelTestCustomActor::Property::DEVEL_TEST_PROPERTY5, 40.0f );
+
+  Property::Value value = actor.GetProperty( Test::TestCustomActor::Property::TEST_PROPERTY1 );
+  DALI_TEST_EQUALS( value.Get<float>(), 0.5f, 0.001f, TEST_LOCATION );
+
+  value = actor.GetProperty( Test::TestCustomActor::Property::TEST_PROPERTY2 );
+  DALI_TEST_EQUALS( value.Get<Vector4>(), Color::WHITE, 0.001f, TEST_LOCATION );
+
+
+  value = actor.GetProperty( Test::DevelTestCustomActor::Property::DEVEL_TEST_PROPERTY3 );
+  DALI_TEST_EQUALS( value.Get<Vector4>(), Color::BLUE, 0.001f, TEST_LOCATION );
+
+  value = actor.GetProperty( Test::DevelTestCustomActor::Property::DEVEL_TEST_PROPERTY4 );
+  DALI_TEST_EQUALS( value.Get<int>(), 20, TEST_LOCATION );
+
+  value = actor.GetProperty( Test::DevelTestCustomActor::Property::DEVEL_TEST_PROPERTY5 );
+  DALI_TEST_EQUALS( value.Get<float>(), 40.0f, 0.001f, TEST_LOCATION );
+
+  END_TEST;
+}