From d62df0661906bea6319f4ef0b9b7660af43c7c58 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Tue, 3 Aug 2021 15:53:01 +0900 Subject: [PATCH] Add testcase for ecore_imf_input_panel_hide() ecore_imf_context_input_panel_show() should be called for support ecore_imf_input_panel_hide(). Change-Id: I549e79d11d03b291f9effc8f527c3e24ae5f720b Signed-off-by: Jihoon Kim --- ism/extras/wayland_immodule/wayland_imcontext.c | 6 +++--- ism/tests/ecore_imf_tests.cpp | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/ism/extras/wayland_immodule/wayland_imcontext.c b/ism/extras/wayland_immodule/wayland_imcontext.c index b877ee5..9ca7e4e 100644 --- a/ism/extras/wayland_immodule/wayland_imcontext.c +++ b/ism/extras/wayland_immodule/wayland_imcontext.c @@ -1541,7 +1541,7 @@ static Eina_Bool _client_window_focus_in_cb(void *data, int ev_type, void *ev) set_focus(_focus_req_ctx); if (ecore_imf_context_input_panel_enabled_get (_focus_req_ctx) || !_focus_req_only) if (!ecore_imf_context_input_panel_show_on_demand_get (_focus_req_ctx) || !_focus_req_only) - show_input_panel (_focus_req_ctx); + ecore_imf_context_input_panel_show(_focus_req_ctx); _win_focus_in_handler_del(); @@ -1798,7 +1798,7 @@ static void _canvas_focus_in_cb(void *data, Evas *e, void *event_info) set_focus(_focus_req_ctx); if (ecore_imf_context_input_panel_enabled_get (_focus_req_ctx) || !_focus_req_only) if (!ecore_imf_context_input_panel_show_on_demand_get (_focus_req_ctx) || !_focus_req_only) - show_input_panel (_focus_req_ctx); + ecore_imf_context_input_panel_show(_focus_req_ctx); WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(_focus_req_ctx); if (imcontext && imcontext->canvas) @@ -3132,7 +3132,7 @@ wayland_im_context_focus_in(Ecore_IMF_Context *ctx) if (ecore_imf_context_input_panel_enabled_get(ctx)) if (!ecore_imf_context_input_panel_show_on_demand_get (ctx)) - show_input_panel(ctx); + ecore_imf_context_input_panel_show (ctx); else LOGD ("ctx : %p input panel on demand mode : TRUE", ctx); else diff --git a/ism/tests/ecore_imf_tests.cpp b/ism/tests/ecore_imf_tests.cpp index dc92edf..50685e7 100644 --- a/ism/tests/ecore_imf_tests.cpp +++ b/ism/tests/ecore_imf_tests.cpp @@ -379,4 +379,25 @@ TEST_F(EcoreIMFContextWinFocusTest, utc_ime_show_and_context_delete) vconf_ignore_key_changed(VCONFKEY_ISF_INPUT_PANEL_STATE, input_panel_state_changed_cb); } +TEST_F(EcoreIMFContextWinFocusTest, utc_ecore_imf_input_panel_hide) +{ + ecore_imf_context_focus_in(ctx); + + ecore_imf_context_input_panel_event_callback_add(ctx, ECORE_IMF_INPUT_PANEL_STATE_EVENT, _input_panel_state_cb, NULL); + + WAIT_FOR_CALLBACK(); + + EXPECT_EQ(callback_called, true); + EXPECT_EQ(input_panel_state, ECORE_IMF_INPUT_PANEL_STATE_SHOW); + + callback_called = false; + + ecore_imf_input_panel_hide(); + + WAIT_FOR_CALLBACK(); + + EXPECT_EQ(callback_called, true); + EXPECT_EQ(input_panel_state, ECORE_IMF_INPUT_PANEL_STATE_HIDE); +} + } // namespace -- 2.7.4