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/FrameBroker/DefaultFrameBroker")]
14 class InternalDefaultFrameBrokerTest
16 private const string tag = "NUITEST";
17 private const string MyAppId = "org.tizen.SampleServiceApp.Tizen";
18 private string path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";
20 internal class MyDefaultFrameBroker : DefaultFrameBroker
22 public MyDefaultFrameBroker(Window win) : base(win)
25 public void MyOnFrameCreated()
27 base.OnFrameCreated();
30 public void MyOnFrameResumed(FrameData frame)
32 base.OnFrameResumed(frame);
35 public void MyOnFrameUpdated(FrameData frame)
37 base.OnFrameUpdated(frame);
40 public void MyOnFramePaused()
45 public void MyOnFrameDestroyed()
47 base.OnFrameDestroyed();
50 public void MyOnFrameErred(FrameError error)
52 base.OnFrameErred(error);
59 tlog.Info(tag, "Init() is called!");
65 tlog.Info(tag, "Destroy() is called!");
70 [Description("DefaultFrameBroker constructor.")]
71 [Property("SPEC", "Tizen.NUI.DefaultFrameBroker.DefaultFrameBroker C")]
72 [Property("SPEC_URL", "-")]
73 [Property("CRITERIA", "CONSTR")]
74 [Property("AUTHOR", "guowei.wang@samsung.com")]
75 public void DefaultFrameBrokerConstructor()
77 tlog.Debug(tag, $"DefaultFrameBrokerConstructor START");
79 using (Window window = new Window(new Rectangle(0, 0, 1920, 1080), false))
81 var testingTarget = new DefaultFrameBroker(window);
82 Assert.IsNotNull(testingTarget, "Can't create success object CustomView");
83 Assert.IsInstanceOf<DefaultFrameBroker>(testingTarget, "Should be an instance of DefaultFrameBroker type.");
85 testingTarget.Dispose();
88 tlog.Debug(tag, $"DefaultFrameBrokerConstructor END (OK)");
93 [Description("DefaultFrameBroker constructor. With null window.")]
94 [Property("SPEC", "Tizen.NUI.DefaultFrameBroker.DefaultFrameBroker M")]
95 [Property("SPEC_URL", "-")]
96 [Property("CRITERIA", "MR")]
97 [Property("AUTHOR", "guowei.wang@samsung.com")]
98 public void DefaultFrameBrokerConstructorWindowIsNull()
100 tlog.Debug(tag, $"DefaultFrameBrokerConstructorWindowIsNull START");
102 using (Window window = null)
106 var testingTarget = new DefaultFrameBroker(window);
110 tlog.Debug(tag, e.Message.ToString());
111 tlog.Debug(tag, $"DefaultFrameBrokerConstructorWindowIsNull END (OK)");
112 Assert.Pass("Caught Exception : Passed!");
119 [Description("DefaultFrameBroker ForwardAnimation.")]
120 [Property("SPEC", "Tizen.NUI.DefaultFrameBroker.ForwardAnimation A")]
121 [Property("SPEC_URL", "-")]
122 [Property("CRITERIA", "PRO")]
123 [Property("AUTHOR", "guowei.wang@samsung.com")]
124 public void DefaultFrameBrokerForwardAnimation()
126 tlog.Debug(tag, $"DefaultFrameBrokerForwardAnimation START");
128 var testingTarget = new DefaultFrameBroker(Window.Instance);
129 Assert.IsNotNull(testingTarget, "Can't create success object CustomView");
130 Assert.IsInstanceOf<DefaultFrameBroker>(testingTarget, "Should be an instance of DefaultFrameBroker type.");
134 var result = testingTarget.ForwardAnimation;
135 tlog.Debug(tag, "ForwardAnimation.ForwardAnimation : " + result);
137 using (TransitionAnimation forwardAni = new TransitionAnimation(300))
139 testingTarget.ForwardAnimation = forwardAni;
140 tlog.Debug(tag, "ForwardAnimation.ForwardAnimation : " + testingTarget.ForwardAnimation);
145 tlog.Debug(tag, e.Message.ToString());
146 Assert.Fail("Caught Exception : Failed!");
149 testingTarget.Dispose();
150 tlog.Debug(tag, $"DefaultFrameBrokerForwardAnimation END (OK)");
155 [Description("DefaultFrameBroker BackwardAnimation.")]
156 [Property("SPEC", "Tizen.NUI.DefaultFrameBroker.BackwardAnimation A")]
157 [Property("SPEC_URL", "-")]
158 [Property("CRITERIA", "PRO")]
159 [Property("AUTHOR", "guowei.wang@samsung.com")]
160 public void DefaultFrameBrokerBackwardAnimation()
162 tlog.Debug(tag, $"DefaultFrameBrokerBackwardAnimation START");
164 var testingTarget = new DefaultFrameBroker(Window.Instance);
165 Assert.IsNotNull(testingTarget, "Can't create success object CustomView");
166 Assert.IsInstanceOf<DefaultFrameBroker>(testingTarget, "Should be an instance of DefaultFrameBroker type.");
170 var result = testingTarget.BackwardAnimation;
171 tlog.Debug(tag, "ForwardAnimation.BackwardAnimation : " + result);
173 using (TransitionAnimation backAni = new TransitionAnimation(300))
175 testingTarget.BackwardAnimation = backAni;
176 tlog.Debug(tag, "ForwardAnimation.BackwardAnimation : " + testingTarget.BackwardAnimation);
181 tlog.Debug(tag, e.Message.ToString());
182 Assert.Fail("Caught Exception : Failed!");
185 testingTarget.Dispose();
187 tlog.Debug(tag, $"DefaultFrameBrokerBackwardAnimation END (OK)");
192 [Description("DefaultFrameBroker OnFrameCreated.")]
193 [Property("SPEC", "Tizen.NUI.DefaultFrameBroker.OnFrameCreated M")]
194 [Property("SPEC_URL", "-")]
195 [Property("CRITERIA", "MR")]
196 [Property("AUTHOR", "guowei.wang@samsung.com")]
197 public void DefaultFrameBrokerOnFrameCreated()
199 tlog.Debug(tag, $"DefaultFrameBrokerOnFrameCreated START");
201 var testingTarget = new MyDefaultFrameBroker(Window.Instance);
202 Assert.IsNotNull(testingTarget, "Can't create success object CustomView");
203 Assert.IsInstanceOf<DefaultFrameBroker>(testingTarget, "Should be an instance of DefaultFrameBroker type.");
207 testingTarget.MyOnFrameCreated();
211 tlog.Debug(tag, e.Message.ToString());
212 Assert.Fail("Caught Exception : Failed!");
215 testingTarget.Dispose();
217 tlog.Debug(tag, $"DefaultFrameBrokerOnFrameCreated END (OK)");
222 [Description("DefaultFrameBroker OnFramePaused.")]
223 [Property("SPEC", "Tizen.NUI.DefaultFrameBroker.OnFramePaused M")]
224 [Property("SPEC_URL", "-")]
225 [Property("CRITERIA", "MR")]
226 [Property("AUTHOR", "guowei.wang@samsung.com")]
227 public void DefaultFrameBrokerOnFramePaused()
229 tlog.Debug(tag, $"DefaultFrameBrokerOnFramePaused START");
231 var testingTarget = new MyDefaultFrameBroker(Window.Instance);
232 Assert.IsNotNull(testingTarget, "Can't create success object CustomView");
233 Assert.IsInstanceOf<DefaultFrameBroker>(testingTarget, "Should be an instance of DefaultFrameBroker type.");
237 testingTarget.MyOnFramePaused();
241 tlog.Debug(tag, e.Message.ToString());
242 Assert.Fail("Caught Exception : Failed!");
245 testingTarget.Dispose();
247 tlog.Debug(tag, $"DefaultFrameBrokerOnFramePaused END (OK)");
252 [Description("DefaultFrameBroker OnFrameDestroyed.")]
253 [Property("SPEC", "Tizen.NUI.DefaultFrameBroker.OnFrameDestroyed M")]
254 [Property("SPEC_URL", "-")]
255 [Property("CRITERIA", "MR")]
256 [Property("AUTHOR", "guowei.wang@samsung.com")]
257 public void DefaultFrameBrokerOnFrameDestroyed()
259 tlog.Debug(tag, $"DefaultFrameBrokerOnFrameDestroyed START");
261 var testingTarget = new MyDefaultFrameBroker(Window.Instance);
262 Assert.IsNotNull(testingTarget, "Can't create success object CustomView");
263 Assert.IsInstanceOf<DefaultFrameBroker>(testingTarget, "Should be an instance of DefaultFrameBroker type.");
267 testingTarget.MyOnFrameDestroyed();
271 tlog.Debug(tag, e.Message.ToString());
272 Assert.Fail("Caught Exception : Failed!");
275 testingTarget.Dispose();
277 tlog.Debug(tag, $"DefaultFrameBrokerOnFrameDestroyed END (OK)");
282 [Description("DefaultFrameBroker OnFrameErred.")]
283 [Property("SPEC", "Tizen.NUI.DefaultFrameBroker.OnFrameErred M")]
284 [Property("SPEC_URL", "-")]
285 [Property("CRITERIA", "MR")]
286 [Property("AUTHOR", "guowei.wang@samsung.com")]
287 public void DefaultFrameBrokerOnFrameErred()
289 tlog.Debug(tag, $"DefaultFrameBrokerOnFrameErred START");
291 var testingTarget = new MyDefaultFrameBroker(Window.Instance);
292 Assert.IsNotNull(testingTarget, "Can't create success object CustomView");
293 Assert.IsInstanceOf<DefaultFrameBroker>(testingTarget, "Should be an instance of DefaultFrameBroker type.");
297 testingTarget.MyOnFrameErred(FrameError.Disqualified);
301 tlog.Debug(tag, e.Message.ToString());
302 Assert.Fail("Caught Exception : Failed!");
305 testingTarget.Dispose();
307 tlog.Debug(tag, $"DefaultFrameBrokerOnFrameErred END (OK)");
312 //[Description("DefaultFrameBroker SendLaunchRequest.")]
313 //[Property("SPEC", "Tizen.NUI.DefaultFrameBroker.SendLaunchRequest M")]
314 //[Property("SPEC_URL", "-")]
315 //[Property("CRITERIA", "MR")]
316 //[Property("AUTHOR", "guowei.wang@samsung.com")]
317 //public void DefaultFrameBrokerSendLaunchRequest()
319 // tlog.Debug(tag, $"DefaultFrameBrokerSendLaunchRequest START");
321 // var testingTarget = new DefaultFrameBroker(Window.Instance);
322 // Assert.IsNotNull(testingTarget, "Can't create success object CustomView");
323 // Assert.IsInstanceOf<DefaultFrameBroker>(testingTarget, "Should be an instance of DefaultFrameBroker type.");
327 // Tizen.Applications.AppControl appControl = new Tizen.Applications.AppControl();
328 // appControl.Operation = Tizen.Applications.AppControlOperations.Call;
329 // appControl.ApplicationId = MyAppId;
330 // testingTarget.SendLaunchRequest(appControl, true);
332 // catch (Exception e)
334 // tlog.Debug(tag, e.Message.ToString());
335 // Assert.Fail("Caught Exception : Failed!");
338 // testingTarget.Dispose();
340 // tlog.Debug(tag, $"DefaultFrameBrokerSendLaunchRequest END (OK)");