[Description("Tizen.System.Display tests")]
class DisplayTests
{
- private int isSupport = 1;
+ private int isDisplaySupport = 1;
+ private int isDisplayBrightnessSupport = 1;
[SetUp]
public void Init()
{
ret_value = Tizen.System.Information.TryGetValue<string>("tizen.org/feature/profile", out value);
if (ret_value == true && String.Compare(value, "tv", true) == 0)
{
- isSupport = 0;
+ isDisplaySupport = 0;
return;
}
+
+ try
+ {
+ foreach (Display dis in Display.Displays)
+ {
+ dis.Brightness = 30;
+ }
+ }
+ catch (NotSupportedException e)
+ {
+ isDisplayBrightnessSupport = 0;
+ }
}
[TearDown]
[Property("AUTHOR", "Praveen Kumar Gattu, gattu.p@samsung.com")]
public void NumberOfDisplays_PROPERTY_READ_ONLY()
{
- if (isSupport == 1)
+ if (isDisplaySupport == 1)
{
LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "NumberofDisplays_READ Value:" + Display.NumberOfDisplays);
Assert.IsTrue(Display.NumberOfDisplays > 0, "Number of displays can't be zero");
[Property("AUTHOR", "Praveen Kumar Gattu, gattu.p@samsung.com")]
public void Displays_PROPERTY_READ_ONLY()
{
- if (isSupport == 1)
+ if (isDisplaySupport == 1)
{
Assert.IsTrue(Display.Displays.Count > 0, "Number of displays can't be zero");
}
[Property("AUTHOR", "Praveen Kumar Gattu, gattu.p@samsung.com")]
public void MaxBrightness_PROPERTY_READ_ONLY()
{
- if (isSupport == 1)
+ if (isDisplaySupport == 1 && isDisplayBrightnessSupport == 1)
{
LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "MaxBrightness_READ count:" + Display.Displays.Count);
foreach (Display dis in Display.Displays)
}
else
{
- Assert.IsTrue(true, "display is not supported");
+ Assert.IsTrue(true, "display brightness is not supported");
}
}
[Property("AUTHOR", "Praveen Kumar Gattu, gattu.p@samsung.com")]
public void State_PROPERTY_READ_WRITE()
{
- if (isSupport == 1)
+ if (isDisplaySupport == 1)
{
Display.State = DisplayState.Normal;
LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "State_READ Value:" + Display.State);
[Property("AUTHOR", "Praveen Kumar Gattu, gattu.p@samsung.com")]
public void Brightness_READ_WRITE()
{
- if (isSupport == 1)
+ if (isDisplaySupport == 1 && isDisplayBrightnessSupport == 1)
{
foreach (Display dis in Display.Displays)
{
dis.Brightness = 30;
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "MaxBrightness_READ Value:" + dis.Brightness);
+ LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Brightness_READ Value:" + dis.Brightness);
Assert.IsTrue(dis.Brightness == 30, "set/get brightness value should be same");
}
}
else
{
- Assert.IsTrue(true, "display is not supported");
+ Assert.IsTrue(true, "display brightness is not supported");
}
}
[Property("AUTHOR", "Praveen Kumar Gattu, gattu.p@samsung.com")]
public void Brightness_CHANGE_VALUE()
{
- if (isSupport == 1)
+ if (isDisplaySupport == 1 && isDisplayBrightnessSupport == 1)
{
//Minimum value for brightness is not defined . we can't check the value.
Display dis = Display.Displays[0];