From: Seoyeon Kim Date: Wed, 3 Jul 2019 04:43:08 +0000 (+0900) Subject: [UTC][dali-adaptor][ACR-1403] Add Window APIs for adding /removing actor, retrieving... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=be1f4825b72a7310565bd58cfaba035033a008ff;p=test%2Ftct%2Fnative%2Fapi.git [UTC][dali-adaptor][ACR-1403] Add Window APIs for adding /removing actor, retrieving root layer and background color - The commit ID (428022afb9b88376f992a1aa58a4d8602eebd4cd) is for ITC. - And this patch is for the real UTC. Change-Id: I443c0211c99d0464427f496e5d873ef40389e688 Signed-off-by: Seoyeon Kim --- diff --git a/src/utc/dali-adaptor/tct-dali-adaptor-core_mobile.h b/src/utc/dali-adaptor/tct-dali-adaptor-core_mobile.h index 120b84ddf..57463a398 100755 --- a/src/utc/dali-adaptor/tct-dali-adaptor-core_mobile.h +++ b/src/utc/dali-adaptor/tct-dali-adaptor-core_mobile.h @@ -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}, diff --git a/src/utc/dali-adaptor/tct-dali-adaptor-core_tizeniot.h b/src/utc/dali-adaptor/tct-dali-adaptor-core_tizeniot.h index 120b84ddf..57463a398 100755 --- a/src/utc/dali-adaptor/tct-dali-adaptor-core_tizeniot.h +++ b/src/utc/dali-adaptor/tct-dali-adaptor-core_tizeniot.h @@ -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}, diff --git a/src/utc/dali-adaptor/tct-dali-adaptor-core_wearable.h b/src/utc/dali-adaptor/tct-dali-adaptor-core_wearable.h index 180db9567..da98bd9fd 100755 --- a/src/utc/dali-adaptor/tct-dali-adaptor-core_wearable.h +++ b/src/utc/dali-adaptor/tct-dali-adaptor-core_wearable.h @@ -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}, diff --git a/src/utc/dali-adaptor/window/utc-dali-window.cpp b/src/utc/dali-adaptor/window/utc-dali-window.cpp index a5ed0d4d7..5cb7dc287 100755 --- a/src/utc/dali-adaptor/window/utc-dali-window.cpp +++ b/src/utc/dali-adaptor/window/utc-dali-window.cpp @@ -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; +}