From: ABHISHEK JAIN Date: Fri, 26 Jul 2019 07:12:03 +0000 (+0530) Subject: [ITC][app-manager][ACR-1418][Updated TC for new enum for Component-based application] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9c981682171d7f08b94736432856a7adf010d7ad;p=test%2Ftct%2Fnative%2Fapi.git [ITC][app-manager][ACR-1418][Updated TC for new enum for Component-based application] Change-Id: I55819e46f5b0a6febacb44d82abbbe55fd983cc3 Signed-off-by: ABHISHEK JAIN --- diff --git a/src/itc/app-manager/ITs-app-manager-common.h b/src/itc/app-manager/ITs-app-manager-common.h index 1d07821b4..0e8cc71fd 100755 --- a/src/itc/app-manager/ITs-app-manager-common.h +++ b/src/itc/app-manager/ITs-app-manager-common.h @@ -41,6 +41,7 @@ #define GMAINTIMEOUT 10000 //10 seconds #define TEST_TESTAPPLICATION_APPID "org.tizen.testapplication" #define TEST_APPMANAGERTESTFILE_APPID "org.tizen.appmanagertestfile" +#define TEST_COMPONENTBASED_APPID "org.example.componentbased" #define MKEY "test" #define MVALUE "metavalue" #define API_NAMESPACE "APP_MANAGER_ITC" diff --git a/src/itc/app-manager/ITs-app-manager-info.c b/src/itc/app-manager/ITs-app-manager-info.c index f3aa30772..32ec513bf 100755 --- a/src/itc/app-manager/ITs-app-manager-info.c +++ b/src/itc/app-manager/ITs-app-manager-info.c @@ -41,7 +41,8 @@ void ITs_app_manager_info_startup(void) FPRINTF("[Line : %d][%s] TEST SUIT start-up: ITs_App_Manager_p\\n", __LINE__, API_NAMESPACE); #endif - TCT_CheckInstalledApp(2, TEST_TESTAPPLICATION_APPID, TEST_APPMANAGERTESTFILE_APPID); + //TCT_CheckInstalledApp(2, TEST_TESTAPPLICATION_APPID, TEST_APPMANAGERTESTFILE_APPID); + TCT_CheckInstalledApp(3, TEST_TESTAPPLICATION_APPID, TEST_APPMANAGERTESTFILE_APPID, TEST_COMPONENTBASED_APPID); sleep(2); int nRet = APP_MANAGER_ERROR_NONE; @@ -1072,10 +1073,10 @@ int ITc_app_manager_app_info_get_localed_label_p(void) * @type auto * @since_tizen 4.0 * @description Gets the application component type. -* @scenario Gets the application component type. +* @scenario Gets the application component type and compare with expected value. * @apicovered app_info_get_app_component_type -* @passcase If app_info_get_app_component_type returns success -* @failcase If app_info_get_app_component_type or any precondition api returns fail +* @passcase If app_info_get_app_component_type returns success or type matches +* @failcase If app_info_get_app_component_type or any precondition api returns fail or type mismatch * @precondition app manager instance should be created * @postcondition app manager instance should be destroyed */ @@ -1083,21 +1084,40 @@ int ITc_app_manager_app_info_get_app_component_type_p(void) { START_TEST; - app_info_h pstAppInfoHandle = NULL; + const char *AppIDs[] = + { + TEST_TESTAPPLICATION_APPID, + TEST_COMPONENTBASED_APPID + }; + + app_info_app_component_type_e eAPP_COMP_TYPE[] = + { + APP_INFO_APP_COMPONENT_TYPE_UI_APP, + APP_INFO_APP_COMPONENT_TYPE_COMPONENT_BASED_APP + }; + + app_info_h hAppInfo = NULL; app_info_app_component_type_e eGetComponent; + int nRet = APP_MANAGER_ERROR_NONE; + int nLoopCnt, nLoopSize; - int nRet = app_manager_get_app_info((const char *)TEST_TESTAPPLICATION_APPID, &pstAppInfoHandle); - PRINT_RESULT(APP_MANAGER_ERROR_NONE, nRet, "app_manager_get_app_info", AppManagerGetError(nRet)); - CHECK_HANDLE(pstAppInfoHandle, "app_manager_get_app_info"); + nLoopSize = sizeof(AppIDs)/sizeof(AppIDs[0]); - nRet = app_info_get_app_component_type(pstAppInfoHandle, &eGetComponent); - PRINT_RESULT_CLEANUP(APP_MANAGER_ERROR_NONE, nRet, "app_info_get_component_type", AppManagerGetError(nRet),app_info_destroy(pstAppInfoHandle)); - FPRINTF("eGetComponent value is = [%s] \\n" ,AppManagerGetAppComponent(eGetComponent)); + for (nLoopCnt = 0; nLoopCnt < nLoopSize; nLoopCnt++) + { + nRet = app_manager_get_app_info((const char *)AppIDs[nLoopCnt], &hAppInfo); + PRINT_RESULT(APP_MANAGER_ERROR_NONE, nRet, "app_manager_get_app_info", AppManagerGetError(nRet)); + CHECK_HANDLE(hAppInfo, "app_manager_get_app_info"); - nRet = app_info_destroy(pstAppInfoHandle); - PRINT_RESULT_NORETURN(APP_MANAGER_ERROR_NONE, nRet, "app_info_destroy", AppManagerGetError(nRet)); + nRet = app_info_get_app_component_type(hAppInfo, &eGetComponent); + PRINT_RESULT_CLEANUP(APP_MANAGER_ERROR_NONE, nRet, "app_info_get_component_type", AppManagerGetError(nRet),app_info_destroy(hAppInfo)); + PRINT_RESULT_CLEANUP(eAPP_COMP_TYPE[nLoopCnt], eGetComponent, "app_info_get_component_type", AppManagerGetError(nRet),app_info_destroy(hAppInfo)); + nRet = app_info_destroy(hAppInfo); + PRINT_RESULT_NORETURN(APP_MANAGER_ERROR_NONE, nRet, "app_info_destroy", AppManagerGetError(nRet)); + } return 0; } + /** @} */ /** @} */ diff --git a/src/itc/app-manager/res/mobile/org.example.componentbased-1.0.0-arm.tpk b/src/itc/app-manager/res/mobile/org.example.componentbased-1.0.0-arm.tpk new file mode 100644 index 000000000..bf7119aba Binary files /dev/null and b/src/itc/app-manager/res/mobile/org.example.componentbased-1.0.0-arm.tpk differ diff --git a/src/itc/app-manager/res/mobile/org.example.componentbased-1.0.0-i386.tpk b/src/itc/app-manager/res/mobile/org.example.componentbased-1.0.0-i386.tpk new file mode 100644 index 000000000..190f7cc5f Binary files /dev/null and b/src/itc/app-manager/res/mobile/org.example.componentbased-1.0.0-i386.tpk differ diff --git a/src/itc/app-manager/res/tizeniot/org.example.componentbased-1.0.0-arm.tpk b/src/itc/app-manager/res/tizeniot/org.example.componentbased-1.0.0-arm.tpk new file mode 100644 index 000000000..bf7119aba Binary files /dev/null and b/src/itc/app-manager/res/tizeniot/org.example.componentbased-1.0.0-arm.tpk differ diff --git a/src/itc/app-manager/res/tizeniot/org.example.componentbased-1.0.0-i386.tpk b/src/itc/app-manager/res/tizeniot/org.example.componentbased-1.0.0-i386.tpk new file mode 100644 index 000000000..190f7cc5f Binary files /dev/null and b/src/itc/app-manager/res/tizeniot/org.example.componentbased-1.0.0-i386.tpk differ diff --git a/src/itc/app-manager/res/tv/org.example.componentbased-1.0.0-arm.tpk b/src/itc/app-manager/res/tv/org.example.componentbased-1.0.0-arm.tpk new file mode 100644 index 000000000..bf7119aba Binary files /dev/null and b/src/itc/app-manager/res/tv/org.example.componentbased-1.0.0-arm.tpk differ diff --git a/src/itc/app-manager/res/tv/org.example.componentbased-1.0.0-i386.tpk b/src/itc/app-manager/res/tv/org.example.componentbased-1.0.0-i386.tpk new file mode 100644 index 000000000..190f7cc5f Binary files /dev/null and b/src/itc/app-manager/res/tv/org.example.componentbased-1.0.0-i386.tpk differ diff --git a/src/itc/app-manager/res/wearable/org.example.componentbased-1.0.0-arm.tpk b/src/itc/app-manager/res/wearable/org.example.componentbased-1.0.0-arm.tpk new file mode 100644 index 000000000..bf7119aba Binary files /dev/null and b/src/itc/app-manager/res/wearable/org.example.componentbased-1.0.0-arm.tpk differ diff --git a/src/itc/app-manager/res/wearable/org.example.componentbased-1.0.0-i386.tpk b/src/itc/app-manager/res/wearable/org.example.componentbased-1.0.0-i386.tpk new file mode 100644 index 000000000..190f7cc5f Binary files /dev/null and b/src/itc/app-manager/res/wearable/org.example.componentbased-1.0.0-i386.tpk differ