From 8de932191c1fcab430f761f6aed4e1f7b63c7b66 Mon Sep 17 00:00:00 2001 From: lokilee73 Date: Wed, 3 Mar 2021 11:04:50 +0900 Subject: [PATCH] [Non-ACR][Device] Add display features for headless profile ex) http://tizen.org/feature/display http://tizen.org/feature/display.state Change-Id: I0080bfb457b674702002e9159d14ad6c03162052 Signed-off-by: lokilee73 --- .../Tizen.Device.Tests/testcase/TSPower.cs | 24 +++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) mode change 100755 => 100644 tct-suite-vs/Tizen.Device.Tests/testcase/TSPower.cs diff --git a/tct-suite-vs/Tizen.Device.Tests/testcase/TSPower.cs b/tct-suite-vs/Tizen.Device.Tests/testcase/TSPower.cs old mode 100755 new mode 100644 index 7dab570..1742eeb --- a/tct-suite-vs/Tizen.Device.Tests/testcase/TSPower.cs +++ b/tct-suite-vs/Tizen.Device.Tests/testcase/TSPower.cs @@ -8,9 +8,22 @@ namespace Tizen.System.Tests [Description("Tizen.System.Power tests")] class PowerTests { + static bool IsdisplayfeatureSupport = false; + static bool IsdisplaystatefeatureSupport = false; [SetUp] public void Init() { + Information.TryGetValue("http://tizen.org/feature/display", out IsdisplayfeatureSupport); + Information.TryGetValue("http://tizen.org/feature/display.state", out IsdisplaystatefeatureSupport); + + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "IsdisplayfeatureSupport:" + IsdisplayfeatureSupport); + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "IsdisplaystatefeatureSupport:" + IsdisplaystatefeatureSupport); + } + + static bool PassForNotSuppot() + { + if ((IsdisplayfeatureSupport == false) || (IsdisplaystatefeatureSupport == false)) return true; + else return false; } [TearDown] @@ -51,7 +64,8 @@ namespace Tizen.System.Tests try { Power.RequestLock(PowerLock.Cpu, -1); - Assert.IsTrue(false, "ArgumentException should be thrown for negative timeout value."); + if (PassForNotSuppot() == false) + Assert.IsTrue(false, "ArgumentException should be thrown for negative timeout value."); } catch (Exception e) { @@ -96,6 +110,10 @@ namespace Tizen.System.Tests Power.RequestLock(type, 2000); } } + catch (NotSupportedException) + { + Assert.IsTrue(PassForNotSuppot() == true, "Invalid NotSupportedException"); + } catch (Exception e) { Assert.IsTrue(false, "failed to request cpu lock. " + e.Message); @@ -139,6 +157,10 @@ namespace Tizen.System.Tests Power.ReleaseLock(type); } } + catch (NotSupportedException) + { + Assert.IsTrue(PassForNotSuppot() == true, "Invalid NotSupportedException"); + } catch (Exception e) { Assert.IsTrue(false, "failed to release cpu lock. " + e.Message); -- 2.7.4