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);
+extern int utc_app_multi_resolution_icon_test_p(void);
+extern int utc_app_multi_resolution_icon_test_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},
+ {"utc_app_multi_resolution_icon_test_p", utc_app_multi_resolution_icon_test_p, NULL, NULL},
+ {"utc_app_multi_resolution_icon_test_n", utc_app_multi_resolution_icon_test_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);
+extern int utc_app_multi_resolution_icon_test_p(void);
+extern int utc_app_multi_resolution_icon_test_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},
+ {"utc_app_multi_resolution_icon_test_p", utc_app_multi_resolution_icon_test_p, NULL, NULL},
+ {"utc_app_multi_resolution_icon_test_n", utc_app_multi_resolution_icon_test_n, NULL, NULL},
{NULL, NULL}
};
#include <app_manager.h>
#include <app_context.h>
#include <app_info.h>
+#include <system_info.h>
#include <stdbool.h>
#include <string.h>
#include <app.h>
}
/**
- * @testcase utc_app_multi_resolution_icon_test_mobile_p
+ * @testcase utc_app_multi_resolution_icon_test_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.
+ * Check whether result contains proper value for test device's resolution.
*/
-int utc_app_multi_resolution_icon_test_mobile_p(void)
+int utc_app_multi_resolution_icon_test_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";
+ static const char ldpi[] = "ldpi";
+ static const char mdpi[] = "mdpi";
+ static const char hdpi[] = "hdpi";
+ static const char xhdpi[] = "xhdpi";
+ static const char xxhdpi[] = "xxhdpi";
+ static const int ldpi_min = 0;
+ static const int ldpi_max = 240;
+ static const int mdpi_min = 241;
+ static const int mdpi_max = 300;
+ static const int hdpi_min = 301;
+ static const int hdpi_max = 380;
+ static const int xhdpi_min = 381;
+ static const int xhdpi_max = 480;
+ static const int xxhdpi_min = 481;
+ static const int xxhdpi_max = 600;
char *tmp_ptr = NULL;
+ int dpi = -1;
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);
+ system_info_get_platform_int("http://tizen.org/feature/screen.dpi", &dpi);
+ assert_neq_with_exit(dpi, -1);
+
+ if (dpi >= ldpi_min && dpi <= ldpi_max)
+ tmp_ptr = strstr(path, ldpi);
+ else if (dpi >= mdpi_min && dpi <= mdpi_max)
+ tmp_ptr = strstr(path, mdpi);
+ else if (dpi >= hdpi_min && dpi <= hdpi_max)
+ tmp_ptr = strstr(path, hdpi);
+ else if (dpi >= xhdpi_min && dpi <= xhdpi_max)
+ tmp_ptr = strstr(path, xhdpi);
+ else if (dpi >= xxhdpi_min && dpi <= xxhdpi_max)
+ tmp_ptr = strstr(path, xxhdpi);
+ else
+ assert_with_exit(false);
+
assert_neq_with_exit(tmp_ptr, NULL);
normal_exit(0);
}
/**
- * @testcase utc_app_multi_resolution_icon_test_mobile_n
+ * @testcase utc_app_multi_resolution_icon_test_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.
+ * Check whether result contains wrong value for test device's resolution.
*/
-int utc_app_multi_resolution_icon_test_mobile_n(void)
+int utc_app_multi_resolution_icon_test_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";
+ static const char ldpi[] = "ldpi";
+ static const char mdpi[] = "mdpi";
+ static const int ldpi_min = 0;
+ static const int ldpi_max = 240;
char *tmp_ptr = NULL;
+ int dpi = -1;
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;
+ system_info_get_platform_int("http://tizen.org/feature/screen.dpi", &dpi);
+ assert_neq_with_exit(dpi, -1);
- 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);
+ if (dpi >= ldpi_max)
+ tmp_ptr = strstr(path, ldpi);
+ else
+ tmp_ptr = strstr(path, mdpi);
- tmp_ptr = strstr(path, wearable_iconname_mdpi);
- free(path);
- app_info_destroy(app_info);
assert_eq_with_exit(tmp_ptr, NULL);
normal_exit(0);