[Multimedia][TCSACR-447] Support Video & UI sync mode 18/263618/2
authorHaesu Gwon <haesu.gwon@samsung.com>
Tue, 7 Sep 2021 05:39:27 +0000 (14:39 +0900)
committerHaesu Gwon <haesu.gwon@samsung.com>
Wed, 15 Sep 2021 06:15:55 +0000 (15:15 +0900)
Change-Id: I2a98ca6b33afcebc8b0b55625132f62285601ce2

tct-suite-vs/Tizen.Multimedia.NUI.Tests/Program.cs [new file with mode: 0755]
tct-suite-vs/Tizen.Multimedia.NUI.Tests/Tizen.Multimedia.NUI.Tests.csproj [new file with mode: 0755]
tct-suite-vs/Tizen.Multimedia.NUI.Tests/Tizen.Multimedia.NUI.Tests.sln [new file with mode: 0755]
tct-suite-vs/Tizen.Multimedia.NUI.Tests/shared/res/Tizen.Multimedia.NUI.Tests.png [new file with mode: 0755]
tct-suite-vs/Tizen.Multimedia.NUI.Tests/testcase/TSDisplay.cs [new file with mode: 0755]
tct-suite-vs/Tizen.Multimedia.NUI.Tests/tizen-manifest.xml [new file with mode: 0755]

diff --git a/tct-suite-vs/Tizen.Multimedia.NUI.Tests/Program.cs b/tct-suite-vs/Tizen.Multimedia.NUI.Tests/Program.cs
new file mode 100755 (executable)
index 0000000..eeaa491
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ *  Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License
+ */
+
+using NUnitLite.TUnit;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using System.Threading;
+using System.Diagnostics;
+using System.Threading.Tasks;
+
+namespace Tizen.Multimedia.NUI.Tests
+{
+    using tlog = Tizen.Log;
+    public class App : Tizen.NUI.NUIApplication
+    {
+        static string tag = "Tizen.Multimedia.NUI.Tests";
+
+        public App() : base()
+        {
+            tlog.Debug(tag, "Call App()");
+        }
+
+        View root;
+        static TextLabel mainTitle;
+        static string title = "Tizen.Multimedia.NUI Auto TCT \n\n";
+        float textSize = 30.0f;
+        Window window;
+        Layer layer;
+        protected override void OnCreate()
+        {
+            base.OnCreate();
+
+            tlog.Debug(tag, "OnCreate() START!");
+
+            window = NUIApplication.GetDefaultWindow();
+            window.BackgroundColor = Color.Green;
+
+            root = new View()
+            {
+                Size = new Tizen.NUI.Size(100, 100),
+                BackgroundColor = Color.White,
+                PositionUsesPivotPoint = true,
+                ParentOrigin = ParentOrigin.Center,
+                PivotPoint = PivotPoint.Center,
+            };
+
+            layer = window.GetDefaultLayer();
+            layer.Add(root);
+
+            mainTitle = new TextLabel()
+            {
+                MultiLine = true,
+                Text = title + $"Process ID: {Process.GetCurrentProcess().Id} \nThread ID: {Thread.CurrentThread.ManagedThreadId}\n",
+                PixelSize = textSize,
+                BackgroundColor = Color.Cyan,
+                Size2D = new Size2D(window.WindowSize.Width / 2, window.WindowSize.Height / 2),
+                PositionUsesPivotPoint = true,
+                ParentOrigin = ParentOrigin.Center,
+                PivotPoint = PivotPoint.Center,
+            };
+            root.Add(mainTitle);
+
+            tlog.Debug(tag, "OnCreate() END!");
+        }
+
+        static public async Task MainTitleChangeBackgroundColor(Color color)
+        {
+            if (color != null)
+            {
+                mainTitle.BackgroundColor = color;
+                await Task.Delay(900);
+            }
+        }
+
+        static public async Task MainTitleChangeText(string tcTitle)
+        {
+            if (tcTitle != null)
+            {
+                var processId = Process.GetCurrentProcess().Id;
+                var threadId = Thread.CurrentThread.ManagedThreadId;
+
+                mainTitle.Text = $"{title}\nProcess ID: {processId}\nThread ID: {threadId}\n TC: {tcTitle}";
+                await Task.Delay(20);
+
+                tlog.Debug(tag, $"{title}\nProcess ID: {processId}\nThread ID: {threadId}\n TC: {tcTitle}");
+            }
+        }
+
+        protected override void OnResume()
+        {
+            base.OnResume();
+
+            tlog.Debug(tag, $"OnResume() START!");
+
+            TRunner t = new TRunner();
+            t.LoadTestsuite();
+            t.Execute();
+
+            tlog.Debug(tag, $"OnResume() END!");
+        }
+
+        protected override void OnPause()
+        {
+            base.OnPause();
+        }
+
+        protected override void OnTerminate()
+        {
+            base.OnTerminate();
+            Exit();
+        }
+
+        static void Main(string[] args)
+        {
+            tlog.Debug(tag, "NUI RUN!");
+            App example = new App();
+            example.Run(args);
+        }
+    };
+}
diff --git a/tct-suite-vs/Tizen.Multimedia.NUI.Tests/Tizen.Multimedia.NUI.Tests.csproj b/tct-suite-vs/Tizen.Multimedia.NUI.Tests/Tizen.Multimedia.NUI.Tests.csproj
new file mode 100755 (executable)
index 0000000..0e67e69
--- /dev/null
@@ -0,0 +1,41 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <!-- Property Group for .NET Core Project -->
+  <PropertyGroup>
+    <OutputType>Exe</OutputType>
+    <TargetFramework>tizen90</TargetFramework>
+    <TargetFrameworkIdentifier>Tizen</TargetFrameworkIdentifier>
+  </PropertyGroup>
+
+  <!-- Property Group for Tizen Project -->
+  <PropertyGroup>
+    <TizenCreateTpkOnBuild>true</TizenCreateTpkOnBuild>
+  </PropertyGroup>
+
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugType>portable</DebugType>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>None</DebugType>
+  </PropertyGroup>
+
+  <ItemGroup>
+  <Folder Include="lib\" />
+  </ItemGroup>
+
+  <Import Project="..\Common\dependencies.props" />
+
+  <ItemGroup>
+    <PackageReference Include="Tizen.NET" Version="$(TizenNETVersion)">
+      <ExcludeAssets>Runtime</ExcludeAssets>
+    </PackageReference>
+    <PackageReference Include="Tizen.NET.Sdk" Version="$(TizenNETSdkVersion)" />
+  </ItemGroup>
+
+  <!-- Include Nuget Package for Tizen Project building -->
+  <ItemGroup>
+    <ProjectReference Include="..\nunit.framework\nunit.framework.csproj" />
+    <ProjectReference Include="..\nunitlite\nunitlite.csproj" />
+  </ItemGroup>
+
+</Project>
diff --git a/tct-suite-vs/Tizen.Multimedia.NUI.Tests/Tizen.Multimedia.NUI.Tests.sln b/tct-suite-vs/Tizen.Multimedia.NUI.Tests/Tizen.Multimedia.NUI.Tests.sln
new file mode 100755 (executable)
index 0000000..17e9c51
--- /dev/null
@@ -0,0 +1,72 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.26730.15
+MinimumVisualStudioVersion = 15.0.26124.0
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia.NUI.Tests", "Tizen.Multimedia.NUI.Tests.csproj", "{D92BEEAC-3B2A-45F8-8C53-53B92550404A}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunit.framework", "..\nunit.framework\nunit.framework.csproj", "{B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunitlite", "..\nunitlite\nunitlite.csproj", "{FDB8025A-C029-461F-895E-287B4C65939B}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoTemplate", "..\Template\AutoTemplate\AutoTemplate.csproj", "{B11ABB0C-C3C1-4B5C-8251-A15628A775F3}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Any CPU = Debug|Any CPU
+               Debug|x64 = Debug|x64
+               Debug|x86 = Debug|x86
+               Release|Any CPU = Release|Any CPU
+               Release|x64 = Release|x64
+               Release|x86 = Release|x86
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x64.ActiveCfg = Debug|Any CPU
+               {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x64.Build.0 = Debug|Any CPU
+               {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x86.ActiveCfg = Debug|Any CPU
+               {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x86.Build.0 = Debug|Any CPU
+               {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|Any CPU.Build.0 = Release|Any CPU
+               {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x64.ActiveCfg = Release|Any CPU
+               {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x64.Build.0 = Release|Any CPU
+               {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x86.ActiveCfg = Release|Any CPU
+               {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x86.Build.0 = Release|Any CPU
+               {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x64.ActiveCfg = Debug|Any CPU
+               {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x64.Build.0 = Debug|Any CPU
+               {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x86.ActiveCfg = Debug|Any CPU
+               {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x86.Build.0 = Debug|Any CPU
+               {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|Any CPU.Build.0 = Release|Any CPU
+               {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x64.ActiveCfg = Release|Any CPU
+               {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x64.Build.0 = Release|Any CPU
+               {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x86.ActiveCfg = Release|Any CPU
+               {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x86.Build.0 = Release|Any CPU
+               {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x64.ActiveCfg = Debug|Any CPU
+               {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x64.Build.0 = Debug|Any CPU
+               {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x86.ActiveCfg = Debug|Any CPU
+               {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x86.Build.0 = Debug|Any CPU
+               {FDB8025A-C029-461F-895E-287B4C65939B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {FDB8025A-C029-461F-895E-287B4C65939B}.Release|Any CPU.Build.0 = Release|Any CPU
+               {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x64.ActiveCfg = Release|Any CPU
+               {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x64.Build.0 = Release|Any CPU
+               {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x86.ActiveCfg = Release|Any CPU
+               {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x86.Build.0 = Release|Any CPU
+               {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.NUI|Any CPU.ActiveCfg = Debug|Any CPU
+               {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.NUI|Any CPU.Build.0 = Debug|Any CPU
+               {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|Any CPU.Build.0 = Release|Any CPU
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+       GlobalSection(ExtensibilityGlobals) = postSolution
+               SolutionGuid = {ED382B91-9930-40B6-B3D7-362304C78680}
+       EndGlobalSection
+EndGlobal
diff --git a/tct-suite-vs/Tizen.Multimedia.NUI.Tests/shared/res/Tizen.Multimedia.NUI.Tests.png b/tct-suite-vs/Tizen.Multimedia.NUI.Tests/shared/res/Tizen.Multimedia.NUI.Tests.png
new file mode 100755 (executable)
index 0000000..9765b1b
Binary files /dev/null and b/tct-suite-vs/Tizen.Multimedia.NUI.Tests/shared/res/Tizen.Multimedia.NUI.Tests.png differ
diff --git a/tct-suite-vs/Tizen.Multimedia.NUI.Tests/testcase/TSDisplay.cs b/tct-suite-vs/Tizen.Multimedia.NUI.Tests/testcase/TSDisplay.cs
new file mode 100755 (executable)
index 0000000..69ab20a
--- /dev/null
@@ -0,0 +1,88 @@
+// Copyright 2021 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 NUnit.Framework.TUnit;
+using System;
+using System.Threading.Tasks;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI;
+
+namespace Tizen.Multimedia.NUI.Tests
+{
+    [TestFixture]
+    [Description("Tests Tizen.Multimedia.Display class")]
+    public class DisplayTests
+    {
+        Tizen.NUI.Window window = null;
+
+        [SetUp]
+        public void Init()
+        {
+            try
+            {
+                window = new Tizen.NUI.Window("Test window");
+            }
+            catch
+            {
+                Assert.Pass("NUI window is not supported.");
+            }
+        }
+
+        [TearDown]
+        public void Destroy()
+        {
+
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Check whether Display instance is created properly or not")]
+        [Property("SPEC", "Tizen.Multimedia.Display.Display C")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "CONSTR")]
+        [Property("COVPARAM", "NUI.Window")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void Display_WITH_NUI_WINDOW()
+        {
+            var display = new Display(window);
+            Assert.IsNotNull(display, "display should not be null.");
+            Assert.IsInstanceOf<Display>(display, "Should return Display instance.");
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Check whether Display instance without UI sync is created properly or not")]
+        [Property("SPEC", "Tizen.Multimedia.Display.Display C")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "CONSTR")]
+        [Property("COVPARAM", "NUI.Window, bool")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void Display_WITH_NUI_WINDOW_WITHOUT_UI_SYNC()
+        {
+            var display = new Display(window, false);
+            Assert.IsNotNull(display, "display should not be null.");
+            Assert.IsInstanceOf<Display>(display, "Should return Display instance.");
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Check whether Display without UI sync instance is created properly or not")]
+        [Property("SPEC", "Tizen.Multimedia.Display.Display C")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "CONSTR")]
+        [Property("COVPARAM", "NUI.Window, bool")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void Display_WITH_NUI_WINDOW_WITH_UI_SYNC()
+        {
+            var display = new Display(window, false);
+            Assert.IsNotNull(display, "display should not be null.");
+            Assert.IsInstanceOf<Display>(display, "Should return Display instance.");
+        }
+    }
+}
\ No newline at end of file
diff --git a/tct-suite-vs/Tizen.Multimedia.NUI.Tests/tizen-manifest.xml b/tct-suite-vs/Tizen.Multimedia.NUI.Tests/tizen-manifest.xml
new file mode 100755 (executable)
index 0000000..3d06225
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="9" package="Tizen.Multimedia.NUI.Tests" version="1.0.0">
+    <profile name="common" />
+    <ui-application appid="Tizen.Multimedia.NUI.Tests"
+                    exec="Tizen.Multimedia.NUI.Tests.dll"
+                    type="dotnet"
+                    multiple="false"
+                    taskmanage="true"
+                    launch_mode="single">
+    <icon>Tizen.Multimedia.NUI.Tests.png</icon>
+    <label>Tizen.Multimedia.NUI.Tests</label>
+    </ui-application>
+    <privileges>
+        <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+    </privileges>
+</manifest>