[UTC][app-manager][Non-ACR][Add TC to check multi-resolution icon feature]
authorJunghyun Yeon <jungh.yeon@samsung.com>
Wed, 7 Dec 2016 11:09:22 +0000 (20:09 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Fri, 9 Dec 2016 08:22:10 +0000 (00:22 -0800)
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
Change-Id: Ibd3bff76e67dfc895b0f41a3efceedd39e5e146d

src/utc/app-manager/res/mobile/org.tizen.multiresolutionicon-1.0.0-aarch64.tpk [new file with mode: 0644]
src/utc/app-manager/res/mobile/org.tizen.multiresolutionicon-1.0.0-arm.tpk [new file with mode: 0644]
src/utc/app-manager/res/mobile/org.tizen.multiresolutionicon-1.0.0-i386.tpk [new file with mode: 0644]
src/utc/app-manager/res/mobile/org.tizen.multiresolutionicon-1.0.0-x86_64.tpk [new file with mode: 0644]
src/utc/app-manager/res/wearable/org.tizen.multiresolutionicon-1.0.0-aarch64.tpk [new file with mode: 0644]
src/utc/app-manager/res/wearable/org.tizen.multiresolutionicon-1.0.0-arm.tpk [new file with mode: 0644]
src/utc/app-manager/res/wearable/org.tizen.multiresolutionicon-1.0.0-i386.tpk [new file with mode: 0644]
src/utc/app-manager/res/wearable/org.tizen.multiresolutionicon-1.0.0-x86_64.tpk [new file with mode: 0644]
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

diff --git a/src/utc/app-manager/res/mobile/org.tizen.multiresolutionicon-1.0.0-aarch64.tpk b/src/utc/app-manager/res/mobile/org.tizen.multiresolutionicon-1.0.0-aarch64.tpk
new file mode 100644 (file)
index 0000000..f93b46b
Binary files /dev/null and b/src/utc/app-manager/res/mobile/org.tizen.multiresolutionicon-1.0.0-aarch64.tpk differ
diff --git a/src/utc/app-manager/res/mobile/org.tizen.multiresolutionicon-1.0.0-arm.tpk b/src/utc/app-manager/res/mobile/org.tizen.multiresolutionicon-1.0.0-arm.tpk
new file mode 100644 (file)
index 0000000..580a493
Binary files /dev/null and b/src/utc/app-manager/res/mobile/org.tizen.multiresolutionicon-1.0.0-arm.tpk differ
diff --git a/src/utc/app-manager/res/mobile/org.tizen.multiresolutionicon-1.0.0-i386.tpk b/src/utc/app-manager/res/mobile/org.tizen.multiresolutionicon-1.0.0-i386.tpk
new file mode 100644 (file)
index 0000000..4981104
Binary files /dev/null and b/src/utc/app-manager/res/mobile/org.tizen.multiresolutionicon-1.0.0-i386.tpk differ
diff --git a/src/utc/app-manager/res/mobile/org.tizen.multiresolutionicon-1.0.0-x86_64.tpk b/src/utc/app-manager/res/mobile/org.tizen.multiresolutionicon-1.0.0-x86_64.tpk
new file mode 100644 (file)
index 0000000..5fb30fe
Binary files /dev/null and b/src/utc/app-manager/res/mobile/org.tizen.multiresolutionicon-1.0.0-x86_64.tpk differ
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 (file)
index 0000000..f93b46b
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 (file)
index 0000000..580a493
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 (file)
index 0000000..4981104
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 (file)
index 0000000..5fb30fe
Binary files /dev/null and b/src/utc/app-manager/res/wearable/org.tizen.multiresolutionicon-1.0.0-x86_64.tpk differ
index 870ef005ce525e2fc52aa14c7ddc748b8b01ee2a..8c1638913d06aeec6b6484f81ad2b4ec8d908e80 100755 (executable)
@@ -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}
 };
 
index 8667877fcfc68ea95e06010b0e2b76bce4d22985..42639d86979943f32de5fb38050bebdca2416999 100755 (executable)
@@ -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}
 };
 
index 38f23ef22a23d5d5b1481887dae9ed468a89052f..aa6115e3a0ad613c080453288e2db58cca5a6bf6 100755 (executable)
@@ -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;
+}