[CTC][Platform-permission][ACR-669][Added Test cases for New API for media streamer...
authormanoj gupta <manoj.g2@samsung.com>
Mon, 4 Jul 2016 10:56:06 +0000 (16:26 +0530)
committermanoj gupta <manoj.g2@samsung.com>
Mon, 4 Jul 2016 11:28:35 +0000 (16:58 +0530)
Change-Id: Id04009dd5d68132de1039a346f36a250b358c51c
Signed-off-by: manoj gupta <manoj.g2@samsung.com>
packaging/ctc/native-platform-permission-ctc.spec
src/ctc/platform-permission/CMakeLists.txt
src/ctc/platform-permission/CTs-platform-permission-media-streamer.c
src/ctc/platform-permission/tct-platform-permission-native_mobile.h
src/ctc/platform-permission/tct-platform-permission-native_wearable.h

index b3910eb..4c4491c 100755 (executable)
@@ -72,6 +72,7 @@ BuildRequires:        pkgconfig(capi-ui-efl-util)
 BuildRequires: pkgconfig(stt)
 BuildRequires: cmake
 BuildRequires: pkgconfig(capi-network-http)
+BuildRequires: pkgconfig(capi-media-streamer)
 %if %{?DEVICE_BUILD_TYPE_MOBILE:1}0
 BuildRequires:         pkgconfig(capi-messaging-email)
 BuildRequires:  pkgconfig(contacts-service2)
@@ -96,7 +97,6 @@ BuildRequires:        pkgconfig(oauth2)
 BuildRequires: pkgconfig(libcurl)
 BuildRequires: pkgconfig(capi-vpnsvc)
 BuildRequires: pkgconfig(iotcon)
-BuildRequires: pkgconfig(capi-media-streamer)
 BuildRequires: pkgconfig(phonenumber-utils)
 BuildRequires: pkgconfig(capi-network-http)
 %endif
@@ -221,4 +221,4 @@ rm %{INTERNAL_STORAGE_PATH}/Music/TestAudio.mp3
 %files
 %{APP_PATH}%{name}/*
 /usr/share/packages/native-%{MODULE_NAME}-ctc.xml
-/usr/share/license/%{name}
\ No newline at end of file
+/usr/share/license/%{name}
index de25701..3075c1b 100755 (executable)
@@ -94,6 +94,7 @@ SET(TC_SOURCES
        CTs-platform-permission-widget-viewer.c
        CTs-platform-permission-wifi.c
        CTs-platform-permission-http.c
+       CTs-platform-permission-media-streamer.c
 )
 ENDIF()
 
@@ -208,6 +209,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
     alarm-service
     capi-network-bluetooth
     capi-system-info
+    capi-media-streamer
        capi-system-runtime-info
        capi-location-manager
        capi-network-connection
index 5405b77..260a970 100755 (executable)
@@ -236,3 +236,43 @@ int CTc_MediaStreamer_PrivilegeMediaStorage_node_set_param(void)
        return 0;
 }
 
+//& purpose: Checking tizen.org/privilege/mediastorage privilege
+/**
+* @testcase                    CTc_MediaStreamer_PrivilegeMediaStorage_node_set_params
+* @since_tizen                 3.0
+* @author                      SRID(manoj.g2)
+* @reviewer                    SRID(shobhit.v)
+* @type                                auto
+* @description                 Set  media streamer node params
+* @scenario                    media streamer node src create,media_streamer_node_set_params
+* @apicovered                  media_streamer_node_create_src,media_streamer_node_set_params
+* @passcase                    if target privileged API returns TIZEN_ERROR_PERMISSION_DENIED
+* @failcase                    If target privileged API does not return TIZEN_ERROR_PERMISSION_DENIED
+* @precondition                        NA
+* @postcondition               NA
+*/
+int CTc_MediaStreamer_PrivilegeMediaStorage_node_set_params(void)
+{
+       START_TEST;
+       int ret = MEDIA_STREAMER_ERROR_NONE;
+       media_streamer_node_h vid_test = NULL;
+       bundle *param_list = NULL;
+       ret = media_streamer_node_create_src(MEDIA_STREAMER_NODE_SRC_TYPE_VIDEO_TEST, &vid_test);
+       PRINT_RESULT(MEDIA_STREAMER_ERROR_NONE, ret, "media_streamer_node_create_src", MediaStreamerGetError(ret));
+       CHECK_HANDLE(vid_test,"media_streamer_node_create_src");
+
+       ret = media_streamer_node_add(streamer,vid_test);
+       PRINT_RESULT(MEDIA_STREAMER_ERROR_NONE, ret, "media_streamer_node_add", MediaStreamerGetError(ret));
+
+       bundle *params = bundle_create();
+       bundle_add_str(params, "is-live", "true");
+       bundle_add_str(params, "timestamp-offset", "1024");
+       bundle_add_str(params, "xoffset", "150");
+       bundle_add_str(params, "yoffset", "200");
+
+       ret = media_streamer_node_set_params(vid_test, params);
+       PRINT_RESULT_CLEANUP(TIZEN_ERROR_PERMISSION_DENIED, ret, "media_streamer_node_set_params", MediaStreamerGetError(ret),bundle_free(params));
+       bundle_free(params);
+       return 0;
+}
+
index 9d90dba..746d363 100755 (executable)
@@ -125,6 +125,7 @@ extern int CTc_MediaStreamer_PrivilegeMediaStorage_node_create_src(void);
 extern int CTc_MediaStreamer_PrivilegeMediaStorage_node_create_sink(void);
 extern int CTc_MediaStreamer_PrivilegeMediaStorage_node_set_param(void);
 
+extern int CTc_MediaStreamer_PrivilegeMediaStorage_node_set_params(void);
 extern int CTc_Iotcon_PrivilegeNetworkGet_initialize_deinitialize_p(void);
 extern int CTc_AccountManager_PrivilegeAccountReadWrite_query_label_by_locale(void);
 extern int CTc_AccountManager_PrivilegeAccountReadWrite_query_app_id_exist(void);
@@ -671,6 +672,8 @@ testcase tc_array[] = {
     {"CTc_MediaStreamer_PrivilegeMediaStorage_node_create_src",  CTc_MediaStreamer_PrivilegeMediaStorage_node_create_src, CTs_platform_permission_media_streamer_startup,  CTs_platform_permission_media_streamer_cleanup},
     {"CTc_MediaStreamer_PrivilegeMediaStorage_node_create_sink", CTc_MediaStreamer_PrivilegeMediaStorage_node_create_sink, CTs_platform_permission_media_streamer_startup,  CTs_platform_permission_media_streamer_cleanup},
     {"CTc_MediaStreamer_PrivilegeMediaStorage_node_set_param", CTc_MediaStreamer_PrivilegeMediaStorage_node_set_param, CTs_platform_permission_media_streamer_startup,  CTs_platform_permission_media_streamer_cleanup},  
+    
+    {"CTc_MediaStreamer_PrivilegeMediaStorage_node_set_params", CTc_MediaStreamer_PrivilegeMediaStorage_node_set_params, CTs_platform_permission_media_streamer_startup,  CTs_platform_permission_media_streamer_cleanup},  
     {NULL, NULL}
 };
 
index 36aafbb..6ff4a8f 100755 (executable)
@@ -43,7 +43,9 @@ extern void CTs_platform_permission_mediacontent_startup(void);
 extern void CTs_platform_permission_mediacontent_cleanup(void);
 extern void CTs_platform_permission_messages_startup(void);
 extern void CTs_platform_permission_messages_cleanup(void);
+extern void CTs_platform_permission_media_streamer_startup();
 extern void CTs_platform_permission_nfc_startup(void);
+extern void CTs_platform_permission_media_streamer_cleanup();
 extern void CTs_platform_permission_nfc_cleanup(void);
 extern void CTs_platform_permission_notification_startup(void);
 extern void CTs_platform_permission_notification_cleanup(void);
@@ -69,7 +71,10 @@ extern void CTs_platform_permission_WidgetViewer_startup(void);
 extern void CTs_platform_permission_WidgetViewer_cleanup(void);
 extern void CTs_platform_permission_wifi_startup(void);
 extern void CTs_platform_permission_wifi_cleanup(void);
-
+extern int CTc_MediaStreamer_PrivilegeMediaStorage_node_create_src(void);
+extern int CTc_MediaStreamer_PrivilegeMediaStorage_node_create_sink(void);
+extern int CTc_MediaStreamer_PrivilegeMediaStorage_node_set_param(void);
+extern int CTc_MediaStreamer_PrivilegeMediaStorage_node_set_params(void);
 extern int CTc_AppManager_Privilege_PackagemanagerInfo_app_control_send_launch_request(void);
 extern int CTc_Application_PrivilegeAlarmSet_alarm_schedule_once_after_delay(void);
 extern int CTc_Application_PrivilegeAlarmSet_alarm_get_scheduled_date(void);
@@ -381,6 +386,11 @@ testcase tc_array[] = {
     {"CTc_Wifi_Privilege_NetworkGet_SetSubnetMask", CTc_Wifi_Privilege_NetworkGet_SetSubnetMask, CTs_platform_permission_wifi_startup, CTs_platform_permission_wifi_cleanup},
     {"CTc_Wifi_Privilege_wifi_tdls_disconnect", CTc_Wifi_Privilege_wifi_tdls_disconnect, CTs_platform_permission_wifi_startup, CTs_platform_permission_wifi_cleanup},
     {"CTc_Wifi_Privilege_wifi_tdls_get_connected_peer", CTc_Wifi_Privilege_wifi_tdls_get_connected_peer, CTs_platform_permission_wifi_startup, CTs_platform_permission_wifi_cleanup},
+    {"CTc_MediaStreamer_PrivilegeMediaStorage_node_create_src",  CTc_MediaStreamer_PrivilegeMediaStorage_node_create_src, CTs_platform_permission_media_streamer_startup,  CTs_platform_permission_media_streamer_cleanup},
+    {"CTc_MediaStreamer_PrivilegeMediaStorage_node_create_sink", CTc_MediaStreamer_PrivilegeMediaStorage_node_create_sink, CTs_platform_permission_media_streamer_startup,  CTs_platform_permission_media_streamer_cleanup},
+    {"CTc_MediaStreamer_PrivilegeMediaStorage_node_set_param", CTc_MediaStreamer_PrivilegeMediaStorage_node_set_param, CTs_platform_permission_media_streamer_startup,  CTs_platform_permission_media_streamer_cleanup},  
+    
+    {"CTc_MediaStreamer_PrivilegeMediaStorage_node_set_params", CTc_MediaStreamer_PrivilegeMediaStorage_node_set_params, CTs_platform_permission_media_streamer_startup,  CTs_platform_permission_media_streamer_cleanup},  
     {NULL, NULL}
 };