[dali_2.3.19] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-Button.cpp
index a2b1a81..76a10fc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
 #include <stdlib.h>
+#include <iostream>
 
 // Need to override adaptor classes for toolkit test harness, so include
 // test harness headers before dali headers.
 #include <dali-toolkit-test-suite-utils.h>
 #include "dali-toolkit-test-utils/toolkit-timer.h"
 
-#include <dali.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali.h>
 #include <dali/integration-api/events/touch-event-integ.h>
 
 #include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
@@ -32,7 +32,6 @@
 using namespace Dali;
 using namespace Toolkit;
 
-
 void utc_dali_toolkit_button_startup(void)
 {
   test_return_value = TET_UNDEF;
@@ -45,33 +44,33 @@ void utc_dali_toolkit_button_cleanup(void)
 
 namespace
 {
-static bool gIsCalledButtonCallback = false;
+static bool gIsCalledButtonCallback      = false;
 static bool gIsCalledChildButtonCallback = false;
 
-static bool ButtonCallback( Button button )
+static bool ButtonCallback(Button button)
 {
   gIsCalledButtonCallback = true;
   return false;
 }
 
-static bool ChildButtonCallback( Button button )
+static bool ChildButtonCallback(Button button)
 {
   gIsCalledChildButtonCallback = true;
   return false;
 }
 
-static std::string GetButtonText( Button button )
+static std::string GetButtonText(Button button)
 {
-  Property::Value value = button.GetProperty( Toolkit::Button::Property::LABEL );
+  Property::Value value = button.GetProperty(Toolkit::Button::Property::LABEL);
 
-  Property::Map *labelProperty = value.GetMap();
+  Property::MaplabelProperty = value.GetMap();
 
   std::string textLabel;
 
-  if ( labelProperty )
+  if(labelProperty)
   {
-    Property::Value* value = labelProperty->Find( Toolkit::TextVisual::Property::TEXT );
-    value->Get( textLabel );
+    Property::Value* value = labelProperty->Find(Toolkit::TextVisual::Property::TEXT);
+    value->Get(textLabel);
   }
 
   return textLabel;
@@ -80,7 +79,7 @@ static std::string GetButtonText( Button button )
 struct CallbackFunctor
 {
   CallbackFunctor(bool* callbackFlag)
-  : mCallbackFlag( callbackFlag )
+  : mCallbackFlag(callbackFlag)
   {
   }
 
@@ -94,48 +93,48 @@ struct CallbackFunctor
 Dali::Integration::Point GetPointDownInside()
 {
   Dali::Integration::Point point;
-  point.SetState( PointState::DOWN );
-  point.SetScreenPosition( Vector2( 240, 400 ) );
+  point.SetState(PointState::DOWN);
+  point.SetScreenPosition(Vector2(240, 400));
   return point;
 }
 
 Dali::Integration::Point GetPointUpInside()
 {
   Dali::Integration::Point point;
-  point.SetState( PointState::UP );
-  point.SetScreenPosition( Vector2( 240, 400 ) );
+  point.SetState(PointState::UP);
+  point.SetScreenPosition(Vector2(240, 400));
   return point;
 }
 
 Dali::Integration::Point GetPointLeave()
 {
   Dali::Integration::Point point;
-  point.SetState( PointState::LEAVE );
-  point.SetScreenPosition( Vector2( 240, 400 ) );
+  point.SetState(PointState::LEAVE);
+  point.SetScreenPosition(Vector2(240, 400));
   return point;
 }
 
 Dali::Integration::Point GetPointEnter()
 {
   Dali::Integration::Point point;
-  point.SetState( PointState::MOTION );
-  point.SetScreenPosition( Vector2( 240, 400 ) );
+  point.SetState(PointState::MOTION);
+  point.SetScreenPosition(Vector2(240, 400));
   return point;
 }
 
 Dali::Integration::Point GetPointDownOutside()
 {
   Dali::Integration::Point point;
-  point.SetState( PointState::DOWN );
-  point.SetScreenPosition( Vector2( 10, 10 ) );
+  point.SetState(PointState::DOWN);
+  point.SetScreenPosition(Vector2(10, 10));
   return point;
 }
 
 Dali::Integration::Point GetPointUpOutside()
 {
   Dali::Integration::Point point;
-  point.SetState( PointState::UP );
-  point.SetScreenPosition( Vector2( 10, 10 ) );
+  point.SetState(PointState::UP);
+  point.SetScreenPosition(Vector2(10, 10));
   return point;
 }
 
@@ -143,66 +142,105 @@ Dali::Integration::Point GetPointUpOutside()
 
 int UtcDaliButtonConstructorP(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   Button button;
 
-  DALI_TEST_CHECK( !button );
+  DALI_TEST_CHECK(!button);
   END_TEST;
 }
 
 int UtcDaliButtonCopyConstructorP(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   // Initialize an object, ref count == 1
   Button button = PushButton::New();
 
-  Button copy( button );
-  DALI_TEST_CHECK( copy );
+  Button copy(button);
+  DALI_TEST_CHECK(copy);
+  END_TEST;
+}
+
+int UtcDaliButtonMoveConstructor(void)
+{
+  ToolkitTestApplication application;
+
+  Button button = PushButton::New();
+  DALI_TEST_EQUALS(1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+  DALI_TEST_EQUALS(button.GetProperty<bool>(Button::Property::TOGGLABLE), false, TEST_LOCATION);
+  button.SetProperty(Button::Property::TOGGLABLE, true);
+  DALI_TEST_EQUALS(button.GetProperty<bool>(Button::Property::TOGGLABLE), true, TEST_LOCATION);
+
+  Button moved = std::move(button);
+  DALI_TEST_CHECK(moved);
+  DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+  DALI_TEST_EQUALS(moved.GetProperty<bool>(Button::Property::TOGGLABLE), true, TEST_LOCATION);
+  DALI_TEST_CHECK(!button);
+
   END_TEST;
 }
 
 int UtcDaliButtonAssignmentOperatorP(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   Button button = PushButton::New();
 
-  Button copy( button );
-  DALI_TEST_CHECK( copy );
+  Button copy(button);
+  DALI_TEST_CHECK(copy);
+
+  DALI_TEST_CHECK(button == copy);
+  END_TEST;
+}
+
+int UtcDaliButtonMoveAssignment(void)
+{
+  ToolkitTestApplication application;
+
+  Button button = PushButton::New();
+  DALI_TEST_EQUALS(1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+  DALI_TEST_EQUALS(button.GetProperty<bool>(Button::Property::TOGGLABLE), false, TEST_LOCATION);
+  button.SetProperty(Button::Property::TOGGLABLE, true);
+  DALI_TEST_EQUALS(button.GetProperty<bool>(Button::Property::TOGGLABLE), true, TEST_LOCATION);
+
+  Button moved;
+  moved = std::move(button);
+  DALI_TEST_CHECK(moved);
+  DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+  DALI_TEST_EQUALS(moved.GetProperty<bool>(Button::Property::TOGGLABLE), true, TEST_LOCATION);
+  DALI_TEST_CHECK(!button);
 
-  DALI_TEST_CHECK( button == copy );
   END_TEST;
 }
 
 int UtcDaliButtonDownCastP(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   Button button = PushButton::New();
 
   BaseHandle object(button);
 
-  Button button2 = Button::DownCast( object );
+  Button button2 = Button::DownCast(object);
   DALI_TEST_CHECK(button2);
 
-  Button button3 = DownCast< Button >(object);
+  Button button3 = DownCast<Button>(object);
   DALI_TEST_CHECK(button3);
   END_TEST;
 }
 
 int UtcDaliButtonDownCastN(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   BaseHandle unInitializedObject;
 
-  Button button1 = Button::DownCast( unInitializedObject );
-  DALI_TEST_CHECK( !button1 );
+  Button button1 = Button::DownCast(unInitializedObject);
+  DALI_TEST_CHECK(!button1);
 
-  Button button2 = DownCast< Button >( unInitializedObject );
-  DALI_TEST_CHECK( !button2 );
+  Button button2 = DownCast<Button>(unInitializedObject);
+  DALI_TEST_CHECK(!button2);
   END_TEST;
 }
 
@@ -212,22 +250,21 @@ int UtcDaliButtonDisabledPropertyP(void)
 
   Button button = PushButton::New();
 
+  button.SetProperty(button.GetPropertyIndex("disabled"), true);
 
-  button.SetProperty( button.GetPropertyIndex("disabled"), true );
+  DALI_TEST_EQUALS(button.GetProperty<bool>(button.GetPropertyIndex("disabled")), true, TEST_LOCATION);
 
-  DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("disabled")), true, TEST_LOCATION );
+  button.SetProperty(button.GetPropertyIndex("disabled"), false);
 
-  button.SetProperty( button.GetPropertyIndex("disabled"), false );
+  DALI_TEST_EQUALS(button.GetProperty<bool>(button.GetPropertyIndex("disabled")), false, TEST_LOCATION);
 
-  DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("disabled")), false, TEST_LOCATION );
+  button.SetProperty(button.GetPropertyIndex("disabled"), true);
 
-  button.SetProperty( button.GetPropertyIndex("disabled"), true );
+  DALI_TEST_EQUALS(button.GetProperty<bool>(button.GetPropertyIndex("disabled")), true, TEST_LOCATION);
 
-  DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("disabled")), true, TEST_LOCATION );
+  button.SetProperty(button.GetPropertyIndex("disabled"), false);
 
-  button.SetProperty( button.GetPropertyIndex("disabled"), false );
-
-  DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("disabled")), false, TEST_LOCATION );
+  DALI_TEST_EQUALS(button.GetProperty<bool>(button.GetPropertyIndex("disabled")), false, TEST_LOCATION);
 
   END_TEST;
 }
@@ -242,17 +279,17 @@ int UtcDaliButtonSetDisabledWithDifferentStates01P(void)
 
   bool SELECTED = true;
 
-  button.SetProperty( Button::Property::TOGGLABLE, true);
-  button.SetProperty( Button::Property::SELECTED, SELECTED );
+  button.SetProperty(Button::Property::TOGGLABLE, true);
+  button.SetProperty(Button::Property::SELECTED, SELECTED);
 
-  button.SetProperty( Button::Property::DISABLED, true);
+  button.SetProperty(Button::Property::DISABLED, true);
 
   tet_infoline("Set button to SELECTED = false whilst disabled, should not change to false\n");
-  button.SetProperty( Button::Property::SELECTED, !SELECTED );
+  button.SetProperty(Button::Property::SELECTED, !SELECTED);
 
-  bool isSelected = button.GetProperty<bool>( Button::Property::SELECTED ) ;
+  bool isSelected = button.GetProperty<bool>(Button::Property::SELECTED);
 
-  DALI_TEST_EQUALS( isSelected, SELECTED , TEST_LOCATION );
+  DALI_TEST_EQUALS(isSelected, SELECTED, TEST_LOCATION);
 
   END_TEST;
 }
@@ -267,19 +304,19 @@ int UtcDaliButtonSetDisabledWithDifferentStates02P(void)
 
   bool SELECTED = true;
 
-  button.SetProperty( Button::Property::TOGGLABLE, true );
-  button.SetProperty( Button::Property::SELECTED, SELECTED );
-  button.SetProperty( Button::Property::DISABLED, true );
+  button.SetProperty(Button::Property::TOGGLABLE, true);
+  button.SetProperty(Button::Property::SELECTED, SELECTED);
+  button.SetProperty(Button::Property::DISABLED, true);
 
-  bool isSelected =  button.GetProperty<bool>( Button::Property::SELECTED );
-  DALI_TEST_EQUALS( isSelected, SELECTED , TEST_LOCATION );
+  bool isSelected = button.GetProperty<bool>(Button::Property::SELECTED);
+  DALI_TEST_EQUALS(isSelected, SELECTED, TEST_LOCATION);
   tet_infoline("Set button to DISABLED = false whilst disabled and then set to unselected\n");
 
-  button.SetProperty( Button::Property::DISABLED, false);
-  button.SetProperty( Button::Property::SELECTED, !SELECTED );
+  button.SetProperty(Button::Property::DISABLED, false);
+  button.SetProperty(Button::Property::SELECTED, !SELECTED);
 
-  isSelected = button.GetProperty<bool>( Button::Property::SELECTED );
-  DALI_TEST_EQUALS( isSelected, !SELECTED , TEST_LOCATION );
+  isSelected = button.GetProperty<bool>(Button::Property::SELECTED);
+  DALI_TEST_EQUALS(isSelected, !SELECTED, TEST_LOCATION);
 
   END_TEST;
 }
@@ -290,8 +327,8 @@ int UtcDaliButtonPropertyGetLabelAlignment(void)
   tet_infoline(" UtcDaliPushButtonPropertyGetLabelAlignment\n");
 
   Button button = PushButton::New();
-  button.SetProperty( Toolkit::DevelButton::Property::LABEL_RELATIVE_ALIGNMENT, "END"  );
-  DALI_TEST_EQUALS( button.GetProperty<std::string>( Toolkit::DevelButton::Property::LABEL_RELATIVE_ALIGNMENT ), "END", TEST_LOCATION );
+  button.SetProperty(Toolkit::DevelButton::Property::LABEL_RELATIVE_ALIGNMENT, "END");
+  DALI_TEST_EQUALS(button.GetProperty<std::string>(Toolkit::DevelButton::Property::LABEL_RELATIVE_ALIGNMENT), "END", TEST_LOCATION);
 
   END_TEST;
 }
@@ -302,13 +339,13 @@ int UtcDaliButtonIsDisabledP(void)
 
   Button button = PushButton::New();
 
-  button.SetProperty( Button::Property::DISABLED, true);
+  button.SetProperty(Button::Property::DISABLED, true);
 
-  DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::DISABLED ), true, TEST_LOCATION );
+  DALI_TEST_EQUALS(button.GetProperty<bool>(Button::Property::DISABLED), true, TEST_LOCATION);
 
-  button.SetProperty( Button::Property::DISABLED, false);
+  button.SetProperty(Button::Property::DISABLED, false);
 
-  DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::DISABLED ), false, TEST_LOCATION );
+  DALI_TEST_EQUALS(button.GetProperty<bool>(Button::Property::DISABLED), false, TEST_LOCATION);
   END_TEST;
 }
 
@@ -318,17 +355,17 @@ int UtcDaliButtonAutoRepeatingPropertyP(void)
 
   Button button = PushButton::New();
 
-  button.SetProperty( button.GetPropertyIndex("autoRepeating"), true );
+  button.SetProperty(button.GetPropertyIndex("autoRepeating"), true);
 
-  DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("autoRepeating")), true, TEST_LOCATION );
+  DALI_TEST_EQUALS(button.GetProperty<bool>(button.GetPropertyIndex("autoRepeating")), true, TEST_LOCATION);
 
-  button.SetProperty( button.GetPropertyIndex("autoRepeating"), false );
+  button.SetProperty(button.GetPropertyIndex("autoRepeating"), false);
 
-  DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("autoRepeating")), false, TEST_LOCATION );
+  DALI_TEST_EQUALS(button.GetProperty<bool>(button.GetPropertyIndex("autoRepeating")), false, TEST_LOCATION);
 
-  button.SetProperty( button.GetPropertyIndex("autoRepeating"), true );
+  button.SetProperty(button.GetPropertyIndex("autoRepeating"), true);
 
-  DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("autoRepeating")), true, TEST_LOCATION );
+  DALI_TEST_EQUALS(button.GetProperty<bool>(button.GetPropertyIndex("autoRepeating")), true, TEST_LOCATION);
 
   END_TEST;
 }
@@ -339,13 +376,13 @@ int UtcDaliButtonIsAutoRepeatingP(void)
 
   Button button = PushButton::New();
 
-  button.SetProperty( Button::Property::AUTO_REPEATING, true);
+  button.SetProperty(Button::Property::AUTO_REPEATING, true);
 
-  DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::AUTO_REPEATING ), true, TEST_LOCATION );
+  DALI_TEST_EQUALS(button.GetProperty<bool>(Button::Property::AUTO_REPEATING), true, TEST_LOCATION);
 
-  button.SetProperty( Button::Property::AUTO_REPEATING, false);
+  button.SetProperty(Button::Property::AUTO_REPEATING, false);
 
-  DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::AUTO_REPEATING ), false, TEST_LOCATION );
+  DALI_TEST_EQUALS(button.GetProperty<bool>(Button::Property::AUTO_REPEATING), false, TEST_LOCATION);
 
   END_TEST;
 }
@@ -358,54 +395,54 @@ int UtcDaliButtonAutoRepeatingP(void)
   const float AUTO_REPEATING_DELAY = 0.15f;
 
   Button button = PushButton::New();
-  button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
-  button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
-  button.SetPosition( 240, 400 );
-  button.SetSize( 100, 100 );
-  Stage::GetCurrent().Add( button );
+  button.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+  button.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+  button.SetProperty(Actor::Property::POSITION, Vector2(240, 400));
+  button.SetProperty(Actor::Property::SIZE, Vector2(100, 100));
+  application.GetScene().Add(button);
 
   application.SendNotification();
   application.Render();
 
-  button.SetProperty( Toolkit::Button::Property::AUTO_REPEATING, true  );
-  button.SetProperty( Toolkit::Button::Property::INITIAL_AUTO_REPEATING_DELAY, AUTO_REPEATING_DELAY );
+  button.SetProperty(Toolkit::Button::Property::AUTO_REPEATING, true);
+  button.SetProperty(Toolkit::Button::Property::INITIAL_AUTO_REPEATING_DELAY, AUTO_REPEATING_DELAY);
   // connect to its touch signal
   ConnectionTracker* testTracker = new ConnectionTracker();
-  button.PressedSignal().Connect( &ButtonCallback );
-  button.ClickedSignal().Connect( &ButtonCallback );
+  button.PressedSignal().Connect(&ButtonCallback);
+  button.ClickedSignal().Connect(&ButtonCallback);
   bool clickedSignal = false;
   bool pressedSignal = false;
-  button.ConnectSignal( testTracker, "pressed", CallbackFunctor(&pressedSignal) );
-  button.ConnectSignal( testTracker, "clicked", CallbackFunctor(&clickedSignal) );
+  button.ConnectSignal(testTracker, "pressed", CallbackFunctor(&pressedSignal));
+  button.ConnectSignal(testTracker, "clicked", CallbackFunctor(&clickedSignal));
 
   Dali::Integration::TouchEvent event;
 
   // Touch point down and up inside the button.
 
   gIsCalledButtonCallback = false;
-  event = Dali::Integration::TouchEvent();
-  event.AddPoint( GetPointDownInside() );
-  application.ProcessEvent( event );
+  event                   = Dali::Integration::TouchEvent();
+  event.AddPoint(GetPointDownInside());
+  application.ProcessEvent(event);
 
-  DALI_TEST_EQUALS( gIsCalledButtonCallback, true, TEST_LOCATION );
-  DALI_TEST_EQUALS( pressedSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS(gIsCalledButtonCallback, true, TEST_LOCATION);
+  DALI_TEST_EQUALS(pressedSignal, true, TEST_LOCATION);
   tet_infoline("Consume first clicked signal then wait\n");
 
   gIsCalledButtonCallback = false;
-  Dali::Timer timer = Timer::New( AUTO_REPEATING_DELAY );
+  Dali::Timer timer       = Timer::New(AUTO_REPEATING_DELAY);
   timer.MockEmitSignal();
-  application.Wait( AUTO_REPEATING_DELAY*2 );
-  DALI_TEST_EQUALS( clickedSignal, true, TEST_LOCATION );
+  application.Wait(AUTO_REPEATING_DELAY * 2);
+  DALI_TEST_EQUALS(clickedSignal, true, TEST_LOCATION);
   tet_infoline("Check gIsCalledButtonCallback was called again after last consumption of it.\n");
 
-  DALI_TEST_EQUALS( gIsCalledButtonCallback, true, TEST_LOCATION );
+  DALI_TEST_EQUALS(gIsCalledButtonCallback, true, TEST_LOCATION);
 
   gIsCalledButtonCallback = false;
-  event = Dali::Integration::TouchEvent();
-  event.AddPoint( GetPointUpInside() );
-  application.ProcessEvent( event );
+  event                   = Dali::Integration::TouchEvent();
+  event.AddPoint(GetPointUpInside());
+  application.ProcessEvent(event);
 
-  DALI_TEST_EQUALS( gIsCalledButtonCallback, true, TEST_LOCATION );
+  DALI_TEST_EQUALS(gIsCalledButtonCallback, true, TEST_LOCATION);
 
   END_TEST;
 }
@@ -416,13 +453,13 @@ int UtcDaliButtonInitialAutoRepeatingDelayPropertyP(void)
 
   Button button = PushButton::New();
 
-  button.SetProperty( button.GetPropertyIndex("initialAutoRepeatingDelay"), 0.5f );
+  button.SetProperty(button.GetPropertyIndex("initialAutoRepeatingDelay"), 0.5f);
 
-  DALI_TEST_EQUALS( button.GetProperty<float>( button.GetPropertyIndex("initialAutoRepeatingDelay")), 0.5f, TEST_LOCATION );
+  DALI_TEST_EQUALS(button.GetProperty<float>(button.GetPropertyIndex("initialAutoRepeatingDelay")), 0.5f, TEST_LOCATION);
 
-  button.SetProperty( button.GetPropertyIndex("initialAutoRepeatingDelay"), 0.2f );
+  button.SetProperty(button.GetPropertyIndex("initialAutoRepeatingDelay"), 0.2f);
 
-  DALI_TEST_EQUALS( button.GetProperty<float>( button.GetPropertyIndex("initialAutoRepeatingDelay")), 0.2f, TEST_LOCATION );
+  DALI_TEST_EQUALS(button.GetProperty<float>(button.GetPropertyIndex("initialAutoRepeatingDelay")), 0.2f, TEST_LOCATION);
 
   END_TEST;
 }
@@ -433,13 +470,13 @@ int UtcDaliButtonNextAutoRepeatingDelayPropertyP(void)
 
   Button button = PushButton::New();
 
-  button.SetProperty( button.GetPropertyIndex("nextAutoRepeatingDelay"), 0.5f );
+  button.SetProperty(button.GetPropertyIndex("nextAutoRepeatingDelay"), 0.5f);
 
-  DALI_TEST_EQUALS( button.GetProperty<float>( button.GetPropertyIndex("nextAutoRepeatingDelay")), 0.5f, TEST_LOCATION );
+  DALI_TEST_EQUALS(button.GetProperty<float>(button.GetPropertyIndex("nextAutoRepeatingDelay")), 0.5f, TEST_LOCATION);
 
-  button.SetProperty( button.GetPropertyIndex("nextAutoRepeatingDelay"), 0.2f );
+  button.SetProperty(button.GetPropertyIndex("nextAutoRepeatingDelay"), 0.2f);
 
-  DALI_TEST_EQUALS( button.GetProperty<float>( button.GetPropertyIndex("nextAutoRepeatingDelay")), 0.2f, TEST_LOCATION );
+  DALI_TEST_EQUALS(button.GetProperty<float>(button.GetPropertyIndex("nextAutoRepeatingDelay")), 0.2f, TEST_LOCATION);
   END_TEST;
 }
 
@@ -449,13 +486,13 @@ int UtcDaliButtonTogglableButtonPropertyP(void)
 
   Button button = PushButton::New();
 
-  button.SetProperty( button.GetPropertyIndex("togglable"), true );
+  button.SetProperty(button.GetPropertyIndex("togglable"), true);
 
-  DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("togglable")), true, TEST_LOCATION );
+  DALI_TEST_EQUALS(button.GetProperty<bool>(button.GetPropertyIndex("togglable")), true, TEST_LOCATION);
 
-  button.SetProperty( button.GetPropertyIndex("togglable"), false );
+  button.SetProperty(button.GetPropertyIndex("togglable"), false);
 
-  DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("togglable")), false, TEST_LOCATION );
+  DALI_TEST_EQUALS(button.GetProperty<bool>(button.GetPropertyIndex("togglable")), false, TEST_LOCATION);
   END_TEST;
 }
 
@@ -464,15 +501,15 @@ int UtcDaliButtonSelectedPropertyP(void)
   ToolkitTestApplication application;
 
   Button button = PushButton::New();
-  button.SetProperty( button.GetPropertyIndex("togglable"), true );
+  button.SetProperty(button.GetPropertyIndex("togglable"), true);
 
-  button.SetProperty( button.GetPropertyIndex("selected"), true );
+  button.SetProperty(button.GetPropertyIndex("selected"), true);
 
-  DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("selected")), true, TEST_LOCATION );
+  DALI_TEST_EQUALS(button.GetProperty<bool>(button.GetPropertyIndex("selected")), true, TEST_LOCATION);
 
-  button.SetProperty( button.GetPropertyIndex("selected"), false );
+  button.SetProperty(button.GetPropertyIndex("selected"), false);
 
-  DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("selected")), false, TEST_LOCATION );
+  DALI_TEST_EQUALS(button.GetProperty<bool>(button.GetPropertyIndex("selected")), false, TEST_LOCATION);
   END_TEST;
 }
 
@@ -481,13 +518,10 @@ int UtcDaliButtonSetLabelStringWithPropertyMapP(void)
   ToolkitTestApplication application;
 
   Button button = PushButton::New();
-  button.SetProperty( Toolkit::Button::Property::LABEL,
-                      Property::Map().Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT )
-                                     .Add( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f )
-                                     .Add( Toolkit::TextVisual::Property::TEXT, "Button Label")
-                     );
+  button.SetProperty(Toolkit::Button::Property::LABEL,
+                     Property::Map().Add(Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT).Add(Toolkit::TextVisual::Property::POINT_SIZE, 15.0f).Add(Toolkit::TextVisual::Property::TEXT, "Button Label"));
 
-  DALI_TEST_EQUALS( GetButtonText( button ), "Button Label", TEST_LOCATION );
+  DALI_TEST_EQUALS(GetButtonText(button), "Button Label", TEST_LOCATION);
   END_TEST;
 }
 
@@ -501,34 +535,34 @@ int UtcDaliButtonSetLabelStringWithPropertyMapStringsP(void)
 
   Property::Map textVisualMapInitial;
   textVisualMapInitial["visualType"] = "TEXT";
-  textVisualMapInitial["pointSize"]  15.0f;
-  textVisualMapInitial["text"] = "button label initial";
+  textVisualMapInitial["pointSize"]  = 15.0f;
+  textVisualMapInitial["text"]       = "button label initial";
 
-  button.SetProperty( Button::Property::LABEL, textVisualMapInitial );
+  button.SetProperty(Button::Property::LABEL, textVisualMapInitial);
 
-  DALI_TEST_EQUALS( GetButtonText( button ), "button label initial", TEST_LOCATION );
+  DALI_TEST_EQUALS(GetButtonText(button), "button label initial", TEST_LOCATION);
 
   tet_infoline(" UtcDaliButtonSetLabelStringWithPropertyMapStringsP Intermediate part of test");
 
   Property::Map propertyMap;
-  propertyMap.Insert( Toolkit::Visual::Property::TYPE,  Toolkit::Visual::TEXT );
-  propertyMap.Insert( Toolkit::TextVisual::Property::TEXT,  "error if this is the final text" );
-  propertyMap.Insert( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f );
+  propertyMap.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT);
+  propertyMap.Insert(Toolkit::TextVisual::Property::TEXT, "error if this is the final text");
+  propertyMap.Insert(Toolkit::TextVisual::Property::POINT_SIZE, 15.0f);
 
-  button.SetProperty( Button::Property::LABEL, propertyMap );
+  button.SetProperty(Button::Property::LABEL, propertyMap);
 
-  DALI_TEST_EQUALS( GetButtonText( button ), "error if this is the final text", TEST_LOCATION );
+  DALI_TEST_EQUALS(GetButtonText(button), "error if this is the final text", TEST_LOCATION);
 
   tet_infoline(" UtcDaliButtonSetLabelStringWithPropertyMapStringsP Final part of test");
 
   Property::Map textVisualMap;
   textVisualMap["visualType"] = "TEXT";
-  textVisualMap["pointSize"]  15.0f;
-  textVisualMap["text"] = "Button Label";
+  textVisualMap["pointSize"]  = 15.0f;
+  textVisualMap["text"]       = "Button Label";
 
-  button.SetProperty( Toolkit::Button::Property::LABEL, textVisualMap );
+  button.SetProperty(Toolkit::Button::Property::LABEL, textVisualMap);
 
-  DALI_TEST_EQUALS( GetButtonText( button ), "Button Label", TEST_LOCATION );
+  DALI_TEST_EQUALS(GetButtonText(button), "Button Label", TEST_LOCATION);
   END_TEST;
 }
 
@@ -539,14 +573,12 @@ int UtcDaliButtonSetLabelWithStringP(void)
   Button button = PushButton::New();
 
   // Set default point size for text visual as style sheet not available.
-  button.SetProperty( Toolkit::Button::Property::LABEL,
-                      Property::Map().Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT )
-                                     .Add( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f )
-                                     );
+  button.SetProperty(Toolkit::Button::Property::LABEL,
+                     Property::Map().Add(Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT).Add(Toolkit::TextVisual::Property::POINT_SIZE, 15.0f));
 
-  button.SetProperty( Toolkit::Button::Property::LABEL, "Button Label" );
+  button.SetProperty(Toolkit::Button::Property::LABEL, "Button Label");
 
-  DALI_TEST_EQUALS( GetButtonText( button ), "Button Label", TEST_LOCATION );
+  DALI_TEST_EQUALS(GetButtonText(button), "Button Label", TEST_LOCATION);
   END_TEST;
 }
 
@@ -556,28 +588,24 @@ int UtcDaliButtonSetLabelPropertyP(void)
 
   tet_infoline(" UtcDaliButtonSetLabelPropertyP Set text label and then set again with new text");
 
-
   const std::string TEST_LABEL1 = "test label one";
   const std::string TEST_LABEL2 = "test label two";
 
   Button button = PushButton::New();
 
-  button.SetProperty( Toolkit::Button::Property::LABEL,
-                        Property::Map().Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT )
-                                       .Add( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f )
-                                       .Add( Toolkit::TextVisual::Property::TEXT, TEST_LABEL1 )
-                     );
+  button.SetProperty(Toolkit::Button::Property::LABEL,
+                     Property::Map().Add(Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT).Add(Toolkit::TextVisual::Property::POINT_SIZE, 15.0f).Add(Toolkit::TextVisual::Property::TEXT, TEST_LABEL1));
 
-  DALI_TEST_EQUALS( GetButtonText( button ), TEST_LABEL1,  TEST_LOCATION );
+  DALI_TEST_EQUALS(GetButtonText(button), TEST_LABEL1, TEST_LOCATION);
 
   Property::Map propertyMap;
-  propertyMap.Insert( Toolkit::Visual::Property::TYPE,  Toolkit::Visual::TEXT );
-  propertyMap.Insert( Toolkit::TextVisual::Property::TEXT,  TEST_LABEL2 );
-  propertyMap.Insert( Toolkit::TextVisual::Property::TEXT_COLOR, Color::BLUE );
-  propertyMap.Insert( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f );
-  button.SetProperty( Button::Property::LABEL, propertyMap );
+  propertyMap.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT);
+  propertyMap.Insert(Toolkit::TextVisual::Property::TEXT, TEST_LABEL2);
+  propertyMap.Insert(Toolkit::TextVisual::Property::TEXT_COLOR, Color::BLUE);
+  propertyMap.Insert(Toolkit::TextVisual::Property::POINT_SIZE, 15.0f);
+  button.SetProperty(Button::Property::LABEL, propertyMap);
 
-  DALI_TEST_EQUALS( GetButtonText( button ), TEST_LABEL2,  TEST_LOCATION );
+  DALI_TEST_EQUALS(GetButtonText(button), TEST_LABEL2, TEST_LOCATION);
 
   END_TEST;
 }
@@ -588,104 +616,104 @@ int UtcDaliButtonPressedSignalP(void)
   tet_infoline(" UtcDaliButtonPressedSignalP");
 
   Button button = PushButton::New();
-  button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
-  button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
-  button.SetPosition( 240, 400 );
-  button.SetSize( 100, 100 );
+  button.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+  button.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+  button.SetProperty(Actor::Property::POSITION, Vector2(240, 400));
+  button.SetProperty(Actor::Property::SIZE, Vector2(100, 100));
 
-  Stage::GetCurrent().Add( button );
+  application.GetScene().Add(button);
 
   application.SendNotification();
   application.Render();
 
   // connect to its touch signal
   ConnectionTracker* testTracker = new ConnectionTracker();
-  button.PressedSignal().Connect( &ButtonCallback );
-  button.ReleasedSignal().Connect( &ButtonCallback );
-  bool pressedSignal = false;
+  button.PressedSignal().Connect(&ButtonCallback);
+  button.ReleasedSignal().Connect(&ButtonCallback);
+  bool pressedSignal  = false;
   bool releasedSignal = false;
-  button.ConnectSignal( testTracker, "pressed",   CallbackFunctor(&pressedSignal) );
-  button.ConnectSignal( testTracker, "released",  CallbackFunctor(&releasedSignal) );
+  button.ConnectSignal(testTracker, "pressed", CallbackFunctor(&pressedSignal));
+  button.ConnectSignal(testTracker, "released", CallbackFunctor(&releasedSignal));
 
   Dali::Integration::TouchEvent event;
 
   // Test1. Touch point down and up inside the button.
 
   gIsCalledButtonCallback = false;
-  event = Dali::Integration::TouchEvent();
-  event.AddPoint( GetPointDownInside() );
-  application.ProcessEvent( event );
+  event                   = Dali::Integration::TouchEvent();
+  event.AddPoint(GetPointDownInside());
+  application.ProcessEvent(event);
 
-  DALI_TEST_CHECK( gIsCalledButtonCallback );
-  DALI_TEST_CHECK( pressedSignal );
+  DALI_TEST_CHECK(gIsCalledButtonCallback);
+  DALI_TEST_CHECK(pressedSignal);
 
   gIsCalledButtonCallback = false;
-  event = Dali::Integration::TouchEvent();
-  event.AddPoint( GetPointUpInside() );
-  application.ProcessEvent( event );
+  event                   = Dali::Integration::TouchEvent();
+  event.AddPoint(GetPointUpInside());
+  application.ProcessEvent(event);
 
-  DALI_TEST_CHECK( gIsCalledButtonCallback );
-  DALI_TEST_CHECK( releasedSignal );
+  DALI_TEST_CHECK(gIsCalledButtonCallback);
+  DALI_TEST_CHECK(releasedSignal);
 
   // Test2. Touch point down and up outside the button.
 
-  pressedSignal = false;
-  releasedSignal = false;
+  pressedSignal           = false;
+  releasedSignal          = false;
   gIsCalledButtonCallback = false;
-  event = Dali::Integration::TouchEvent();
-  event.AddPoint( GetPointDownOutside() );
-  application.ProcessEvent( event );
+  event                   = Dali::Integration::TouchEvent();
+  event.AddPoint(GetPointDownOutside());
+  application.ProcessEvent(event);
 
-  DALI_TEST_CHECK( !gIsCalledButtonCallback );
-  DALI_TEST_CHECK( !pressedSignal );
+  DALI_TEST_CHECK(!gIsCalledButtonCallback);
+  DALI_TEST_CHECK(!pressedSignal);
 
   gIsCalledButtonCallback = false;
-  event = Dali::Integration::TouchEvent();
-  event.AddPoint( GetPointUpOutside() );
-  application.ProcessEvent( event );
+  event                   = Dali::Integration::TouchEvent();
+  event.AddPoint(GetPointUpOutside());
+  application.ProcessEvent(event);
 
-  DALI_TEST_CHECK( !gIsCalledButtonCallback );
-  DALI_TEST_CHECK( !releasedSignal );
+  DALI_TEST_CHECK(!gIsCalledButtonCallback);
+  DALI_TEST_CHECK(!releasedSignal);
 
   // Test3. Touch point down inside and up outside the button.
 
   gIsCalledButtonCallback = false;
-  event = Dali::Integration::TouchEvent();
-  event.AddPoint( GetPointDownInside() );
-  application.ProcessEvent( event );
+  event                   = Dali::Integration::TouchEvent();
+  event.AddPoint(GetPointDownInside());
+  application.ProcessEvent(event);
 
-  DALI_TEST_CHECK( gIsCalledButtonCallback );
+  DALI_TEST_CHECK(gIsCalledButtonCallback);
 
   gIsCalledButtonCallback = false;
-  event = Dali::Integration::TouchEvent();
-  event.AddPoint( GetPointLeave() );
-  application.ProcessEvent( event );
+  event                   = Dali::Integration::TouchEvent();
+  event.AddPoint(GetPointLeave());
+  application.ProcessEvent(event);
 
   event = Dali::Integration::TouchEvent();
-  event.AddPoint( GetPointUpOutside() );
-  application.ProcessEvent( event );
+  event.AddPoint(GetPointUpOutside());
+  application.ProcessEvent(event);
 
-  DALI_TEST_CHECK( gIsCalledButtonCallback );
+  DALI_TEST_CHECK(gIsCalledButtonCallback);
 
   // Test4. Touch point down outside and up inside the button.
 
   gIsCalledButtonCallback = false;
-  event = Dali::Integration::TouchEvent();
-  event.AddPoint( GetPointDownOutside() );
-  application.ProcessEvent( event );
+  event                   = Dali::Integration::TouchEvent();
+  event.AddPoint(GetPointDownOutside());
+  application.ProcessEvent(event);
 
-  DALI_TEST_CHECK( !gIsCalledButtonCallback );
+  DALI_TEST_CHECK(!gIsCalledButtonCallback);
 
   gIsCalledButtonCallback = false;
-  event = Dali::Integration::TouchEvent();
-  event.AddPoint( GetPointEnter() );
-  application.ProcessEvent( event );
+  event                   = Dali::Integration::TouchEvent();
+  event.AddPoint(GetPointEnter());
+  application.ProcessEvent(event);
 
   event = Dali::Integration::TouchEvent();
-  event.AddPoint( GetPointUpInside() );
-  application.ProcessEvent( event );
+  event.AddPoint(GetPointUpInside());
+  application.ProcessEvent(event);
 
-  DALI_TEST_CHECK( !gIsCalledButtonCallback );
+  DALI_TEST_CHECK(!gIsCalledButtonCallback);
   END_TEST;
 }
 
@@ -695,90 +723,90 @@ int UtcDaliButtonClickedSignalP(void)
   tet_infoline(" UtcDaliButtonClickedSignalP");
 
   Button button = PushButton::New();
-  button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
-  button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
-  button.SetPosition( 240, 400 );
-  button.SetSize( 100, 100 );
+  button.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+  button.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+  button.SetProperty(Actor::Property::POSITION, Vector2(240, 400));
+  button.SetProperty(Actor::Property::SIZE, Vector2(100, 100));
 
-  Stage::GetCurrent().Add( button );
+  application.GetScene().Add(button);
 
   application.SendNotification();
   application.Render();
 
   // connect to its touch signal
-  button.ClickedSignal().Connect( &ButtonCallback );
-  bool clickedSignal = false;
-  ConnectionTracker* testTracker = new ConnectionTracker();
-  button.ConnectSignal( testTracker, "clicked",   CallbackFunctor(&clickedSignal) );
+  button.ClickedSignal().Connect(&ButtonCallback);
+  bool               clickedSignal = false;
+  ConnectionTracker* testTracker   = new ConnectionTracker();
+  button.ConnectSignal(testTracker, "clicked", CallbackFunctor(&clickedSignal));
 
   Dali::Integration::TouchEvent event;
 
   // Test1. Touch point down and up inside the button.
 
   gIsCalledButtonCallback = false;
-  event = Dali::Integration::TouchEvent();
-  event.AddPoint( GetPointDownInside() );
-  application.ProcessEvent( event );
+  event                   = Dali::Integration::TouchEvent();
+  event.AddPoint(GetPointDownInside());
+  application.ProcessEvent(event);
 
   event = Dali::Integration::TouchEvent();
-  event.AddPoint( GetPointUpInside() );
-  application.ProcessEvent( event );
+  event.AddPoint(GetPointUpInside());
+  application.ProcessEvent(event);
 
-  DALI_TEST_CHECK( gIsCalledButtonCallback );
-  DALI_TEST_CHECK( clickedSignal );
+  DALI_TEST_CHECK(gIsCalledButtonCallback);
+  DALI_TEST_CHECK(clickedSignal);
 
   // Test2. Touch point down and up outside the button.
 
   gIsCalledButtonCallback = false;
-  clickedSignal = false;
-  event = Dali::Integration::TouchEvent();
-  event.AddPoint( GetPointDownOutside() );
-  application.ProcessEvent( event );
+  clickedSignal           = false;
+  event                   = Dali::Integration::TouchEvent();
+  event.AddPoint(GetPointDownOutside());
+  application.ProcessEvent(event);
 
   event = Dali::Integration::TouchEvent();
-  event.AddPoint( GetPointUpOutside() );
-  application.ProcessEvent( event );
+  event.AddPoint(GetPointUpOutside());
+  application.ProcessEvent(event);
 
-  DALI_TEST_CHECK( !gIsCalledButtonCallback );
-  DALI_TEST_CHECK( !clickedSignal );
+  DALI_TEST_CHECK(!gIsCalledButtonCallback);
+  DALI_TEST_CHECK(!clickedSignal);
 
   // Test3. Touch point down inside and up outside the button.
 
   gIsCalledButtonCallback = false;
-  clickedSignal = false;
-  event = Dali::Integration::TouchEvent();
-  event.AddPoint( GetPointDownInside() );
-  application.ProcessEvent( event );
+  clickedSignal           = false;
+  event                   = Dali::Integration::TouchEvent();
+  event.AddPoint(GetPointDownInside());
+  application.ProcessEvent(event);
 
   event = Dali::Integration::TouchEvent();
-  event.AddPoint( GetPointLeave() );
-  application.ProcessEvent( event );
+  event.AddPoint(GetPointLeave());
+  application.ProcessEvent(event);
 
   event = Dali::Integration::TouchEvent();
-  event.AddPoint( GetPointUpOutside() );
-  application.ProcessEvent( event );
+  event.AddPoint(GetPointUpOutside());
+  application.ProcessEvent(event);
 
-  DALI_TEST_CHECK( !gIsCalledButtonCallback );
-  DALI_TEST_CHECK( !clickedSignal );
+  DALI_TEST_CHECK(!gIsCalledButtonCallback);
+  DALI_TEST_CHECK(!clickedSignal);
 
   // Test4. Touch point down outside and up inside the button.
 
   gIsCalledButtonCallback = false;
-  clickedSignal = false;
-  event = Dali::Integration::TouchEvent();
-  event.AddPoint( GetPointDownOutside() );
-  application.ProcessEvent( event );
+  clickedSignal           = false;
+  event                   = Dali::Integration::TouchEvent();
+  event.AddPoint(GetPointDownOutside());
+  application.ProcessEvent(event);
 
   event = Dali::Integration::TouchEvent();
-  event.AddPoint( GetPointEnter() );
-  application.ProcessEvent( event );
+  event.AddPoint(GetPointEnter());
+  application.ProcessEvent(event);
 
   event = Dali::Integration::TouchEvent();
-  event.AddPoint( GetPointUpInside() );
-  application.ProcessEvent( event );
+  event.AddPoint(GetPointUpInside());
+  application.ProcessEvent(event);
 
-  DALI_TEST_CHECK( !gIsCalledButtonCallback );
-  DALI_TEST_CHECK( !clickedSignal );
+  DALI_TEST_CHECK(!gIsCalledButtonCallback);
+  DALI_TEST_CHECK(!clickedSignal);
   END_TEST;
 }
 
@@ -789,31 +817,31 @@ int UtcDaliButtonStateChangedSignalP(void)
 
   Button button = PushButton::New();
 
-  button.SetProperty( Button::Property::TOGGLABLE, true);
+  button.SetProperty(Button::Property::TOGGLABLE, true);
 
-  Stage::GetCurrent().Add( button );
+  application.GetScene().Add(button);
 
   application.SendNotification();
   application.Render();
 
   // connect to its signal
-  button.StateChangedSignal().Connect( &ButtonCallback );
-  bool stateChangedSignal = false;
-  ConnectionTracker* testTracker = new ConnectionTracker();
-  button.ConnectSignal( testTracker, "stateChanged",   CallbackFunctor(&stateChangedSignal) );
+  button.StateChangedSignal().Connect(&ButtonCallback);
+  bool               stateChangedSignal = false;
+  ConnectionTracker* testTracker        = new ConnectionTracker();
+  button.ConnectSignal(testTracker, "stateChanged", CallbackFunctor(&stateChangedSignal));
 
   gIsCalledButtonCallback = false;
-  button.SetProperty( Button::Property::SELECTED, true);
+  button.SetProperty(Button::Property::SELECTED, true);
 
-  DALI_TEST_CHECK( gIsCalledButtonCallback );
-  DALI_TEST_CHECK( stateChangedSignal );
+  DALI_TEST_CHECK(gIsCalledButtonCallback);
+  DALI_TEST_CHECK(stateChangedSignal);
 
   gIsCalledButtonCallback = false;
-  stateChangedSignal = false;
+  stateChangedSignal      = false;
 
-  button.SetProperty( Button::Property::SELECTED, false);
-  DALI_TEST_CHECK( gIsCalledButtonCallback );
-  DALI_TEST_CHECK( stateChangedSignal );
+  button.SetProperty(Button::Property::SELECTED, false);
+  DALI_TEST_CHECK(gIsCalledButtonCallback);
+  DALI_TEST_CHECK(stateChangedSignal);
   END_TEST;
 }
 
@@ -826,10 +854,10 @@ int UtcDaliButtonSetProperty(void)
 
   pushButton.SetProperty(pushButton.GetPropertyIndex("disabled"), false);
 
-  DALI_TEST_EQUALS( pushButton.GetProperty<bool>( pushButton.GetPropertyIndex("disabled")), false, TEST_LOCATION );
+  DALI_TEST_EQUALS(pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("disabled")), false, TEST_LOCATION);
 
   pushButton.SetProperty(pushButton.GetPropertyIndex("disabled"), true);
-  DALI_TEST_EQUALS( pushButton.GetProperty<bool>( pushButton.GetPropertyIndex("disabled")), true, TEST_LOCATION );
+  DALI_TEST_EQUALS(pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("disabled")), true, TEST_LOCATION);
 
   END_TEST;
 }
@@ -848,47 +876,47 @@ int UtcDaliButtonEventConsumption(void)
   ToolkitTestApplication application;
 
   Button parentButton = PushButton::New();
-  parentButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
-  parentButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
-  parentButton.SetSize( 20, 20 );
-  Stage::GetCurrent().Add( parentButton );
+  parentButton.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+  parentButton.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+  parentButton.SetProperty(Actor::Property::SIZE, Vector2(20, 20));
+  application.GetScene().Add(parentButton);
 
   Button childButton = PushButton::New();
-  childButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
-  childButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT );
-  childButton.SetSize( 20, 20 );
-  parentButton.Add( childButton );
+  childButton.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+  childButton.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT);
+  childButton.SetProperty(Actor::Property::SIZE, Vector2(20, 20));
+  parentButton.Add(childButton);
 
   // Reset signal flags
   gIsCalledChildButtonCallback = false;
-  gIsCalledButtonCallback = false;
+  gIsCalledButtonCallback      = false;
 
-  parentButton.ClickedSignal().Connect( &ButtonCallback );
-  childButton.ClickedSignal().Connect( &ChildButtonCallback );
+  parentButton.ClickedSignal().Connect(&ButtonCallback);
+  childButton.ClickedSignal().Connect(&ChildButtonCallback);
 
   // Peform a button click at coordinates (10,30) which is the child.
   Dali::Integration::TouchEvent event;
   event = Dali::Integration::TouchEvent();
   Dali::Integration::Point point;
-  point.SetState( PointState::DOWN );
-  point.SetScreenPosition( Vector2( 10, 30 ) );
-  event.AddPoint( point );
+  point.SetState(PointState::DOWN);
+  point.SetScreenPosition(Vector2(10, 30));
+  event.AddPoint(point);
   // flush the queue and render once
   application.SendNotification();
   application.Render();
-  application.ProcessEvent( event );
+  application.ProcessEvent(event);
 
   event = Dali::Integration::TouchEvent();
-  point.SetState( PointState::UP );
-  point.SetScreenPosition( Vector2( 10, 30 ) );
-  event.AddPoint( point );
+  point.SetState(PointState::UP);
+  point.SetScreenPosition(Vector2(10, 30));
+  event.AddPoint(point);
   // flush the queue and render once
   application.SendNotification();
   application.Render();
-  application.ProcessEvent( event );
+  application.ProcessEvent(event);
 
-  DALI_TEST_EQUALS( gIsCalledChildButtonCallback, true, TEST_LOCATION );
-  DALI_TEST_EQUALS( ! gIsCalledButtonCallback, true, TEST_LOCATION );
+  DALI_TEST_EQUALS(gIsCalledChildButtonCallback, true, TEST_LOCATION);
+  DALI_TEST_EQUALS(!gIsCalledButtonCallback, true, TEST_LOCATION);
 
   END_TEST;
 }
@@ -902,11 +930,11 @@ int UtcDaliButtonRelease(void)
   ToolkitTestApplication application;
 
   Button parentButton = PushButton::New();
-  parentButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
-  parentButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
-  parentButton.SetSize( 20, 20 );
-  Stage::GetCurrent().Add( parentButton );
-  parentButton.ReleasedSignal().Connect( &ButtonCallback );
+  parentButton.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+  parentButton.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+  parentButton.SetProperty(Actor::Property::SIZE, Vector2(20, 20));
+  application.GetScene().Add(parentButton);
+  parentButton.ReleasedSignal().Connect(&ButtonCallback);
 
   // Reset signal flags
   gIsCalledButtonCallback = false;
@@ -915,23 +943,23 @@ int UtcDaliButtonRelease(void)
   Dali::Integration::TouchEvent event;
   event = Dali::Integration::TouchEvent();
   Dali::Integration::Point point;
-  point.SetState( PointState::DOWN );
-  point.SetScreenPosition( Vector2( 10, 10 ) );
-  event.AddPoint( point );
+  point.SetState(PointState::DOWN);
+  point.SetScreenPosition(Vector2(10, 10));
+  event.AddPoint(point);
   // flush the queue and render once
   application.SendNotification();
   application.Render();
-  application.ProcessEvent( event );
+  application.ProcessEvent(event);
 
   event = Dali::Integration::TouchEvent();
-  point.SetState( PointState::INTERRUPTED );
-  event.AddPoint( point );
+  point.SetState(PointState::INTERRUPTED);
+  event.AddPoint(point);
   // flush the queue and render once
   application.SendNotification();
   application.Render();
-  application.ProcessEvent( event );
+  application.ProcessEvent(event);
 
-  DALI_TEST_EQUALS( gIsCalledButtonCallback, true, TEST_LOCATION );
+  DALI_TEST_EQUALS(gIsCalledButtonCallback, true, TEST_LOCATION);
 
   END_TEST;
 }
@@ -945,13 +973,13 @@ int UtcDaliButtonMultiTouch(void)
   ToolkitTestApplication application;
 
   Button button = PushButton::New();
-  button.SetProperty( Button::Property::TOGGLABLE, true);
+  button.SetProperty(Button::Property::TOGGLABLE, true);
 
-  button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
-  button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
-  button.SetSize( 20, 20 );
-  Stage::GetCurrent().Add( button );
-  button.ReleasedSignal().Connect( &ButtonCallback );
+  button.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+  button.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+  button.SetProperty(Actor::Property::SIZE, Vector2(20, 20));
+  application.GetScene().Add(button);
+  button.ReleasedSignal().Connect(&ButtonCallback);
 
   // Reset signal flags
   gIsCalledButtonCallback = false;
@@ -962,49 +990,49 @@ int UtcDaliButtonMultiTouch(void)
   Dali::Integration::Point point;
 
   // Add Press button
-  point.SetState( PointState::DOWN );
-  point.SetScreenPosition( Vector2( 15, 15 ) );
-  downEvent.AddPoint( point );
+  point.SetState(PointState::DOWN);
+  point.SetScreenPosition(Vector2(15, 15));
+  downEvent.AddPoint(point);
   // flush the queue and render once
   application.SendNotification();
   application.Render();
-  application.ProcessEvent( downEvent );
+  application.ProcessEvent(downEvent);
 
   // Release button
   Dali::Integration::TouchEvent upEvent;
   upEvent = Dali::Integration::TouchEvent();
-  point.SetState( PointState::UP );
-  point.SetScreenPosition( Vector2( 15, 15 ) );
-  upEvent.AddPoint( point );
+  point.SetState(PointState::UP);
+  point.SetScreenPosition(Vector2(15, 15));
+  upEvent.AddPoint(point);
   // flush the queue and render once
   application.SendNotification();
   application.Render();
-  application.ProcessEvent( upEvent );
+  application.ProcessEvent(upEvent);
 
   tet_infoline("Button should now be selected\n");
-  bool isSelected = button.GetProperty<bool>( Button::Property::SELECTED ) ;
-  DALI_TEST_EQUALS( isSelected, true, TEST_LOCATION );
+  bool isSelected = button.GetProperty<bool>(Button::Property::SELECTED);
+  DALI_TEST_EQUALS(isSelected, true, TEST_LOCATION);
 
   // Add first point
   Dali::Integration::TouchEvent multiEvent;
   multiEvent = Dali::Integration::TouchEvent();
-  point.SetState( PointState::DOWN );
-  point.SetScreenPosition( Vector2( 10, 10 ) );
-  multiEvent.AddPoint( point );
+  point.SetState(PointState::DOWN);
+  point.SetScreenPosition(Vector2(10, 10));
+  multiEvent.AddPoint(point);
 
   // Add second point
-  point.SetState( PointState::DOWN );
-  point.SetScreenPosition( Vector2( 15, 15 ) );
-  multiEvent.AddPoint( point );
+  point.SetState(PointState::DOWN);
+  point.SetScreenPosition(Vector2(15, 15));
+  multiEvent.AddPoint(point);
 
   tet_infoline("Before a multi touch event\n");
 
   // flush the queue and render once
   application.SendNotification();
   application.Render();
-  application.ProcessEvent( multiEvent );
+  application.ProcessEvent(multiEvent);
 
-  DALI_TEST_EQUALS( gIsCalledButtonCallback, true, TEST_LOCATION );
+  DALI_TEST_EQUALS(gIsCalledButtonCallback, true, TEST_LOCATION);
 
   END_TEST;
 }