(Automated Tests) Use Scene instead of Stage
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-Alignment.cpp
index 3b1a6f8..b1b7aba 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 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.
@@ -239,7 +239,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
   {
     Alignment alignment = Alignment::New();
     alignment.Add(Actor::New());
-    Stage::GetCurrent().Add(alignment);
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
 
@@ -250,7 +250,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
     alignment.SetAlignmentType(type);
     DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
 
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -259,7 +259,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
   {
     Alignment alignment = Alignment::New();
     alignment.Add(Actor::New());
-    Stage::GetCurrent().Add(alignment);
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
 
@@ -270,7 +270,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
     alignment.SetAlignmentType(type);
     DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
 
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -279,7 +279,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
   {
     Alignment alignment = Alignment::New();
     alignment.Add(Actor::New());
-    Stage::GetCurrent().Add(alignment);
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
 
@@ -290,7 +290,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
     alignment.SetAlignmentType(type);
     DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
 
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -299,7 +299,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
   {
     Alignment alignment = Alignment::New();
     alignment.Add(Actor::New());
-    Stage::GetCurrent().Add(alignment);
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
 
@@ -310,7 +310,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
     alignment.SetAlignmentType(type);
     DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
 
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -319,7 +319,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
   {
     Alignment alignment = Alignment::New();
     alignment.Add(Actor::New());
-    Stage::GetCurrent().Add(alignment);
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
 
@@ -330,7 +330,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
     alignment.SetAlignmentType(type);
     DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
 
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -339,7 +339,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
   {
     Alignment alignment = Alignment::New();
     alignment.Add(Actor::New());
-    Stage::GetCurrent().Add(alignment);
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
 
@@ -350,7 +350,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
     alignment.SetAlignmentType(type);
     DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
 
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -359,7 +359,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
   {
     Alignment alignment = Alignment::New();
     alignment.Add(Actor::New());
-    Stage::GetCurrent().Add(alignment);
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
 
@@ -370,7 +370,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
     alignment.SetAlignmentType(type);
     DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
 
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -379,7 +379,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
   {
     Alignment alignment = Alignment::New();
     alignment.Add(Actor::New());
-    Stage::GetCurrent().Add(alignment);
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
 
@@ -390,7 +390,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
     alignment.SetAlignmentType(type);
     DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
 
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -399,7 +399,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
   {
     Alignment alignment = Alignment::New();
     alignment.Add(Actor::New());
-    Stage::GetCurrent().Add(alignment);
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
 
@@ -410,7 +410,7 @@ int UtcDaliAlignmentSetAlignmentTypePositiveOnStage(void)
     alignment.SetAlignmentType(type);
     DALI_TEST_CHECK(alignment.GetAlignmentType() & type);
 
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -473,10 +473,10 @@ int UtcDaliAlignmentGetAlignmentType(void)
     Alignment alignment = Alignment::New();
     DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
     alignment.Add(Actor::New());
-    Stage::GetCurrent().Add(alignment);
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -486,10 +486,10 @@ int UtcDaliAlignmentGetAlignmentType(void)
     Alignment alignment = Alignment::New(Alignment::HorizontalLeft);
     DALI_TEST_EQUALS(Alignment::HorizontalLeft | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
     alignment.Add(Actor::New());
-    Stage::GetCurrent().Add(alignment);
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -499,10 +499,10 @@ int UtcDaliAlignmentGetAlignmentType(void)
     Alignment alignment = Alignment::New(Alignment::HorizontalRight);
     DALI_TEST_EQUALS(Alignment::HorizontalRight | Alignment::VerticalCenter, alignment.GetAlignmentType(), TEST_LOCATION);
     alignment.Add(Actor::New());
-    Stage::GetCurrent().Add(alignment);
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -512,10 +512,10 @@ int UtcDaliAlignmentGetAlignmentType(void)
     Alignment alignment = Alignment::New(Alignment::HorizontalLeft, Alignment::VerticalTop);
     DALI_TEST_EQUALS(Alignment::HorizontalLeft | Alignment::VerticalTop, alignment.GetAlignmentType(), TEST_LOCATION);
     alignment.Add(Actor::New());
-    Stage::GetCurrent().Add(alignment);
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -525,10 +525,10 @@ int UtcDaliAlignmentGetAlignmentType(void)
     Alignment alignment = Alignment::New(Alignment::HorizontalCenter, Alignment::VerticalTop);
     DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalTop, alignment.GetAlignmentType(), TEST_LOCATION);
     alignment.Add(Actor::New());
-    Stage::GetCurrent().Add(alignment);
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -538,10 +538,10 @@ int UtcDaliAlignmentGetAlignmentType(void)
     Alignment alignment = Alignment::New(Alignment::HorizontalRight, Alignment::VerticalTop);
     DALI_TEST_EQUALS(Alignment::HorizontalRight | Alignment::VerticalTop, alignment.GetAlignmentType(), TEST_LOCATION);
     alignment.Add(Actor::New());
-    Stage::GetCurrent().Add(alignment);
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -551,10 +551,10 @@ int UtcDaliAlignmentGetAlignmentType(void)
     Alignment alignment = Alignment::New(Alignment::HorizontalLeft, Alignment::VerticalBottom);
     DALI_TEST_EQUALS(Alignment::HorizontalLeft | Alignment::VerticalBottom, alignment.GetAlignmentType(), TEST_LOCATION);
     alignment.Add(Actor::New());
-    Stage::GetCurrent().Add(alignment);
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -564,10 +564,10 @@ int UtcDaliAlignmentGetAlignmentType(void)
     Alignment alignment = Alignment::New(Alignment::HorizontalCenter, Alignment::VerticalBottom);
     DALI_TEST_EQUALS(Alignment::HorizontalCenter | Alignment::VerticalBottom, alignment.GetAlignmentType(), TEST_LOCATION);
     alignment.Add(Actor::New());
-    Stage::GetCurrent().Add(alignment);
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -577,10 +577,10 @@ int UtcDaliAlignmentGetAlignmentType(void)
     Alignment alignment = Alignment::New(Alignment::HorizontalRight, Alignment::VerticalBottom);
     DALI_TEST_EQUALS(Alignment::HorizontalRight | Alignment::VerticalBottom, alignment.GetAlignmentType(), TEST_LOCATION);
     alignment.Add(Actor::New());
-    Stage::GetCurrent().Add(alignment);
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -595,7 +595,7 @@ int UtcDaliAlignmentSetScaling(void)
   {
     Alignment alignment = Alignment::New();
     alignment.Add(Actor::New());
-    Stage::GetCurrent().Add(alignment);
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
 
@@ -619,7 +619,7 @@ int UtcDaliAlignmentSetScaling(void)
     application.Render();
     application.SendNotification();
 
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -628,7 +628,7 @@ int UtcDaliAlignmentSetScaling(void)
   {
     Alignment alignment = Alignment::New();
     alignment.Add(Actor::New());
-    Stage::GetCurrent().Add(alignment);
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
 
@@ -652,7 +652,7 @@ int UtcDaliAlignmentSetScaling(void)
     application.Render();
     application.SendNotification();
 
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -661,7 +661,7 @@ int UtcDaliAlignmentSetScaling(void)
   {
     Alignment alignment = Alignment::New();
     alignment.Add(Actor::New());
-    Stage::GetCurrent().Add(alignment);
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
 
@@ -685,7 +685,7 @@ int UtcDaliAlignmentSetScaling(void)
     application.Render();
     application.SendNotification();
 
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -694,7 +694,7 @@ int UtcDaliAlignmentSetScaling(void)
   {
     Alignment alignment = Alignment::New();
     alignment.Add(Actor::New());
-    Stage::GetCurrent().Add(alignment);
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
 
@@ -718,7 +718,7 @@ int UtcDaliAlignmentSetScaling(void)
     application.Render();
     application.SendNotification();
 
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -727,7 +727,7 @@ int UtcDaliAlignmentSetScaling(void)
   {
     Alignment alignment = Alignment::New();
     alignment.Add(Actor::New());
-    Stage::GetCurrent().Add(alignment);
+    application.GetScene().Add(alignment);
     application.Render();
     application.SendNotification();
 
@@ -751,7 +751,7 @@ int UtcDaliAlignmentSetScaling(void)
     application.Render();
     application.SendNotification();
 
-    Stage::GetCurrent().Remove(alignment);
+    application.GetScene().Remove(alignment);
     application.Render();
     application.SendNotification();
   }
@@ -906,7 +906,7 @@ int UtcDaliAlignmentChildAddAndRemove(void)
   ToolkitTestApplication application;
 
   Alignment alignment = Alignment::New();
-  Stage::GetCurrent().Add(alignment);
+  application.GetScene().Add(alignment);
 
   application.Render();
   application.SendNotification();
@@ -926,7 +926,7 @@ int UtcDaliAlignmentChildAddAndRemove(void)
   application.Render();
   application.SendNotification();
 
-  Stage::GetCurrent().Remove(alignment);
+  application.GetScene().Remove(alignment);
   END_TEST;
 }
 
@@ -935,7 +935,7 @@ int UtcDaliAlignmentSizeSetP(void)
   ToolkitTestApplication application;
 
   Alignment alignment = Alignment::New();
-  Stage::GetCurrent().Add(alignment);
+  application.GetScene().Add(alignment);
 
   application.Render();
   application.SendNotification();
@@ -950,7 +950,7 @@ int UtcDaliAlignmentSizeSetP(void)
 
   DALI_TEST_EQUALS(size, alignment.GetTargetSize().GetVectorXY(), TEST_LOCATION);
 
-  Stage::GetCurrent().Remove(alignment);
+  application.GetScene().Remove(alignment);
   END_TEST;
 }
 
@@ -969,7 +969,7 @@ int UtcDaliAlignmentOnTouchEvent(void)
   Alignment alignment = Alignment::New();
   alignment.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
   alignment.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
-  Stage::GetCurrent().Add(alignment);
+  application.GetScene().Add(alignment);
 
   alignment.TouchSignal().Connect(&TouchCallback);
 
@@ -995,7 +995,7 @@ int UtcDaliAlignmentOnKeyEvent(void)
   ToolkitTestApplication application;
 
   Alignment alignment = Alignment::New();
-  Stage::GetCurrent().Add(alignment);
+  application.GetScene().Add(alignment);
 
   alignment.SetKeyInputFocus();
 
@@ -1016,7 +1016,7 @@ int UtcDaliAlignmentOnSizeAnimation(void)
   ToolkitTestApplication application;
 
   Alignment alignment = Alignment::New();
-  Stage::GetCurrent().Add(alignment);
+  application.GetScene().Add(alignment);
 
   Animation animation = Animation::New(100.0f);
   animation.AnimateTo( Property( alignment, Actor::Property::SIZE ), Vector3( 100.0f, 150.0f, 200.0f ) );