Add testcase for ecore_imf_input_panel_hide() 59/262159/2
authorJihoon Kim <jihoon48.kim@samsung.com>
Tue, 3 Aug 2021 06:53:01 +0000 (15:53 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Tue, 3 Aug 2021 07:18:13 +0000 (16:18 +0900)
ecore_imf_context_input_panel_show() should be called for support ecore_imf_input_panel_hide().

Change-Id: I549e79d11d03b291f9effc8f527c3e24ae5f720b
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
ism/extras/wayland_immodule/wayland_imcontext.c
ism/tests/ecore_imf_tests.cpp

index b877ee5..9ca7e4e 100644 (file)
@@ -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
index dc92edf..50685e7 100644 (file)
@@ -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