}
}
+/**
+* @function application_app_control_result_cb
+* @description callback function for app control result
+* @parameter hRequest : handle for app control request, eResult : result, user_data : user data sent to callback
+* @return false
+*/
+void application_app_control_result_cb(app_control_h hRequest, app_control_error_e eResult, void *user_data)
+{
+ if(strncmp((char *)user_data,(char *)g_pUserData_appControl,strlen(g_pUserData_appControl)) != 0)
+ {
+ g_bUserDataMismatch_appControl = true;
+ }
+
+ g_bAppControlSendLaunchRequest = true;
+ FPRINTF("[Line : %d][%s] app_control_result_callback invoked, error returned = %d\\n", __LINE__, API_NAMESPACE, (int)eResult);
+
+ if (g_pApplicationMainLoop)
+ {
+ g_main_loop_quit(g_pApplicationMainLoop);
+ g_pApplicationMainLoop = NULL;
+ }
+}
+
/**
* @function application_app_control_app_matched_cb
* @description callback function for app control application match
return 0;
}
+//& type: auto
+//& purpose: Launches an application asynchronously
+/**
+* @testcase ITc_application_app_control_send_launch_request_async_p
+* @since_tizen 5.0
+* @author SRID(s.rathi)
+* @reviewer SRID(priya.kohli)
+* @type auto
+* @description Sends a launch request to an application asynchronously
+* @scenario Create AppControl\n
+* Set default operation\n
+* Set application ID\n
+* Launch application asynchronously\n
+* Destroy AppControl
+* @apicovered app_control_create, app_control_set_operation, app_control_set_app_id, app_control_send_launch_request_async, app_control_destroy
+* @passcase When app_control_create, app_control_set_operation, app_control_set_app_id, app_control_send_launch_request_async, app_control_destroy are successful and callback function invoked.
+* @failcase When target API fails or callback function not invoked
+* @precondition None
+* @postcondition None
+*/
+int ITc_application_app_control_send_launch_request_async_p(void)
+{
+ START_TEST;
+ int nRet = APP_CONTROL_ERROR_NONE;
+ int nTimeoutId = 0;
+ app_control_h hAppControl;
+
+ 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_operation(hAppControl, APP_CONTROL_OPERATION_DEFAULT);
+ PRINT_RESULT_CLEANUP(APP_CONTROL_ERROR_NONE, nRet, "app_control_set_operation", AppControlGetError(nRet), app_control_destroy(hAppControl));
+
+ nRet = app_control_set_app_id(hAppControl, TEST_TESTAPPLICATION_APPID);
+ PRINT_RESULT_CLEANUP(APP_CONTROL_ERROR_NONE, nRet, "app_control_set_app_id", AppControlGetError(nRet), app_control_destroy(hAppControl));
+
+ g_bAppControlSendLaunchRequest = false;
+
+ nRet = app_control_send_launch_request_async(hAppControl, application_app_control_result_cb, application_app_control_reply_cb, g_pUserData_appControl);
+ PRINT_RESULT_CLEANUP(APP_CONTROL_ERROR_NONE, nRet, "app_control_send_launch_request_async", AppControlGetError(nRet), app_control_destroy(hAppControl));
+
+ RUN_POLLING_LOOP;
+
+ if(false == g_bAppControlSendLaunchRequest)
+ {
+ FPRINTF("[Line : %d][%s] Callback not invoked\\n", __LINE__, API_NAMESPACE);
+ app_control_destroy(hAppControl);
+ return 1;
+ }
+
+ if(g_bUserDataMismatch_appControl)
+ {
+ FPRINTF("[Line : %d][%s] User data in callback is not same which is passed through caller function.\\n", __LINE__, API_NAMESPACE);
+ app_control_destroy(hAppControl);
+ return 1;
+ }
+
+ nRet = app_control_destroy(hAppControl);
+ PRINT_RESULT_NORETURN(APP_CONTROL_ERROR_NONE, nRet, "app_control_destroy", AppControlGetError(nRet));
+
+ return 0;
+}
+
#ifdef TV //Starts TV
//& type: auto
//& purpose: Test app_control_enable_app_started_result_event
extern void ITs_application_resourceManager_startup(void);
extern void ITs_application_resourceManager_cleanup(void);
+extern int ITc_application_app_control_send_launch_request_async_p(void);
extern int ITc_application_ui_app_add_remove_event_handler_p(void);
extern int ITc_application_app_get_device_orientation_p(void);
extern int ITc_application_app_get_tep_resource_path_p(void);
extern int ITc_application_app_resource_manager_get_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_ui_app_add_remove_event_handler_p",ITc_application_ui_app_add_remove_event_handler_p,ITs_application_startup,ITs_application_cleanup},
{"ITc_application_app_get_device_orientation_p",ITc_application_app_get_device_orientation_p,ITs_application_startup,ITs_application_cleanup},
{"ITc_application_app_get_tep_resource_path_p",ITc_application_app_get_tep_resource_path_p,ITs_application_startup,ITs_application_cleanup},
extern void ITs_application_resourceManager_startup(void);
extern void ITs_application_resourceManager_cleanup(void);
+extern int ITc_application_app_control_send_launch_request_async_p(void);
extern int ITc_application_ui_app_add_remove_event_handler_p(void);
extern int ITc_application_app_get_device_orientation_p(void);
extern int ITc_application_app_get_tep_resource_path_p(void);
extern int ITc_application_app_resource_manager_get_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_ui_app_add_remove_event_handler_p",ITc_application_ui_app_add_remove_event_handler_p,ITs_application_startup,ITs_application_cleanup},
{"ITc_application_app_get_device_orientation_p",ITc_application_app_get_device_orientation_p,ITs_application_startup,ITs_application_cleanup},
{"ITc_application_app_get_tep_resource_path_p",ITc_application_app_get_tep_resource_path_p,ITs_application_startup,ITs_application_cleanup},
extern void ITs_application_resourceManager_startup(void);
extern void ITs_application_resourceManager_cleanup(void);
+extern int ITc_application_app_control_send_launch_request_async_p(void);
extern int ITc_application_ui_app_add_remove_event_handler_p(void);
extern int ITc_application_app_get_device_orientation_p(void);
extern int ITc_application_app_get_tep_resource_path_p(void);
extern int ITc_application_app_resource_manager_get_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_ui_app_add_remove_event_handler_p",ITc_application_ui_app_add_remove_event_handler_p,ITs_application_startup,ITs_application_cleanup},
{"ITc_application_app_get_device_orientation_p",ITc_application_app_get_device_orientation_p,ITs_application_startup,ITs_application_cleanup},
{"ITc_application_app_get_tep_resource_path_p",ITc_application_app_get_tep_resource_path_p,ITs_application_startup,ITs_application_cleanup},