[Property("SPEC_URL", " - ")]
[Property("CRITERIA", "PRW")]
[Property("AUTHOR", "Wenfeng Ge, wenfeng.ge@samsung.com")]
- public void TextPrediction_SET_GET_VALUE()
+ public async Task TextPrediction_SET_GET_VALUE()
{
/* TEST CODE */
- var _editor = new TextEditor();
- var inputMethodContext = _editor.GetInputMethodContext();
- inputMethodContext.TextPrediction = true;
- Assert.AreEqual(true, inputMethodContext.TextPrediction, "Should be true but error");
- inputMethodContext.TextPrediction = false;
- Assert.AreEqual(false, inputMethodContext.TextPrediction, "should be false but error");
+ TextEditor editor = new TextEditor()
+ {
+ Size2D = new Size2D(500, 300),
+ Position2D = new Position2D(10, 550),
+ BackgroundColor = Color.Magenta,
+ Focusable = true,
+ };
+ NUIApplication.GetDefaultWindow().GetDefaultLayer().Add(editor);
+ var inputMethodContext = editor.GetInputMethodContext();
+ FocusManager.Instance.SetCurrentFocusView(editor);
+ inputMethodContext.Activate();
+ inputMethodContext.ShowInputPanel();
+
+ await Task.Delay(300);
+
+ if (inputMethodContext)
+ {
+ editor.Text = "text";
+ inputMethodContext.TextPrediction = true;
+ Assert.AreEqual(true, inputMethodContext.TextPrediction, "Should be true but error");
+ inputMethodContext.TextPrediction = false;
+ Assert.AreEqual(false, inputMethodContext.TextPrediction, "should be false but error");
+ }
+ inputMethodContext.HideInputPanel();
+ await Task.Delay(30);
+ FocusManager.Instance.ClearFocus();
+ editor.Unparent();
+ editor.Dispose();
+ editor = null;
}
[Test]
[Property("AUTHOR", "Wenfeng Ge, wenfeng.ge@samsung.com")]
public async Task GetInputPanelState_RETURN_VALUE()
{
- var _editor = new TextEditor();
- var inputMethodContext = _editor.GetInputMethodContext();
+ TextEditor editor = new TextEditor()
+ {
+ Size2D = new Size2D(500, 300),
+ Position2D = new Position2D(10, 550),
+ BackgroundColor = Color.Magenta,
+ Focusable = true,
+ };
+ NUIApplication.GetDefaultWindow().GetDefaultLayer().Add(editor);
+ var inputMethodContext = editor.GetInputMethodContext();
Assert.IsNotNull(inputMethodContext, "InputMethodContext should not be null");
+ FocusManager.Instance.SetCurrentFocusView(editor);
+ inputMethodContext.Activate();
+ inputMethodContext.ShowInputPanel();
+ await Task.Delay(300);
if (inputMethodContext.RestoreAfterFocusLost())
{
inputMethodContext.SetRestoreAfterFocusLost(false);
inputMethodContext.HideInputPanel();
await Task.Delay(300);
Assert.AreEqual(InputMethodContext.State.Hide, inputMethodContext.GetInputPanelState(), "Should be equal");
+ FocusManager.Instance.ClearFocus();
+ editor.Unparent();
+ editor.Dispose();
+ editor = null;
}
[Test]
}
}
}
+ inputMethodContext.HideInputPanel();
+ await Task.Delay(30);
+ FocusManager.Instance.ClearFocus();
+ _editor.Unparent();
+ _editor.Dispose();
+ _editor = null;
}
[Test]
[Property("SPEC_URL", " - ")]
[Property("CRITERIA", "MR")]
[Property("AUTHOR", "Seoyeon Kim, seoyeon2.kim@samsung.com")]
- public void SetInputPanelLanguage_NO_RETURN_VALUE()
+ public async Task SetInputPanelLanguage_NO_RETURN_VALUE()
{
- var _editor = new TextEditor();
- var inputMethodContext = _editor.GetInputMethodContext();
+ TextEditor editor = new TextEditor()
+ {
+ Size2D = new Size2D(500, 300),
+ Position2D = new Position2D(10, 550),
+ BackgroundColor = Color.Magenta,
+ Focusable = true,
+ };
+ NUIApplication.GetDefaultWindow().GetDefaultLayer().Add(editor);
+ var inputMethodContext = editor.GetInputMethodContext();
+ FocusManager.Instance.SetCurrentFocusView(editor);
+ inputMethodContext.Activate();
+ inputMethodContext.ShowInputPanel();
InputMethodContext.InputPanelLanguage language = InputMethodContext.InputPanelLanguage.Alphabet;
try
{
{
Assert.Fail("Caught Exception" + e.ToString());
}
+ inputMethodContext.HideInputPanel();
+ await Task.Delay(30);
+ FocusManager.Instance.ClearFocus();
+ editor.Unparent();
+ editor.Dispose();
+ editor = null;
}
[Test]
[Property("AUTHOR", "Wenfeng Ge, wenfeng.ge@samsung.com")]
public async Task Activated_EVENT()
{
- var _editor = new TextEditor();
- var inputMethodContext = _editor.GetInputMethodContext();
+ TextEditor editor = new TextEditor()
+ {
+ Size2D = new Size2D(500, 300),
+ Position2D = new Position2D(10, 550),
+ BackgroundColor = Color.Magenta,
+ Focusable = true,
+ };
+ NUIApplication.GetDefaultWindow().GetDefaultLayer().Add(editor);
+ var inputMethodContext = editor.GetInputMethodContext();
+ FocusManager.Instance.SetCurrentFocusView(editor);
+ await Task.Delay(500);
if (inputMethodContext)
{
_temp = 0;
inputMethodContext.Activated += OnInputMethodContextEvent;
inputMethodContext.Activate();
- await Task.Delay(20);
+ inputMethodContext.ShowInputPanel();
+ await Task.Delay(500);
Assert.AreEqual(10, _temp, "Should be 10");
inputMethodContext.Activated -= OnInputMethodContextEvent;
}
+ inputMethodContext.HideInputPanel();
+ await Task.Delay(30);
+ FocusManager.Instance.ClearFocus();
+ editor.Unparent();
+ editor.Dispose();
+ editor = null;
}
[Test]