[UTC][application][ACR-1303][Add new testcases for app_control_send_launch_request_as...
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 1 Oct 2018 02:43:12 +0000 (11:43 +0900)
committerHwanKyu Jhun <h.jhun@samsung.com>
Sun, 7 Oct 2018 23:16:37 +0000 (23:16 +0000)
Change-Id: I537cda53991e8d6ba7f2d585a410cb5ca9366976
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/utc/application/public.list
src/utc/application/tct-application-core_mobile.h
src/utc/application/tct-application-core_tizeniot.h
src/utc/application/tct-application-core_wearable.h
src/utc/application/utc_app_control.c

index 8376e8e8e09701fe793b3e145c1a3ece3da6f899..b30c95e08a84e776d7f83eb62fc336f0d5f4e5d2 100755 (executable)
@@ -27,6 +27,7 @@ app_control_set_uri
 app_control_set_launch_mode
 app_control_get_launch_mode
 app_control_enable_app_started_result_event
+app_control_send_launch_request_async
 app_get_cache_path
 app_get_data_path
 app_get_device_orientation
index 6ef9b0c75a4c4d430205885e39c99df16f799078..33bde6f7594f1efbac2b007da40c0e727bda7953 100755 (executable)
@@ -269,6 +269,14 @@ extern int utc_application_app_event_publish_trusted_app_event_n4(void);
 extern int utc_application_app_event_publish_trusted_app_event_n5(void);
 extern int utc_application_app_event_keep_last_event_data_p(void);
 extern int utc_application_app_event_keep_last_event_data_n(void);
+extern int utc_application_app_control_send_launch_request_async_p1(void);
+extern int utc_application_app_control_send_launch_request_async_p2(void);
+extern int utc_application_app_control_send_launch_request_async_p3(void);
+extern int utc_application_app_control_send_launch_request_async_p4(void);
+extern int utc_application_app_control_send_launch_request_async_n1(void);
+extern int utc_application_app_control_send_launch_request_async_n2(void);
+extern int utc_application_app_control_send_launch_request_async_n3(void);
+extern int utc_application_app_control_send_launch_request_async_n4(void);
 
 testcase tc_array[] = {
        {"utc_application_app_get_name_p",utc_application_app_get_name_p,NULL,NULL},
@@ -460,6 +468,14 @@ testcase tc_array[] = {
        {"utc_application_app_control_get_launch_mode_n1",utc_application_app_control_get_launch_mode_n1,utc_application_app_control_startup,NULL},
        {"utc_application_app_control_enable_app_started_result_event_p1",utc_application_app_control_enable_app_started_result_event_p1,utc_application_app_control_startup,NULL},
        {"utc_application_app_control_enable_app_started_result_event_n1",utc_application_app_control_enable_app_started_result_event_n1,utc_application_app_control_startup,NULL},
+       {"utc_application_app_control_send_launch_request_async_p1", utc_application_app_control_send_launch_request_async_p1, NULL, NULL},
+       {"utc_application_app_control_send_launch_request_async_p2", utc_application_app_control_send_launch_request_async_p2, NULL, NULL},
+       {"utc_application_app_control_send_launch_request_async_p3", utc_application_app_control_send_launch_request_async_p3, NULL, NULL},
+       {"utc_application_app_control_send_launch_request_async_p4", utc_application_app_control_send_launch_request_async_p4, NULL, NULL},
+       {"utc_application_app_control_send_launch_request_async_n1", utc_application_app_control_send_launch_request_async_n1, NULL, NULL},
+       {"utc_application_app_control_send_launch_request_async_n2", utc_application_app_control_send_launch_request_async_n2, NULL, NULL},
+       {"utc_application_app_control_send_launch_request_async_n3", utc_application_app_control_send_launch_request_async_n3, NULL, NULL},
+       {"utc_application_app_control_send_launch_request_async_n4", utc_application_app_control_send_launch_request_async_n4, NULL, NULL},
        {"utc_application_app_resource_manager_get_p1",utc_application_app_resource_manager_get_p1,utc_application_app_resource_manager_startup,utc_application_app_resource_manager_cleanup},
        {"utc_application_app_resource_manager_get_p2",utc_application_app_resource_manager_get_p2,utc_application_app_resource_manager_startup,utc_application_app_resource_manager_cleanup},
        {"utc_application_app_resource_manager_get_p3",utc_application_app_resource_manager_get_p3,utc_application_app_resource_manager_startup,utc_application_app_resource_manager_cleanup},
index 6ef9b0c75a4c4d430205885e39c99df16f799078..33bde6f7594f1efbac2b007da40c0e727bda7953 100755 (executable)
@@ -269,6 +269,14 @@ extern int utc_application_app_event_publish_trusted_app_event_n4(void);
 extern int utc_application_app_event_publish_trusted_app_event_n5(void);
 extern int utc_application_app_event_keep_last_event_data_p(void);
 extern int utc_application_app_event_keep_last_event_data_n(void);
+extern int utc_application_app_control_send_launch_request_async_p1(void);
+extern int utc_application_app_control_send_launch_request_async_p2(void);
+extern int utc_application_app_control_send_launch_request_async_p3(void);
+extern int utc_application_app_control_send_launch_request_async_p4(void);
+extern int utc_application_app_control_send_launch_request_async_n1(void);
+extern int utc_application_app_control_send_launch_request_async_n2(void);
+extern int utc_application_app_control_send_launch_request_async_n3(void);
+extern int utc_application_app_control_send_launch_request_async_n4(void);
 
 testcase tc_array[] = {
        {"utc_application_app_get_name_p",utc_application_app_get_name_p,NULL,NULL},
@@ -460,6 +468,14 @@ testcase tc_array[] = {
        {"utc_application_app_control_get_launch_mode_n1",utc_application_app_control_get_launch_mode_n1,utc_application_app_control_startup,NULL},
        {"utc_application_app_control_enable_app_started_result_event_p1",utc_application_app_control_enable_app_started_result_event_p1,utc_application_app_control_startup,NULL},
        {"utc_application_app_control_enable_app_started_result_event_n1",utc_application_app_control_enable_app_started_result_event_n1,utc_application_app_control_startup,NULL},
+       {"utc_application_app_control_send_launch_request_async_p1", utc_application_app_control_send_launch_request_async_p1, NULL, NULL},
+       {"utc_application_app_control_send_launch_request_async_p2", utc_application_app_control_send_launch_request_async_p2, NULL, NULL},
+       {"utc_application_app_control_send_launch_request_async_p3", utc_application_app_control_send_launch_request_async_p3, NULL, NULL},
+       {"utc_application_app_control_send_launch_request_async_p4", utc_application_app_control_send_launch_request_async_p4, NULL, NULL},
+       {"utc_application_app_control_send_launch_request_async_n1", utc_application_app_control_send_launch_request_async_n1, NULL, NULL},
+       {"utc_application_app_control_send_launch_request_async_n2", utc_application_app_control_send_launch_request_async_n2, NULL, NULL},
+       {"utc_application_app_control_send_launch_request_async_n3", utc_application_app_control_send_launch_request_async_n3, NULL, NULL},
+       {"utc_application_app_control_send_launch_request_async_n4", utc_application_app_control_send_launch_request_async_n4, NULL, NULL},
        {"utc_application_app_resource_manager_get_p1",utc_application_app_resource_manager_get_p1,utc_application_app_resource_manager_startup,utc_application_app_resource_manager_cleanup},
        {"utc_application_app_resource_manager_get_p2",utc_application_app_resource_manager_get_p2,utc_application_app_resource_manager_startup,utc_application_app_resource_manager_cleanup},
        {"utc_application_app_resource_manager_get_p3",utc_application_app_resource_manager_get_p3,utc_application_app_resource_manager_startup,utc_application_app_resource_manager_cleanup},
index 6ef9b0c75a4c4d430205885e39c99df16f799078..33bde6f7594f1efbac2b007da40c0e727bda7953 100755 (executable)
@@ -269,6 +269,14 @@ extern int utc_application_app_event_publish_trusted_app_event_n4(void);
 extern int utc_application_app_event_publish_trusted_app_event_n5(void);
 extern int utc_application_app_event_keep_last_event_data_p(void);
 extern int utc_application_app_event_keep_last_event_data_n(void);
+extern int utc_application_app_control_send_launch_request_async_p1(void);
+extern int utc_application_app_control_send_launch_request_async_p2(void);
+extern int utc_application_app_control_send_launch_request_async_p3(void);
+extern int utc_application_app_control_send_launch_request_async_p4(void);
+extern int utc_application_app_control_send_launch_request_async_n1(void);
+extern int utc_application_app_control_send_launch_request_async_n2(void);
+extern int utc_application_app_control_send_launch_request_async_n3(void);
+extern int utc_application_app_control_send_launch_request_async_n4(void);
 
 testcase tc_array[] = {
        {"utc_application_app_get_name_p",utc_application_app_get_name_p,NULL,NULL},
@@ -460,6 +468,14 @@ testcase tc_array[] = {
        {"utc_application_app_control_get_launch_mode_n1",utc_application_app_control_get_launch_mode_n1,utc_application_app_control_startup,NULL},
        {"utc_application_app_control_enable_app_started_result_event_p1",utc_application_app_control_enable_app_started_result_event_p1,utc_application_app_control_startup,NULL},
        {"utc_application_app_control_enable_app_started_result_event_n1",utc_application_app_control_enable_app_started_result_event_n1,utc_application_app_control_startup,NULL},
+       {"utc_application_app_control_send_launch_request_async_p1", utc_application_app_control_send_launch_request_async_p1, NULL, NULL},
+       {"utc_application_app_control_send_launch_request_async_p2", utc_application_app_control_send_launch_request_async_p2, NULL, NULL},
+       {"utc_application_app_control_send_launch_request_async_p3", utc_application_app_control_send_launch_request_async_p3, NULL, NULL},
+       {"utc_application_app_control_send_launch_request_async_p4", utc_application_app_control_send_launch_request_async_p4, NULL, NULL},
+       {"utc_application_app_control_send_launch_request_async_n1", utc_application_app_control_send_launch_request_async_n1, NULL, NULL},
+       {"utc_application_app_control_send_launch_request_async_n2", utc_application_app_control_send_launch_request_async_n2, NULL, NULL},
+       {"utc_application_app_control_send_launch_request_async_n3", utc_application_app_control_send_launch_request_async_n3, NULL, NULL},
+       {"utc_application_app_control_send_launch_request_async_n4", utc_application_app_control_send_launch_request_async_n4, NULL, NULL},
        {"utc_application_app_resource_manager_get_p1",utc_application_app_resource_manager_get_p1,utc_application_app_resource_manager_startup,utc_application_app_resource_manager_cleanup},
        {"utc_application_app_resource_manager_get_p2",utc_application_app_resource_manager_get_p2,utc_application_app_resource_manager_startup,utc_application_app_resource_manager_cleanup},
        {"utc_application_app_resource_manager_get_p3",utc_application_app_resource_manager_get_p3,utc_application_app_resource_manager_startup,utc_application_app_resource_manager_cleanup},
index dc53208570fc82d229f4ad7471cbe783562a2c37..1c397e91f598d9b255b404aa5c7e0ce3e26982dd 100755 (executable)
 // See the License for the specific language governing permissions and
 // limitations under the License.
 //
-#include "assert.h"
-#include "assert_common.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 #include <app.h>
 #include <bundle.h>
+#include <dlog.h>
+
 #include "tct_app_common.h"
+#include "assert.h"
+#include "assert_common.h"
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+
+#define LOG_TAG "NativeTCT"
 
 /**
  * @function            utc_application_app_control_startup
@@ -3278,3 +3287,414 @@ int utc_application_app_control_enable_app_started_result_event_n1(void)
 
        return 0;
 }
+
+static void __app_control_result_cb(app_control_h request,
+               app_control_error_e result, void *user_data)
+{
+       dlog_print(DLOG_INFO, LOG_TAG, "Result: %d", result);
+       if (result == APP_CONTROL_ERROR_NONE)
+               normal_exit(0);
+       else
+               normal_exit(1);
+}
+
+/**
+ * @testcase            utc_application_app_control_send_launch_request_async_p1
+ * @since_tizen         5.0
+ * @type                Positive
+ * @description         Sends the launch request asynchronously.
+ * @scenario            Sends the launch request asynchronously.
+ */
+int utc_application_app_control_send_launch_request_async_p1(void)
+{
+       app_control_h handle;
+       int ret;
+
+       ret = app_control_create(&handle);
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create app control handle");
+               normal_exit(1);
+               return -1;
+       }
+
+       ret = app_control_set_operation(handle,
+                       APP_CONTROL_OPERATION_DEFAULT);
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "Failed to set operation");
+               normal_exit(1);
+               goto end;
+       }
+
+       ret = app_control_set_app_id(handle, "org.tizen.helloworld");
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "Failed to set application ID");
+               normal_exit(1);
+               goto end;
+       }
+
+       ret = app_control_send_launch_request_async(handle, __app_control_result_cb,
+                       NULL, NULL);
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "Failed to send launch request async");
+               normal_exit(1);
+       }
+
+end:
+       app_control_destroy(handle);
+
+       return ret;
+}
+
+
+/**
+ * @testcase            utc_application_app_control_send_launch_request_async_p2
+ * @since_tizen         5.0
+ * @type                Positive
+ * @description         Sends the launch request asynchronously.
+ * @scenario            Sends the launch request asynchronously with the reply callback.
+ */
+int utc_application_app_control_send_launch_request_async_p2(void)
+{
+       app_control_h handle;
+       int ret;
+
+       ret = app_control_create(&handle);
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create app control handle");
+               normal_exit(1);
+               return -1;
+       }
+
+       ret = app_control_set_operation(handle,
+                       APP_CONTROL_OPERATION_DEFAULT);
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "Failed to set operation");
+               normal_exit(1);
+               goto end;
+       }
+
+       ret = app_control_set_app_id(handle, "org.tizen.helloworld");
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "Failed to set application ID");
+               normal_exit(1);
+               goto end;
+       }
+
+       ret = app_control_send_launch_request_async(handle, __app_control_result_cb,
+                       dts_app_control_reply_cb, NULL);
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "Failed to send launch request async");
+               normal_exit(1);
+       }
+
+end:
+       app_control_destroy(handle);
+
+       return ret;
+}
+
+/**
+ * @testcase            utc_application_app_control_send_launch_request_async_p3
+ * @since_tizen         5.0
+ * @type                Positive
+ * @description         Sends the launch request asynchronously..
+ * @scenario            Sets the operation, the mime and the appid,
+ *                      and then sends the launch request asynchronously.
+ */
+int utc_application_app_control_send_launch_request_async_p3(void)
+{
+       app_control_h handle;
+       int ret;
+
+       ret = app_control_create(&handle);
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create app control handle");
+               normal_exit(1);
+               return -1;
+       }
+
+       ret = app_control_set_operation(handle,
+                       APP_CONTROL_OPERATION_DEFAULT);
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "Failed to set operation");
+               normal_exit(1);
+               goto end;
+       }
+
+       ret = app_control_set_mime(handle, "type/custom");
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "Failed to set MIME-Type");
+               normal_exit(1);
+               goto end;
+       }
+
+       ret = app_control_set_app_id(handle, "org.tizen.helloworld");
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "Failed to set application ID");
+               normal_exit(1);
+               goto end;
+       }
+
+       ret = app_control_send_launch_request_async(handle, __app_control_result_cb,
+                       NULL, NULL);
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "Failed to send launch request async");
+               normal_exit(1);
+       }
+
+end:
+       app_control_destroy(handle);
+
+       return ret;
+}
+
+/**
+ * @testcase            utc_application_app_control_send_launch_request_async_p4
+ * @since_tizen         5.0
+ * @type                Positive
+ * @description         Sends the launch request asynchronously.
+ * @scenario            Sets the operation, the appid, and then sends the
+ *                      launch request asynchronously. This target application requires
+ *                      privilege(http://tizen.org/privilege/alarm.get) to
+ *                      send app_control.
+ */
+int utc_application_app_control_send_launch_request_async_p4(void)
+{
+       app_control_h handle;
+       int ret;
+
+       ret = app_control_create(&handle);
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create app control handle");
+               normal_exit(1);
+               return -1;
+       }
+
+       ret = app_control_set_operation(handle,
+                       APP_CONTROL_OPERATION_DEFAULT);
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "Failed to set operation");
+               normal_exit(1);
+               goto end;
+       }
+
+       ret = app_control_set_app_id(handle, "org.example.appcontrolprivilegetest");
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "Failed to set application ID");
+               normal_exit(1);
+               goto end;
+       }
+
+       ret = app_control_send_launch_request_async(handle, __app_control_result_cb,
+                       NULL, NULL);
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "Failed to send launch request async");
+               normal_exit(1);
+       }
+
+end:
+       app_control_destroy(handle);
+
+       return ret;
+}
+
+/**
+ * @testcase            utc_application_app_control_send_launch_request_async_n1
+ * @since_tizen         5.0
+ * @type                Negative
+ * @description         Sends the launch request asynchronously.
+ * @scenario            Calls the app_control_send_launch_request() with the invalid parameters.
+ */
+int utc_application_app_control_send_launch_request_async_n1(void)
+{
+       app_control_h handle;
+       int ret;
+
+       ret = app_control_create(&handle);
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create app control handle");
+               normal_exit(1);
+               return -1;
+       }
+
+       ret = app_control_send_launch_request_async(NULL, NULL, NULL, NULL);
+       if (ret != APP_CONTROL_ERROR_INVALID_PARAMETER) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "error: %d", ret);
+               normal_exit(1);
+               goto end;
+       }
+
+       ret = app_control_send_launch_request_async(handle, NULL, NULL, NULL);
+       if (ret != APP_CONTROL_ERROR_INVALID_PARAMETER) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "error: %d", ret);
+               normal_exit(1);
+               goto end;
+       }
+
+       normal_exit(0);
+
+end:
+       app_control_destroy(handle);
+
+       return 0;
+}
+
+/**
+ * @testcase           utc_application_app_control_send_launch_request_async_n2
+ * @since_tizen                5.0
+ * @type                Negative
+ * @description         Sends the launch request asynchronously.
+ * @scenario            Sends the launch request without the given appid.
+ *                      If the operation is APP_CONTROL_OPERATION_DEFAULT,
+ *                      the app_control requires the appid for sending the launch request asynchronously.
+ */
+int utc_application_app_control_send_launch_request_async_n2(void)
+{
+       app_control_h handle;
+       int ret;
+
+       ret = app_control_create(&handle);
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create app control handle");
+               normal_exit(1);
+               return -1;
+       }
+
+       ret = app_control_set_operation(handle,
+                       APP_CONTROL_OPERATION_DEFAULT);
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "Failed to set operation");
+               normal_exit(1);
+               goto end;
+       }
+
+       ret = app_control_send_launch_request_async(handle, __app_control_result_cb,
+                       NULL, NULL);
+       if (ret != APP_CONTROL_ERROR_APP_NOT_FOUND) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "error: %d", ret);
+               normal_exit(1);
+       }
+       normal_exit(0);
+
+end:
+       app_control_destroy(handle);
+
+       return 0;
+}
+
+static void __app_control_result_cb_n3(app_control_h request,
+               app_control_error_e result, void *user_data)
+{
+       dlog_print(DLOG_INFO, LOG_TAG, "Result: %d", result);
+       if (result == APP_CONTROL_ERROR_APP_NOT_FOUND)
+               normal_exit(0);
+       else
+               normal_exit(1);
+}
+
+/**
+ * @testcase            utc_application_app_control_send_launch_request_async_n3
+ * @since_tizen         5.0
+ * @type                Negative
+ * @description         Sends the launch request asynchronously.
+ * @scenario            Sends the launch request asynchronously with the invalid appid.
+ */
+int utc_application_app_control_send_launch_request_async_n3(void)
+{
+       app_control_h handle;
+       int ret;
+
+       ret = app_control_create(&handle);
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create app control handle");
+               normal_exit(1);
+               return -1;
+       }
+
+       ret = app_control_set_operation(handle,
+                       APP_CONTROL_OPERATION_DEFAULT);
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "Failed to set operation");
+               normal_exit(1);
+               goto end;
+       }
+
+       ret = app_control_set_app_id(handle, "org.tizen.hellohelloworld");
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "Failed to set application ID");
+               normal_exit(1);
+               goto end;
+       }
+
+       ret = app_control_send_launch_request_async(handle,
+                       __app_control_result_cb_n3,
+                       NULL, NULL);
+       if (ret != APP_CONTROL_ERROR_APP_NOT_FOUND) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "error: %d", ret);
+               normal_exit(1);
+       }
+
+end:
+       app_control_destroy(handle);
+
+       return 0;
+}
+
+static void __app_control_result_cb_n4(app_control_h request,
+               app_control_error_e result, void *user_data)
+{
+       dlog_print(DLOG_INFO, LOG_TAG, "Result: %d", result);
+       if (result == APP_CONTROL_ERROR_PERMISSION_DENIED)
+               normal_exit(0);
+       else
+               normal_exit(1);
+}
+
+/**
+ * @testcase            utc_application_app_control_send_launch_request_async_n4
+ * @since_tizen         5.0
+ * @type                Negative
+ * @description         Sends the launch request asynchronously.
+ * @scenario            Sends the launch request asynchronously to application which requires
+ *                      privilege(http://tizen.org/privilege/notification).
+ */
+int utc_application_app_control_send_launch_request_async_n4(void)
+{
+       app_control_h handle;
+       int ret;
+
+       ret = app_control_create(&handle);
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "Failed to create app control handle");
+               normal_exit(1);
+               return -1;
+       }
+
+       ret = app_control_set_operation(handle,
+                       APP_CONTROL_OPERATION_DEFAULT);
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "Failed to set operation");
+               normal_exit(1);
+               goto end;
+       }
+
+       ret = app_control_set_app_id(handle, "org.example.appcontrolprivilegetest2");
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "Failed to set application ID");
+               normal_exit(1);
+               goto end;
+       }
+
+       ret = app_control_send_launch_request_async(handle,
+                       __app_control_result_cb_n4,
+                       NULL, NULL);
+       if (ret != APP_CONTROL_ERROR_PERMISSION_DENIED) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "error: %d", ret);
+               normal_exit(1);
+       }
+
+end:
+       app_control_destroy(handle);
+
+       return 0;
+}