From: Junghyun Yeon Date: Wed, 7 Dec 2016 11:09:22 +0000 (+0900) Subject: [UTC][app-manager][Non-ACR][Add TC to check multi-resolution icon feature] X-Git-Tag: Public_Final_RC6~8^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3dad3a7652e921b533cd22e4cb2d14f48a2084fa;p=test%2Ftct%2Fnative%2Fapi.git [UTC][app-manager][Non-ACR][Add TC to check multi-resolution icon feature] Signed-off-by: Junghyun Yeon Change-Id: Ibd3bff76e67dfc895b0f41a3efceedd39e5e146d --- diff --git a/src/utc/app-manager/res/wearable/org.tizen.multiresolutionicon-1.0.0-aarch64.tpk b/src/utc/app-manager/res/wearable/org.tizen.multiresolutionicon-1.0.0-aarch64.tpk new file mode 100644 index 000000000..f93b46b94 Binary files /dev/null and b/src/utc/app-manager/res/wearable/org.tizen.multiresolutionicon-1.0.0-aarch64.tpk differ diff --git a/src/utc/app-manager/res/wearable/org.tizen.multiresolutionicon-1.0.0-arm.tpk b/src/utc/app-manager/res/wearable/org.tizen.multiresolutionicon-1.0.0-arm.tpk new file mode 100644 index 000000000..580a49301 Binary files /dev/null and b/src/utc/app-manager/res/wearable/org.tizen.multiresolutionicon-1.0.0-arm.tpk differ diff --git a/src/utc/app-manager/res/wearable/org.tizen.multiresolutionicon-1.0.0-i386.tpk b/src/utc/app-manager/res/wearable/org.tizen.multiresolutionicon-1.0.0-i386.tpk new file mode 100644 index 000000000..498110421 Binary files /dev/null and b/src/utc/app-manager/res/wearable/org.tizen.multiresolutionicon-1.0.0-i386.tpk differ diff --git a/src/utc/app-manager/res/wearable/org.tizen.multiresolutionicon-1.0.0-x86_64.tpk b/src/utc/app-manager/res/wearable/org.tizen.multiresolutionicon-1.0.0-x86_64.tpk new file mode 100644 index 000000000..5fb30febd Binary files /dev/null and b/src/utc/app-manager/res/wearable/org.tizen.multiresolutionicon-1.0.0-x86_64.tpk differ diff --git a/src/utc/app-manager/tct-app-manager-core_mobile.h b/src/utc/app-manager/tct-app-manager-core_mobile.h index 870ef005c..8c1638913 100755 --- a/src/utc/app-manager/tct-app-manager-core_mobile.h +++ b/src/utc/app-manager/tct-app-manager-core_mobile.h @@ -163,7 +163,8 @@ extern int utc_app_info_is_onboot_p(void); extern int utc_app_info_is_onboot_n(void); extern int utc_app_info_is_preload_p(void); extern int utc_app_info_is_preload_n(void); - +extern int utc_app_multi_resolution_icon_test_mobile_p(void); +extern int utc_app_multi_resolution_icon_test_mobile_n(void); testcase tc_array[] = { {"utc_app_manager_app_context_clone_p", utc_app_manager_app_context_clone_p, utc_app_manager_startup, utc_app_manager_cleanup}, @@ -307,6 +308,8 @@ testcase tc_array[] = { {"utc_app_info_is_onboot_n", utc_app_info_is_onboot_n, utc_app_manager_startup, utc_app_manager_cleanup}, {"utc_app_info_is_preload_p", utc_app_info_is_preload_p, utc_app_manager_startup, utc_app_manager_cleanup}, {"utc_app_info_is_preload_n", utc_app_info_is_preload_n, utc_app_manager_startup, utc_app_manager_cleanup}, + {"utc_app_multi_resolution_icon_test_mobile_p", utc_app_multi_resolution_icon_test_mobile_p, NULL, NULL}, + {"utc_app_multi_resolution_icon_test_mobile_n", utc_app_multi_resolution_icon_test_mobile_n, NULL, NULL}, {NULL, NULL} }; diff --git a/src/utc/app-manager/tct-app-manager-core_wearable.h b/src/utc/app-manager/tct-app-manager-core_wearable.h index 8667877fc..42639d869 100755 --- a/src/utc/app-manager/tct-app-manager-core_wearable.h +++ b/src/utc/app-manager/tct-app-manager-core_wearable.h @@ -163,6 +163,8 @@ extern int utc_app_info_is_onboot_p(void); extern int utc_app_info_is_onboot_n(void); extern int utc_app_info_is_preload_p(void); extern int utc_app_info_is_preload_n(void); +extern int utc_app_multi_resolution_icon_test_wearable_p(void); +extern int utc_app_multi_resolution_icon_test_wearable_n(void); testcase tc_array[] = { {"utc_app_manager_app_context_clone_p", utc_app_manager_app_context_clone_p, utc_app_manager_startup, utc_app_manager_cleanup}, @@ -306,6 +308,8 @@ testcase tc_array[] = { {"utc_app_info_is_onboot_n", utc_app_info_is_onboot_n, utc_app_manager_startup, utc_app_manager_cleanup}, {"utc_app_info_is_preload_p", utc_app_info_is_preload_p, utc_app_manager_startup, utc_app_manager_cleanup}, {"utc_app_info_is_preload_n", utc_app_info_is_preload_n, utc_app_manager_startup, utc_app_manager_cleanup}, + {"utc_app_multi_resolution_icon_test_wearable_p", utc_app_multi_resolution_icon_test_wearable_p, NULL, NULL}, + {"utc_app_multi_resolution_icon_test_wearable_n", utc_app_multi_resolution_icon_test_wearable_n, NULL, NULL}, {NULL, NULL} }; diff --git a/src/utc/app-manager/utc-app-manager.c b/src/utc/app-manager/utc-app-manager.c index 38f23ef22..aa6115e3a 100755 --- a/src/utc/app-manager/utc-app-manager.c +++ b/src/utc/app-manager/utc-app-manager.c @@ -26,6 +26,8 @@ #define TEST_APPID "org.tizen.helloworld" #define TEST_APPID2 "org.tizen.helloworld2" +#define TEST_MULTIRES_ICON_APPID "org.tizen.multiresolutionicon" + static app_context_h app_context = NULL; @@ -3142,3 +3144,119 @@ int utc_app_info_is_preload_n(void) return 0; } + +/** + * @testcase utc_app_multi_resolution_icon_test_mobile_p + * @since_tizen 3.0 + * @description Checks whether icon path is returned properly for device's resolution. + * @scenario Call app_info handle for TEST_APPID_MULTI_RESOLUTION and get icon path.\n + * Check whether result contains proper value for mobile's resolution. + */ +int utc_app_multi_resolution_icon_test_mobile_p(void) +{ + int ret = APP_MANAGER_ERROR_NONE; + char *path = NULL; + app_info_h app_info = NULL; + static const char mobile_iconname_hdpi[] = "hdpi_mobile"; + char *tmp_ptr = NULL; + + ret = app_manager_get_app_info(TEST_MULTIRES_ICON_APPID, &app_info); + assert_eq_with_exit(ret, APP_MANAGER_ERROR_NONE); + + ret = app_info_get_icon(app_info, &path); + + tmp_ptr = strstr(path, mobile_iconname_hdpi); + free(path); + app_info_destroy(app_info); + assert_neq_with_exit(tmp_ptr, NULL); + normal_exit(0); + + return 0; +} + +/** + * @testcase utc_app_multi_resolution_icon_test_mobile_n + * @since_tizen 3.0 + * @description If icon path does not contain proper value, func has to return an error. + * @scenario Call app_info handle for TEST_APPID_MULTI_RESOLUTION and get icon path and compare it with wrong value.\n + * Check whether result contains wrong value for mobile's resolution. + */ +int utc_app_multi_resolution_icon_test_mobile_n(void) +{ + int ret = APP_MANAGER_ERROR_NONE; + char *path = NULL; + app_info_h app_info = NULL; + static const char mobile_iconname_hdpi[] = "hdpi_wearable"; + char *tmp_ptr = NULL; + + ret = app_manager_get_app_info(TEST_MULTIRES_ICON_APPID, &app_info); + assert_eq_with_exit(ret, APP_MANAGER_ERROR_NONE); + + ret = app_info_get_icon(app_info, &path); + + tmp_ptr = strstr(path, mobile_iconname_hdpi); + free(path); + app_info_destroy(app_info); + assert_eq_with_exit(tmp_ptr, NULL); + normal_exit(0); + + return 0; +} + +/** + * @testcase utc_app_multi_resolution_icon_test_wearable_p + * @since_tizen 3.0 + * @description Checks whether icon path is returned properly for device's resolution. + * @scenario Call app_info handle for TEST_APPID_MULTI_RESOLUTION and get icon path.\n + * Check whether result contains proper value for wearable device's resolution. + */ +int utc_app_multi_resolution_icon_test_wearable_p(void) +{ + int ret = APP_MANAGER_ERROR_NONE; + char *path = NULL; + app_info_h app_info = NULL; + static const char wearable_iconname_mdpi[] = "mdpi_wearable"; + char *tmp_ptr = NULL; + + ret = app_manager_get_app_info(TEST_MULTIRES_ICON_APPID, &app_info); + assert_eq_with_exit(ret, APP_MANAGER_ERROR_NONE); + + ret = app_info_get_icon(app_info, &path); + + tmp_ptr = strstr(path, wearable_iconname_mdpi); + free(path); + app_info_destroy(app_info); + assert_neq_with_exit(tmp_ptr, NULL); + normal_exit(0); + + return 0; +} + +/** + * @testcase utc_app_multi_resolution_icon_test_wearable_n + * @since_tizen 3.0 + * @description If icon path does not contain proper value, func has to return an error. + * @scenario Call app_info handle for TEST_APPID_MULTI_RESOLUTION and get icon path and compare it with wrong value.\n + * Check whether result contains wrong value for wearable's resolution. + */ +int utc_app_multi_resolution_icon_test_wearable_n(void) +{ + int ret = APP_MANAGER_ERROR_NONE; + char *path = NULL; + app_info_h app_info = NULL; + static const char wearable_iconname_mdpi[] = "mdpi_mobile"; + char *tmp_ptr = NULL; + + ret = app_manager_get_app_info(TEST_MULTIRES_ICON_APPID, &app_info); + assert_eq_with_exit(ret, APP_MANAGER_ERROR_NONE); + + ret = app_info_get_icon(app_info, &path); + + tmp_ptr = strstr(path, wearable_iconname_mdpi); + free(path); + app_info_destroy(app_info); + assert_eq_with_exit(tmp_ptr, NULL); + normal_exit(0); + + return 0; +}