--- /dev/null
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.27130.2036
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PositionTestApp", "PositionTestApp\PositionTestApp.csproj", "{649B6B98-50F2-4277-B506-73FD47551581}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {649B6B98-50F2-4277-B506-73FD47551581}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {649B6B98-50F2-4277-B506-73FD47551581}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {649B6B98-50F2-4277-B506-73FD47551581}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {649B6B98-50F2-4277-B506-73FD47551581}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {23A821AA-759E-491A-8428-D37612EBD6F9}
+ EndGlobalSection
+EndGlobal
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <!-- Property Group for .NET Core Project -->
+ <PropertyGroup>
+ <OutputType>Exe</OutputType>
+ <TargetFramework>tizen11.0</TargetFramework>
+ <TargetFrameworkIdentifier>Tizen</TargetFrameworkIdentifier>
+ </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\" />
+ <Folder Include="res\" />
+ </ItemGroup>
+
+ <!-- Include Nuget Package for Tizen Project building -->
+ <ItemGroup>
+ <PackageReference Include="Tizen.NET" Version="11.0.0.17807">
+ <ExcludeAssets>Runtime</ExcludeAssets>
+ </PackageReference>
+ <PackageReference Include="Tizen.NET.Sdk" Version="1.0.1" />
+ </ItemGroup>
+
+</Project>
--- /dev/null
+using Tizen.Applications;
+using ElmSharp;
+using Tizen.Applications.EventManager;
+
+namespace PositionTestApp
+{
+ class App : CoreUIApplication
+ {
+ private string LOG_TAG = "PositionTestApp";
+
+ static private App _app;
+
+ void OnReceived(object sender, EventManagerEventArgs e)
+ {
+ Tizen.Log.Debug(LOG_TAG, "Application Event On Received");
+
+ }
+ protected override void OnCreate()
+ {
+ base.OnCreate();
+ Initialize();
+ }
+
+ protected override void OnAppControlReceived(AppControlReceivedEventArgs e)
+ {
+ Tizen.Log.Debug(LOG_TAG, "OnAppControlReceived");
+
+ var pos = _app.GetWindowPosition();
+
+ Tizen.Log.Debug(LOG_TAG, "[TestCase][WindowPosition] X: " + pos.PositionX + ", Y: " + pos.PositionY + ", W: " + pos.Width + ", H: " + pos.Height);
+
+ base.OnAppControlReceived(e);
+ }
+
+ void Initialize()
+ {
+ Window window = new Window("ElmSharpApp")
+ {
+ AvailableRotations = DisplayRotation.Degree_0 | DisplayRotation.Degree_180 | DisplayRotation.Degree_270 | DisplayRotation.Degree_90
+ };
+ window.BackButtonPressed += (s, e) =>
+ {
+ Exit();
+ };
+ window.Show();
+
+ var box = new Box(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ };
+ box.Show();
+
+ var bg = new Background(window)
+ {
+ Color = Color.White
+ };
+ bg.SetContent(box);
+
+ var conformant = new Conformant(window);
+ conformant.Show();
+ conformant.SetContent(bg);
+
+ var label = new Label(window)
+ {
+ Text = "Hello, Tizen",
+ Color = Color.Black
+ };
+ label.Show();
+ box.PackEnd(label);
+ }
+
+ static void Main(string[] args)
+ {
+ Elementary.Initialize();
+ Elementary.ThemeOverlay();
+ _app = new App();
+ _app.Run(args);
+ }
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="7" package="org.tizen.example.PositionTestApp" version="1.0.0">
+ <profile name="common" />
+ <ui-application appid="org.tizen.example.PositionTestApp" exec="PositionTestApp.dll" type="dotnet" multiple="false" taskmanage="true" nodisplay="false" launch_mode="single">
+ <label>PositionTestApp</label>
+ <icon>PositionTestApp.png</icon>
+ <metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
+ </ui-application>
+</manifest>
[Description("UIApplication init test")]
public class CoreUIApplicationTests {
+ private AppControl _myAppControl;
private bool s_appIsLaunch = false;
[SetUp]
public void Init()
{
Log.Info("TCT", "Preconditions for each TEST");
- AppControl myAppControl = new AppControl();
- myAppControl.Operation = AppControlOperations.Default;
- myAppControl.ApplicationId = "org.tizen.ApplicationManual.Tizen";
- AppControl.SendLaunchRequest(myAppControl);
+ _myAppControl = new AppControl();
+ _myAppControl.Operation = AppControlOperations.Default;
+ _myAppControl.ApplicationId = "org.tizen.ApplicationManual.Tizen";
}
[TearDown]
[Step(2, "Check if log show \"[TestCase][Run][Application] Pass\".")]
[Postcondition(1, "Close the terminal")]
public async Task Run_MANUAL_TEST() {
+ AppControl.SendLaunchRequest(_myAppControl);
await ManualTest.WaitForConfirm();
}
[Step(1, "Click run TC")]
[Step(2, "Check if log show \"[TestCase][OnPreCreate][Application] Pass\".")]
[Postcondition(1, "Close the terminal")]
- public async Task OnPreCreate_MANUAL_TEST()
- {
+ public async Task OnPreCreate_MANUAL_TEST() {
+ AppControl.SendLaunchRequest(_myAppControl);
await ManualTest.WaitForConfirm();
}
[Step(2, "Check if log show \"[TestCase][OnResume][Application] Pass\".")]
[Postcondition(1, "Close the terminal")]
public async Task OnResume_MANUAL_TEST() {
+ AppControl.SendLaunchRequest(_myAppControl);
await ManualTest.WaitForConfirm();
}
[Step(2, "Check if log show \"[TestCase][EventHandlerResumed][Application] Pass\".")]
[Postcondition(1, "Close the terminal")]
public async Task Resumed_MANUAL_TEST() {
+ AppControl.SendLaunchRequest(_myAppControl);
await ManualTest.WaitForConfirm();
}
[Step(3, "Check if log show \"[TestCase][OnPause][Application] Pass\".")]
[Postcondition(1, "Close the terminal")]
public async Task OnPause_MANUAL_TEST() {
+ AppControl.SendLaunchRequest(_myAppControl);
await ManualTest.WaitForConfirm();
}
[Step(3, "Check if log show \"[TestCase][EventHandlerPaused][Application] Pass\".")]
[Postcondition(1, "Close the terminal")]
public async Task Paused_MANUAL_TEST() {
+ AppControl.SendLaunchRequest(_myAppControl);
await ManualTest.WaitForConfirm();
}
[Step(3, "Check if log show \"[TestCase][Exit][Application] Pass\".")]
[Postcondition(1, "Close the terminal")]
public async Task Exit_MANUAL_TEST() {
+ AppControl.SendLaunchRequest(_myAppControl);
+ await ManualTest.WaitForConfirm();
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("MANUAL TEST : Gets window position properly")]
+ [Property("SPEC", "Tizen.Applications.CoreUIApplication.GetWindowPosition M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")]
+ [Precondition(1, "Open terminal to view logs.")]
+ [Precondition(2, "Enter command \"sdb dlog -c\" to clear log")]
+ [Precondition(3, "Enter command \"sdb dlog | grep TestCase\" to terminal")]
+ [Step(1, "Click run TC")]
+ [Step(2, "Check if log show \"[TestCase][WindowPosition] X: 10, Y: 20, W: 300, H: 400\".")]
+ [Postcondition(1, "Close the terminal")]
+ public async Task GetWindowPosition_MANUAL_TEST() {
+ var windowPosition = new WindowPosition(10, 20, 300, 400);
+ _myAppControl.ApplicationId = "org.tizen.example.PositionTestApp";
+ _myAppControl.SetWindowPosition(windowPosition);
+
+ AppControl.SendLaunchRequest(_myAppControl);
+
await ManualTest.WaitForConfirm();
}
}
using NUnit.Framework;\r
using NUnit.Framework.TUnit;\r
+using System;\r
\r
namespace Tizen.Applications.Tests\r
{\r
(deviceOrientation == DeviceOrientation.Orientation_270),\r
"Property \"CurrentDeviceOrientation\": should be Orientation_0 or Orientation_90 or Orientation_180 or Orientation_270");\r
}\r
+\r
+ [Test]\r
+ [Category("P2")]\r
+ [Description("Test : Gets window position - InvalidOperationException should be occured")]\r
+ [Property("SPEC", "Tizen.Applications.CoreUIApplication.GetWindowPosition M")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "MEX")]\r
+ [Property("AUTHOR", "Sukhyung Kang, shine.kang@samsung.com")]\r
+ public void GetWindowPosition_CHECK_INVALID_OPERATION_EXCEPTION()\r
+ {\r
+ CoreUIApplication app = new CoreUIApplication();\r
+\r
+ try\r
+ {\r
+ var windowPosition = app.GetWindowPosition();\r
+ Assert.Fail("InvalidOperationException should be occured");\r
+ }\r
+ catch (InvalidOperationException)\r
+ {\r
+ Assert.Pass("InvalidOperationException occurs");\r
+ }\r
+ }\r
}\r
}\r