From: huiyu.eun Date: Wed, 28 Aug 2019 03:45:43 +0000 (+0900) Subject: [NUI][Non-ACR] Fix IMF/InputMethod TCT issue X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6c7bd0e1a5f440d4194d4b089cdc36403da630eb;p=test%2Ftct%2Fcsharp%2Fapi.git [NUI][Non-ACR] Fix IMF/InputMethod TCT issue The IMF(InputMethod) is implemented by a third party, and there are some IMFs that do not set the value of InputPanelLocale and Changed callback. The three TCTs below do not support behavior in the IMF of GBM Binaries. If the InputPanelLocale value is set the "", then the IMF does not support this feature(TCT). - Tizen.NUI.Tests.InputMethodContextTests.LanguageChanged_EVENT - Tizen.NUI.Tests.InputMethodContextTests.GetInputPanelLocale - Tizen.NUI.Tests.ImfManagerTests.LanguageChanged_CHECK_EVENT Change-Id: Icb6a93807f8a36698745138e67a34601e1e6d1d1 Signed-off-by: huiyu.eun --- diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSImfManager.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSImfManager.cs index 60e2468..86d2b75 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSImfManager.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSImfManager.cs @@ -637,30 +637,42 @@ namespace Tizen.NUI.Tests { /* TEST CODE */ var manager = ImfManager.Get(); - Assert.IsInstanceOf(manager, "Should be an instance of ImfManager type."); - try - { - _flagOnLanguageChangedEvent = false; - Assert.False(_flagOnLanguageChangedEvent, "_flagOnLanguageChangedEvent should false initial"); - manager.LanguageChanged += OnLanguageChangedEvent; - manager.Deactivate(); - manager.HideInputPanel(); - await Task.Delay(500); - manager.Activate(); - manager.ShowInputPanel(); - await Task.Delay(500); - Tizen.Log.Fatal("NUI", "LanguageChanged_CHECK_EVENT()!!!"); - Assert.True(_flagOnLanguageChangedEvent, "Should be true after triger LanguageChanged event."); - } - catch (Exception e) - { - Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString()); - Assert.Fail("Caught Exception" + e.ToString()); - } - finally - { - manager.LanguageChanged -= OnLanguageChangedEvent; + Assert.IsInstanceOf(manager, "Should be an instance of ImfManager type."); + + if (manager.GetInputPanelLocale() != null) + { + if (manager.GetInputPanelLocale() == "") + { + Assert.Pass("InputPanelLocale of ImfManager is not set in this profile"); + } + else + { + try + { + _flagOnLanguageChangedEvent = false; + Assert.False(_flagOnLanguageChangedEvent, "_flagOnLanguageChangedEvent should false initial"); + manager.LanguageChanged += OnLanguageChangedEvent; + manager.Deactivate(); + manager.HideInputPanel(); + await Task.Delay(500); + manager.Activate(); + manager.ShowInputPanel(); + await Task.Delay(500); + Tizen.Log.Fatal("NUI", "LanguageChanged_CHECK_EVENT()!!!"); + Assert.True(_flagOnLanguageChangedEvent, "Should be true after triger LanguageChanged event."); + + } + catch (Exception e) + { + Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); + } + finally + { + manager.LanguageChanged -= OnLanguageChangedEvent; + } + } } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSInputMethodContext.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSInputMethodContext.cs index 2b649df..913a184 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSInputMethodContext.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSInputMethodContext.cs @@ -598,7 +598,17 @@ namespace Tizen.NUI.Tests await Task.Delay(500); if (inputMethodContext) { - Assert.IsTrue(inputMethodContext.GetInputPanelLocale().Contains("en_US"), "Default value is not en_US"); + if(inputMethodContext.GetInputPanelLocale() != null) + { + if (inputMethodContext.GetInputPanelLocale() != "") + { + Assert.IsTrue(inputMethodContext.GetInputPanelLocale().Contains("en_US"), "Default value is not en_US"); + } + else + { + Assert.Pass("InputPanelLocale of InputMethod is not set in this profile"); + } + } } inputMethodContext.Dispose(); @@ -755,21 +765,32 @@ namespace Tizen.NUI.Tests }; Window.Instance.GetDefaultLayer().Add(_editor); InputMethodContext inputMethodContext = _editor.GetInputMethodContext(); - if (inputMethodContext) - { - _temp = 0; - inputMethodContext.LanguageChanged += OnInputMethodContextEvent1; - inputMethodContext.Deactivate(); - inputMethodContext.HideInputPanel(); - await Task.Delay(500); - Tizen.Log.Debug("NUI", $"TP#1 LanguageChanged_EVENT() HideInputPanel() TimeStamp={DateTime.Now.ToString("hh:mm:ss.fff")}"); - inputMethodContext.Activate(); - inputMethodContext.ShowInputPanel(); - await Task.Delay(500); - Tizen.Log.Debug("NUI", $"TP#2 LanguageChanged_EVENT() ShowInputPanel() TimeStamp={DateTime.Now.ToString("hh:mm:ss.fff")}"); - Assert.AreEqual(10, _temp, "Should be 10"); - inputMethodContext.LanguageChanged -= OnInputMethodContextEvent1; + if (inputMethodContext) + { + if (inputMethodContext.GetInputPanelLocale() != null) + { + if (inputMethodContext.GetInputPanelLocale() == "") + { + Assert.Pass("InputPanelLocale of InputMethod is not set in this profile"); + } + else + { + _temp = 0; + inputMethodContext.LanguageChanged += OnInputMethodContextEvent1; + inputMethodContext.Deactivate(); + inputMethodContext.HideInputPanel(); + await Task.Delay(500); + Tizen.Log.Debug("NUI", $"TP#1 LanguageChanged_EVENT() HideInputPanel() TimeStamp={DateTime.Now.ToString("hh:mm:ss.fff")}"); + inputMethodContext.Activate(); + inputMethodContext.ShowInputPanel(); + await Task.Delay(500); + Tizen.Log.Debug("NUI", $"TP#2 LanguageChanged_EVENT() ShowInputPanel() TimeStamp={DateTime.Now.ToString("hh:mm:ss.fff")}"); + + Assert.AreEqual(10, _temp, "Should be 10"); + inputMethodContext.LanguageChanged -= OnInputMethodContextEvent1; + } + } } Window.Instance.GetDefaultLayer().Remove(_editor);