3 using Tizen.Applications;
\r
5 namespace ApplicationManual.Tizen
\r
7 class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication, App.IAppEvent
\r
11 public void OnButtonPressed()
\r
13 Log.Info("TCT", "Call Exit()");
\r
16 protected override void OnPreCreate()
\r
18 Log.Info("TCT", "[TestCase][OnPreCreate][Application] Pass");
\r
25 protected override void OnCreate()
\r
29 Log.Info("TCT", "[TestCase][OnCreate][Application] Pass");
\r
31 LoadApplication(app_);
\r
34 protected override void OnResume()
\r
36 Log.Info("TCT", "[TestCase][OnResume][Application] Pass");
\r
40 protected override void OnPause()
\r
42 Log.Info("TCT", "[TestCase][OnPause][Application] Pass");
\r
46 protected override void OnTerminate()
\r
48 Log.Info("TCT", "Application::OnTerminate()");
\r
49 Log.Info("TCT", "[TestCase][OnTerminate][Application] Pass");
\r
53 protected override void OnAppControlReceived(AppControlReceivedEventArgs e)
\r
55 Log.Info("TCT", "Application::OnAppControlReceived()");
\r
56 if (e.ReceivedAppControl != null)
\r
58 Log.Info("TCT", "[TestCase][Test_Properties] ReceivedAppControl properties is not null");
\r
59 Log.Info("TCT", "[TestCase][Test_Properties] ReceivedAppControl Type: " + e.ReceivedAppControl.GetType());
\r
61 //logBuilder.AppendLine("TCT [TestCase][OnAppControlReceived] Pass");
\r
62 Log.Info("TCT", "[TestCase][OnAppControlReceived][Application] Pass");
\r
64 base.OnAppControlReceived(e);
\r
65 ShowPropertiesInfo();
\r
68 protected override void OnLocaleChanged(LocaleChangedEventArgs e)
\r
70 Log.Info("TCT", "Application::OnLocaleChanged()");
\r
71 if (e.Locale != null)
\r
73 Log.Info("TCT", "[Test_Properties] Locale properties is not null");
\r
74 Log.Info("TCT", "[Test_Properties] Current value of Locale : " + e.Locale);
\r
75 Log.Info("TCT", "[Test_Properties] Locale type: " + e.Locale.GetType());
\r
78 Log.Info("TCT", "[TestCase][OnLocaleChanged][Application] Pass");
\r
79 base.OnLocaleChanged(e);
\r
82 protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e)
\r
84 Log.Info("TCT", "Application::OnRegionFormatChanged()");
\r
87 Log.Info("TCT", "[Test_Properties] Region properties is not null");
\r
88 Log.Info("TCT", "[Test_Properties] Current value of Region : " + e.Region);
\r
89 Log.Info("TCT", "[Test_Properties] Region type: " + e.Region.GetType());
\r
92 Log.Info("TCT", "[TestCase][OnRegionFormatChanged][Application] Pass");
\r
93 base.OnRegionFormatChanged(e);
\r
96 protected override void OnDeviceOrientationChanged(DeviceOrientationEventArgs e)
\r
98 Log.Info("TCT", "Application::OnDeviceOrientationChanged()");
\r
101 Log.Info("TCT", "[Test_Properties] DeviceOrientation properties is not null");
\r
102 Log.Info("TCT", "[Test_Properties] Current value of DeviceOrientation : " + e.DeviceOrientation);
\r
103 Log.Info("TCT", "[Test_Properties] DeviceOrientation type: " + e.DeviceOrientation.GetType());
\r
106 Log.Info("TCT", "[TestCase][OnDeviceOrientationChanged][Application] Pass");
\r
107 base.OnDeviceOrientationChanged(e);
\r
110 protected override void OnLowMemory(LowMemoryEventArgs e)
\r
112 Log.Info("TCT", "Application::OnLowMemory()");
\r
113 if (e.LowMemoryStatus != LowMemoryStatus.None)
\r
115 Log.Info("TCT", "[Test_Properties] LowMemoryStatus properties is not null");
\r
116 Log.Info("TCT", "[Test_Properties] Current value of LowMemoryStatus : " + e.LowMemoryStatus.ToString());
\r
117 Log.Info("TCT", "[Test_Properties] LowMemoryStatus type: " + e.LowMemoryStatus.GetType());
\r
119 //logBuilder.AppendLine("TCT [TestCase][OnLowMemory] Pass");
\r
120 Log.Info("TCT", "[TestCase][OnLowMemory][Application] Pass");
\r
122 base.OnLowMemory(e);
\r
125 protected override void OnLowBattery(LowBatteryEventArgs e)
\r
127 Log.Info("TCT", "Application::OnLowBattery()");
\r
128 if (e.LowBatteryStatus != LowBatteryStatus.None)
\r
130 Log.Info("TCT", "[Test_Properties] LowBatteryStatus properties is not null");
\r
131 Log.Info("TCT", "[Test_Properties] Current value of LowBatteryStatus : " + e.LowBatteryStatus.ToString());
\r
132 Log.Info("TCT", "[Test_Properties] LowBatteryStatus type: " + e.LowBatteryStatus.GetType());
\r
135 Log.Info("TCT", "[TestCase][OnLowBattery][Application] Pass");
\r
137 base.OnLowBattery(e);
\r
140 public override void Run(string[] args)
\r
142 Created += Created_Event_Test;
\r
143 AppControlReceived += AppControlReceived_Event_Test;
\r
144 LocaleChanged += LocaleChanged_Event_Test;
\r
145 LowMemory += LowMemory_Event_Test;
\r
146 LowBattery += LowBattery_Event_Test;
\r
147 Terminated += Terminated_Event_Test;
\r
148 Paused += EventHandlerPaused;
\r
149 Resumed += EventHandlerResumed;
\r
150 DeviceOrientationChanged += DeviceOrientationCHanged_Event_Test;
\r
151 RegionFormatChanged += RegionFormatChanged_Event_Test;
\r
153 Log.Info("TCT", "[TestCase][Run][Application] Pass");
\r
158 private void Terminated_Event_Test(object sender, EventArgs e)
\r
163 * -> If log show "Application::Terminated_Event_Test()" -> PASS
\r
165 Log.Info("TCT", "Application::Terminated_Event_Test");
\r
166 //logBuilder.AppendLine("TCT [TestCase][Terminated_Event_Test] Pass");
\r
167 Log.Info("TCT", "[TestCase][Terminated_Event_Test][Application] Pass");
\r
170 private void LocaleChanged_Event_Test(object sender, LocaleChangedEventArgs e)
\r
175 * -> If log show "Application::LocaleChanged_Event_Test()" -> PASS
\r
177 Log.Info("TCT", "Application::LocaleChanged_Event_Test");
\r
178 Log.Info("TCT", "Application::LocaleChanged_Event_Test: new located - " + e.Locale);
\r
179 //logBuilder.AppendLine("TCT [TestCase][LocaleChanged_Event_Test] Pass");
\r
180 Log.Info("TCT", "[TestCase][LocaleChanged_Event_Test][Application] Pass");
\r
183 private void RegionFormatChanged_Event_Test(object sender, RegionFormatChangedEventArgs e)
\r
185 Log.Info("TCT", "Application::RegionFormatChanged_Event_Test");
\r
186 Log.Info("TCT", "Application::RegionFormatChanged_Event_Test: new region - " + e.Region);
\r
187 //logBuilder.AppendLine("TCT [TestCase][LocaleChanged_Event_Test] Pass");
\r
188 Log.Info("TCT", "[TestCase][RegionFormatChanged_Event_Test][Application] Pass");
\r
191 private void DeviceOrientationCHanged_Event_Test(object sender, DeviceOrientationEventArgs e)
\r
193 Log.Info("TCT", "Application::DeviceOrientationCHanged_Event_Test");
\r
194 Log.Info("TCT", "Application::DeviceOrientationCHanged_Event_Test: new located - " + e.DeviceOrientation);
\r
195 Log.Info("TCT", "[TestCase][DeviceOrientationCHanged_Event_Test][Application] Pass");
\r
198 private void LowMemory_Event_Test(object sender, LowMemoryEventArgs e)
\r
203 * -> If log show "Application::LowMemory_Event_Test()" -> PASS
\r
205 Log.Info("TCT", "Application::LowMemory_Event_Test");
\r
206 if (e.LowMemoryStatus == LowMemoryStatus.None)
\r
208 Log.Info("TCT", "Application::LowMemory_Event_Test: LowMemoryStatus.None");
\r
210 else if (e.LowMemoryStatus == LowMemoryStatus.Normal)
\r
212 Log.Info("TCT", "Application::LowMemory_Event_Test: LowMemoryStatus.Normal");
\r
214 else if (e.LowMemoryStatus == LowMemoryStatus.SoftWarning)
\r
216 Log.Info("TCT", "Application::LowMemory_Event_Test: LowMemoryStatus.SoftWarning");
\r
218 else if (e.LowMemoryStatus == LowMemoryStatus.HardWarning)
\r
220 Log.Info("TCT", "Application::LowMemory_Event_Test: LowMemoryStatus.HardWarning");
\r
222 //logBuilder.AppendLine("TCT [TestCase][LowMemory_Event_Test] Pass");
\r
223 Log.Info("TCT", "[TestCase][LowMemory_Event_Test][Application] Pass");
\r
226 private void LowBattery_Event_Test(object sender, LowBatteryEventArgs e)
\r
228 Log.Info("TCT", "Application::LowBattery_Event_Test");
\r
230 if (e.LowBatteryStatus == LowBatteryStatus.CriticalLow)
\r
232 Log.Info("TCT", "Application::LowBattery_Event_Test: LowMemoryStatus.CriticalLow");
\r
234 Log.Info("TCT", "[TestCase][LowBattery_Event_Test][Application] Pass");
\r
237 private void AppControlReceived_Event_Test(object sender, AppControlReceivedEventArgs e)
\r
242 * -> If log show "Application::AppControlReceived_Event_Test()" -> PASS
\r
244 Log.Info("TCT", "Application::AppControlReceived_Event_Test");
\r
245 //logBuilder.AppendLine("TCT [TestCase][AppControlReceived_Event_Test] Pass");
\r
246 Log.Info("TCT", "[TestCase][AppControlReceived_Event_Test][Application] Pass");
\r
249 private void Created_Event_Test(object sender, EventArgs e)
\r
254 * -> If log show "Application::Created_Event_Test()" -> PASS
\r
256 Log.Info("TCT", "Application::Created_Event_Test");
\r
257 //logBuilder.AppendLine("TCT [TestCase][Created_Event_Test] Pass");
\r
258 Log.Info("TCT", "[TestCase][Created_Event_Test][Application] Pass");
\r
260 public void EventHandlerPaused(object sender, EventArgs e)
\r
264 * 1. Open Application app.
\r
265 * 2. Open other app.
\r
267 Log.Info("TCT", "[TestCase][EventHandlerPaused][Application] Pass");
\r
269 public void EventHandlerResumed(object sender, EventArgs e)
\r
273 * 1. Open Application app.
\r
274 * 2. Open other app.
\r
275 * 3. Long press HOME button and tap to Applicaton shortcut.
\r
277 Log.Info("TCT", "Application Resumed event occur!");
\r
278 Log.Info("TCT", "[TestCase][EventHandlerResumed][Application] Pass");
\r
281 public override void Exit()
\r
283 Log.Info("TCT", "[TestCase][Exit][Application] Pass");
\r
286 void ShowPropertiesInfo()
\r
288 if (base.ApplicationInfo != null)
\r
290 Log.Info("TCT", "[Info] ApplicationInfo is not null");
\r
291 Log.Info("TCT", "[Info] ApplicationInfo.ApplicationId = " + base.ApplicationInfo.ApplicationId);
\r
292 Log.Info("TCT", "[Info] ApplicationInfo.ApplicationType = " + base.ApplicationInfo.ApplicationType);
\r
293 Log.Info("TCT", "[Info] ApplicationInfo.ExecutablePath = " + base.ApplicationInfo.ExecutablePath);
\r
294 Log.Info("TCT", "[Info] ApplicationInfo.ExternalSharedDataPath = " + base.ApplicationInfo.ExternalSharedDataPath);
\r
295 Log.Info("TCT", "[Info] ApplicationInfo.IconPath = " + base.ApplicationInfo.IconPath);
\r
296 Log.Info("TCT", "[Info] ApplicationInfo.IsNoDisplay = " + base.ApplicationInfo.IsNoDisplay);
\r
297 Log.Info("TCT", "[Info] ApplicationInfo.IsOnBoot = " + base.ApplicationInfo.IsOnBoot);
\r
298 Log.Info("TCT", "[Info] ApplicationInfo.IsPreload = " + base.ApplicationInfo.IsPreload);
\r
299 Log.Info("TCT", "[Info] ApplicationInfo.Label = " + base.ApplicationInfo.Label);
\r
300 Log.Info("TCT", "[Info] ApplicationInfo.Metadata Count = " + base.ApplicationInfo.Metadata.Count);
\r
301 foreach (var item in base.ApplicationInfo.Metadata)
\r
303 Log.Info("TCT", "[Info] ApplicationInfo.Metadata, Key: " + item.Key + " Value: " + item.Value);
\r
305 Log.Info("TCT", "[Info] ApplicationInfo.PackageId = " + base.ApplicationInfo.PackageId);
\r
306 Log.Info("TCT", "[Info] ApplicationInfo.SharedDataPath = " + base.ApplicationInfo.SharedDataPath);
\r
307 Log.Info("TCT", "[Info] ApplicationInfo.SharedResourcePath = " + base.ApplicationInfo.SharedResourcePath);
\r
308 Log.Info("TCT", "[Info] ApplicationInfo.SharedTrustedPath = " + base.ApplicationInfo.SharedTrustedPath);
\r
310 if (base.DirectoryInfo != null)
\r
312 Log.Info("TCT", "[Info] DirectoryInfo is not null");
\r
313 Log.Info("TCT", "[Info] DirectoryInfo.Cache = " + base.DirectoryInfo.Cache);
\r
314 Log.Info("TCT", "[Info] DirectoryInfo.Data = " + base.DirectoryInfo.Data);
\r
315 Log.Info("TCT", "[Info] DirectoryInfo.ExpansionPackageResource = " + base.DirectoryInfo.ExpansionPackageResource);
\r
316 Log.Info("TCT", "[Info] DirectoryInfo.ExternalCache = " + base.DirectoryInfo.ExternalCache);
\r
317 Log.Info("TCT", "[Info] DirectoryInfo.ExternalData = " + base.DirectoryInfo.ExternalData);
\r
318 Log.Info("TCT", "[Info] DirectoryInfo.ExternalSharedData = " + base.DirectoryInfo.ExternalSharedData);
\r
319 Log.Info("TCT", "[Info] DirectoryInfo.Resource = " + base.DirectoryInfo.Resource);
\r
320 Log.Info("TCT", "[Info] DirectoryInfo.SharedData = " + base.DirectoryInfo.SharedData);
\r
321 Log.Info("TCT", "[Info] DirectoryInfo.SharedResource = " + base.DirectoryInfo.SharedResource);
\r
322 Log.Info("TCT", "[Info] DirectoryInfo.SharedTrusted = " + base.DirectoryInfo.SharedTrusted);
\r
325 Log.Info("TCT", "[Info] Current == this : " + (Current == this));
\r
326 Log.Info("TCT", "[Info] Current.ApplicationInfo.ApplicationId = " + Current.ApplicationInfo.ApplicationId);
\r
329 static void Main(string[] args)
\r
331 var app = new Program();
\r
332 global::Xamarin.Forms.Platform.Tizen.Forms.Init(app);
\r