[AT-SPI] Squashed implementation
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-ToggleButton.cpp
old mode 100755 (executable)
new mode 100644 (file)
index 2f75b37..6d3424e
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -74,7 +74,7 @@ Dali::Integration::Point GetPointUpInside()
 
 int UtcDaliToggleButtonConstructorP(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
   tet_infoline(" UtcDaliToggleButtonConstructorP");
 
   ToggleButton button;
@@ -84,7 +84,7 @@ int UtcDaliToggleButtonConstructorP(void)
 
 int UtcDaliToggleButtonCopyConstructorP(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
   tet_infoline(" UtcDaliToggleButtonCopyConstructorP");
 
   // Initialize an object, ref count == 1
@@ -97,7 +97,7 @@ int UtcDaliToggleButtonCopyConstructorP(void)
 
 int UtcDaliToggleButtonAssignmentOperatorP(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
   tet_infoline(" UtcDaliToggleButtonAssignmentOperatorP");
 
   ToggleButton button = ToggleButton::New();
@@ -128,7 +128,7 @@ int UtcDaliToggleButtonNewP(void)
   DALI_TEST_CHECK( toggleButton2 == toggleButton );
 
   //Additional check to ensure object is created by checking if it's registered
-  ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
+  ObjectRegistry registry = application.GetCore().GetObjectRegistry();
   DALI_TEST_CHECK( registry );
 
   gObjectCreatedCallBackCalled = false;
@@ -171,10 +171,10 @@ int UtcDaliToggleButtonToggleStatesProperty(void)
 
   // Create the ToggleButton actor
   ToggleButton toggleButton = ToggleButton::New();
-  Stage::GetCurrent().Add( toggleButton );
-  toggleButton.SetParentOrigin(ParentOrigin::TOP_LEFT);
-  toggleButton.SetAnchorPoint(ParentOrigin::TOP_LEFT);
-  toggleButton.SetPosition( 0.0f, 0.0f );
+  application.GetScene().Add( toggleButton );
+  toggleButton.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
+  toggleButton.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
+  toggleButton.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
 
   {// Check empty array
     Property::Array toggleIcons;
@@ -252,10 +252,10 @@ int UtcDaliToggleButtonToggleTipsProperty( void )
 
   // Create the ToggleButton actor
   ToggleButton toggleButton = ToggleButton::New();
-  Stage::GetCurrent().Add( toggleButton );
-  toggleButton.SetParentOrigin(ParentOrigin::TOP_LEFT);
-  toggleButton.SetAnchorPoint(ParentOrigin::TOP_LEFT);
-  toggleButton.SetPosition( 0.0f, 0.0f );
+  application.GetScene().Add( toggleButton );
+  toggleButton.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
+  toggleButton.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
+  toggleButton.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
 
   { // Check empty tip array
     Property::Array toggleIcons;
@@ -311,11 +311,11 @@ int UtcDaliToggleButtonStateChange(void)
 
   // Create the ToggleButton actor
   ToggleButton toggleButton = ToggleButton::New();
-  Stage::GetCurrent().Add( toggleButton );
-  toggleButton.SetParentOrigin(ParentOrigin::TOP_LEFT);
-  toggleButton.SetAnchorPoint(ParentOrigin::TOP_LEFT);
-  toggleButton.SetPosition( BUTTON_POSITON_TO_GET_INSIDE_TOUCH_EVENTS );
-  toggleButton.SetSize( BUTTON_SIZE_TO_GET_INSIDE_TOUCH_EVENTS );
+  application.GetScene().Add( toggleButton );
+  toggleButton.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
+  toggleButton.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
+  toggleButton.SetProperty( Actor::Property::POSITION, BUTTON_POSITON_TO_GET_INSIDE_TOUCH_EVENTS );
+  toggleButton.SetProperty( Actor::Property::SIZE, BUTTON_SIZE_TO_GET_INSIDE_TOUCH_EVENTS );
 
   Property::Array toggleIcons;
   toggleIcons.PushBack( TEST_IMAGE_ONE ); //Icons path
@@ -381,4 +381,4 @@ int UtcDaliToggleButtonStateChange(void)
   DALI_TEST_EQUALS( index, 0, TEST_LOCATION );
 
   END_TEST;
-}
\ No newline at end of file
+}