bool g_bCallBackHit_appCommon = false;
bool g_bUserDataMismatch_appCommon = false;
+bool g_bUiGetWinPosition = false;
+
+//Callback
+static void ApplicationWinAppControlLaunchReply_CB(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data)
+{
+ int x, y, w, h;
+ int nRet;
+
+ FPRINTF("[Line : %d][%s] ApplicationWinAppControlLaunchReply_CB Callback invoked.\\n", __LINE__, API_NAMESPACE);
+
+ nRet = app_control_get_window_position(reply, &x, &y, &w, &h);
+ if ( nRet != APP_CONTROL_ERROR_NONE)
+ {
+ PRINT_RESULT_NORETURN(APP_ERROR_NONE, nRet, "app_control_get_window_position", AppGetError(nRet));
+ g_bUiGetWinPosition = true;
+ }
+ if (x != 10 || y != 20 || w != 300 || h != 400)
+ {
+ FPRINTF("[Line : %d][%s] ui app get window position values mismatch\\n", __LINE__, API_NAMESPACE);
+ g_bUiGetWinPosition = true;
+ }
+ return;
+}
+
/**
* @function ITs_application_app_common_startup
}
+ //& type: auto
+//& purpose: Get absolute path to the shated data directory of the application which is used to share data with other applications
+/**
+* @testcase ITc_application_app_get_res_control_allowed_resource_path_p
+* @since_tizen 7.5
+* @author SRID(shobhit.v)
+* @reviewer SRID(utk.tiwari)
+* @type auto
+* @description Gets the window position
+* @scenario Gets the window position
+* @apicovered ui_app_get_window_position
+* @passcase When ui_app_get_window_position is successful and returns APP_ERROR_NONE.
+* @failcase If ui_app_get_window_position fails
+* @precondition None
+* @postcondition None
+*/
+int ITc_application_ui_app_get_window_position_p(void)
+{
+ int nRet = APP_CONTROL_ERROR_NONE;
+ const char *app_id = "org.tizen.windowtest";
+ g_bUiGetWinPosition = false;
+ app_control_h app_control;
+
+ nRet = app_control_create(&app_control);
+ PRINT_RESULT(APP_ERROR_NONE, nRet, "app_control_create", AppGetError(nRet));
+
+ nRet = app_control_set_app_id(app_control, app_id);
+ PRINT_RESULT_CLEANUP(APP_ERROR_NONE, nRet, "app_control_set_app_id", AppGetError(nRet),app_control_destroy(app_control));
+
+ nRet = app_control_set_window_position(app_control, 10, 20, 300, 400);
+ PRINT_RESULT_CLEANUP(APP_ERROR_NONE, nRet, "app_control_set_window_position", AppGetError(nRet),app_control_destroy(app_control));
+
+ nRet = app_control_send_launch_request(app_control, ApplicationWinAppControlLaunchReply_CB, NULL);
+ PRINT_RESULT_CLEANUP(APP_ERROR_NONE, nRet, "app_control_send_launch_request", AppGetError(nRet),app_control_destroy(app_control));
+
+ if (g_bUiGetWinPosition == true)
+ {
+ FPRINTF("[Line : %d][%s] ui_app_get_window_position failed\\n", __LINE__, API_NAMESPACE);
+ return 1;
+ }
+
+ nRet = app_control_destroy(app_control);
+ PRINT_RESULT_NORETURN(APP_ERROR_NONE, nRet, "app_control_destroy", AppGetError(nRet));
+
+ return 0;
+}
+
#ifdef TV //Starts TV
//& type: auto
//& purpose: gets absolute path to application tep resource directory
return 0;
}
+
+//& type: auto
+//& purpose: Set and Get window position
+/**
+* @testcase ITc_application_app_control_set_get_window_position_p
+* @since_tizen 7.5
+* @author SRID(shobhit.v)
+* @reviewer SRID(utk.tiwari)
+* @type auto
+* @description Set and Get window position to app-controland and Get window position
+* @scenario Create AppControl\n
+* Set and Get window position to app-controland and Get window position\n
+* Destroy AppControl
+* @apicovered app_control_create, app_control_destroy, app_control_set_window_position and app_control_get_window_position
+* @passcase When pre condition APIs, app_control_set_window_position and app_control_get_window_positionare successful and set value should match the get value.
+* @failcase If pre condition APIs Or target API fails or value mis-match happens.
+* @precondition None
+* @postcondition None
+*/
+int ITc_application_app_control_set_get_window_position_p(void)
+{
+ START_TEST;
+
+ int nRet = -1;
+ app_control_h hAppControl;
+ int x, y, w, h;
+
+ nRet = app_control_create(&hAppControl);
+ PRINT_RESULT(APP_CONTROL_ERROR_NONE, nRet, "app_control_create", AppControlGetError(nRet));
+ CHECK_HANDLE(hAppControl,"app_control_create");
+
+ nRet = app_control_set_window_position(hAppControl, 10, 10, 300, 400);
+ PRINT_RESULT(APP_CONTROL_ERROR_NONE, nRet, "app_control_set_window_position", AppControlGetError(nRet));
+
+ nRet = app_control_get_window_position(hAppControl, &x, &y, &w, &h);
+ PRINT_RESULT(APP_CONTROL_ERROR_NONE, nRet, "app_control_get_window_position", AppControlGetError(nRet));
+
+ if (x != 10 || y != 10 || w != 300 || h != 400)
+ {
+ FPRINTF("[Line : %d][%s] Set and Get Value Mismatched. Get Values: [%d] [%d] [%d] [%d] \\n", __LINE__, API_NAMESPACE, x, y, w, h);
+ return 1;
+ }
+
+ return 0;
+}
+
/** @} */
/** @} */
extern int ITc_application_app_control_uri_add_get_query_p(void);
extern int ITc_application_app_control_uri_query_foreach_p(void);
extern int ITc_application_app_control_set_get_component_id_p(void);
+extern int ITc_application_app_control_set_get_window_position_p(void);
+extern int ITc_application_ui_app_get_window_position_p(void);
testcase tc_array[] = {
{"ITc_application_app_control_send_launch_request_async_p",ITc_application_app_control_send_launch_request_async_p,ITs_application_startup,ITs_application_cleanup},
{"ITc_application_app_control_uri_get_user_p",ITc_application_app_control_uri_get_user_p,ITc_application_app_control_uri_startup,Itc_application_app_control_uri_cleanup},
{"ITc_application_app_control_uri_add_get_query_p",ITc_application_app_control_uri_add_get_query_p,ITc_application_app_control_uri_startup,Itc_application_app_control_uri_cleanup},
{"ITc_application_app_control_uri_query_foreach_p",ITc_application_app_control_uri_query_foreach_p,ITc_application_app_control_uri_startup,Itc_application_app_control_uri_cleanup},
+ {"ITc_application_app_control_set_get_window_position_p",ITc_application_app_control_set_get_window_position_p,ITs_application_app_control_startup,ITs_application_app_control_cleanup},
+ {"ITc_application_ui_app_get_window_position_p",ITc_application_ui_app_get_window_position_p,ITs_application_app_common_startup,ITs_application_app_common_cleanup},
{NULL, NULL}
};
extern int ITc_application_app_control_set_get_component_id_p(void);
extern int ITc_application_app_get_res_control_allowed_resource_path_p(void);
extern int ITc_application_app_get_res_control_global_resource_path_p(void);
+extern int ITc_application_app_control_set_get_window_position_p(void);
+extern int ITc_application_ui_app_get_window_position_p(void);
testcase tc_array[] = {
{"ITc_application_app_control_send_launch_request_async_p",ITc_application_app_control_send_launch_request_async_p,ITs_application_startup,ITs_application_cleanup},
{"ITc_application_app_control_set_get_operation_p",ITc_application_app_control_set_get_operation_p,ITs_application_app_control_startup,ITs_application_app_control_cleanup},
{"ITc_application_app_control_set_get_app_id_p",ITc_application_app_control_set_get_app_id_p,ITs_application_app_control_startup,ITs_application_app_control_cleanup},
{"ITc_application_app_control_set_get_uri_p",ITc_application_app_control_set_get_uri_p,ITs_application_app_control_startup,ITs_application_app_control_cleanup},
- {"ITc_application_app_control_set_get_component_id_p",ITc_application_app_control_set_get_component_id_p,ITs_application_app_control_startup,ITs_application_app_control_cleanup},
+ {"ITc_application_app_control_set_get_component_id_p",ITc_application_app_control_set_get_component_id_p,ITs_application_app_control_startup,ITs_application_app_control_cleanup},
{"ITc_application_app_control_set_get_mime_p",ITc_application_app_control_set_get_mime_p,ITs_application_app_control_startup,ITs_application_app_control_cleanup},
{"ITc_application_app_control_set_get_category_p",ITc_application_app_control_set_get_category_p,ITs_application_app_control_startup,ITs_application_app_control_cleanup},
{"ITc_application_app_control_add_get_extra_data_p",ITc_application_app_control_add_get_extra_data_p,ITs_application_app_control_startup,ITs_application_app_control_cleanup},
{"ITc_application_app_control_uri_query_foreach_p",ITc_application_app_control_uri_query_foreach_p,ITc_application_app_control_uri_startup,Itc_application_app_control_uri_cleanup},
{"ITc_application_app_get_res_control_allowed_resource_path_p",ITc_application_app_get_res_control_allowed_resource_path_p,ITs_application_app_common_startup,ITs_application_app_common_cleanup},
{"ITc_application_app_get_res_control_global_resource_path_p",ITc_application_app_get_res_control_global_resource_path_p,ITs_application_app_common_startup,ITs_application_app_common_cleanup},
+ {"ITc_application_app_control_set_get_window_position_p",ITc_application_app_control_set_get_window_position_p,ITs_application_app_control_startup,ITs_application_app_control_cleanup},
+ {"ITc_application_ui_app_get_window_position_p",ITc_application_ui_app_get_window_position_p,ITs_application_app_common_startup,ITs_application_app_common_cleanup},
{NULL, NULL}
};
extern int ITc_application_app_control_set_get_component_id_p(void);
extern int ITc_application_app_get_res_control_allowed_resource_path_p(void);
extern int ITc_application_app_get_res_control_global_resource_path_p(void);
+extern int ITc_application_app_control_set_get_window_position_p(void);
+extern int ITc_application_ui_app_get_window_position_p(void);
testcase tc_array[] = {
{"ITc_application_app_control_send_launch_request_async_p",ITc_application_app_control_send_launch_request_async_p,ITs_application_startup,ITs_application_cleanup},
{"ITc_application_app_control_uri_query_foreach_p",ITc_application_app_control_uri_query_foreach_p,ITc_application_app_control_uri_startup,Itc_application_app_control_uri_cleanup},
{"ITc_application_app_get_res_control_allowed_resource_path_p",ITc_application_app_get_res_control_allowed_resource_path_p,ITs_application_app_common_startup,ITs_application_app_common_cleanup},
{"ITc_application_app_get_res_control_global_resource_path_p",ITc_application_app_get_res_control_global_resource_path_p,ITs_application_app_common_startup,ITs_application_app_common_cleanup},
+ {"ITc_application_app_control_set_get_window_position_p",ITc_application_app_control_set_get_window_position_p,ITs_application_app_control_startup,ITs_application_app_control_cleanup},
+ {"ITc_application_ui_app_get_window_position_p",ITc_application_ui_app_get_window_position_p,ITs_application_app_common_startup,ITs_application_app_common_cleanup},
{NULL, NULL}
};