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},
{"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}
};
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},
{"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}
};
#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;
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;
+}