2 * Copyright (c) 2022 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include <dali-toolkit-test-suite-utils.h>
19 #include <dali-toolkit/dali-toolkit.h>
20 #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
21 #include <dali-toolkit/public-api/transition/fade-transition.h>
22 #include <dali-toolkit/public-api/transition/slide-transition.h>
23 #include <dali-toolkit/public-api/transition/transition-base.h>
24 #include <dali-toolkit/public-api/transition/transition-set.h>
25 #include <dali-toolkit/public-api/transition/transition.h>
26 #include <dali/devel-api/actors/actor-devel.h>
27 #include <dali/public-api/rendering/decorated-visual-renderer.h> // for Renderer Property Index.
32 using namespace Dali::Toolkit;
35 const char* TEST_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/gallery-small-1.jpg";
39 // Functor to test whether a Finish signal is emitted
40 struct TransitionFinishCheck
42 TransitionFinishCheck(bool& signalReceived)
43 : mSignalReceived(signalReceived)
47 void operator()(TransitionSet& transitionSet)
49 mSignalReceived = true;
54 mSignalReceived = false;
57 void CheckSignalReceived()
61 tet_printf("Expected Finish signal was not received\n");
70 void CheckSignalNotReceived()
74 tet_printf("Unexpected Finish signal was received\n");
83 bool& mSignalReceived; // owned by individual tests
86 int UtcDaliTransitionSetGetProperty01(void)
88 ToolkitTestApplication application;
89 tet_infoline(" UtcDaliTransitionSetGetProperty01");
91 Control control1 = Control::New();
92 control1.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
93 control1.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
94 control1.SetProperty(Actor::Property::POSITION, Vector3(100, 200, 0));
95 Property::Map controlProperty1;
96 controlProperty1.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
97 controlProperty1.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
98 controlProperty1.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, 50.f);
99 controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, 50.f);
100 controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
101 controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, 1.f);
102 control1.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty1);
104 Control control2 = Control::New();
105 control2.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
106 control2.SetProperty(Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_LEFT);
107 control2.SetProperty(Actor::Property::POSITION, Vector3(50, 50, 0));
108 Property::Map controlProperty2;
109 controlProperty2.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
110 controlProperty2.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 1.0f, 0.0f, 0.5f));
111 controlProperty2.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, 30.f);
112 controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, 30.f);
113 controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_COLOR, Vector4(1.0f, 1.0f, 0.0f, 0.5f));
114 controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, -1.f);
115 control2.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty2);
117 application.GetScene().Add(control1);
118 application.GetScene().Add(control2);
120 application.SendNotification();
121 application.Render(20);
123 Transition transition = Transition::New(control1, control2, true, TimePeriod(-0.1f, -0.1f));
124 TimePeriod timePeriod = transition.GetTimePeriod();
125 DALI_TEST_EQUALS(0.0f, timePeriod.durationSeconds, TEST_LOCATION);
126 DALI_TEST_EQUALS(0.0f, timePeriod.delaySeconds, TEST_LOCATION);
128 transition.SetTimePeriod(TimePeriod(0.5f, 1.0f));
129 timePeriod = transition.GetTimePeriod();
130 DALI_TEST_EQUALS(1.0f, timePeriod.durationSeconds, TEST_LOCATION);
131 DALI_TEST_EQUALS(0.5f, timePeriod.delaySeconds, TEST_LOCATION);
133 DALI_TEST_EQUALS(Dali::AlphaFunction::DEFAULT, transition.GetAlphaFunction().GetBuiltinFunction(), TEST_LOCATION);
134 transition.SetAlphaFunction(Dali::AlphaFunction::EASE_IN_OUT);
135 DALI_TEST_EQUALS(Dali::AlphaFunction::EASE_IN_OUT, transition.GetAlphaFunction().GetBuiltinFunction(), TEST_LOCATION);
137 TransitionSet transitionSet = TransitionSet::New();
138 transitionSet.AddTransition(transition);
140 DALI_TEST_EQUALS(1, transitionSet.GetTransitionCount(), TEST_LOCATION);
141 DALI_TEST_EQUALS(transition, transitionSet.GetTransitionAt(0), TEST_LOCATION);
146 int UtcDaliTransitionSetGetProperty02(void)
148 ToolkitTestApplication application;
149 tet_infoline(" UtcDaliTransitionSetGetProperty02");
151 Control control1 = Control::New();
152 control1.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
153 control1.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
154 control1.SetProperty(Actor::Property::POSITION, Vector3(100, 200, 0));
155 Property::Map controlProperty1;
156 controlProperty1.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
157 controlProperty1.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
158 controlProperty1.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, Vector4(50.0f, 30.0f, 40.0f, 20.0f));
159 controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, 50.f);
160 controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
161 controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, -1.f);
162 control1.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty1);
164 Control control2 = Control::New();
165 control2.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
166 control2.SetProperty(Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_LEFT);
167 control2.SetProperty(Actor::Property::POSITION, Vector3(50, 50, 0));
168 Property::Map controlProperty2;
169 controlProperty2.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
170 controlProperty2.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 1.0f, 0.0f, 0.5f));
171 controlProperty2.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, Vector4(32.f, 54.0f, 24.0f, 42.0f));
172 controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, 30.f);
173 controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_COLOR, Vector4(1.0f, 1.0f, 0.0f, 0.5f));
174 controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, -1.f);
175 control2.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty2);
177 application.GetScene().Add(control1);
178 application.GetScene().Add(control2);
180 application.SendNotification();
181 application.Render(20);
183 Transition transition = Transition::New(control1, control2, true, TimePeriod(-0.1f));
184 TimePeriod timePeriod = transition.GetTimePeriod();
185 DALI_TEST_EQUALS(0.0f, timePeriod.durationSeconds, TEST_LOCATION);
186 DALI_TEST_EQUALS(0.0f, timePeriod.delaySeconds, TEST_LOCATION);
188 transition.SetTimePeriod(TimePeriod(0.5f, 1.0f));
189 timePeriod = transition.GetTimePeriod();
190 DALI_TEST_EQUALS(1.0f, timePeriod.durationSeconds, TEST_LOCATION);
191 DALI_TEST_EQUALS(0.5f, timePeriod.delaySeconds, TEST_LOCATION);
193 DALI_TEST_EQUALS(Dali::AlphaFunction::DEFAULT, transition.GetAlphaFunction().GetBuiltinFunction(), TEST_LOCATION);
194 transition.SetAlphaFunction(Dali::AlphaFunction::EASE_IN_OUT);
195 DALI_TEST_EQUALS(Dali::AlphaFunction::EASE_IN_OUT, transition.GetAlphaFunction().GetBuiltinFunction(), TEST_LOCATION);
197 TransitionSet transitionSet = TransitionSet::New();
198 transitionSet.AddTransition(transition);
200 DALI_TEST_EQUALS(1, transitionSet.GetTransitionCount(), TEST_LOCATION);
201 DALI_TEST_EQUALS(transition, transitionSet.GetTransitionAt(0), TEST_LOCATION);
206 int UtcDaliTransitionBetweenControlPair(void)
208 ToolkitTestApplication application;
209 tet_infoline(" UtcDaliTransitionBetweenControlPair");
211 Vector3 destinationPosition(50, 50, 0);
212 Vector3 destinationSize(120, 120, 0);
213 Vector3 destinationScale(2, 1, 0);
214 Vector4 destinationColor(1.0f, 0.5f, 1.0f, 0.8f);
215 float destinationOpacity(0.8f);
216 float destinationRadius(50.f);
217 float destinationBorderlineWidth(80.0f);
218 Vector4 destinationBorderlineColor(0.5f, 1.0f, 0.5f, 0.3f);
219 float destinationBorderlineOffset(-1.0f);
220 Vector4 destinationRadiusV4 = Vector4(destinationRadius, destinationRadius, destinationRadius, destinationRadius);
222 Control control1 = Control::New();
223 control1.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
224 control1.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
225 control1.SetProperty(Actor::Property::POSITION, Vector3(100, 200, 0));
226 control1.SetProperty(Actor::Property::SIZE, Vector3(150, 150, 0));
227 control1.SetProperty(Actor::Property::SCALE, Vector3(1, 2, 0));
228 control1.SetProperty(Actor::Property::COLOR, Vector4(1.0f, 1.0f, 1.0f, 0.5f));
229 control1.SetProperty(Actor::Property::OPACITY, 0.5f);
230 Property::Map controlProperty1;
231 controlProperty1.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
232 controlProperty1.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
233 controlProperty1.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, 30.f);
234 controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, 60.f);
235 controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
236 controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, 1.f);
237 control1.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty1);
239 Control control2 = Control::New();
240 control2.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
241 control2.SetProperty(Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_LEFT);
242 control2.SetProperty(Actor::Property::POSITION, destinationPosition);
243 control2.SetProperty(Actor::Property::SIZE, destinationSize);
244 control2.SetProperty(Actor::Property::SCALE, destinationScale);
245 control2.SetProperty(Actor::Property::COLOR, destinationColor);
246 control2.SetProperty(Actor::Property::OPACITY, destinationOpacity);
247 Property::Map controlProperty2;
248 controlProperty2.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
249 controlProperty2.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 1.0f, 0.0f, 0.5f));
250 controlProperty2.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, destinationRadius);
251 controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, destinationBorderlineWidth);
252 controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_COLOR, destinationBorderlineColor);
253 controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, destinationBorderlineOffset);
254 control2.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty2);
256 DALI_TEST_EQUALS(destinationPosition, control2.GetProperty<Vector3>(Actor::Property::POSITION), TEST_LOCATION);
257 Property::Map backgroundMap = control2.GetProperty<Property::Map>(Toolkit::Control::Property::BACKGROUND);
258 Vector4 cornerRadius = backgroundMap.Find(Toolkit::DevelVisual::Property::CORNER_RADIUS)->Get<Vector4>();
259 DALI_TEST_EQUALS(destinationRadiusV4, cornerRadius, TEST_LOCATION);
260 float borderlineWidth = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH)->Get<float>();
261 DALI_TEST_EQUALS(destinationBorderlineWidth, borderlineWidth, TEST_LOCATION);
262 Vector4 borderlineColor = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_COLOR)->Get<Vector4>();
263 DALI_TEST_EQUALS(destinationBorderlineColor, borderlineColor, TEST_LOCATION);
264 float borderlineOffset = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET)->Get<float>();
265 DALI_TEST_EQUALS(destinationBorderlineOffset, borderlineOffset, TEST_LOCATION);
267 application.GetScene().Add(control1);
268 application.GetScene().Add(control2);
270 application.SendNotification();
271 application.Render(20);
273 Transition transition = Transition::New(control1, control2, true, TimePeriod(0.5f));
274 TransitionSet transitionSet = TransitionSet::New();
275 transitionSet.AddTransition(transition);
276 transitionSet.Play();
278 bool signalReceived(false);
279 TransitionFinishCheck finishCheck(signalReceived);
280 transitionSet.FinishedSignal().Connect(&application, finishCheck);
282 application.SendNotification();
283 application.Render(50);
285 // We didn't expect the animation to finish yet
286 application.SendNotification();
287 finishCheck.CheckSignalNotReceived();
289 DALI_TEST_NOT_EQUALS(destinationPosition, control2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), 0.00001f, TEST_LOCATION);
290 DALI_TEST_EQUALS(1, control2.GetRendererCount(), TEST_LOCATION);
291 Dali::Renderer renderer = control2.GetRendererAt(0);
292 cornerRadius = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::CORNER_RADIUS);
293 DALI_TEST_NOT_EQUALS(destinationRadiusV4, cornerRadius, 0.00001f, TEST_LOCATION);
294 borderlineWidth = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_WIDTH);
295 DALI_TEST_NOT_EQUALS(destinationBorderlineWidth, borderlineWidth, 0.00001f, TEST_LOCATION);
296 borderlineColor = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::BORDERLINE_COLOR);
297 DALI_TEST_NOT_EQUALS(destinationBorderlineColor, borderlineColor, 0.00001f, TEST_LOCATION);
298 borderlineOffset = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_OFFSET);
299 DALI_TEST_NOT_EQUALS(destinationBorderlineOffset, borderlineOffset, 0.00001f, TEST_LOCATION);
301 application.SendNotification();
302 application.Render(700);
304 // We did expect the animation to finish
305 application.SendNotification();
306 finishCheck.CheckSignalReceived();
308 application.SendNotification();
309 application.Render(20);
311 DALI_TEST_EQUALS(destinationPosition, control2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), TEST_LOCATION);
312 DALI_TEST_EQUALS(destinationSize, control2.GetCurrentProperty<Vector3>(Actor::Property::SIZE), TEST_LOCATION);
313 DALI_TEST_EQUALS(destinationScale, control2.GetCurrentProperty<Vector3>(Actor::Property::SCALE), TEST_LOCATION);
314 DALI_TEST_EQUALS(destinationColor, control2.GetCurrentProperty<Vector4>(Actor::Property::COLOR), TEST_LOCATION);
315 DALI_TEST_EQUALS(destinationOpacity, control2.GetCurrentProperty<float>(Actor::Property::OPACITY), TEST_LOCATION);
316 DALI_TEST_EQUALS(1, control2.GetRendererCount(), TEST_LOCATION);
317 renderer = control2.GetRendererAt(0);
318 cornerRadius = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::CORNER_RADIUS);
319 DALI_TEST_EQUALS(destinationRadiusV4, cornerRadius, TEST_LOCATION);
320 borderlineWidth = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_WIDTH);
321 DALI_TEST_EQUALS(destinationBorderlineWidth, borderlineWidth, TEST_LOCATION);
322 borderlineColor = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::BORDERLINE_COLOR);
323 DALI_TEST_EQUALS(destinationBorderlineColor, borderlineColor, TEST_LOCATION);
324 borderlineOffset = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_OFFSET);
325 DALI_TEST_EQUALS(destinationBorderlineOffset, borderlineOffset, TEST_LOCATION);
330 int UtcDaliTransitionBetweenControlPair2(void)
332 ToolkitTestApplication application;
333 tet_infoline(" UtcDaliTransitionBetweenControlPair2 - source target will be transitioned.");
335 Vector3 sourcePosition(100, 200, 0);
336 Vector3 sourceSize(150, 150, 0);
337 Vector3 sourceScale(1, 2, 0);
338 Vector4 sourceColor(1.0f, 1.0f, 1.0f, 0.5f);
339 float sourceOpacity(0.5f);
340 float sourceRadius(30.f);
341 float sourceBorderlineWidth(60.0f);
342 Vector4 sourceBorderlineColor(1.0f, 0.0f, 0.0f, 1.0f);
343 float sourceBorderlineOffset(1.f);
344 Vector4 sourceRadiusV4 = Vector4(sourceRadius, sourceRadius, sourceRadius, sourceRadius);
346 Vector3 destinationPosition(50, 50, 0);
347 Vector3 destinationSize(120, 120, 0);
348 Vector3 destinationScale(2, 1, 0);
349 Vector4 destinationColor(1.0f, 0.5f, 1.0f, 0.8f);
350 float destinationOpacity(0.8f);
351 float destinationRadius(50.f);
352 float destinationBorderlineWidth(80.0f);
353 Vector4 destinationBorderlineColor(0.5f, 1.0f, 0.5f, 0.3f);
354 float destinationBorderlineOffset(-1.0f);
355 Vector4 destinationRadiusV4 = Vector4(destinationRadius, destinationRadius, destinationRadius, destinationRadius);
357 Control control1 = Control::New();
358 control1.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
359 control1.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
360 control1.SetProperty(Actor::Property::POSITION, sourcePosition);
361 control1.SetProperty(Actor::Property::SIZE, sourceSize);
362 control1.SetProperty(Actor::Property::SCALE, sourceScale);
363 control1.SetProperty(Actor::Property::COLOR, sourceColor);
364 control1.SetProperty(Actor::Property::OPACITY, sourceOpacity);
365 Property::Map controlProperty1;
366 controlProperty1.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
367 controlProperty1.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
368 controlProperty1.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, sourceRadius);
369 controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, sourceBorderlineWidth);
370 controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_COLOR, sourceBorderlineColor);
371 controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, sourceBorderlineOffset);
372 control1.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty1);
374 Control control2 = Control::New();
375 control2.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
376 control2.SetProperty(Actor::Property::ANCHOR_POINT, ParentOrigin::CENTER);
377 control2.SetProperty(Actor::Property::POSITION, destinationPosition);
378 control2.SetProperty(Actor::Property::SIZE, destinationSize);
379 control2.SetProperty(Actor::Property::SCALE, destinationScale);
380 control2.SetProperty(Actor::Property::COLOR, destinationColor);
381 control2.SetProperty(Actor::Property::OPACITY, destinationOpacity);
382 Property::Map controlProperty2;
383 controlProperty2.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
384 controlProperty2.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 1.0f, 0.0f, 0.5f));
385 controlProperty2.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, destinationRadius);
386 controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, destinationBorderlineWidth);
387 controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_COLOR, destinationBorderlineColor);
388 controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, destinationBorderlineOffset);
389 control2.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty2);
391 DALI_TEST_EQUALS(destinationPosition, control2.GetProperty<Vector3>(Actor::Property::POSITION), TEST_LOCATION);
392 Property::Map backgroundMap = control2.GetProperty<Property::Map>(Toolkit::Control::Property::BACKGROUND);
393 Vector4 cornerRadius = backgroundMap.Find(Toolkit::DevelVisual::Property::CORNER_RADIUS)->Get<Vector4>();
394 DALI_TEST_EQUALS(destinationRadiusV4, cornerRadius, TEST_LOCATION);
395 float borderlineWidth = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH)->Get<float>();
396 DALI_TEST_EQUALS(destinationBorderlineWidth, borderlineWidth, TEST_LOCATION);
397 Vector4 borderlineColor = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_COLOR)->Get<Vector4>();
398 DALI_TEST_EQUALS(destinationBorderlineColor, borderlineColor, TEST_LOCATION);
399 float borderlineOffset = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET)->Get<float>();
400 DALI_TEST_EQUALS(destinationBorderlineOffset, borderlineOffset, TEST_LOCATION);
402 application.GetScene().Add(control1);
403 application.GetScene().Add(control2);
405 application.SendNotification();
406 application.Render(20);
408 Transition transition = Transition::New(control1, control2, false, TimePeriod(0.5f));
409 TransitionSet transitionSet = TransitionSet::New();
410 transitionSet.AddTransition(transition);
411 transitionSet.Play();
413 bool signalReceived(false);
414 TransitionFinishCheck finishCheck(signalReceived);
415 transitionSet.FinishedSignal().Connect(&application, finishCheck);
417 application.SendNotification();
418 application.Render(50);
420 // We didn't expect the animation to finish yet
421 application.SendNotification();
422 finishCheck.CheckSignalNotReceived();
424 DALI_TEST_NOT_EQUALS(destinationPosition, control1.GetCurrentProperty<Vector3>(Actor::Property::POSITION), 0.00001f, TEST_LOCATION);
425 DALI_TEST_EQUALS(1, control1.GetRendererCount(), TEST_LOCATION);
427 Dali::Renderer renderer = control1.GetRendererAt(0);
428 cornerRadius = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::CORNER_RADIUS);
429 DALI_TEST_NOT_EQUALS(destinationRadiusV4, cornerRadius, 0.00001f, TEST_LOCATION);
431 borderlineWidth = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_WIDTH);
432 DALI_TEST_NOT_EQUALS(destinationBorderlineWidth, borderlineWidth, 0.00001f, TEST_LOCATION);
434 borderlineColor = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::BORDERLINE_COLOR);
435 DALI_TEST_NOT_EQUALS(destinationBorderlineColor, borderlineColor, 0.00001f, TEST_LOCATION);
437 borderlineOffset = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_OFFSET);
438 DALI_TEST_NOT_EQUALS(destinationBorderlineOffset, borderlineOffset, 0.00001f, TEST_LOCATION);
440 application.SendNotification();
441 application.Render(700);
443 // We did expect the animation to finish
444 application.SendNotification();
445 finishCheck.CheckSignalReceived();
447 // After the transition is finished,
448 // every current and renderer propeties of control1 are equal to destination properties.
449 DALI_TEST_EQUALS(destinationPosition, control1.GetCurrentProperty<Vector3>(Actor::Property::POSITION), TEST_LOCATION);
450 DALI_TEST_EQUALS(destinationSize, control1.GetCurrentProperty<Vector3>(Actor::Property::SIZE), TEST_LOCATION);
451 DALI_TEST_EQUALS(destinationScale, control1.GetCurrentProperty<Vector3>(Actor::Property::SCALE), TEST_LOCATION);
452 DALI_TEST_EQUALS(destinationColor, control1.GetCurrentProperty<Vector4>(Actor::Property::COLOR), TEST_LOCATION);
453 DALI_TEST_EQUALS(destinationOpacity, control1.GetCurrentProperty<float>(Actor::Property::OPACITY), TEST_LOCATION);
455 DALI_TEST_EQUALS(1, control1.GetRendererCount(), TEST_LOCATION);
456 renderer = control1.GetRendererAt(0);
457 cornerRadius = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::CORNER_RADIUS);
458 DALI_TEST_EQUALS(destinationRadiusV4, cornerRadius, TEST_LOCATION);
460 borderlineWidth = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_WIDTH);
461 DALI_TEST_EQUALS(destinationBorderlineWidth, borderlineWidth, TEST_LOCATION);
463 borderlineColor = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::BORDERLINE_COLOR);
464 DALI_TEST_EQUALS(destinationBorderlineColor, borderlineColor, TEST_LOCATION);
466 borderlineOffset = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_OFFSET);
467 DALI_TEST_EQUALS(destinationBorderlineOffset, borderlineOffset, TEST_LOCATION);
469 // every actor properties of control1 are returned to the source properties.
470 DALI_TEST_EQUALS(sourcePosition, control1.GetProperty<Vector3>(Actor::Property::POSITION), TEST_LOCATION);
471 DALI_TEST_EQUALS(sourceSize, control1.GetProperty<Vector3>(Actor::Property::SIZE), TEST_LOCATION);
472 DALI_TEST_EQUALS(sourceScale, control1.GetProperty<Vector3>(Actor::Property::SCALE), TEST_LOCATION);
473 DALI_TEST_EQUALS(sourceColor, control1.GetProperty<Vector4>(Actor::Property::COLOR), TEST_LOCATION);
474 DALI_TEST_EQUALS(sourceOpacity, control1.GetProperty<float>(Actor::Property::OPACITY), TEST_LOCATION);
476 application.SendNotification();
477 application.Render(20);
479 // after next update, renderer properties are returned to the source properties.
480 DALI_TEST_EQUALS(1, control1.GetRendererCount(), TEST_LOCATION);
481 renderer = control1.GetRendererAt(0);
482 cornerRadius = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::CORNER_RADIUS);
483 DALI_TEST_EQUALS(sourceRadiusV4, cornerRadius, TEST_LOCATION);
485 borderlineWidth = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_WIDTH);
486 DALI_TEST_EQUALS(sourceBorderlineWidth, borderlineWidth, TEST_LOCATION);
488 borderlineColor = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::BORDERLINE_COLOR);
489 DALI_TEST_EQUALS(sourceBorderlineColor, borderlineColor, TEST_LOCATION);
491 borderlineOffset = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_OFFSET);
492 DALI_TEST_EQUALS(sourceBorderlineOffset, borderlineOffset, TEST_LOCATION);
497 int UtcDaliTransitionBetweenControlPairWithoutEmptySourceBackground(void)
499 ToolkitTestApplication application;
500 tet_infoline(" UtcDaliTransitionBetweenControlPair");
502 Vector4 destinationRadius(50.f, 30.f, 40.f, 0.f);
503 float destinationBorderlineWidth(40.f);
504 Vector4 destinationBorderlineColor(1.0f, 0.5f, 0.2f, 0.8f);
505 float destinationBorderlineOffset(1.f);
507 Control control1 = Control::New();
508 control1.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
509 control1.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
510 control1.SetProperty(Actor::Property::POSITION, Vector3(100, 200, 0));
512 Control control2 = Control::New();
513 control2.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
514 control2.SetProperty(Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_LEFT);
515 control2.SetProperty(Actor::Property::POSITION, Vector3(50, 50, 0));
516 Property::Map controlProperty2;
517 controlProperty2.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
518 controlProperty2.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 1.0f, 0.0f, 0.5f));
519 controlProperty2.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, destinationRadius);
520 controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, destinationBorderlineWidth);
521 controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_COLOR, destinationBorderlineColor);
522 controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, destinationBorderlineOffset);
523 control2.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty2);
525 Property::Map backgroundMap = control2.GetProperty<Property::Map>(Toolkit::Control::Property::BACKGROUND);
526 Vector4 cornerRadius = backgroundMap.Find(Toolkit::DevelVisual::Property::CORNER_RADIUS)->Get<Vector4>();
527 DALI_TEST_EQUALS(destinationRadius, cornerRadius, TEST_LOCATION);
528 float borderlineWidth = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH)->Get<float>();
529 DALI_TEST_EQUALS(destinationBorderlineWidth, borderlineWidth, TEST_LOCATION);
530 Vector4 borderlineColor = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_COLOR)->Get<Vector4>();
531 DALI_TEST_EQUALS(destinationBorderlineColor, borderlineColor, TEST_LOCATION);
532 float borderlineOffset = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET)->Get<float>();
533 DALI_TEST_EQUALS(destinationBorderlineOffset, borderlineOffset, TEST_LOCATION);
535 application.GetScene().Add(control1);
536 application.GetScene().Add(control2);
538 application.SendNotification();
539 application.Render(20);
541 Transition transition = Transition::New(control1, control2, true, TimePeriod(0.5f));
542 TransitionSet transitionSet = TransitionSet::New();
543 transitionSet.AddTransition(transition);
544 transitionSet.Play();
546 bool signalReceived(false);
547 TransitionFinishCheck finishCheck(signalReceived);
548 transitionSet.FinishedSignal().Connect(&application, finishCheck);
550 application.SendNotification();
551 application.Render(50);
553 // We didn't expect the animation to finish yet
554 application.SendNotification();
555 finishCheck.CheckSignalNotReceived();
557 backgroundMap = control2.GetProperty<Property::Map>(Toolkit::Control::Property::BACKGROUND);
558 cornerRadius = backgroundMap.Find(Toolkit::DevelVisual::Property::CORNER_RADIUS)->Get<Vector4>();
559 DALI_TEST_EQUALS(destinationRadius, cornerRadius, TEST_LOCATION);
560 borderlineWidth = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH)->Get<float>();
561 DALI_TEST_EQUALS(destinationBorderlineWidth, borderlineWidth, TEST_LOCATION);
562 borderlineColor = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_COLOR)->Get<Vector4>();
563 DALI_TEST_EQUALS(destinationBorderlineColor, borderlineColor, TEST_LOCATION);
564 borderlineOffset = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET)->Get<float>();
565 DALI_TEST_EQUALS(destinationBorderlineOffset, borderlineOffset, TEST_LOCATION);
567 application.SendNotification();
568 application.Render(700);
570 // We did expect the animation to finish
571 application.SendNotification();
572 finishCheck.CheckSignalReceived();
574 application.SendNotification();
575 application.Render(20);
577 backgroundMap = control2.GetProperty<Property::Map>(Toolkit::Control::Property::BACKGROUND);
578 cornerRadius = backgroundMap.Find(Toolkit::DevelVisual::Property::CORNER_RADIUS)->Get<Vector4>();
579 DALI_TEST_EQUALS(destinationRadius, cornerRadius, TEST_LOCATION);
580 borderlineWidth = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH)->Get<float>();
581 DALI_TEST_EQUALS(destinationBorderlineWidth, borderlineWidth, TEST_LOCATION);
582 borderlineColor = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_COLOR)->Get<Vector4>();
583 DALI_TEST_EQUALS(destinationBorderlineColor, borderlineColor, TEST_LOCATION);
584 borderlineOffset = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET)->Get<float>();
585 DALI_TEST_EQUALS(destinationBorderlineOffset, borderlineOffset, TEST_LOCATION);
590 int UtcDaliTransitionBetweenImageViewPair(void)
592 ToolkitTestApplication application;
593 tet_infoline(" UtcDaliTransitionBetweenControlPair");
595 Vector3 destinationPosition(50, 50, 0);
597 ImageView control1 = ImageView::New();
598 control1.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
599 control1.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
600 control1.SetProperty(Actor::Property::POSITION, Vector3(100, 200, 0));
601 control1.SetProperty(Actor::Property::SIZE, Vector3(150, 150, 0));
602 Property::Map controlProperty1;
603 controlProperty1.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE);
604 controlProperty1.Insert(Toolkit::ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME);
605 controlProperty1.Insert(Toolkit::Visual::Property::MIX_COLOR, Vector4(1.0f, 1.0f, 0.5f, 0.5f));
606 controlProperty1.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, 50.f);
607 controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, 50.f);
608 controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
609 controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, 1.f);
610 control1.SetProperty(Toolkit::ImageView::Property::IMAGE, controlProperty1);
612 ImageView control2 = ImageView::New();
613 control2.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
614 control2.SetProperty(Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_LEFT);
615 control2.SetProperty(Actor::Property::POSITION, destinationPosition);
616 control2.SetProperty(Actor::Property::SIZE, Vector3(120, 120, 0));
617 Property::Map controlProperty2;
618 controlProperty2.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE);
619 controlProperty2.Insert(Toolkit::ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME);
620 controlProperty2.Insert(Toolkit::Visual::Property::MIX_COLOR, Vector4(1.0f, 1.0f, 1.0f, 1.0f));
621 controlProperty2.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, 30.f);
622 controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, 30.f);
623 controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_COLOR, Vector4(0.0f, 1.0f, 1.0f, 0.5f));
624 controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, -1.f);
625 control2.SetProperty(Toolkit::ImageView::Property::IMAGE, controlProperty2);
627 DALI_TEST_EQUALS(destinationPosition, control2.GetProperty<Vector3>(Actor::Property::POSITION), TEST_LOCATION);
629 application.GetScene().Add(control1);
630 application.GetScene().Add(control2);
632 application.SendNotification();
633 application.Render(20);
635 Vector3 startWorldPosition = control1.GetProperty<Vector3>(Actor::Property::WORLD_POSITION);
636 Vector3 finishWorldPosition = control2.GetProperty<Vector3>(Actor::Property::WORLD_POSITION);
638 Transition transition = Transition::New(control1, control2, true, TimePeriod(0.5f));
639 TransitionSet transitionSet = TransitionSet::New();
640 transitionSet.AddTransition(transition);
641 transitionSet.Play();
643 bool signalReceived(false);
644 TransitionFinishCheck finishCheck(signalReceived);
645 transitionSet.FinishedSignal().Connect(&application, finishCheck);
647 application.SendNotification();
648 application.Render(400);
650 // We didn't expect the animation to finish yet
651 application.SendNotification();
652 finishCheck.CheckSignalNotReceived();
654 // control2 moved about 80%
655 Vector3 currentPosition = control2.GetCurrentProperty<Vector3>(Actor::Property::POSITION);
656 Vector3 expectedPosition_0_7 = startWorldPosition + (finishWorldPosition - startWorldPosition) * 0.7;
657 Vector3 expectedPosition_0_9 = startWorldPosition + (finishWorldPosition - startWorldPosition) * 0.9;
658 DALI_TEST_CHECK(currentPosition.x <= expectedPosition_0_7.x && currentPosition.x >= expectedPosition_0_9.x);
659 DALI_TEST_CHECK(currentPosition.y <= expectedPosition_0_7.y && currentPosition.y >= expectedPosition_0_9.y);
661 application.SendNotification();
662 application.Render(200);
664 // We did expect the animation to finish
665 application.SendNotification();
666 finishCheck.CheckSignalReceived();
668 DALI_TEST_NOT_EQUALS(destinationPosition, control2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), 0.00001f, TEST_LOCATION);
670 application.SendNotification();
671 application.Render(20);
673 DALI_TEST_EQUALS(destinationPosition, control2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), TEST_LOCATION);
678 int UtcDaliTransitionBetweenImageViewPairWithDelay(void)
680 ToolkitTestApplication application;
681 tet_infoline(" UtcDaliTransitionBetweenControlPair");
683 Vector3 destinationPosition(50, 50, 0);
685 ImageView control1 = ImageView::New();
686 control1.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
687 control1.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
688 control1.SetProperty(Actor::Property::POSITION, Vector3(100, 200, 0));
689 control1.SetProperty(Actor::Property::SIZE, Vector3(150, 150, 0));
690 Property::Map controlProperty1;
691 controlProperty1.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE);
692 controlProperty1.Insert(Toolkit::ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME);
693 controlProperty1.Insert(Toolkit::Visual::Property::MIX_COLOR, Vector4(1.0f, 1.0f, 0.5f, 0.5f));
694 controlProperty1.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, 50.f);
695 controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, 50.f);
696 controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
697 controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, 1.f);
698 control1.SetProperty(Toolkit::ImageView::Property::IMAGE, controlProperty1);
700 ImageView control2 = ImageView::New();
701 control2.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
702 control2.SetProperty(Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_LEFT);
703 control2.SetProperty(Actor::Property::POSITION, destinationPosition);
704 control2.SetProperty(Actor::Property::SIZE, Vector3(120, 120, 0));
705 Property::Map controlProperty2;
706 controlProperty2.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE);
707 controlProperty2.Insert(Toolkit::ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME);
708 controlProperty2.Insert(Toolkit::Visual::Property::MIX_COLOR, Vector4(1.0f, 1.0f, 1.0f, 1.0f));
709 controlProperty2.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, 30.f);
710 controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, 30.f);
711 controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_COLOR, Vector4(0.0f, 1.0f, 1.0f, 0.5f));
712 controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, -1.f);
713 control2.SetProperty(Toolkit::ImageView::Property::IMAGE, controlProperty2);
715 DALI_TEST_EQUALS(destinationPosition, control2.GetProperty<Vector3>(Actor::Property::POSITION), TEST_LOCATION);
717 application.GetScene().Add(control1);
718 application.GetScene().Add(control2);
720 application.SendNotification();
721 application.Render(20);
723 Vector3 startWorldPosition = control1.GetProperty<Vector3>(Actor::Property::WORLD_POSITION);
724 Vector3 finishWorldPosition = control2.GetProperty<Vector3>(Actor::Property::WORLD_POSITION);
726 Transition transition = Transition::New(control1, control2, true, TimePeriod(0.5f, 0.5f));
727 TransitionSet transitionSet = TransitionSet::New();
728 transitionSet.AddTransition(transition);
729 transitionSet.Play();
731 bool signalReceived(false);
732 TransitionFinishCheck finishCheck(signalReceived);
733 transitionSet.FinishedSignal().Connect(&application, finishCheck);
735 application.SendNotification();
736 application.Render(400);
738 // We didn't expect the animation to finish yet
739 application.SendNotification();
740 finishCheck.CheckSignalNotReceived();
742 DALI_TEST_EQUALS(startWorldPosition, control2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), TEST_LOCATION);
744 application.SendNotification();
745 application.Render(400);
747 // We didn't expect the animation to finish yet
748 application.SendNotification();
749 finishCheck.CheckSignalNotReceived();
751 // control2 moved about 60% (800ms)
752 Vector3 currentPosition = control2.GetCurrentProperty<Vector3>(Actor::Property::POSITION);
753 Vector3 expectedPosition_0_5 = startWorldPosition + (finishWorldPosition - startWorldPosition) * 0.5;
754 Vector3 expectedPosition_0_7 = startWorldPosition + (finishWorldPosition - startWorldPosition) * 0.7;
755 DALI_TEST_CHECK(currentPosition.x <= expectedPosition_0_5.x && currentPosition.x >= expectedPosition_0_7.x);
756 DALI_TEST_CHECK(currentPosition.y <= expectedPosition_0_5.y && currentPosition.y >= expectedPosition_0_7.y);
758 application.SendNotification();
759 application.Render(400);
761 // We did expect the animation to finish
762 application.SendNotification();
763 finishCheck.CheckSignalReceived();
765 DALI_TEST_NOT_EQUALS(destinationPosition, control2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), 0.00001f, TEST_LOCATION);
767 application.SendNotification();
768 application.Render(20);
770 DALI_TEST_EQUALS(destinationPosition, control2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), TEST_LOCATION);
775 int UtcDaliTransitionBetweenControlPairWithTree(void)
777 ToolkitTestApplication application;
778 tet_infoline(" UtcDaliTransitionBetweenControlPairWithTree");
780 Vector3 destinationPosition(50, 50, 0);
781 Vector3 destinationWorldPosition(-130, -290, 0);
783 Control control1 = Control::New();
784 control1.SetProperty(Actor::Property::POSITION, Vector3(100, 200, 0));
785 control1.SetProperty(Actor::Property::SIZE, Vector3(150, 150, 0));
786 Property::Map controlProperty1;
787 controlProperty1.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
788 controlProperty1.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
789 control1.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty1);
791 Control control2 = Control::New();
792 control2.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
793 control2.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
794 control2.SetProperty(Actor::Property::POSITION, destinationPosition);
795 control2.SetProperty(Actor::Property::SIZE, Vector3(120, 120, 0));
796 Property::Map controlProperty2;
797 controlProperty2.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
798 controlProperty2.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
799 control2.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty2);
801 Control control3 = Control::New();
802 control3.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
803 control3.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
804 control3.SetProperty(Actor::Property::POSITION, Vector3(50, 50, 0));
805 control3.SetProperty(Actor::Property::SIZE, Vector3(120, 120, 0));
806 Property::Map controlProperty3;
807 controlProperty3.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
808 controlProperty3.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
809 control3.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty3);
811 application.GetScene().Add(control1);
812 application.GetScene().Add(control2);
813 control2.Add(control3);
815 application.SendNotification();
816 application.Render(20);
818 Transition transition = Transition::New(control1, control2, true, TimePeriod(0.5f));
819 TransitionSet transitionSet = TransitionSet::New();
820 transitionSet.AddTransition(transition);
821 transitionSet.Play();
823 bool signalReceived(false);
824 TransitionFinishCheck finishCheck(signalReceived);
825 transitionSet.FinishedSignal().Connect(&application, finishCheck);
827 application.SendNotification();
828 application.Render(600);
830 // We didn't expect the animation to finish yet
831 application.SendNotification();
832 finishCheck.CheckSignalReceived();
834 application.SendNotification();
835 application.Render(20);
837 DALI_TEST_EQUALS(destinationPosition, control2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), TEST_LOCATION);
838 DALI_TEST_EQUALS(destinationWorldPosition, control2.GetProperty<Vector3>(Actor::Property::WORLD_POSITION), TEST_LOCATION);
843 int UtcDaliTransitionBetweenControlPairWithTreeWithChild(void)
845 ToolkitTestApplication application;
846 tet_infoline(" UtcDaliTransitionBetweenControlPairWithTreeWithChild");
848 Vector3 destinationWorldPosition(-80, -240, 0);
850 Control control1 = Control::New();
851 control1.SetProperty(Actor::Property::POSITION, Vector3(100, 200, 0));
852 control1.SetProperty(Actor::Property::SIZE, Vector3(150, 150, 0));
853 Property::Map controlProperty1;
854 controlProperty1.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
855 controlProperty1.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
856 control1.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty1);
858 Control control2 = Control::New();
859 control2.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
860 control2.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
861 control2.SetProperty(Actor::Property::POSITION, Vector3(50, 50, 0));
862 control2.SetProperty(Actor::Property::SIZE, Vector3(120, 120, 0));
863 Property::Map controlProperty2;
864 controlProperty2.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
865 controlProperty2.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
866 control2.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty2);
868 Control control3 = Control::New();
869 control3.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
870 control3.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
871 control3.SetProperty(Actor::Property::POSITION, Vector3(50, 50, 0));
872 control3.SetProperty(Actor::Property::SIZE, Vector3(120, 120, 0));
873 Property::Map controlProperty3;
874 controlProperty3.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
875 controlProperty3.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
876 control3.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty3);
878 application.GetScene().Add(control1);
879 application.GetScene().Add(control2);
880 control2.Add(control3);
882 application.SendNotification();
883 application.Render(20);
885 Transition transition = Transition::New(control1, control2, true, TimePeriod(0.5f));
886 transition.TransitionWithChild(true);
887 TransitionSet transitionSet = TransitionSet::New();
888 transitionSet.AddTransition(transition);
889 transitionSet.Play();
891 bool signalReceived(false);
892 TransitionFinishCheck finishCheck(signalReceived);
893 transitionSet.FinishedSignal().Connect(&application, finishCheck);
895 application.SendNotification();
896 application.Render(600);
898 // We didn't expect the animation to finish yet
899 application.SendNotification();
900 finishCheck.CheckSignalReceived();
902 application.SendNotification();
903 application.Render(20);
905 DALI_TEST_EQUALS(destinationWorldPosition, control3.GetProperty<Vector3>(Actor::Property::WORLD_POSITION), TEST_LOCATION);
910 int UtcDaliTransitionBetweenControlPairWithTreeWithoutPositionInheritance(void)
912 ToolkitTestApplication application;
913 tet_infoline(" UtcDaliTransitionBetweenControlPairWithTreeWithoutPositionInheritance");
915 Vector3 sourcePosition(50, 50, 0);
916 Vector3 destinationPosition(100, 100, 0);
918 Control control1 = Control::New();
919 control1.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
920 control1.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
921 control1.SetProperty(Actor::Property::POSITION, sourcePosition);
922 control1.SetProperty(Actor::Property::SIZE, Vector3(150, 150, 0));
923 Property::Map controlProperty1;
924 controlProperty1.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
925 controlProperty1.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
926 control1.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty1);
928 Control control2 = Control::New();
929 control2.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
930 control2.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
931 control2.SetProperty(Actor::Property::POSITION, Vector3(150, 150, 0));
932 control2.SetProperty(Actor::Property::SIZE, Vector3(120, 120, 0));
933 Property::Map controlProperty2;
934 controlProperty2.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
935 controlProperty2.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
936 control2.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty2);
938 Control control3 = Control::New();
939 control3.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
940 control3.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
941 control3.SetProperty(Actor::Property::POSITION, destinationPosition);
942 control3.SetProperty(Actor::Property::SIZE, Vector3(120, 120, 0));
943 Property::Map controlProperty3;
944 controlProperty3.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
945 controlProperty3.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
946 control3.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty3);
948 application.GetScene().Add(control1);
949 application.GetScene().Add(control2);
950 control2.Add(control3);
952 application.SendNotification();
953 application.Render(20);
955 Transition transition;
956 TransitionSet transitionSet;
957 bool signalReceived(false);
958 TransitionFinishCheck finishCheck(signalReceived);
960 // not inherit Position.
961 control3.SetProperty(Actor::Property::INHERIT_POSITION, false);
962 control3.SetProperty(Actor::Property::INHERIT_ORIENTATION, true);
963 control3.SetProperty(Actor::Property::INHERIT_SCALE, true);
965 transition = Transition::New(control1, control3, true, TimePeriod(0.5f));
966 transitionSet = TransitionSet::New();
967 transitionSet.AddTransition(transition);
968 transitionSet.Play();
969 transitionSet.FinishedSignal().Connect(&application, finishCheck);
971 application.SendNotification();
972 application.Render(300);
974 Vector3 currentPosition = control3.GetProperty<Vector3>(Actor::Property::WORLD_POSITION);
975 DALI_TEST_CHECK(currentPosition.x <= destinationPosition.x && currentPosition.x >= sourcePosition.x);
976 DALI_TEST_CHECK(currentPosition.y <= destinationPosition.y && currentPosition.y >= sourcePosition.y);
977 DALI_TEST_CHECK(currentPosition.z <= destinationPosition.z && currentPosition.z >= sourcePosition.z);
979 application.SendNotification();
980 application.Render(300);
982 // We didn't expect the animation to finish yet
983 application.SendNotification();
984 finishCheck.CheckSignalReceived();
986 application.SendNotification();
987 application.Render(20);
989 DALI_TEST_EQUALS(destinationPosition, control3.GetProperty<Vector3>(Actor::Property::WORLD_POSITION), TEST_LOCATION);
993 int UtcDaliTransitionBetweenControlPairWithTreeWithoutOrientationInheritance(void)
995 ToolkitTestApplication application;
996 tet_infoline(" UtcDaliTransitionBetweenControlPairWithTreeWithoutOrientationInheritance");
998 Radian sourceAngle(1.0f);
999 Radian destinationAngle(2.0f);
1000 Quaternion sourceOrientation(sourceAngle, Vector3::XAXIS);
1001 Quaternion destinationOrientation(destinationAngle, Vector3::XAXIS);
1003 Control control1 = Control::New();
1004 control1.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
1005 control1.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
1006 control1.SetProperty(Actor::Property::ORIENTATION, sourceOrientation);
1007 control1.SetProperty(Actor::Property::SIZE, Vector3(150, 150, 0));
1008 Property::Map controlProperty1;
1009 controlProperty1.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
1010 controlProperty1.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
1011 control1.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty1);
1013 Control control2 = Control::New();
1014 control2.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
1015 control2.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
1016 control2.SetProperty(Actor::Property::ORIENTATION, Quaternion(Radian(2.0f), Vector3::XAXIS));
1017 control2.SetProperty(Actor::Property::SIZE, Vector3(120, 120, 0));
1018 Property::Map controlProperty2;
1019 controlProperty2.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
1020 controlProperty2.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
1021 control2.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty2);
1023 Control control3 = Control::New();
1024 control3.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
1025 control3.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
1026 control3.SetProperty(Actor::Property::ORIENTATION, destinationOrientation);
1027 control3.SetProperty(Actor::Property::SIZE, Vector3(120, 120, 0));
1028 Property::Map controlProperty3;
1029 controlProperty3.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
1030 controlProperty3.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
1031 control3.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty3);
1033 // not inherit Orientation.
1034 control3.SetProperty(Actor::Property::INHERIT_POSITION, true);
1035 control3.SetProperty(Actor::Property::INHERIT_ORIENTATION, false);
1036 control3.SetProperty(Actor::Property::INHERIT_SCALE, true);
1038 Vector3 currentAxis;
1039 Radian currentRadian;
1041 application.GetScene().Add(control1);
1042 application.GetScene().Add(control2);
1043 control2.Add(control3);
1045 application.SendNotification();
1046 application.Render(20);
1048 Quaternion currentOrientation = control3.GetProperty<Quaternion>(Actor::Property::WORLD_ORIENTATION);
1049 DALI_TEST_EQUALS(currentOrientation, destinationOrientation, 0.0001f, TEST_LOCATION);
1051 Transition transition;
1052 TransitionSet transitionSet;
1053 bool signalReceived(false);
1054 TransitionFinishCheck finishCheck(signalReceived);
1056 transition = Transition::New(control1, control3, true, TimePeriod(0.5f));
1057 transitionSet = TransitionSet::New();
1058 transitionSet.AddTransition(transition);
1059 transitionSet.Play();
1060 transitionSet.FinishedSignal().Connect(&application, finishCheck);
1062 application.SendNotification();
1063 application.Render(300);
1065 currentOrientation = control3.GetProperty<Quaternion>(Actor::Property::WORLD_ORIENTATION);
1066 DALI_TEST_NOT_EQUALS(currentOrientation, destinationOrientation, 0.0001f, TEST_LOCATION);
1068 application.SendNotification();
1069 application.Render(300);
1071 // We didn't expect the animation to finish yet
1072 application.SendNotification();
1073 finishCheck.CheckSignalReceived();
1075 application.SendNotification();
1076 application.Render(20);
1078 currentOrientation = control3.GetProperty<Quaternion>(Actor::Property::WORLD_ORIENTATION);
1079 DALI_TEST_EQUALS(currentOrientation, destinationOrientation, 0.0001f, TEST_LOCATION);
1084 int UtcDaliTransitionBetweenControlPairWithTreeWithoutScaleInheritance(void)
1086 ToolkitTestApplication application;
1087 tet_infoline(" UtcDaliTransitionBetweenControlPairWithTreeWithoutOrientationInheritance");
1089 Vector3 sourceScale(1, 1, 1);
1090 Vector3 destinationScale(2, 2, 1);
1092 Control control1 = Control::New();
1093 control1.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
1094 control1.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
1095 control1.SetProperty(Actor::Property::SCALE, sourceScale);
1096 control1.SetProperty(Actor::Property::SIZE, Vector3(150, 150, 0));
1097 Property::Map controlProperty1;
1098 controlProperty1.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
1099 controlProperty1.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
1100 control1.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty1);
1102 Control control2 = Control::New();
1103 control2.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
1104 control2.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
1105 control2.SetProperty(Actor::Property::SCALE, Vector3(3, 3, 1));
1106 control2.SetProperty(Actor::Property::SIZE, Vector3(120, 120, 0));
1107 Property::Map controlProperty2;
1108 controlProperty2.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
1109 controlProperty2.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
1110 control2.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty2);
1112 Control control3 = Control::New();
1113 control3.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
1114 control3.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
1115 control3.SetProperty(Actor::Property::SCALE, destinationScale);
1116 control3.SetProperty(Actor::Property::SIZE, Vector3(120, 120, 0));
1117 Property::Map controlProperty3;
1118 controlProperty3.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
1119 controlProperty3.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
1120 control3.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty3);
1122 // not inherit Orientation.
1123 control3.SetProperty(Actor::Property::INHERIT_POSITION, true);
1124 control3.SetProperty(Actor::Property::INHERIT_ORIENTATION, true);
1125 control3.SetProperty(Actor::Property::INHERIT_SCALE, false);
1127 application.GetScene().Add(control1);
1128 application.GetScene().Add(control2);
1129 control2.Add(control3);
1131 application.SendNotification();
1132 application.Render(20);
1134 Vector3 currentScale = control3.GetProperty<Vector3>(Actor::Property::WORLD_SCALE);
1135 DALI_TEST_EQUALS(currentScale, destinationScale, 0.0001f, TEST_LOCATION);
1137 Transition transition;
1138 TransitionSet transitionSet;
1139 bool signalReceived(false);
1140 TransitionFinishCheck finishCheck(signalReceived);
1142 transition = Transition::New(control1, control3, true, TimePeriod(0.5f));
1143 transitionSet = TransitionSet::New();
1144 transitionSet.AddTransition(transition);
1145 transitionSet.Play();
1146 transitionSet.FinishedSignal().Connect(&application, finishCheck);
1148 application.SendNotification();
1149 application.Render(300);
1151 currentScale = control3.GetProperty<Vector3>(Actor::Property::WORLD_SCALE);
1152 DALI_TEST_CHECK(currentScale.x <= destinationScale.x && currentScale.x >= sourceScale.x);
1153 DALI_TEST_CHECK(currentScale.y <= destinationScale.y && currentScale.y >= sourceScale.y);
1154 DALI_TEST_CHECK(currentScale.z <= destinationScale.z && currentScale.z >= sourceScale.z);
1156 application.SendNotification();
1157 application.Render(300);
1159 // We didn't expect the animation to finish yet
1160 application.SendNotification();
1161 finishCheck.CheckSignalReceived();
1163 application.SendNotification();
1164 application.Render(20);
1166 currentScale = control3.GetProperty<Vector3>(Actor::Property::WORLD_SCALE);
1167 DALI_TEST_EQUALS(currentScale, destinationScale, 0.0001f, TEST_LOCATION);
1172 int UtcDaliMultipleTransitionAppearing(void)
1174 ToolkitTestApplication application;
1175 tet_infoline("UtcDaliMultipleTransitionAppearing");
1177 Control control = Control::New();
1178 control.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
1179 control.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
1180 control.SetProperty(Actor::Property::POSITION, Vector3(100, 200, 0));
1181 control.SetProperty(Actor::Property::SIZE, Vector3(150, 150, 0));
1182 Property::Map controlProperty;
1183 controlProperty.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
1184 controlProperty.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
1185 control.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty);
1187 application.GetScene().Add(control);
1189 application.SendNotification();
1190 application.Render(20);
1192 DALI_TEST_EQUALS(1.0f, control.GetCurrentProperty<float>(Actor::Property::OPACITY), TEST_LOCATION);
1194 TransitionSet transitionSet = TransitionSet::New();
1195 FadeTransition fade = FadeTransition::New(control, 0.5, TimePeriod(1.0f, 1.0f));
1196 fade.SetAppearingTransition(true); // set fade in
1197 transitionSet.AddTransition(fade);
1198 SlideTransition slide = SlideTransition::New(control, Dali::Toolkit::SlideTransitionDirection::BOTTOM, TimePeriod(0.5f, 1.0f));
1199 slide.SetAppearingTransition(true); // set slide
1200 transitionSet.AddTransition(slide);
1201 transitionSet.Play();
1203 bool signalReceived(false);
1204 TransitionFinishCheck finishCheck(signalReceived);
1205 transitionSet.FinishedSignal().Connect(&application, finishCheck);
1207 application.SendNotification();
1208 application.Render(300);
1210 float currentOpacity = control.GetCurrentProperty<float>(Actor::Property::OPACITY);
1211 DALI_TEST_CHECK(currentOpacity == 0.0f);
1213 application.SendNotification();
1214 application.Render(400);
1216 currentOpacity = control.GetCurrentProperty<float>(Actor::Property::OPACITY);
1217 DALI_TEST_CHECK(currentOpacity == 0.5f);
1219 application.SendNotification();
1220 application.Render(500);
1222 currentOpacity = control.GetCurrentProperty<float>(Actor::Property::OPACITY);
1223 DALI_TEST_CHECK(currentOpacity > 0.5f && currentOpacity < 1.0f);
1225 application.SendNotification();
1226 application.Render(500);
1228 currentOpacity = control.GetCurrentProperty<float>(Actor::Property::OPACITY);
1229 DALI_TEST_CHECK(currentOpacity > 0.5f && currentOpacity < 1.0f);
1231 // We didn't expect the animation to finish yet
1232 application.SendNotification();
1233 finishCheck.CheckSignalNotReceived();
1235 application.SendNotification();
1236 application.Render(500);
1238 // We did expect the animation to finish
1239 application.SendNotification();
1240 finishCheck.CheckSignalReceived();
1242 application.SendNotification();
1243 application.Render(20);
1245 DALI_TEST_EQUALS(1.0f, control.GetCurrentProperty<float>(Actor::Property::OPACITY), TEST_LOCATION);