[Test]
[Category("P1")]
- [Description("Test Display property of the camera.")]
- [Property("SPEC", "Tizen.Multimedia.Camera.Display A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
- public void Display_PROPERTY_READ_ONLY()
- {
- /* TESTCODE
- * Test Surface Display Type.
- * Overlay type is tested always in TestBase.SetUpBase()
- */
- try
- {
- TestCamera.Display = new Display(new MediaView(CreateWindow()));
- }
- catch (NotSupportedException)
- {
- Assert.Pass("EVAS surface display type is not supported.");
- }
- catch
- {
- Assert.Fail("Set display for surface type is failed.");
- }
- }
-
- [Test]
- [Category("P1")]
[Description("Test Setting property of the camera.")]
[Property("SPEC", "Tizen.Multimedia.Camera.Settings A")]
[Property("SPEC_URL", "-")]
-using ElmSharp;
using NUnit.Framework;
using System;
using System.Linq;
{
Assert.Pass("Camera feature is not supported.");
}
-
- /// Default test window type is overlay.
- try
- {
- TestCamera.Display = new Display(CreateWindow());
- }
- catch (NotSupportedException)
- {
- Assert.Pass("Overlay display type is not supported.");
- }
- catch
- {
- Assert.Fail("Set display for overlay type is failed.");
- }
}
[TearDown]
{
return FeatureChecker.IsSupported(Features.SecondaryCamera);
}
-
- internal static Window CreateWindow()
- {
- var w = new Window("");
- w.Resize(100, 100);
- w.Realize(null);
- return w;
- }
-
- public static Display CameraOverlayDisplay = new Display(CreateWindow());
-
- public static Display CameraSurfaceDisplay = new Display(new MediaView(CreateWindow()));
}
}
[Test]
- [Category("P1")]
- [Description("Test AdaptiveVariants supported property. Supported list should be greater than 0")]
- [Property("SPEC", "Tizen.Multimedia.AdaptiveVariants.AvailableAdaptiveVariants A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
- public async Task AvailableAdaptiveVariants_PROPERTY_READ_ONLY()
- {
- try
- {
- var player = await GetPreparedPlayer(_adaptiveStreamingSource, DefaultDisplay);
- IList result = player.AdaptiveVariants.AvailableAdaptiveVariants.ToList();
- Assert.IsNotNull(result, "The list of adaptive variants should not be null.");
- Assert.IsNotEmpty(result, "The list of adaptive variants should not be empty.");
- Assert.Greater(result.Count, 0, "The list of adaptive variants should be greater than 0");
- }
- catch (Exception)
- {
- NetworkConncetion.Check();
- throw;
- }
- }
-
- [Test]
[Category("P2")]
[Description("Any attempt to access the AvailableAdaptiveVariants if the player has been disposed of")]
[Property("SPEC", "Tizen.Multimedia.AdaptiveVariants.AvailableAdaptiveVariants A")]
{
Assert.That(() => _configuration.BufferMinThreshold = 101U, Throws.TypeOf<ArgumentOutOfRangeException>());
}
-
- [Test]
- [Category("P1")]
- [Description("BufferStatusChanged test")]
- [Property("SPEC", "Tizen.Multimedia.MediaStreamConfiguration.BufferStatusChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")]
- public async Task BufferStatusChanged_CHECK()
- {
- await GetPreparedPlayer(_streamSource, DefaultDisplay);
-
- using (var eventAwaiter = EventAwaiter<MediaStreamBufferStatusChangedEventArgs>.Create())
- {
- _configuration.BufferMinThreshold = 10U;
- _configuration.BufferStatusChanged += eventAwaiter;
- new VideoDecoderParser(Constants.PushFilePath).Feed((packet) =>
- {
- _streamSource.Push(packet);
- packet.Dispose();
- });
-
- var args = await eventAwaiter.GetResultAsync();
-
- Assert.That(args.Status, Is.EqualTo(MediaStreamBufferStatus.Underrun));
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("SeekingOccurred test")]
- [Property("SPEC", "Tizen.Multimedia.MediaStreamConfiguration.SeekingOccurred E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")]
- public async Task SeekingOccurred_CHECK()
- {
- var player = await GetPreparedPlayer(_streamSource, DefaultDisplay);
-
- using (var eventAwaiter = EventAwaiter<MediaStreamSeekingOccurredEventArgs>.Create())
- {
- _configuration.SeekingOccurred += eventAwaiter;
-
- new VideoDecoderParser(Constants.PushFilePath).Feed((packet) =>
- {
- _streamSource.Push(packet);
- packet.Dispose();
- });
-
- await player.SetPlayPositionAsync(40000, true);
-
- Assert.That(await eventAwaiter.IsRaisedAsync());
- }
- }
}
}
[Test]
[Category("P2")]
- [Description("Push throws if a audio packet is passed to a video source")]
- [Property("SPEC", "Tizen.Multimedia.MediaStreamSource.Push M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MEX")]
- [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")]
- public async Task Push_THROWS_IF_PACKET_NOT_ACCEPTABLE_VIDEO()
- {
- var player = await GetPreparedPlayer(_videoSource, DefaultDisplay);
-
- using (var audioPacket = MediaPacket.Create(AacAudioFormat))
- {
- Assert.That(() => _videoSource.Push(audioPacket), Throws.ArgumentException);
- }
- }
-
- [Test]
- [Category("P2")]
[Description("Push throws if the player is in the idle state")]
[Property("SPEC", "Tizen.Multimedia.MediaStreamSource.Push M")]
[Property("SPEC_URL", "-")]
}
#endregion
- #region AudioOnly
-
- [Test]
- [Category("P1")]
- [Description("Default IsAudioOnly value is false")]
- [Property("SPEC", "Tizen.Multimedia.Player.IsAudioOnly A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PDV")]
- [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
- public async Task IsAudioOnly_DEFAULT()
- {
- var player = await GetPreparedPlayer(
- new MediaUriSource(Constants.VideoFilePath), DefaultDisplay);
-
- Assert.That(player.IsAudioOnly, Is.False);
-
- }
-
- [Test]
- [Category("P1")]
- [Description("check whether IsAudioOnly is readable and writable")]
- [Property("SPEC", "Tizen.Multimedia.Player.IsAudioOnly A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
- public async Task IsAudioOnly_SET_GET()
- {
- var player = await GetPreparedPlayer(
- new MediaUriSource(Constants.VideoFilePath), DefaultDisplay);
-
- const bool newValue = true;
-
- player.IsAudioOnly = newValue;
- Assert.That(player.IsAudioOnly, Is.EqualTo(newValue));
- }
-
- #endregion
#region AudioLatencyMode
}
[Test]
- [Category("P2")]
- [Description("Display can't be assigned to multiple players")]
- [Property("SPEC", "Tizen.Multimedia.Player.Display A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PEX")]
- [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")]
- public void Display_THROWS_IF_SET_TO_MULTIPLE()
- {
- using (Player p = new Player())
- {
- TestPlayer.Display = DefaultDisplay;
-
- Assert.That(() => p.Display = DefaultDisplay, Throws.ArgumentException);
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Display set test")]
- [Property("SPEC", "Tizen.Multimedia.Player.Display A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PCST")]
- [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")]
- public void Display_SET_CHECK()
- {
- Assert.That(() => TestPlayer.Display = DefaultDisplay, Throws.Nothing);
- }
-
- [Test]
[Category("P1")]
[Description("Is always not null")]
[Property("SPEC", "Tizen.Multimedia.Player.DisplaySettings A")]
}
#endregion
- #region VideoStreamChanged
-
- [Test]
- [Category("P1")]
- [Description("VideoStreamChanged test")]
- [Property("SPEC", "Tizen.Multimedia.Player.VideoStreamChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")]
- public async Task VideoStreamChanged_CHECK()
- {
- using (var eventAwaiter = EventAwaiter<VideoStreamChangedEventArgs>.Create())
- {
- var player = await GetPreparedPlayer(
- new MediaUriSource(Constants.StreamChangedTestFilePath), DefaultDisplay);
-
- player.VideoStreamChanged += eventAwaiter;
-
- player.Start();
-
- await player.SetPlayPositionAsync(4500, true);
-
- Assert.That(await eventAwaiter.IsRaisedAsync(), "Event wasn't raised.");
- }
- }
-
- #endregion
-
- #region PlaybackInterrupted
-
- [Test]
- [Category("P1")]
- [Description("PlaybackInterrupted test")]
- [Property("SPEC", "Tizen.Multimedia.Player.PlaybackInterrupted E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")]
- public async Task PlaybackInterrupted_CHECK()
- {
- var source = Constants.VideoFileSource;
-
- using (var eventWaiter = EventAwaiter<PlaybackInterruptedEventArgs>.Create())
- {
- var player = await GetPreparedPlayer(
- new MediaUriSource(Constants.StreamChangedTestFilePath), DefaultDisplay);
-
- player.PlaybackInterrupted += eventWaiter;
-
- using (Player secondPlayer = new Player())
- {
- secondPlayer.SetSource(source);
- secondPlayer.Display = new Display(CreateWindow());
- await secondPlayer.PrepareAsync();
- }
- Assert.That(await eventWaiter.IsRaisedAsync());
- }
- }
-
- #endregion
-
#region ErrorOccurred
[Test]
#region VideoRoi
[Test]
- [Category("P1")]
- [Description("SetVideoRoi default test")]
- [Property("SPEC", "Tizen.Multimedia.Player.SetVideoRoi M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MCST")]
- [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
- public void SetVideoRoi_DEFAULT()
- {
- Player player = new Player();
- player.SetSource(Constants.VideoFileSource);
- player.Display = new Display(CreateWindow());
-
- ScaleRectangle sr = new ScaleRectangle(0.19, 0.98765, 1.0, 0.21548);
-
- Assert.That(() => player.SetVideoRoi(sr), Throws.Nothing);
- Assert.That(player.GetVideoRoi(), Is.EqualTo(sr), "Invalid value.");
- player.Dispose();
- }
-
- [Test]
[Category("P2")]
[Description("Any attempt to call the SetVideoRoi if the player has been disposed of")]
[Property("SPEC", "Tizen.Multimedia.Player.SetVideoRoi M")]
[Test]
[Category("P2")]
- [Description("SetVideoRoi throws exceptions if out of range")]
- [Property("SPEC", "Tizen.Multimedia.Player.SetVideoRoi M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MEX")]
- [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
- public void SetVideoRoi_OUT_OF_RANGE()
- {
- Player player = new Player();
- player.SetSource(Constants.VideoFileSource);
- player.Display = new Display(CreateWindow());
-
- Assert.That(() => player.SetVideoRoi(new ScaleRectangle(0, 0, 0, 0)), Throws.TypeOf<ArgumentOutOfRangeException>());
- Assert.That(() => player.SetVideoRoi(new ScaleRectangle(0.1, 0.1, 0.18, 4)), Throws.TypeOf<ArgumentOutOfRangeException>());
- Assert.That(() => player.SetVideoRoi(new ScaleRectangle(0.99, -0.1, 1, 1)), Throws.TypeOf<ArgumentOutOfRangeException>());
- Assert.That(() => player.SetVideoRoi(new ScaleRectangle(0.1, 0.1, 1.1, 1)), Throws.TypeOf<ArgumentOutOfRangeException>());
- Assert.That(() => player.SetVideoRoi(new ScaleRectangle(-3, 0.1, 1, 1)), Throws.TypeOf<ArgumentOutOfRangeException>());
- player.Dispose();
- }
-
- [Test]
- [Category("P2")]
[Description("SetVideoRoi throws if display has wrong type")]
[Property("SPEC", "Tizen.Multimedia.Player.SetVideoRoi M")]
[Property("SPEC_URL", "-")]
-using NUnit.Framework;
+using NUnit.Framework;
using System;
using System.IO;
using System.Threading.Tasks;
public const int VerticalDegrees = 67;
}
- protected async Task<SphericalVideo> GetSphericalVideo()
- {
- return (await GetPlayingPlayer(Constants.SphericalVideoSource, DefaultDisplay)).SphericalVideo;
- }
-
- [Test]
- [Category("P1")]
- [Description("Player always not null")]
- [Property("SPEC", "Tizen.Multimedia.SphericalVideo.Player A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PDV")]
- [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
- public async Task Player_CHECK()
- {
- Assert.That((await GetSphericalVideo()).Player, Is.Not.Null);
- }
-
- [Test]
- [Category("P1")]
- [Description("Check whether IsEnabled is readable and writable")]
- [Property("SPEC", "Tizen.Multimedia.SphericalVideo.IsEnabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
- public async Task IsEnabled_SET_GET()
- {
- var player = await GetPreparedPlayer(
- new MediaUriSource(Constants.SphericalVideoPath), DefaultDisplay);
-
- const bool newValue = true;
-
- player.SphericalVideo.IsEnabled = newValue;
- Assert.That(player.SphericalVideo.IsEnabled, Is.EqualTo(newValue), "Invalid value");
- }
-
- [Test]
- [Category("P1")]
- [Description("IsSphericalContent throws if the video is spherical content")]
- [Property("SPEC", "Tizen.Multimedia.SphericalVideo.IsSphericalContent M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
- public async Task IsSphericalContent_TRUE()
- {
- var player = await GetPreparedPlayer(
- new MediaUriSource(Constants.SphericalVideoPath), DefaultDisplay);
-
- Assert.That(player.SphericalVideo.IsSphericalContent(), Is.True, "Invalid value");
- }
-
- [Test]
- [Category("P1")]
- [Description("IsSphericalContent throws if the video is not spherical content")]
- [Property("SPEC", "Tizen.Multimedia.SphericalVideo.IsSphericalContent M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
- public async Task IsSphericalContent_FALSE()
- {
- var player = await GetPreparedPlayer(
- new MediaUriSource(Constants.VideoFilePath), DefaultDisplay);
-
- Assert.That(player.SphericalVideo.IsSphericalContent(), Is.False, "Invalid value");
- }
-
[Test]
[Category("P1")]
[Description("Check default value of DirectionOfView")]
-using ElmSharp;
+using ElmSharp;
using NUnit.Framework;
using NUnit.Framework.TUnit;
using System;
return TestPlayer;
}
-
- internal static Window CreateWindow()
- {
- var w = new Window("");
- w.Resize(100, 100);
- w.Realize(null);
- return w;
- }
-
- public static Display DefaultDisplay = new Display(CreateWindow());
}
--- /dev/null
+/*
+ * Copyright (c) 2018 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 System;
+using NUnitLite.TUnit;
+using AutoTemplate;
+
+namespace XamarinForTizen.Tizen
+{
+
+ class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication
+ {
+ private static App _app;
+ protected override void OnCreate()
+ {
+ base.OnCreate();
+
+ Console.WriteLine("TCT : OnCreate()");
+ _app = new App();
+ LoadApplication(_app);
+
+ TRunner t = new TRunner();
+ t.LoadTestsuite();
+ t.Execute();
+ }
+
+ public static App getApp()
+ {
+ return _app;
+ }
+ static void Main(string[] args)
+ {
+ Console.WriteLine("TCT : Main()");
+ var app = new Program();
+ global::Xamarin.Forms.Forms.Init(app);
+ app.Run(args);
+ }
+ }
+}
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <!-- Property Group for .NET Core Project -->
+ <PropertyGroup>
+ <OutputType>Exe</OutputType>
+ <TargetFramework>tizen80</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="..\Template\AutoTemplate\AutoTemplate.csproj" />
+ <ProjectReference Include="..\Tizen.Multimedia.Support.Library\Tizen.Multimedia.Support.Library.csproj" />
+ </ItemGroup>
+
+</Project>
--- /dev/null
+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.UI.Tests", "Tizen.Multimedia.UI.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
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia.Support.Library", "..\Tizen.Multimedia.Support.Library\Tizen.Multimedia.Support.Library.csproj", "{612D4512-0652-41F2-A192-426C76BE99F1}"
+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}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x64.Build.0 = Debug|Any CPU
+ {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x86.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
+ {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x64.ActiveCfg = Release|Any CPU
+ {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x64.Build.0 = Release|Any CPU
+ {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x86.ActiveCfg = Release|Any CPU
+ {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x86.Build.0 = Release|Any CPU
+ {612D4512-0652-41F2-A192-426C76BE99F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {612D4512-0652-41F2-A192-426C76BE99F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {612D4512-0652-41F2-A192-426C76BE99F1}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {612D4512-0652-41F2-A192-426C76BE99F1}.Debug|x64.Build.0 = Debug|Any CPU
+ {612D4512-0652-41F2-A192-426C76BE99F1}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {612D4512-0652-41F2-A192-426C76BE99F1}.Debug|x86.Build.0 = Debug|Any CPU
+ {612D4512-0652-41F2-A192-426C76BE99F1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {612D4512-0652-41F2-A192-426C76BE99F1}.Release|Any CPU.Build.0 = Release|Any CPU
+ {612D4512-0652-41F2-A192-426C76BE99F1}.Release|x64.ActiveCfg = Release|Any CPU
+ {612D4512-0652-41F2-A192-426C76BE99F1}.Release|x64.Build.0 = Release|Any CPU
+ {612D4512-0652-41F2-A192-426C76BE99F1}.Release|x86.ActiveCfg = Release|Any CPU
+ {612D4512-0652-41F2-A192-426C76BE99F1}.Release|x86.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {ED382B91-9930-40B6-B3D7-362304C78680}
+ EndGlobalSection
+EndGlobal
--- /dev/null
+// Copyright 2020 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;
+
+namespace Tizen.Multimedia.UI.Tests
+{
+ [TestFixture]
+ [Description("Tests Tizen.Multimedia.Camera class")]
+ public class CameraTests : CameraTestBase
+ {
+ [Test]
+ [Category("P1")]
+ [Description("Test Display property of the camera.")]
+ [Property("SPEC", "Tizen.Multimedia.Camera.Display A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void Display_PROPERTY_READ_ONLY()
+ {
+ /* TESTCODE
+ * Test Surface Display Type.
+ * Overlay type is tested always in TestBase.SetUpBase()
+ */
+ try
+ {
+ TestCamera.Display = new Display(new MediaView(CreateWindow()));
+ }
+ catch (NotSupportedException)
+ {
+ Assert.Pass("EVAS surface display type is not supported.");
+ }
+ catch
+ {
+ Assert.Fail("Set display for surface type is failed.");
+ }
+ }
+ }
+}
--- /dev/null
+/*
+* Copyright (c) 2020 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 NUnit.Framework;
+using System.Threading.Tasks;
+using System.Linq;
+using System.Collections;
+using System;
+
+namespace Tizen.Multimedia.UI.Tests
+{
+ [TestFixture]
+ [Description("Tizen.Multimedia.AdaptiveVariants Tests")]
+ public class AdaptiveVariantsTests : MediaPlayerTestBase
+ {
+ private MediaUriSource _adaptiveStreamingSource = null;
+
+ [OneTimeSetUp]
+ public void Init()
+ {
+ if (MediaPlayerPreconditionUtils.ADAPTIVE_STREAMING_URI == null)
+ MediaPlayerPreconditionUtils.SetPrecondition();
+
+ _adaptiveStreamingSource = new MediaUriSource(MediaPlayerPreconditionUtils.ADAPTIVE_STREAMING_URI);
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test AdaptiveVariants supported property. Supported list should be greater than 0")]
+ [Property("SPEC", "Tizen.Multimedia.AdaptiveVariants.AvailableAdaptiveVariants A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public async Task AvailableAdaptiveVariants_PROPERTY_READ_ONLY()
+ {
+ try
+ {
+ var player = await GetPreparedPlayer(_adaptiveStreamingSource, DefaultDisplay);
+ IList result = player.AdaptiveVariants.AvailableAdaptiveVariants.ToList();
+ Assert.IsNotNull(result, "The list of adaptive variants should not be null.");
+ Assert.IsNotEmpty(result, "The list of adaptive variants should not be empty.");
+ Assert.Greater(result.Count, 0, "The list of adaptive variants should be greater than 0");
+ }
+ catch (Exception)
+ {
+ NetworkConncetion.Check();
+ throw;
+ }
+ }
+ }
+}
--- /dev/null
+/*
+* Copyright (c) 2020 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 NUnit.Framework;
+using System;
+using System.Threading.Tasks;
+
+namespace Tizen.Multimedia.UI.Tests
+{
+#pragma warning disable CS4014
+
+ [TestFixture]
+ [Description("Tizen.Multimedia.UI tests")]
+ public class PlayerTests : MediaPlayerTestBase
+ {
+ #region AudioOnly
+ [Test]
+ [Category("P1")]
+ [Description("Default IsAudioOnly value is false")]
+ [Property("SPEC", "Tizen.Multimedia.Player.IsAudioOnly A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PDV")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public async Task IsAudioOnly_DEFAULT()
+ {
+ var player = await GetPreparedPlayer(
+ new MediaUriSource(Constants.VideoFilePath), DefaultDisplay);
+
+ Assert.That(player.IsAudioOnly, Is.False);
+
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("check whether IsAudioOnly is readable and writable")]
+ [Property("SPEC", "Tizen.Multimedia.Player.IsAudioOnly A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public async Task IsAudioOnly_SET_GET()
+ {
+ var player = await GetPreparedPlayer(
+ new MediaUriSource(Constants.VideoFilePath), DefaultDisplay);
+
+ const bool newValue = true;
+
+ player.IsAudioOnly = newValue;
+ Assert.That(player.IsAudioOnly, Is.EqualTo(newValue));
+ }
+ #endregion
+
+ #region Display
+ [Test]
+ [Category("P2")]
+ [Description("Display can't be assigned to multiple players")]
+ [Property("SPEC", "Tizen.Multimedia.Player.Display A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")]
+ public void Display_THROWS_IF_SET_TO_MULTIPLE()
+ {
+ using (Player p = new Player())
+ {
+ TestPlayer.Display = DefaultDisplay;
+
+ Assert.That(() => p.Display = DefaultDisplay, Throws.ArgumentException);
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Display set test")]
+ [Property("SPEC", "Tizen.Multimedia.Player.Display A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PCST")]
+ [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")]
+ public void Display_SET_CHECK()
+ {
+ Assert.That(() => TestPlayer.Display = DefaultDisplay, Throws.Nothing);
+ }
+ #endregion
+
+ #region VideoStreamChanged
+ [Test]
+ [Category("P1")]
+ [Description("VideoStreamChanged test")]
+ [Property("SPEC", "Tizen.Multimedia.Player.VideoStreamChanged E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")]
+ public async Task VideoStreamChanged_CHECK()
+ {
+ using (var eventAwaiter = EventAwaiter<VideoStreamChangedEventArgs>.Create())
+ {
+ var player = await GetPreparedPlayer(
+ new MediaUriSource(Constants.StreamChangedTestFilePath), DefaultDisplay);
+
+ player.VideoStreamChanged += eventAwaiter;
+
+ player.Start();
+
+ await player.SetPlayPositionAsync(4500, true);
+
+ Assert.That(await eventAwaiter.IsRaisedAsync(), "Event wasn't raised.");
+ }
+ }
+ #endregion
+
+ #region PlaybackInterrupted
+ [Test]
+ [Category("P1")]
+ [Description("PlaybackInterrupted test")]
+ [Property("SPEC", "Tizen.Multimedia.Player.PlaybackInterrupted E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")]
+ public async Task PlaybackInterrupted_CHECK()
+ {
+ var source = Constants.VideoFileSource;
+
+ using (var eventWaiter = EventAwaiter<PlaybackInterruptedEventArgs>.Create())
+ {
+ var player = await GetPreparedPlayer(
+ new MediaUriSource(Constants.StreamChangedTestFilePath), DefaultDisplay);
+
+ player.PlaybackInterrupted += eventWaiter;
+
+ using (Player secondPlayer = new Player())
+ {
+ secondPlayer.SetSource(source);
+ secondPlayer.Display = new Display(CreateWindow());
+ await secondPlayer.PrepareAsync();
+ }
+ Assert.That(await eventWaiter.IsRaisedAsync());
+ }
+ }
+ #endregion
+
+ #region VideoRoi
+ [Test]
+ [Category("P1")]
+ [Description("SetVideoRoi default test")]
+ [Property("SPEC", "Tizen.Multimedia.Player.SetVideoRoi M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MCST")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public void SetVideoRoi_DEFAULT()
+ {
+ Player player = new Player();
+ player.SetSource(Constants.VideoFileSource);
+ player.Display = new Display(CreateWindow());
+
+ ScaleRectangle sr = new ScaleRectangle(0.19, 0.98765, 1.0, 0.21548);
+
+ Assert.That(() => player.SetVideoRoi(sr), Throws.Nothing);
+ Assert.That(player.GetVideoRoi(), Is.EqualTo(sr), "Invalid value.");
+ player.Dispose();
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("SetVideoRoi throws exceptions if out of range")]
+ [Property("SPEC", "Tizen.Multimedia.Player.SetVideoRoi M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public void SetVideoRoi_OUT_OF_RANGE()
+ {
+ Player player = new Player();
+ player.SetSource(Constants.VideoFileSource);
+ player.Display = new Display(CreateWindow());
+
+ Assert.That(() => player.SetVideoRoi(new ScaleRectangle(0, 0, 0, 0)), Throws.TypeOf<ArgumentOutOfRangeException>());
+ Assert.That(() => player.SetVideoRoi(new ScaleRectangle(0.1, 0.1, 0.18, 4)), Throws.TypeOf<ArgumentOutOfRangeException>());
+ Assert.That(() => player.SetVideoRoi(new ScaleRectangle(0.99, -0.1, 1, 1)), Throws.TypeOf<ArgumentOutOfRangeException>());
+ Assert.That(() => player.SetVideoRoi(new ScaleRectangle(0.1, 0.1, 1.1, 1)), Throws.TypeOf<ArgumentOutOfRangeException>());
+ Assert.That(() => player.SetVideoRoi(new ScaleRectangle(-3, 0.1, 1, 1)), Throws.TypeOf<ArgumentOutOfRangeException>());
+ player.Dispose();
+ }
+ #endregion
+ }
+}
--- /dev/null
+/*
+* Copyright (c) 2020 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 NUnit.Framework;
+using System.Threading.Tasks;
+
+namespace Tizen.Multimedia.UI.Tests
+{
+ [TestFixture]
+ [Description("Tizen.Multimedia.MediaSteramConfiguration tests")]
+ public class MediaStreamConfigurationAssignedTests : MediaPlayerTestBase
+ {
+ private MediaStreamSource _streamSource;
+ private MediaStreamConfiguration _configuration;
+
+ [SetUp]
+ public void SetUp()
+ {
+ _streamSource = new MediaStreamSource(VideoDecoderParser.Format);
+ _configuration = _streamSource.VideoConfiguration;
+
+ GetIdlePlayer().SetSource(_streamSource);
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("BufferStatusChanged test")]
+ [Property("SPEC", "Tizen.Multimedia.MediaStreamConfiguration.BufferStatusChanged E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")]
+ public async Task BufferStatusChanged_CHECK()
+ {
+ await GetPreparedPlayer(_streamSource, DefaultDisplay);
+
+ using (var eventAwaiter = EventAwaiter<MediaStreamBufferStatusChangedEventArgs>.Create())
+ {
+ _configuration.BufferMinThreshold = 10U;
+ _configuration.BufferStatusChanged += eventAwaiter;
+ new VideoDecoderParser(Constants.PushFilePath).Feed((packet) =>
+ {
+ _streamSource.Push(packet);
+ packet.Dispose();
+ });
+
+ var args = await eventAwaiter.GetResultAsync();
+
+ Assert.That(args.Status, Is.EqualTo(MediaStreamBufferStatus.Underrun));
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("SeekingOccurred test")]
+ [Property("SPEC", "Tizen.Multimedia.MediaStreamConfiguration.SeekingOccurred E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")]
+ public async Task SeekingOccurred_CHECK()
+ {
+ var player = await GetPreparedPlayer(_streamSource, DefaultDisplay);
+
+ using (var eventAwaiter = EventAwaiter<MediaStreamSeekingOccurredEventArgs>.Create())
+ {
+ _configuration.SeekingOccurred += eventAwaiter;
+
+ new VideoDecoderParser(Constants.PushFilePath).Feed((packet) =>
+ {
+ _streamSource.Push(packet);
+ packet.Dispose();
+ });
+
+ await player.SetPlayPositionAsync(40000, true);
+
+ Assert.That(await eventAwaiter.IsRaisedAsync());
+ }
+ }
+ }
+}
--- /dev/null
+/*
+* Copyright (c) 2020 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 NUnit.Framework;
+using System.Threading.Tasks;
+
+namespace Tizen.Multimedia.UI.Tests
+{
+ [TestFixture]
+ [Description("Tizen.Multimedia.MediaStreamSource Tests")]
+ public class MediaStreamSourceWithPlayerTests : MediaPlayerTestBase
+ {
+ private static readonly AudioMediaFormat AacAudioFormat = new AudioMediaFormat(
+ MediaFormatAudioMimeType.Aac, 2, 48000, 16, 128000);
+
+ private MediaStreamSource _audioSource = new MediaStreamSource(AacAudioFormat);
+ private MediaStreamSource _videoSource = new MediaStreamSource(VideoDecoderParser.Format);
+
+ [Test]
+ [Category("P2")]
+ [Description("Push throws if a audio packet is passed to a video source")]
+ [Property("SPEC", "Tizen.Multimedia.MediaStreamSource.Push M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")]
+ public async Task Push_THROWS_IF_PACKET_NOT_ACCEPTABLE_VIDEO()
+ {
+ var player = await GetPreparedPlayer(_videoSource, DefaultDisplay);
+
+ using (var audioPacket = MediaPacket.Create(AacAudioFormat))
+ {
+ Assert.That(() => _videoSource.Push(audioPacket), Throws.ArgumentException);
+ }
+ }
+ }
+}
--- /dev/null
+/*
+* Copyright (c) 2020 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 NUnit.Framework;
+using System.Threading.Tasks;
+
+namespace Tizen.Multimedia.UI.Tests
+{
+ [TestFixture]
+ [Description("Tizen.Multimedia.SphericalVideo Tests")]
+ public class SphericalVideoTests : MediaPlayerTestBase
+ {
+ [SetUp]
+ public void SetUp()
+ {
+ if (FeatureChecker.IsSupported(Features.OpenGl) == false
+ || FeatureChecker.IsSupported(Features.SphericalVideo) == false)
+ {
+ Assert.Pass($"The feature is not supported.");
+ }
+ }
+
+ private class DefaultValues
+ {
+ public const float Yaw = 0.0f;
+ public const float Pitch = 0.0f;
+ public const float level = 1.0f;
+ public const int HorizontalDegrees = 120;
+ public const int VerticalDegrees = 67;
+ }
+
+ protected async Task<SphericalVideo> GetSphericalVideo()
+ {
+ return (await GetPlayingPlayer(Constants.SphericalVideoSource, DefaultDisplay)).SphericalVideo;
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Player always not null")]
+ [Property("SPEC", "Tizen.Multimedia.SphericalVideo.Player A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PDV")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public async Task Player_CHECK()
+ {
+ Assert.That((await GetSphericalVideo()).Player, Is.Not.Null);
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether IsEnabled is readable and writable")]
+ [Property("SPEC", "Tizen.Multimedia.SphericalVideo.IsEnabled A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public async Task IsEnabled_SET_GET()
+ {
+ var player = await GetPreparedPlayer(
+ new MediaUriSource(Constants.SphericalVideoPath), DefaultDisplay);
+
+ const bool newValue = true;
+
+ player.SphericalVideo.IsEnabled = newValue;
+ Assert.That(player.SphericalVideo.IsEnabled, Is.EqualTo(newValue), "Invalid value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("IsSphericalContent throws if the video is spherical content")]
+ [Property("SPEC", "Tizen.Multimedia.SphericalVideo.IsSphericalContent M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public async Task IsSphericalContent_TRUE()
+ {
+ var player = await GetPreparedPlayer(
+ new MediaUriSource(Constants.SphericalVideoPath), DefaultDisplay);
+
+ Assert.That(player.SphericalVideo.IsSphericalContent(), Is.True, "Invalid value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("IsSphericalContent throws if the video is not spherical content")]
+ [Property("SPEC", "Tizen.Multimedia.SphericalVideo.IsSphericalContent M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public async Task IsSphericalContent_FALSE()
+ {
+ var player = await GetPreparedPlayer(
+ new MediaUriSource(Constants.VideoFilePath), DefaultDisplay);
+
+ Assert.That(player.SphericalVideo.IsSphericalContent(), Is.False, "Invalid value");
+ }
+ }
+}
+/*
+* Copyright (c) 2020 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 NUnit.Framework;
using System;
using System.Threading.Tasks;
-namespace Tizen.Multimedia.Tests
+namespace Tizen.Multimedia.UI.Tests
{
[TestFixture]
[Description("Tizen.Multimedia.StreamInfo tests")]
- public class StreamInfoVideoTests : TestBase
+ public class StreamInfoVideoTests : MediaPlayerTestBase
{
private class ExpectedValues
{
-// Copyright 2016 by Samsung Electronics, Inc.,
+// Copyright 2020 by Samsung Electronics, Inc.,
//
// This software is the confidential and proprietary information
// of Samsung Electronics, Inc. ("Confidential Information"). You
using NUnit.Framework;
using System;
-namespace Tizen.Multimedia.Tests
+namespace Tizen.Multimedia.UI.Tests
{
[TestFixture]
[Description("Tests Tizen.Multimedia.Display class")]
public class DisplayTests
{
- private const string RawVideoFeature = "http://tizen.org/feature/multimedia.raw_video";
-
[Test]
[Category("P1")]
[Description("Construction with MediaView")]
}
catch (NotSupportedException e)
{
- if (FeatureChecker.IsSupported(RawVideoFeature))
+ if (FeatureChecker.IsSupported(Features.RawVideo))
{
Assert.Fail($"Invalid NotSupportedException; {e.Message}");
}
--- /dev/null
+/*
+* Copyright (c) 2020 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 ElmSharp;
+using NUnit.Framework;
+using System;
+using System.Linq;
+
+namespace Tizen.Multimedia.UI.Tests
+{
+ public class CameraTestBase
+ {
+ public static Camera TestCamera { get; private set; }
+
+ [SetUp]
+ public void SetUpBase()
+ {
+ try
+ {
+ TestCamera = new Camera(CameraDevice.Rear);
+ TestCamera.Settings.PreviewPixelFormat = TestCamera.Capabilities.SupportedPreviewPixelFormats.FirstOrDefault();
+ }
+ catch (NotSupportedException) when (FeatureChecker.IsSupported(Features.PrimaryCamera) == false)
+ {
+ Assert.Pass("Camera feature is not supported.");
+ }
+
+ /// Default test window type is overlay.
+ try
+ {
+ TestCamera.Display = new Display(CreateWindow());
+ }
+ catch (NotSupportedException)
+ {
+ Assert.Pass("Overlay display type is not supported.");
+ }
+ catch
+ {
+ Assert.Fail("Set display for overlay type is failed.");
+ }
+ }
+
+ [TearDown]
+ public void TearDownBase()
+ {
+ if (TestCamera != null)
+ {
+ if (TestCamera.State == CameraState.Captured)
+ {
+ TestCamera.StartPreview();
+ TestCamera.StopPreview();
+ }
+ else if (TestCamera.State == CameraState.Preview)
+ {
+ TestCamera.StopPreview();
+ }
+
+ TestCamera?.Dispose();
+ }
+ }
+
+ internal static bool IsSupportedSecondaryCamera()
+ {
+ return FeatureChecker.IsSupported(Features.SecondaryCamera);
+ }
+
+ internal static Window CreateWindow()
+ {
+ var w = new Window("");
+ w.Resize(100, 100);
+ w.Realize(null);
+ return w;
+ }
+
+ public static Display CameraOverlayDisplay = new Display(CreateWindow());
+
+ public static Display CameraSurfaceDisplay = new Display(new MediaView(CreateWindow()));
+ }
+}
--- /dev/null
+/*
+* Copyright (c) 2020 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.
+*/
+
+namespace Tizen.Multimedia.UI.Tests
+{
+ internal static class Constants
+ {
+ internal const int AudioLength = 33384;
+
+ internal const string AudioFilePath = "/opt/usr/home/owner/share/res/test.mp3";
+ internal const string PushFilePath = "/opt/usr/home/owner/share/res/test.h264"; // no pts
+ internal const string VideoFilePath = "/opt/usr/home/owner/share/res/test_meta.mp4";
+ internal const string SphericalVideoPath = "/opt/usr/home/owner/share/res/test_360.mp4";
+
+ internal const string StreamChangedTestFilePath = "/opt/usr/home/owner/share/res/test_drc_640x480_320x240.ts";
+
+ internal static readonly MediaUriSource AudioFileSource = new MediaUriSource(AudioFilePath);
+ internal static readonly MediaUriSource VideoFileSource = new MediaUriSource(VideoFilePath);
+ internal static readonly MediaUriSource SphericalVideoSource = new MediaUriSource(SphericalVideoPath);
+ }
+}
--- /dev/null
+/*
+* Copyright (c) 2020 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.
+*/
+
+namespace Tizen.Multimedia.UI.Tests
+{
+ internal static class Features
+ {
+ internal const string PrimaryCamera = "http://tizen.org/feature/camera";
+ internal const string SecondaryCamera = "http://tizen.org/feature/camera.front";
+ internal const string RawVideo = "http://tizen.org/feature/multimedia.raw_video";
+
+ internal const string AudioEffect = "http://tizen.org/feature/multimedia.custom_audio_effect";
+ internal const string StreamInfo = "http://tizen.org/feature/multimedia.player.stream_info";
+ internal const string OpenGl = "http://tizen.org/feature/opengles.version.2_0";
+ internal const string SphericalVideo = "http://tizen.org/feature/multimedia.player.spherical_video";
+ internal const string AudioOffload = "http://tizen.org/feature/multimedia.player.audio_offload";
+ }
+}
--- /dev/null
+/*
+* Copyright (c) 2020 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 NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.System;
+using System;
+using Tizen.Network.Connection;
+using Tizen.Network.WiFi;
+
+namespace Tizen.Multimedia.UI.Tests
+{
+ internal static class NetworkConncetion
+ {
+ private static bool IsSupportable
+ {
+ get
+ {
+ Information.TryGetValue("http://tizen.org/feature/network.wifi", out bool isWiFiSupported);
+ Information.TryGetValue("http://tizen.org/feature/network.telephony", out bool isTelephonySupported);
+ Information.TryGetValue("http://tizen.org/feature/network.ethernet", out bool isEthernetSupported);
+
+ LogUtils.Write(LogUtils.INFO, LogUtils.TAG,
+ $"Wifi:{isWiFiSupported}, Telephony:{isTelephonySupported}, Ethernet:{isEthernetSupported}");
+
+ return isWiFiSupported | isTelephonySupported | isEthernetSupported;
+ }
+ }
+
+ public static void Check()
+ {
+ if (!IsSupportable)
+ {
+ Assert.Fail("Networks are not supported.");
+ }
+
+ if (ConnectionState.Connected == ConnectionManager.WiFiState)
+ {
+ WiFiAP WifiAp = WiFiManager.GetConnectedAP();
+ if (WifiAp != null)
+ {
+ LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "WifiAp : " + WifiAp.NetworkInformation.Essid.ToString());
+ WifiAp.Dispose();
+ }
+
+ try
+ {
+ var data = ConnectionManager.GetStatistics(ConnectionType.WiFi, StatisticsType.TotalReceivedData);
+ LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "TotalReceivedData : " + data);
+ if (data == 0)
+ Assert.Fail("TotalReceivedData should not be 0.");
+ }
+ catch (Exception ex)
+ {
+ Assert.Fail("Failed to get connection statistics. : " + ex.ToString());
+ }
+ }
+ else
+ {
+ LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Wifi is not connected. Maybe another network is being used.");
+ }
+ }
+ }
+}
--- /dev/null
+/*
+* Copyright (c) 2020 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 NUnit.Framework.TUnit;
+using System;
+using System.IO;
+
+namespace Tizen.Multimedia.UI.Tests
+{
+ public class MediaPlayerPreconditionUtils
+ {
+ public static string STREAMING_URI = null;
+ public static string ADAPTIVE_STREAMING_URI = null;
+
+ public static void SetPrecondition()
+ {
+ string result = ReadFile("/opt/usr/home/owner/share/tct/preconfigure.json");
+ int index = 0;
+ string[] resultArray = StringParser(result);
+
+ if (resultArray == null)
+ {
+ LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "StringParser failed " + result);
+ return;
+ }
+
+ foreach (string item in resultArray)
+ {
+ switch (item)
+ {
+ case "STREAMING_URI":
+ // Remove backslash
+ resultArray[index + 1] = resultArray[index + 1].Replace("\\", "");
+ STREAMING_URI = resultArray[index + 1];
+ break;
+ case "ADAPTIVE_STREAMING_URL":
+ resultArray[index + 1] = resultArray[index + 1].Replace("\\", "");
+ ADAPTIVE_STREAMING_URI = resultArray[index + 1];
+ break;
+ default:
+ break;
+ }
+ index++;
+ }
+ }
+
+ private static string ReadFile(string path)
+ {
+ string result = null;
+ string url = path;
+ StreamReader reader = null;
+
+ try
+ {
+ reader = File.OpenText(path);
+ result = reader.ReadToEnd();
+ }
+ catch (Exception e)
+ {
+ LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "File read error : " + e.Message);
+ }
+ finally
+ {
+ if (reader != null)
+ {
+ reader.Dispose();
+ }
+ }
+ return result;
+ }
+ private static string[] StringParser(string TCID)
+ {
+ TCID = TCID.Replace(": \"", ":\"");
+ TCID = TCID.Replace(" ", "");
+ TCID = TCID.Replace("\n", "");
+ TCID = TCID.Replace("\n", "");
+
+ string[] delimiter = { "[{\"", "\":\"", "\",\"", "\":", ",\"", "\"}]", "}" };
+ string[] stringPieces = null;
+
+ try
+ {
+ stringPieces = TCID.Split(delimiter, StringSplitOptions.None);
+ }
+ catch (Exception e)
+ {
+ LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "ResultParser : " + e.Message);
+ }
+
+ return stringPieces;
+ }
+ }
+}
--- /dev/null
+/*
+* Copyright (c) 2020 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 ElmSharp;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using System.Threading.Tasks;
+
+namespace Tizen.Multimedia.UI.Tests
+{
+ public class MediaPlayerTestBase
+ {
+ public Player TestPlayer { get; private set; }
+
+ [SetUp]
+ public void SetUpBase()
+ {
+ TestPlayer = new Player();
+ }
+
+ [TearDown]
+ public void TearDownBase()
+ {
+ TestPlayer.Dispose();
+ }
+
+ protected Player GetIdlePlayer()
+ {
+ TestPlayer.Unprepare();
+
+ return TestPlayer;
+ }
+
+ internal async Task PreparePlayerAsync()
+ {
+ PlayerError? error = null;
+
+ EventHandler<PlayerErrorOccurredEventArgs> errorHandler = (s, e) => error = e.Error;
+
+ TestPlayer.ErrorOccurred += errorHandler;
+
+ try
+ {
+ await TestPlayer.PrepareAsync();
+ }
+ catch
+ {
+ if (error != null)
+ {
+ string msg = $"Failed to prepare the player. Error : { error }.";
+
+ LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, msg);
+ throw new Exception(msg);
+ }
+ throw;
+ }
+ finally
+ {
+ TestPlayer.ErrorOccurred -= errorHandler;
+ }
+ }
+
+ protected async Task<Player> GetPreparedPlayer(MediaSource source = null, Display display = null)
+ {
+ // reset source
+ TestPlayer.SetSource(null);
+
+ TestPlayer.SetSource(source ?? Constants.AudioFileSource);
+ TestPlayer.Display = display;
+
+ await PreparePlayerAsync();
+
+ return TestPlayer;
+ }
+
+ protected async Task<Player> GetPlayingPlayer(MediaSource source = null, Display display = null)
+ {
+ await GetPreparedPlayer(source, display);
+
+ TestPlayer.Start();
+
+ return TestPlayer;
+ }
+
+ protected async Task<Player> GetPausedPlayer(MediaSource source = null, Display display = null)
+ {
+ await GetPlayingPlayer(source, display);
+
+ TestPlayer.Pause();
+
+ return TestPlayer;
+ }
+
+ internal static Window CreateWindow()
+ {
+ var w = new Window("");
+ w.Resize(100, 100);
+ w.Realize(null);
+ return w;
+ }
+
+ public static Display DefaultDisplay = new Display(CreateWindow());
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="8" package="Tizen.Multimedia.UI.Tests" version="1.0.0">
+ <profile name="common" />
+ <ui-application appid="Tizen.Multimedia.UI.Tests"
+ exec="Tizen.Multimedia.UI.Tests.dll"
+ type="dotnet"
+ multiple="false"
+ taskmanage="true"
+ launch_mode="single">
+ <icon>Tizen.Multimedia.UI.Tests.png</icon>
+ <label>Tizen.Multimedia.UI.Tests</label>
+ </ui-application>
+ <privileges>
+ <privilege>http://tizen.org/privilege/internet</privilege>
+ <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+ <privilege>http://tizen.org/privilege/network.get</privilege>
+ </privileges>
+</manifest>
[Tizen.MediaPlayer.Tests]
STREAMING_URI = set the uri in here. ex>http://www.samsung.com/xx/xx/aa.mp4
ADAPTIVE_STREAMING_URL = set the url in here
+
+# Multimedia.UI test key settings
+[Tizen.Multimedia.UI.Tests]
+STREAMING_URI = set the uri in here. ex>http://www.samsung.com/xx/xx/aa.mp4
+ADAPTIVE_STREAMING_URL = set the url in here
</set>
<set name="Tizen.Maps.Tests">
<testcase component="WebAPI/Tizen/configuration" execution_type="manual" id="Mapsconfiguration" purpose="Tizen.Maps.Tests configuration">
- <description>
+ <description>
<steps>
<step order="1">
<step_desc>A network connection capable of accessing the Internet MUST be established.</step_desc>
<test_script_entry test_script_expected_result="0" timeout="90"/>
</description>
</testcase>
- </set>
+ </set>
+
+ <set name="Tizen.Multimedia.UI.Tests">
+ <testcase component="WebAPI/Tizen/configuration" execution_type="manual" id="MultimediaUIconfiguration" purpose="Tizen.Multimedia.UI.Tests configuration">
+ <description>
+ <steps>
+ <step order="1">
+ <step_desc> Set the streaming uri such as http://www.samsung.com/xx/xx/aa.mp4.</step_desc>
+ </step>
+ <step order="2">
+ <step_desc> Set the adaptive streaming url.</step_desc>
+ </step>
+ </steps>
+ <test_script_entry test_script_expected_result="0" timeout="90"/>
+ </description>
+ </testcase>
+ </set>
+
<set name="Tizen.WebView.Tests">
<testcase component="WebAPI/Tizen/configuration" execution_type="manual" id="WebViewconfiguration" purpose="Tizen.WebView.Tests configuration">