2 * Copyright (c) 2020 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.
19 #include <dali-toolkit-test-suite-utils.h>
21 #include <dali/devel-api/rendering/renderer-devel.h>
22 #include <dali-toolkit/dali-toolkit.h>
23 #include <dali-toolkit/devel-api/visual-factory/transition-data.h>
24 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
25 #include "dummy-control.h"
28 using namespace Toolkit;
31 void utc_dali_toolkit_transition_data_startup(void)
33 test_return_value = TET_UNDEF;
36 void utc_dali_toolkit_transition_data_cleanup(void)
38 test_return_value = TET_PASS;
41 Property::Map CreateMap()
45 map["target"] = "Actor1";
46 map["property"] = "color";
47 map["initialValue"] = Color::MAGENTA;
48 map["targetValue"] = Color::RED;
49 map["animator"] = Property::Map()
50 .Add("alphaFunction", "EASE_IN_OUT_BACK")
51 .Add("timePeriod", Property::Map()
53 .Add("duration", 1.0f));
57 void CHECK_ARRAY_EQUALS( Property::Array test, Property::Value result )
59 if( result.GetType() == Property::ARRAY )
62 Property::Array *resultArray = result.GetArray();
63 DALI_TEST_EQUALS( test.Count(), resultArray->Count(), TEST_LOCATION );
64 for( size_t i=0; i < std::min(test.Count(), resultArray->Count()); ++i )
66 Property::Value a = test.GetElementAt(i);
67 Property::Value b = resultArray->GetElementAt(i);
68 DALI_TEST_EQUALS( a.GetType(), b.GetType(), TEST_LOCATION );
69 DALI_TEST_EQUALS( a, b, 0.001, TEST_LOCATION );
72 else if( result.GetType() == Property::VECTOR4 )
74 Vector4 value = result.Get<Vector4>();
75 DALI_TEST_CHECK( test.Count() >= 4 );
76 for( size_t i=0; i < 4; ++i )
78 Property::Value a = test.GetElementAt(i);
79 DALI_TEST_EQUALS( a.GetType(), Property::FLOAT, TEST_LOCATION );
80 DALI_TEST_EQUALS( a.Get<float>(), value[i], 0.001, TEST_LOCATION );
89 void CHECK_MAP_EQUALS( Property::Map test, Property::Map result )
91 DALI_TEST_EQUALS(test.Count(), result.Count(), TEST_LOCATION);
93 for( unsigned int i=0; i< test.Count(); ++i )
95 KeyValuePair keyValue = test.GetKeyValue(i);
96 Property::Value* value;
98 if( keyValue.first.type == Property::Key::STRING )
100 value = result.Find(keyValue.first.stringKey);
104 value = result.Find(keyValue.first.indexKey);
107 DALI_TEST_CHECK( value != NULL );
110 if( keyValue.second.GetType() == Property::MAP )
112 DALI_TEST_EQUALS( keyValue.second.GetType(), value->GetType(), TEST_LOCATION );
113 CHECK_MAP_EQUALS( *(keyValue.second.GetMap()), *(value->GetMap()) );
115 else if( keyValue.second.GetType() == Property::ARRAY )
117 CHECK_ARRAY_EQUALS( *(keyValue.second.GetArray()), *value );
119 else if( keyValue.second.GetType() == Property::STRING )
121 DALI_TEST_EQUALS( keyValue.second.GetType(), value->GetType(), TEST_LOCATION );
124 DALI_TEST_EQUALS( keyValue.second, str.c_str(), TEST_LOCATION );
128 DALI_TEST_EQUALS( keyValue.second.GetType(), value->GetType(), TEST_LOCATION );
129 DALI_TEST_EQUALS( keyValue.second, *value, 0.001f, TEST_LOCATION );
136 int UtcDaliTransitionDataNew(void)
138 ToolkitTestApplication application;
140 Property::Map map = CreateMap();
141 Dali::Toolkit::TransitionData transition = TransitionData::New( map );
142 DALI_TEST_CHECK( transition );
147 int UtcDaliTransitionDataDownCast(void)
149 ToolkitTestApplication application;
151 Property::Map map = CreateMap();
153 BaseHandle handle = TransitionData::New( map );
154 DALI_TEST_CHECK( handle );
156 TransitionData transitionData = TransitionData::DownCast( handle );
157 DALI_TEST_CHECK( transitionData );
161 int UtcDaliTransitionDataCopyConstructor(void)
163 ToolkitTestApplication application;
165 Property::Map map = CreateMap();
167 TransitionData transitionData = TransitionData::New( map );
168 DALI_TEST_CHECK( transitionData );
170 TransitionData td2( transitionData );
171 DALI_TEST_CHECK( td2 );
172 DALI_TEST_EQUALS( td2.Count(), 1, TEST_LOCATION );
176 int UtcDaliTransitionDataAssignmentOperator(void)
178 ToolkitTestApplication application;
180 Property::Map map = CreateMap();
182 TransitionData transitionData = TransitionData::New( map );
183 DALI_TEST_CHECK( transitionData );
186 DALI_TEST_CHECK( !td2 );
188 td2 = transitionData;
189 DALI_TEST_CHECK( td2 );
191 DALI_TEST_EQUALS( td2.Count(), 1, TEST_LOCATION );
195 int UtcDaliTransitionDataCount(void)
197 ToolkitTestApplication application;
199 Property::Map map = CreateMap();
200 TransitionData transitionData = TransitionData::New( map );
201 DALI_TEST_CHECK( transitionData );
202 DALI_TEST_EQUALS( transitionData.Count(), 1, TEST_LOCATION );
204 Property::Array array;
205 array.PushBack( map );
206 array.PushBack( map );
207 array.PushBack( map );
209 TransitionData transitionData2 = TransitionData::New( array );
210 DALI_TEST_CHECK( transitionData2 );
211 DALI_TEST_EQUALS( transitionData2.Count(), 3, TEST_LOCATION );
216 int UtcDaliTransitionDataMap1P(void)
218 ToolkitTestApplication application;
220 tet_printf("Testing animation of a visual property using stylesheet equivalent maps\n");
223 map["target"] = "visual1";
224 map["property"] = "mixColor";
225 map["initialValue"] = Color::MAGENTA;
226 map["targetValue"] = Color::RED;
227 map["animator"] = Property::Map()
228 .Add("alphaFunction", "EASE_IN_OUT")
229 .Add("timePeriod", Property::Map()
231 .Add("duration", 1.0f));
233 Dali::Toolkit::TransitionData transition = TransitionData::New( map );
235 DummyControl actor = DummyControl::New();
236 actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
237 actor.SetProperty( Dali::Actor::Property::NAME,"Actor1");
238 actor.SetProperty( Actor::Property::COLOR,Color::CYAN);
239 application.GetScene().Add(actor);
241 DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
243 Property::Map visualMap;
244 visualMap[Visual::Property::TYPE] = Visual::COLOR;
245 visualMap[ColorVisual::Property::MIX_COLOR] = Color::MAGENTA;
246 Visual::Base visual = VisualFactory::Get().CreateVisual( visualMap );
247 visual.SetName( "visual1" );
249 Property::Index visualIndex = Control::CONTROL_PROPERTY_END_INDEX + 1;
250 dummyImpl.RegisterVisual( visualIndex, visual );
252 Animation anim = dummyImpl.CreateTransition( transition );
253 DALI_TEST_CHECK( anim );
255 Renderer renderer = actor.GetRendererAt(0);
256 Property::Index mixColorIndex = renderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR );
257 application.SendNotification();
258 application.Render(0);
260 DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION);
261 DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA), TEST_LOCATION );
262 DALI_TEST_EQUALS( renderer.GetProperty<float>( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION );
263 DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION );
267 application.SendNotification();
268 application.Render(500); // Start animation
269 application.Render(500); // Halfway thru anim
270 application.SendNotification();
271 DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA+Color::RED)*0.5f, TEST_LOCATION);
272 DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION );
274 application.Render(500); // End of anim
275 application.SendNotification();
276 DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::RED), TEST_LOCATION );
277 DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION );
284 int UtcDaliTransitionDataMap2P(void)
286 ToolkitTestApplication application;
288 tet_printf("Testing animation of a visual property using programmatic maps\n");
291 map["target"] = "visual1";
292 map["property"] = ColorVisual::Property::MIX_COLOR;
293 map["initialValue"] = Color::MAGENTA;
294 map["targetValue"] = Color::RED;
295 map["animator"] = Property::Map()
296 .Add("alphaFunction", "LINEAR")
297 .Add("timePeriod", Property::Map()
299 .Add("duration", 1.0f));
301 Dali::Toolkit::TransitionData transition = TransitionData::New( map );
303 DummyControl actor = DummyControl::New();
304 actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
305 actor.SetProperty( Dali::Actor::Property::NAME,"Actor1");
306 actor.SetProperty( Actor::Property::COLOR,Color::CYAN);
307 application.GetScene().Add(actor);
309 DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
311 Property::Map visualMap;
312 visualMap[Visual::Property::TYPE] = Visual::COLOR;
313 visualMap[ColorVisual::Property::MIX_COLOR] = Color::MAGENTA;
314 Visual::Base visual = VisualFactory::Get().CreateVisual( visualMap );
315 visual.SetName( "visual1" );
317 Property::Index visualIndex = Control::CONTROL_PROPERTY_END_INDEX + 1;
318 dummyImpl.RegisterVisual( visualIndex, visual );
320 Animation anim = dummyImpl.CreateTransition( transition );
321 DALI_TEST_CHECK( anim );
323 Renderer renderer = actor.GetRendererAt(0);
324 Property::Index mixColorIndex = renderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR );
325 application.SendNotification();
326 application.Render(0);
328 DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION);
329 DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA), TEST_LOCATION );
330 DALI_TEST_EQUALS( renderer.GetProperty<float>( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION );
331 DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION );
335 application.SendNotification();
336 application.Render(0);
337 application.Render(500); // Start animation
338 application.Render(500); // Halfway thru anim
339 application.SendNotification();
340 DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA+Color::RED)*0.5f, TEST_LOCATION);
341 DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION);
343 application.Render(500); // End of anim
344 application.SendNotification();
345 DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::RED), TEST_LOCATION );
346 DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION);
352 int UtcDaliTransitionDataMap2Pb(void)
354 ToolkitTestApplication application;
356 tet_printf("Testing animation of a visual property using programmatic maps\n");
359 map["target"] = "visual1";
360 map["property"] = PrimitiveVisual::Property::MIX_COLOR;
361 map["initialValue"] = Color::MAGENTA;
362 map["targetValue"] = Color::RED;
363 map["animator"] = Property::Map()
364 .Add("alphaFunction", "LINEAR")
365 .Add("timePeriod", Property::Map()
367 .Add("duration", 1.0f));
369 Dali::Toolkit::TransitionData transition = TransitionData::New( map );
371 DummyControl actor = DummyControl::New();
372 actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
373 actor.SetProperty( Dali::Actor::Property::NAME,"Actor1");
374 actor.SetProperty( Actor::Property::COLOR,Color::CYAN);
375 application.GetScene().Add(actor);
377 DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
379 Property::Map visualMap;
380 visualMap[Visual::Property::TYPE] = Visual::PRIMITIVE;
381 visualMap[PrimitiveVisual::Property::MIX_COLOR] = Color::MAGENTA;
382 visualMap[ PrimitiveVisual::Property::SHAPE ] = PrimitiveVisual::Shape::SPHERE;
383 visualMap[ PrimitiveVisual::Property::SLICES ] = 10;
384 visualMap[ PrimitiveVisual::Property::STACKS ] = 10;
386 Visual::Base visual = VisualFactory::Get().CreateVisual( visualMap );
387 visual.SetName( "visual1" );
389 Property::Index visualIndex = Control::CONTROL_PROPERTY_END_INDEX + 1;
390 dummyImpl.RegisterVisual( visualIndex, visual );
392 Animation anim = dummyImpl.CreateTransition( transition );
393 DALI_TEST_CHECK( anim );
395 Renderer renderer = actor.GetRendererAt(0);
396 Property::Index mixColorIndex = renderer.GetPropertyIndex( PrimitiveVisual::Property::MIX_COLOR );
397 application.SendNotification();
398 application.Render(0);
400 DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION);
401 DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA), TEST_LOCATION );
402 DALI_TEST_EQUALS( renderer.GetProperty<float>( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION );
403 DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION );
407 application.SendNotification();
408 application.Render(0);
409 application.Render(500); // Start animation
410 application.Render(500); // Halfway thru anim
411 application.SendNotification();
412 DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA+Color::RED)*0.5f, TEST_LOCATION);
413 DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION);
415 application.Render(500); // End of anim
416 application.SendNotification();
417 DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::RED), TEST_LOCATION );
418 DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION);
424 int UtcDaliTransitionDataMap3P(void)
426 ToolkitTestApplication application;
428 tet_printf("Testing animation of an actor's position property using bezier curve\n");
431 map["target"] = "Actor1";
432 map["property"] = "position";
433 map["initialValue"] = Vector3(0, 0, 0);
434 map["targetValue"] = Vector3(100, 100, 0);
435 map["animator"] = Property::Map()
436 .Add("alphaFunction", Vector4(0.71, -0.57, 0.42, 1.38) )
437 .Add("timePeriod", Property::Map()
439 .Add("duration", 1.0f));
441 Dali::Toolkit::TransitionData transition = TransitionData::New( map );
443 DummyControl actor = DummyControl::New();
444 actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
445 actor.SetProperty( Dali::Actor::Property::NAME,"Actor1");
446 application.GetScene().Add(actor);
448 DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
449 Animation anim = dummyImpl.CreateTransition( transition );
450 DALI_TEST_CHECK( anim );
452 application.SendNotification();
453 application.Render(0);
454 DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0,0,0), 0.001f, TEST_LOCATION);
458 application.SendNotification();
459 application.Render(0);
461 application.Render(250); // 25%
462 application.SendNotification();
463 DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(-10,-10,0), 1.0, TEST_LOCATION); // High epsilon as we don't have exact figure for bezier curve at 50%
465 application.Render(250); // Halfway thru map1 anim
466 application.SendNotification();
467 DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(24,24,0), 1.0, TEST_LOCATION); // High epsilon as we don't have exact figure for bezier curve at 50%
469 application.Render(250); // End of map1 anim
470 application.SendNotification();
471 DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(100,100,0), 1.0, TEST_LOCATION); // High epsilon as we don't have exact figure for bezier curve
473 application.Render(250); // End of map1 anim
474 application.SendNotification();
475 DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(100,100,0), TEST_LOCATION );
480 int UtcDaliTransitionDataMap4P(void)
482 ToolkitTestApplication application;
484 tet_printf("Testing animation of a visual's transform property using programmatic maps\n");
487 map1["target"] = "testVisual";
488 map1["property"] = "offset";
489 map1["initialValue"] = Vector2(0.0f, 0.0f);
490 map1["targetValue"] = Vector2(100.0f, 100.0f);
491 map1["animator"] = Property::Map()
492 .Add("alphaFunction", "LINEAR")
493 .Add("timePeriod", Property::Map()
495 .Add("duration", 1.0f));
498 map2["target"] = "testVisual";
499 map2["property"] = "size";
500 map2["initialValue"] = Vector2(10.0f, 10.0f);
501 map2["targetValue"] = Vector2(110.0f, 110.0f);
502 map2["animator"] = Property::Map()
503 .Add("alphaFunction", "LINEAR")
504 .Add("timePeriod", Property::Map()
506 .Add("duration", 1.0f));
508 Dali::Toolkit::TransitionData transition = TransitionData::New( Property::Array().Add(map1).Add(map2) );
510 DummyControl actor = DummyControl::New();
511 actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
512 actor.SetProperty( Dali::Actor::Property::NAME,"Actor1");
513 application.GetScene().Add(actor);
515 DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
517 Property::Map visualMap;
518 visualMap[Visual::Property::TYPE] = Visual::COLOR;
519 visualMap[ColorVisual::Property::MIX_COLOR] = Color::MAGENTA;
520 Visual::Base visual = VisualFactory::Get().CreateVisual( visualMap );
522 visual.SetName( "testVisual" );
523 dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
525 Animation anim = dummyImpl.CreateTransition( transition );
526 DALI_TEST_CHECK( anim );
528 Renderer renderer = actor.GetRendererAt(0);
529 Property::Index sizeIndex = renderer.GetPropertyIndex( "size" );
530 application.SendNotification();
531 application.Render(0);
533 DALI_TEST_EQUALS( renderer.GetProperty<Vector2>(sizeIndex), Vector2(10.0f, 10.0f), TEST_LOCATION);
534 DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector2 >( sizeIndex ), Vector2(10.0f, 10.0f), TEST_LOCATION);
538 application.SendNotification();
539 application.Render(0);
540 application.Render(500); // Start animation
541 application.Render(500); // Halfway thru anim
542 application.SendNotification();
543 DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector2 >( sizeIndex ), Vector2(60.0f, 60.0f), TEST_LOCATION);
545 application.Render(500); // End of anim
546 application.SendNotification();
547 DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector2 >( sizeIndex ), Vector2(110.0f, 110.0f), TEST_LOCATION );
552 int UtcDaliTransitionDataMap5P(void)
554 ToolkitTestApplication application;
556 tet_printf("Testing animation visual opacity using stylesheet equivalent maps\n");
559 map["target"] = "visual1";
560 map["property"] = "opacity";
561 map["initialValue"] = 0.0f;
562 map["targetValue"] = 1.0f;
563 map["animator"] = Property::Map()
564 .Add("alphaFunction", "EASE_IN_OUT")
565 .Add("timePeriod", Property::Map()
567 .Add("duration", 1.0f));
569 Dali::Toolkit::TransitionData transition = TransitionData::New( map );
571 DummyControl actor = DummyControl::New();
572 actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
573 actor.SetProperty( Dali::Actor::Property::NAME,"Actor1");
574 actor.SetProperty( Actor::Property::COLOR,Color::CYAN);
575 application.GetScene().Add(actor);
577 DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
579 Property::Map visualMap;
580 visualMap[Visual::Property::TYPE] = Visual::COLOR;
581 visualMap[ColorVisual::Property::MIX_COLOR] = Color::MAGENTA;
582 Visual::Base visual = VisualFactory::Get().CreateVisual( visualMap );
583 visual.SetName( "visual1" );
585 Property::Index visualIndex = Control::CONTROL_PROPERTY_END_INDEX + 1;
586 dummyImpl.RegisterVisual( visualIndex, visual );
588 Animation anim = dummyImpl.CreateTransition( transition );
589 DALI_TEST_CHECK( anim );
591 Renderer renderer = actor.GetRendererAt(0);
592 Property::Index mixColorIndex = renderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR );
593 application.SendNotification();
594 application.Render(0);
596 DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION);
597 DALI_TEST_EQUALS( renderer.GetProperty<float>( DevelRenderer::Property::OPACITY ), 0.0f, 0.001f, TEST_LOCATION );
598 DALI_TEST_EQUALS( renderer.GetProperty<int>(Renderer::Property::BLEND_MODE), (int)BlendMode::ON, TEST_LOCATION );
600 DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA), TEST_LOCATION);
601 DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 0.0f, 0.001f, TEST_LOCATION );
602 DALI_TEST_EQUALS( renderer.GetCurrentProperty< int >( Renderer::Property::BLEND_MODE ), (int)BlendMode::ON, TEST_LOCATION );
606 application.SendNotification();
607 application.Render(500); // Start animation
608 application.Render(500); // Halfway thru anim
609 application.SendNotification();
610 DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA), TEST_LOCATION);
611 DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 0.5f, 0.001f, TEST_LOCATION );
612 DALI_TEST_EQUALS( renderer.GetCurrentProperty< int >( Renderer::Property::BLEND_MODE ), (int)BlendMode::ON, TEST_LOCATION );
614 application.Render(501); // End of anim
615 application.SendNotification();
616 application.Render();
617 DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA), TEST_LOCATION );
618 DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION );
619 DALI_TEST_EQUALS( renderer.GetCurrentProperty< int >( Renderer::Property::BLEND_MODE ), (int)BlendMode::AUTO, TEST_LOCATION );
625 int UtcDaliTransitionDataMap6P(void)
627 ToolkitTestApplication application;
629 tet_printf("Testing animation visual opacity using stylesheet equivalent maps\n");
632 map["target"] = "visual1";
633 map["property"] = "opacity";
634 map["targetValue"] = 0.0f;
635 map["animator"] = Property::Map()
636 .Add("alphaFunction", "EASE_IN_OUT")
637 .Add("timePeriod", Property::Map()
639 .Add("duration", 1.0f));
641 Dali::Toolkit::TransitionData transition = TransitionData::New( map );
643 DummyControl actor = DummyControl::New();
644 actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
645 actor.SetProperty( Dali::Actor::Property::NAME,"Actor1");
646 actor.SetProperty( Actor::Property::COLOR,Color::CYAN);
647 application.GetScene().Add(actor);
649 DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
651 Property::Map visualMap;
652 visualMap[Visual::Property::TYPE] = Visual::COLOR;
653 visualMap[ColorVisual::Property::MIX_COLOR] = Color::MAGENTA;
654 Visual::Base visual = VisualFactory::Get().CreateVisual( visualMap );
655 visual.SetName( "visual1" );
657 Property::Index visualIndex = Control::CONTROL_PROPERTY_END_INDEX + 1;
658 dummyImpl.RegisterVisual( visualIndex, visual );
660 Animation anim = dummyImpl.CreateTransition( transition );
661 DALI_TEST_CHECK( anim );
663 Renderer renderer = actor.GetRendererAt(0);
664 Property::Index mixColorIndex = renderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR );
665 application.SendNotification();
666 application.Render(0);
668 DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION);
669 DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA), TEST_LOCATION);
670 DALI_TEST_EQUALS( renderer.GetProperty<float>( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION );
671 DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION );
673 // Note, This should be testing for AUTO
674 // this is the same problem as C# target value being set before Play is called.
675 // @todo How was this solved?
676 DALI_TEST_EQUALS( renderer.GetProperty<int>(Renderer::Property::BLEND_MODE), (int)BlendMode::ON, TEST_LOCATION );
677 DALI_TEST_EQUALS( renderer.GetCurrentProperty< int >( Renderer::Property::BLEND_MODE ), (int)BlendMode::ON, TEST_LOCATION );
681 application.SendNotification();
682 application.Render(500); // Start animation
683 application.Render(500); // Halfway thru anim
684 application.SendNotification();
685 DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA), TEST_LOCATION);
686 DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 0.5f, 0.001f, TEST_LOCATION );
687 DALI_TEST_EQUALS( renderer.GetCurrentProperty< int >( Renderer::Property::BLEND_MODE ), (int)BlendMode::ON, TEST_LOCATION );
689 application.Render(500); // End of anim
690 application.SendNotification();
691 DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA), TEST_LOCATION );
692 DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 0.0f, 0.001f, TEST_LOCATION );
693 DALI_TEST_EQUALS( renderer.GetCurrentProperty< int >( Renderer::Property::BLEND_MODE ), (int)BlendMode::ON, TEST_LOCATION );
699 int UtcDaliTransitionDataMap1N(void)
701 ToolkitTestApplication application;
704 map["target"] = "Actor1";
705 map["property"] = "randomProperty";
706 map["initialValue"] = Color::MAGENTA;
707 map["targetValue"] = Color::RED;
708 map["animator"] = Property::Map()
709 .Add("alphaFunction", "EASE_OUT")
710 .Add("timePeriod", Property::Map()
712 .Add("duration", 1.0f));
714 Dali::Toolkit::TransitionData transition = TransitionData::New( map );
716 DummyControl actor = DummyControl::New();
717 actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
718 actor.SetProperty( Dali::Actor::Property::NAME,"Actor1");
719 actor.SetProperty( Actor::Property::COLOR,Color::CYAN);
720 application.GetScene().Add(actor);
722 DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
723 Animation anim = dummyImpl.CreateTransition( transition );
724 DALI_TEST_CHECK( ! anim );
726 CHECK_MAP_EQUALS( map, transition.GetAnimatorAt(0) );
731 int UtcDaliTransitionDataMapN3(void)
733 ToolkitTestApplication application;
735 tet_printf("Testing visual lookup with no renderers\n");
738 map["target"] = "visual1";
739 map["property"] = "mixColor";
740 map["initialValue"] = Vector3(Color::MAGENTA);
741 map["targetValue"] = Vector3(Color::RED);
742 map["animator"] = Property::Map()
743 .Add("alphaFunction", "EASE_OUT_BACK")
744 .Add("timePeriod", Property::Map()
746 .Add("duration", 1.0f));
748 Dali::Toolkit::TransitionData transition = TransitionData::New( map );
749 CHECK_MAP_EQUALS( map, transition.GetAnimatorAt(0) );
751 DummyControl actor = DummyControl::New();
752 actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
753 actor.SetProperty( Dali::Actor::Property::NAME,"Actor1");
754 actor.SetProperty( Actor::Property::COLOR,Color::CYAN);
757 DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
758 Property::Map visualMap;
759 visualMap[Visual::Property::TYPE] = Visual::COLOR;
760 visualMap[ColorVisual::Property::MIX_COLOR] = Vector3(Color::MAGENTA);
761 Visual::Base visual = VisualFactory::Get().CreateVisual( visualMap );
762 visual.SetName( "visual1" );
764 Property::Index visualIndex = Control::CONTROL_PROPERTY_END_INDEX + 1;
765 dummyImpl.RegisterVisual( visualIndex, visual );
767 Animation anim = dummyImpl.CreateTransition( transition );
768 DALI_TEST_CHECK( !anim );
773 int UtcDaliTransitionDataMapN4(void)
775 ToolkitTestApplication application;
777 tet_printf("Testing visual doesn't animate with duff bezier data \n");
780 map["target"] = "visual1";
781 map["property"] = "mixColor";
782 map["initialValue"] = Vector3(Color::MAGENTA);
783 map["targetValue"] = Vector3(Color::RED);
784 map["animator"] = Property::Map()
785 .Add("alphaFunction", Vector3(.1f,1.0f,0.5f))
786 .Add("timePeriod", Property::Map()
788 .Add("duration", 1.0f));
790 Dali::Toolkit::TransitionData transition = TransitionData::New( map );
792 DummyControl actor = DummyControl::New();
793 actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
794 actor.SetProperty( Dali::Actor::Property::NAME,"Actor1");
795 actor.SetProperty( Actor::Property::COLOR,Color::CYAN);
796 application.GetScene().Add(actor);
798 DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
799 Property::Map visualMap;
800 visualMap[Visual::Property::TYPE] = Visual::COLOR;
801 visualMap[ColorVisual::Property::MIX_COLOR] = Color::MAGENTA;
802 Visual::Base visual = VisualFactory::Get().CreateVisual( visualMap );
803 visual.SetName( "visual1" );
805 Property::Index visualIndex = Control::CONTROL_PROPERTY_END_INDEX + 1;
806 dummyImpl.RegisterVisual( visualIndex, visual );
808 Animation anim = dummyImpl.CreateTransition( transition );
809 DALI_TEST_CHECK( !anim );
811 application.SendNotification();
812 application.Render(0);
813 application.SendNotification();
815 Renderer renderer = actor.GetRendererAt(0);
816 Property::Index mixColorIdx = renderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR );
818 tet_printf( "Test that the property has been set to target value\n");
819 DALI_TEST_EQUALS(renderer.GetProperty<Vector3>(mixColorIdx), Vector3(Color::RED), 0.001, TEST_LOCATION);
820 DALI_TEST_EQUALS(renderer.GetProperty<float>( DevelRenderer::Property::OPACITY ), 1.0f, 0.001, TEST_LOCATION);
825 int UtcDaliTransitionDataMapN5(void)
827 ToolkitTestApplication application;
829 tet_printf("Testing visual doesn't animate with duff bezier data \n");
832 map["target"] = "visual1";
833 map["property"] = "mixColor";
834 map["initialValue"] = Color::MAGENTA;
835 map["targetValue"] = Color::RED;
836 map["animator"] = Property::Map()
837 .Add("alphaFunction", Property::Array().Add(.1f).Add(1.0f).Add(0.5f))
838 .Add("timePeriod", Property::Map()
840 .Add("duration", 1.0f));
842 Dali::Toolkit::TransitionData transition = TransitionData::New( map );
844 DummyControl actor = DummyControl::New();
845 actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
846 actor.SetProperty( Dali::Actor::Property::NAME,"Actor1");
847 actor.SetProperty( Actor::Property::COLOR,Color::CYAN);
848 application.GetScene().Add(actor);
850 DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
851 Property::Map visualMap;
852 visualMap[Visual::Property::TYPE] = Visual::COLOR;
853 visualMap[ColorVisual::Property::MIX_COLOR] = Color::MAGENTA;
854 Visual::Base visual = VisualFactory::Get().CreateVisual( visualMap );
855 visual.SetName( "visual1" );
857 Property::Index visualIndex = Control::CONTROL_PROPERTY_END_INDEX + 1;
858 dummyImpl.RegisterVisual( visualIndex, visual );
860 Animation anim = dummyImpl.CreateTransition( transition );
861 DALI_TEST_CHECK( !anim );
863 application.SendNotification();
864 application.Render(0);
865 application.SendNotification();
867 Renderer renderer = actor.GetRendererAt(0);
868 Property::Index mixColorIdx = renderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR );
870 tet_printf( "Test that the property has been set to target value\n");
871 DALI_TEST_EQUALS(renderer.GetProperty<Vector3>(mixColorIdx), Vector3(Color::RED), 0.001, TEST_LOCATION);
876 int UtcDaliTransitionDataMapN6(void)
878 ToolkitTestApplication application;
880 tet_printf("Testing visual doesn't animate with duff bezier data \n");
883 map["target"] = "visual1";
884 map["property"] = "mixColor";
885 map["initialValue"] = Color::MAGENTA;
886 map["targetValue"] = Color::RED;
887 map["animator"] = Property::Map()
888 .Add("alphaFunction", Property::Array().Add("1").Add("Two").Add("3").Add("4"))
889 .Add("timePeriod", Property::Map()
891 .Add("duration", 1.0f));
893 Dali::Toolkit::TransitionData transition = TransitionData::New( map );
895 DummyControl actor = DummyControl::New();
896 actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
897 actor.SetProperty( Dali::Actor::Property::NAME,"Actor1");
898 actor.SetProperty( Actor::Property::COLOR,Color::CYAN);
899 application.GetScene().Add(actor);
901 DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
902 Property::Map visualMap;
903 visualMap[Visual::Property::TYPE] = Visual::COLOR;
904 visualMap[ColorVisual::Property::MIX_COLOR] = Color::MAGENTA;
905 Visual::Base visual = VisualFactory::Get().CreateVisual( visualMap );
906 visual.SetName( "visual1" );
908 Property::Index visualIndex = Control::CONTROL_PROPERTY_END_INDEX + 1;
909 dummyImpl.RegisterVisual( visualIndex, visual );
911 Animation anim = dummyImpl.CreateTransition( transition );
912 DALI_TEST_CHECK( !anim );
914 application.SendNotification();
915 application.Render(0);
916 application.SendNotification();
918 Renderer renderer = actor.GetRendererAt(0);
919 Property::Index mixColorIdx = renderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR );
921 tet_printf( "Test that the property has been set to target value\n");
922 DALI_TEST_EQUALS(renderer.GetProperty<Vector3>(mixColorIdx), Vector3(Color::RED), 0.001, TEST_LOCATION);
923 DALI_TEST_EQUALS(renderer.GetProperty<float>( DevelRenderer::Property::OPACITY ), 1.0f, 0.001, TEST_LOCATION);
929 int UtcDaliTransitionDataArrayP(void)
931 ToolkitTestApplication application;
934 map1["target"] = "Actor1";
935 map1["property"] = "color";
936 map1["initialValue"] = Color::MAGENTA;
937 map1["targetValue"] = Color::RED;
938 map1["animator"] = Property::Map()
939 .Add("alphaFunction", "EASE_IN_OUT")
940 .Add("timePeriod", Property::Map()
942 .Add("duration", 1.0f));
945 map2["target"] = "Actor1";
946 map2["property"] = "position";
947 map2["initialValue"] = Vector3(100,0,0);
948 map2["targetValue"] = Vector3(0,100,0);
949 map2["animator"] = Property::Map()
950 .Add("alphaFunction", "EASE_IN_OUT")
951 .Add("timePeriod", Property::Map()
953 .Add("duration", 1.0f));
956 map3["target"] = "Actor1";
957 map3["property"] = "orientation";
958 map3["targetValue"] = Quaternion( Radian(Math::PI_2), Vector3::ZAXIS );
960 Property::Array array;
961 array.PushBack(map1);
962 array.PushBack(map2);
963 array.PushBack(map3);
965 Dali::Toolkit::TransitionData transition = TransitionData::New( array );
967 DummyControl actor = DummyControl::New();
968 actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
969 actor.SetProperty( Dali::Actor::Property::NAME,"Actor1");
970 actor.SetProperty( Actor::Property::COLOR,Color::CYAN);
971 application.GetScene().Add(actor);
972 DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(Radian(0), Vector3::ZAXIS), TEST_LOCATION);
974 DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
975 Animation anim = dummyImpl.CreateTransition( transition );
976 DALI_TEST_CHECK( anim );
977 application.SendNotification();
978 application.Render(0);
979 DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), Color::MAGENTA, TEST_LOCATION);
980 DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(Radian(Math::PI_2), Vector3::ZAXIS), TEST_LOCATION);
983 application.SendNotification();
984 application.Render(0); // start map2 anim
985 application.SendNotification();
986 DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(100,0,0), TEST_LOCATION);
988 application.Render(500); // Start map1 animation, halfway thru map2 anim
989 application.SendNotification();
990 DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(50,50,0), TEST_LOCATION);
992 application.Render(500); // Halfway thru map1 anim, end of map2 anim
993 application.SendNotification();
994 DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0,100,0), TEST_LOCATION);
995 DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), (Color::MAGENTA+Color::RED)*0.5f, TEST_LOCATION);
997 application.Render(500); // End of map1 anim
998 application.SendNotification();
999 DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), Color::RED, TEST_LOCATION );
1005 int UtcDaliTransitionDataGetAnimatorP(void)
1007 ToolkitTestApplication application;
1010 map1["target"] = "Actor1";
1011 map1["property"] = "color";
1012 map1["initialValue"] = Color::MAGENTA;
1013 map1["targetValue"] = Color::RED;
1014 map1["animator"] = Property::Map()
1015 .Add("alphaFunction", "EASE_IN_SQUARE")
1016 .Add("timePeriod", Property::Map()
1018 .Add("duration", 0.5f));
1021 map2["target"] = "Actor1";
1022 map2["property"] = "position";
1023 map2["initialValue"] = Vector3(100,0,0);
1024 map2["targetValue"] = Vector3(0,100,0);
1025 map2["animator"] = Property::Map()
1026 .Add("alphaFunction", "EASE_OUT_SQUARE")
1027 .Add("timePeriod", Property::Map()
1029 .Add("duration", 2.0f));
1032 map3["target"] = "Actor1";
1033 map3["property"] = "size";
1034 map3["initialValue"] = Vector2(10,10);
1035 map3["targetValue"] = Vector2(100,100);
1036 map3["animator"] = Property::Map()
1037 .Add("alphaFunction", "EASE_OUT_SINE")
1038 .Add("timePeriod", Property::Map()
1040 .Add("duration", 3.0f));
1043 map4["target"] = "Actor2";
1044 map4["property"] = "color";
1045 map4["initialValue"] = Color::BLACK;
1046 map4["targetValue"] = Color::GREEN;
1047 map4["animator"] = Property::Map()
1048 .Add("alphaFunction", "EASE_IN_OUT_SINE")
1049 .Add("timePeriod", Property::Map()
1051 .Add("duration", 0.5f));
1054 map5["target"] = "Actor2";
1055 map5["property"] = "position";
1056 map5["initialValue"] = Vector3(100,0,0);
1057 map5["targetValue"] = Vector3(0,100,0);
1058 map5["animator"] = Property::Map()
1059 .Add("alphaFunction", "BOUNCE")
1060 .Add("timePeriod", Property::Map()
1062 .Add("duration", 2.0f));
1065 map6["target"] = "Actor2";
1066 map6["property"] = "size";
1067 map6["initialValue"] = Vector2(10,10);
1068 map6["targetValue"] = Vector2(100,100);
1069 map6["animator"] = Property::Map()
1070 .Add("alphaFunction", "SIN")
1071 .Add("timePeriod", Property::Map()
1073 .Add("duration", 3.0f));
1076 map7["target"] = "Actor4";
1077 map7["property"] = "sizeModeFactor";
1078 map7["initialValue"] = Vector3(1,1,1);
1079 map7["targetValue"] = Vector3(2,2,2);
1080 map7["animator"] = Property::Map()
1081 .Add("alphaFunction", "EASE_IN_SINE")
1082 .Add("timePeriod", Property::Map()
1084 .Add("duration", 1.0f));
1087 map8["target"] = "Visual1";
1088 map8["property"] = "opacity";
1089 map8["initialValue"] = 0.0f;
1090 map8["targetValue"] = 1.0f;
1091 map8["animator"] = Property::Map()
1092 .Add("alphaFunction", "EASE_IN")
1093 .Add("timePeriod", Property::Map()
1095 .Add("duration", 9.0f));
1098 map9["target"] = "Actor2";
1099 map9["property"] = "scale";
1100 map9["initialValue"] = Vector3(0,0,0);
1101 map9["targetValue"] = Vector3(1,1,1);
1102 map9["animator"] = Property::Map()
1103 .Add("alphaFunction", "REVERSE")
1104 .Add("timePeriod", Property::Map()
1106 .Add("duration", 1.0f));
1108 Property::Map map10;
1109 map10["target"] = "Actor2";
1110 map10["property"] = "scale";
1111 map10["initialValue"] = Vector3(0,0,0);
1112 map10["targetValue"] = Vector3(1,1,1);
1113 map10["animator"] = Property::Map()
1114 .Add("alphaFunction", Vector4(.23,.4,.8,1.2))
1115 .Add("timePeriod", Property::Map()
1117 .Add("duration", 1.0f));
1119 Property::Map map11;
1120 map11["target"] = "Actor2";
1121 map11["property"] = "scale";
1122 map11["initialValue"] = Vector3(0,0,0);
1123 map11["targetValue"] = Vector3(1,1,1);
1124 map11["animator"] = Property::Map()
1125 .Add("alphaFunction", Property::Array().Add(.23f).Add(.4f).Add(.8f).Add(.2f))
1126 .Add("timePeriod", Property::Map()
1128 .Add("duration", 1.0f));
1130 Property::Map map12;
1131 map12["target"] = "Actor1";
1132 map12["property"] = "orientation";
1133 map12["targetValue"] = Quaternion( Radian(Math::PI_2), Vector3::ZAXIS );
1135 Property::Array array;
1136 array.PushBack(map1);
1137 array.PushBack(map2);
1138 array.PushBack(map3);
1139 array.PushBack(map4);
1140 array.PushBack(map5);
1141 array.PushBack(map6);
1142 array.PushBack(map7);
1143 array.PushBack(map8);
1144 array.PushBack(map9);
1145 array.PushBack(map10);
1146 array.PushBack(map11);
1147 array.PushBack(map12);
1149 Dali::Toolkit::TransitionData transition = TransitionData::New( array );
1151 DALI_TEST_EQUALS( transition.Count(), array.Count(), TEST_LOCATION );
1153 for( unsigned int i=0; i < array.Count(); ++i )
1155 Property::Map animatorMap = transition.GetAnimatorAt(i);
1156 Property::Value& value = array.GetElementAt(i);
1157 Property::Map* inputMap = value.GetMap();
1158 DALI_TEST_CHECK( inputMap );
1159 CHECK_MAP_EQUALS( *inputMap, animatorMap );