[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]
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)
{
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);
Power.ReleaseLock(type);
}
}
+ catch (NotSupportedException)
+ {
+ Assert.IsTrue(PassForNotSuppot() == true, "Invalid NotSupportedException");
+ }
catch (Exception e)
{
Assert.IsTrue(false, "failed to release cpu lock. " + e.Message);