<desc>test</desc>
<domain>System</domain>
</action>
+ <action name="vconf.db.bluetooth.status" type="int" since="5.5" plugin="vconf">
+ <alias name="VCONFKEY_BT_STATUS_OFF">0</alias>
+ <alias name="VCONFKEY_BT_STATUS_ON">1</alias>
+ <alias name="VCONFKEY_BT_STATUS_BT_VISIBLE">2</alias>
+ <alias name="VCONFKEY_BT_STATUS_TRANSFER">4</alias>
+ <defaultVal>0</defaultVal>
+ <desc>test</desc>
+ <domain>Network & Connectivity</domain>
+ </action>
<action name="browser.url" type="string" since="5.5" plugin="web">
<defaultVal>about:blank</defaultVal>
<desc>browser</desc>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<tizenModes xmlns="http://www.tizen.org" version="5.5">
+ <mode name="powerSave" type="exclusive">
+ <req action="vconf.db.setting.psmode">SETTING_PSMODE_WEARABLE_ENHANCED</req>
+ <req action="vconf.db.bluetooth.status">VCONFKEY_BT_STATUS_OFF</req>
+ </mode>
+</tizenModes>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<tizenModes xmlns="http://www.tizen.org" version="5.5">
+ <mode name="wifiOn" type="exclusive">
+ <req action="wifi.power">on</req>
+ </mode>
+</tizenModes>
%manifest %{name}.manifest
%license LICENSE.APLv2
%{modes_test_dir}/modes-gtest-*
+%{modes_test_dir}/modes-apply-mode-test
#=======================================================================================#
SET(GTEST_CLIENT "modes-gtest-client")
-SET(GTEST_CLIENT_SRCS
- ${SUPERVISOR_DIR}/XMLParser.cpp
- ${SUPERVISOR_DIR}/ModeManager.cpp
- ${SUPERVISOR_DIR}/ModeXMLParser.cpp
- ${SUPERVISOR_DIR}/Req.cpp
- ${SUPERVISOR_DIR}/ActionSchema.cpp
- ${SUPERVISOR_DIR}/ActionSchemaManager.cpp
- ${SUPERVISOR_DIR}/Mode.cpp
- ${SUPERVISOR_DIR}/ModesEx.cpp
- ${SUPERVISOR_DIR}/PluginManager.cpp
- ${SUPERVISOR_DIR}/Supervisor.cpp
- ${SUPERVISOR_DIR}/ArgumentParser.cpp
- ${SUPERVISOR_DIR}/RequestHandler.cpp
- ${SUPERVISOR_DIR}/ClientConnection.cpp
- ${CMAKE_SOURCE_DIR}/client/mdsc.c
- ${CMAKE_SOURCE_DIR}/common/dbus.c
- "modes_test_client.cpp"
- )
+SET(GTEST_CLIENT_SRCS "modes_test_client.cpp")
ADD_EXECUTABLE(${GTEST_CLIENT} ${SRC} ${GTEST_CLIENT_SRCS})
-ADD_DEPENDENCIES(${GTEST_CLIENT} GENERATED_DBUS_CODE)
-TARGET_LINK_LIBRARIES(${GTEST_CLIENT} ${gtest_pkgs_LIBRARIES} dl)
+TARGET_LINK_LIBRARIES(${GTEST_CLIENT} ${CLIENT} ${gtest_pkgs_LIBRARIES})
INSTALL(TARGETS ${GTEST_CLIENT} DESTINATION ${TEST_INSTALL_DIR})
+
#=======================================================================================#
+SET(TEST_APPLY_MODE "modes-apply-mode-test")
+SET(TEST_APPLY_MODE_SRC "modes_apply_mode.c")
+ADD_EXECUTABLE(${TEST_APPLY_MODE} ${TEST_APPLY_MODE_SRC})
+TARGET_LINK_LIBRARIES(${TEST_APPLY_MODE} ${CLIENT})
+INSTALL(TARGETS ${TEST_APPLY_MODE} DESTINATION ${TEST_INSTALL_DIR})
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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 <glib.h>
+#include <modes.h>
+
+#define MDS_STDOUT
+#include "common/log.h"
+
+static GMainLoop *t_apply_loop;
+
+static gboolean request_idler(gpointer data)
+{
+ int ret = modes_apply_mode(data);
+ if (MODES_ERROR_NONE != ret)
+ ERR("modes_apply_mode() Fail(%d)", ret);
+
+ g_main_loop_quit(t_apply_loop);
+ return G_SOURCE_REMOVE;
+}
+
+int main(int argc, char **argv)
+{
+ if (2 != argc) {
+ ERR("Usage) %s ModeName", argv[0]);
+ return -1;
+ }
+
+ t_apply_loop = g_main_loop_new(NULL, FALSE);
+ g_idle_add(request_idler, argv[1]);
+
+ g_main_loop_run(t_apply_loop);
+
+ g_main_loop_unref(t_apply_loop);
+ return 0;
+}
*/
#include <glib.h>
#include <gtest/gtest.h>
-#include "modes.h"
-#include "supervisor/Supervisor.h"
-
-MODES_NAMESPACE_USE;
+#include <modes.h>
class ClientTest : public ::testing::Test {
protected: