--- /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}") = "AppEventTestApp", "AppEventTestApp\AppEventTestApp.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>netcoreapp2.0</TargetFramework>
+ </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="6.0.0.14737">
+ <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 AppEventTestApp
+{
+ class App : CoreUIApplication
+ {
+ private string LOG_TAG = "AppEventTestApp";
+ static EventReceiver receiver;
+
+ void OnReceived(object sender, EventManagerEventArgs e)
+ {
+ Tizen.Log.Debug(LOG_TAG, "Application Event On Received");
+
+ Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();
+ bundle.AddItem("key", "value");
+ ApplicationEventManager.Publish("event.org.tizen.example.AppEventTestApp.AppEvent", bundle);
+ }
+ protected override void OnCreate()
+ {
+ base.OnCreate();
+ Initialize();
+
+ receiver = new EventReceiver("event.Tizen.Applications.EventManager.Tests.AppEventTestApp");
+ receiver.Received += OnReceived;
+ }
+
+ 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 app = new App();
+ app.Run(args);
+ }
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="6" package="org.tizen.example.AppEventTestApp" version="1.0.0">
+ <profile name="common" />
+ <ui-application appid="org.tizen.example.AppEventTestApp"
+ exec="AppEventTestApp.dll"
+ type="dotnet"
+ multiple="false"
+ taskmanage="true"
+ nodisplay="false"
+ launch_mode="single">
+ <label>AppEventTestApp</label>
+ <icon>AppEventTestApp.png</icon>
+ <metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
+ </ui-application>
+</manifest>
--- /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}") = "AppEventTestTrustedApp", "AppEventTestTrustedApp\AppEventTestTrustedApp.csproj", "{4E36601E-94A5-47F5-A6DD-45281336A1CD}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {4E36601E-94A5-47F5-A6DD-45281336A1CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {4E36601E-94A5-47F5-A6DD-45281336A1CD}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4E36601E-94A5-47F5-A6DD-45281336A1CD}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {4E36601E-94A5-47F5-A6DD-45281336A1CD}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {485272C9-C91B-4749-9541-12F2CD70F582}
+ EndGlobalSection
+EndGlobal
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <!-- Property Group for .NET Core Project -->
+ <PropertyGroup>
+ <OutputType>Exe</OutputType>
+ <TargetFramework>netcoreapp2.0</TargetFramework>
+ </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="6.0.0.14699">
+ <ExcludeAssets>Runtime</ExcludeAssets>
+ </PackageReference>
+ <PackageReference Include="Tizen.NET.Sdk" Version="1.0.1" />
+ </ItemGroup>
+ <ItemGroup>
+ <Reference Include="Tizen.Applications.EventManager">
+ <HintPath>\\10.113.112.169\home_inkyun\Workspace_TIZEN\CSHARP_PACKAGE\TizenFX\src\Tizen.Applications.EventManager\bin\Debug\netstandard2.0\Tizen.Applications.EventManager.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+
+</Project>
--- /dev/null
+using Tizen.Applications;\r
+using ElmSharp;\r
+using Tizen.Applications.EventManager;\r
+\r
+namespace AppEventTestTrustedApp\r
+{\r
+ class App : CoreUIApplication\r
+ {\r
+ private string LOG_TAG = "AppEventTestTrustedApp";\r
+ void OnReceived(object sender, EventManagerEventArgs e)\r
+ {\r
+ Tizen.Log.Debug(LOG_TAG, "Application Event On Received");\r
+\r
+ Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle();\r
+ bundle.AddItem("key", "value");\r
+ ApplicationEventManager.Publish("event.org.tizen.example.AppEventTestTrustedApp.AppEvent", bundle, true);\r
+ }\r
+\r
+ protected override void OnCreate()\r
+ {\r
+ base.OnCreate();\r
+ Initialize();\r
+\r
+ EventReceiver receiver = new EventReceiver("event.Tizen.Applications.EventManager.Tests.AppEventTestTrustedApp");\r
+ receiver.Received += OnReceived;\r
+ }\r
+\r
+ void Initialize()\r
+ {\r
+ Window window = new Window("ElmSharpApp")\r
+ {\r
+ AvailableRotations = DisplayRotation.Degree_0 | DisplayRotation.Degree_180 | DisplayRotation.Degree_270 | DisplayRotation.Degree_90\r
+ };\r
+ window.BackButtonPressed += (s, e) =>\r
+ {\r
+ Exit();\r
+ };\r
+ window.Show();\r
+\r
+ var box = new Box(window)\r
+ {\r
+ AlignmentX = -1,\r
+ AlignmentY = -1,\r
+ WeightX = 1,\r
+ WeightY = 1,\r
+ };\r
+ box.Show();\r
+\r
+ var bg = new Background(window)\r
+ {\r
+ Color = Color.White\r
+ };\r
+ bg.SetContent(box);\r
+\r
+ var conformant = new Conformant(window);\r
+ conformant.Show();\r
+ conformant.SetContent(bg);\r
+\r
+ var label = new Label(window)\r
+ {\r
+ Text = "Hello, Tizen",\r
+ Color = Color.Black\r
+ };\r
+ label.Show();\r
+ box.PackEnd(label);\r
+ }\r
+\r
+ static void Main(string[] args)\r
+ {\r
+ Elementary.Initialize();\r
+ Elementary.ThemeOverlay();\r
+ App app = new App();\r
+ app.Run(args);\r
+ }\r
+ }\r
+}\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<manifest xmlns="http://tizen.org/ns/packages" api-version="6" package="org.tizen.example.AppEventTestTrustedApp" version="1.0.0">\r
+ <profile name="common" />\r
+ <ui-application appid="org.tizen.example.AppEventTestTrustedApp"\r
+ exec="AppEventTestTrustedApp.dll"\r
+ type="dotnet"\r
+ multiple="false"\r
+ taskmanage="true"\r
+ nodisplay="false"\r
+ launch_mode="single">\r
+ <label>AppEventTestTrustedApp</label>\r
+ <icon>AppEventTestTrustedApp.png</icon>\r
+ <metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />\r
+ </ui-application>\r
+</manifest>\r
--- /dev/null
+/*
+ * Copyright (c) 2019 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 NUnit.Framework;
+using Xamarin.Forms;
+
+namespace XamarinApplication.Tizen
+{
+ class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication
+ {
+ private Application _app;
+ protected override void OnCreate()
+ {
+ Console.WriteLine("TCT : OnCreate()");
+ base.OnCreate();
+ if (ManualTest.IsWearable())
+ {
+ _app = new WearableTemplate.MainPage();
+ }
+ else
+ {
+ _app = new ManualTemplate.MainPage();
+ }
+ LoadApplication(_app);
+ }
+
+ static void Main(string[] args)
+ {
+ Console.WriteLine("TCT : Main()");
+ var app = new Program();
+ global::Xamarin.Forms.Platform.Tizen.Forms.Init(app);
+ app.Run(args);
+ }
+ }
+}
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <!-- Property Group for .NET Core Project -->
+ <PropertyGroup>
+ <OutputType>Exe</OutputType>
+ <TargetFramework>tizen60</TargetFramework>
+ </PropertyGroup>
+
+ <!-- Property Group for Tizen Project -->
+ <PropertyGroup>
+ <TizenCreateTpkOnBuild>true</TizenCreateTpkOnBuild>
+ <AssemblyName>Tizen.Applications.EventManager.Manual.Tests</AssemblyName>
+ <RootNamespace>Tizen.Applications.EventManager.Manual.Tests</RootNamespace>
+ </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="6.0.0.14730">
+ <ExcludeAssets>Runtime</ExcludeAssets>
+ </PackageReference>
+ <PackageReference Include="Tizen.NET.Sdk" Version="$(TizenNETSdkVersion)" />
+ </ItemGroup>
+
+ <!-- Include Nuget Package for Tizen Project building -->
+ <ItemGroup>
+ <ProjectReference Include="..\Template\ManualTemplate\ManualTemplate.csproj" />
+ </ItemGroup>
+ <ItemGroup>
+ <Reference Include="Tizen.Applications.EventManager">
+ <HintPath>..\..\..\TizenFX\src\Tizen.Applications.EventManager\bin\Debug\netstandard2.0\Tizen.Applications.EventManager.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+
+</Project>
--- /dev/null
+Microsoft Visual Studio Solution File, Format Version 12.00\r
+# Visual Studio 15\r
+VisualStudioVersion = 15.0.27130.2036\r
+MinimumVisualStudioVersion = 15.0.26124.0\r
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.EventManager.Manual.Tests", "Tizen.EventManager.Manual.Tests.csproj", "{D92BEEAC-3B2A-45F8-8C53-53B92550404A}"\r
+EndProject\r
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunit.framework", "..\nunit.framework\nunit.framework.csproj", "{B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}"\r
+EndProject\r
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunitlite", "..\nunitlite\nunitlite.csproj", "{FDB8025A-C029-461F-895E-287B4C65939B}"\r
+EndProject\r
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ManualTemplate", "..\Template\ManualTemplate\ManualTemplate.csproj", "{269F89A7-E648-4811-8421-844E00ACF5F0}"\r
+EndProject\r
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ManualTemplateForWearable", "..\Template\ManualTemplateForWearable\ManualTemplateForWearable.csproj", "{D36CED01-29BD-4EB3-8903-62E0BF2A822D}"\r
+EndProject\r
+Global\r
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
+ Debug|Any CPU = Debug|Any CPU\r
+ Debug|x64 = Debug|x64\r
+ Debug|x86 = Debug|x86\r
+ Release|Any CPU = Release|Any CPU\r
+ Release|x64 = Release|x64\r
+ Release|x86 = Release|x86\r
+ EndGlobalSection\r
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
+ {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
+ {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
+ {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x64.ActiveCfg = Debug|Any CPU\r
+ {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x64.Build.0 = Debug|Any CPU\r
+ {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x86.ActiveCfg = Debug|Any CPU\r
+ {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x86.Build.0 = Debug|Any CPU\r
+ {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
+ {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|Any CPU.Build.0 = Release|Any CPU\r
+ {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x64.ActiveCfg = Release|Any CPU\r
+ {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x64.Build.0 = Release|Any CPU\r
+ {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x86.ActiveCfg = Release|Any CPU\r
+ {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x86.Build.0 = Release|Any CPU\r
+ {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
+ {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
+ {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x64.ActiveCfg = Debug|Any CPU\r
+ {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x64.Build.0 = Debug|Any CPU\r
+ {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x86.ActiveCfg = Debug|Any CPU\r
+ {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x86.Build.0 = Debug|Any CPU\r
+ {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
+ {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|Any CPU.Build.0 = Release|Any CPU\r
+ {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x64.ActiveCfg = Release|Any CPU\r
+ {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x64.Build.0 = Release|Any CPU\r
+ {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x86.ActiveCfg = Release|Any CPU\r
+ {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x86.Build.0 = Release|Any CPU\r
+ {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
+ {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
+ {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x64.ActiveCfg = Debug|Any CPU\r
+ {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x64.Build.0 = Debug|Any CPU\r
+ {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x86.ActiveCfg = Debug|Any CPU\r
+ {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x86.Build.0 = Debug|Any CPU\r
+ {FDB8025A-C029-461F-895E-287B4C65939B}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
+ {FDB8025A-C029-461F-895E-287B4C65939B}.Release|Any CPU.Build.0 = Release|Any CPU\r
+ {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x64.ActiveCfg = Release|Any CPU\r
+ {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x64.Build.0 = Release|Any CPU\r
+ {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x86.ActiveCfg = Release|Any CPU\r
+ {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x86.Build.0 = Release|Any CPU\r
+ {269F89A7-E648-4811-8421-844E00ACF5F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
+ {269F89A7-E648-4811-8421-844E00ACF5F0}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
+ {269F89A7-E648-4811-8421-844E00ACF5F0}.Debug|x64.ActiveCfg = Debug|Any CPU\r
+ {269F89A7-E648-4811-8421-844E00ACF5F0}.Debug|x64.Build.0 = Debug|Any CPU\r
+ {269F89A7-E648-4811-8421-844E00ACF5F0}.Debug|x86.ActiveCfg = Debug|Any CPU\r
+ {269F89A7-E648-4811-8421-844E00ACF5F0}.Debug|x86.Build.0 = Debug|Any CPU\r
+ {269F89A7-E648-4811-8421-844E00ACF5F0}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
+ {269F89A7-E648-4811-8421-844E00ACF5F0}.Release|Any CPU.Build.0 = Release|Any CPU\r
+ {269F89A7-E648-4811-8421-844E00ACF5F0}.Release|x64.ActiveCfg = Release|Any CPU\r
+ {269F89A7-E648-4811-8421-844E00ACF5F0}.Release|x64.Build.0 = Release|Any CPU\r
+ {269F89A7-E648-4811-8421-844E00ACF5F0}.Release|x86.ActiveCfg = Release|Any CPU\r
+ {269F89A7-E648-4811-8421-844E00ACF5F0}.Release|x86.Build.0 = Release|Any CPU\r
+ {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
+ {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
+ {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Debug|x64.ActiveCfg = Debug|Any CPU\r
+ {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Debug|x64.Build.0 = Debug|Any CPU\r
+ {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Debug|x86.ActiveCfg = Debug|Any CPU\r
+ {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Debug|x86.Build.0 = Debug|Any CPU\r
+ {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
+ {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Release|Any CPU.Build.0 = Release|Any CPU\r
+ {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Release|x64.ActiveCfg = Release|Any CPU\r
+ {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Release|x64.Build.0 = Release|Any CPU\r
+ {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Release|x86.ActiveCfg = Release|Any CPU\r
+ {D36CED01-29BD-4EB3-8903-62E0BF2A822D}.Release|x86.Build.0 = Release|Any CPU\r
+ EndGlobalSection\r
+ GlobalSection(SolutionProperties) = preSolution\r
+ HideSolutionNode = FALSE\r
+ EndGlobalSection\r
+ GlobalSection(ExtensibilityGlobals) = postSolution\r
+ SolutionGuid = {ED382B91-9930-40B6-B3D7-362304C78680}\r
+ EndGlobalSection\r
+EndGlobal\r
--- /dev/null
+/*\r
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License\r
+ */\r
+\r
+using System.Threading.Tasks;\r
+using NUnit.Framework;\r
+using Tizen.Applications;\r
+using Tizen.Applications.EventManager;\r
+using Tizen.Applications.EventManager.SystemEvents;\r
+\r
+namespace Tizen.Applications.EventManager.Manual.Tests\r
+{\r
+\r
+ [TestFixture]\r
+ [Description("Tizen.Applications.EventManager.EventManagerEventReceiver Tests")]\r
+ public class EventManagerEventReceiverTests\r
+ {\r
+\r
+ private string TAG = "Tizen.Application.EventManager";\r
+ private string _message;\r
+ EventReceiver receiver;\r
+\r
+ [SetUp]\r
+ public void Init()\r
+ {\r
+ }\r
+\r
+ [TearDown]\r
+ public void Destroy()\r
+ {\r
+ }\r
+\r
+ void OnReceived(object sender, EventManagerEventArgs e)\r
+ {\r
+ if (e.Name == EarjackStatus.EventName)\r
+ {\r
+ Bundle eventData = e.Data;\r
+ object aValue = eventData.GetItem(EarjackStatus.StatusKey);\r
+ if (eventData.Is<string>(EarjackStatus.StatusKey))\r
+ {\r
+ string statusValue = (string)aValue;\r
+\r
+ ToastMessage toast = new ToastMessage\r
+ {\r
+ Message = statusValue\r
+ };\r
+\r
+ toast.Post();\r
+ }\r
+ }\r
+\r
+ receiver.Received -= OnReceived;\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("MANUAL TEST : EventReceiver add received event handler.")]\r
+ [Property("SPEC", "Tizen.Applications.EventManager.EventReceiver.Received E")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "EVL")]\r
+ [Property("AUTHOR", "inkyun kil, inkyun.kil@samsung.com")]\r
+ [Precondition(1, "earjack is disconnected.")]\r
+ [Step(1, "Click run TC")]\r
+ [Step(2, "earjack is connected")]\r
+ [Step(3, "check if toast message show \"connected\".")]\r
+ public async Task Received_Add()\r
+ {\r
+\r
+ receiver = new EventReceiver(EarjackStatus.EventName);\r
+ receiver.Received += OnReceived;\r
+\r
+ // Waits for user confirmation.\r
+ await ManualTest.WaitForConfirm();\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("MANUAL TEST : EventReceiver remove received event handler.")]\r
+ [Property("SPEC", "Tizen.Applications.EventManager.EventReceiver.Received E")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "EVL")]\r
+ [Property("AUTHOR", "inkyun kil, inkyun.kil@samsung.com")]\r
+ [Precondition(1, "earjack is disconnected.")]\r
+ [Step(1, "Click run TC")]\r
+ [Step(2, "earjack is connected")]\r
+ [Step(3, "check if toast message doesn't show \"connected\".")]\r
+ public async Task Received_Remove()\r
+ {\r
+\r
+ receiver = new EventReceiver(EarjackStatus.EventName);\r
+ receiver.Received += OnReceived;\r
+ receiver.Received -= OnReceived;\r
+\r
+ // Waits for user confirmation.\r
+ await ManualTest.WaitForConfirm();\r
+ }\r
+ }\r
+}\r
+\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest package="Tizen.Applications.EventManager.Manual.Tests" version="1.0.0" api-version="6" xmlns="http://tizen.org/ns/packages">
+ <profile name="common" />
+ <ui-application appid="Tizen.Applications.EventManager.Manual.Tests" exec="Tizen.Applications.EventManager.Manual.Tests.dll" multiple="false" taskmanage="true" splash-screen-display="true" type="dotnet" launch_mode="single">
+ <icon>Tizen.Applications.EventManager.Manual.Tests.png</icon>
+ <label>Tizen.Applications.EventManager.Manual.Tests</label>
+ </ui-application>
+ <privileges>
+ <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+ </privileges>
+ <provides-appdefined-privileges />
+</manifest>
--- /dev/null
+/*
+ * Copyright (c) 2019 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.Platform.Tizen.Forms.Init(app);
+ app.Run(args);
+ }
+ }
+}
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <!-- Property Group for .NET Core Project -->
+ <PropertyGroup>
+ <OutputType>Exe</OutputType>
+ <TargetFramework>tizen60</TargetFramework>
+ </PropertyGroup>
+
+ <!-- Property Group for Tizen Project -->
+ <PropertyGroup>
+ <TizenCreateTpkOnBuild>true</TizenCreateTpkOnBuild>
+ <AssemblyName>Tizen.Applications.EventManager.Tests</AssemblyName>
+ <RootNamespace>Tizen.Applications.EventManager.Tests</RootNamespace>
+ </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="6.0.0.14730">
+ <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" />
+ </ItemGroup>
+ <ItemGroup>
+ <Reference Include="Tizen.Applications.EventManager">
+ <HintPath>..\..\..\TizenFX\src\Tizen.Applications.EventManager\bin\Debug\netstandard2.0\Tizen.Applications.EventManager.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+
+</Project>
--- /dev/null
+Microsoft Visual Studio Solution File, Format Version 12.00\r
+# Visual Studio 15\r
+VisualStudioVersion = 15.0.27130.2036\r
+MinimumVisualStudioVersion = 15.0.26124.0\r
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.EventManager.Tests", "Tizen.Applications.EventManager.Tests.csproj", "{D92BEEAC-3B2A-45F8-8C53-53B92550404A}"\r
+EndProject\r
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunit.framework", "..\nunit.framework\nunit.framework.csproj", "{B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}"\r
+EndProject\r
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nunitlite", "..\nunitlite\nunitlite.csproj", "{FDB8025A-C029-461F-895E-287B4C65939B}"\r
+EndProject\r
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoTemplate", "..\Template\AutoTemplate\AutoTemplate.csproj", "{B11ABB0C-C3C1-4B5C-8251-A15628A775F3}"\r
+EndProject\r
+Global\r
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
+ Debug|Any CPU = Debug|Any CPU\r
+ Debug|x64 = Debug|x64\r
+ Debug|x86 = Debug|x86\r
+ Release|Any CPU = Release|Any CPU\r
+ Release|x64 = Release|x64\r
+ Release|x86 = Release|x86\r
+ EndGlobalSection\r
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
+ {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
+ {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
+ {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x64.ActiveCfg = Debug|Any CPU\r
+ {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x64.Build.0 = Debug|Any CPU\r
+ {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x86.ActiveCfg = Debug|Any CPU\r
+ {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Debug|x86.Build.0 = Debug|Any CPU\r
+ {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
+ {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|Any CPU.Build.0 = Release|Any CPU\r
+ {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x64.ActiveCfg = Release|Any CPU\r
+ {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x64.Build.0 = Release|Any CPU\r
+ {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x86.ActiveCfg = Release|Any CPU\r
+ {D92BEEAC-3B2A-45F8-8C53-53B92550404A}.Release|x86.Build.0 = Release|Any CPU\r
+ {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
+ {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
+ {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x64.ActiveCfg = Debug|Any CPU\r
+ {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x64.Build.0 = Debug|Any CPU\r
+ {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x86.ActiveCfg = Debug|Any CPU\r
+ {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Debug|x86.Build.0 = Debug|Any CPU\r
+ {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
+ {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|Any CPU.Build.0 = Release|Any CPU\r
+ {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x64.ActiveCfg = Release|Any CPU\r
+ {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x64.Build.0 = Release|Any CPU\r
+ {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x86.ActiveCfg = Release|Any CPU\r
+ {B9E7C1FD-CB38-42F7-AC43-7BD2E5B4D216}.Release|x86.Build.0 = Release|Any CPU\r
+ {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
+ {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
+ {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x64.ActiveCfg = Debug|Any CPU\r
+ {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x64.Build.0 = Debug|Any CPU\r
+ {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x86.ActiveCfg = Debug|Any CPU\r
+ {FDB8025A-C029-461F-895E-287B4C65939B}.Debug|x86.Build.0 = Debug|Any CPU\r
+ {FDB8025A-C029-461F-895E-287B4C65939B}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
+ {FDB8025A-C029-461F-895E-287B4C65939B}.Release|Any CPU.Build.0 = Release|Any CPU\r
+ {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x64.ActiveCfg = Release|Any CPU\r
+ {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x64.Build.0 = Release|Any CPU\r
+ {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x86.ActiveCfg = Release|Any CPU\r
+ {FDB8025A-C029-461F-895E-287B4C65939B}.Release|x86.Build.0 = Release|Any CPU\r
+ {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
+ {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
+ {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x64.ActiveCfg = Debug|Any CPU\r
+ {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x64.Build.0 = Debug|Any CPU\r
+ {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x86.ActiveCfg = Debug|Any CPU\r
+ {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Debug|x86.Build.0 = Debug|Any CPU\r
+ {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
+ {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|Any CPU.Build.0 = Release|Any CPU\r
+ {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x64.ActiveCfg = Release|Any CPU\r
+ {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x64.Build.0 = Release|Any CPU\r
+ {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x86.ActiveCfg = Release|Any CPU\r
+ {B11ABB0C-C3C1-4B5C-8251-A15628A775F3}.Release|x86.Build.0 = Release|Any CPU\r
+ EndGlobalSection\r
+ GlobalSection(SolutionProperties) = preSolution\r
+ HideSolutionNode = FALSE\r
+ EndGlobalSection\r
+ GlobalSection(ExtensibilityGlobals) = postSolution\r
+ SolutionGuid = {ED382B91-9930-40B6-B3D7-362304C78680}\r
+ EndGlobalSection\r
+EndGlobal\r
--- /dev/null
+/*\r
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License\r
+ */\r
+\r
+using NUnit.Framework;\r
+using NUnit.Framework.TUnit;\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
+using System.Threading.Tasks;\r
+\r
+namespace Tizen.Applications.EventManager.Tests\r
+{\r
+ [TestFixture]\r
+ [Description("Tizen.Applications.ApplicationEventManager Tests")]\r
+ class EventManagerApplicationEventManagerTests\r
+ {\r
+ private string LOG_TAG = "ApplicationEvents";\r
+ private const string AppId = "org.tizen.example.AppEventTestApp";\r
+ private const string TrustedAppId = "org.tizen.example.AppEventTestTrustedApp";\r
+ private bool _flag;\r
+ private bool _eventFlag;\r
+\r
+ public async Task WaitFlag()\r
+ {\r
+ int count = 0;\r
+ while (true)\r
+ {\r
+ await Task.Delay(500);\r
+ count++;\r
+ if (_flag)\r
+ break;\r
+ if (count == 4)\r
+ break;\r
+ }\r
+ }\r
+\r
+ public async Task WaitEventFlag()\r
+ {\r
+ int count = 0;\r
+ while (true)\r
+ {\r
+ await Task.Delay(500);\r
+ count++;\r
+ if (_eventFlag)\r
+ break;\r
+ if (count == 4)\r
+ break;\r
+ }\r
+ }\r
+\r
+ void AppControlReplyReceivedCallback(Tizen.Applications.AppControl launchRequest, Tizen.Applications.AppControl replyRequest, AppControlReplyResult result)\r
+ {\r
+ if (result >= 0)\r
+ _flag = true;\r
+ }\r
+\r
+ [SetUp]\r
+ public void Init()\r
+ {\r
+ LogUtils.Write(LogUtils.DEBUG, LOG_TAG, "Preconditions for each TEST");\r
+ }\r
+\r
+ [TearDown]\r
+ public void Destroy()\r
+ {\r
+ LogUtils.Write(LogUtils.DEBUG, LOG_TAG, "Postconditions for each TEST");\r
+ }\r
+ void OnReceived(object sender, EventManagerEventArgs e)\r
+ {\r
+ LogUtils.Write(LogUtils.DEBUG, LOG_TAG, "On Received : " + e.Name);\r
+ if (e.Name == "event.org.tizen.example.AppEventTestApp.AppEvent" ||\r
+ e.Name == "event.org.tizen.example.AppEventTestTrustedApp.AppEvent")\r
+ _eventFlag = true;\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Publish an application event for non trusted application")]\r
+ [Property("SPEC", "Tizen.Applications.EventManager.ApplicationEventManager.Publish M")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "MR")]\r
+ [Property("AUTHOR", "Inkyun Kil, inkyun.kil@samsung.com")]\r
+ [Property("COVPARAM", "string, Bundle")]\r
+ public async Task Publish_App_EventAsync()\r
+ {\r
+ /* PRECONDITION\r
+ * Install org.tizen.example.UIApp.Tizen.tpk <in folder res/>\r
+ * Privilege: http://tizen.org/privilege/appmanager.launch\r
+ * */\r
+\r
+ /* TEST CODE */\r
+ _eventFlag = false;\r
+ AppControl myAppControl = new Tizen.Applications.AppControl(true);\r
+ Assert.IsNotNull(myAppControl, "Object should not be null after initializing");\r
+\r
+ myAppControl.Operation = AppControlOperations.Default;\r
+ myAppControl.ApplicationId = AppId;\r
+ myAppControl.LaunchMode = AppControlLaunchMode.Group;\r
+\r
+ Tizen.Applications.AppControl.SendLaunchRequest(myAppControl, AppControlReplyReceivedCallback);\r
+\r
+ await WaitFlag();\r
+ Assert.IsTrue(_flag, AppId + "should be running after launching request has sent");\r
+\r
+ EventReceiver receiver = new EventReceiver("event.org.tizen.example.AppEventTestApp.AppEvent");\r
+ receiver.Received += OnReceived;\r
+\r
+ Bundle bundle = new Bundle();\r
+ bundle.AddItem("key", "value");\r
+ Tizen.Applications.EventManager.ApplicationEventManager.Publish("event.Tizen.Applications.EventManager.Tests.AppEventTestApp", bundle);\r
+ await WaitEventFlag();\r
+ Assert.IsTrue(_eventFlag, "Success to publish app event");\r
+ }\r
+\r
+ [Test]\r
+ [Category("P2")]\r
+ [Description("Check publishing an application event with null parameter")]\r
+ [Property("SPEC", "Tizen.Applications.EventManager.ApplicationEventManager.Publish M")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "MEX")]\r
+ [Property("AUTHOR", "Inkyun Kil, inkyun.kil@samsung.com")]\r
+ [Property("COVPARAM", "string, Bundle")]\r
+ public void Publish_App_Event_ArgumentException()\r
+ {\r
+ Bundle bundle = new Bundle();\r
+ bundle.AddItem("key", "value");\r
+ Assert.Throws<ArgumentException>(() => {\r
+ Tizen.Applications.EventManager.ApplicationEventManager.Publish(null, bundle);\r
+ });\r
+ }\r
+\r
+ [Test]\r
+ [Category("P2")]\r
+ [Description("Check publishing an application event with wrong event name")]\r
+ [Property("SPEC", "Tizen.Applications.EventManager.ApplicationEventManager.Publish M")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "MEX")]\r
+ [Property("AUTHOR", "Inkyun Kil, inkyun.kil@samsung.com")]\r
+ [Property("COVPARAM", "string, Bundle")]\r
+ public void Publish_App_Event_InvalidOperationException()\r
+ {\r
+ Bundle bundle = new Bundle();\r
+ bundle.AddItem("key", "value");\r
+ Assert.Throws<InvalidOperationException>(() => {\r
+ Tizen.Applications.EventManager.ApplicationEventManager.Publish("event.Tests.AppEventTestApp", bundle);\r
+ });\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Publish an application event for trusted application")]\r
+ [Property("SPEC", "Tizen.Applications.EventManager.ApplicationEventManager.Publish M")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "MR")]\r
+ [Property("AUTHOR", "Inkyun Kil, inkyun.kil@samsung.com")]\r
+ [Property("COVPARAM", "string, Bundle, bool")]\r
+ public async Task Publish_App_TrustedEventAsync()\r
+ {\r
+ /* PRECONDITION\r
+ * Install org.tizen.example.UIApp.Tizen.tpk <in folder res/>\r
+ * Privilege: http://tizen.org/privilege/appmanager.launch\r
+ * */\r
+\r
+ /* TEST CODE */\r
+ _eventFlag = false;\r
+ AppControl myAppControl = new Tizen.Applications.AppControl(true);\r
+ Assert.IsNotNull(myAppControl, "Object should not be null after initializing");\r
+\r
+ myAppControl.Operation = AppControlOperations.Default;\r
+ myAppControl.ApplicationId = TrustedAppId;\r
+ myAppControl.LaunchMode = AppControlLaunchMode.Group;\r
+\r
+ Tizen.Applications.AppControl.SendLaunchRequest(myAppControl, AppControlReplyReceivedCallback);\r
+\r
+ await WaitFlag();\r
+ Assert.IsTrue(_flag, TrustedAppId + "should be running after launching request has sent");\r
+\r
+ EventReceiver receiver = new EventReceiver("event.org.tizen.example.AppEventTestTrustedApp.AppEvent");\r
+ receiver.Received += OnReceived;\r
+\r
+ Bundle bundle = new Bundle();\r
+ bundle.AddItem("key", "value");\r
+ Tizen.Applications.EventManager.ApplicationEventManager.Publish("event.Tizen.Applications.EventManager.Tests.AppEventTestTrustedApp", bundle, true);\r
+ await WaitEventFlag();\r
+ Assert.IsTrue(_eventFlag, "Success to publish app event");\r
+ }\r
+\r
+ [Test]\r
+ [Category("P2")]\r
+ [Description("Check publishing an application event with null parameter")]\r
+ [Property("SPEC", "Tizen.Applications.EventManager.ApplicationEventManager.Publish M")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "MEX")]\r
+ [Property("AUTHOR", "Inkyun Kil, inkyun.kil@samsung.com")]\r
+ [Property("COVPARAM", "string, Bundle, bool")]\r
+ public void Publish_App_TrustedEvent_ArgumentException()\r
+ {\r
+ Bundle bundle = new Bundle();\r
+ bundle.AddItem("key", "value");\r
+ Assert.Throws<ArgumentException>(() => {\r
+ Tizen.Applications.EventManager.ApplicationEventManager.Publish(null, bundle, true);\r
+ });\r
+ }\r
+\r
+ [Test]\r
+ [Category("P2")]\r
+ [Description("Check publishing an application event with wrong event name")]\r
+ [Property("SPEC", "Tizen.Applications.EventManager.ApplicationEventManager.Publish M")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "MEX")]\r
+ [Property("AUTHOR", "Inkyun Kil, inkyun.kil@samsung.com")]\r
+ [Property("COVPARAM", "string, Bundle, bool")]\r
+ public void Publish_App_TrustedEvent_InvalidOperationException()\r
+ {\r
+ Bundle bundle = new Bundle();\r
+ bundle.AddItem("key", "value");\r
+ Assert.Throws<InvalidOperationException>(() => {\r
+ Tizen.Applications.EventManager.ApplicationEventManager.Publish("event.Tests.AppEventTestApp", bundle, true);\r
+ });\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Keep last an application event")]\r
+ [Property("SPEC", "Tizen.Applications.EventManager.ApplicationEventManager.KeepLastEvent M")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "MR")]\r
+ [Property("AUTHOR", "Inkyun Kil, inkyun.kil@samsung.com")]\r
+ public void KeepLastEvent_Data_Sync()\r
+ {\r
+ Tizen.Applications.EventManager.ApplicationEventManager.KeepLastEvent("event.Tizen.Applications.EventManager.Tests.AppEventTestApp");\r
+ Assert.IsTrue(_eventFlag, "Success to publish app event");\r
+ }\r
+\r
+ [Test]\r
+ [Category("P2")]\r
+ [Description("Check Keep last an application event with null param")]\r
+ [Property("SPEC", "Tizen.Applications.EventManager.ApplicationEventManager.KeepLastEvent M")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "MEX")]\r
+ [Property("AUTHOR", "Inkyun Kil, inkyun.kil@samsung.com")]\r
+ public void KeepLastEvent_Data_ArgumentException()\r
+ {\r
+ Assert.Throws<ArgumentException>(() => {\r
+ Tizen.Applications.EventManager.ApplicationEventManager.KeepLastEvent(null);\r
+ });\r
+ }\r
+\r
+ }\r
+}\r
--- /dev/null
+/*
+ * Copyright (c) 2019 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 System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Tizen;
+using Tizen.Applications;
+using Tizen.Applications.EventManager;
+using Tizen.Applications.EventManager.SystemEvents;
+
+namespace Tizen.Application.EventManager.Tests
+{
+
+ [TestFixture]
+ [Description("Tizen.Application.EventManager.EventManagerEventArgs Tests")]
+ public class EventManagerEventManagerEventArgsTests
+ {
+ private string LOG_TAG = "ApplicationEvents";
+ private const string AppId = "org.tizen.example.AppEventTestApp";
+ private bool _flag;
+ private bool _eventFlag;
+
+ public async Task WaitFlag()
+ {
+ int count = 0;
+ while (true)
+ {
+ await Task.Delay(500);
+ count++;
+ if (_flag)
+ break;
+ if (count == 4)
+ break;
+ }
+ }
+
+ public async Task WaitEventFlag()
+ {
+ int count = 0;
+ while (true)
+ {
+ await Task.Delay(500);
+ count++;
+ if (_eventFlag)
+ break;
+ if (count == 4)
+ break;
+ }
+ }
+
+ void AppControlReplyReceivedCallback(Tizen.Applications.AppControl launchRequest, Tizen.Applications.AppControl replyRequest, AppControlReplyResult result)
+ {
+ if (result >= 0)
+ _flag = true;
+ }
+
+ [SetUp]
+ public void Init()
+ {
+ LogUtils.Write(LogUtils.DEBUG, LOG_TAG, "Preconditions for each TEST");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ LogUtils.Write(LogUtils.DEBUG, LOG_TAG, "Postconditions for each TEST");
+ }
+
+ void OnReceived(object sender, EventManagerEventArgs e)
+ {
+ LogUtils.Write(LogUtils.DEBUG, LOG_TAG, "On Received : " + e.Name);
+ if (e.Name == "event.org.tizen.example.AppEventTestApp.AppEvent" &&
+ e.Data.Contains("key"))
+ _eventFlag = true;
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Get prpoperty Name of EventManagerEventArgs")]
+ [Property("SPEC", "Tizen.Applications.EventManager.EventManagerEventArgs.Name A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Inkyun Kil, inkyun.kil@samsung.com")]
+ public async Task Name_GET()
+ {
+ /* PRECONDITION
+ * Install org.tizen.example.UIApp.Tizen.tpk <in folder res/>
+ * Privilege: http://tizen.org/privilege/appmanager.launch
+ * */
+
+ /* TEST CODE */
+ _eventFlag = false;
+ AppControl myAppControl = new Tizen.Applications.AppControl(true);
+ Assert.IsNotNull(myAppControl, "Object should not be null after initializing");
+
+ myAppControl.Operation = AppControlOperations.Default;
+ myAppControl.ApplicationId = AppId;
+ myAppControl.LaunchMode = AppControlLaunchMode.Group;
+
+ Tizen.Applications.AppControl.SendLaunchRequest(myAppControl, AppControlReplyReceivedCallback);
+
+ await WaitFlag();
+ Assert.IsTrue(_flag, AppId + "should be running after launching request has sent");
+
+ EventReceiver receiver = new EventReceiver("event.org.tizen.example.AppEventTestApp.AppEvent");
+ receiver.Received += OnReceived;
+
+ Bundle bundle = new Bundle();
+ bundle.AddItem("key", "value");
+ Tizen.Applications.EventManager.ApplicationEventManager.Publish("event.Tizen.Applications.EventManager.Tests.AppEventTestApp", bundle);
+ await WaitEventFlag();
+ Assert.IsTrue(_eventFlag, "Success to check EventManagerEventArgs.Name");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Get prpoperty Data of EventManagerEventArgs")]
+ [Property("SPEC", "Tizen.Applications.EventManager.EventManagerEventArgs.Data A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Inkyun Kil, inkyun.kil@samsung.com")]
+ public async Task Data_GET()
+ {
+ _eventFlag = false;
+
+ Bundle bundle = new Bundle();
+ bundle.AddItem("key", "value");
+ Tizen.Applications.EventManager.ApplicationEventManager.Publish("event.Tizen.Applications.EventManager.Tests.AppEventTestApp", bundle);
+ await WaitEventFlag();
+ Assert.IsTrue(_eventFlag, "Success to check EventManagerEventArgs.Name");
+ }
+ }
+}
--- /dev/null
+/*\r
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License\r
+ */\r
+\r
+using NUnit.Framework;\r
+using NUnit.Framework.TUnit;\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Threading;\r
+using System.Threading.Tasks;\r
+using Tizen;\r
+using Tizen.Applications;\r
+using Tizen.Applications.EventManager;\r
+using Tizen.Applications.EventManager.SystemEvents;\r
+\r
+namespace Tizen.Application.EventManager.Tests {\r
+\r
+ [TestFixture]\r
+ [Description("Tizen.Applications.EventManagerEventReceiver Tests")]\r
+ public class EventManagerEventReceiverTests {\r
+ private string LOG_TAG = "ApplicationEvents";\r
+\r
+ [SetUp]\r
+ public void Init()\r
+ {\r
+ LogUtils.Write(LogUtils.DEBUG, LOG_TAG, "Preconditions for each TEST");\r
+ }\r
+\r
+ [TearDown]\r
+ public void Destroy()\r
+ {\r
+ LogUtils.Write(LogUtils.DEBUG , LOG_TAG, "Postconditions for each TEST");\r
+ }\r
+\r
+ void OnReceived(object sender, EventManagerEventArgs e)\r
+ {\r
+ LogUtils.Write(LogUtils.DEBUG, LOG_TAG, "On Received : " + e.Name);\r
+ }\r
+\r
+ [Test]
+ [Category("P1")]
+ [Description("Test EventReceiver method initialization")]
+ [Property("SPEC", "Tizen.Applications.EventManager.EventReceiver.EventReceiver C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Inkyun Kil, inkyun.kil@samsung.com")]
+ public void EventReceiver_INIT()
+ {
+ var receiver = new EventReceiver(DisplayState.EventName);
+ Assert.IsInstanceOf<EventReceiver>(receiver);
+ Assert.IsNotNull(receiver, "receiver should be not null after init.");
+ }\r
+\r
+ [Test]
+ [Category("P1")]
+ [Description("Test getting property of EventReceiver")]
+ [Property("SPEC", "Tizen.Applications.EventManager.EventReceiver.EventName A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Inkyun Kil, inkyun.kil@samsung.com")]
+ public void EventName_Get()
+ {
+ var receiver = new EventReceiver(DisplayState.EventName);
+ Assert.AreEqual(receiver.EventName, DisplayState.EventName, "EventName of receiver should be " + DisplayState.EventName + ".");
+ }\r
+ }\r
+}\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest package="Tizen.Applications.EventManager.Tests" version="1.0.0" api-version="6" xmlns="http://tizen.org/ns/packages">
+ <profile name="common" />
+ <ui-application appid="Tizen.Applications.EventManager.Tests" exec="Tizen.Applications.EventManager.Tests.dll" multiple="false" taskmanage="true" splash-screen-display="true" type="dotnet" launch_mode="single">
+ <icon>Tizen.ApplicationEvents.Tests.png</icon>
+ <label>Tizen.Applications.EventManager.Tests</label>
+ </ui-application>
+ <privileges>
+ <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+ <privilege>http://tizen.org/privilege/display</privilege>
+ <privilege>http://tizen.org/privilege/network.get</privilege>
+ <privilege>http://tizen.org/privilege/message.read</privilege>
+ </privileges>
+ <provides-appdefined-privileges />
+</manifest>