[Non-ACR][Device] Add display features for headless profile 27/254427/5
authorlokilee73 <changjoo.lee@samsung.com>
Wed, 3 Mar 2021 02:04:50 +0000 (11:04 +0900)
committerlokilee73 <changjoo.lee@samsung.com>
Wed, 3 Mar 2021 08:45:01 +0000 (17:45 +0900)
ex) http://tizen.org/feature/display
    http://tizen.org/feature/display.state

Change-Id: I0080bfb457b674702002e9159d14ad6c03162052
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
tct-suite-vs/Tizen.Device.Tests/testcase/TSPower.cs [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 7dab570..1742eeb
@@ -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);