3 using Tizen.Applications;
\r
4 using System.Threading;
\r
6 namespace org.tizen.ApplicationManual.Tizen
\r
8 class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication
\r
10 protected override void OnPreCreate()
\r
12 Log.Debug("TCT", "[TestCase][OnPreCreate][Application] Pass");
\r
15 protected override void OnCreate()
\r
19 Log.Debug("TCT", "[TestCase][OnCreate][Application] Pass");
\r
21 LoadApplication(new App());
\r
24 protected override void OnResume()
\r
26 Log.Debug("TCT", "[TestCase][OnResume][Application] Pass");
\r
30 protected override void OnPause()
\r
32 Log.Debug("TCT", "[TestCase][OnPause][Application] Pass");
\r
36 protected override void OnTerminate()
\r
38 Log.Debug("TCT", "Application::OnTerminate()");
\r
39 Log.Debug("TCT", "[TestCase][OnTerminate][Application] Pass");
\r
43 protected override void OnAppControlReceived(AppControlReceivedEventArgs e)
\r
45 Log.Debug("TCT", "Application::OnAppControlReceived()");
\r
46 if (e.ReceivedAppControl != null)
\r
48 Log.Debug("TCT", "[TestCase][Test_Properties] ReceivedAppControl properties is not null");
\r
49 Log.Debug("TCT", "[TestCase][Test_Properties] ReceivedAppControl Type: " + e.ReceivedAppControl.GetType());
\r
51 //logBuilder.AppendLine("TCT [TestCase][OnAppControlReceived] Pass");
\r
52 Log.Debug("TCT", "[TestCase][OnAppControlReceived][Application] Pass");
\r
54 base.OnAppControlReceived(e);
\r
55 ShowPropertiesInfo();
\r
58 protected override void OnLocaleChanged(LocaleChangedEventArgs e)
\r
60 Log.Debug("TCT", "Application::OnLocaleChanged()");
\r
61 if (e.Locale != null)
\r
63 Log.Debug("TCT", "[Test_Properties] Locale properties is not null");
\r
64 Log.Debug("TCT", "[Test_Properties] Current value of Locale : " + e.Locale);
\r
65 Log.Debug("TCT", "[Test_Properties] Locale type: " + e.Locale.GetType());
\r
68 Log.Debug("TCT", "[TestCase][OnLocaleChanged][Application] Pass");
\r
69 base.OnLocaleChanged(e);
\r
72 protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e)
\r
74 Log.Debug("TCT", "Application::OnRegionFormatChanged()");
\r
77 Log.Debug("TCT", "[Test_Properties] Region properties is not null");
\r
78 Log.Debug("TCT", "[Test_Properties] Current value of Region : " + e.Region);
\r
79 Log.Debug("TCT", "[Test_Properties] Region type: " + e.Region.GetType());
\r
82 Log.Debug("TCT", "[TestCase][OnRegionFormatChanged][Application] Pass");
\r
83 base.OnRegionFormatChanged(e);
\r
86 protected override void OnDeviceOrientationChanged(DeviceOrientationEventArgs e)
\r
88 Log.Debug("TCT", "Application::OnDeviceOrientationChanged()");
\r
91 Log.Debug("TCT", "[Test_Properties] DeviceOrientation properties is not null");
\r
92 Log.Debug("TCT", "[Test_Properties] Current value of DeviceOrientation : " + e.DeviceOrientation);
\r
93 Log.Debug("TCT", "[Test_Properties] DeviceOrientation type: " + e.DeviceOrientation.GetType());
\r
96 Log.Debug("TCT", "[TestCase][OnDeviceOrientationChanged][Application] Pass");
\r
97 base.OnDeviceOrientationChanged(e);
\r
100 protected override void OnLowMemory(LowMemoryEventArgs e)
\r
102 Log.Debug("TCT", "Application::OnLowMemory()");
\r
103 if (e.LowMemoryStatus != LowMemoryStatus.None)
\r
105 Log.Debug("TCT", "[Test_Properties] LowMemoryStatus properties is not null");
\r
106 Log.Debug("TCT", "[Test_Properties] Current value of LowMemoryStatus : " + e.LowMemoryStatus.ToString());
\r
107 Log.Debug("TCT", "[Test_Properties] LowMemoryStatus type: " + e.LowMemoryStatus.GetType());
\r
109 //logBuilder.AppendLine("TCT [TestCase][OnLowMemory] Pass");
\r
110 Log.Debug("TCT", "[TestCase][OnLowMemory][Application] Pass");
\r
112 base.OnLowMemory(e);
\r
115 protected override void OnLowBattery(LowBatteryEventArgs e)
\r
117 Log.Debug("TCT", "Application::OnLowBattery()");
\r
118 if (e.LowBatteryStatus != LowBatteryStatus.None)
\r
120 Log.Debug("TCT", "[Test_Properties] LowBatteryStatus properties is not null");
\r
121 Log.Debug("TCT", "[Test_Properties] Current value of LowBatteryStatus : " + e.LowBatteryStatus.ToString());
\r
122 Log.Debug("TCT", "[Test_Properties] LowBatteryStatus type: " + e.LowBatteryStatus.GetType());
\r
125 Log.Debug("TCT", "[TestCase][OnLowBattery][Application] Pass");
\r
127 base.OnLowBattery(e);
\r
130 public override void Run(string[] args)
\r
132 Created += Created_Event_Test;
\r
133 AppControlReceived += AppControlReceived_Event_Test;
\r
134 LocaleChanged += LocaleChanged_Event_Test;
\r
135 LowMemory += LowMemory_Event_Test;
\r
136 LowBattery += LowBattery_Event_Test;
\r
137 Terminated += Terminated_Event_Test;
\r
138 Paused += EventHandlerPaused;
\r
139 Resumed += EventHandlerResumed;
\r
140 DeviceOrientationChanged += DeviceOrientationCHanged_Event_Test;
\r
141 RegionFormatChanged += RegionFormatChanged_Event_Test;
\r
143 Log.Debug("TCT", "[TestCase][Run][Application] Pass");
\r
148 private void Terminated_Event_Test(object sender, EventArgs e)
\r
153 * -> If log show "Application::Terminated_Event_Test()" -> PASS
\r
155 Log.Debug("TCT", "Application::Terminated_Event_Test");
\r
156 //logBuilder.AppendLine("TCT [TestCase][Terminated_Event_Test] Pass");
\r
157 Log.Debug("TCT", "[TestCase][Terminated_Event_Test][Application] Pass");
\r
160 private void LocaleChanged_Event_Test(object sender, LocaleChangedEventArgs e)
\r
165 * -> If log show "Application::LocaleChanged_Event_Test()" -> PASS
\r
167 Log.Debug("TCT", "Application::LocaleChanged_Event_Test");
\r
168 Log.Debug("TCT", "Application::LocaleChanged_Event_Test: new located - " + e.Locale);
\r
169 //logBuilder.AppendLine("TCT [TestCase][LocaleChanged_Event_Test] Pass");
\r
170 Log.Debug("TCT", "[TestCase][LocaleChanged_Event_Test][Application] Pass");
\r
173 private void RegionFormatChanged_Event_Test(object sender, RegionFormatChangedEventArgs e)
\r
175 Log.Debug("TCT", "Application::RegionFormatChanged_Event_Test");
\r
176 Log.Debug("TCT", "Application::RegionFormatChanged_Event_Test: new region - " + e.Region);
\r
177 //logBuilder.AppendLine("TCT [TestCase][LocaleChanged_Event_Test] Pass");
\r
178 Log.Debug("TCT", "[TestCase][RegionFormatChanged_Event_Test][Application] Pass");
\r
181 private void DeviceOrientationCHanged_Event_Test(object sender, DeviceOrientationEventArgs e)
\r
183 Log.Debug("TCT", "Application::DeviceOrientationCHanged_Event_Test");
\r
184 Log.Debug("TCT", "Application::DeviceOrientationCHanged_Event_Test: new located - " + e.DeviceOrientation);
\r
185 Log.Debug("TCT", "[TestCase][DeviceOrientationCHanged_Event_Test][Application] Pass");
\r
188 private void LowMemory_Event_Test(object sender, LowMemoryEventArgs e)
\r
193 * -> If log show "Application::LowMemory_Event_Test()" -> PASS
\r
195 Log.Debug("TCT", "Application::LowMemory_Event_Test");
\r
196 if (e.LowMemoryStatus == LowMemoryStatus.None)
\r
198 Log.Debug("TCT", "Application::LowMemory_Event_Test: LowMemoryStatus.None");
\r
200 else if (e.LowMemoryStatus == LowMemoryStatus.Normal)
\r
202 Log.Debug("TCT", "Application::LowMemory_Event_Test: LowMemoryStatus.Normal");
\r
204 else if (e.LowMemoryStatus == LowMemoryStatus.SoftWarning)
\r
206 Log.Debug("TCT", "Application::LowMemory_Event_Test: LowMemoryStatus.SoftWarning");
\r
208 else if (e.LowMemoryStatus == LowMemoryStatus.HardWarning)
\r
210 Log.Debug("TCT", "Application::LowMemory_Event_Test: LowMemoryStatus.HardWarning");
\r
212 //logBuilder.AppendLine("TCT [TestCase][LowMemory_Event_Test] Pass");
\r
213 Log.Debug("TCT", "[TestCase][LowMemory_Event_Test][Application] Pass");
\r
216 private void LowBattery_Event_Test(object sender, LowBatteryEventArgs e)
\r
218 Log.Debug("TCT", "Application::LowBattery_Event_Test");
\r
220 if (e.LowBatteryStatus == LowBatteryStatus.CriticalLow)
\r
222 Log.Debug("TCT", "Application::LowBattery_Event_Test: LowMemoryStatus.CriticalLow");
\r
224 Log.Debug("TCT", "[TestCase][LowBattery_Event_Test][Application] Pass");
\r
227 private void AppControlReceived_Event_Test(object sender, AppControlReceivedEventArgs e)
\r
232 * -> If log show "Application::AppControlReceived_Event_Test()" -> PASS
\r
234 Log.Debug("TCT", "Application::AppControlReceived_Event_Test");
\r
235 //logBuilder.AppendLine("TCT [TestCase][AppControlReceived_Event_Test] Pass");
\r
236 Log.Debug("TCT", "[TestCase][AppControlReceived_Event_Test][Application] Pass");
\r
239 private void Created_Event_Test(object sender, EventArgs e)
\r
244 * -> If log show "Application::Created_Event_Test()" -> PASS
\r
246 Log.Debug("TCT", "Application::Created_Event_Test");
\r
247 //logBuilder.AppendLine("TCT [TestCase][Created_Event_Test] Pass");
\r
248 Log.Debug("TCT", "[TestCase][Created_Event_Test][Application] Pass");
\r
250 public void EventHandlerPaused(object sender, EventArgs e)
\r
254 * 1. Open Application app.
\r
255 * 2. Open other app.
\r
257 Log.Debug("TCT", "[TestCase][EventHandlerPaused][Application] Pass");
\r
259 public void EventHandlerResumed(object sender, EventArgs e)
\r
263 * 1. Open Application app.
\r
264 * 2. Open other app.
\r
265 * 3. Long press HOME button and tap to Applicaton shortcut.
\r
267 Log.Debug("TCT", "Application Resumed event occur!");
\r
268 Log.Debug("TCT", "[TestCase][EventHandlerResumed][Application] Pass");
\r
271 public override void Exit()
\r
273 Log.Debug("TCT", "[TestCase][Exit][Application] Pass");
\r
276 void ShowPropertiesInfo()
\r
278 if (base.ApplicationInfo != null)
\r
280 Log.Debug("TCT", "[Info] ApplicationInfo is not null");
\r
281 Log.Debug("TCT", "[Info] ApplicationInfo.ApplicationId = " + base.ApplicationInfo.ApplicationId);
\r
282 Log.Debug("TCT", "[Info] ApplicationInfo.ApplicationType = " + base.ApplicationInfo.ApplicationType);
\r
283 Log.Debug("TCT", "[Info] ApplicationInfo.ExecutablePath = " + base.ApplicationInfo.ExecutablePath);
\r
284 Log.Debug("TCT", "[Info] ApplicationInfo.ExternalSharedDataPath = " + base.ApplicationInfo.ExternalSharedDataPath);
\r
285 Log.Debug("TCT", "[Info] ApplicationInfo.IconPath = " + base.ApplicationInfo.IconPath);
\r
286 Log.Debug("TCT", "[Info] ApplicationInfo.IsNoDisplay = " + base.ApplicationInfo.IsNoDisplay);
\r
287 Log.Debug("TCT", "[Info] ApplicationInfo.IsOnBoot = " + base.ApplicationInfo.IsOnBoot);
\r
288 Log.Debug("TCT", "[Info] ApplicationInfo.IsPreload = " + base.ApplicationInfo.IsPreload);
\r
289 Log.Debug("TCT", "[Info] ApplicationInfo.Label = " + base.ApplicationInfo.Label);
\r
290 Log.Debug("TCT", "[Info] ApplicationInfo.Metadata Count = " + base.ApplicationInfo.Metadata.Count);
\r
291 foreach (var item in base.ApplicationInfo.Metadata)
\r
293 Log.Debug("TCT", "[Info] ApplicationInfo.Metadata, Key: " + item.Key + " Value: " + item.Value);
\r
295 Log.Debug("TCT", "[Info] ApplicationInfo.PackageId = " + base.ApplicationInfo.PackageId);
\r
296 Log.Debug("TCT", "[Info] ApplicationInfo.SharedDataPath = " + base.ApplicationInfo.SharedDataPath);
\r
297 Log.Debug("TCT", "[Info] ApplicationInfo.SharedResourcePath = " + base.ApplicationInfo.SharedResourcePath);
\r
298 Log.Debug("TCT", "[Info] ApplicationInfo.SharedTrustedPath = " + base.ApplicationInfo.SharedTrustedPath);
\r
300 if (base.DirectoryInfo != null)
\r
302 Log.Debug("TCT", "[Info] DirectoryInfo is not null");
\r
303 Log.Debug("TCT", "[Info] DirectoryInfo.Cache = " + base.DirectoryInfo.Cache);
\r
304 Log.Debug("TCT", "[Info] DirectoryInfo.Data = " + base.DirectoryInfo.Data);
\r
305 Log.Debug("TCT", "[Info] DirectoryInfo.ExpansionPackageResource = " + base.DirectoryInfo.ExpansionPackageResource);
\r
306 Log.Debug("TCT", "[Info] DirectoryInfo.ExternalCache = " + base.DirectoryInfo.ExternalCache);
\r
307 Log.Debug("TCT", "[Info] DirectoryInfo.ExternalData = " + base.DirectoryInfo.ExternalData);
\r
308 Log.Debug("TCT", "[Info] DirectoryInfo.ExternalSharedData = " + base.DirectoryInfo.ExternalSharedData);
\r
309 Log.Debug("TCT", "[Info] DirectoryInfo.Resource = " + base.DirectoryInfo.Resource);
\r
310 Log.Debug("TCT", "[Info] DirectoryInfo.SharedData = " + base.DirectoryInfo.SharedData);
\r
311 Log.Debug("TCT", "[Info] DirectoryInfo.SharedResource = " + base.DirectoryInfo.SharedResource);
\r
312 Log.Debug("TCT", "[Info] DirectoryInfo.SharedTrusted = " + base.DirectoryInfo.SharedTrusted);
\r
315 Log.Debug("TCT", "[Info] Current == this : " + (Current == this));
\r
316 Log.Debug("TCT", "[Info] Current.ApplicationInfo.ApplicationId = " + Current.ApplicationInfo.ApplicationId);
\r
319 static void Main(string[] args)
\r
321 var app = new Program();
\r
322 global::Xamarin.Forms.Platform.Tizen.Forms.Init(app);
\r