[UTC][dali-adaptor][ACR-1403] Add Window APIs for adding /removing actor, retrieving... 55/209155/1
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Wed, 3 Jul 2019 04:43:08 +0000 (13:43 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Wed, 3 Jul 2019 04:44:38 +0000 (13:44 +0900)
- The commit ID (428022afb9b88376f992a1aa58a4d8602eebd4cd) is for ITC.
- And this patch is for the real UTC.

Change-Id: I443c0211c99d0464427f496e5d873ef40389e688
Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
src/utc/dali-adaptor/tct-dali-adaptor-core_mobile.h
src/utc/dali-adaptor/tct-dali-adaptor-core_tizeniot.h
src/utc/dali-adaptor/tct-dali-adaptor-core_wearable.h
src/utc/dali-adaptor/window/utc-dali-window.cpp

index 120b84ddf903c0ab705493482e2b05a39569a360..57463a3987ac47fdb110ab297360fe99d7aaec40 100755 (executable)
@@ -73,6 +73,11 @@ extern int UtcDaliWindowSetGetScreenOffModeP(void);
 extern int UtcDaliWindowSetGetBrightnessP(void);
 extern int UtcDaliWindowSetGetSizeResizedSignalP(void);
 extern int UtcDaliWindowSetGetPositionP(void);
+extern int UtcWindowAddRemoveActorP(void);
+extern int UtcWindowSetGetBackgroundColorP(void);
+extern int UtcWindowGetRootLayerP(void);
+extern int UtcWindowGetLayerCountP(void);
+extern int UtcWindowGetLayerP(void);
 extern int UtcDaliNativeImageSourceColorDepthDefaultP(void);
 extern int UtcDaliNativeImageSourceColorDepth24P(void);
 extern int UtcDaliNativeImageSourceColorDepth32P(void);
@@ -193,6 +198,11 @@ testcase tc_array[] = {
        {"UtcDaliWindowSetGetBrightnessP",UtcDaliWindowSetGetBrightnessP,utc_Dali_Window_startup,utc_Dali_Window_cleanup},
        {"UtcDaliWindowSetGetSizeResizedSignalP",UtcDaliWindowSetGetSizeResizedSignalP,utc_Dali_Window_startup,utc_Dali_Window_cleanup},
        {"UtcDaliWindowSetGetPositionP",UtcDaliWindowSetGetPositionP,utc_Dali_Window_startup,utc_Dali_Window_cleanup},
+       {"UtcWindowAddRemoveActorP",UtcWindowAddRemoveActorP,utc_Dali_Window_startup,utc_Dali_Window_cleanup},
+       {"UtcWindowSetGetBackgroundColorP",UtcWindowSetGetBackgroundColorP,utc_Dali_Window_startup,utc_Dali_Window_cleanup},
+       {"UtcWindowGetRootLayerP",UtcWindowGetRootLayerP,utc_Dali_Window_startup,utc_Dali_Window_cleanup},
+       {"UtcWindowGetLayerCountP",UtcWindowGetLayerCountP,utc_Dali_Window_startup,utc_Dali_Window_cleanup},
+       {"UtcWindowGetLayerP",UtcWindowGetLayerP,utc_Dali_Window_startup,utc_Dali_Window_cleanup},
        {"UtcDaliNativeImageSourceColorDepthDefaultP",UtcDaliNativeImageSourceColorDepthDefaultP,utc_Dali_NativeImageSource_startup,utc_Dali_NativeImageSource_cleanup},
        {"UtcDaliNativeImageSourceColorDepth24P",UtcDaliNativeImageSourceColorDepth24P,utc_Dali_NativeImageSource_startup,utc_Dali_NativeImageSource_cleanup},
        {"UtcDaliNativeImageSourceColorDepth32P",UtcDaliNativeImageSourceColorDepth32P,utc_Dali_NativeImageSource_startup,utc_Dali_NativeImageSource_cleanup},
index 120b84ddf903c0ab705493482e2b05a39569a360..57463a3987ac47fdb110ab297360fe99d7aaec40 100755 (executable)
@@ -73,6 +73,11 @@ extern int UtcDaliWindowSetGetScreenOffModeP(void);
 extern int UtcDaliWindowSetGetBrightnessP(void);
 extern int UtcDaliWindowSetGetSizeResizedSignalP(void);
 extern int UtcDaliWindowSetGetPositionP(void);
+extern int UtcWindowAddRemoveActorP(void);
+extern int UtcWindowSetGetBackgroundColorP(void);
+extern int UtcWindowGetRootLayerP(void);
+extern int UtcWindowGetLayerCountP(void);
+extern int UtcWindowGetLayerP(void);
 extern int UtcDaliNativeImageSourceColorDepthDefaultP(void);
 extern int UtcDaliNativeImageSourceColorDepth24P(void);
 extern int UtcDaliNativeImageSourceColorDepth32P(void);
@@ -193,6 +198,11 @@ testcase tc_array[] = {
        {"UtcDaliWindowSetGetBrightnessP",UtcDaliWindowSetGetBrightnessP,utc_Dali_Window_startup,utc_Dali_Window_cleanup},
        {"UtcDaliWindowSetGetSizeResizedSignalP",UtcDaliWindowSetGetSizeResizedSignalP,utc_Dali_Window_startup,utc_Dali_Window_cleanup},
        {"UtcDaliWindowSetGetPositionP",UtcDaliWindowSetGetPositionP,utc_Dali_Window_startup,utc_Dali_Window_cleanup},
+       {"UtcWindowAddRemoveActorP",UtcWindowAddRemoveActorP,utc_Dali_Window_startup,utc_Dali_Window_cleanup},
+       {"UtcWindowSetGetBackgroundColorP",UtcWindowSetGetBackgroundColorP,utc_Dali_Window_startup,utc_Dali_Window_cleanup},
+       {"UtcWindowGetRootLayerP",UtcWindowGetRootLayerP,utc_Dali_Window_startup,utc_Dali_Window_cleanup},
+       {"UtcWindowGetLayerCountP",UtcWindowGetLayerCountP,utc_Dali_Window_startup,utc_Dali_Window_cleanup},
+       {"UtcWindowGetLayerP",UtcWindowGetLayerP,utc_Dali_Window_startup,utc_Dali_Window_cleanup},
        {"UtcDaliNativeImageSourceColorDepthDefaultP",UtcDaliNativeImageSourceColorDepthDefaultP,utc_Dali_NativeImageSource_startup,utc_Dali_NativeImageSource_cleanup},
        {"UtcDaliNativeImageSourceColorDepth24P",UtcDaliNativeImageSourceColorDepth24P,utc_Dali_NativeImageSource_startup,utc_Dali_NativeImageSource_cleanup},
        {"UtcDaliNativeImageSourceColorDepth32P",UtcDaliNativeImageSourceColorDepth32P,utc_Dali_NativeImageSource_startup,utc_Dali_NativeImageSource_cleanup},
index 180db95673613cc35a7d0e35251015d3581ff401..da98bd9fd7a50231e349b0670660473b3400ac52 100755 (executable)
@@ -79,6 +79,11 @@ extern int UtcDaliWindowSetGetScreenOffModeP(void);
 extern int UtcDaliWindowSetGetBrightnessP(void);
 extern int UtcDaliWindowSetGetSizeResizedSignalP(void);
 extern int UtcDaliWindowSetGetPositionP(void);
+extern int UtcWindowAddRemoveActorP(void);
+extern int UtcWindowSetGetBackgroundColorP(void);
+extern int UtcWindowGetRootLayerP(void);
+extern int UtcWindowGetLayerCountP(void);
+extern int UtcWindowGetLayerP(void);
 extern int UtcDaliNativeImageSourceColorDepthDefaultP(void);
 extern int UtcDaliNativeImageSourceColorDepth24P(void);
 extern int UtcDaliNativeImageSourceColorDepth32P(void);
@@ -231,6 +236,11 @@ testcase tc_array[] = {
        {"UtcDaliWindowSetGetBrightnessP",UtcDaliWindowSetGetBrightnessP,utc_Dali_Window_startup,utc_Dali_Window_cleanup},
        {"UtcDaliWindowSetGetSizeResizedSignalP",UtcDaliWindowSetGetSizeResizedSignalP,utc_Dali_Window_startup,utc_Dali_Window_cleanup},
        {"UtcDaliWindowSetGetPositionP",UtcDaliWindowSetGetPositionP,utc_Dali_Window_startup,utc_Dali_Window_cleanup},
+       {"UtcWindowAddRemoveActorP",UtcWindowAddRemoveActorP,utc_Dali_Window_startup,utc_Dali_Window_cleanup},
+       {"UtcWindowSetGetBackgroundColorP",UtcWindowSetGetBackgroundColorP,utc_Dali_Window_startup,utc_Dali_Window_cleanup},
+       {"UtcWindowGetRootLayerP",UtcWindowGetRootLayerP,utc_Dali_Window_startup,utc_Dali_Window_cleanup},
+       {"UtcWindowGetLayerCountP",UtcWindowGetLayerCountP,utc_Dali_Window_startup,utc_Dali_Window_cleanup},
+       {"UtcWindowGetLayerP",UtcWindowGetLayerP,utc_Dali_Window_startup,utc_Dali_Window_cleanup},
        {"UtcDaliNativeImageSourceColorDepthDefaultP",UtcDaliNativeImageSourceColorDepthDefaultP,utc_Dali_NativeImageSource_startup,utc_Dali_NativeImageSource_cleanup},
        {"UtcDaliNativeImageSourceColorDepth24P",UtcDaliNativeImageSourceColorDepth24P,utc_Dali_NativeImageSource_startup,utc_Dali_NativeImageSource_cleanup},
        {"UtcDaliNativeImageSourceColorDepth32P",UtcDaliNativeImageSourceColorDepth32P,utc_Dali_NativeImageSource_startup,utc_Dali_NativeImageSource_cleanup},
index a5ed0d4d7411e01acee747ded4fae4d77a5b4fb6..5cb7dc28796a040b999c5bd053c0ededfcc5a86b 100755 (executable)
@@ -58,6 +58,11 @@ void WindowSetGetScreenOffModeP( Application& application );
 void WindowSetGetBrightnessP( Application& application );
 void WindowSetGetSizeResizedSignalP( Application& application );
 void WindowSetGetPositionP( Application& application );
+void WindowAddRemoveActorP( Application& application );
+void WindowSetGetBackgroundColorP( Application& application );
+void WindowGetRootLayerP( Application& application );
+void WindowGetLayerCountP( Application& application );
+void WindowGetLayerP( Application& application );
 
 void VTWindowSetGetSizeResizedSignal001( Application& application );
 
@@ -120,7 +125,12 @@ namespace
     WINDOW_SET_GET_SCREEN_OFF_MODE_P,
     WINDOW_SET_GET_BRIGHTNESS_P,
     WINDOW_SET_GET_SIZE_RESIZED_SIGNAL_P,
-    WINDOW_SET_GET_POSITION_P
+    WINDOW_SET_GET_POSITION_P,
+    WINDOW_ADD_REMOVE_ACTOR_P,
+    WINDOW_SET_GET_BACKGROUND_COLOR_P,
+    WINDOW_GET_ROOT_LAYER_P,
+    WINDOW_GET_LAYER_COUNT_P,
+    WINDOW_GET_LAYER_P
   };
 
   struct Window_TestApp : public ConnectionTracker
@@ -274,6 +284,26 @@ namespace
         case WINDOW_SET_GET_POSITION_P:
           WindowSetGetPositionP( mApplication );
           break;
+
+        case WINDOW_ADD_REMOVE_ACTOR_P:
+          WindowAddRemoveActorP( mApplication );
+          break;
+
+        case WINDOW_SET_GET_BACKGROUND_COLOR_P:
+          WindowSetGetBackgroundColorP( mApplication );
+          break;
+
+        case WINDOW_GET_ROOT_LAYER_P:
+          WindowGetRootLayerP( mApplication );
+          break;
+
+        case WINDOW_GET_LAYER_COUNT_P:
+          WindowGetLayerCountP( mApplication );
+          break;
+
+        case WINDOW_GET_LAYER_P:
+          WindowGetLayerP( mApplication );
+          break;
       }
     }
 
@@ -791,6 +821,90 @@ void WindowSetGetPositionP( Application& application )
   DaliLog::PrintPass();
 }
 
+void WindowAddRemoveActorP( Application& application )
+{
+  Window window = application.GetWindow();
+
+  Actor actor = Actor::New();
+  DALI_CHECK_FAIL( !actor,  "Actor::New() is Failed" );
+
+  bool bIsOnStage = actor.OnStage();
+  DALI_CHECK_FAIL( bIsOnStage,  " OnStage is Failed to get default value" );
+
+  window.Add( actor );
+  bIsOnStage = actor.OnStage();
+  DALI_CHECK_FAIL( !bIsOnStage,  "OnStage is Failed to get the expected value" );
+
+  window.Remove( actor );
+  bIsOnStage = actor.OnStage();
+  DALI_CHECK_FAIL( bIsOnStage,  "OnStage is Failed to get the expected value" );
+
+  DaliLog::PrintPass();
+}
+
+void WindowSetGetBackgroundColorP( Application& application )
+{
+  Window window = application.GetWindow();
+
+  window.SetBackgroundColor( Color::RED );
+  DALI_CHECK_FAIL( Color::RED != window.GetBackgroundColor(), "Window::SetBackgroundColor and Window::GetBackgroundColor are failed" );
+
+  DaliLog::PrintPass();
+}
+
+void WindowGetRootLayerP( Application& application )
+{
+  Window window = application.GetWindow();
+
+  Layer rootLayer = window.GetLayer( 0u );
+  DALI_CHECK_FAIL( window.GetRootLayer() != rootLayer,  "GetRootLayer is failed to get expected value" );
+
+  Layer layer = Layer::New();
+  window.Add( layer );
+  layer.LowerToBottom();
+  DALI_CHECK_FAIL( window.GetRootLayer() != rootLayer,  "GetRootLayer is failed to get expected value" );
+
+  DaliLog::PrintPass();
+}
+
+void WindowGetLayerCountP( Application& application )
+{
+  Window window = application.GetWindow();
+
+  // Initially we have a default layer
+  DALI_CHECK_FAIL( window.GetLayer( 0u ) != window.GetRootLayer(),  "GetLayer is failed to get expected value" );
+  DALI_CHECK_FAIL( window.GetLayerCount() != 1u, "GetLayerCount is failed to get expected value" );
+
+  // Add a new layer to the window
+  Layer newLayer = Layer::New();
+  window.Add( newLayer );
+  DALI_TEST_EQUALS( window.GetLayerCount() != 2u, "GetLayerCount is failed to get expected value" );
+
+  // Retrieves the new layer from the window
+  DALI_TEST_EQUALS( window.GetLayer( 1u ) != newLayer, "GetLayer is failed to get expected value" );
+
+  DaliLog::PrintPass();
+}
+
+void WindowGetLayerP( Application& application )
+{
+  Window window = application.GetWindow();
+
+  // Initially we have a default layer
+  DALI_CHECK_FAIL( window.GetLayerCount() != 1u, "GetLayerCount is failed to get expected value" );
+
+  // Add a new layer to the window
+  Layer layer = Layer::New();
+  window.Add( layer );
+  DALI_TEST_EQUALS( window.GetLayerCount() != 2u, "GetLayerCount is failed to get expected value" );
+
+  // Remove the new layer from the window
+  window.Remove( layer );
+  DALI_TEST_EQUALS( window.GetLayerCount() != 1u, "GetLayerCount is failed to get expected value" );
+
+  DaliLog::PrintPass();
+}
+
 /**
  * @testcase        UtcDaliWindowNewP
  * @since_tizen     2.4
@@ -1255,3 +1369,78 @@ int UtcDaliWindowSetGetPositionP(void)
   application.MainLoop();
   return test_return_value;
 }
+
+/**
+* @testcase       UtcWindowAddRemoveActorP
+* @since_tizen    5.5
+* @description    checks for Window::Add() and Window::Remove() functionality
+*/
+int UtcWindowAddRemoveActorP(void)
+{
+  DaliLog::PrintExecStarted( SUITE_NAME, __FUNCTION__ );
+  Application application = Application::New( &gArgc, &gArgv );
+  CHECK_GL;
+  Window_TestApp testApp( application, WINDOW_ADD_REMOVE_ACTOR_P );
+  application.MainLoop();
+  return test_return_value;
+}
+
+/**
+* @testcase       UtcWindowSetGetBackgroundColorP
+* @since_tizen    5.5
+* @description    checks for Window::SetBackgroundColor() and Window::GetBackgroundColor() functionality
+*/
+int UtcWindowSetGetBackgroundColorP(void)
+{
+  DaliLog::PrintExecStarted( SUITE_NAME, __FUNCTION__ );
+  Application application = Application::New( &gArgc, &gArgv );
+  CHECK_GL;
+  Window_TestApp testApp( application, WINDOW_SET_GET_BACKGROUND_COLOR_P );
+  application.MainLoop();
+  return test_return_value;
+}
+
+/**
+* @testcase       UtcWindowGetRootLayerP
+* @since_tizen    5.5
+* @description    checks for Window::GetRootLayer functionality
+*/
+int UtcWindowGetRootLayerP(void)
+{
+  DaliLog::PrintExecStarted( SUITE_NAME, __FUNCTION__ );
+  Application application = Application::New( &gArgc, &gArgv );
+  CHECK_GL;
+  Window_TestApp testApp( application, WINDOW_GET_ROOT_LAYER_P );
+  application.MainLoop();
+  return test_return_value;
+}
+
+/**
+* @testcase       UtcWindowGetLayerCountP
+* @since_tizen    5.5
+* @description    checks for Window::GetLayerCount functionality
+*/
+int UtcWindowGetLayerCountP(void)
+{
+  DaliLog::PrintExecStarted( SUITE_NAME, __FUNCTION__ );
+  Application application = Application::New( &gArgc, &gArgv );
+  CHECK_GL;
+  Window_TestApp testApp( application, WINDOW_GET_LAYER_COUNT_P );
+  application.MainLoop();
+  return test_return_value;
+}
+
+/**
+* @testcase       UtcWindowGetLayerP
+* @since_tizen    5.5
+* @description      checks for Window::GetLayer functionality
+*/
+int UtcWindowGetLayerP(void)
+{
+  DaliLog::PrintExecStarted( SUITE_NAME, __FUNCTION__ );
+  Application application = Application::New( &gArgc, &gArgv );
+  CHECK_GL;
+  Window_TestApp testApp( application, WINDOW_GET_LAYER_P );
+  application.MainLoop();
+  return test_return_value;
+}