[Non-ACR][NUI][Fix InputMethodContext TCT fails] 17/232117/1
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Tue, 28 Apr 2020 09:43:36 +0000 (18:43 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Tue, 28 Apr 2020 09:44:44 +0000 (18:44 +0900)
- To show input panel, TextEditor should be focused.

Change-Id: I07091c11051d74607936ca18c4430658bc51e25b
Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
tct-suite-vs/Tizen.NUI.Tests/testcase/TSInputMethodContext.cs

index 7a9284403e78f47e9666398570b843b9e75b5b34..26699facae71011bc7ec5d7e3de2a3150666d14e 100755 (executable)
@@ -634,6 +634,7 @@ namespace Tizen.NUI.Tests
                 Focusable = true,
             };
             NUIApplication.GetDefaultWindow().GetDefaultLayer().Add(editor);
+            FocusManager.Instance.SetCurrentFocusView(editor);
             var inputMethodContext = editor.GetInputMethodContext();
             await Task.Delay(500);
             if (inputMethodContext)
@@ -643,6 +644,7 @@ namespace Tizen.NUI.Tests
                 tlog.Debug(TAG, $"EventReceived_EVENT, OnEventReceived added, State={inputMethodContext.GetInputPanelState()}");
                 inputMethodContext.Activate();
                 inputMethodContext.ShowInputPanel();
+                editor.Text = "text"; // EventReceived event emits when the text is preedit or commit while focusing.
                 await Task.Delay(500);
                 tlog.Debug(TAG, $"EventReceived_EVENT, ShowInputPanel() 500ms delay, State={inputMethodContext.GetInputPanelState()}");
                 inputMethodContext.HideInputPanel();
@@ -655,6 +657,7 @@ namespace Tizen.NUI.Tests
             {
                 tlog.Debug(TAG, $"EventReceived_EVENT, error : inputMethodContext is null !");
             }
+            FocusManager.Instance.ClearFocus();
             editor.Unparent();
             editor.Dispose();
             editor = null;
@@ -677,6 +680,7 @@ namespace Tizen.NUI.Tests
                 Focusable = true,
             };
             NUIApplication.GetDefaultWindow().GetDefaultLayer().Add(editor);
+            FocusManager.Instance.SetCurrentFocusView(editor);
             var inputMethodContext = editor.GetInputMethodContext();
             await Task.Delay(500);
             if (inputMethodContext)
@@ -698,6 +702,7 @@ namespace Tizen.NUI.Tests
             {
                 tlog.Debug(TAG, $"StatusChanged_EVENT, error : inputMethodContext is null !");
             }
+            FocusManager.Instance.ClearFocus();
             editor.Unparent();
             editor.Dispose();
             editor = null;
@@ -720,6 +725,7 @@ namespace Tizen.NUI.Tests
                 Focusable = true,
             };
             NUIApplication.GetDefaultWindow().GetDefaultLayer().Add(editor);
+            FocusManager.Instance.SetCurrentFocusView(editor);
             var inputMethodContext = editor.GetInputMethodContext();
             await Task.Delay(500);
             if (inputMethodContext)
@@ -741,6 +747,7 @@ namespace Tizen.NUI.Tests
             {
                 tlog.Debug(TAG, $"Resized_EVENT, error : inputMethodContext is null !");
             }
+            FocusManager.Instance.ClearFocus();
             editor.Unparent();
             editor.Dispose();
             editor = null;