1 using NUnit.Framework;
3 using System.Collections.Generic;
4 using static Tizen.NUI.Window;
6 namespace Tizen.NUI.Devel.Tests
8 using tlog = Tizen.Log;
11 [Description("public/Window/Window")]
12 internal class PublicWindowTest
14 private const string tag = "NUITEST";
15 private static Window myWin;
19 Rectangle r1 = new Rectangle(0, 0, 20, 20);
20 myWin = new Window(r1);
21 tlog.Info(tag, "Init() is called!");
32 tlog.Info(tag, "Destroy() is called!");
37 [Description("Window WindowPositionSize")]
38 [Property("SPEC", "Tizen.NUI.Window.WindowPositionSize A")]
39 [Property("SPEC_URL", "-")]
40 [Property("CRITERIA", "PRW")]
41 public void WindowWindowPositionSize()
43 tlog.Debug(tag, $"WindowWindowPositionSize START");
46 Rectangle r1 = myWin.WindowPositionSize;
47 myWin.WindowPositionSize = r1;
51 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
53 Assert.Fail("Caught Exception" + e.ToString());
55 tlog.Debug(tag, $"WindowWindowPositionSize END (OK)");
56 Assert.Pass("WindowWindowPositionSize");
61 [Description("Window DEFAULT_BACKGROUND_COLOR")]
62 [Property("SPEC", "Tizen.NUI.Window.DEFAULT_BACKGROUND_COLOR A")]
63 [Property("SPEC_URL", "-")]
64 [Property("CRITERIA", "PRW")]
65 public void WindowDEFAULT_BACKGROUND_COLOR()
67 tlog.Debug(tag, $"WindowDEFAULT_BACKGROUND_COLOR START");
70 Vector4 v1 = Window.DEFAULT_BACKGROUND_COLOR;
74 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
76 Assert.Fail("Caught Exception" + e.ToString());
78 tlog.Debug(tag, $"WindowDEFAULT_BACKGROUND_COLOR END (OK)");
79 Assert.Pass("WindowDEFAULT_BACKGROUND_COLOR");
84 [Description("Window DEBUG_BACKGROUND_COLOR")]
85 [Property("SPEC", "Tizen.NUI.Window.DEBUG_BACKGROUND_COLOR A")]
86 [Property("SPEC_URL", "-")]
87 [Property("CRITERIA", "PRW")]
88 public void WindowDEBUG_BACKGROUND_COLOR()
90 tlog.Debug(tag, $"WindowDEBUG_BACKGROUND_COLOR START");
93 Vector4 v1 = Window.DEBUG_BACKGROUND_COLOR;
97 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
99 Assert.Fail("Caught Exception" + e.ToString());
101 tlog.Debug(tag, $"WindowDEBUG_BACKGROUND_COLOR END (OK)");
102 Assert.Pass("WindowDEBUG_BACKGROUND_COLOR");
107 [Description("Window GetLayer")]
108 [Property("SPEC", "Tizen.NUI.Window.GetLayer M")]
109 [Property("SPEC_URL", "-")]
110 [Property("CRITERIA", "MR")]
111 public void WindowGetLayer()
113 tlog.Debug(tag, $"WindowGetLayer START");
116 myWin.GetLayer(65535);
120 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
122 Assert.Fail("Caught Exception" + e.ToString());
124 tlog.Debug(tag, $"WindowGetLayer END (OK)");
125 Assert.Pass("WindowGetLayer");
130 [Description("Window Destroy")]
131 [Property("SPEC", "Tizen.NUI.Window.Destroy M")]
132 [Property("SPEC_URL", "-")]
133 [Property("CRITERIA", "MR")]
134 public void WindowDestroy()
136 tlog.Debug(tag, $"WindowDestroy START");
139 Rectangle r2 = new Rectangle(0, 0, 20, 20);
140 Window w1 = new Window(r2);
147 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
149 Assert.Fail("Caught Exception" + e.ToString());
151 tlog.Debug(tag, $"WindowDestroy END (OK)");
152 Assert.Pass("WindowDestroy");
157 [Description("Window GetCurrentOrientation")]
158 [Property("SPEC", "Tizen.NUI.Window.GetCurrentOrientation M")]
159 [Property("SPEC_URL", "-")]
160 [Property("CRITERIA", "MR")]
161 public void WindowGetCurrentOrientation()
163 tlog.Debug(tag, $"WindowGetCurrentOrientation START");
166 myWin.GetCurrentOrientation();
170 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
172 Assert.Fail("Caught Exception" + e.ToString());
174 tlog.Debug(tag, $"WindowGetCurrentOrientation END (OK)");
175 Assert.Pass("WindowGetCurrentOrientation");
180 [Description("Window SetAvailableOrientations")]
181 [Property("SPEC", "Tizen.NUI.Window.SetAvailableOrientations M")]
182 [Property("SPEC_URL", "-")]
183 [Property("CRITERIA", "MR")]
184 public void WindowSetAvailableOrientations()
186 tlog.Debug(tag, $"WindowSetAvailableOrientations START");
189 List<Window.WindowOrientation> l1 = new List<Window.WindowOrientation>();
190 Window.WindowOrientation o1 = new Window.WindowOrientation();
193 myWin.SetAvailableOrientations(l1);
197 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
199 Assert.Fail("Caught Exception" + e.ToString());
201 tlog.Debug(tag, $"WindowSetAvailableOrientations END (OK)");
202 Assert.Pass("WindowSetAvailableOrientations");
207 [Description("Window GetNativeId")]
208 [Property("SPEC", "Tizen.NUI.Window.GetNativeId M")]
209 [Property("SPEC_URL", "-")]
210 [Property("CRITERIA", "MR")]
211 public void WindowGetNativeId()
213 tlog.Debug(tag, $"WindowGetNativeId START");
220 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
222 Assert.Fail("Caught Exception" + e.ToString());
224 tlog.Debug(tag, $"WindowGetNativeId END (OK)");
225 Assert.Pass("WindowGetNativeId");
230 [Description("Window GetNativeHandle")]
231 [Property("SPEC", "Tizen.NUI.Window.GetNativeHandle M")]
232 [Property("SPEC_URL", "-")]
233 [Property("CRITERIA", "MR")]
234 public void WindowGetNativeHandle()
236 tlog.Debug(tag, $"WindowGetNativeHandle START");
239 myWin.GetNativeHandle();
243 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
245 Assert.Fail("Caught Exception" + e.ToString());
247 tlog.Debug(tag, $"WindowGetNativeHandle END (OK)");
248 Assert.Pass("WindowGetNativeHandle");
253 [Description("Window Add")]
254 [Property("SPEC", "Tizen.NUI.Window.Add M")]
255 [Property("SPEC_URL", "-")]
256 [Property("CRITERIA", "MR")]
257 public void WindowAdd()
259 tlog.Debug(tag, $"WindowAdd START");
267 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
269 Assert.Fail("Caught Exception" + e.ToString());
271 tlog.Debug(tag, $"WindowAdd END (OK)");
272 Assert.Pass("WindowAdd");
277 [Description("Window Remove")]
278 [Property("SPEC", "Tizen.NUI.Window.Remove M")]
279 [Property("SPEC_URL", "-")]
280 [Property("CRITERIA", "MR")]
281 public void WindowRemove()
283 tlog.Debug(tag, $"WindowRemove START");
291 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
293 Assert.Fail("Caught Exception" + e.ToString());
295 tlog.Debug(tag, $"WindowRemove END (OK)");
296 Assert.Pass("WindowRemove");
301 [Description("Window GetRenderTaskList")]
302 [Property("SPEC", "Tizen.NUI.Window.GetRenderTaskList M")]
303 [Property("SPEC_URL", "-")]
304 [Property("CRITERIA", "MR")]
305 public void WindowGetRenderTaskList()
307 tlog.Debug(tag, $"WindowGetRenderTaskList START");
310 myWin.GetRenderTaskList();
314 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
316 Assert.Fail("Caught Exception" + e.ToString());
318 tlog.Debug(tag, $"WindowGetRenderTaskList END (OK)");
319 Assert.Pass("WindowGetRenderTaskList");
324 [Description("Window GetObjectRegistry")]
325 [Property("SPEC", "Tizen.NUI.Window.GetObjectRegistry M")]
326 [Property("SPEC_URL", "-")]
327 [Property("CRITERIA", "MR")]
328 public void WindowGetObjectRegistry()
330 tlog.Debug(tag, $"WindowGetObjectRegistry START");
333 myWin.GetObjectRegistry();
337 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
339 Assert.Fail("Caught Exception" + e.ToString());
341 tlog.Debug(tag, $"WindowGetObjectRegistry END (OK)");
342 Assert.Pass("WindowGetObjectRegistry");
347 [Description("Window SetWindowSize")]
348 [Property("SPEC", "Tizen.NUI.Window.SetWindowSize M")]
349 [Property("SPEC_URL", "-")]
350 [Property("CRITERIA", "MR")]
351 public void WindowSetWindowSize()
353 tlog.Debug(tag, $"WindowSetWindowSize START");
357 myWin.SetWindowSize(s1);
361 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
363 Assert.Fail("Caught Exception" + e.ToString());
365 tlog.Debug(tag, $"WindowSetWindowSize END (OK)");
366 Assert.Pass("WindowSetWindowSize");
371 [Description("Window SetPosition")]
372 [Property("SPEC", "Tizen.NUI.Window.SetPosition M")]
373 [Property("SPEC_URL", "-")]
374 [Property("CRITERIA", "MR")]
375 public void WindowSetPosition()
377 tlog.Debug(tag, $"WindowSetPosition START");
380 Position2D p1 = null;
381 myWin.SetPosition(p1);
385 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
387 Assert.Fail("Caught Exception" + e.ToString());
389 tlog.Debug(tag, $"WindowSetPosition END (OK)");
390 Assert.Pass("WindowSetPosition");
395 [Description("Window SetPositionSize")]
396 [Property("SPEC", "Tizen.NUI.Window.SetPositionSize M")]
397 [Property("SPEC_URL", "-")]
398 [Property("CRITERIA", "MR")]
399 public void WindowSetPositionSize()
401 tlog.Debug(tag, $"WindowSetPositionSize START");
404 Rectangle r1 = new Rectangle(0, 0, 20, 20);
405 myWin.SetPositionSize(r1);
409 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
411 Assert.Fail("Caught Exception" + e.ToString());
413 tlog.Debug(tag, $"WindowSetPositionSize END (OK)");
414 Assert.Pass("WindowSetPositionSize");
419 [Description("Window AddFrameUpdateCallback")]
420 [Property("SPEC", "Tizen.NUI.Window.AddFrameUpdateCallback M")]
421 [Property("SPEC_URL", "-")]
422 [Property("CRITERIA", "MR")]
423 public void WindowAddFrameUpdateCallback()
425 tlog.Debug(tag, $"WindowAddFrameUpdateCallback START");
428 FrameUpdateCallbackInterface f1 = new FrameUpdateCallbackInterface();
429 myWin.AddFrameUpdateCallback(f1);
433 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
435 Assert.Fail("Caught Exception" + e.ToString());
437 tlog.Debug(tag, $"WindowAddFrameUpdateCallback END (OK)");
438 Assert.Pass("WindowAddFrameUpdateCallback");
443 [Description("Window RemoveFrameUpdateCallback")]
444 [Property("SPEC", "Tizen.NUI.Window.RemoveFrameUpdateCallback M")]
445 [Property("SPEC_URL", "-")]
446 [Property("CRITERIA", "MR")]
447 public void WindowRemoveFrameUpdateCallback()
449 tlog.Debug(tag, $"WindowRemoveFrameUpdateCallback START");
452 FrameUpdateCallbackInterface f1 = new FrameUpdateCallbackInterface();
453 myWin.RemoveFrameUpdateCallback(f1);
457 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
459 Assert.Fail("Caught Exception" + e.ToString());
461 tlog.Debug(tag, $"WindowRemoveFrameUpdateCallback END (OK)");
462 Assert.Pass("WindowRemoveFrameUpdateCallback");
467 [Description("Window AddFrameRenderedCallback")]
468 [Property("SPEC", "Tizen.NUI.Window.AddFrameRenderedCallback M")]
469 [Property("SPEC_URL", "-")]
470 [Property("CRITERIA", "MR")]
471 public void WindowAddFrameRenderedCallback()
473 tlog.Debug(tag, $"WindowAddFrameRenderedCallback START");
476 FrameCallbackType f1 = null;
477 myWin.AddFrameRenderedCallback(f1, 1);
481 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
483 Assert.Fail("Caught Exception" + e.ToString());
485 tlog.Debug(tag, $"WindowAddFrameRenderedCallback END (OK)");
486 Assert.Pass("WindowAddFrameRenderedCallback");
491 [Description("Window AddFramePresentedCallback")]
492 [Property("SPEC", "Tizen.NUI.Window.AddFramePresentedCallback M")]
493 [Property("SPEC_URL", "-")]
494 [Property("CRITERIA", "MR")]
495 public void WindowAddFramePresentedCallback()
497 tlog.Debug(tag, $"WindowAddFramePresentedCallback START");
500 FrameCallbackType f1 = null;
501 myWin.AddFramePresentedCallback(f1, 1);
505 Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
507 Assert.Fail("Caught Exception" + e.ToString());
509 tlog.Debug(tag, $"WindowAddFramePresentedCallback END (OK)");
510 Assert.Pass("WindowAddFramePresentedCallback");