[Camera][TCSACR-173][Add new preview format] 23/188423/3
authorHaesu Gwon <haesu.gwon@samsung.com>
Wed, 5 Sep 2018 04:20:47 +0000 (13:20 +0900)
committerHaesu Gwon <haesu.gwon@samsung.com>
Wed, 5 Sep 2018 09:37:53 +0000 (09:37 +0000)
Change-Id: If8cd1770b8268c058fc5d9b40f195be5fc64188c

tct-suite-vs/Tizen.Camera.Tests/testcase/TSDepthPlane.cs [new file with mode: 0644]
tct-suite-vs/Tizen.Camera.Tests/testcase/TSPreviewFrame.cs [changed mode: 0755->0644]

diff --git a/tct-suite-vs/Tizen.Camera.Tests/testcase/TSDepthPlane.cs b/tct-suite-vs/Tizen.Camera.Tests/testcase/TSDepthPlane.cs
new file mode 100644 (file)
index 0000000..6d66105
--- /dev/null
@@ -0,0 +1,55 @@
+// 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));
+            }
+        }
+    }
+}
old mode 100755 (executable)
new mode 100644 (file)
index e983210..0dac3a6
@@ -213,5 +213,34 @@ namespace Tizen.Multimedia.Tests
                 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));
+            }
+        }
     }
 }