[UTC][app-manager][Non-ACR][Modify multi res icon TC to cover all dpi cases]
authorInkyun Kil <inkyun.kil@samsung.com>
Wed, 21 Dec 2016 05:04:46 +0000 (14:04 +0900)
committerInkyun Kil <inkyun.kil@samsung.com>
Wed, 21 Dec 2016 05:19:23 +0000 (14:19 +0900)
Change-Id: I49210dd47b9b41cc325239d8eff4136c96bf6f94
Signed-off-by: Inkyun Kil <inkyun.kil@samsung.com>
src/utc/app-manager/res/wearable/org.tizen.multiresolutionicon-1.0.0-aarch64.tpk
src/utc/app-manager/res/wearable/org.tizen.multiresolutionicon-1.0.0-arm.tpk
src/utc/app-manager/res/wearable/org.tizen.multiresolutionicon-1.0.0-i386.tpk
src/utc/app-manager/res/wearable/org.tizen.multiresolutionicon-1.0.0-x86_64.tpk
src/utc/app-manager/tct-app-manager-core_mobile.h
src/utc/app-manager/tct-app-manager-core_wearable.h
src/utc/app-manager/utc-app-manager.c

index f93b46b9466bd3c6744d0313cb77fbaba142dc68..8b695b4d886d465c6f746f0ebcd56805c1cabe5c 100644 (file)
Binary files a/src/utc/app-manager/res/wearable/org.tizen.multiresolutionicon-1.0.0-aarch64.tpk and b/src/utc/app-manager/res/wearable/org.tizen.multiresolutionicon-1.0.0-aarch64.tpk differ
index 580a4930120dbc073a6e58602ba7bb30b0371a59..07530b47df941a9a5f89322cd86b15eede10febb 100644 (file)
Binary files a/src/utc/app-manager/res/wearable/org.tizen.multiresolutionicon-1.0.0-arm.tpk and b/src/utc/app-manager/res/wearable/org.tizen.multiresolutionicon-1.0.0-arm.tpk differ
index 49811042180b99b049f298c9e5f143193a134c73..b196b320d28ad4f3c81883b3f10f58300a483ab3 100644 (file)
Binary files a/src/utc/app-manager/res/wearable/org.tizen.multiresolutionicon-1.0.0-i386.tpk and b/src/utc/app-manager/res/wearable/org.tizen.multiresolutionicon-1.0.0-i386.tpk differ
index 5fb30febde2afdbce87fa3abdc40f775ccbca28f..0ce3ec23c9e9fc2cc2a9f23b55ecf0ca69c679dc 100644 (file)
Binary files a/src/utc/app-manager/res/wearable/org.tizen.multiresolutionicon-1.0.0-x86_64.tpk and b/src/utc/app-manager/res/wearable/org.tizen.multiresolutionicon-1.0.0-x86_64.tpk differ
index 8c1638913d06aeec6b6484f81ad2b4ec8d908e80..f0267e769cdaf6b484d893cb9f1f53cdb346233b 100755 (executable)
@@ -163,8 +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);
+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},
@@ -308,8 +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},
+    {"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}
 };
 
index 42639d86979943f32de5fb38050bebdca2416999..f0267e769cdaf6b484d893cb9f1f53cdb346233b 100755 (executable)
@@ -163,8 +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);
+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},
@@ -308,8 +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},
+    {"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}
 };
 
index aa6115e3a0ad613c080453288e2db58cca5a6bf6..af5ca71d3271c38947652c11146a3c6a3a210035 100755 (executable)
@@ -18,6 +18,7 @@
 #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>
@@ -3146,28 +3147,55 @@ int utc_app_info_is_preload_n(void)
 }
 
 /**
- * @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);
 
@@ -3175,86 +3203,36 @@ int utc_app_multi_resolution_icon_test_mobile_p(void)
 }
 
 /**
- * @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);