--- /dev/null
+// Copyright 2018 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using NUnit.Framework;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace Tizen.Multimedia.Tests
+{
+ [TestFixture]
+ [Description("Tests Tizen.Multimedia.DepthPlane class")]
+ public class DepthPlaneTests : TestBase
+ {
+ public bool _isSupportDepthPlane;
+
+ [SetUp]
+ public void SetUp()
+ {
+ _isSupportDepthPlane = TestCamera.Capabilities.SupportedPreviewPixelFormats
+ .Contains(CameraPixelFormat.Invz);
+ if (_isSupportDepthPlane == false)
+ {
+ Assert.Pass("DepthPlane format is not supported.");
+ }
+
+ TestCamera.Settings.PreviewPixelFormat = CameraPixelFormat.Invz;
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Data property.")]
+ [Property("SPEC", "Tizen.Multimedia.DepthPlane.Data A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task Data_PROPERTY_READ_ONLY()
+ {
+ using (var eventWaiter = EventAwaiter<PreviewEventArgs>.Create())
+ {
+ TestCamera.Preview += eventWaiter;
+
+ TestCamera.StartPreview();
+
+ var eventArgs = await eventWaiter.GetResultAsync();
+ Assert.IsInstanceOf<DepthPlane>(eventArgs.Preview.Plane);
+ Assert.That((eventArgs.Preview.Plane as DepthPlane).Data.Length, Is.GreaterThan(0));
+ }
+ }
+ }
+}
Assert.That(eventArgs.Preview.PlaneType, Is.EqualTo(PlaneType.EncodedPlane));
}
}
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Type property for Depth plane.")]
+ [Property("SPEC", "Tizen.Multimedia.PreviewFrame.PlaneType A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRE")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task PlaneType_PROPERTY_GET_ENUM_PLANETYPE_DEPTHPLANE()
+ {
+ bool isSupportEncodedPlane = TestCamera.Capabilities.SupportedPreviewPixelFormats
+ .Contains(CameraPixelFormat.Invz);
+ if (isSupportEncodedPlane == false)
+ {
+ Assert.Pass("DepthPlane format is not supported.");
+ }
+
+ TestCamera.Settings.PreviewPixelFormat = CameraPixelFormat.Invz;
+
+ using (var eventWaiter = EventAwaiter<PreviewEventArgs>.Create())
+ {
+ TestCamera.Preview += eventWaiter;
+
+ TestCamera.StartPreview();
+
+ var eventArgs = await eventWaiter.GetResultAsync();
+ Assert.That(eventArgs.Preview.PlaneType, Is.EqualTo(PlaneType.DepthPlane));
+ }
+ }
}
}