From 0a933d7d8561648d26238f4fa5b5d5398b0865c8 Mon Sep 17 00:00:00 2001 From: hj kim Date: Fri, 27 Apr 2018 17:30:41 +0900 Subject: Add test case for APP_CONTROL_OPERATION_MEDIA_CONTROLLER Change-Id: I77474a80eb41f5c4181b7684baa0d2ee9a1d3c38 --- packaging/capi-media-controller.spec | 1 + test/client_test/CMakeLists.txt | 2 +- test/client_test/media_controller_client_test.c | 42 +++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/packaging/capi-media-controller.spec b/packaging/capi-media-controller.spec index fe48134..7eca7f9 100755 --- a/packaging/capi-media-controller.spec +++ b/packaging/capi-media-controller.spec @@ -22,6 +22,7 @@ BuildRequires: pkgconfig(libsystemd-login) BuildRequires: pkgconfig(libtzplatform-config) BuildRequires: pkgconfig(cynara-client) BuildRequires: pkgconfig(cynara-session) +BuildRequires: pkgconfig(capi-appfw-app-control) %define upgrade_script_path /usr/share/upgrade/scripts diff --git a/test/client_test/CMakeLists.txt b/test/client_test/CMakeLists.txt index 938cd60..139494a 100755 --- a/test/client_test/CMakeLists.txt +++ b/test/client_test/CMakeLists.txt @@ -1,7 +1,7 @@ SET(fw_test "media-controller-client-test") INCLUDE(FindPkgConfig) -pkg_check_modules(${fw_test} REQUIRED glib-2.0) +pkg_check_modules(${fw_test} REQUIRED glib-2.0 capi-appfw-app-control) FOREACH(flag ${${fw_test}_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") diff --git a/test/client_test/media_controller_client_test.c b/test/client_test/media_controller_client_test.c index aaccbdb..b41a24f 100755 --- a/test/client_test/media_controller_client_test.c +++ b/test/client_test/media_controller_client_test.c @@ -22,6 +22,7 @@ #include #include +#include #include #include "media_controller_private.h" @@ -472,7 +473,47 @@ static gboolean _destroy() return TRUE; } +#if 0 +static int _test_app_launch() +{ + int ret = APP_CONTROL_ERROR_NONE; + + app_control_h app_control; + + g_print("== _test_app_launch \n"); + + ret = app_control_create(&app_control); + if (ret != APP_CONTROL_ERROR_NONE) + g_print("Fail to app_control_create \n"); + + ret = app_control_set_operation(app_control, APP_CONTROL_OPERATION_MEDIA_CONTROLLER); + if (ret != APP_CONTROL_ERROR_NONE) + g_print("Fail to app_control_set_operation \n"); + + ret = app_control_add_extra_data(app_control, APP_CONTROL_DATA_TYPE, "server"); //or app_control_add_extra_data(service, APP_CONTROL_DATA_TYPE, "client"); + if (ret != APP_CONTROL_ERROR_NONE) + g_print("Fail to app_control_add_extra_data \n"); + ret = app_control_set_uri(app_control, "test-path"); + if (ret != APP_CONTROL_ERROR_NONE) + g_print("Fail to app_control_set_uri \n"); + + ret = app_control_set_app_id(app_control, "org.example.musicplayerui"); + if (ret != APP_CONTROL_ERROR_NONE) + g_print("Fail to app_control_set_app_id \n"); + + ret = app_control_send_launch_request(app_control, NULL, NULL); + if (ret != APP_CONTROL_ERROR_NONE) + g_print("Fail to app_control_send_launch_request \n"); + + ret = app_control_destroy(app_control); + if (ret != APP_CONTROL_ERROR_NONE) + g_print("Fail to app_control_destroy \n"); + + g_print("== _test_app_launch end \n"); + return 0; +} +#endif /***************************************************************/ /** Testsuite */ /***************************************************************/ @@ -738,6 +779,7 @@ int main(int argc, char **argv) mainloop = g_main_loop_new(NULL, FALSE); + //_test_app_launch(); display_menu(); g_main_loop_run(mainloop); -- cgit v1.2.3