--- /dev/null
+/*
+ * Copyright (c) 2020 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 <gtest/gtest.h>
+
+#include <inputmethod_manager.h>
+#include "cynara_mock.h"
+#include "isf_control_mock.h"
+
+namespace {
+
+#define IME_APPID "ise-default"
+
+class InputMethodManagerDeniedTest : public testing::Test {
+ public:
+ virtual void SetUp() {
+ cynara_check_set_result(CYNARA_API_ACCESS_DENIED);
+ }
+ virtual void TearDown() {
+ cynara_check_set_result(CYNARA_API_ACCESS_ALLOWED);
+ }
+};
+
+TEST_F(InputMethodManagerDeniedTest, utc_ime_manager_get_active_ime_permission_denied)
+{
+ int ret = ime_manager_get_active_ime(NULL);
+ EXPECT_EQ(ret, IME_MANAGER_ERROR_PERMISSION_DENIED);
+}
+
+TEST_F(InputMethodManagerDeniedTest, utc_ime_manager_get_enabled_ime_count_permission_denied)
+{
+ int count = ime_manager_get_enabled_ime_count();
+ EXPECT_EQ(count, 0);
+}
+
+TEST_F(InputMethodManagerDeniedTest, utc_ime_manager_prelaunch_ime_permission_denied)
+{
+ int ret = ime_manager_prelaunch_ime();
+ EXPECT_EQ(ret, IME_MANAGER_ERROR_PERMISSION_DENIED);
+}
+
+} // namespace
}
};
-class InputMethodManagerDeniedTest : public testing::Test {
- public:
- virtual void SetUp() {
- cynara_check_set_result(CYNARA_API_ACCESS_DENIED);
- }
- virtual void TearDown() {
- cynara_check_set_result(CYNARA_API_ACCESS_ALLOWED);
- }
-};
-
TEST_F(InputMethodManagerTest, utc_ime_manager_get_active_ime_p)
{
char *app_id = nullptr;
EXPECT_EQ(ret, IME_MANAGER_ERROR_INVALID_PARAMETER);
}
-TEST_F(InputMethodManagerDeniedTest, utc_ime_manager_get_active_ime_permission_denied)
-{
- int ret = ime_manager_get_active_ime(NULL);
- EXPECT_EQ(ret, IME_MANAGER_ERROR_PERMISSION_DENIED);
-}
-
TEST_F(InputMethodManagerTest, utc_ime_manager_is_ime_enabled_p)
{
bool enabled;
EXPECT_GT(count, 0);
}
-TEST_F(InputMethodManagerDeniedTest, utc_ime_manager_get_enabled_ime_count_permission_denied)
-{
- int count = ime_manager_get_enabled_ime_count();
- EXPECT_EQ(count, 0);
-}
-
TEST_F(InputMethodManagerTest, utc_ime_manager_prelaunch_ime_p)
{
int ret = ime_manager_prelaunch_ime();
EXPECT_EQ(ret, IME_MANAGER_ERROR_NONE);
}
-TEST_F(InputMethodManagerDeniedTest, utc_ime_manager_prelaunch_ime_permission_denied)
-{
- int ret = ime_manager_prelaunch_ime();
- EXPECT_EQ(ret, IME_MANAGER_ERROR_PERMISSION_DENIED);
-}
-
} // namespace