From 5eee26b074ce5232e3fb5b20497da07c68e69dd0 Mon Sep 17 00:00:00 2001 From: "dongsug.song" Date: Wed, 7 Aug 2019 19:12:59 +0900 Subject: [PATCH] [NUI][Non-ACR][Fix Fhub TC fail] Change-Id: I6461ed632f22c58079b75e77d4005e0165668170 --- tct-suite-vs/Tizen.NUI.Tests/testcase/TSWindow.cs | 47 +++++++++++++++++++++-- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSWindow.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSWindow.cs index 810173f..ca091e0 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSWindow.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSWindow.cs @@ -398,10 +398,28 @@ namespace Tizen.NUI.Tests /* TEST CODE */ Window stage = Window.Instance; Layer layer = stage.GetDefaultLayer(); - Assert.IsTrue((stage.GetLayer(0) == layer), "Should be equal!"); + uint cnt = stage.LayerCount; + Tizen.Log.Debug("NUITEST", $"num of layers={cnt}"); + + // default layer's depth can be changed by sibling order or rendering order + uint defaultLayerdepth = 0; + for (uint i = 0; i < cnt; i++) + { + var iterLayer = stage.GetLayer(i); + if (iterLayer == null) + { + Tizen.Log.Debug("NUITEST", $"iterLayer[{i}] is NULL!"); + } + else if (iterLayer == layer) + { + Tizen.Log.Debug("NUITEST", $"iterLayer[{i}] is same as default layer!"); + defaultLayerdepth = i; + break; + } + } + Assert.IsTrue((stage.GetLayer(defaultLayerdepth) == layer), "Should be equal!"); } - [Test] [Category("P1")] [Description("Test SetKeyboardRepeatInfo.")] @@ -826,8 +844,29 @@ namespace Tizen.NUI.Tests public void GetLayer_CHECK_RETURN_VALUE() { /* TEST CODE */ - Layer layer = Window.Instance.GetDefaultLayer(); - Assert.IsTrue((Window.Instance.GetLayer(0) == layer), "Should be equal!"); + Layer layer = Window.Instance.GetDefaultLayer(); + + uint cnt = Window.Instance.LayerCount; + Tizen.Log.Debug("NUITEST", $"num of layers={cnt}"); + + // default layer's depth can be changed by sibling order or rendering order + uint defaultLayerdepth = 0; + for (uint i = 0; i < cnt; i++) + { + var iterLayer = Window.Instance.GetLayer(i); + if (iterLayer == null) + { + Tizen.Log.Debug("NUITEST", $"iterLayer[{i}] is NULL!"); + } + else if (iterLayer == layer) + { + Tizen.Log.Debug("NUITEST", $"iterLayer[{i}] is same as default layer!"); + defaultLayerdepth = i; + break; + } + } + + Assert.IsTrue((Window.Instance.GetLayer(defaultLayerdepth) == layer), "Should be equal!"); } [Test] -- 2.7.4