Merge "Prepare for Tizen 4.0 Build" into devel/master
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-TransitionData.cpp
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #include <iostream>
18 #include <stdlib.h>
19 #include <dali-toolkit-test-suite-utils.h>
20 #include <dali.h>
21 #include <dali/devel-api/object/handle-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 <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
26 #include "dummy-control.h"
27
28 using namespace Dali;
29 using namespace Toolkit;
30
31
32 void utc_dali_toolkit_transition_data_startup(void)
33 {
34   test_return_value = TET_UNDEF;
35 }
36
37 void utc_dali_toolkit_transition_data_cleanup(void)
38 {
39   test_return_value = TET_PASS;
40 }
41
42 Property::Map CreateMap()
43 {
44   Property::Map map;
45
46   map["target"] = "Actor1";
47   map["property"] = "color";
48   map["initialValue"] = Color::MAGENTA;
49   map["targetValue"] = Color::RED;
50   map["animator"] = Property::Map()
51     .Add("alphaFunction", "EASE_IN_OUT_BACK")
52     .Add("timePeriod", Property::Map()
53          .Add("delay", 0.5f)
54          .Add("duration", 1.0f));
55   return map;
56 }
57
58 void CHECK_ARRAY_EQUALS( Property::Array test, Property::Value result )
59 {
60   if( result.GetType() == Property::ARRAY )
61   {
62     // Compare arrays
63     Property::Array *resultArray = result.GetArray();
64     DALI_TEST_EQUALS( test.Count(), resultArray->Count(), TEST_LOCATION );
65     for( size_t i=0; i < std::min(test.Count(), resultArray->Count()); ++i )
66     {
67       Property::Value a = test.GetElementAt(i);
68       Property::Value b = resultArray->GetElementAt(i);
69       DALI_TEST_EQUALS( a.GetType(), b.GetType(), TEST_LOCATION );
70       DALI_TEST_EQUALS( a, b, 0.001, TEST_LOCATION );
71     }
72   }
73   else if( result.GetType() == Property::VECTOR4 )
74   {
75     Vector4 value = result.Get<Vector4>();
76     DALI_TEST_CHECK( test.Count() >= 4 );
77     for( size_t i=0; i < 4; ++i )
78     {
79       Property::Value a = test.GetElementAt(i);
80       DALI_TEST_EQUALS( a.GetType(), Property::FLOAT, TEST_LOCATION );
81       DALI_TEST_EQUALS( a.Get<float>(), value[i], 0.001, TEST_LOCATION );
82     }
83   }
84   else
85   {
86     DALI_TEST_CHECK( 0 );
87   }
88 }
89
90 void CHECK_MAP_EQUALS( Property::Map test, Property::Map result )
91 {
92   DALI_TEST_EQUALS(test.Count(), result.Count(), TEST_LOCATION);
93
94   for( unsigned int i=0; i< test.Count(); ++i )
95   {
96     KeyValuePair keyValue = test.GetKeyValue(i);
97     Property::Value* value;
98
99     if( keyValue.first.type == Property::Key::STRING )
100     {
101       value = result.Find(keyValue.first.stringKey);
102     }
103     else
104     {
105       value = result.Find(keyValue.first.indexKey);
106     }
107
108     DALI_TEST_CHECK( value != NULL );
109     if( value != NULL )
110     {
111       if( keyValue.second.GetType() == Property::MAP )
112       {
113         DALI_TEST_EQUALS( keyValue.second.GetType(), value->GetType(), TEST_LOCATION );
114         CHECK_MAP_EQUALS( *(keyValue.second.GetMap()), *(value->GetMap()) );
115       }
116       else if( keyValue.second.GetType() == Property::ARRAY )
117       {
118         CHECK_ARRAY_EQUALS( *(keyValue.second.GetArray()), *value );
119       }
120       else if( keyValue.second.GetType() == Property::STRING )
121       {
122         DALI_TEST_EQUALS( keyValue.second.GetType(), value->GetType(), TEST_LOCATION );
123         std::string str;
124         value->Get(str);
125         DALI_TEST_EQUALS( keyValue.second, str.c_str(), TEST_LOCATION );
126       }
127       else
128       {
129         DALI_TEST_EQUALS( keyValue.second.GetType(), value->GetType(), TEST_LOCATION );
130         DALI_TEST_EQUALS( keyValue.second, *value, 0.001f, TEST_LOCATION );
131       }
132     }
133   }
134 }
135
136
137 int UtcDaliTransitionDataNew(void)
138 {
139   TestApplication application;
140
141   Property::Map map = CreateMap();
142   Dali::Toolkit::TransitionData transition = TransitionData::New( map );
143   DALI_TEST_CHECK( transition );
144
145   END_TEST;
146 }
147
148 int UtcDaliTransitionDataDownCast(void)
149 {
150   TestApplication application;
151
152   Property::Map map = CreateMap();
153
154   BaseHandle handle = TransitionData::New( map );
155   DALI_TEST_CHECK( handle );
156
157   TransitionData transitionData = TransitionData::DownCast( handle );
158   DALI_TEST_CHECK( transitionData );
159   END_TEST;
160 }
161
162 int UtcDaliTransitionDataCopyConstructor(void)
163 {
164   TestApplication application;
165
166   Property::Map map = CreateMap();
167
168   TransitionData transitionData = TransitionData::New( map );
169   DALI_TEST_CHECK( transitionData );
170
171   TransitionData td2( transitionData );
172   DALI_TEST_CHECK( td2 );
173   DALI_TEST_EQUALS( td2.Count(), 1, TEST_LOCATION );
174   END_TEST;
175 }
176
177 int UtcDaliTransitionDataAssignmentOperator(void)
178 {
179   TestApplication application;
180
181   Property::Map map = CreateMap();
182
183   TransitionData transitionData = TransitionData::New( map );
184   DALI_TEST_CHECK( transitionData );
185
186   TransitionData td2;
187   DALI_TEST_CHECK( !td2 );
188
189   td2 = transitionData;
190   DALI_TEST_CHECK( td2 );
191
192   DALI_TEST_EQUALS( td2.Count(), 1, TEST_LOCATION );
193   END_TEST;
194 }
195
196 int UtcDaliTransitionDataCount(void)
197 {
198   TestApplication application;
199
200   Property::Map map = CreateMap();
201   TransitionData transitionData = TransitionData::New( map );
202   DALI_TEST_CHECK( transitionData );
203   DALI_TEST_EQUALS( transitionData.Count(), 1, TEST_LOCATION );
204
205   Property::Array array;
206   array.PushBack( map );
207   array.PushBack( map );
208   array.PushBack( map );
209
210   TransitionData transitionData2 = TransitionData::New( array );
211   DALI_TEST_CHECK( transitionData2 );
212   DALI_TEST_EQUALS( transitionData2.Count(), 3, TEST_LOCATION );
213
214   END_TEST;
215 }
216
217 int UtcDaliTransitionDataMap1P(void)
218 {
219   TestApplication application;
220
221   tet_printf("Testing animation of a visual property using stylesheet equivalent maps\n");
222
223   Property::Map map;
224   map["target"] = "visual1";
225   map["property"] = "mixColor";
226   map["initialValue"] = Color::MAGENTA;
227   map["targetValue"] = Color::RED;
228   map["animator"] = Property::Map()
229     .Add("alphaFunction", "EASE_IN_OUT")
230     .Add("timePeriod", Property::Map()
231          .Add("delay", 0.5f)
232          .Add("duration", 1.0f));
233
234   Dali::Toolkit::TransitionData transition = TransitionData::New( map );
235
236   DummyControl actor = DummyControl::New();
237   actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
238   actor.SetName("Actor1");
239   actor.SetColor(Color::CYAN);
240   Stage::GetCurrent().Add(actor);
241
242   DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
243
244   Property::Map visualMap;
245   visualMap[Visual::Property::TYPE] = Visual::COLOR;
246   visualMap[ColorVisual::Property::MIX_COLOR] = Color::MAGENTA;
247   Visual::Base visual = VisualFactory::Get().CreateVisual( visualMap );
248   visual.SetName( "visual1" );
249
250   Property::Index visualIndex = Control::CONTROL_PROPERTY_END_INDEX + 1;
251   dummyImpl.RegisterVisual( visualIndex, visual );
252
253   Animation anim = dummyImpl.CreateTransition( transition );
254   DALI_TEST_CHECK( anim );
255
256   Renderer renderer = actor.GetRendererAt(0);
257   Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
258   Property::Index opacityIndex = DevelHandle::GetPropertyIndex( renderer, DevelVisual::Property::OPACITY );
259   application.SendNotification();
260   application.Render(0);
261
262   DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION);
263   DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 1.0f, 0.001f, TEST_LOCATION );
264
265   anim.Play();
266
267   application.SendNotification();
268   application.Render(500); // Start animation
269   application.Render(500); // Halfway thru anim
270   application.SendNotification();
271   DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA+Color::RED)*0.5f, TEST_LOCATION);
272   DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 1.0f, 0.001f, TEST_LOCATION );
273
274   application.Render(500); // End of anim
275   application.SendNotification();
276   DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::RED), TEST_LOCATION );
277   DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 1.0f, 0.001f, TEST_LOCATION );
278
279   END_TEST;
280 }
281
282
283
284 int UtcDaliTransitionDataMap2P(void)
285 {
286   TestApplication application;
287
288   tet_printf("Testing animation of a visual property using programmatic maps\n");
289
290   Property::Map map;
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()
298          .Add("delay", 0.5f)
299          .Add("duration", 1.0f));
300
301   Dali::Toolkit::TransitionData transition = TransitionData::New( map );
302
303   DummyControl actor = DummyControl::New();
304   actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
305   actor.SetName("Actor1");
306   actor.SetColor(Color::CYAN);
307   Stage::GetCurrent().Add(actor);
308
309   DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
310
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" );
316
317   Property::Index visualIndex = Control::CONTROL_PROPERTY_END_INDEX + 1;
318   dummyImpl.RegisterVisual( visualIndex, visual );
319
320   Animation anim = dummyImpl.CreateTransition( transition );
321   DALI_TEST_CHECK( anim );
322
323   Renderer renderer = actor.GetRendererAt(0);
324   Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
325   Property::Index opacityIndex = DevelHandle::GetPropertyIndex( renderer, DevelVisual::Property::OPACITY );
326   application.SendNotification();
327   application.Render(0);
328
329   DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION);
330   DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 1.0f, 0.001f, TEST_LOCATION);
331
332   anim.Play();
333
334   application.SendNotification();
335   application.Render(0);
336   application.Render(500); // Start animation
337   application.Render(500); // Halfway thru anim
338   application.SendNotification();
339   DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA+Color::RED)*0.5f, TEST_LOCATION);
340   DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 1.0f, 0.001f, TEST_LOCATION);
341
342   application.Render(500); // End of anim
343   application.SendNotification();
344   DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::RED), TEST_LOCATION );
345   DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 1.0f, 0.001f, TEST_LOCATION);
346
347   END_TEST;
348 }
349
350
351 int UtcDaliTransitionDataMap2Pb(void)
352 {
353   TestApplication application;
354
355   tet_printf("Testing animation of a visual property using programmatic maps\n");
356
357   Property::Map map;
358   map["target"] = "visual1";
359   map["property"] = PrimitiveVisual::Property::MIX_COLOR;
360   map["initialValue"] = Color::MAGENTA;
361   map["targetValue"] = Color::RED;
362   map["animator"] = Property::Map()
363     .Add("alphaFunction", "LINEAR")
364     .Add("timePeriod", Property::Map()
365          .Add("delay", 0.5f)
366          .Add("duration", 1.0f));
367
368   Dali::Toolkit::TransitionData transition = TransitionData::New( map );
369
370   DummyControl actor = DummyControl::New();
371   actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
372   actor.SetName("Actor1");
373   actor.SetColor(Color::CYAN);
374   Stage::GetCurrent().Add(actor);
375
376   DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
377
378   Property::Map visualMap;
379   visualMap[Visual::Property::TYPE] = Visual::PRIMITIVE;
380   visualMap[PrimitiveVisual::Property::MIX_COLOR] = Color::MAGENTA;
381   visualMap[ PrimitiveVisual::Property::SHAPE  ] = PrimitiveVisual::Shape::SPHERE;
382   visualMap[ PrimitiveVisual::Property::SLICES ] = 10;
383   visualMap[ PrimitiveVisual::Property::STACKS ] = 10;
384
385   Visual::Base visual = VisualFactory::Get().CreateVisual( visualMap );
386   visual.SetName( "visual1" );
387
388   Property::Index visualIndex = Control::CONTROL_PROPERTY_END_INDEX + 1;
389   dummyImpl.RegisterVisual( visualIndex, visual );
390
391   Animation anim = dummyImpl.CreateTransition( transition );
392   DALI_TEST_CHECK( anim );
393
394   Renderer renderer = actor.GetRendererAt(0);
395   Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, PrimitiveVisual::Property::MIX_COLOR );
396   Property::Index opacityIndex = DevelHandle::GetPropertyIndex( renderer, DevelVisual::Property::OPACITY );
397   application.SendNotification();
398   application.Render(0);
399
400   DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION);
401   DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 1.0f, 0.001f, TEST_LOCATION);
402
403   anim.Play();
404
405   application.SendNotification();
406   application.Render(0);
407   application.Render(500); // Start animation
408   application.Render(500); // Halfway thru anim
409   application.SendNotification();
410   DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA+Color::RED)*0.5f, TEST_LOCATION);
411   DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 1.0f, 0.001f, TEST_LOCATION);
412
413   application.Render(500); // End of anim
414   application.SendNotification();
415   DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::RED), TEST_LOCATION );
416   DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 1.0f, 0.001f, TEST_LOCATION);
417
418   END_TEST;
419 }
420
421
422 int UtcDaliTransitionDataMap3P(void)
423 {
424   TestApplication application;
425
426   tet_printf("Testing animation of an actor's position property using bezier curve\n");
427
428   Property::Map map;
429   map["target"] = "Actor1";
430   map["property"] = "position";
431   map["initialValue"] = Vector3(0, 0, 0);
432   map["targetValue"] = Vector3(100, 100, 0);
433   map["animator"] = Property::Map()
434     .Add("alphaFunction", Vector4(0.71, -0.57, 0.42, 1.38) )
435     .Add("timePeriod", Property::Map()
436          .Add("delay", 0.0f)
437          .Add("duration", 1.0f));
438
439   Dali::Toolkit::TransitionData transition = TransitionData::New( map );
440
441   DummyControl actor = DummyControl::New();
442   actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
443   actor.SetName("Actor1");
444   Stage::GetCurrent().Add(actor);
445
446   DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
447   Animation anim = dummyImpl.CreateTransition( transition );
448   DALI_TEST_CHECK( anim );
449
450   application.SendNotification();
451   application.Render(0);
452   DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3(0,0,0), 0.001f, TEST_LOCATION);
453
454   anim.Play();
455
456   application.SendNotification();
457   application.Render(0);
458
459   application.Render(250); // 25%
460   application.SendNotification();
461   DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3(-10,-10,0), 1.0, TEST_LOCATION); // High epsilon as we don't have exact figure for bezier curve at 50%
462
463   application.Render(250); // Halfway thru map1 anim
464   application.SendNotification();
465   DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3(24,24,0), 1.0, TEST_LOCATION); // High epsilon as we don't have exact figure for bezier curve at 50%
466
467   application.Render(250); // End of map1 anim
468   application.SendNotification();
469   DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3(100,100,0), 1.0, TEST_LOCATION); // High epsilon as we don't have exact figure for bezier curve
470
471   application.Render(250); // End of map1 anim
472   application.SendNotification();
473   DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3(100,100,0), TEST_LOCATION );
474   END_TEST;
475 }
476
477
478 int UtcDaliTransitionDataMap4P(void)
479 {
480   TestApplication application;
481
482   tet_printf("Testing animation of a visual's transform property using programmatic maps\n");
483
484   Property::Map map1;
485   map1["target"] = "testVisual";
486   map1["property"] = "offset";
487   map1["initialValue"] = Vector2(0.0f, 0.0f);
488   map1["targetValue"] = Vector2(100.0f, 100.0f);
489   map1["animator"] = Property::Map()
490     .Add("alphaFunction", "LINEAR")
491     .Add("timePeriod", Property::Map()
492          .Add("delay", 0.5f)
493          .Add("duration", 1.0f));
494
495   Property::Map map2;
496   map2["target"] = "testVisual";
497   map2["property"] = "size";
498   map2["initialValue"] = Vector2(10.0f, 10.0f);
499   map2["targetValue"] = Vector2(110.0f, 110.0f);
500   map2["animator"] = Property::Map()
501     .Add("alphaFunction", "LINEAR")
502     .Add("timePeriod", Property::Map()
503          .Add("delay", 0.5f)
504          .Add("duration", 1.0f));
505
506   Dali::Toolkit::TransitionData transition = TransitionData::New( Property::Array().Add(map1).Add(map2) );
507
508   DummyControl actor = DummyControl::New();
509   actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
510   actor.SetName("Actor1");
511   Stage::GetCurrent().Add(actor);
512
513   DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
514
515   Property::Map visualMap;
516   visualMap[Visual::Property::TYPE] = Visual::COLOR;
517   visualMap[ColorVisual::Property::MIX_COLOR] = Color::MAGENTA;
518   Visual::Base visual = VisualFactory::Get().CreateVisual( visualMap );
519
520   visual.SetName( "testVisual" );
521   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
522
523   Animation anim = dummyImpl.CreateTransition( transition );
524   DALI_TEST_CHECK( anim );
525
526   Renderer renderer = actor.GetRendererAt(0);
527   Property::Index sizeIndex = renderer.GetPropertyIndex( "size" );
528   application.SendNotification();
529   application.Render(0);
530
531   DALI_TEST_EQUALS( renderer.GetProperty<Vector2>(sizeIndex), Vector2(10.0f, 10.0f), TEST_LOCATION);
532
533   anim.Play();
534
535   application.SendNotification();
536   application.Render(0);
537   application.Render(500); // Start animation
538   application.Render(500); // Halfway thru anim
539   application.SendNotification();
540   DALI_TEST_EQUALS( renderer.GetProperty<Vector2>(sizeIndex), Vector2(60.0f, 60.0f), TEST_LOCATION);
541
542   application.Render(500); // End of anim
543   application.SendNotification();
544   DALI_TEST_EQUALS( renderer.GetProperty<Vector2>(sizeIndex), Vector2(110.0f, 110.0f), TEST_LOCATION );
545
546   END_TEST;
547 }
548
549 int UtcDaliTransitionDataMap5P(void)
550 {
551   TestApplication application;
552
553   tet_printf("Testing animation visual opacity using stylesheet equivalent maps\n");
554
555   Property::Map map;
556   map["target"] = "visual1";
557   map["property"] = "opacity";
558   map["initialValue"] = 0.0f;
559   map["targetValue"] = 1.0f;
560   map["animator"] = Property::Map()
561     .Add("alphaFunction", "EASE_IN_OUT")
562     .Add("timePeriod", Property::Map()
563          .Add("delay", 0.5f)
564          .Add("duration", 1.0f));
565
566   Dali::Toolkit::TransitionData transition = TransitionData::New( map );
567
568   DummyControl actor = DummyControl::New();
569   actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
570   actor.SetName("Actor1");
571   actor.SetColor(Color::CYAN);
572   Stage::GetCurrent().Add(actor);
573
574   DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
575
576   Property::Map visualMap;
577   visualMap[Visual::Property::TYPE] = Visual::COLOR;
578   visualMap[ColorVisual::Property::MIX_COLOR] = Color::MAGENTA;
579   Visual::Base visual = VisualFactory::Get().CreateVisual( visualMap );
580   visual.SetName( "visual1" );
581
582   Property::Index visualIndex = Control::CONTROL_PROPERTY_END_INDEX + 1;
583   dummyImpl.RegisterVisual( visualIndex, visual );
584
585   Animation anim = dummyImpl.CreateTransition( transition );
586   DALI_TEST_CHECK( anim );
587
588   Renderer renderer = actor.GetRendererAt(0);
589   Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
590   Property::Index opacityIndex = DevelHandle::GetPropertyIndex( renderer, DevelVisual::Property::OPACITY );
591   application.SendNotification();
592   application.Render(0);
593
594   DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION);
595   DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 0.0f, 0.001f, TEST_LOCATION );
596   DALI_TEST_EQUALS( renderer.GetProperty<int>(Renderer::Property::BLEND_MODE), (int)BlendMode::ON, TEST_LOCATION );
597
598   anim.Play();
599
600   application.SendNotification();
601   application.Render(500); // Start animation
602   application.Render(500); // Halfway thru anim
603   application.SendNotification();
604   DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION);
605   DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 0.5f, 0.001f, TEST_LOCATION );
606   DALI_TEST_EQUALS( renderer.GetProperty<int>(Renderer::Property::BLEND_MODE), (int)BlendMode::ON, TEST_LOCATION );
607
608   application.Render(501); // End of anim
609   application.SendNotification();
610   DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION );
611   DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 1.0f, 0.001f, TEST_LOCATION );
612   DALI_TEST_EQUALS( renderer.GetProperty<int>(Renderer::Property::BLEND_MODE), (int)BlendMode::AUTO, TEST_LOCATION );
613
614   END_TEST;
615 }
616
617
618 int UtcDaliTransitionDataMap6P(void)
619 {
620   TestApplication application;
621
622   tet_printf("Testing animation visual opacity using stylesheet equivalent maps\n");
623
624   Property::Map map;
625   map["target"] = "visual1";
626   map["property"] = "opacity";
627   map["targetValue"] = 0.0f;
628   map["animator"] = Property::Map()
629     .Add("alphaFunction", "EASE_IN_OUT")
630     .Add("timePeriod", Property::Map()
631          .Add("delay", 0.5f)
632          .Add("duration", 1.0f));
633
634   Dali::Toolkit::TransitionData transition = TransitionData::New( map );
635
636   DummyControl actor = DummyControl::New();
637   actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
638   actor.SetName("Actor1");
639   actor.SetColor(Color::CYAN);
640   Stage::GetCurrent().Add(actor);
641
642   DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
643
644   Property::Map visualMap;
645   visualMap[Visual::Property::TYPE] = Visual::COLOR;
646   visualMap[ColorVisual::Property::MIX_COLOR] = Color::MAGENTA;
647   Visual::Base visual = VisualFactory::Get().CreateVisual( visualMap );
648   visual.SetName( "visual1" );
649
650   Property::Index visualIndex = Control::CONTROL_PROPERTY_END_INDEX + 1;
651   dummyImpl.RegisterVisual( visualIndex, visual );
652
653   Animation anim = dummyImpl.CreateTransition( transition );
654   DALI_TEST_CHECK( anim );
655
656   Renderer renderer = actor.GetRendererAt(0);
657   Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
658   Property::Index opacityIndex = DevelHandle::GetPropertyIndex( renderer, DevelVisual::Property::OPACITY );
659   application.SendNotification();
660   application.Render(0);
661
662   DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION);
663   DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 1.0f, 0.001f, TEST_LOCATION );
664
665   // Note, This should be testing for AUTO
666   // this is the same problem as C# target value being set before Play is called.
667   // @todo How was this solved?
668   DALI_TEST_EQUALS( renderer.GetProperty<int>(Renderer::Property::BLEND_MODE), (int)BlendMode::ON, TEST_LOCATION );
669
670   anim.Play();
671
672   application.SendNotification();
673   application.Render(500); // Start animation
674   application.Render(500); // Halfway thru anim
675   application.SendNotification();
676   DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION);
677   DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 0.5f, 0.001f, TEST_LOCATION );
678   DALI_TEST_EQUALS( renderer.GetProperty<int>(Renderer::Property::BLEND_MODE), (int)BlendMode::ON, TEST_LOCATION );
679
680   application.Render(500); // End of anim
681   application.SendNotification();
682   DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION );
683   DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 0.0f, 0.001f, TEST_LOCATION );
684   DALI_TEST_EQUALS( renderer.GetProperty<int>(Renderer::Property::BLEND_MODE), (int)BlendMode::ON, TEST_LOCATION );
685
686   END_TEST;
687 }
688
689
690 int UtcDaliTransitionDataMap1N(void)
691 {
692   TestApplication application;
693
694   Property::Map map;
695   map["target"] = "Actor1";
696   map["property"] = "randomProperty";
697   map["initialValue"] = Color::MAGENTA;
698   map["targetValue"] = Color::RED;
699   map["animator"] = Property::Map()
700     .Add("alphaFunction", "EASE_OUT")
701     .Add("timePeriod", Property::Map()
702          .Add("delay", 0.5f)
703          .Add("duration", 1.0f));
704
705   Dali::Toolkit::TransitionData transition = TransitionData::New( map );
706
707   DummyControl actor = DummyControl::New();
708   actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
709   actor.SetName("Actor1");
710   actor.SetColor(Color::CYAN);
711   Stage::GetCurrent().Add(actor);
712
713   DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
714   Animation anim = dummyImpl.CreateTransition( transition );
715   DALI_TEST_CHECK( ! anim );
716
717   CHECK_MAP_EQUALS( map, transition.GetAnimatorAt(0) );
718   END_TEST;
719 }
720
721
722 int UtcDaliTransitionDataMapN3(void)
723 {
724   TestApplication application;
725
726   tet_printf("Testing visual lookup with no renderers\n");
727
728   Property::Map map;
729   map["target"] = "visual1";
730   map["property"] = "mixColor";
731   map["initialValue"] = Vector3(Color::MAGENTA);
732   map["targetValue"] = Vector3(Color::RED);
733   map["animator"] = Property::Map()
734     .Add("alphaFunction", "EASE_OUT_BACK")
735     .Add("timePeriod", Property::Map()
736          .Add("delay", 0.5f)
737          .Add("duration", 1.0f));
738
739   Dali::Toolkit::TransitionData transition = TransitionData::New( map );
740   CHECK_MAP_EQUALS( map, transition.GetAnimatorAt(0) );
741
742   DummyControl actor = DummyControl::New();
743   actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
744   actor.SetName("Actor1");
745   actor.SetColor(Color::CYAN);
746   // Don't stage actor
747
748   DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
749   Property::Map visualMap;
750   visualMap[Visual::Property::TYPE] = Visual::COLOR;
751   visualMap[ColorVisual::Property::MIX_COLOR] = Vector3(Color::MAGENTA);
752   Visual::Base visual = VisualFactory::Get().CreateVisual( visualMap );
753   visual.SetName( "visual1" );
754
755   Property::Index visualIndex = Control::CONTROL_PROPERTY_END_INDEX + 1;
756   dummyImpl.RegisterVisual( visualIndex, visual );
757
758   Animation anim = dummyImpl.CreateTransition( transition );
759   DALI_TEST_CHECK( !anim );
760   END_TEST;
761 }
762
763
764 int UtcDaliTransitionDataMapN4(void)
765 {
766   TestApplication application;
767
768   tet_printf("Testing visual doesn't animate with duff bezier data \n");
769
770   Property::Map map;
771   map["target"] = "visual1";
772   map["property"] = "mixColor";
773   map["initialValue"] = Vector3(Color::MAGENTA);
774   map["targetValue"] = Vector3(Color::RED);
775   map["animator"] = Property::Map()
776     .Add("alphaFunction", Vector3(.1f,1.0f,0.5f))
777     .Add("timePeriod", Property::Map()
778          .Add("delay", 0.5f)
779          .Add("duration", 1.0f));
780
781   Dali::Toolkit::TransitionData transition = TransitionData::New( map );
782
783   DummyControl actor = DummyControl::New();
784   actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
785   actor.SetName("Actor1");
786   actor.SetColor(Color::CYAN);
787   Stage::GetCurrent().Add(actor);
788
789   DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
790   Property::Map visualMap;
791   visualMap[Visual::Property::TYPE] = Visual::COLOR;
792   visualMap[ColorVisual::Property::MIX_COLOR] = Color::MAGENTA;
793   Visual::Base visual = VisualFactory::Get().CreateVisual( visualMap );
794   visual.SetName( "visual1" );
795
796   Property::Index visualIndex = Control::CONTROL_PROPERTY_END_INDEX + 1;
797   dummyImpl.RegisterVisual( visualIndex, visual );
798
799   Animation anim = dummyImpl.CreateTransition( transition );
800   DALI_TEST_CHECK( !anim );
801
802   application.SendNotification();
803   application.Render(0);
804   application.SendNotification();
805
806   Renderer renderer = actor.GetRendererAt(0);
807   Property::Index mixColorIdx = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
808   Property::Index opacityIdx = DevelHandle::GetPropertyIndex( renderer, DevelVisual::Property::OPACITY );
809
810   tet_printf( "Test that the property has been set to target value\n");
811   DALI_TEST_EQUALS(renderer.GetProperty<Vector3>(mixColorIdx), Vector3(Color::RED), 0.001, TEST_LOCATION);
812   DALI_TEST_EQUALS(renderer.GetProperty<float>(opacityIdx), 1.0f, 0.001, TEST_LOCATION);
813
814   END_TEST;
815 }
816
817 int UtcDaliTransitionDataMapN5(void)
818 {
819   TestApplication application;
820
821   tet_printf("Testing visual doesn't animate with duff bezier data \n");
822
823   Property::Map map;
824   map["target"] = "visual1";
825   map["property"] = "mixColor";
826   map["initialValue"] = Color::MAGENTA;
827   map["targetValue"] = Color::RED;
828   map["animator"] = Property::Map()
829     .Add("alphaFunction", Property::Array().Add(.1f).Add(1.0f).Add(0.5f))
830     .Add("timePeriod", Property::Map()
831          .Add("delay", 0.5f)
832          .Add("duration", 1.0f));
833
834   Dali::Toolkit::TransitionData transition = TransitionData::New( map );
835
836   DummyControl actor = DummyControl::New();
837   actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
838   actor.SetName("Actor1");
839   actor.SetColor(Color::CYAN);
840   Stage::GetCurrent().Add(actor);
841
842   DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
843   Property::Map visualMap;
844   visualMap[Visual::Property::TYPE] = Visual::COLOR;
845   visualMap[ColorVisual::Property::MIX_COLOR] = Color::MAGENTA;
846   Visual::Base visual = VisualFactory::Get().CreateVisual( visualMap );
847   visual.SetName( "visual1" );
848
849   Property::Index visualIndex = Control::CONTROL_PROPERTY_END_INDEX + 1;
850   dummyImpl.RegisterVisual( visualIndex, visual );
851
852   Animation anim = dummyImpl.CreateTransition( transition );
853   DALI_TEST_CHECK( !anim );
854
855   application.SendNotification();
856   application.Render(0);
857   application.SendNotification();
858
859   Renderer renderer = actor.GetRendererAt(0);
860   Property::Index mixColorIdx = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
861
862   tet_printf( "Test that the property has been set to target value\n");
863   DALI_TEST_EQUALS(renderer.GetProperty<Vector3>(mixColorIdx), Vector3(Color::RED), 0.001, TEST_LOCATION);
864
865   END_TEST;
866 }
867
868 int UtcDaliTransitionDataMapN6(void)
869 {
870   TestApplication application;
871
872   tet_printf("Testing visual doesn't animate with duff bezier data \n");
873
874   Property::Map map;
875   map["target"] = "visual1";
876   map["property"] = "mixColor";
877   map["initialValue"] = Color::MAGENTA;
878   map["targetValue"] = Color::RED;
879   map["animator"] = Property::Map()
880     .Add("alphaFunction", Property::Array().Add("1").Add("Two").Add("3").Add("4"))
881     .Add("timePeriod", Property::Map()
882          .Add("delay", 0.5f)
883          .Add("duration", 1.0f));
884
885   Dali::Toolkit::TransitionData transition = TransitionData::New( map );
886
887   DummyControl actor = DummyControl::New();
888   actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
889   actor.SetName("Actor1");
890   actor.SetColor(Color::CYAN);
891   Stage::GetCurrent().Add(actor);
892
893   DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
894   Property::Map visualMap;
895   visualMap[Visual::Property::TYPE] = Visual::COLOR;
896   visualMap[ColorVisual::Property::MIX_COLOR] = Color::MAGENTA;
897   Visual::Base visual = VisualFactory::Get().CreateVisual( visualMap );
898   visual.SetName( "visual1" );
899
900   Property::Index visualIndex = Control::CONTROL_PROPERTY_END_INDEX + 1;
901   dummyImpl.RegisterVisual( visualIndex, visual );
902
903   Animation anim = dummyImpl.CreateTransition( transition );
904   DALI_TEST_CHECK( !anim );
905
906   application.SendNotification();
907   application.Render(0);
908   application.SendNotification();
909
910   Renderer renderer = actor.GetRendererAt(0);
911   Property::Index mixColorIdx = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
912   Property::Index opacityIdx = DevelHandle::GetPropertyIndex( renderer, DevelVisual::Property::OPACITY );
913
914   tet_printf( "Test that the property has been set to target value\n");
915   DALI_TEST_EQUALS(renderer.GetProperty<Vector3>(mixColorIdx), Vector3(Color::RED), 0.001, TEST_LOCATION);
916   DALI_TEST_EQUALS(renderer.GetProperty<float>(opacityIdx), 1.0f, 0.001, TEST_LOCATION);
917
918   END_TEST;
919 }
920
921
922 int UtcDaliTransitionDataArrayP(void)
923 {
924   TestApplication application;
925
926   Property::Map map1;
927   map1["target"] = "Actor1";
928   map1["property"] = "color";
929   map1["initialValue"] = Color::MAGENTA;
930   map1["targetValue"] = Color::RED;
931   map1["animator"] = Property::Map()
932     .Add("alphaFunction", "EASE_IN_OUT")
933     .Add("timePeriod", Property::Map()
934          .Add("delay", 0.5f)
935          .Add("duration", 1.0f));
936
937   Property::Map map2;
938   map2["target"] = "Actor1";
939   map2["property"] = "position";
940   map2["initialValue"] = Vector3(100,0,0);
941   map2["targetValue"] = Vector3(0,100,0);
942   map2["animator"] = Property::Map()
943     .Add("alphaFunction", "EASE_IN_OUT")
944     .Add("timePeriod", Property::Map()
945          .Add("delay", 0.0f)
946          .Add("duration", 1.0f));
947
948   Property::Map map3;
949   map3["target"] = "Actor1";
950   map3["property"] = "orientation";
951   map3["targetValue"] = Quaternion( Radian(Math::PI_2), Vector3::ZAXIS );
952
953   Property::Array array;
954   array.PushBack(map1);
955   array.PushBack(map2);
956   array.PushBack(map3);
957
958   Dali::Toolkit::TransitionData transition = TransitionData::New( array );
959
960   DummyControl actor = DummyControl::New();
961   actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
962   actor.SetName("Actor1");
963   actor.SetColor(Color::CYAN);
964   Stage::GetCurrent().Add(actor);
965   DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(Radian(0), Vector3::ZAXIS), TEST_LOCATION);
966
967   DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
968   Animation anim = dummyImpl.CreateTransition( transition );
969   DALI_TEST_CHECK( anim );
970   application.SendNotification();
971   application.Render(0);
972   DALI_TEST_EQUALS( actor.GetCurrentColor(), Color::MAGENTA, TEST_LOCATION);
973   DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(Radian(Math::PI_2), Vector3::ZAXIS), TEST_LOCATION);
974   anim.Play();
975
976   application.SendNotification();
977   application.Render(0);   // start map2 anim
978   application.SendNotification();
979   DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3(100,0,0), TEST_LOCATION);
980
981   application.Render(500); // Start map1 animation, halfway thru map2 anim
982   application.SendNotification();
983   DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3(50,50,0), TEST_LOCATION);
984
985   application.Render(500); // Halfway thru map1 anim, end of map2 anim
986   application.SendNotification();
987   DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3(0,100,0), TEST_LOCATION);
988   DALI_TEST_EQUALS( actor.GetCurrentColor(), (Color::MAGENTA+Color::RED)*0.5f, TEST_LOCATION);
989
990   application.Render(500); // End of map1 anim
991   application.SendNotification();
992   DALI_TEST_EQUALS( actor.GetCurrentColor(), Color::RED, TEST_LOCATION );
993
994   END_TEST;
995 }
996
997
998 int UtcDaliTransitionDataGetAnimatorP(void)
999 {
1000   TestApplication application;
1001
1002   Property::Map map1;
1003   map1["target"] = "Actor1";
1004   map1["property"] = "color";
1005   map1["initialValue"] = Color::MAGENTA;
1006   map1["targetValue"] = Color::RED;
1007   map1["animator"] = Property::Map()
1008     .Add("alphaFunction", "EASE_IN_SQUARE")
1009     .Add("timePeriod", Property::Map()
1010          .Add("delay", 0.5f)
1011          .Add("duration", 0.5f));
1012
1013   Property::Map map2;
1014   map2["target"] = "Actor1";
1015   map2["property"] = "position";
1016   map2["initialValue"] = Vector3(100,0,0);
1017   map2["targetValue"] = Vector3(0,100,0);
1018   map2["animator"] = Property::Map()
1019     .Add("alphaFunction", "EASE_OUT_SQUARE")
1020     .Add("timePeriod", Property::Map()
1021          .Add("delay", 0.2f)
1022          .Add("duration", 2.0f));
1023
1024   Property::Map map3;
1025   map3["target"] = "Actor1";
1026   map3["property"] = "size";
1027   map3["initialValue"] = Vector2(10,10);
1028   map3["targetValue"] = Vector2(100,100);
1029   map3["animator"] = Property::Map()
1030     .Add("alphaFunction", "EASE_OUT_SINE")
1031     .Add("timePeriod", Property::Map()
1032          .Add("delay", 0.4f)
1033          .Add("duration", 3.0f));
1034
1035   Property::Map map4;
1036   map4["target"] = "Actor2";
1037   map4["property"] = "color";
1038   map4["initialValue"] = Color::BLACK;
1039   map4["targetValue"] = Color::GREEN;
1040   map4["animator"] = Property::Map()
1041     .Add("alphaFunction", "EASE_IN_OUT_SINE")
1042     .Add("timePeriod", Property::Map()
1043          .Add("delay", 0.5f)
1044          .Add("duration", 0.5f));
1045
1046   Property::Map map5;
1047   map5["target"] = "Actor2";
1048   map5["property"] = "position";
1049   map5["initialValue"] = Vector3(100,0,0);
1050   map5["targetValue"] = Vector3(0,100,0);
1051   map5["animator"] = Property::Map()
1052     .Add("alphaFunction", "BOUNCE")
1053     .Add("timePeriod", Property::Map()
1054          .Add("delay", 0.2f)
1055          .Add("duration", 2.0f));
1056
1057   Property::Map map6;
1058   map6["target"] = "Actor2";
1059   map6["property"] = "size";
1060   map6["initialValue"] = Vector2(10,10);
1061   map6["targetValue"] = Vector2(100,100);
1062   map6["animator"] = Property::Map()
1063     .Add("alphaFunction", "SIN")
1064     .Add("timePeriod", Property::Map()
1065          .Add("delay", 0.4f)
1066          .Add("duration", 3.0f));
1067
1068   Property::Map map7;
1069   map7["target"] = "Actor4";
1070   map7["property"] = "sizeModeFactor";
1071   map7["initialValue"] = Vector3(1,1,1);
1072   map7["targetValue"] = Vector3(2,2,2);
1073   map7["animator"] = Property::Map()
1074     .Add("alphaFunction", "EASE_IN_SINE")
1075     .Add("timePeriod", Property::Map()
1076          .Add("delay", 0.0f)
1077          .Add("duration", 1.0f));
1078
1079   Property::Map map8;
1080   map8["target"] = "Visual1";
1081   map8["property"] = "opacity";
1082   map8["initialValue"] = 0.0f;
1083   map8["targetValue"] = 1.0f;
1084   map8["animator"] = Property::Map()
1085     .Add("alphaFunction", "EASE_IN")
1086     .Add("timePeriod", Property::Map()
1087          .Add("delay", 0.3f)
1088          .Add("duration", 9.0f));
1089
1090   Property::Map map9;
1091   map9["target"] = "Actor2";
1092   map9["property"] = "scale";
1093   map9["initialValue"] = Vector3(0,0,0);
1094   map9["targetValue"] = Vector3(1,1,1);
1095   map9["animator"] = Property::Map()
1096     .Add("alphaFunction", "REVERSE")
1097     .Add("timePeriod", Property::Map()
1098          .Add("delay", 0.0f)
1099          .Add("duration", 1.0f));
1100
1101   Property::Map map10;
1102   map10["target"] = "Actor2";
1103   map10["property"] = "scale";
1104   map10["initialValue"] = Vector3(0,0,0);
1105   map10["targetValue"] = Vector3(1,1,1);
1106   map10["animator"] = Property::Map()
1107     .Add("alphaFunction", Vector4(.23,.4,.8,1.2))
1108     .Add("timePeriod", Property::Map()
1109          .Add("delay", 0.0f)
1110          .Add("duration", 1.0f));
1111
1112   Property::Map map11;
1113   map11["target"] = "Actor2";
1114   map11["property"] = "scale";
1115   map11["initialValue"] = Vector3(0,0,0);
1116   map11["targetValue"] = Vector3(1,1,1);
1117   map11["animator"] = Property::Map()
1118     .Add("alphaFunction", Property::Array().Add(.23f).Add(.4f).Add(.8f).Add(.2f))
1119     .Add("timePeriod", Property::Map()
1120          .Add("delay", 0.0f)
1121          .Add("duration", 1.0f));
1122
1123   Property::Map map12;
1124   map12["target"] = "Actor1";
1125   map12["property"] = "orientation";
1126   map12["targetValue"] = Quaternion( Radian(Math::PI_2), Vector3::ZAXIS );
1127
1128   Property::Array array;
1129   array.PushBack(map1);
1130   array.PushBack(map2);
1131   array.PushBack(map3);
1132   array.PushBack(map4);
1133   array.PushBack(map5);
1134   array.PushBack(map6);
1135   array.PushBack(map7);
1136   array.PushBack(map8);
1137   array.PushBack(map9);
1138   array.PushBack(map10);
1139   array.PushBack(map11);
1140   array.PushBack(map12);
1141
1142   Dali::Toolkit::TransitionData transition = TransitionData::New( array );
1143
1144   DALI_TEST_EQUALS( transition.Count(), array.Count(), TEST_LOCATION );
1145
1146   for( unsigned int i=0; i < array.Count(); ++i )
1147   {
1148     Property::Map animatorMap = transition.GetAnimatorAt(i);
1149     Property::Value& value = array.GetElementAt(i);
1150     Property::Map* inputMap = value.GetMap();
1151     DALI_TEST_CHECK( inputMap );
1152     CHECK_MAP_EQUALS( *inputMap, animatorMap );
1153   }
1154
1155   END_TEST;
1156 }