[NUI] Add public window TCs
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / public / Window / TSGLWindow.cs
1 using NUnit.Framework;
2 using System.Collections.Generic;
3
4 namespace Tizen.NUI.Devel.Tests
5 {
6     using tlog = Tizen.Log;
7
8     [TestFixture]
9     [Description("public/Window/GLWindow.cs")]
10     internal class PublicGLWindowTest
11     {
12         private const string tag = "NUITEST";
13
14         [SetUp]
15         public void Init()
16         {
17             tlog.Info(tag, "Init() is called!");
18         }
19
20         [TearDown]
21         public void Destroy()
22         {
23             tlog.Info(tag, "Destroy() is called!");
24         }
25
26         [Test]
27         [Category("P1")]
28         [Description("Create a GLWindow object.")]
29         [Property("SPEC", "Tizen.NUI.GLWindow.GLWindow C")]
30         [Property("SPEC_URL", "-")]
31         [Property("CRITERIA", "CONSTR")]
32         [Property("COVPARAM", "")]
33         public void GLWindowConstructor()
34         {
35             tlog.Debug(tag, $"GLWindowConstructor START");
36             string name = "myGLWindow";
37             Rectangle rectangle = new Rectangle(20, 20, 100, 100);
38             GLWindow a1 = new GLWindow(name, rectangle, true);
39
40             GLWindow a2 = new GLWindow();
41             GLWindow a3 = new GLWindow(GLWindow.getCPtr(a1).Handle, true);
42
43             a1.Destroy();
44             a2.Destroy();
45             a3.Destroy();
46             tlog.Debug(tag, $"GLWindowConstructor END (OK)");
47             Assert.Pass("GLWindowConstructor");
48         }
49
50         [Test]
51         [Category("P1")]
52         [Description("GLWindow WindowSize")]
53         [Property("SPEC", "Tizen.NUI.GLWindow.WindowSize A")]
54         [Property("SPEC_URL", "-")]
55         [Property("CRITERIA", "PRW")]
56         public void GLWindowWindowSize()
57         {
58             tlog.Debug(tag, $"GLWindowWindowSize START");
59             string name = "myGLWindow";
60             Rectangle rectangle = new Rectangle(20, 20, 100, 100);
61             GLWindow a1 = new GLWindow(name, rectangle, true);
62
63             Size2D b1 = a1.WindowSize;
64             a1.WindowSize = b1;
65             a1.WindowSize = null;
66
67             a1.Destroy();
68             tlog.Debug(tag, $"GLWindowWindowSize END (OK)");
69             Assert.Pass("GLWindowWindowSize");
70         }
71
72         [Test]
73         [Category("P1")]
74         [Description("GLWindow SetEglConfig")]
75         [Property("SPEC", "Tizen.NUI.GLWindow.SetEglConfig M")]
76         [Property("SPEC_URL", "-")]
77         [Property("CRITERIA", "MR")]
78         public void GLWindowSetEglConfig()
79         {
80             tlog.Debug(tag, $"GLWindowSetEglConfig START");
81             string name = "myGLWindow";
82             Rectangle rectangle = new Rectangle(20, 20, 100, 100);
83             GLWindow a1 = new GLWindow(name, rectangle, true);
84
85             GLWindow.GLESVersion b1 = new GLWindow.GLESVersion();
86             a1.SetEglConfig(true, true, 10, b1);
87
88             a1.Destroy();
89             tlog.Debug(tag, $"GLWindowSetEglConfig END (OK)");
90             Assert.Pass("GLWindowSetEglConfig");
91         }
92
93         [Test]
94         [Category("P1")]
95         [Description("GLWindow Show")]
96         [Property("SPEC", "Tizen.NUI.GLWindow.Show M")]
97         [Property("SPEC_URL", "-")]
98         [Property("CRITERIA", "MR")]
99         public void GLWindowShow()
100         {
101             tlog.Debug(tag, $"GLWindowShow START");
102             string name = "myGLWindow";
103             Rectangle rectangle = new Rectangle(20, 20, 100, 100);
104             GLWindow a1 = new GLWindow(name, rectangle, true);
105
106             a1.Show();
107             a1.Destroy();
108             tlog.Debug(tag, $"GLWindowShow END (OK)");
109             Assert.Pass("GLWindowShow");
110         }
111
112         [Test]
113         [Category("P1")]
114         [Description("GLWindow Hide")]
115         [Property("SPEC", "Tizen.NUI.GLWindow.Hide M")]
116         [Property("SPEC_URL", "-")]
117         [Property("CRITERIA", "MR")]
118         public void GLWindowHide()
119         {
120             tlog.Debug(tag, $"GLWindowHide START");
121             string name = "myGLWindow";
122             Rectangle rectangle = new Rectangle(20, 20, 100, 100);
123             GLWindow a1 = new GLWindow(name, rectangle, true);
124
125             a1.Hide();
126
127             tlog.Debug(tag, $"GLWindowHide END (OK)");
128             Assert.Pass("GLWindowHide");
129         }
130
131
132         [Test]
133         [Category("P1")]
134         [Description("GLWindow Raise")]
135         [Property("SPEC", "Tizen.NUI.GLWindow.Raise M")]
136         [Property("SPEC_URL", "-")]
137         [Property("CRITERIA", "MR")]
138         public void GLWindowRaise()
139         {
140             tlog.Debug(tag, $"GLWindowRaise START");
141             string name = "myGLWindow";
142             Rectangle rectangle = new Rectangle(20, 20, 100, 100);
143             GLWindow a1 = new GLWindow(name, rectangle, true);
144
145             a1.Raise();
146
147             tlog.Debug(tag, $"GLWindowRaise END (OK)");
148             Assert.Pass("GLWindowRaise");
149         }
150
151         [Test]
152         [Category("P1")]
153         [Description("GLWindow Lower")]
154         [Property("SPEC", "Tizen.NUI.GLWindow.Lower M")]
155         [Property("SPEC_URL", "-")]
156         [Property("CRITERIA", "MR")]
157         public void GLWindowLower()
158         {
159             tlog.Debug(tag, $"GLWindowLower START");
160             string name = "myGLWindow";
161             Rectangle rectangle = new Rectangle(20, 20, 100, 100);
162             GLWindow a1 = new GLWindow(name, rectangle, true);
163
164             a1.Lower();
165
166             tlog.Debug(tag, $"GLWindowLower END (OK)");
167             Assert.Pass("GLWindowLower");
168         }
169
170         [Test]
171         [Category("P1")]
172         [Description("GLWindow Activate")]
173         [Property("SPEC", "Tizen.NUI.GLWindow.Activate M")]
174         [Property("SPEC_URL", "-")]
175         [Property("CRITERIA", "MR")]
176         public void GLWindowActivate()
177         {
178             tlog.Debug(tag, $"GLWindowActivate START");
179             string name = "myGLWindow";
180             Rectangle rectangle = new Rectangle(20, 20, 100, 100);
181             GLWindow a1 = new GLWindow(name, rectangle, true);
182
183             a1.Activate();
184
185             tlog.Debug(tag, $"GLWindowActivate END (OK)");
186             Assert.Pass("GLWindowActivate");
187         }
188
189         [Test]
190         [Category("P1")]
191         [Description("GLWindow WindowPositionSize")]
192         [Property("SPEC", "Tizen.NUI.GLWindow.WindowPositionSize A")]
193         [Property("SPEC_URL", "-")]
194         [Property("CRITERIA", "PRW")]
195         public void GLWindowWindowPositionSize()
196         {
197             tlog.Debug(tag, $"GLWindowWindowPositionSize START");
198             string name = "myGLWindow";
199             Rectangle rectangle = new Rectangle(20, 20, 100, 100);
200             GLWindow a1 = new GLWindow(name, rectangle, true);
201
202             Rectangle b1 = a1.WindowPositionSize;
203             a1.WindowPositionSize = b1;
204
205             tlog.Debug(tag, $"GLWindowWindowPositionSize END (OK)");
206             Assert.Pass("GLWindowWindowPositionSize");
207         }
208
209         [Test]
210         [Category("P1")]
211         [Description("GLWindow GetSupportedAuxiliaryHintCount")]
212         [Property("SPEC", "Tizen.NUI.GLWindow.GetSupportedAuxiliaryHintCount M")]
213         [Property("SPEC_URL", "-")]
214         [Property("CRITERIA", "MR")]
215         public void GLWindowGetSupportedAuxiliaryHintCount()
216         {
217             tlog.Debug(tag, $"GLWindowGetSupportedAuxiliaryHintCount START");
218             string name = "myGLWindow";
219             Rectangle rectangle = new Rectangle(20, 20, 100, 100);
220             GLWindow a1 = new GLWindow(name, rectangle, true);
221
222             a1.GetSupportedAuxiliaryHintCount();
223
224             tlog.Debug(tag, $"GLWindowGetSupportedAuxiliaryHintCount END (OK)");
225             Assert.Pass("GLWindowGetSupportedAuxiliaryHintCount");
226         }
227
228         [Test]
229         [Category("P1")]
230         [Description("GLWindow GetSupportedAuxiliaryHint")]
231         [Property("SPEC", "Tizen.NUI.GLWindow.GetSupportedAuxiliaryHint M")]
232         [Property("SPEC_URL", "-")]
233         [Property("CRITERIA", "MR")]
234         public void GLWindowGetSupportedAuxiliaryHint()
235         {
236             tlog.Debug(tag, $"GLWindowGetSupportedAuxiliaryHint START");
237             string name = "myGLWindow";
238             Rectangle rectangle = new Rectangle(20, 20, 100, 100);
239             GLWindow a1 = new GLWindow(name, rectangle, true);
240
241             a1.GetSupportedAuxiliaryHint(1);
242
243             tlog.Debug(tag, $"GLWindowGetSupportedAuxiliaryHint END (OK)");
244             Assert.Pass("GLWindowGetSupportedAuxiliaryHint");
245         }
246
247         [Test]
248         [Category("P1")]
249         [Description("GLWindow AddAuxiliaryHint")]
250         [Property("SPEC", "Tizen.NUI.GLWindow.AddAuxiliaryHint M")]
251         [Property("SPEC_URL", "-")]
252         [Property("CRITERIA", "MR")]
253         public void GLWindowAddAuxiliaryHint()
254         {
255             tlog.Debug(tag, $"GLWindowAddAuxiliaryHint START");
256             string name = "myGLWindow";
257             Rectangle rectangle = new Rectangle(20, 20, 100, 100);
258             GLWindow a1 = new GLWindow(name, rectangle, true);
259
260             a1.AddAuxiliaryHint("myHint", "myValue");
261
262             tlog.Debug(tag, $"GLWindowAddAuxiliaryHint END (OK)");
263             Assert.Pass("GLWindowAddAuxiliaryHint");
264         }
265
266         [Test]
267         [Category("P1")]
268         [Description("GLWindow RemoveAuxiliaryHint")]
269         [Property("SPEC", "Tizen.NUI.GLWindow.RemoveAuxiliaryHint M")]
270         [Property("SPEC_URL", "-")]
271         [Property("CRITERIA", "MR")]
272         public void GLWindowRemoveAuxiliaryHint()
273         {
274             tlog.Debug(tag, $"GLWindowRemoveAuxiliaryHint START");
275             string name = "myGLWindow";
276             Rectangle rectangle = new Rectangle(20, 20, 100, 100);
277             GLWindow a1 = new GLWindow(name, rectangle, true);
278
279             uint pos = a1.AddAuxiliaryHint("myHint", "myValue");
280             a1.RemoveAuxiliaryHint(pos);
281
282             tlog.Debug(tag, $"GLWindowRemoveAuxiliaryHint END (OK)");
283             Assert.Pass("GLWindowRemoveAuxiliaryHint");
284         }
285
286         [Test]
287         [Category("P1")]
288         [Description("GLWindow SetAuxiliaryHintValue")]
289         [Property("SPEC", "Tizen.NUI.GLWindow.SetAuxiliaryHintValue M")]
290         [Property("SPEC_URL", "-")]
291         [Property("CRITERIA", "MR")]
292         public void GLWindowSetAuxiliaryHintValue()
293         {
294             tlog.Debug(tag, $"GLWindowSetAuxiliaryHintValue START");
295             string name = "myGLWindow";
296             Rectangle rectangle = new Rectangle(20, 20, 100, 100);
297             GLWindow a1 = new GLWindow(name, rectangle, true);
298
299             uint pos = a1.AddAuxiliaryHint("myHint", "myValue");
300             a1.SetAuxiliaryHintValue(pos, "myValue");
301
302
303             tlog.Debug(tag, $"GLWindowSetAuxiliaryHintValue END (OK)");
304             Assert.Pass("GLWindowSetAuxiliaryHintValue");
305         }
306
307         [Test]
308         [Category("P1")]
309         [Description("GLWindow GetAuxiliaryHintValue")]
310         [Property("SPEC", "Tizen.NUI.GLWindow.GetAuxiliaryHintValue M")]
311         [Property("SPEC_URL", "-")]
312         [Property("CRITERIA", "MR")]
313         public void GLWindowGetAuxiliaryHintValue()
314         {
315             tlog.Debug(tag, $"GLWindowGetAuxiliaryHintValue START");
316             string name = "myGLWindow";
317             Rectangle rectangle = new Rectangle(20, 20, 100, 100);
318             GLWindow a1 = new GLWindow(name, rectangle, true);
319
320             uint pos = a1.AddAuxiliaryHint("myHint", "myValue");
321             a1.GetAuxiliaryHintValue(pos);
322
323
324             tlog.Debug(tag, $"GLWindowGetAuxiliaryHintValue END (OK)");
325             Assert.Pass("GLWindowGetAuxiliaryHintValue");
326         }
327
328         [Test]
329         [Category("P1")]
330         [Description("GLWindow GetAuxiliaryHintId")]
331         [Property("SPEC", "Tizen.NUI.GLWindow.GetAuxiliaryHintId M")]
332         [Property("SPEC_URL", "-")]
333         [Property("CRITERIA", "MR")]
334         public void GLWindowGetAuxiliaryHintId()
335         {
336             tlog.Debug(tag, $"GLWindowGetAuxiliaryHintId START");
337             string name = "myGLWindow";
338             Rectangle rectangle = new Rectangle(20, 20, 100, 100);
339             GLWindow a1 = new GLWindow(name, rectangle, true);
340
341             uint pos = a1.AddAuxiliaryHint("myHint", "myValue");
342             a1.GetAuxiliaryHintId("myHint");
343
344             tlog.Debug(tag, $"GLWindowGetAuxiliaryHintId END (OK)");
345             Assert.Pass("GLWindowGetAuxiliaryHintId");
346         }
347
348         [Test]
349         [Category("P1")]
350         [Description("GLWindow SetInputRegion")]
351         [Property("SPEC", "Tizen.NUI.GLWindow.SetInputRegion M")]
352         [Property("SPEC_URL", "-")]
353         [Property("CRITERIA", "MR")]
354         public void GLWindowSetInputRegion()
355         {
356             tlog.Debug(tag, $"GLWindowSetInputRegion START");
357             string name = "myGLWindow";
358             Rectangle rectangle = new Rectangle(20, 20, 100, 100);
359             GLWindow a1 = new GLWindow(name, rectangle, true);
360
361             a1.SetInputRegion(rectangle);
362             tlog.Debug(tag, $"GLWindowGetAuxiliaryHintId END (OK)");
363             Assert.Pass("GLWindowGetAuxiliaryHintId");
364         }
365
366         [Test]
367         [Category("P1")]
368         [Description("GLWindow SetOpaqueState")]
369         [Property("SPEC", "Tizen.NUI.GLWindow.SetOpaqueState M")]
370         [Property("SPEC_URL", "-")]
371         [Property("CRITERIA", "MR")]
372         public void GLWindowSetOpaqueState()
373         {
374             tlog.Debug(tag, $"GLWindowSetOpaqueState START");
375             string name = "myGLWindow";
376             Rectangle rectangle = new Rectangle(20, 20, 100, 100);
377             GLWindow a1 = new GLWindow(name, rectangle, true);
378
379             a1.SetOpaqueState(true);
380             tlog.Debug(tag, $"GLWindowSetOpaqueState END (OK)");
381             Assert.Pass("GLWindowSetOpaqueState");
382         }
383
384         [Test]
385         [Category("P1")]
386         [Description("GLWindow IsOpaqueState")]
387         [Property("SPEC", "Tizen.NUI.GLWindow.IsOpaqueState M")]
388         [Property("SPEC_URL", "-")]
389         [Property("CRITERIA", "MR")]
390         public void GLWindowIsOpaqueState()
391         {
392             tlog.Debug(tag, $"GLWindowIsOpaqueState START");
393             string name = "myGLWindow";
394             Rectangle rectangle = new Rectangle(20, 20, 100, 100);
395             GLWindow a1 = new GLWindow(name, rectangle, true);
396
397             a1.IsOpaqueState();
398             tlog.Debug(tag, $"GLWindowIsOpaqueState END (OK)");
399             Assert.Pass("GLWindowIsOpaqueState");
400         }
401
402         [Test]
403         [Category("P1")]
404         [Description("GLWindow SetPreferredOrientation")]
405         [Property("SPEC", "Tizen.NUI.GLWindow.SetPreferredOrientation M")]
406         [Property("SPEC_URL", "-")]
407         [Property("CRITERIA", "MR")]
408         public void GLWindowSetPreferredOrientation()
409         {
410             tlog.Debug(tag, $"GLWindowSetPreferredOrientation START");
411             string name = "myGLWindow";
412             Rectangle rectangle = new Rectangle(20, 20, 100, 100);
413             GLWindow a1 = new GLWindow(name, rectangle, true);
414
415             GLWindow.GLWindowOrientation o1 = new GLWindow.GLWindowOrientation();
416             a1.SetPreferredOrientation(o1);
417             tlog.Debug(tag, $"GLWindowSetPreferredOrientation END (OK)");
418             Assert.Pass("GLWindowSetPreferredOrientation");
419         }
420
421         [Test]
422         [Category("P1")]
423         [Description("GLWindow GetCurrentOrientation")]
424         [Property("SPEC", "Tizen.NUI.GLWindow.GetCurrentOrientation M")]
425         [Property("SPEC_URL", "-")]
426         [Property("CRITERIA", "MR")]
427         public void GLWindowGetCurrentOrientation()
428         {
429             tlog.Debug(tag, $"GLWindowGetCurrentOrientation START");
430             string name = "myGLWindow";
431             Rectangle rectangle = new Rectangle(20, 20, 100, 100);
432             GLWindow a1 = new GLWindow(name, rectangle, true);
433
434
435             a1.GetCurrentOrientation();
436             tlog.Debug(tag, $"GLWindowGetCurrentOrientation END (OK)");
437             Assert.Pass("GLWindowGetCurrentOrientation");
438         }
439
440         [Test]
441         [Category("P1")]
442         [Description("GLWindow SetAvailableOrientations")]
443         [Property("SPEC", "Tizen.NUI.GLWindow.SetAvailableOrientations M")]
444         [Property("SPEC_URL", "-")]
445         [Property("CRITERIA", "MR")]
446         public void GLWindowSetAvailableOrientations()
447         {
448             tlog.Debug(tag, $"GLWindowSetAvailableOrientations START");
449             string name = "myGLWindow";
450             Rectangle rectangle = new Rectangle(20, 20, 100, 100);
451             GLWindow a1 = new GLWindow(name, rectangle, true);
452
453             GLWindow.GLWindowOrientation o1 = new GLWindow.GLWindowOrientation();
454             List<GLWindow.GLWindowOrientation> l1 = new List<GLWindow.GLWindowOrientation>
455             {
456                 o1
457             };
458
459             a1.SetAvailableOrientations(l1);
460
461             tlog.Debug(tag, $"GLWindowSetAvailableOrientations END (OK)");
462             Assert.Pass("GLWindowSetAvailableOrientations");
463         }
464
465         [Test]
466         [Category("P1")]
467         [Description("GLWindow RenderOnce")]
468         [Property("SPEC", "Tizen.NUI.GLWindow.RenderOnce M")]
469         [Property("SPEC_URL", "-")]
470         [Property("CRITERIA", "MR")]
471         public void GLWindowRenderOnce()
472         {
473             tlog.Debug(tag, $"GLWindowRenderOnce START");
474             string name = "myGLWindow";
475             Rectangle rectangle = new Rectangle(20, 20, 100, 100);
476             GLWindow a1 = new GLWindow(name, rectangle, true);
477
478             a1.RenderOnce();
479             tlog.Debug(tag, $"GLWindowRenderOnce END (OK)");
480             Assert.Pass("GLWindowRenderOnce");
481         }
482
483         [Test]
484         [Category("P1")]
485         [Description("GLWindow RegisterGlCallback")]
486         [Property("SPEC", "Tizen.NUI.GLWindow.RegisterGlCallback M")]
487         [Property("SPEC_URL", "-")]
488         [Property("CRITERIA", "MR")]
489         public void GLWindowRegisterGlCallback()
490         {
491             tlog.Debug(tag, $"GLWindowRegisterGlCallback START");
492             string name = "myGLWindow";
493             Rectangle rectangle = new Rectangle(20, 20, 100, 100);
494             GLWindow a1 = new GLWindow(name, rectangle, true);
495
496
497             a1.RegisterGlCallback(b1, c1, d1);
498             tlog.Debug(tag, $"GLWindowRegisterGlCallback END (OK)");
499             Assert.Pass("GLWindowRegisterGlCallback");
500         }
501
502         public void b1() { }
503         public int c1() { return 0; }
504         public void d1() { }
505
506         [Test]
507         [Category("P1")]
508         [Description("GLWindow Destroy")]
509         [Property("SPEC", "Tizen.NUI.GLWindow.Destroy M")]
510         [Property("SPEC_URL", "-")]
511         [Property("CRITERIA", "MR")]
512         public void GLWindowDestroy()
513         {
514             tlog.Debug(tag, $"GLWindowDestroy START");
515             string name = "myGLWindow";
516             Rectangle rectangle = new Rectangle(20, 20, 100, 100);
517             GLWindow a1 = new GLWindow(name, rectangle, true);
518
519             a1.Destroy();
520             tlog.Debug(tag, $"GLWindowDestroy END (OK)");
521             Assert.Pass("GLWindowDestroy");
522         }
523     }
524 }
525