[ImageUtil] Add heif and webp TCs 77/276577/1
authorHaesu Gwon <haesu.gwon@samsung.com>
Tue, 21 Jun 2022 05:24:55 +0000 (14:24 +0900)
committerHaesu Gwon <haesu.gwon@samsung.com>
Tue, 21 Jun 2022 05:24:55 +0000 (14:24 +0900)
Change-Id: I797635a5ff3333f08e77992641b1f7ce7d11eaf7

tct-suite-vs/Tizen.MultimediaUtil.Tests/res/test_heic.heic [new file with mode: 0755]
tct-suite-vs/Tizen.MultimediaUtil.Tests/res/test_mp3.mp3 [moved from tct-suite-vs/Tizen.MultimediaUtil.Tests/res/test.mp3 with 100% similarity]
tct-suite-vs/Tizen.MultimediaUtil.Tests/res/test_webp.webp [new file with mode: 0755]
tct-suite-vs/Tizen.MultimediaUtil.Tests/testcase/ImageUtil/TSImageDecoder.cs
tct-suite-vs/Tizen.MultimediaUtil.Tests/testcase/support/ImageUtilConstants.cs

diff --git a/tct-suite-vs/Tizen.MultimediaUtil.Tests/res/test_heic.heic b/tct-suite-vs/Tizen.MultimediaUtil.Tests/res/test_heic.heic
new file mode 100755 (executable)
index 0000000..659078c
Binary files /dev/null and b/tct-suite-vs/Tizen.MultimediaUtil.Tests/res/test_heic.heic differ
diff --git a/tct-suite-vs/Tizen.MultimediaUtil.Tests/res/test_webp.webp b/tct-suite-vs/Tizen.MultimediaUtil.Tests/res/test_webp.webp
new file mode 100755 (executable)
index 0000000..f2272c3
Binary files /dev/null and b/tct-suite-vs/Tizen.MultimediaUtil.Tests/res/test_webp.webp differ
index 9905b51..0ac20b3 100755 (executable)
@@ -49,6 +49,8 @@ namespace Tizen.Multimedia.Util.Tests
             _gifDecoder.Dispose();
             _jpegDecoder.Dispose();
             _pngDecoder.Dispose();
+            _webPDecoder.Dispose();
+            _heifDecoder.Dispose();
         }
 
         [Test]
@@ -268,6 +270,66 @@ namespace Tizen.Multimedia.Util.Tests
         }
 
         [Test]
+        [Category("P1")]
+        [Description("Decode webp image using input buffer")]
+        [Property("SPEC", "Tizen.Multimedia.Util.ImageDecoder.DecodeAsync M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MR")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        [Property("COVPARAM", "byte[]")]
+        public async Task DecodeAsync_INPUTBUFFER_WEBP_CHECK_RETURN_VALUE()
+        {
+            var frame = (await _webPDecoder.DecodeAsync(File.ReadAllBytes(ImageUtilConstants.WebPPath))).FirstOrDefault();
+
+            Assert.That(frame.Size.Height, Is.Positive);
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Decode webp image using input path")]
+        [Property("SPEC", "Tizen.Multimedia.Util.ImageDecoder.DecodeAsync M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MR")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        [Property("COVPARAM", "string")]
+        public async Task DecodeAsync_INPUTPATH_WEBP_CHECK_RETURN_VALUE()
+        {
+            var frame = (await _webPDecoder.DecodeAsync(ImageUtilConstants.WebPPath)).FirstOrDefault();
+
+            Assert.That(frame.Size.Height, Is.Positive);
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Decode heif image using input buffer")]
+        [Property("SPEC", "Tizen.Multimedia.Util.ImageDecoder.DecodeAsync M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MR")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        [Property("COVPARAM", "byte[]")]
+        public async Task DecodeAsync_INPUTBUFFER_HEIF_CHECK_RETURN_VALUE()
+        {
+            var frame = (await _heifDecoder.DecodeAsync(File.ReadAllBytes(ImageUtilConstants.HeifPath))).FirstOrDefault();
+
+            Assert.That(frame.Size.Height, Is.Positive);
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Decode heif image using input path")]
+        [Property("SPEC", "Tizen.Multimedia.Util.ImageDecoder.DecodeAsync M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MR")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        [Property("COVPARAM", "string")]
+        public async Task DecodeAsync_INPUTPATH_HEIF_CHECK_RETURN_VALUE()
+        {
+            var frame = (await _heifDecoder.DecodeAsync(ImageUtilConstants.HeifPath)).FirstOrDefault();
+
+            Assert.That(frame.Size.Height, Is.Positive);
+        }
+
+        [Test]
         [Category("P2")]
         [Description("Check if it throws argument exception for setting color space with an invalid color space value")]
         [Property("SPEC", "Tizen.Multimedia.Util.ImageDecoder.SetColorSpace M")]
index fc14158..ca31365 100755 (executable)
@@ -5,5 +5,7 @@ internal static class ImageUtilConstants
     internal const string BitmapPath = "/opt/usr/home/owner/share/res/test_bmp.bmp";
     internal const string GifPath = "/opt/usr/home/owner/share/res/test_gif.gif";
     internal const string PngPath = "/opt/usr/home/owner/share/res/test_png.png";
-    internal const string Mp3Path = "/opt/usr/home/owner/share/res/test.mp3";
+    internal const string WebPPath = "/opt/usr/home/owner/share/res/test_webp.webp";
+    internal const string HeifPath = "/opt/usr/home/owner/share/res/test_heic.heic";
+    internal const string Mp3Path = "/opt/usr/home/owner/share/res/test_mp3.mp3";
 }
\ No newline at end of file