From: Hwankyu Jhun Date: Mon, 27 Jul 2020 04:54:02 +0000 (+0900) Subject: [Applications][Non-ACR][Fix testcases for iot profile] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F74%2F239474%2F1;p=test%2Ftct%2Fcsharp%2Fapi.git [Applications][Non-ACR][Fix testcases for iot profile] - Use service app instead of ui app Change-Id: I9d16fc3d7a27ca5dcf7476d99f00af6d78c0effe Signed-off-by: Hwankyu Jhun --- diff --git a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSApplicationLaunchedEventArgs.cs b/tct-suite-vs/Tizen.Applications.Tests/testcase/TSApplicationLaunchedEventArgs.cs index 341f3c0..66937fb 100755 --- a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSApplicationLaunchedEventArgs.cs +++ b/tct-suite-vs/Tizen.Applications.Tests/testcase/TSApplicationLaunchedEventArgs.cs @@ -1,5 +1,6 @@ using NUnit.Framework; using NUnit.Framework.TUnit; +using System.Linq.Expressions; using System.Threading.Tasks; namespace Tizen.Applications.Tests @@ -13,7 +14,7 @@ namespace Tizen.Applications.Tests private bool _needUnsubscribe; private bool _isLaunched; private string _argAppId; - private const string AppId = "org.tizen.example.UIApp.Tizen"; + private const string AppId = "org.tizen.ServiceAppTest.Tizen"; [SetUp] public void Init() @@ -63,6 +64,17 @@ namespace Tizen.Applications.Tests [Property("AUTHOR", "Sangyoon Jang, s89.jang@samsung.com")] public async Task ApplicationRunningContext_ATTR() { + try + { + var runningContext = new ApplicationRunningContext(AppId); + if (runningContext != null) + ApplicationManager.TerminateBackgroundApplication(runningContext); + } + catch + { + Log.Debug("TCT", AppId + " is not running"); + } + var IsRunning = false; ApplicationManager.ApplicationLaunched += Eventlaunched; _needUnsubscribe = true; @@ -80,6 +92,7 @@ namespace Tizen.Applications.Tests if (app.ApplicationId.Contains(AppId)) { IsRunning = true; + ApplicationManager.TerminateBackgroundApplication(app); break; } } @@ -93,11 +106,6 @@ namespace Tizen.Applications.Tests Assert.AreEqual(_argAppId, AppId, "Application ID launch is not correct"); Assert.Greater(_processId, 0, "Process ID is not correct"); Assert.True(_isLaunched, "Eventlaunched should be occurred"); - - if (IsRunning) - { - AppControl.SendTerminateRequest(appControl); - } } } } diff --git a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSApplicationManager.cs b/tct-suite-vs/Tizen.Applications.Tests/testcase/TSApplicationManager.cs index a861732..61c5248 100755 --- a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSApplicationManager.cs +++ b/tct-suite-vs/Tizen.Applications.Tests/testcase/TSApplicationManager.cs @@ -240,11 +240,11 @@ namespace Tizen.Applications.Tests public void Eventlaunched(object sender, ApplicationLaunchedEventArgs Args) { - if (string.Equals(Args.ApplicationRunningContext.ApplicationId, AppId)) - { - _argAppId = Args.ApplicationRunningContext.ApplicationId; + if (string.Equals(Args.ApplicationRunningContext.ApplicationId, AppServiceId)) + { + _argAppId = Args.ApplicationRunningContext.ApplicationId; _processId = Args.ApplicationRunningContext.ProcessId; - _isLaunched = true; + _isLaunched = true; } } @@ -261,8 +261,7 @@ namespace Tizen.Applications.Tests ApplicationManager.ApplicationLaunched += Eventlaunched; _needUnsubscribe1 = true; AppControl appControl = new AppControl(); - appControl.ApplicationId = AppId; - appControl.LaunchMode = AppControlLaunchMode.Group; + appControl.ApplicationId = AppServiceId; _argAppId = ""; _processId = 0; @@ -271,9 +270,10 @@ namespace Tizen.Applications.Tests var _list = await ApplicationManager.GetAllRunningApplicationsAsync(); foreach (var app in _list) { - if (app.ApplicationId.Contains(AppId)) + if (app.ApplicationId.Contains(AppServiceId)) { IsRunning = true; + ApplicationManager.TerminateBackgroundApplication(app); break; } } @@ -284,14 +284,9 @@ namespace Tizen.Applications.Tests * 4 Close Message App after this app lauched. * 4 Check bFlag is true. */ - Assert.AreEqual(_argAppId, AppId, "Application ID launch is not correct"); + Assert.AreEqual(_argAppId, AppServiceId, "Application ID launch is not correct"); Assert.Greater(_processId, 0, "Process ID is not correct"); Assert.True(_isLaunched, "Eventlaunched should be occurred"); - - if (IsRunning) - { - AppControl.SendTerminateRequest(appControl); - } } public void EventTerminated(object sender, ApplicationTerminatedEventArgs Args)