- minicontrol will be deprecated.
Change-Id: I3b3c541c3cf8342b5fe24ad0026f1e033f87eaec
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
BuildRequires: pkgconfig(calendar-service2)
BuildRequires: pkgconfig(capi-messaging-messages)
BuildRequires: pkgconfig(context)
-BuildRequires: pkgconfig(minicontrol-viewer)
-BuildRequires: pkgconfig(minicontrol-provider)
-BuildRequires: pkgconfig(minicontrol-monitor)
BuildRequires: pkgconfig(shortcut)
BuildRequires: pkgconfig(core-sync-client)
BuildRequires: pkgconfig(efl-extension)
+++ /dev/null
-%define MODULE_NAME minicontrol
-#%define MODULE_LIBNAME minicontrol-viewer
-Name: native-%{MODULE_NAME}-itc
-Summary: Native API Integration TC (%{name})
-Version: 0.1
-Release: 0
-Group: Development/Tools
-License: Apache-2.0
-Source0: %{name}-%{version}.tar.gz
-#BuildRequires: pkgconfig(%{MODULE_LIBNAME})
-BuildRequires: pkgconfig(glib-2.0)
-BuildRequires: cmake
-BuildRequires: pkgconfig(bundle)
-BuildRequires: pkgconfig(capi-system-info)
-BuildRequires: pkgconfig(minicontrol-provider)
-BuildRequires: pkgconfig(minicontrol-viewer)
-BuildRequires: pkgconfig(minicontrol-monitor)
-BuildRequires: pkgconfig(dbus-1)
-BuildRequires: pkgconfig(dbus-glib-1)
-BuildRequires: pkgconfig(elementary)
-BuildRequires: pkgconfig(capi-appfw-application)
-BuildRequires: pkgconfig(dlog)
-
-%description
-Native API Integration TC (%{name})
-
-%prep
-%setup -q
-
-%build
-
-%define PREFIX "%{_libdir}/%{name}"
-
-export LDFLAGS+="-Wl,--rpath=%{PREFIX} -Wl,--as-needed"
-
-%if %{?ASAN_BUILD:1}0
- %if %{?DEVICE_BUILD_TYPE_MOBILE:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="mobile" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="wearable" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_TV:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="tv" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_TIZENIOT:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="tizeniot" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
-%else
- %if %{?DEVICE_BUILD_TYPE_MOBILE:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="mobile" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="wearable" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_TV:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="tv" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_TIZENIOT:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="tizeniot" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
-%endif
-
-make %{?jobs:-j%jobs}
-
-%install
-rm -rf %{buildroot}
-%make_install
-mkdir -p %{buildroot}/usr/share/license
-cp LICENSE %{buildroot}/usr/share/license/%{name}
-
-mkdir -p %{buildroot}/usr/share/packages/
-cp packaging/itc/native-%{MODULE_NAME}-itc.xml %{buildroot}/usr/share/packages/
-mkdir -p %{buildroot}%{APP_PATH}%{name}/bin
-#cp templates/external_wrapper.sh %{buildroot}%{APP_PATH}%{name}/bin
-%post
-
-%postun
-
-
-%files
-%{APP_PATH}%{name}/*
-/usr/share/packages/native-%{MODULE_NAME}-itc.xml
-/usr/share/license/%{name}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns="http://tizen.org/ns/packages" package="native-minicontrol-itc" version="0.1.0" api-version="6.0">
- <label>CoreMinicontrolTest</label>
- <author email="mymail@tizentest.com" href="www.tizentest.com">test</author>
- <description>Native API test Application</description>
- <ui-application appid="native.minicontrol-itc" exec="/usr/apps/native-minicontrol-itc/bin/tct-minicontrol-native" nodisplay="false" multiple="false" type="capp" taskmanage="true">
- <background-category value="background-network"/>
- <background-category value="download"/>
- <background-category value="iot-communication"/>
- <background-category value="location"/>
- <background-category value="media"/>
- <background-category value="sensor"/>
- </ui-application>
-</manifest>
+++ /dev/null
-%define MODULE_NAME minicontrol
-%define MODULE_LIBNAME minicontrol
-Name: core-%{MODULE_NAME}-tests
-Summary: Core API unit TC (%{name})
-Version: 0.1
-Release: 0
-Group: Development/Tools
-License: Apache License, Version 2.0
-Source0: %{name}-%{version}.tar.gz
-BuildRequires: pkgconfig(%{MODULE_LIBNAME}-viewer)
-BuildRequires: pkgconfig(%{MODULE_LIBNAME}-provider)
-BuildRequires: pkgconfig(glib-2.0)
-BuildRequires: cmake
-BuildRequires: pkgconfig(capi-appfw-application)
-BuildRequires: pkgconfig(dlog)
-BuildRequires: pkgconfig(capi-system-info)
-BuildRequires: pkgconfig(bundle)
-BuildRequires: pkgconfig(elementary)
-
-%description
-Core API unit TC (%{name})
-
-%prep
-%setup -q
-
-%build
-
-%define PREFIX "%{_libdir}/%{name}"
-
-export LDFLAGS+="-Wl,--rpath=%{PREFIX} -Wl,--as-needed"
-
-%if %{?ASAN_BUILD:1}0
- %if %{?DEVICE_BUILD_TYPE_MOBILE:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="mobile" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="wearable" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_TV:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="tv" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_TIZENIOT:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="tizeniot" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
-%else
- %if %{?DEVICE_BUILD_TYPE_MOBILE:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="mobile" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="wearable" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_TV:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="tv" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_TIZENIOT:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="tizeniot" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
-%endif
-
-make %{?jobs:-j%jobs}
-
-%install
-rm -rf %{buildroot}
-%make_install
-mkdir -p %{buildroot}/usr/share/license
-cp LICENSE %{buildroot}/usr/share/license/%{name}
-mkdir -p %{buildroot}/usr/share/packages/
-cp packaging/utc/%{name}.xml %{buildroot}/usr/share/packages/
-mkdir -p %{buildroot}/usr/apps/%{name}/bin
-%post
-
-%postun
-
-
-%files
-/usr/apps/%{name}/*
-/usr/share/packages/%{name}.xml
-/usr/share/license/%{name}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns="http://tizen.org/ns/packages" package="core-minicontrol-tests" version="0.1.0" api-version="6.0">
- <label>CoreMinicontrolTest</label>
- <author email="test@tizen.org" href="www.tizen.org">test</author>
- <description>Core API test Application</description>
- <ui-application appid="core.minicontrol-tests" exec="/usr/apps/core-minicontrol-tests/bin/tct-minicontrol-core" nodisplay="false" multiple="false" type="capp" taskmanage="true">
- <background-category value="background-network"/>
- <background-category value="download"/>
- <background-category value="iot-communication"/>
- <background-category value="location"/>
- <background-category value="media"/>
- <background-category value="sensor"/>
- </ui-application>
-</manifest>
CTs-platform-permission-thumbnail-util.c
CTs-platform-permission-url-download.c
CTs-platform-permission-wifi-direct.c
- CTs-platform-permission-app-manager.c
+ CTs-platform-permission-app-manager.c
CTs-platform-permission-libfeedback.c
CTs-platform-permission-telephony.c
CTs-platform-permission-nfc.c
sqlite3
shortcut
phonenumber-utils
- dlog
+ dlog
db-util
glib-2.0
ecore
capi-network-nfc
capi-network-http
context
- minicontrol-viewer
- minicontrol-provider
- minicontrol-monitor
capi-network-smartcard
capi-media-controller
-
+
evas
capi-system-info
widget_viewer_evas
PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
${CAPI_LIB}
sqlite3
- dlog
+ dlog
db-util
glib-2.0
ecore
}
-#ifdef MOBILE
-/**
-* @function MinicontrolGetError
-* @description Maps minicontrol_error_e enums to string values
-* @parameter nRet : error code returned
-* @return minicontrol error string
-*/
-char* MinicontrolGetError(minicontrol_error_e nRet)
-{
- char *szErrorVal = NULL;
- switch ( nRet )
- {
- case MINICONTROL_ERROR_NONE: szErrorVal = "MINICONTROL_ERROR_NONE"; break;
- case MINICONTROL_ERROR_INVALID_PARAMETER: szErrorVal = "MINICONTROL_ERROR_INVALID_PARAMETER"; break;
- case MINICONTROL_ERROR_OUT_OF_MEMORY: szErrorVal = "MINICONTROL_ERROR_OUT_OF_MEMORY"; break;
- case MINICONTROL_ERROR_PERMISSION_DENIED: szErrorVal = "MINICONTROL_ERROR_PERMISSION_DENIED"; break;
- case MINICONTROL_ERROR_IPC_FAILURE: szErrorVal = "MINICONTROL_ERROR_IPC_FAILURE"; break;
- case MINICONTROL_ERROR_NOT_SUPPORTED: szErrorVal = "MINICONTROL_ERROR_NOT_SUPPORTED"; break;
- case MINICONTROL_ERROR_ELM_FAILURE: szErrorVal = "MINICONTROL_ERROR_ELM_FAILURE" ; break;
- case MINICONTROL_ERROR_UNKNOWN: szErrorVal = "MINICONTROL_ERROR_UNKNOWN"; break;
- default: szErrorVal = "Unknown Error"; break;
- }
- return szErrorVal;
-}
-#endif
-
/**
* @function EflUtilGetError
* @description Maps error enumerators to string values
#include <device/power.h>
#include <device/haptic.h>
#include <device/display.h>
-#include <device/callback.h>
+#include <device/callback.h>
#include <recorder.h>
#include <camera.h>
#include <package_manager.h>
#include <app.h>
#include <player.h>
#include <sensor.h>
-#include <device/led.h>
+#include <device/led.h>
#include <data_control.h>
#include <message_port.h>
#include <audio_io.h>
#include <widget_service.h>
#include <widget_errno.h>
//#include <widget_service_internal.h>
-#ifdef MOBILE
-#include <minicontrol-viewer.h>
-#include <minicontrol-provider.h>
-//#include <minicontrol-monitor.h>
-#endif
#include <efl_util.h>
#include <Elementary.h>
#include "runtime_info.h"
#define PUSH_TEST_CONTENT_TYPE "text/vnd.wap.connectivity-xml"
#define PROVIDERID "http://tizen.org/datacontrol/provider/datacontrolprovider"
#define FEATURE_AUDIO_MICROPHONE "http://tizen.org/feature/microphone"
-#define FEATURE_AUDIO_CAMERA "http://tizen.org/feature/camera"
+#define FEATURE_AUDIO_CAMERA "http://tizen.org/feature/camera"
#define FEATURE_CAMERA_BACK "http://tizen.org/feature/camera.back"
#define FEATURE_CAMERA_FRONT "http://tizen.org/feature/camera.front"
#define FEATURE_NETWORK_TELEPHONY "http://tizen.org/feature/network.telephony"
char* SmartcardGetErrorCode(int nRet);
char* SmartcardGetError(int nRet);
char* WidgetServiceGetError(int nRet);
-#ifdef MOBILE
-char* MinicontrolGetError(minicontrol_error_e nRet);
-#endif
char* EflUtilGetError(int nRet);
char* MessagesGetError(int nRet);
char* Oauth2InfoGetError(int nRet);
+++ /dev/null
-SET(PKG_NAME "minicontrol")
-
-SET(EXEC_NAME "tct-${PKG_NAME}-native")
-SET(RPM_NAME "native-${PKG_NAME}-itc")
-
-SET(CAPI_LIB "minicontrol bundle glib-2.0 capi-system-info minicontrol-viewer minicontrol-provider minicontrol-monitor dbus-1 dbus-glib-1 capi-appfw-application")
-SET(TC_SOURCES
- ITs-minicontrol-common.c
- ITs-minicontrol.c
-)
-
-PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
-# ${CAPI_LIB}
- bundle
- glib-2.0
- capi-system-info
- minicontrol-viewer
- minicontrol-provider
- minicontrol-monitor
- dbus-1
- dbus-glib-1
- capi-appfw-application
- dlog
-)
-
-INCLUDE_DIRECTORIES(
- ${${CAPI_LIB}_INCLUDE_DIRS}
-)
-
-ADD_EXECUTABLE(${EXEC_NAME} ${EXEC_NAME}.c ${TC_SOURCES} ${COMMON_FILE})
-TARGET_LINK_LIBRARIES(${EXEC_NAME}
- ${${CAPI_LIB}_LIBRARIES}
- bundle
-)
-
-INSTALL(PROGRAMS ${EXEC_NAME}
- DESTINATION ${BIN_DIR}/${RPM_NAME}/bin
-)
-
-IF( DEFINED ASAN )
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Wall -pie -g -fsanitize=address -fsanitize-recover=address -U_FORTIFY_SOURCE -fno-omit-frame-pointer")
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib -Wl,-fsanitize=address")
-ELSE()
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g -fPIE -Wall")
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib -pie")
-ENDIF()
+++ /dev/null
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Apache License, Version 2.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#include "ITs-minicontrol-common.h"
-
-/** @addtogroup itc-minicontrol
-* @ingroup minicontrol
-* @{
-*/
-//Add helper function definitions here
-
-/**
-* @function MinicontrolGetError
-* @description Maps minicontrol_error_e enums to string values
-* @parameter nRet : error code returned
-* @return minicontrol error string
-*/
-char* MinicontrolGetError(minicontrol_error_e nRet)
-{
- char *szErrorVal = NULL;
- switch ( nRet )
- {
- case MINICONTROL_ERROR_NONE: szErrorVal = "MINICONTROL_ERROR_NONE"; break;
- case MINICONTROL_ERROR_INVALID_PARAMETER: szErrorVal = "MINICONTROL_ERROR_INVALID_PARAMETER"; break;
- case MINICONTROL_ERROR_OUT_OF_MEMORY: szErrorVal = "MINICONTROL_ERROR_OUT_OF_MEMORY"; break;
- case MINICONTROL_ERROR_PERMISSION_DENIED: szErrorVal = "MINICONTROL_ERROR_PERMISSION_DENIED"; break;
- case MINICONTROL_ERROR_IPC_FAILURE: szErrorVal = "MINICONTROL_ERROR_IPC_FAILURE"; break;
- case MINICONTROL_ERROR_NOT_SUPPORTED: szErrorVal = "MINICONTROL_ERROR_NOT_SUPPORTED"; break;
- case MINICONTROL_ERROR_ELM_FAILURE: szErrorVal = "MINICONTROL_ERROR_ELM_FAILURE" ; break;
- case MINICONTROL_ERROR_UNKNOWN: szErrorVal = "MINICONTROL_ERROR_UNKNOWN"; break;
- default: szErrorVal = "Unknown Error"; break;
- }
- return szErrorVal;
-}
-
-/**
-* @function MinicontrolGetEvent
-* @description Maps minicontrol_event_e enums to string values
-* @parameter nType : minicontrol event enum
-* @return minicontrol type string
-*/
-char* MinicontrolGetEvent(minicontrol_event_e nType)
-{
- char *szType = "Unknown Minicontrol Event";
- switch ( nType )
- {
- case MINICONTROL_EVENT_START: szType = "MINICONTROL_EVENT_START"; break;
- case MINICONTROL_EVENT_STOP: szType = "MINICONTROL_EVENT_STOP"; break;
- case MINICONTROL_EVENT_RESIZE: szType = "MINICONTROL_EVENT_RESIZE"; break;
- case MINICONTROL_EVENT_REQUEST_HIDE: szType = "MINICONTROL_EVENT_REQUEST_HIDE"; break;
- case MINICONTROL_EVENT_REQUEST_ANGLE: szType = "MINICONTROL_EVENT_REQUEST_ANGLE"; break;
- case MINICONTROL_EVENT_REPORT_ANGLE: szType = "MINICONTROL_EVENT_REPORT_ANGLE"; break;
- }
-
- return szType;
-}
-
-/**
-* @function MinicontrolGetProviderEvent
-* @description Maps minicontrol_provider_event_e enums to string values
-* @parameter nType : minicontrol provider event type enum
-* @return minicontrol type string
-*/
-char* MinicontrolGetProviderEvent(minicontrol_provider_event_e nType)
-{
- char *szType = "Unknown Minicontrol Provider Event";
- switch ( nType )
- {
- case MINICONTROL_PROVIDER_EVENT_REQUEST_HIDE: szType = "MINICONTROL_PROVIDER_EVENT_REQUEST_HIDE"; break;
- case MINICONTROL_PROVIDER_EVENT_REQUEST_ANGLE: szType = "MINICONTROL_PROVIDER_EVENT_REQUEST_ANGLE"; break;
- }
-
- return szType;
-}
-
-/**
-* @function MinicontrolGetViewerEvent
-* @description Maps minicontrol_viewer_event_e enums to string values
-* @parameter nType : minicontrol viewer event type enum
-* @return minicontrol type string
-*/
-char* MinicontrolGetViewerEvent(minicontrol_viewer_event_e nType)
-{
- char *szType = "Unknown Minicontrol Provider Event";
- switch ( nType )
- {
- case MINICONTROL_VIEWER_EVENT_REPORT_ANGLE: szType = "MINICONTROL_VIEWER_EVENT_REPORT_ANGLE"; break;
- case MINICONTROL_VIEWER_EVENT_SHOW: szType = "MINICONTROL_VIEWER_EVENT_SHOW"; break;
- case MINICONTROL_VIEWER_EVENT_HIDE: szType = "MINICONTROL_VIEWER_EVENT_HIDE"; break;
- }
-
- return szType;
-}
-/**
-* @function MinicontrolGetProviderEvent
-* @description Maps minicontrol_target_viewer_e enums to string values
-* @parameter nType : minicontrol provider event type enum
-* @return minicontrol type string
-*/
-char* MinicontrolGetTargetViewer(minicontrol_target_viewer_e nType)
-{
- char *szType = "Unknown Minicontrol Provider Event";
- switch ( nType )
- {
- case MINICONTROL_TARGET_VIEWER_QUICK_PANEL: szType = "MINICONTROL_TARGET_VIEWER_QUICK_PANEL"; break;
- case MINICONTROL_TARGET_VIEWER_STOCK_LOCK_SCREEN: szType = "MINICONTROL_TARGET_VIEWER_STOCK_LOCK_SCREEN"; break;
- case MINICONTROL_TARGET_VIEWER_CUSTOM_LOCK_SCREEN: szType = "MINICONTROL_TARGET_VIEWER_CUSTOM_LOCK_SCREEN"; break;
- }
-
- return szType;
-}
-
-/**
-* @function MinicontrolCallBackTimeout
-* @description callback function to terminate g_main loop
-* @parameter data : user data sent to callback
-* @return NA
-*/
-gboolean MinicontrolCallBackTimeout(gpointer data)
-{
- GMainLoop* pMainLoop = (GMainLoop *)data;
- if ( pMainLoop != NULL )
- {
- g_main_loop_quit(pMainLoop);
- g_main_loop_unref(pMainLoop);
- pMainLoop = NULL;
- }
- return false;
-}
-
-/** @} */
+++ /dev/null
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Apache License, Version 2.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#ifndef _ITS_MINICONTROL_COMMON_H_
-#define _ITS_MINICONTROL_COMMON_H_
-
-#include "assert.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <glib-2.0/glib.h>
-#include <glib.h>
-#include <pthread.h>
-#include <Evas.h>
-#include <Elementary.h>
-#include <minicontrol-viewer.h>
-#include <minicontrol-provider.h>
-//#include <minicontrol-monitor.h>
-#include "tct_common.h"
-
-/** @addtogroup itc-minicontrol
-* @ingroup minicontrol
-* @{
-*/
-#define TARGET_APP_ID "org.tizen.music-player"
-#define MINICONTROL_NAME "minicontrol-itc"
-#define API_NAMESPACE "MINICONTROL_ITC"
-#define GMAINTIMEOUT 10000 //10 seconds
-#define MINICONTROL_FEATURE "http://tizen.org/feature/minicontrol"
-//Add test package related includes here
-
-
-//Add helper function declarations here
-
-#define START_TEST {\
- FPRINTF("[Line : %d][%s] Starting test : %s\\n", __LINE__, API_NAMESPACE, __FUNCTION__);\
-}
-#define RUN_POLLING_LOOP {\
- g_pMainLoop = g_main_loop_new(NULL, false);\
- g_timeout_id = g_timeout_add(GMAINTIMEOUT, MinicontrolCallBackTimeout, g_pMainLoop);\
- g_main_loop_run(g_pMainLoop);\
- g_source_remove(g_timeout_id);\
- g_pMainLoop = NULL;\
-}
-
-//Add helper function declarations here
-
-char* MinicontrolGetError(minicontrol_error_e nRet);
-char* MinicontrolGetEvent(minicontrol_event_e nType);
-char* MinicontrolGetProviderEvent(minicontrol_provider_event_e nType);
-char* MinicontrolGetViewerEvent(minicontrol_viewer_event_e nType);
-char* MinicontrolGetTargetViewer(minicontrol_target_viewer_e nType);
-gboolean MinicontrolCallBackTimeout(gpointer data);
-
-/** @}*/
-#endif //_ITS_MINICONTROL_COMMON_H_
+++ /dev/null
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Apache License, Version 2.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#include "ITs-minicontrol-common.h"
-/** @addtogroup itc-minicontrol
-* @ingroup minicontrol
-* @{
-*/
-
-static GMainLoop *g_pMainLoop = NULL;
-static int g_itc_minicontrol_viewer_add_p_result = 0;
-static bool g_bMinicontrolCallbackHit;
-bool g_bMinicontrolNotSupported = false;
-/**
- * @function ITs_minicontrol_startup
- * @description Called before each test
- * @parameter NA
- * @return NA
- */
-void ITs_minicontrol_startup(void)
-{
- struct stat stBuff;
- if ( stat(ERR_LOG, &stBuff) == 0 )
- {
- remove(ERR_LOG);
- }
-#if DEBUG
- FPRINTF("[Line: %d][%s] TEST SUIT start-up: ITs_Minicontrol_p\\n", __LINE__, API_NAMESPACE);
-#endif
-
- g_bMinicontrolNotSupported = false;
-
-#if defined(MOBILE) || defined(WEARABLE) //Starts MOBILE/WEARABLE
- if ( !TCTCheckSystemInfoFeatureSupported(MINICONTROL_FEATURE, API_NAMESPACE) )
- {
- g_bMinicontrolNotSupported = true;
- }
-#endif //End mobile/wearable
- return;
-}
-
-/**
- * @function ITs_minicontrol_cleanup
- * @description Called after each test
- * @parameter NA
- * @return NA
- */
-void ITs_minicontrol_cleanup(void)
-{
-#if DEBUG
- FPRINTF("[Line : %d][%s] TEST SUIT clean-up: ITs_Minicontrol_p\\n", __LINE__, API_NAMESPACE);
-#endif
- return;
-}
-
-/**
-* @function minicontrol_viewer_event_callback
-* @description callback function for minicontrol set event
-* @parameter event : minicontrol_event_e event, minicontrol_name : minicontrol_name, bundle: bundle, user_data: user_data sent to callback
-* @return NA
-*/
-void minicontrol_viewer_event_callback(minicontrol_event_e event, const char *minicontrol_name, bundle *event_arg, void *data)
-{
-#if DEBUG
- FPRINTF("[Line : %d][%s] minicontrol_viewer_event_callback \\n", __LINE__, API_NAMESPACE);
-#endif
-
- g_bMinicontrolCallbackHit = true;
-
- Evas_Object *parent_window = NULL;
- Evas_Object *viewer = NULL;
- parent_window = elm_win_add(NULL, "parent_window", ELM_WIN_BASIC);
-
- evas_object_resize(parent_window, 480, 800);
-
- viewer = minicontrol_viewer_add(parent_window, minicontrol_name);
- g_itc_minicontrol_viewer_add_p_result = (viewer != NULL) ? 1 : 0;
-
- evas_object_hide(parent_window);
- evas_object_hide(viewer);
-
- if ( g_pMainLoop )
- {
- g_main_loop_quit(g_pMainLoop);
- g_main_loop_unref(g_pMainLoop);
- g_pMainLoop = NULL;
- }
-}
-
-/**
-* @function minicontrol_window_callback
-* @description callback function for minicontrol create window
-* @parameter event_type: minicontrol_viewer_event_e, bundle: bundle
-* @return NA
-*/
-void minicontrol_window_callback(minicontrol_viewer_event_e event_type, bundle *event_arg)
-{
-#if DEBUG
- FPRINTF("[Line : %d][%s] minicontrol_window_callback callback \\n", __LINE__, API_NAMESPACE);
-#endif
- g_bMinicontrolCallbackHit = true;
- if ( g_pMainLoop )
- {
- g_main_loop_quit(g_pMainLoop);
- g_main_loop_unref(g_pMainLoop);
- g_pMainLoop = NULL;
- }
-}
-
-/**
-* @function create_minicontrol_window_thread
-* @description callback function for minicontrol window
-* @parameter user_data: user_data sent to callback
-* @return NA
-*/
-static int create_minicontrol_window_thread(void *data)
-{
- Evas_Object *minicontrol_window = NULL;
-
- usleep(1000000);
- /* Wait a sec for viewer*/
- minicontrol_window = minicontrol_create_window(MINICONTROL_NAME, MINICONTROL_TARGET_VIEWER_QUICK_PANEL, minicontrol_window_callback);
- CHECK_HANDLE(minicontrol_window, "minicontrol_create_window");
-
- elm_win_alpha_set(minicontrol_window, EINA_TRUE);
- evas_object_resize(minicontrol_window, 480, 800);
- evas_object_show(minicontrol_window);
-
- return 0;
-}
-
-/************************** callback block end**********************************************/
-
-/** @addtogroup itc-minicontrol-testcases
-* @brief Integration testcases for module minicontrol
-* @ingroup itc-minicontrol
-* @{
-*/
-
-//& purpose: to add minicontrol named as "minicontrol_name" to a given parent evas object return it
-//& type : auto
-/**
-* @testcase ITc_minicontrol_viewer_add_p
-* @type auto
-* @author SRID(shekhar1.s)
-* @reviewer SRID(gupta.sanjay)
-* @since_tizen 2.4
-* @description Adds minicontrol named as "minicontrol_name" to a given parent evas object and returns it.
-* @scenario sets the callback for the viewer event\n
-* creates window\n
-* checks the viewer callback\n
-* adds the viewer\n
-* unsets the callback
-* @apicovered minicontrol_viewer_set_event_cb, minicontrol_viewer_unset_event_cb, minicontrol_viewer_add
-* @passcase When minicontrol_viewer_add return success
-* @failcase When minicontrol_viewer_add return failure
-* @precondition none
-* @postcondition none
-*/
-int ITc_minicontrol_viewer_add_p(void)
-{
- START_TEST;
-
- pthread_t thread_id;
- int g_timeout_id = 0;
- minicontrol_error_e nRet;
- g_itc_minicontrol_viewer_add_p_result = 0;
-
- nRet = minicontrol_viewer_set_event_cb(minicontrol_viewer_event_callback, "user_data");
-#if defined(MOBILE) || defined(WEARABLE) //Starts MOBILE/WEARABLE
- if (g_bMinicontrolNotSupported)
- {
- if(nRet != MINICONTROL_ERROR_NOT_SUPPORTED)
- {
- FPRINTF("[Line: %d][%s] Feature is mismatch \\n", __LINE__, API_NAMESPACE);
- return 1;
- }
- else
- {
- FPRINTF("[Line: %d][%s] Feature is Not Supported \\n", __LINE__, API_NAMESPACE);
- return 0;
- }
- }
-#endif //End mobile/wearable
- PRINT_RESULT(MINICONTROL_ERROR_NONE, nRet, "minicontrol_viewer_set_event_cb", MinicontrolGetError(nRet));
-
- create_minicontrol_window_thread(NULL);
- RUN_POLLING_LOOP;
- PRINT_RESULT(1, g_itc_minicontrol_viewer_add_p_result, "minicontrol_viewer_add", MinicontrolGetError(nRet));
- nRet = minicontrol_viewer_unset_event_cb();
- PRINT_RESULT(MINICONTROL_ERROR_NONE, nRet, "minicontrol_viewer_unset_event_cb", MinicontrolGetError(nRet));
-
- return 0;
-}
-
-//& purpose: to send an event to the provider.
-//& type : auto
-/**
-* @testcase ITc_minicontrol_viewer_send_event_p
-* @type auto
-* @author SRID(shekhar1.s)
-* @reviewer SRID(gupta.sanjay)
-* @since_tizen 2.4
-* @description Sends an event to the provider.
-* @scenario send the event to the provider.
-* @apicovered minicontrol_viewer_send_event
-* @passcase When minicontrol_viewer_send_event return success
-* @failcase When minicontrol_viewer_send_event return failure
-* @precondition none
-* @postcondition none
-*/
-int ITc_minicontrol_viewer_send_event_p(void)
-{
- START_TEST;
-
- bundle *event_arg = NULL;
- minicontrol_viewer_event_e event_viewer[] = { MINICONTROL_VIEWER_EVENT_REPORT_ANGLE, MINICONTROL_VIEWER_EVENT_SHOW, MINICONTROL_VIEWER_EVENT_HIDE };
-
- int nEnumEventSize = sizeof(event_viewer) / sizeof(event_viewer[0]);
- int nEnumEventCounter = 0;
- for ( nEnumEventCounter = 0; nEnumEventCounter < nEnumEventSize; nEnumEventCounter++ )
- {
- minicontrol_error_e nRet = minicontrol_viewer_send_event(TARGET_APP_ID, event_viewer[nEnumEventCounter], event_arg);
-#if defined(MOBILE) || defined(WEARABLE) //Starts MOBILE/WEARABLE
- if (g_bMinicontrolNotSupported)
- {
- if(nRet != MINICONTROL_ERROR_NOT_SUPPORTED)
- {
- FPRINTF("[Line: %d][%s] Feature is mismatch \\n", __LINE__, API_NAMESPACE);
- return 1;
- }
- else
- {
- FPRINTF("[Line: %d][%s] Feature is Not Supported \\n", __LINE__, API_NAMESPACE);
- return 0;
- }
- }
-#endif //End mobile/wearable
- PRINT_RESULT(MINICONTROL_ERROR_NONE, nRet, "minicontrol_viewer_send_event", MinicontrolGetError(nRet));
- }
- return 0;
-}
-
-//& purpose: Register and unregister a callback for events originated by minicontrol provider.
-//& type : auto
-/**
-* @testcase ITc_minicontrol_viewer_set_unset_event_cb_p
-* @type auto
-* @author SRID(shekhar1.s)
-* @reviewer SRID(gupta.sanjay)
-* @since_tizen 2.4
-* @description Registers and unregister a callback for events originated by minicontrol provider.
-* @scenario sets the callback for the viewer event\n
-* creates window\n
-* checks the viewer callback\n
-* adds the viewer\n
-* unsets the callback
-* @apicovered minicontrol_viewer_set_event_cb, minicontrol_create_window, minicontrol_viewer_unset_event_cb
-* @passcase When minicontrol_viewer_set_event_cb, minicontrol_create_window, minicontrol_viewer_unset_event_cb return success
-* @failcase When minicontrol_viewer_set_event_cb, minicontrol_create_window, minicontrol_viewer_unset_event_cb return failure
-* @precondition none
-* @postcondition none
-*/
-int ITc_minicontrol_viewer_set_unset_event_cb_p(void)
-{
- START_TEST;
-
- int g_timeout_id = 0;
- Evas_Object *minicontrol_window = NULL;
- g_bMinicontrolCallbackHit = false;
-
- minicontrol_error_e nRet = minicontrol_viewer_set_event_cb(minicontrol_viewer_event_callback, NULL);
-#if defined(MOBILE) || defined(WEARABLE) //Starts MOBILE/WEARABLE
- if (g_bMinicontrolNotSupported)
- {
- if(nRet != MINICONTROL_ERROR_NOT_SUPPORTED)
- {
- FPRINTF("[Line: %d][%s] Feature is mismatch \\n", __LINE__, API_NAMESPACE);
- return 1;
- }
- else
- {
- FPRINTF("[Line: %d][%s] Feature is Not Supported \\n", __LINE__, API_NAMESPACE);
- return 0;
- }
- }
-#endif //End mobile/wearable
- PRINT_RESULT(MINICONTROL_ERROR_NONE, nRet, "minicontrol_viewer_set_event_cb", MinicontrolGetError(nRet));
-
- minicontrol_window = minicontrol_create_window(MINICONTROL_NAME, MINICONTROL_TARGET_VIEWER_QUICK_PANEL, minicontrol_window_callback);
- if ( minicontrol_window == NULL )
- {
- nRet = get_last_result();
- FPRINTF("[Line : %d][%s] minicontrol_viewer_add failed viewer is NULL error %s\\n", __LINE__, API_NAMESPACE, MinicontrolGetError(nRet));
- minicontrol_viewer_unset_event_cb();
- return 1;
- }
-
- elm_win_alpha_set(minicontrol_window, EINA_TRUE);
- evas_object_resize(minicontrol_window, 480, 800);
- evas_object_show(minicontrol_window);
-
- RUN_POLLING_LOOP;
-
- if ( g_bMinicontrolCallbackHit == false )
- {
- FPRINTF("[Line : %d][%s] minicontrol_viewer_set_event_cb callback not hit \\n", __LINE__, API_NAMESPACE);
- minicontrol_viewer_unset_event_cb();
- return 1;
- }
-
- nRet = minicontrol_viewer_unset_event_cb();
- PRINT_RESULT(MINICONTROL_ERROR_NONE, nRet, "minicontrol_viewer_unset_event_cb", MinicontrolGetError(nRet));
-
- return 0;
-}
-
-//& purpose: Create a window for minicontrol.
-//& type : auto
-/**
-* @testcase ITc_minicontrol_create_window_p
-* @type auto
-* @author SRID(shekhar1.s)
-* @reviewer SRID(gupta.sanjay)
-* @since_tizen 2.4
-* @description Create a window for minicontrol.
-* @scenario create window\n
-* check the callback
-* @apicovered minicontrol_create_window
-* @passcase When minicontrol_create_window return success
-* @failcase When minicontrol_create_window return failure
-* @precondition none
-* @postcondition none
-*/
-int ITc_minicontrol_create_window_p(void)
-{
- START_TEST;
-
- int g_timeout_id = 0;
- Evas_Object *minicontrol_window = NULL;
- minicontrol_target_viewer_e event_viewer[] = { MINICONTROL_TARGET_VIEWER_QUICK_PANEL };
- int nEnumEventSize = sizeof(event_viewer) / sizeof(event_viewer[0]);
- int nEnumEventCounter = 0;
-
- for ( nEnumEventCounter = 0; nEnumEventCounter < nEnumEventSize; nEnumEventCounter++ )
- {
- minicontrol_window = minicontrol_create_window(MINICONTROL_NAME, event_viewer[nEnumEventCounter], minicontrol_window_callback);
- minicontrol_error_e nRet = get_last_result();
-#if defined(MOBILE) || defined(WEARABLE) //Starts MOBILE/WEARABLE
- if (g_bMinicontrolNotSupported)
- {
- if(nRet != MINICONTROL_ERROR_NOT_SUPPORTED)
- {
- FPRINTF("[Line: %d][%s] Feature is mismatch \\n", __LINE__, API_NAMESPACE);
- return 1;
- }
- else
- {
- FPRINTF("[Line: %d][%s] Feature is Not Supported \\n", __LINE__, API_NAMESPACE);
- return 0;
- }
- }
-#endif //End mobile/wearable
-
- elm_win_alpha_set(minicontrol_window, EINA_TRUE);
- evas_object_resize(minicontrol_window, 480, 800);
- evas_object_show(minicontrol_window);
-
- RUN_POLLING_LOOP;
- if ( minicontrol_window == NULL )
- {
- FPRINTF("[Line : %d][%s] minicontrol_create_window failed minicontrol_window is NULL for enum %s error %s\\n", __LINE__, API_NAMESPACE, MinicontrolGetTargetViewer(event_viewer[nEnumEventCounter]), MinicontrolGetError(nRet));
- return 1;
- }
-
- }
- evas_object_hide(minicontrol_window);
- return 0;
-}
-
-//& purpose: Send an event to the viewer.
-//& type : auto
-/**
-* @testcase ITc_minicontrol_send_event_p
-* @type auto
-* @author SRID(shekhar1.s)
-* @reviewer SRID(gupta.sanjay)
-* @since_tizen 2.4
-* @description Send an event to the viewer.
-* @scenario create window\n
-* send event
-* @apicovered minicontrol_create_window, minicontrol_send_event
-* @passcase When minicontrol_create_window, minicontrol_send_event return success
-* @failcase When minicontrol_create_window, minicontrol_send_event return failure
-* @precondition none
-* @postcondition none
-*/
-int ITc_minicontrol_send_event_p(void)
-{
- START_TEST;
-
- Evas_Object *minicontrol_window = NULL;
-
- minicontrol_window = minicontrol_create_window(MINICONTROL_NAME, MINICONTROL_TARGET_VIEWER_QUICK_PANEL, minicontrol_window_callback);
- minicontrol_error_e nRet = get_last_result();
-#if defined(MOBILE) || defined(WEARABLE) //Starts MOBILE/WEARABLE
- if (g_bMinicontrolNotSupported)
- {
- if(nRet != MINICONTROL_ERROR_NOT_SUPPORTED)
- {
- FPRINTF("[Line: %d][%s] Feature is mismatch \\n", __LINE__, API_NAMESPACE);
- return 1;
- }
- else
- {
- FPRINTF("[Line: %d][%s] Feature is Not Supported \\n", __LINE__, API_NAMESPACE);
- return 0;
- }
- }
-#endif //End mobile/wearable
- if ( minicontrol_window == NULL)
- {
- FPRINTF("[Line : %d][%s] minicontrol_create_window failed with error %s\\n", __LINE__, API_NAMESPACE, MinicontrolGetError(nRet));
- return 1;
- }
- minicontrol_provider_event_e event_viewer[] = { MINICONTROL_PROVIDER_EVENT_REQUEST_HIDE, MINICONTROL_PROVIDER_EVENT_REQUEST_ANGLE };
-
- int nEnumEventSize = sizeof(event_viewer) / sizeof(event_viewer[0]);
- int nEnumEventCounter = 0;
- for ( nEnumEventCounter = 0; nEnumEventCounter < nEnumEventSize; nEnumEventCounter++ )
- {
- minicontrol_error_e nRet = minicontrol_send_event(minicontrol_window, event_viewer[nEnumEventCounter], NULL);
- PRINT_RESULT(MINICONTROL_ERROR_NONE, nRet, "minicontrol_send_event", MinicontrolGetError(nRet));
- }
- evas_object_hide(minicontrol_window);
- return 0;
-}
-
-/** @}*/
-/** @}*/
+++ /dev/null
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Apache License, Version 2.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#include <stdio.h>
-#include <string.h>
-#include "tct_common.h"
-
-#ifdef MOBILE //Starts MOBILE
-#include "tct-minicontrol-native_mobile.h"
-#endif //MOBILE //End MOBILE
-
-#ifdef WEARABLE //Starts WEARABLE
-#include "tct-minicontrol-native_wearable.h"
-#endif //WEARABLE //End WEARABLE
-
-#ifdef TV //Starts TV
-#include "tct-minicontrol-native_tv.h"
-#endif //TV //End TV
-
-#ifdef TIZENIOT //Starts TIZENIOT
-#include "tct-minicontrol-native_tizeniot.h"
-#endif //TIZENIOT //End TIZENIOT
-
-
-#include <malloc.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <glib.h>
-#include <stdbool.h>
-
-#include <app.h>
-#include <dlog.h>
-
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <errno.h>
-
-static bool app_create(void *data)
-{
- return true;
-}
-
-static void app_control(app_control_h app_control, void *data)
-{
- char* pszGetTCName = NULL;
- int i=0, result=0, nRet=0;
- nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName);
- if(nRet != APP_CONTROL_ERROR_NONE)
- {
- dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet);
- PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__);
- PRINT_TC_RESULT("%d",1);
- FREE_MEMORY_TC(pszGetTCName);
- return;
- }
-
- dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName);
- for ( i = 0; tc_array[i].name; i++ )
- {
- if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) )
- {
- dlog_print(DLOG_INFO, "NativeTCT", "%s : Startup begin", pszGetTCName);
- if ( tc_array[i].startup )
- {
- tc_array[i].startup();
- }
- dlog_print(DLOG_INFO, "NativeTCT", "%s : Startup end", pszGetTCName);
-
- dlog_print(DLOG_INFO, "NativeTCT", "%s : Body begin", pszGetTCName);
- result = tc_array[i].function();
- dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result);
- dlog_print(DLOG_INFO, "NativeTCT", "%s : Body end", pszGetTCName);
-
- dlog_print(DLOG_INFO, "NativeTCT", "%s : Cleanup begin", pszGetTCName);
- if ( tc_array[i].cleanup )
- {
- tc_array[i].cleanup();
- }
- dlog_print(DLOG_INFO, "NativeTCT", "%s : Cleanup end", pszGetTCName);
- PRINT_TC_RESULT("%d",result);
- FREE_MEMORY_TC(pszGetTCName);
- ui_app_exit();
- return;
- }
- }
-
- dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName);
- PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName);
- PRINT_TC_RESULT("%d",1);
- FREE_MEMORY_TC(pszGetTCName);
- return;
-}
-
-static void app_terminate(void *data)
-{
- dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__);
-}
-
-int main(int argc, char *argv[])
-{
- int ret = 0;
-
- ui_app_lifecycle_callback_s event_callback = {0,};
- event_callback.create = app_create;
- event_callback.terminate = app_terminate;
- event_callback.app_control = app_control;
-
- //setting gcda file location for coverage
- setenv("GCOV_PREFIX","/tmp",1);
- dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Coverage *.gcda File location set to /tmp/home/abuild/rpmbuild/BUILD/ ", __FUNCTION__, __LINE__);
-
- dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__);
- ret = ui_app_main(argc, argv, &event_callback, NULL);
- if (ret != APP_ERROR_NONE)
- {
- dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret);
- PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret);
- PRINT_TC_RESULT("%d",1);
- return ret;
- }
-
- dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__);
- return ret;
-}
+++ /dev/null
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Apache License, Version 2.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#ifndef __TCT_MINICONTROL-NATIVE_H__
-#define __TCT_MINICONTROL-NATIVE_H__
-
-#include "testcase.h"
-#include "tct_common.h"
-
-extern void ITs_minicontrol_startup(void);
-extern void ITs_minicontrol_cleanup(void);
-
-extern int ITc_minicontrol_viewer_add_p(void);
-extern int ITc_minicontrol_viewer_send_event_p(void);
-extern int ITc_minicontrol_viewer_set_unset_event_cb_p(void);
-extern int ITc_minicontrol_create_window_p(void);
-extern int ITc_minicontrol_send_event_p(void);
-
-testcase tc_array[] = {
- {"ITc_minicontrol_viewer_add_p",ITc_minicontrol_viewer_add_p,ITs_minicontrol_startup,ITs_minicontrol_cleanup},
- {"ITc_minicontrol_viewer_send_event_p",ITc_minicontrol_viewer_send_event_p,ITs_minicontrol_startup,ITs_minicontrol_cleanup},
- {"ITc_minicontrol_viewer_set_unset_event_cb_p",ITc_minicontrol_viewer_set_unset_event_cb_p,ITs_minicontrol_startup,ITs_minicontrol_cleanup},
- {"ITc_minicontrol_create_window_p",ITc_minicontrol_create_window_p,ITs_minicontrol_startup,ITs_minicontrol_cleanup},
- {"ITc_minicontrol_send_event_p",ITc_minicontrol_send_event_p,ITs_minicontrol_startup,ITs_minicontrol_cleanup},
- {NULL, NULL}
-};
-
-#endif // __TCT_MINICONTROL-NATIVE_H__
+++ /dev/null
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Apache License, Version 2.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#ifndef __TCT_MINICONTROL-NATIVE_H__
-#define __TCT_MINICONTROL-NATIVE_H__
-
-#include "testcase.h"
-#include "tct_common.h"
-
-extern void ITs_minicontrol_startup(void);
-extern void ITs_minicontrol_cleanup(void);
-
-extern int ITc_minicontrol_viewer_add_p(void);
-extern int ITc_minicontrol_viewer_send_event_p(void);
-extern int ITc_minicontrol_viewer_set_unset_event_cb_p(void);
-extern int ITc_minicontrol_create_window_p(void);
-extern int ITc_minicontrol_send_event_p(void);
-
-testcase tc_array[] = {
- {"ITc_minicontrol_viewer_add_p",ITc_minicontrol_viewer_add_p,ITs_minicontrol_startup,ITs_minicontrol_cleanup},
- {"ITc_minicontrol_viewer_send_event_p",ITc_minicontrol_viewer_send_event_p,ITs_minicontrol_startup,ITs_minicontrol_cleanup},
- {"ITc_minicontrol_viewer_set_unset_event_cb_p",ITc_minicontrol_viewer_set_unset_event_cb_p,ITs_minicontrol_startup,ITs_minicontrol_cleanup},
- {"ITc_minicontrol_create_window_p",ITc_minicontrol_create_window_p,ITs_minicontrol_startup,ITs_minicontrol_cleanup},
- {"ITc_minicontrol_send_event_p",ITc_minicontrol_send_event_p,ITs_minicontrol_startup,ITs_minicontrol_cleanup},
- {NULL, NULL}
-};
-
-#endif // __TCT_MINICONTROL-NATIVE_H__
+++ /dev/null
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Apache License, Version 2.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#ifndef __TCT_MINICONTROL-NATIVE_H__
-#define __TCT_MINICONTROL-NATIVE_H__
-
-#include "testcase.h"
-#include "tct_common.h"
-
-extern void ITs_minicontrol_startup(void);
-extern void ITs_minicontrol_cleanup(void);
-
-extern int ITc_minicontrol_viewer_add_p(void);
-extern int ITc_minicontrol_viewer_send_event_p(void);
-extern int ITc_minicontrol_viewer_set_unset_event_cb_p(void);
-extern int ITc_minicontrol_create_window_p(void);
-extern int ITc_minicontrol_send_event_p(void);
-
-testcase tc_array[] = {
- {"ITc_minicontrol_viewer_add_p",ITc_minicontrol_viewer_add_p,ITs_minicontrol_startup,ITs_minicontrol_cleanup},
- {"ITc_minicontrol_viewer_send_event_p",ITc_minicontrol_viewer_send_event_p,ITs_minicontrol_startup,ITs_minicontrol_cleanup},
- {"ITc_minicontrol_viewer_set_unset_event_cb_p",ITc_minicontrol_viewer_set_unset_event_cb_p,ITs_minicontrol_startup,ITs_minicontrol_cleanup},
- {"ITc_minicontrol_create_window_p",ITc_minicontrol_create_window_p,ITs_minicontrol_startup,ITs_minicontrol_cleanup},
- {"ITc_minicontrol_send_event_p",ITc_minicontrol_send_event_p,ITs_minicontrol_startup,ITs_minicontrol_cleanup},
- {NULL, NULL}
-};
-
-#endif // __TCT_MINICONTROL-NATIVE_H__
+++ /dev/null
-SET(PKG_NAME "minicontrol")
-
-SET(EXEC_NAME "tct-${PKG_NAME}-core")
-SET(RPM_NAME "core-${PKG_NAME}-tests")
-
-SET(CAPI_LIB "minicontrol")
-SET(TC_SOURCES
- utc-minicontrol.c
-)
-
-PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
- ${CAPI_LIB}-viewer
- ${CAPI_LIB}-provider
- capi-appfw-application
- bundle
- glib-2.0
- capi-system-info
- elementary
- dlog elementary
-)
-INCLUDE_DIRECTORIES(
- ${${CAPI_LIB}_INCLUDE_DIRS}
-)
-
-ADD_EXECUTABLE(${EXEC_NAME} ${EXEC_NAME}.c ${TC_SOURCES} ${COMMON_FILE})
-TARGET_LINK_LIBRARIES(${EXEC_NAME}
- ${${CAPI_LIB}_LIBRARIES}
- bundle
-)
-
-INSTALL(PROGRAMS ${EXEC_NAME}
- DESTINATION ${BIN_DIR}/${RPM_NAME}/bin
-)
-
-IF( DEFINED ASAN )
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Wall -pie -g -fsanitize=address -fsanitize-recover=address -U_FORTIFY_SOURCE -fno-omit-frame-pointer")
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib -Wl,-fsanitize=address")
-ELSE()
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g -fPIE -Wall")
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib -pie")
-ENDIF()
+++ /dev/null
-//\r
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
-//\r
-// Licensed under the Apache License, Version 2.0 (the License);\r
-// you may not use this file except in compliance with the License.\r
-// You may obtain a copy of the License at\r
-//\r
-// http://www.apache.org/licenses/LICENSE-2.0\r
-//\r
-// Unless required by applicable law or agreed to in writing, software\r
-// distributed under the License is distributed on an "AS IS" BASIS,\r
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-// See the License for the specific language governing permissions and\r
-// limitations under the License.\r
-//\r
-#include <stdio.h>\r
-#include <string.h>\r
-#include <malloc.h>\r
-#include <unistd.h>\r
-#include <sys/types.h>\r
-#include <sys/stat.h>\r
-#include <sys/wait.h>\r
-#include <glib.h>\r
-#include <stdbool.h>\r
-#include "tct_common.h"\r
-#include <app.h>\r
-#include <dlog.h>\r
-\r
-#include <Elementary.h>\r
-\r
-#ifdef MOBILE\r
-#include "tct-minicontrol-core_mobile.h"\r
-#endif\r
-#ifdef TV\r
-#include "tct-minicontrol-core_tv.h"\r
-#endif // TV\r
-#ifdef WEARABLE\r
-#include "tct-minicontrol-core_wearable.h"\r
-#endif //WEARABLE\r
-\r
-#ifdef TIZENIOT \r
-#include "tct-minicontrol-core_tizeniot.h"\r
-#endif //TIZENIOT\r
-\r
-typedef struct appdata {\r
- Evas_Object *win;\r
- Evas_Object *conform;\r
- Evas_Object *label;\r
-} appdata_s;\r
-\r
-static bool app_create(void *data)\r
-{\r
- return true;\r
-}\r
-\r
-static void app_control(app_control_h app_control, void *data)\r
-{\r
- char* pszGetTCName = NULL;\r
- int i=0, result=0, nRet=0;\r
- nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName);\r
- if(nRet != APP_CONTROL_ERROR_NONE)\r
- {\r
- dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet);\r
- PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__);\r
- PRINT_TC_RESULT("%d",1);\r
- FREE_MEMORY_TC(pszGetTCName);\r
- return;\r
- }\r
-\r
- dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName);\r
- for ( i = 0; tc_array[i].name; i++ )\r
- {\r
- if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) )\r
- {\r
- DUMP_UTC_ERRLOG();\r
- dlog_print(DLOG_INFO, "NativeTCT", "%s : Startup begin", pszGetTCName);\r
- if ( tc_array[i].startup )\r
- {
- tc_array[i].startup();
- }\r
- dlog_print(DLOG_INFO, "NativeTCT", "%s : Startup end", pszGetTCName);\r
-\r
- dlog_print(DLOG_INFO, "NativeTCT", "%s : Body begin", pszGetTCName);
- result = tc_array[i].function();\r
- dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result);
- dlog_print(DLOG_INFO, "NativeTCT", "%s : Body end", pszGetTCName);
-\r
- dlog_print(DLOG_INFO, "NativeTCT", "%s : Cleanup begin", pszGetTCName);\r
- if ( tc_array[i].cleanup )\r
- {
- tc_array[i].cleanup();
- }\r
- dlog_print(DLOG_INFO, "NativeTCT", "%s : Cleanup end", pszGetTCName);\r
-\r
- CLOSE_UTC_ERRLOG();\r
- PRINT_TC_RESULT("%d",result);\r
- FREE_MEMORY_TC(pszGetTCName);\r
- return;\r
- }\r
- }\r
-\r
- dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName);\r
- PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName);\r
- PRINT_TC_RESULT("%d",1);\r
- FREE_MEMORY_TC(pszGetTCName);\r
- return;\r
-}\r
-\r
-static void app_terminate(void *data)\r
-{\r
- dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__);\r
-}\r
-\r
-int main(int argc, char *argv[])\r
-{\r
- int ret = 0;\r
- appdata_s ad = {0,};\r
-\r
- ui_app_lifecycle_callback_s event_callback = {0,};\r
- event_callback.create = app_create;\r
- event_callback.terminate = app_terminate;\r
- event_callback.app_control = app_control;\r
-\r
- //setting gcda file location for coverage\r
- setenv("GCOV_PREFIX","/tmp",1);\r
- dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Coverage *.gcda File location set to /tmp/home/abuild/rpmbuild/BUILD/ ", __FUNCTION__, __LINE__);\r
-\r
- dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__);\r
- ret = ui_app_main(argc, argv, &event_callback, &ad);\r
- if (ret != APP_ERROR_NONE)\r
- {\r
- dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret);\r
- PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret);\r
- PRINT_TC_RESULT("%d",1);\r
- return ret;\r
- }\r
-\r
- dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__);\r
- return ret;\r
-}\r
+++ /dev/null
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Apache License, Version 2.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#ifndef __TCT_MINICONTROL-NATIVE_H__
-#define __TCT_MINICONTROL-NATIVE_H__
-
-#include "testcase.h"
-#include "tct_common.h"
-
-extern void utc_minicontrol_startup(void);
-extern void utc_minicontrol_cleanup(void);
-
-extern int utc_minicontrol_create_window_p(void);
-extern int utc_minicontrol_create_window_n(void);
-extern int utc_minicontrol_send_event_p(void);
-extern int utc_minicontrol_send_event_n(void);
-extern int utc_minicontrol_viewer_add_p(void);
-extern int utc_minicontrol_viewer_add_n(void);
-extern int utc_minicontrol_viewer_send_event_p1(void);
-extern int utc_minicontrol_viewer_send_event_p2(void);
-extern int utc_minicontrol_viewer_send_event_n(void);
-extern int utc_minicontrol_viewer_set_event_cb_p(void);
-extern int utc_minicontrol_viewer_set_event_cb_n(void);
-extern int utc_minicontrol_viewer_unset_event_cb_p(void);
-
-testcase tc_array[] = {
- {"utc_minicontrol_create_window_p",utc_minicontrol_create_window_p,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_create_window_n",utc_minicontrol_create_window_n,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_send_event_p",utc_minicontrol_send_event_p,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_send_event_n",utc_minicontrol_send_event_n,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_viewer_add_p",utc_minicontrol_viewer_add_p,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_viewer_add_n",utc_minicontrol_viewer_add_n,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_viewer_send_event_p1",utc_minicontrol_viewer_send_event_p1,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_viewer_send_event_p2",utc_minicontrol_viewer_send_event_p2,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_viewer_send_event_n",utc_minicontrol_viewer_send_event_n,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_viewer_set_event_cb_p",utc_minicontrol_viewer_set_event_cb_p,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_viewer_set_event_cb_n",utc_minicontrol_viewer_set_event_cb_n,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_viewer_unset_event_cb_p",utc_minicontrol_viewer_unset_event_cb_p,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {NULL, NULL}
-};
-
-#endif // __TCT_MINICONTROL-NATIVE_H__
+++ /dev/null
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Apache License, Version 2.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#ifndef __TCT_MINICONTROL-NATIVE_H__
-#define __TCT_MINICONTROL-NATIVE_H__
-
-#include "testcase.h"
-#include "tct_common.h"
-
-extern void utc_minicontrol_startup(void);
-extern void utc_minicontrol_cleanup(void);
-
-extern int utc_minicontrol_create_window_p(void);
-extern int utc_minicontrol_create_window_n(void);
-extern int utc_minicontrol_send_event_p(void);
-extern int utc_minicontrol_send_event_n(void);
-extern int utc_minicontrol_viewer_add_p(void);
-extern int utc_minicontrol_viewer_add_n(void);
-extern int utc_minicontrol_viewer_send_event_p1(void);
-extern int utc_minicontrol_viewer_send_event_p2(void);
-extern int utc_minicontrol_viewer_send_event_n(void);
-extern int utc_minicontrol_viewer_set_event_cb_p(void);
-extern int utc_minicontrol_viewer_set_event_cb_n(void);
-extern int utc_minicontrol_viewer_unset_event_cb_p(void);
-
-testcase tc_array[] = {
- {"utc_minicontrol_create_window_p",utc_minicontrol_create_window_p,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_create_window_n",utc_minicontrol_create_window_n,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_send_event_p",utc_minicontrol_send_event_p,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_send_event_n",utc_minicontrol_send_event_n,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_viewer_add_p",utc_minicontrol_viewer_add_p,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_viewer_add_n",utc_minicontrol_viewer_add_n,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_viewer_send_event_p1",utc_minicontrol_viewer_send_event_p1,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_viewer_send_event_p2",utc_minicontrol_viewer_send_event_p2,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_viewer_send_event_n",utc_minicontrol_viewer_send_event_n,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_viewer_set_event_cb_p",utc_minicontrol_viewer_set_event_cb_p,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_viewer_set_event_cb_n",utc_minicontrol_viewer_set_event_cb_n,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_viewer_unset_event_cb_p",utc_minicontrol_viewer_unset_event_cb_p,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {NULL, NULL}
-};
-
-#endif // __TCT_MINICONTROL-NATIVE_H__
+++ /dev/null
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Apache License, Version 2.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#ifndef __TCT_MINICONTROL-NATIVE_H__
-#define __TCT_MINICONTROL-NATIVE_H__
-
-#include "testcase.h"
-#include "tct_common.h"
-
-extern void utc_minicontrol_startup(void);
-extern void utc_minicontrol_cleanup(void);
-
-extern int utc_minicontrol_create_window_p(void);
-extern int utc_minicontrol_create_window_n(void);
-extern int utc_minicontrol_send_event_p(void);
-extern int utc_minicontrol_send_event_n(void);
-extern int utc_minicontrol_viewer_add_p(void);
-extern int utc_minicontrol_viewer_add_n(void);
-extern int utc_minicontrol_viewer_send_event_p1(void);
-extern int utc_minicontrol_viewer_send_event_p2(void);
-extern int utc_minicontrol_viewer_send_event_n(void);
-extern int utc_minicontrol_viewer_set_event_cb_p(void);
-extern int utc_minicontrol_viewer_set_event_cb_n(void);
-extern int utc_minicontrol_viewer_unset_event_cb_p(void);
-
-testcase tc_array[] = {
- {"utc_minicontrol_create_window_p",utc_minicontrol_create_window_p,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_create_window_n",utc_minicontrol_create_window_n,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_send_event_p",utc_minicontrol_send_event_p,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_send_event_n",utc_minicontrol_send_event_n,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_viewer_add_p",utc_minicontrol_viewer_add_p,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_viewer_add_n",utc_minicontrol_viewer_add_n,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_viewer_send_event_p1",utc_minicontrol_viewer_send_event_p1,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_viewer_send_event_p2",utc_minicontrol_viewer_send_event_p2,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_viewer_send_event_n",utc_minicontrol_viewer_send_event_n,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_viewer_set_event_cb_p",utc_minicontrol_viewer_set_event_cb_p,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_viewer_set_event_cb_n",utc_minicontrol_viewer_set_event_cb_n,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {"utc_minicontrol_viewer_unset_event_cb_p",utc_minicontrol_viewer_unset_event_cb_p,utc_minicontrol_startup,utc_minicontrol_cleanup},
- {NULL, NULL}
-};
-
-#endif // __TCT_MINICONTROL-NATIVE_H__
+++ /dev/null
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Apache License, Version 2.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#include "assert.h"
-#include <glib.h>
-#include <Evas.h>
-#include <Elementary.h>
-
-#include <system_info.h>
-
-#include <minicontrol-provider.h>
-#include <minicontrol-viewer.h>
-#include <minicontrol-type.h>
-#include <minicontrol-error.h>
-
-#define MINICONTROL_FEATURE "http://tizen.org/feature/minicontrol"
-
-#define CHECK_MINICONTROL_FEATURE_WITH_RET(function) \
- do { \
- bool is_supported = false; \
- if (!system_info_get_platform_bool(MINICONTROL_FEATURE, &is_supported)) { \
- if (is_supported == false) { \
- int check_suppoted = function; \
- assert_eq(check_suppoted, MINICONTROL_ERROR_NOT_SUPPORTED); \
- return 0; \
- } \
- } \
- } while (0)
-
-#define CHECK_MINICONTROL_FEATURE_WITHOUT_RET(function) \
- do { \
- bool is_supported = false; \
- if (!system_info_get_platform_bool(MINICONTROL_FEATURE, &is_supported)) { \
- if (is_supported == false) { \
- function; \
- assert_eq(get_last_result(), MINICONTROL_ERROR_NOT_SUPPORTED); \
- return 0; \
- } \
- } \
- } while (0)
-
-#define MINICONTROL_NAME "minicontrol-utc"
-#define TARGET_APP_ID "org.tizen.music-player"
-
-static int event_result;
-
-/**
- * @function utc_minicontrol_startup
- * @description Called before each test
- * @parameter NA
- * @return NA
- */
-void utc_minicontrol_startup(void)
-{
-}
-
-/**
- * @function utc_minicontrol_cleanup
- * @description Called after each test
- * @parameter NA
- * @return NA
- */
-void utc_minicontrol_cleanup(void)
-{
-}
-
-
-static void _minicontrol_cb(minicontrol_viewer_event_e event_type, bundle *event_arg)
-{
-}
-
-
-/**
- * @testcase utc_minicontrol_create_window_p
- * @since_tizen 2.4
- * @description Positive test case of minicontrol_create_window()
- */
-int utc_minicontrol_create_window_p(void)
-{
- Evas_Object *minicontrol_window = NULL;
-
- CHECK_MINICONTROL_FEATURE_WITHOUT_RET(minicontrol_create_window(MINICONTROL_NAME, MINICONTROL_TARGET_VIEWER_QUICK_PANEL, _minicontrol_cb));
-
- minicontrol_window = minicontrol_create_window(MINICONTROL_NAME, MINICONTROL_TARGET_VIEWER_QUICK_PANEL, _minicontrol_cb);
- assert_neq(minicontrol_window, NULL);
- evas_object_del(minicontrol_window);
-
- return 0;
-}
-
-/**
- * @testcase utc_minicontrol_create_window_n
- * @since_tizen 2.4
- * @description Negative test case of minicontrol_create_window()
- */
-int utc_minicontrol_create_window_n(void)
-{
- Evas_Object *minicontrol_window = NULL;
-
- CHECK_MINICONTROL_FEATURE_WITHOUT_RET(minicontrol_create_window(NULL, MINICONTROL_TARGET_VIEWER_QUICK_PANEL, NULL));
-
- minicontrol_window = minicontrol_create_window(NULL, MINICONTROL_TARGET_VIEWER_QUICK_PANEL, NULL);
- assert_eq(minicontrol_window, NULL);
-
- return 0;
-}
-
-/**
- * @testcase utc_minicontrol_send_event_p
- * @since_tizen 2.4
- * @description Positive test case of minicontrol_send_event()
- */
-int utc_minicontrol_send_event_p(void)
-{
- int err = MINICONTROL_ERROR_NONE;
- Evas_Object *minicontrol_window = NULL;
-
- CHECK_MINICONTROL_FEATURE_WITHOUT_RET(minicontrol_create_window(MINICONTROL_NAME, MINICONTROL_TARGET_VIEWER_QUICK_PANEL, _minicontrol_cb));
-
- minicontrol_window = minicontrol_create_window(MINICONTROL_NAME, MINICONTROL_TARGET_VIEWER_QUICK_PANEL, _minicontrol_cb);
- assert_neq(minicontrol_window, NULL);
-
- err = minicontrol_send_event(minicontrol_window, MINICONTROL_PROVIDER_EVENT_REQUEST_HIDE, NULL);
- assert_eq(err, MINICONTROL_ERROR_NONE);
-
- evas_object_del(minicontrol_window);
-
- return 0;
-}
-
-/**
- * @testcase utc_minicontrol_send_event_n
- * @since_tizen 2.4
- * @description Negative test case of minicontrol_send_event()
- */
-int utc_minicontrol_send_event_n(void)
-{
- int err = MINICONTROL_ERROR_NONE;
-
- CHECK_MINICONTROL_FEATURE_WITH_RET(minicontrol_send_event(NULL, MINICONTROL_PROVIDER_EVENT_REQUEST_HIDE, NULL));
-
- err = minicontrol_send_event(NULL, MINICONTROL_PROVIDER_EVENT_REQUEST_HIDE, NULL);
- assert_eq(err, MINICONTROL_ERROR_INVALID_PARAMETER);
-
- return 0;
-}
-
-static int g_utc_minicontrol_viewer_add_p_result = 0;
-static GMainLoop *g_mainloop = NULL;
-static guint g_timeout_id = 0;
-
-static gboolean timeout_function(gpointer data)
-{
- g_main_loop_quit(g_mainloop);
- g_timeout_id = 0;
- g_utc_minicontrol_viewer_add_p_result = 1;
- return FALSE;
-}
-
-static inline void wait_for_async(void)
-{
- if (g_mainloop) {
- if (g_timeout_id) {
- g_source_remove(g_timeout_id);
- g_timeout_id = 0;
- }
- g_main_loop_quit(g_mainloop);
- g_mainloop = NULL;
- }
-
- g_mainloop = g_main_loop_new(NULL, FALSE);
-
- g_timeout_id = g_timeout_add(5000, timeout_function, NULL);
-
- g_main_loop_run(g_mainloop);
-
- if (g_timeout_id > 0) {
- g_source_remove(g_timeout_id);
- g_timeout_id = 0;
- }
- g_mainloop = NULL;
-}
-
-void viewer_event_callback(minicontrol_event_e event, const char *minicontrol_name, bundle *event_arg, void *data)
-{
- Evas_Object *parent_window = NULL;
- Evas_Object *viewer = NULL;
-
- event_result = 1;
- parent_window = elm_win_add(NULL, "parent_window", ELM_WIN_BASIC);
-
- evas_object_resize(parent_window, 480, 800);
-
- viewer = minicontrol_viewer_add(parent_window, minicontrol_name);
- g_utc_minicontrol_viewer_add_p_result = (viewer != NULL) ? 0 : 1;
-
- evas_object_del(viewer);
- evas_object_del(parent_window);
-
- g_main_loop_quit(g_mainloop);
- g_mainloop = NULL;
-}
-
-/**
- * @testcase utc_minicontrol_viewer_add_p
- * @since_tizen 2.4
- * @description Positive test case of minicontrol_viewer_add()
- */
-int utc_minicontrol_viewer_add_p(void)
-{
- int err = MINICONTROL_ERROR_NONE;
- Evas_Object *minicontrol_window = NULL;
-
- CHECK_MINICONTROL_FEATURE_WITHOUT_RET(minicontrol_viewer_add(NULL, NULL));
-
- g_utc_minicontrol_viewer_add_p_result = 0;
-
- err = minicontrol_viewer_set_event_cb(viewer_event_callback, "user_data");
- assert_eq(err, MINICONTROL_ERROR_NONE);
-
- minicontrol_window = minicontrol_create_window(MINICONTROL_NAME, MINICONTROL_TARGET_VIEWER_QUICK_PANEL, _minicontrol_cb);
- assert_neq(minicontrol_window, NULL);
-
- elm_win_alpha_set(minicontrol_window, EINA_TRUE);
- evas_object_resize(minicontrol_window, 480, 800);
- evas_object_show(minicontrol_window);
-
- wait_for_async();
-
- assert_eq(g_utc_minicontrol_viewer_add_p_result, 0);
- minicontrol_viewer_unset_event_cb();
- evas_object_del(minicontrol_window);
-
- return 0;
-}
-
-/**
- * @testcase utc_minicontrol_viewer_add_n
- * @since_tizen 2.4
- * @description Negative test case of minicontrol_viewer_add()
- */
-int utc_minicontrol_viewer_add_n(void)
-{
- Evas_Object *viewer = NULL;
-
- CHECK_MINICONTROL_FEATURE_WITHOUT_RET(minicontrol_viewer_add(NULL, NULL));
-
- viewer = minicontrol_viewer_add(NULL, NULL);
- assert_eq(viewer, NULL);
-
- return 0;
-}
-
-/**
- * @testcase utc_minicontrol_viewer_send_event_p1
- * @since_tizen 2.4
- * @description Positive test case of minicontrol_viewer_send_event()
- */
-int utc_minicontrol_viewer_send_event_p1(void)
-{
- int err = MINICONTROL_ERROR_NONE;
- bundle *event_arg = NULL;
-
- CHECK_MINICONTROL_FEATURE_WITH_RET(minicontrol_viewer_send_event(TARGET_APP_ID, MINICONTROL_VIEWER_EVENT_REPORT_ANGLE, event_arg));
-
- err = minicontrol_viewer_send_event(TARGET_APP_ID, MINICONTROL_VIEWER_EVENT_REPORT_ANGLE, event_arg);
- assert_eq(err, MINICONTROL_ERROR_NONE);
- return 0;
-}
-
-static gboolean __send_event(gpointer data)
-{
- minicontrol_viewer_send_event(MINICONTROL_NAME, MINICONTROL_VIEWER_EVENT_REPORT_ANGLE, NULL);
-
- return FALSE;
-}
-
-/**
- * @testcase utc_minicontrol_viewer_send_event_p2
- * @since_tizen 2.4
- * @description Positive test case of minicontrol_viewer_send_event()
- */
-int utc_minicontrol_viewer_send_event_p2(void)
-{
- int ret;
- Evas_Object *minicontrol_window = NULL;
-
- CHECK_MINICONTROL_FEATURE_WITH_RET(minicontrol_viewer_send_event(MINICONTROL_NAME, MINICONTROL_VIEWER_EVENT_REPORT_ANGLE, NULL));
-
- minicontrol_window = minicontrol_create_window(MINICONTROL_NAME, MINICONTROL_TARGET_VIEWER_QUICK_PANEL, _minicontrol_cb);
- assert_neq(minicontrol_window, NULL);
-
- elm_win_alpha_set(minicontrol_window, EINA_TRUE);
- evas_object_resize(minicontrol_window, 480, 800);
- evas_object_show(minicontrol_window);
-
- ret = minicontrol_viewer_set_event_cb(viewer_event_callback, NULL);
- assert_eq(ret, MINICONTROL_ERROR_NONE);
-
- g_idle_add(__send_event, NULL);
-
- wait_for_async();
-
- assert_eq(event_result, 1);
- minicontrol_viewer_unset_event_cb();
- evas_object_del(minicontrol_window);
-
- return 0;
-}
-
-/**
- * @testcase utc_minicontrol_viewer_send_event_n
- * @since_tizen 2.4
- * @description Negative test case of minicontrol_viewer_send_event()
- */
-int utc_minicontrol_viewer_send_event_n(void)
-{
- int err = MINICONTROL_ERROR_NONE;
-
- CHECK_MINICONTROL_FEATURE_WITH_RET(minicontrol_viewer_send_event(NULL, 0, NULL));
-
- err = minicontrol_viewer_send_event(NULL, 0, NULL);
- assert_eq(err, MINICONTROL_ERROR_INVALID_PARAMETER);
- return 0;
-}
-
-void viewer_event_empty_callback(minicontrol_event_e event, const char *minicontrol_name, bundle *event_arg, void *data)
-{
-
-}
-
-/**
- * @testcase utc_minicontrol_viewer_set_event_cb_p
- * @since_tizen 2.4
- * @description Positive test case of minicontrol_viewer_set_event_cb()
- */
-int utc_minicontrol_viewer_set_event_cb_p(void)
-{
- int err = MINICONTROL_ERROR_NONE;
-
- CHECK_MINICONTROL_FEATURE_WITH_RET(minicontrol_viewer_set_event_cb(viewer_event_empty_callback, "user_data"));
-
- err = minicontrol_viewer_set_event_cb(viewer_event_empty_callback, "user_data");
- assert_eq(err, MINICONTROL_ERROR_NONE);
- minicontrol_viewer_unset_event_cb();
- return 0;
-}
-
-/**
- * @testcase utc_minicontrol_viewer_set_event_cb_n
- * @since_tizen 2.4
- * @description Negative test case of minicontrol_viewer_set_event_cb()
- */
-int utc_minicontrol_viewer_set_event_cb_n(void)
-{
- int err = MINICONTROL_ERROR_NONE;
-
- CHECK_MINICONTROL_FEATURE_WITH_RET(minicontrol_viewer_set_event_cb(NULL, NULL));
-
- err = minicontrol_viewer_set_event_cb(NULL, NULL);
- assert_eq(err, MINICONTROL_ERROR_INVALID_PARAMETER);
-
- return 0;
-}
-
-
-/**
- * @testcase utc_minicontrol_viewer_unset_event_cb_p
- * @since_tizen 2.4
- * @description Positive test case of minicontrol_viewer_unset_event_cb()
- */
-int utc_minicontrol_viewer_unset_event_cb_p(void)
-{
- int err = MINICONTROL_ERROR_NONE;
-
- CHECK_MINICONTROL_FEATURE_WITH_RET(minicontrol_viewer_unset_event_cb());
-
- err = minicontrol_viewer_unset_event_cb();
- assert_eq(err, MINICONTROL_ERROR_NONE);
-
- return 0;
-}
tv:armv7l:utc:wifi-direct;
tv:armv7l:utc:badge;
tv:armv7l:utc:job-scheduler;
-tv:armv7l:utc:minicontrol;
tv:armv7l:utc:shortcut;
tv:armv7l:utc:smartcard;
tv:armv7l:utc:mediacodec;
tv:armv7l:itc:stc;
tv:armv7l:itc:wifi-direct;
tv:armv7l:itc:job-scheduler;
-tv:armv7l:itc:minicontrol;
tv:armv7l:itc:smartcard;
tv:armv7l:itc:mediacodec;
tv:armv7l:itc:capi-mediademuxer;