From: Dongsug Song Date: Mon, 13 Apr 2020 10:33:24 +0000 (+0900) Subject: [Non-ACR][NUI][Fix TC fails] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=15f7b8326639d31b5f8670720031e83390894961;p=test%2Ftct%2Fcsharp%2Fapi.git [Non-ACR][NUI][Fix TC fails] Change-Id: I22038f35bbba74e901cb5f63f6e148e6ae387971 --- diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButtonStyle.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButtonStyle.cs old mode 100644 new mode 100755 index 0a10a00..28abd6a --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButtonStyle.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButtonStyle.cs @@ -148,9 +148,11 @@ namespace Tizen.NUI.Components.Tests var style = new ButtonStyle(); Assert.IsNotNull(style, "Should be not null"); Assert.IsInstanceOf(style, "Should be equal!"); + //IsSelectable needs be set true to change IsSelected + style.IsSelectable = true; style.IsSelected = true; Assert.AreEqual(true, style.IsSelected, "Should be equals to the set value"); - style.IsSelected = false; + style.IsSelected = false; Assert.AreEqual(false, style.IsSelected, "Should be equals to the set value"); } diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPopupStyle.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPopupStyle.cs old mode 100644 new mode 100755 index 294a048..1a74c0b --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPopupStyle.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPopupStyle.cs @@ -77,8 +77,12 @@ namespace Tizen.NUI.Components.Tests /* TEST CODE */ var style = new PopupStyle(); Assert.IsNotNull(style, "Should be not null"); - Assert.IsInstanceOf(style, "Should be equal!"); - style.Buttons = new ButtonStyle() {IsSelected = true}; + Assert.IsInstanceOf(style, "Should be equal!"); + //IsSelectable needs be set true to change IsSelected + style.Buttons = new ButtonStyle() { + IsSelectable = true, + IsSelected = true, + }; Assert.AreEqual(true, style.Buttons.IsSelected, "Should be equals to the set value"); } diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSStyleManager.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSStyleManager.cs old mode 100644 new mode 100755 index ef3ef31..2eef4e3 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSStyleManager.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSStyleManager.cs @@ -89,8 +89,9 @@ namespace Tizen.NUI.Components.Tests public void Theme_SET_GET_VALUE() { /* TEST CODE */ - StyleManager.Instance.Theme = "Family"; - Assert.AreEqual("Family", StyleManager.Instance.Theme, "Should be equals to the set value"); + StyleManager.Instance.Theme = "family"; + // Theme name does not distinguish capital character. All the capital character is changed into small character. + Assert.AreEqual("family", StyleManager.Instance.Theme, "Should be equals to the set value"); } [Test] diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSInputMethodContext.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSInputMethodContext.cs index 2c3b3ca..45e4f0f 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSInputMethodContext.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSInputMethodContext.cs @@ -626,30 +626,34 @@ namespace Tizen.NUI.Tests [Property("AUTHOR", "Wenfeng Ge, wenfeng.ge@samsung.com")] public async Task EventReceived_EVENT() { - _editor = new TextEditor() + TextEditor editor = new TextEditor() { Size2D = new Size2D(500, 300), Position2D = new Position2D(10, 550), BackgroundColor = Color.Magenta, Focusable = true, }; - Window.Instance.GetDefaultLayer().Add(_editor); - var inputMethodContext = _editor.GetInputMethodContext(); + NUIApplication.GetDefaultWindow().GetDefaultLayer().Add(editor); + var inputMethodContext = editor.GetInputMethodContext(); if (inputMethodContext) { _temp = 0; inputMethodContext.EventReceived += OnEventReceived; inputMethodContext.Deactivate(); inputMethodContext.HideInputPanel(); - await Task.Delay(20); + await Task.Delay(500); inputMethodContext.Activate(); inputMethodContext.ShowInputPanel(); - await Task.Delay(20); + await Task.Delay(500); + + tlog.Debug(TAG, "EventReceived_EVENT Add 500ms delay"); + Assert.AreEqual(10, _temp, "Should be 10"); inputMethodContext.EventReceived -= OnEventReceived; } - - Window.Instance.GetDefaultLayer().Remove(_editor); + editor.Unparent(); + editor.Dispose(); + editor = null; } [Test] @@ -661,34 +665,32 @@ namespace Tizen.NUI.Tests [Property("AUTHOR", "Wenfeng Ge, wenfeng.ge@samsung.com")] public async Task StatusChanged_EVENT() { - _editor = new TextEditor() + TextEditor editor = new TextEditor() { Size2D = new Size2D(500, 300), Position2D = new Position2D(10, 550), BackgroundColor = Color.Magenta, Focusable = true, - }; - Window.Instance.GetDefaultLayer().Add(_editor); - var inputMethodContext = _editor.GetInputMethodContext(); + }; + NUIApplication.GetDefaultWindow().GetDefaultLayer().Add(editor); + var inputMethodContext = editor.GetInputMethodContext(); if (inputMethodContext) { _temp = 0; inputMethodContext.StatusChanged += OnInputMethodContextEvent; - inputMethodContext.Deactivate(); inputMethodContext.HideInputPanel(); - await Task.Delay(200); + await Task.Delay(500); inputMethodContext.Activate(); inputMethodContext.ShowInputPanel(); - await Task.Delay(200); - - tlog.Debug(TAG, "StatusChanged_EVENT Add 200ms delay"); - + await Task.Delay(500); + tlog.Debug(TAG, "StatusChanged_EVENT Add 500ms delay"); Assert.AreEqual(10, _temp, "Should be 10"); inputMethodContext.StatusChanged -= OnInputMethodContextEvent; } - - Window.Instance.GetDefaultLayer().Remove(_editor); + editor.Unparent(); + editor.Dispose(); + editor = null; } [Test] @@ -700,31 +702,32 @@ namespace Tizen.NUI.Tests [Property("AUTHOR", "Wenfeng Ge, wenfeng.ge@samsung.com")] public async Task Resized_EVENT() { - _editor = new TextEditor() + TextEditor editor = new TextEditor() { Size2D = new Size2D(500, 300), Position2D = new Position2D(10, 550), BackgroundColor = Color.Magenta, Focusable = true, - }; - Window.Instance.GetDefaultLayer().Add(_editor); - var inputMethodContext = _editor.GetInputMethodContext(); + }; + NUIApplication.GetDefaultWindow().GetDefaultLayer().Add(editor); + var inputMethodContext = editor.GetInputMethodContext(); if (inputMethodContext) { _temp = 0; inputMethodContext.Resized += OnInputMethodContextEvent; inputMethodContext.Activate(); inputMethodContext.ShowInputPanel(); - await Task.Delay(200); + await Task.Delay(500); inputMethodContext.Deactivate(); inputMethodContext.HideInputPanel(); - await Task.Delay(200); - + await Task.Delay(500); + tlog.Debug(TAG, "Resized_EVENT Add 500ms delay"); Assert.AreEqual(10, _temp, "Should be 10"); inputMethodContext.Resized -= OnInputMethodContextEvent; - } - - Window.Instance.GetDefaultLayer().Remove(_editor); + } + editor.Unparent(); + editor.Dispose(); + editor = null; } [Test] diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTTSPlayer.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTTSPlayer.cs index e49950b..5120c39 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTTSPlayer.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTTSPlayer.cs @@ -15,6 +15,7 @@ namespace Tizen.NUI.Tests { private string TAG = "NUI"; private string image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; + private bool _flagStateChanged = false; [SetUp] public void Init() @@ -196,23 +197,30 @@ namespace Tizen.NUI.Tests } } - bool flag = false; if (stat == TTSPlayer.TTSState.Unavailable) { - Tizen.Log.Fatal(TAG, "TTS Player is NOT available in this target! Need to Check!"); - flag = true; + Tizen.Log.Fatal(TAG, "TTS Player is NOT available in this target! Need to Check! This case is rarely happened"); + Assert.Pass("TTS Player is not available. It is not under control of NUI.(out of scope in NUI) This is NUI test, so just to be passed."); } + _flagStateChanged = false; - player.StateChanged += (obj, e) => - { - flag = true; - }; + player.StateChanged += Player_StateChanged; player.Play("test"); player.Pause(); await Task.Delay(20); - Assert.IsTrue(flag, "StateChanged is not be called"); + Assert.IsTrue(_flagStateChanged, "StateChanged is not be called"); + + player.StateChanged -= Player_StateChanged; + player.Dispose(); + player = null; + } + + private void Player_StateChanged(object sender, TTSPlayer.StateChangedEventArgs e) + { + _flagStateChanged = true; } + } } \ No newline at end of file