1 using NUnit.Framework;
3 using System.Collections.Generic;
5 namespace Tizen.NUI.Devel.Tests
7 using tlog = Tizen.Log;
10 [Description("public/Window/GLWindow.cs")]
11 internal class PublicGLWindowTest
13 private const string tag = "NUITEST";
18 tlog.Info(tag, "Init() is called!");
24 tlog.Info(tag, "Destroy() is called!");
29 [Description("GLWindow constructor.")]
30 [Property("SPEC", "Tizen.NUI.GLWindow.GLWindow C")]
31 [Property("SPEC_URL", "-")]
32 [Property("CRITERIA", "CONSTR")]
33 [Property("COVPARAM", "")]
34 public void GLWindowConstructor()
36 tlog.Debug(tag, $"GLWindowConstructor START");
38 var testingTarget = new GLWindow();
39 Assert.IsNotNull(testingTarget, "should be not null");
40 Assert.IsInstanceOf<GLWindow>(testingTarget, "should be an instance of testing target class!");
42 testingTarget.Destroy();
43 tlog.Debug(tag, $"GLWindowConstructor END (OK)");
48 [Description("GLWindow constructor. With name.")]
49 [Property("SPEC", "Tizen.NUI.GLWindow.GLWindow C")]
50 [Property("SPEC_URL", "-")]
51 [Property("CRITERIA", "CONSTR")]
52 [Property("COVPARAM", "")]
53 public void GLWindowConstructorWithName()
55 tlog.Debug(tag, $"GLWindowConstructorWithName START");
57 string name = "myGLWindow";
58 Rectangle rectangle = new Rectangle(20, 20, 100, 100);
59 GLWindow a1 = new GLWindow(name, rectangle, true);
62 tlog.Debug(tag, $"GLWindowConstructorWithName END (OK)");
67 [Description("GLWindow constructor. With GLWindow.")]
68 [Property("SPEC", "Tizen.NUI.GLWindow.GLWindow C")]
69 [Property("SPEC_URL", "-")]
70 [Property("CRITERIA", "CONSTR")]
71 [Property("COVPARAM", "")]
72 public void GLWindowConstructorWithGLWindow()
74 tlog.Debug(tag, $"GLWindowConstructorWithGLWindow START");
76 using (GLWindow glwindow = new GLWindow())
78 var testingTarget = new GLWindow(glwindow.SwigCPtr.Handle, false);
79 Assert.IsNotNull(testingTarget, "should be not null");
80 Assert.IsInstanceOf<GLWindow>(testingTarget, "should be an instance of testing target class!");
82 testingTarget.Destroy();
85 tlog.Debug(tag, $"GLWindowConstructorWithGLWindow END (OK)");
90 [Description("GLWindow WindowSize")]
91 [Property("SPEC", "Tizen.NUI.GLWindow.WindowSize A")]
92 [Property("SPEC_URL", "-")]
93 [Property("CRITERIA", "PRW")]
94 public void GLWindowWindowSize()
96 tlog.Debug(tag, $"GLWindowWindowSize START");
98 var testingTarget = new GLWindow();
99 Assert.IsNotNull(testingTarget, "Can't create success object GLWindow");
100 Assert.IsInstanceOf<GLWindow>(testingTarget, "Should be an instance of GLWindow type.");
102 testingTarget.WindowSize = new Size2D(50, 30);
103 Assert.AreEqual(50, testingTarget.WindowSize.Width, "Should be equal!");
104 Assert.AreEqual(30, testingTarget.WindowSize.Height, "Should be equal!");
106 testingTarget.Destroy();
107 tlog.Debug(tag, $"GLWindowWindowSize END (OK)");
112 //[Description("GLWindow SetEglConfig")]
113 //[Property("SPEC", "Tizen.NUI.GLWindow.SetEglConfig M")]
114 //[Property("SPEC_URL", "-")]
115 //[Property("CRITERIA", "MR")]
116 //public void GLWindowSetEglConfig()
118 // tlog.Debug(tag, $"GLWindowSetEglConfig START");
120 // var testingTarget = new GLWindow();
121 // Assert.IsNotNull(testingTarget, "Can't create success object GLWindow");
122 // Assert.IsInstanceOf<GLWindow>(testingTarget, "Should be an instance of GLWindow type.");
126 // testingTarget.SetEglConfig(true, true, 10, GLESVersion.Version20);
128 // catch (Exception e)
130 // tlog.Debug(tag, e.Message.ToString());
131 // Assert.Fail("Caught Exception: Failed!");
134 // testingTarget.Destroy();
135 // tlog.Debug(tag, $"GLWindowSetEglConfig END (OK)");
140 [Description("GLWindow Show")]
141 [Property("SPEC", "Tizen.NUI.GLWindow.Show M")]
142 [Property("SPEC_URL", "-")]
143 [Property("CRITERIA", "MR")]
144 public void GLWindowShow()
146 tlog.Debug(tag, $"GLWindowShow START");
147 string name = "myGLWindow";
148 Rectangle rectangle = new Rectangle(20, 20, 100, 100);
149 GLWindow a1 = new GLWindow(name, rectangle, true);
153 tlog.Debug(tag, $"GLWindowShow END (OK)");
158 [Description("GLWindow Hide")]
159 [Property("SPEC", "Tizen.NUI.GLWindow.Hide M")]
160 [Property("SPEC_URL", "-")]
161 [Property("CRITERIA", "MR")]
162 public void GLWindowHide()
164 tlog.Debug(tag, $"GLWindowHide START");
165 string name = "myGLWindow";
166 Rectangle rectangle = new Rectangle(20, 20, 100, 100);
167 GLWindow a1 = new GLWindow(name, rectangle, true);
172 tlog.Debug(tag, $"GLWindowHide END (OK)");
178 [Description("GLWindow Raise")]
179 [Property("SPEC", "Tizen.NUI.GLWindow.Raise M")]
180 [Property("SPEC_URL", "-")]
181 [Property("CRITERIA", "MR")]
182 public void GLWindowRaise()
184 tlog.Debug(tag, $"GLWindowRaise START");
185 string name = "myGLWindow";
186 Rectangle rectangle = new Rectangle(20, 20, 100, 100);
187 GLWindow a1 = new GLWindow(name, rectangle, true);
192 tlog.Debug(tag, $"GLWindowRaise END (OK)");
197 [Description("GLWindow Lower")]
198 [Property("SPEC", "Tizen.NUI.GLWindow.Lower M")]
199 [Property("SPEC_URL", "-")]
200 [Property("CRITERIA", "MR")]
201 public void GLWindowLower()
203 tlog.Debug(tag, $"GLWindowLower START");
204 string name = "myGLWindow";
205 Rectangle rectangle = new Rectangle(20, 20, 100, 100);
206 GLWindow a1 = new GLWindow(name, rectangle, true);
211 tlog.Debug(tag, $"GLWindowLower END (OK)");
216 [Description("GLWindow Activate")]
217 [Property("SPEC", "Tizen.NUI.GLWindow.Activate M")]
218 [Property("SPEC_URL", "-")]
219 [Property("CRITERIA", "MR")]
220 public void GLWindowActivate()
222 tlog.Debug(tag, $"GLWindowActivate START");
223 string name = "myGLWindow";
224 Rectangle rectangle = new Rectangle(20, 20, 100, 100);
225 GLWindow a1 = new GLWindow(name, rectangle, true);
230 tlog.Debug(tag, $"GLWindowActivate END (OK)");
235 [Description("GLWindow WindowPositionSize")]
236 [Property("SPEC", "Tizen.NUI.GLWindow.WindowPositionSize A")]
237 [Property("SPEC_URL", "-")]
238 [Property("CRITERIA", "PRW")]
239 public void GLWindowWindowPositionSize()
241 tlog.Debug(tag, $"GLWindowWindowPositionSize START");
242 string name = "myGLWindow";
243 Rectangle rectangle = new Rectangle(20, 20, 100, 100);
244 GLWindow a1 = new GLWindow(name, rectangle, true);
246 a1.WindowPositionSize = new Rectangle(30, 40, 50, 60);
247 Assert.AreEqual(30, a1.WindowPositionSize.X, "Should be equal!");
248 Assert.AreEqual(40, a1.WindowPositionSize.Y, "Should be equal!");
249 Assert.AreEqual(50, a1.WindowPositionSize.Width, "Should be equal!");
250 Assert.AreEqual(60, a1.WindowPositionSize.Height, "Should be equal!");
253 tlog.Debug(tag, $"GLWindowWindowPositionSize END (OK)");
258 [Description("GLWindow GetSupportedAuxiliaryHintCount")]
259 [Property("SPEC", "Tizen.NUI.GLWindow.GetSupportedAuxiliaryHintCount M")]
260 [Property("SPEC_URL", "-")]
261 [Property("CRITERIA", "MR")]
262 public void GLWindowGetSupportedAuxiliaryHintCount()
264 tlog.Debug(tag, $"GLWindowGetSupportedAuxiliaryHintCount START");
265 string name = "myGLWindow";
266 Rectangle rectangle = new Rectangle(20, 20, 100, 100);
267 GLWindow a1 = new GLWindow(name, rectangle, true);
269 var result = a1.GetSupportedAuxiliaryHintCount();
270 tlog.Debug(tag, "SupportedAuxiliaryHintCount : " + result);
273 tlog.Debug(tag, $"GLWindowGetSupportedAuxiliaryHintCount END (OK)");
278 [Description("GLWindow GetSupportedAuxiliaryHint")]
279 [Property("SPEC", "Tizen.NUI.GLWindow.GetSupportedAuxiliaryHint M")]
280 [Property("SPEC_URL", "-")]
281 [Property("CRITERIA", "MR")]
282 public void GLWindowGetSupportedAuxiliaryHint()
284 tlog.Debug(tag, $"GLWindowGetSupportedAuxiliaryHint START");
285 string name = "myGLWindow";
286 Rectangle rectangle = new Rectangle(20, 20, 100, 100);
287 GLWindow a1 = new GLWindow(name, rectangle, true);
289 var result = a1.GetSupportedAuxiliaryHint(1);
290 tlog.Debug(tag, "GetSupportedAuxiliaryHint : " + result);
293 tlog.Debug(tag, $"GLWindowGetSupportedAuxiliaryHint END (OK)");
298 [Description("GLWindow AddAuxiliaryHint")]
299 [Property("SPEC", "Tizen.NUI.GLWindow.AddAuxiliaryHint M")]
300 [Property("SPEC_URL", "-")]
301 [Property("CRITERIA", "MR")]
302 public void GLWindowAddAuxiliaryHint()
304 tlog.Debug(tag, $"GLWindowAddAuxiliaryHint START");
305 string name = "myGLWindow";
306 Rectangle rectangle = new Rectangle(20, 20, 100, 100);
307 GLWindow a1 = new GLWindow(name, rectangle, true);
309 a1.AddAuxiliaryHint("myHint", "myValue");
312 tlog.Debug(tag, $"GLWindowAddAuxiliaryHint END (OK)");
317 [Description("GLWindow RemoveAuxiliaryHint")]
318 [Property("SPEC", "Tizen.NUI.GLWindow.RemoveAuxiliaryHint M")]
319 [Property("SPEC_URL", "-")]
320 [Property("CRITERIA", "MR")]
321 public void GLWindowRemoveAuxiliaryHint()
323 tlog.Debug(tag, $"GLWindowRemoveAuxiliaryHint START");
324 string name = "myGLWindow";
325 Rectangle rectangle = new Rectangle(20, 20, 100, 100);
326 GLWindow a1 = new GLWindow(name, rectangle, true);
328 uint pos = a1.AddAuxiliaryHint("myHint", "myValue");
329 a1.RemoveAuxiliaryHint(pos);
332 tlog.Debug(tag, $"GLWindowRemoveAuxiliaryHint END (OK)");
337 [Description("GLWindow SetAuxiliaryHintValue")]
338 [Property("SPEC", "Tizen.NUI.GLWindow.SetAuxiliaryHintValue M")]
339 [Property("SPEC_URL", "-")]
340 [Property("CRITERIA", "MR")]
341 public void GLWindowSetAuxiliaryHintValue()
343 tlog.Debug(tag, $"GLWindowSetAuxiliaryHintValue START");
344 string name = "myGLWindow";
345 Rectangle rectangle = new Rectangle(20, 20, 100, 100);
346 GLWindow a1 = new GLWindow(name, rectangle, true);
348 uint pos = a1.AddAuxiliaryHint("myHint", "myValue");
349 a1.SetAuxiliaryHintValue(pos, "myValue");
352 tlog.Debug(tag, $"GLWindowSetAuxiliaryHintValue END (OK)");
357 [Description("GLWindow GetAuxiliaryHintValue")]
358 [Property("SPEC", "Tizen.NUI.GLWindow.GetAuxiliaryHintValue M")]
359 [Property("SPEC_URL", "-")]
360 [Property("CRITERIA", "MR")]
361 public void GLWindowGetAuxiliaryHintValue()
363 tlog.Debug(tag, $"GLWindowGetAuxiliaryHintValue START");
364 string name = "myGLWindow";
365 Rectangle rectangle = new Rectangle(20, 20, 100, 100);
366 GLWindow a1 = new GLWindow(name, rectangle, true);
368 uint pos = a1.AddAuxiliaryHint("myHint", "myValue");
369 a1.GetAuxiliaryHintValue(pos);
372 tlog.Debug(tag, $"GLWindowGetAuxiliaryHintValue END (OK)");
377 [Description("GLWindow GetAuxiliaryHintId")]
378 [Property("SPEC", "Tizen.NUI.GLWindow.GetAuxiliaryHintId M")]
379 [Property("SPEC_URL", "-")]
380 [Property("CRITERIA", "MR")]
381 public void GLWindowGetAuxiliaryHintId()
383 tlog.Debug(tag, $"GLWindowGetAuxiliaryHintId START");
384 string name = "myGLWindow";
385 Rectangle rectangle = new Rectangle(20, 20, 100, 100);
386 GLWindow a1 = new GLWindow(name, rectangle, true);
388 uint pos = a1.AddAuxiliaryHint("myHint", "myValue");
389 a1.GetAuxiliaryHintId("myHint");
392 tlog.Debug(tag, $"GLWindowGetAuxiliaryHintId END (OK)");
397 [Description("GLWindow SetInputRegion")]
398 [Property("SPEC", "Tizen.NUI.GLWindow.SetInputRegion M")]
399 [Property("SPEC_URL", "-")]
400 [Property("CRITERIA", "MR")]
401 public void GLWindowSetInputRegion()
403 tlog.Debug(tag, $"GLWindowSetInputRegion START");
404 string name = "myGLWindow";
405 Rectangle rectangle = new Rectangle(20, 20, 100, 100);
406 GLWindow a1 = new GLWindow(name, rectangle, true);
408 a1.SetInputRegion(rectangle);
411 tlog.Debug(tag, $"GLWindowGetAuxiliaryHintId END (OK)");
416 [Description("GLWindow SetOpaqueState")]
417 [Property("SPEC", "Tizen.NUI.GLWindow.SetOpaqueState M")]
418 [Property("SPEC_URL", "-")]
419 [Property("CRITERIA", "MR")]
420 public void GLWindowSetOpaqueState()
422 tlog.Debug(tag, $"GLWindowSetOpaqueState START");
423 string name = "myGLWindow";
424 Rectangle rectangle = new Rectangle(20, 20, 100, 100);
425 GLWindow a1 = new GLWindow(name, rectangle, true);
427 a1.SetOpaqueState(true);
430 tlog.Debug(tag, $"GLWindowSetOpaqueState END (OK)");
435 [Description("GLWindow IsOpaqueState")]
436 [Property("SPEC", "Tizen.NUI.GLWindow.IsOpaqueState M")]
437 [Property("SPEC_URL", "-")]
438 [Property("CRITERIA", "MR")]
439 public void GLWindowIsOpaqueState()
441 tlog.Debug(tag, $"GLWindowIsOpaqueState START");
442 string name = "myGLWindow";
443 Rectangle rectangle = new Rectangle(20, 20, 100, 100);
444 GLWindow a1 = new GLWindow(name, rectangle, true);
446 var result = a1.IsOpaqueState();
447 tlog.Debug(tag, "IsOpaqueState : " + result);
450 tlog.Debug(tag, $"GLWindowIsOpaqueState END (OK)");
455 [Description("GLWindow SetPreferredOrientation")]
456 [Property("SPEC", "Tizen.NUI.GLWindow.SetPreferredOrientation M")]
457 [Property("SPEC_URL", "-")]
458 [Property("CRITERIA", "MR")]
459 public void GLWindowSetPreferredOrientation()
461 tlog.Debug(tag, $"GLWindowSetPreferredOrientation START");
462 string name = "myGLWindow";
463 Rectangle rectangle = new Rectangle(20, 20, 100, 100);
464 GLWindow a1 = new GLWindow(name, rectangle, true);
466 GLWindow.GLWindowOrientation o1 = new GLWindow.GLWindowOrientation();
467 a1.SetPreferredOrientation(o1);
470 tlog.Debug(tag, $"GLWindowSetPreferredOrientation END (OK)");
475 [Description("GLWindow GetCurrentOrientation")]
476 [Property("SPEC", "Tizen.NUI.GLWindow.GetCurrentOrientation M")]
477 [Property("SPEC_URL", "-")]
478 [Property("CRITERIA", "MR")]
479 public void GLWindowGetCurrentOrientation()
481 tlog.Debug(tag, $"GLWindowGetCurrentOrientation START");
482 string name = "myGLWindow";
483 Rectangle rectangle = new Rectangle(20, 20, 100, 100);
484 GLWindow a1 = new GLWindow(name, rectangle, true);
486 var result = a1.GetCurrentOrientation();
487 tlog.Debug(tag, "CurrentOrientation : " + result);
490 tlog.Debug(tag, $"GLWindowGetCurrentOrientation END (OK)");
495 [Description("GLWindow SetAvailableOrientations")]
496 [Property("SPEC", "Tizen.NUI.GLWindow.SetAvailableOrientations M")]
497 [Property("SPEC_URL", "-")]
498 [Property("CRITERIA", "MR")]
499 public void GLWindowSetAvailableOrientations()
501 tlog.Debug(tag, $"GLWindowSetAvailableOrientations START");
502 string name = "myGLWindow";
503 Rectangle rectangle = new Rectangle(20, 20, 100, 100);
504 GLWindow a1 = new GLWindow(name, rectangle, true);
506 GLWindow.GLWindowOrientation o1 = new GLWindow.GLWindowOrientation();
507 List<GLWindow.GLWindowOrientation> l1 = new List<GLWindow.GLWindowOrientation>
512 a1.SetAvailableOrientations(l1);
515 tlog.Debug(tag, $"GLWindowSetAvailableOrientations END (OK)");
520 [Description("GLWindow RenderOnce")]
521 [Property("SPEC", "Tizen.NUI.GLWindow.RenderOnce M")]
522 [Property("SPEC_URL", "-")]
523 [Property("CRITERIA", "MR")]
524 public void GLWindowRenderOnce()
526 tlog.Debug(tag, $"GLWindowRenderOnce START");
527 string name = "myGLWindow";
528 Rectangle rectangle = new Rectangle(20, 20, 100, 100);
529 GLWindow a1 = new GLWindow(name, rectangle, true);
534 tlog.Debug(tag, $"GLWindowRenderOnce END (OK)");
539 [Description("GLWindow RegisterGlCallback")]
540 [Property("SPEC", "Tizen.NUI.GLWindow.RegisterGlCallback M")]
541 [Property("SPEC_URL", "-")]
542 [Property("CRITERIA", "MR")]
543 public void GLWindowRegisterGlCallback()
545 tlog.Debug(tag, $"GLWindowRegisterGlCallback START");
546 string name = "myGLWindow";
547 Rectangle rectangle = new Rectangle(20, 20, 100, 100);
548 GLWindow a1 = new GLWindow(name, rectangle, true);
550 a1.RegisterGlCallback(GLInit, GLRenderFrame, GLTerminate);
553 tlog.Debug(tag, $"GLWindowRegisterGlCallback END (OK)");
556 public void GLInit() { }
557 public int GLRenderFrame() { return 0; }
558 public void GLTerminate() { }