From: Haesu Gwon Date: Wed, 5 Sep 2018 04:20:47 +0000 (+0900) Subject: [Camera][TCSACR-173][Add new preview format] X-Git-Tag: tct5.0_m2~77 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=354067292c6e839e5d304dd32beb56391715c296;p=test%2Ftct%2Fcsharp%2Fapi.git [Camera][TCSACR-173][Add new preview format] Change-Id: If8cd1770b8268c058fc5d9b40f195be5fc64188c --- 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 index 0000000..6d66105 --- /dev/null +++ b/tct-suite-vs/Tizen.Camera.Tests/testcase/TSDepthPlane.cs @@ -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.Create()) + { + TestCamera.Preview += eventWaiter; + + TestCamera.StartPreview(); + + var eventArgs = await eventWaiter.GetResultAsync(); + Assert.IsInstanceOf(eventArgs.Preview.Plane); + Assert.That((eventArgs.Preview.Plane as DepthPlane).Data.Length, Is.GreaterThan(0)); + } + } + } +} diff --git a/tct-suite-vs/Tizen.Camera.Tests/testcase/TSPreviewFrame.cs b/tct-suite-vs/Tizen.Camera.Tests/testcase/TSPreviewFrame.cs old mode 100755 new mode 100644 index e983210..0dac3a6 --- a/tct-suite-vs/Tizen.Camera.Tests/testcase/TSPreviewFrame.cs +++ b/tct-suite-vs/Tizen.Camera.Tests/testcase/TSPreviewFrame.cs @@ -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.Create()) + { + TestCamera.Preview += eventWaiter; + + TestCamera.StartPreview(); + + var eventArgs = await eventWaiter.GetResultAsync(); + Assert.That(eventArgs.Preview.PlaneType, Is.EqualTo(PlaneType.DepthPlane)); + } + } } }