namespace Tizen.NUI.Tests
{
-
[TestFixture]
[Description("Tizen.VideoView Tests")]
public class VideoViewTests
{
- private string TAG = "NUI";
+ private string TAG = "NUITEST";
private string videoPath = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "demoVideo.mp4";
private bool _flagOnFinished;
string tempvalue = "";
propertyvalue3.Get(out tempvalue);
Assert.AreEqual("Hello Goodbye", tempvalue, "Video function does not work");
- //videoView.Stop();
videoView.Dispose();
}
{
/* TEST CODE */
var videoView = new VideoView();
+ videoView.Size2D = new Size2D(200, 200);
+ videoView.ResourceUrl = videoPath;
+ videoView.Underlay = false;
Window.Instance.GetDefaultLayer().Add(videoView);
- await Task.Delay(1000);
+ Assert.IsInstanceOf<VideoView>(videoView, "Should be an instance of VideoView type.");
videoView.Looping = true;
Assert.AreEqual(true, videoView.Looping, "Looping function does not work");
videoView.Looping = false;
Assert.AreEqual(false, videoView.Looping, "Looping function does not work");
+
videoView.Unparent();
videoView.Dispose();
+ await Task.Delay(1000);
}
[Test]
{
/* TEST CODE */
var videoView = new VideoView();
+ videoView.Size2D = new Size2D(200, 200);
videoView.ResourceUrl = videoPath;
+ videoView.Underlay = false;
Window.Instance.GetDefaultLayer().Add(videoView);
- await Task.Delay(1000);
+ Assert.IsInstanceOf<VideoView>(videoView, "Should be an instance of VideoView type.");
bool isSupportRawVideo = false;
if (Tizen.System.Information.TryGetValue<bool>("tizen.org/feature/multimedia.raw_video", out isSupportRawVideo))
{
Tizen.Log.Error(TAG, "Error checking if raw_video is supported(systeminfo)");
}
+
videoView.Unparent();
videoView.Dispose();
+ await Task.Delay(1000);
}
[Test]
{
/* TEST CODE */
var videoView = new VideoView();
- Window.Instance.GetDefaultLayer().Add(videoView);
- await Task.Delay(1000);
-
videoView.Size2D = new Size2D(200, 200);
videoView.ResourceUrl = videoPath;
+ videoView.Underlay = false;
+ Window.Instance.GetDefaultLayer().Add(videoView);
+ Assert.IsInstanceOf<VideoView>(videoView, "Should be an instance of VideoView type.");
videoView.Muted = true;
Assert.AreEqual(true, videoView.Muted, "Muted function does not work");
videoView.Unparent();
videoView.Dispose();
+ await Task.Delay(1000);
}
[Test]
{
/* TEST CODE */
var videoView = new VideoView();
- Window.Instance.GetDefaultLayer().Add(videoView);
- await Task.Delay(1000);
-
videoView.Size2D = new Size2D(200, 200);
videoView.ResourceUrl = videoPath;
+ videoView.Underlay = false;
+ Window.Instance.GetDefaultLayer().Add(videoView);
+ Assert.IsInstanceOf<VideoView>(videoView, "Should be an instance of VideoView type.");
PropertyMap propertyMap = new PropertyMap();
propertyMap.Add("volumeLeft", new PropertyValue(0.3f));
Assert.AreEqual(0.3f, left, "values must be equal");
Assert.AreEqual(0.3f, right, "values must be equal");
+ videoView.Unparent();
videoView.Dispose();
+ await Task.Delay(1000);
}
[Test]
Assert.False(_flagOnFinished, "_flagOnFinished should false initial");
videoView.Play();
Tizen.Log.Error(TAG, $"Finished_CHECK_EVENT, videoPath={videoPath}");
- await Task.Delay(3000);
+ await Task.Delay(4000);
+ Tizen.Log.Error(TAG, $"check _flagOnFinished={_flagOnFinished}");
if (false == _flagOnFinished)
{
Tizen.Log.Error(TAG, $"Finished_CHECK_EVENT, _flagOnFinished is false! this is just Finished event test, so Stop() forcefully");
videoView.Stop();
await Task.Delay(1000);
+ Tizen.Log.Error(TAG, $"videoView.Stop()!");
}
Assert.True(_flagOnFinished, "_flagOnFinished should be true after Finished triggered");
videoView.Unparent();
+ Tizen.Log.Error(TAG, $"videoView.Unparent()!");
+ await Task.Delay(1000);
}
catch (Exception e)
{
}
finally
{
+ Tizen.Log.Error(TAG, $"videoView.Finished -= OnFinished!");
videoView.Finished -= OnFinished;
}
videoView.Dispose();
+ Tizen.Log.Error(TAG, $"videoView.Dispose()!");
+ await Task.Delay(1000);
}
[Test]
using NUnit.Framework;
using NUnit.Framework.TUnit;
using System;
+using System.Threading.Tasks;\r
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Test;
[Description("Tizen.NUI.Window Tests")]
public class WindowTests
{
- private string TAG = "NUI";
- bool isSurfacelessContextSupported = false;
+ private string TAG = "NUITEST";\r
[SetUp]
public void Init()
{
Tizen.Log.Info(TAG, "Init() is called!");
App.MainTitleChangeText("WindowTests");
- App.MainTitleChangeBackgroundColor(null);
- Tizen.System.Information.TryGetValue("http://tizen.org/feature/opengles.surfaceless_context", out isSurfacelessContextSupported);
+ App.MainTitleChangeBackgroundColor(null);\r
}
[TearDown]
[Property("CRITERIA", "CONSTR")]
[Property("COVPARAM", "Rectangle, bool")]
[Property("AUTHOR", "Sunghyun kim, scholb.kim@samsung.com")]
- public void Window_INIT()
+ public async Task Window_INIT()
{
/* TEST CODE */
- if( isSurfacelessContextSupported == false )
+ bool isSurfacelessContextSupported = false;\r
+ Tizen.System.Information.TryGetValue("http://tizen.org/feature/opengles.surfaceless_context", out isSurfacelessContextSupported);\r
+ if (isSurfacelessContextSupported == false)
{
Assert.Pass("Test skipped! This Device is not support to opengles.surfaceless_context");
return;
}
- var window = new Window(new Rectangle(0,0,1920,1080), false );
+ var window = new Window(new Rectangle(0, 0, 1920, 1080), false);
Assert.IsNotNull(window, "The instance should be not null");
Assert.IsInstanceOf<Window>(window, "Should return View instance.");
- var twindow = new Window(new Rectangle(0,0,1920,1080), true );
+ var twindow = new Window(new Rectangle(0, 0, 1920, 1080), true);
Assert.IsNotNull(twindow, "The instance should be not null");
Assert.IsInstanceOf<Window>(twindow, "Should return View instance.");
+
+ window.Hide();
+ window.Dispose();
+ twindow.Hide();
+ twindow.Dispose();
+ await Task.Delay(3000);
}
[Test]
[Property("CRITERIA", "CONSTR")]
[Property("COVPARAM", "string, Rectangle, bool")]
[Property("AUTHOR", "Sunghyun kim, scholb.kim@samsung.com")]
- public void Window_INIT_NAME()
+ public async Task Window_INIT_NAME()
{
/* TEST CODE */
- if( isSurfacelessContextSupported == false )
+ bool isSurfacelessContextSupported = false;\r
+ Tizen.System.Information.TryGetValue("http://tizen.org/feature/opengles.surfaceless_context", out isSurfacelessContextSupported);\r
+ if (isSurfacelessContextSupported == false)
{
Assert.Pass("Test skipped! This Device is not support to opengles.surfaceless_context");
return;
}
- var window = new Window("Test Window", new Rectangle(0,0,1920,1080), false );
+ var window = new Window("Test Window", new Rectangle(0, 0, 1920, 1080), false);
Assert.IsNotNull(window, "The instance should be not null");
Assert.IsInstanceOf<Window>(window, "Should return View instance.");
- var twindow = new Window("Test Window", new Rectangle(0,0,1920,1080), true );
+ var twindow = new Window("Test Window", new Rectangle(0, 0, 1920, 1080), true);
Assert.IsNotNull(twindow, "The instance should be not null");
Assert.IsInstanceOf<Window>(twindow, "Should return View instance.");
+
+ window.Hide();
+ window.Dispose();
+ twindow.Hide();
+ twindow.Dispose();
+ await Task.Delay(3000);
}
[Test]
window.SetNotificationLevel(NotificationLevel.Top);
//This is for multi Window feature, currently not supported.
Assert.IsNotNull(window.GetNotificationLevel());
- }
+ }\r
+\r
[Test]
[Category("P1")]
[Description("Test SetScreenOffMode. Check whether SetScreenOffMode works fine or not.")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "PRW")]
[Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
- public void WindowSize_SET_GET_VALUE()
- {
- /* TEST CODE */
- Window window = Window.Instance;
- window.WindowSize = new Size2D(100, 100);
+ public async Task WindowSize_SET_GET_VALUE()
+ {\r
+ /* TEST CODE */\r
+ await Task.Delay(3000);\r
+ var targetWidth = 300;
+ var targetHeight = 300;
+ Window window = Window.Instance;\r
+\r
+ window.WindowSize = new Size2D(targetWidth, targetHeight);
- Tizen.Log.Debug(TAG, $"window.WindowSize.Width={window.WindowSize.Width} window.WindowSize.Height={window.WindowSize.Height}");
+ var currentWidowSize = window.Size;
+ Assert.AreEqual(targetWidth, currentWidowSize.Width, "The currentWidowSize Width is not correct!");
+ Assert.AreEqual(targetHeight, currentWidowSize.Height, "The currentWidowSize Height is not correct!");\r
+ Assert.AreEqual(targetWidth, window.WindowSize.Width, "The WindowSize Width is not correct!");
+ Assert.AreEqual(targetHeight, window.WindowSize.Height, "The WindowSize Height is not correct!");
- Assert.AreEqual(100, window.WindowSize.Width, "The WindowSize.Width is not correct!");
- Assert.AreEqual(100, window.WindowSize.Height, "The WindowSize.Height is not correct!");
+ Tizen.Log.Debug(TAG, $"currentWidowSize.Width={currentWidowSize.Width} currentWidowSize.Height={currentWidowSize.Height}");
}
[Test]
var window = Window.Instance;
try
{
- window.AddAvailableOrientation( Window.WindowOrientation.Portrait );
- window.AddAvailableOrientation( Window.WindowOrientation.Landscape );
- window.AddAvailableOrientation( Window.WindowOrientation.PortraitInverse );
- window.AddAvailableOrientation( Window.WindowOrientation.LandscapeInverse );
+ window.AddAvailableOrientation(Window.WindowOrientation.Portrait);
+ window.AddAvailableOrientation(Window.WindowOrientation.Landscape);
+ window.AddAvailableOrientation(Window.WindowOrientation.PortraitInverse);
+ window.AddAvailableOrientation(Window.WindowOrientation.LandscapeInverse);
window.AddAvailableOrientation((Window.WindowOrientation)100);
- window.AddAvailableOrientation((Window.WindowOrientation)200 );
- window.AddAvailableOrientation((Window.WindowOrientation)300 );
+ window.AddAvailableOrientation((Window.WindowOrientation)200);
+ window.AddAvailableOrientation((Window.WindowOrientation)300);
}
- catch( Exception e )
+ catch (Exception e)
{
Tizen.Log.Error(TAG, "Caught Exception" + e.ToString());
LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
window.AddAvailableOrientation(Window.WindowOrientation.Landscape);
window.AddAvailableOrientation(Window.WindowOrientation.PortraitInverse);
window.AddAvailableOrientation(Window.WindowOrientation.LandscapeInverse);
- window.RemoveAvailableOrientation( Window.WindowOrientation.Landscape );
- window.RemoveAvailableOrientation( Window.WindowOrientation.Landscape);
- window.RemoveAvailableOrientation( Window.WindowOrientation.Landscape);
+ window.RemoveAvailableOrientation(Window.WindowOrientation.Landscape);
+ window.RemoveAvailableOrientation(Window.WindowOrientation.Landscape);
+ window.RemoveAvailableOrientation(Window.WindowOrientation.Landscape);
window.AddAvailableOrientation(Window.WindowOrientation.LandscapeInverse);
- window.AddAvailableOrientation((Window.WindowOrientation)100 );
+ window.AddAvailableOrientation((Window.WindowOrientation)100);
window.RemoveAvailableOrientation(Window.WindowOrientation.Landscape);
- window.AddAvailableOrientation((Window.WindowOrientation)200 );
- window.AddAvailableOrientation((Window.WindowOrientation)300 );
+ window.AddAvailableOrientation((Window.WindowOrientation)200);
+ window.AddAvailableOrientation((Window.WindowOrientation)300);
}
- catch( Exception e )
+ catch (Exception e)
{
Tizen.Log.Error(TAG, "Caught Exception" + e.ToString());
LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
/* TEST CODE */
var window = Window.Instance;
window.SetPreferredOrientation(Window.WindowOrientation.Landscape);
- Assert.AreEqual(Window.WindowOrientation.Landscape , window.GetPreferredOrientation(), "SetPreferredOrientation does not work.");
+ Assert.AreEqual(Window.WindowOrientation.Landscape, window.GetPreferredOrientation(), "SetPreferredOrientation does not work.");
}
[Test]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "MR")]
[Property("AUTHOR", "Sunghyun kim, scholb.kim@samsung.com")]
- public void SetParent_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- if( isSurfacelessContextSupported == false )
+ public async Task SetParent_CHECK_RETURN_VALUE()
+ {\r
+ /* TEST CODE */\r
+ bool isSurfacelessContextSupported = false;\r
+ Tizen.System.Information.TryGetValue("http://tizen.org/feature/opengles.surfaceless_context", out isSurfacelessContextSupported);\r
+ if (isSurfacelessContextSupported == false)
{
Assert.Pass("Test skipped! This Device is not support to opengles.surfaceless_context");
return;
- }
-
+ }\r
try
{
var window = Window.Instance;
var pwindow = new Window();
Assert.IsNotNull(pwindow, "The instance should be not null");
- window.SetParent(pwindow);
+ window.SetParent(pwindow);\r
+\r
+ window.Unparent();\r
+ pwindow.Hide();\r
+ pwindow.Dispose();\r
+ await Task.Delay(3000);
}
catch (Exception e)
{
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "MR")]
[Property("AUTHOR", "Sunghyun kim, scholb.kim@samsung.com")]
- public void Unparent_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- if( isSurfacelessContextSupported == false )
+ public async Task Unparent_CHECK_RETURN_VALUE()
+ {\r
+ /* TEST CODE */\r
+ bool isSurfacelessContextSupported = false;\r
+ Tizen.System.Information.TryGetValue("http://tizen.org/feature/opengles.surfaceless_context", out isSurfacelessContextSupported);\r
+ if (isSurfacelessContextSupported == false)
{
Assert.Pass("Test skipped! This Device is not support to opengles.surfaceless_context");
return;
Assert.IsNotNull(pwindow, "The instance should be not null");
window.SetParent(pwindow);
window.Unparent();
- Assert.AreNotEqual(pwindow, window.GetParent(), "Unparent does not work");
+ Assert.AreNotEqual(pwindow, window.GetParent(), "Unparent does not work");\r
+\r
+ pwindow.Hide();\r
+ pwindow.Dispose();\r
+ await Task.Delay(3000);
}
catch (Exception e)
{
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "MR")]
[Property("AUTHOR", "Sunghyun kim, scholb.kim@samsung.com")]
- public void GetParent_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- if( isSurfacelessContextSupported == false )
+ public async Task GetParent_CHECK_RETURN_VALUE()
+ {\r
+ /* TEST CODE */\r
+ bool isSurfacelessContextSupported = false;\r
+ Tizen.System.Information.TryGetValue("http://tizen.org/feature/opengles.surfaceless_context", out isSurfacelessContextSupported);
+ if (isSurfacelessContextSupported == false)
{
Assert.Pass("Test skipped! This Device is not support to opengles.surfaceless_context");
return;
Assert.IsNotNull(pwindow, "The instance should be not null");
window.SetParent(pwindow);
Assert.AreEqual(pwindow, window.GetParent(), "GetParent does not work");
+
+ window.Unparent();\r
+ pwindow.Hide();\r
+ pwindow.Dispose();\r
+ await Task.Delay(3000);
}
catch (Exception e)
{