Merge remote-tracking branch 'origin/master' into tizen
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / public / Window / TSGLWindowVisibilityChangedEvent.cs
1 using global::System;
2 using NUnit.Framework;
3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
6
7 namespace Tizen.NUI.Devel.Tests
8 {
9     using tlog = Tizen.Log;
10
11     [TestFixture]
12     [Description("public/Window/GLWindowVisibilityChangedEvent")]
13     internal class PublicGLWindowVisibilityChangedEventTest
14     {
15         private const string tag = "NUITEST";
16
17         private delegate bool dummyCallback(IntPtr glWindow);
18         private bool OnDummyCallback(IntPtr data)
19         {
20             return false;
21         }
22
23         [SetUp]
24         public void Init()
25         {
26             tlog.Info(tag, "Init() is called!");
27         }
28
29         [TearDown]
30         public void Destroy()
31         {
32             tlog.Info(tag, "Destroy() is called!");
33         }
34
35         [Test]
36         [Category("P1")]
37         [Description("Create a GLWindowVisibilityChangedEvent object.")]
38         [Property("SPEC", "Tizen.NUI.GLWindowVisibilityChangedEvent.GLWindowVisibilityChangedEvent C")]
39         [Property("SPEC_URL", "-")]
40         [Property("CRITERIA", "CONSTR")]
41         [Property("COVPARAM", "")]
42         public void GLWindowVisibilityChangedEventConstructor()
43         {
44             tlog.Debug(tag, $"GLWindowVisibilityChangedEventConstructor START");
45             string name = "myGLWindow";
46             Rectangle rectangle = new Rectangle(20, 20, 100, 100);
47             GLWindow a1 = new GLWindow(name, rectangle, true);
48
49             GLWindowVisibilityChangedEvent b1 = new GLWindowVisibilityChangedEvent(a1.SwigCPtr.Handle, false);
50
51             b1.Dispose();
52             a1.Destroy();
53             tlog.Debug(tag, $"GLWindowVisibilityChangedEventConstructor END (OK)");
54             Assert.Pass("GLWindowVisibilityChangedEventConstructor");
55         }
56
57         //[Test]
58         //[Category("P1")]
59         //[Description("GLWindowVisibilityChangedEvent Empty")]
60         //[Property("SPEC", "Tizen.NUI.GLWindowVisibilityChangedEvent.Empty M")]
61         //[Property("SPEC_URL", "-")]
62         //[Property("CRITERIA", "MR")]
63         //public void GLWindowVisibilityChangedEventEmpty()
64         //{
65         //    tlog.Debug(tag, $"GLWindowVisibilityChangedEventEmpty START");
66
67         //    using (GLWindow glWindow = new GLWindow())
68         //    {
69         //        var testingTarget = new GLWindowVisibilityChangedEvent(glWindow.SwigCPtr.Handle, false);
70
71         //        try
72         //        {
73         //            var result = testingTarget.Empty();
74         //            tlog.Debug(tag, "result : " + result);
75         //        }
76         //        catch (Exception e)
77         //        {
78         //            tlog.Debug(tag, e.Message.ToString());
79         //            Assert.Fail("Caught Exception : Failed!");
80         //        }
81
82         //        testingTarget.Dispose();
83         //    }
84
85         //    tlog.Debug(tag, $"GLWindowVisibilityChangedEventEmpty END (OK)");
86         //}
87
88         [Test]
89         [Category("P1")]
90         [Description("GLWindowVisibilityChangedEvent GetConnectionCount")]
91         [Property("SPEC", "Tizen.NUI.GLWindowVisibilityChangedEvent.GetConnectionCount M")]
92         [Property("SPEC_URL", "-")]
93         [Property("CRITERIA", "MR")]
94         public void GLWindowVisibilityChangedEventGetConnectionCount()
95         {
96             tlog.Debug(tag, $"GLWindowVisibilityChangedEventGetConnectionCount START");
97             string name = "myGLWindow";
98             Rectangle rectangle = new Rectangle(20, 20, 100, 100);
99             GLWindow a1 = new GLWindow(name, rectangle, true);
100
101             GLWindowVisibilityChangedEvent b1 = new GLWindowVisibilityChangedEvent(a1.SwigCPtr.Handle, false);
102             b1.GetConnectionCount();
103
104             a1.Destroy();
105             tlog.Debug(tag, $"GLWindowVisibilityChangedEventGetConnectionCount END (OK)");
106             Assert.Pass("GLWindowVisibilityChangedEventGetConnectionCount");
107         }
108
109         //[Test]
110         //[Category("P1")]
111         //[Description("GLWindowVisibilityChangedEvent Connect")]
112         //[Property("SPEC", "Tizen.NUI.GLWindowVisibilityChangedEvent.Connect M")]
113         //[Property("SPEC_URL", "-")]
114         //[Property("CRITERIA", "MR")]
115         //public void GLWindowVisibilityChangedEventConnect()
116         //{
117         //    tlog.Debug(tag, $"GLWindowVisibilityChangedEventConnect START");
118
119         //    using (GLWindow glWindow = new GLWindow())
120         //    {
121         //        var testingTarget = new GLWindowVisibilityChangedEvent(glWindow.SwigCPtr.Handle, false);
122
123         //        try
124         //        {
125         //            dummyCallback callback = OnDummyCallback;
126         //            testingTarget.Connect(callback);
127         //            testingTarget.Disconnect(callback);
128         //        }
129         //        catch (Exception e)
130         //        {
131         //            tlog.Debug(tag, e.Message.ToString());
132         //            Assert.Fail("Caught Exception : Failed!");
133         //        }
134
135         //        testingTarget.Dispose();
136         //    }
137
138         //    tlog.Debug(tag, $"GLWindowVisibilityChangedEventConnect END (OK)");
139         //    Assert.Pass("GLWindowVisibilityChangedEventConnect");
140         //}
141
142         [Test]
143         [Category("P1")]
144         [Description("GLWindowVisibilityChangedEvent Emit")]
145         [Property("SPEC", "Tizen.NUI.GLWindowVisibilityChangedEvent.Emit M")]
146         [Property("SPEC_URL", "-")]
147         [Property("CRITERIA", "MR")]
148         public void GLWindowVisibilityChangedEventEmit()
149         {
150             tlog.Debug(tag, $"GLWindowVisibilityChangedEventEmit START");
151             string name = "myGLWindow";
152             Rectangle rectangle = new Rectangle(20, 20, 100, 100);
153             GLWindow a1 = new GLWindow(name, rectangle, true);
154
155             GLWindowVisibilityChangedEvent b1 = new GLWindowVisibilityChangedEvent(a1.SwigCPtr.Handle, false);
156             b1.Emit(a1, true);
157
158             a1.Destroy();
159             tlog.Debug(tag, $"GLWindowVisibilityChangedEventEmit END (OK)");
160             Assert.Pass("GLWindowVisibilityChangedEventEmit");
161         }
162     }
163 }
164