3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
6 using System.Collections.Generic;
8 namespace Tizen.NUI.Devel.Tests
10 using tlog = Tizen.Log;
13 [Description("internal/Window/WindowFocusSignalType")]
14 public class InternalWindowFocusSignalTypeTest
16 private const string tag = "NUITEST";
18 private delegate bool dummyCallback(IntPtr signal);
19 private bool OnDummyCallback(IntPtr data)
27 tlog.Info(tag, "Init() is called!");
33 tlog.Info(tag, "Destroy() is called!");
38 [Description("WindowFocusSignalType constructor")]
39 [Property("SPEC", "Tizen.NUI.WindowFocusSignalType.WindowFocusSignalType C")]
40 [Property("SPEC_URL", "-")]
41 [Property("CRITERIA", "CONSTR")]
42 [Property("AUTHOR", "guowei.wang@samsung.com")]
43 public void WindowFocusSignalTypeConstructor()
45 tlog.Debug(tag, $"WindowFocusSignalTypeConstructor START");
47 var testingTarget = new WindowFocusSignalType();
48 Assert.IsNotNull(testingTarget, "should be not null");
49 Assert.IsInstanceOf<WindowFocusSignalType>(testingTarget, "should be an instance of WindowFocusSignalType class!");
51 testingTarget.Dispose();
52 tlog.Debug(tag, $"WindowFocusSignalTypeConstructor END (OK)");
57 [Description("WindowFocusSignalType GetConnectionCount.")]
58 [Property("SPEC", "Tizen.NUI.WindowFocusSignalType.GetConnectionCount M")]
59 [Property("SPEC_URL", "-")]
60 [Property("CRITERIA", "MR")]
61 [Property("AUTHOR", "guowei.wang@samsung.com")]
62 public void WindowFocusSignalTypeGetConnectionCount()
64 tlog.Debug(tag, $"WindowFocusSignalTypeGetConnectionCount START");
66 var testingTarget = new WindowFocusSignalType();
67 Assert.IsNotNull(testingTarget, "Should be not null!");
68 Assert.IsInstanceOf<WindowFocusSignalType>(testingTarget, "Should be an Instance of WindowFocusSignalType!");
72 testingTarget.GetConnectionCount();
76 tlog.Debug(tag, e.Message.ToString());
77 Assert.Fail("Caught Exception: Failed!");
80 testingTarget.Dispose();
82 tlog.Debug(tag, $"WindowFocusSignalTypeGetConnectionCount END (OK)");
87 [Description("WindowFocusSignalType Emit.")]
88 [Property("SPEC", "Tizen.NUI.WindowFocusSignalType.Emit M")]
89 [Property("SPEC_URL", "-")]
90 [Property("CRITERIA", "MR")]
91 [Property("AUTHOR", "guowei.wang@samsung.com")]
92 public void WindowFocusSignalTypeEmit()
94 tlog.Debug(tag, $"WindowFocusSignalTypeEmit START");
95 var currentPid = global::System.Diagnostics.Process.GetCurrentProcess().Id;
96 var currentTid = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
98 tlog.Debug(tag, $"thread check! main pid={App.mainPid}, current pid={currentPid}, main tid={App.mainTid}, current tid={currentTid}");
100 using (Window window = new Window(new Rectangle(0, 0, 2, 2), false))
102 var testingTarget = new WindowFocusSignalType();
103 Assert.IsNotNull(testingTarget, "Should be not null!");
104 Assert.IsInstanceOf<WindowFocusSignalType>(testingTarget, "Should be an Instance of WindowFocusSignalType!");
108 testingTarget.Emit(window, false);
112 tlog.Debug(tag, e.Message.ToString());
113 Assert.Fail("Caught Exception: Failed!");
116 testingTarget.Dispose();
119 tlog.Debug(tag, $"WindowFocusSignalTypeEmit END (OK)");