From: lokilee73 Date: Wed, 3 Mar 2021 02:04:50 +0000 (+0900) Subject: [Non-ACR][Device] Add display features for headless profile X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F27%2F254427%2F5;p=test%2Ftct%2Fcsharp%2Fapi.git [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 --- 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);