ead839da66eae004e625fd30c2aca2ef11ee10c2
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-LayoutingAnimation.cpp
1 /*
2  * Copyright (c) 2018 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
18 #include <iostream>
19 #include <stdlib.h>
20 #include <dali-toolkit-test-suite-utils.h>
21 #include <toolkit-event-thread-callback.h>
22
23 #include <dali-toolkit/dali-toolkit.h>
24 #include <dali-toolkit/devel-api/controls/control-devel.h>
25 #include <dali-toolkit/devel-api/layouting/absolute-layout.h>
26 #include <dali-toolkit/devel-api/layouting/grid.h>
27 #include <dali-toolkit/devel-api/layouting/linear-layout.h>
28 #include <dali-toolkit/devel-api/layouting/layout-item-impl.h>
29 #include <dali-toolkit/devel-api/layouting/layout-group-impl.h>
30
31 #include <../custom-layout.h>
32
33 #include <layout-utils.h>
34
35 using namespace Dali;
36 using namespace Toolkit;
37
38 void utc_dali_toolkit_layouting_animation_startup(void)
39 {
40   test_return_value = TET_UNDEF;
41 }
42
43 void utc_dali_toolkit_layouting_animation_cleanup(void)
44 {
45   test_return_value = TET_PASS;
46 }
47
48 namespace
49 {
50
51 // Functor to test whether a Finish signal is emitted
52 struct LayoutTransitionFinishCheck
53 {
54   LayoutTransitionFinishCheck( bool& signalReceived )
55   : mSignalReceived( signalReceived )
56   {
57   }
58
59   void operator()( LayoutTransitionData::LayoutTransitionType type, LayoutTransitionData& layoutTransitionData )
60   {
61     mSignalReceived = true;
62   }
63
64   void Reset()
65   {
66     mSignalReceived = false;
67   }
68
69   void CheckSignalReceived()
70   {
71     if (!mSignalReceived)
72     {
73       tet_printf("Expected Finish signal was not received\n");
74       tet_result(TET_FAIL);
75     }
76     else
77     {
78       tet_result(TET_PASS);
79     }
80   }
81
82   void CheckSignalNotReceived()
83   {
84     if (mSignalReceived)
85     {
86       tet_printf("Unexpected Finish signal was received\n");
87       tet_result(TET_FAIL);
88     }
89     else
90     {
91       tet_result(TET_PASS);
92     }
93   }
94
95   bool& mSignalReceived; // owned by individual tests
96 };
97
98 } // anon namespace
99
100 int UtcDaliLayouting_LayoutTransitionDataConstructorP(void)
101 {
102   TestApplication application;
103
104   LayoutTransitionData layoutTransitionData;
105
106   DALI_TEST_CHECK( !layoutTransitionData );
107   END_TEST;
108 }
109
110 int UtcDaliLayouting_LayoutTransitionDataNewP(void)
111 {
112   TestApplication application;
113
114   LayoutTransitionData layoutTransitionData = LayoutTransitionData::New();
115
116   DALI_TEST_CHECK(layoutTransitionData);
117   END_TEST;
118 }
119
120 int UtcDaliLayouting_LayoutTransitionDataDownCastP(void)
121 {
122   TestApplication application;
123
124   LayoutTransitionData layoutTransitionData = LayoutTransitionData::New();
125   BaseHandle object(layoutTransitionData);
126
127   LayoutTransitionData layoutTransitionData2 = LayoutTransitionData::DownCast(object);
128   DALI_TEST_CHECK(layoutTransitionData2);
129
130   LayoutTransitionData layoutTransitionData3 = DownCast< LayoutTransitionData >(object);
131   DALI_TEST_CHECK(layoutTransitionData2);
132   END_TEST;
133 }
134
135 int UtcDaliLayouting_LayoutTransitionDataDownCastN(void)
136 {
137   TestApplication application;
138
139   BaseHandle unInitializedObject;
140
141   LayoutTransitionData layoutTransitionData1 = LayoutTransitionData::DownCast( unInitializedObject );
142   DALI_TEST_CHECK( !layoutTransitionData1 );
143
144   LayoutTransitionData layoutTransitionData2 = DownCast< LayoutTransitionData >( unInitializedObject );
145   DALI_TEST_CHECK( !layoutTransitionData2 );
146   END_TEST;
147 }
148
149 int UtcDaliLayouting_LayoutTransitionDataSetGetTransition(void)
150 {
151   TestApplication application;
152
153   auto layout = LinearLayout::New();
154   auto layoutTransitionData = LayoutTransitionData::New();
155
156   layout.SetTransitionData( LayoutTransitionData::ON_OWNER_SET, layoutTransitionData );
157   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_OWNER_SET ) == layoutTransitionData );
158   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_CHILD_ADD ) == LayoutTransitionData() );
159   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_CHILD_REMOVE ) == LayoutTransitionData() );
160
161   layout.SetTransitionData( LayoutTransitionData::ON_OWNER_SET, LayoutTransitionData() );
162   layout.SetTransitionData( LayoutTransitionData::ON_CHILD_ADD, layoutTransitionData );
163   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_OWNER_SET ) == LayoutTransitionData() );
164   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_CHILD_ADD ) == layoutTransitionData );
165   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_CHILD_REMOVE ) == LayoutTransitionData() );
166
167   layout.SetTransitionData( LayoutTransitionData::ON_CHILD_ADD, LayoutTransitionData() );
168   layout.SetTransitionData( LayoutTransitionData::ON_CHILD_REMOVE, layoutTransitionData );
169   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_OWNER_SET ) == LayoutTransitionData() );
170   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_CHILD_ADD ) == LayoutTransitionData() );
171   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_CHILD_REMOVE ) == layoutTransitionData );
172
173   END_TEST;
174 }
175
176 int UtcDaliLayouting_SetLayoutTransition01(void)
177 {
178   ToolkitTestApplication application;
179   tet_infoline(" UtcDaliLayouting_SetLayoutTransition01");
180
181   Stage stage = Stage::GetCurrent();
182   auto container = Control::New();
183   auto horizontalLayout = LinearLayout::New();
184   horizontalLayout.SetAnimateLayout( true );
185   horizontalLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
186
187   auto verticalLayout = LinearLayout::New();
188   verticalLayout.SetAnimateLayout( true );
189   verticalLayout.SetOrientation( LinearLayout::Orientation::VERTICAL );
190
191   DevelControl::SetLayout( container, horizontalLayout );
192   container.SetName( "Container");
193
194   std::vector< Control > controls;
195   controls.push_back( CreateLeafControl( 100, 100 ) );
196   controls.push_back( CreateLeafControl( 100, 100 ) );
197   for( auto&& iter : controls )
198   {
199     container.Add( iter );
200   }
201
202   container.SetParentOrigin( ParentOrigin::CENTER );
203   container.SetAnchorPoint( AnchorPoint::CENTER );
204   stage.Add( container );
205
206   auto layoutTransitionData = LayoutTransitionData::New();
207   {
208     // Instant resize for parent
209     Property::Map map;
210     map["property"] = "size";
211     map["targetValue"] = Property::Value(); // capture from layout update
212     map["animator"] = Property::Map()
213       .Add("alphaFunction", "LINEAR")
214       .Add("timePeriod", Property::Map()
215         .Add("delay", 0.0f)
216         .Add("duration", 0.0f));
217     layoutTransitionData.AddPropertyAnimator( container, map );
218   }
219   {
220     Property::Map map;
221     map["property"] = "opacity";
222     map["initialValue"] = 0.0f;
223     map["targetValue"] = 1.0f;
224     map["animator"] = Property::Map()
225       .Add("alphaFunction", "LINEAR")
226       .Add("timePeriod", Property::Map()
227         .Add("delay", 0.0f)
228         .Add("duration", 0.5f));
229     layoutTransitionData.AddPropertyAnimator( container, map );
230   }
231   {
232     // Instant position for children
233     Property::Map map;
234     map["property"] = "position";
235     map["animator"] = Property::Map()
236        .Add("alphaFunction", "LINEAR")
237        .Add("timePeriod", Property::Map()
238          .Add("delay", 0.0f)
239          .Add("duration", 0.0f));
240     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
241   }
242   {
243     // Grow children from (0,0) size to full size (captured)
244     Property::Map map;
245     map["property"] = "size";
246     map["initialValue"] = Vector3( 0.0f, 0.0f, 0 );
247     map["animator"] = Property::Map()
248       .Add("alphaFunction", "LINEAR")
249       .Add("timePeriod", Property::Map()
250         .Add("delay", 0.0f)
251         .Add("duration", 0.5f));
252     layoutTransitionData.AddPropertyAnimator( Actor(), map );
253   }
254
255   // Ensure layouting happens
256   application.SendNotification();
257   application.Render();
258
259   // First round, no animation
260   // TODO: container size (0, 0) after it is added to the stage should be fixed with HQ patch soon
261   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
262   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
263   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 100.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
264
265   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
266   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
267   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
268
269   bool signalReceived(false);
270   LayoutTransitionFinishCheck finishCheck(signalReceived);
271   layoutTransitionData.FinishedSignal().Connect(&application, finishCheck);
272
273   // Change a layout, start transition
274   verticalLayout.SetTransitionData( LayoutTransitionData::ON_OWNER_SET, layoutTransitionData );
275   DevelControl::SetLayout( container, verticalLayout );
276
277   application.SendNotification();
278   application.Render( 1u /*just very beginning of the animation*/ );
279
280   finishCheck.CheckSignalNotReceived();
281   // Second round, animation just started
282   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
283   DALI_TEST_EQUALS( container.GetCurrentOpacity(), 0.0f, 0.1f, TEST_LOCATION );
284   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 300.0f, 0.0f ), 0.0001f, TEST_LOCATION );
285   DALI_TEST_EQUALS( controls[1].GetCurrentPosition(), Vector3( 0.0f, 400.0f, 0.0f ), 0.0001f, TEST_LOCATION );
286
287   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
288   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 0.0f, 0.0f, 0.0f ), 1.0f, TEST_LOCATION );
289   DALI_TEST_EQUALS( controls[1].GetCurrentSize(), Vector3( 0.0f, 0.0f, 0.0f ), 1.0f, TEST_LOCATION );
290
291   application.SendNotification();
292   application.Render(static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
293
294   // Third round, animation just finished
295   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
296   DALI_TEST_EQUALS( container.GetCurrentOpacity(), 1.0f, 0.0001f, TEST_LOCATION );
297   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 300.0f, 0.0f ), 0.0001f, TEST_LOCATION );
298   DALI_TEST_EQUALS( controls[1].GetCurrentPosition(), Vector3( 0.0f, 400.0f, 0.0f ), 0.0001f, TEST_LOCATION );
299
300   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
301   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
302   DALI_TEST_EQUALS( controls[1].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
303
304   application.SendNotification();
305   application.Render( 10u /* wait a bit more for a signal */ );
306
307   finishCheck.CheckSignalReceived();
308
309   // Now sizes and positions are finally set
310   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
311   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 300.0f, 0.0f ), 0.0001f, TEST_LOCATION );
312   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 400.0f, 0.0f ), 0.0001f, TEST_LOCATION );
313
314   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
315   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
316   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
317
318   // Transition back now with default transition
319   DevelControl::SetLayout( container, horizontalLayout );
320
321   application.SendNotification();
322   application.Render( 1u /*just very beginning of the animation*/ );
323
324   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
325   DALI_TEST_EQUALS( container.GetCurrentOpacity(), 1.0f, 0.0001f, TEST_LOCATION );
326   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 300.0f, 0.0f ), 1.0f, TEST_LOCATION );
327   DALI_TEST_EQUALS( controls[1].GetCurrentPosition(), Vector3( 0.0f, 400.0f, 0.0f ), 1.0f, TEST_LOCATION );
328
329   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
330   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
331   DALI_TEST_EQUALS( controls[1].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
332
333   application.SendNotification();
334   application.Render(static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
335
336   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
337   DALI_TEST_EQUALS( container.GetCurrentOpacity(), 1.0f, 0.0001f, TEST_LOCATION );
338   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
339   DALI_TEST_EQUALS( controls[1].GetCurrentPosition(), Vector3( 100.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
340
341   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
342   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
343   DALI_TEST_EQUALS( controls[1].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
344
345   application.SendNotification();
346   application.Render( 10u /* wait a bit more for complete default animation */ );
347
348   // Now sizes and positions are finally set
349   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
350   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
351   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 100.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
352
353   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
354   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
355   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
356
357   END_TEST;
358 }
359
360 int UtcDaliLayouting_AddChildLayoutTransition01(void)
361 {
362   ToolkitTestApplication application;
363   tet_infoline(" UtcDaliLayouting_AddChildLayoutTransition01");
364
365   Stage stage = Stage::GetCurrent();
366   auto container = Control::New();
367   auto horizontalLayout = LinearLayout::New();
368   horizontalLayout.SetAnimateLayout( true );
369   horizontalLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
370
371   DevelControl::SetLayout( container, horizontalLayout );
372   container.SetName( "Container");
373
374   std::vector< Control > controls;
375   controls.push_back( CreateLeafControl( 100, 100 ) );
376   container.SetParentOrigin( ParentOrigin::CENTER );
377   container.SetAnchorPoint( AnchorPoint::CENTER );
378   stage.Add( container );
379
380   auto layoutTransitionData = LayoutTransitionData::New();
381   {
382     // Instant resize for parent
383     Property::Map map;
384     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = "size";
385     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Property::Value(); // capture from layout update
386     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
387       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR" )
388       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
389         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
390         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
391     layoutTransitionData.AddPropertyAnimator( container, map );
392   }
393   {
394     // Instant position for a child
395     Property::Map map;
396     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = "position";
397     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
398        .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR")
399        .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
400          .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
401          .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
402     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
403   }
404   {
405     // Grow a child from (0,0) size to full size (captured)
406     Property::Map map;
407     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = "size";
408     map[ LayoutTransitionData::AnimatorKey::INITIAL_VALUE ] = Vector3( 0.0f, 0.0f, 0 );
409     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
410       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR")
411       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
412         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
413         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
414     layoutTransitionData.AddPropertyAnimator( controls[0], map );
415   }
416
417   horizontalLayout.SetTransitionData( LayoutTransitionData::ON_CHILD_ADD, layoutTransitionData );
418   container.Add( controls[0] );
419
420   bool signalReceived(false);
421   LayoutTransitionFinishCheck finishCheck(signalReceived);
422   layoutTransitionData.FinishedSignal().Connect(&application, finishCheck);
423
424   application.SendNotification();
425   application.Render( 1u /*just very beginning of the animation*/ );
426
427   finishCheck.CheckSignalNotReceived();
428   // The animation just started
429   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
430   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
431
432   application.SendNotification();
433   application.Render(static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
434
435   // The animation just finished
436   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
437   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
438
439   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
440   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
441
442   application.SendNotification();
443   application.Render( 10u /* wait a bit more for a signal */ );
444
445   // Now sizes and positions are finally set
446   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
447   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
448
449   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
450   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
451
452   finishCheck.CheckSignalReceived();
453
454   END_TEST;
455 }
456
457 int UtcDaliLayouting_RemoveChildLayoutTransition01(void)
458 {
459   ToolkitTestApplication application;
460   tet_infoline(" UtcDaliLayouting_RemoveChildLayoutTransition01");
461
462   Stage stage = Stage::GetCurrent();
463   auto container = Control::New();
464   auto horizontalLayout = LinearLayout::New();
465   horizontalLayout.SetAnimateLayout( true );
466   horizontalLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
467
468   DevelControl::SetLayout( container, horizontalLayout );
469   container.SetName( "Container");
470
471   std::vector< Control > controls;
472   controls.push_back( CreateLeafControl( 100, 100 ) );
473   controls.push_back( CreateLeafControl( 100, 100 ) );
474   container.SetParentOrigin( ParentOrigin::CENTER );
475   container.SetAnchorPoint( AnchorPoint::CENTER );
476   stage.Add( container );
477   container.Add( controls[0] );
478   container.Add( controls[1] );
479
480   // Initial rendering done
481   application.SendNotification();
482   application.Render();
483
484   auto layoutTransitionData = LayoutTransitionData::New();
485   {
486     // Instant resize for parent width
487     Property::Map map;
488     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE_WIDTH;
489     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Property::Value(); // capture from layout update
490     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
491       .Add( LayoutTransitionData::AnimatorKey::TYPE, "ANIMATE_TO" )
492       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR" )
493       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
494         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
495         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
496     layoutTransitionData.AddPropertyAnimator( container, map );
497   }
498   {
499     // Instant resize for parent height
500     Property::Map map;
501     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE_HEIGHT;
502     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Property::Value(); // capture from layout update
503     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
504       .Add( LayoutTransitionData::AnimatorKey::TYPE, "ANIMATE_TO" )
505       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR" )
506       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
507         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
508         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
509     layoutTransitionData.AddPropertyAnimator( container, map );
510   }
511   {
512     // Instant position for parent X position
513     Property::Map map;
514     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION_X;
515     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Property::Value(); // capture from layout update
516     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
517       .Add( LayoutTransitionData::AnimatorKey::TYPE, "ANIMATE_TO" )
518       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR" )
519       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
520         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
521         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
522     layoutTransitionData.AddPropertyAnimator( container, map );
523   }
524   {
525     // Instant position for parent Y position
526     Property::Map map;
527     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION_Y;
528     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Property::Value(); // capture from layout update
529     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
530       .Add( LayoutTransitionData::AnimatorKey::TYPE, "ANIMATE_TO" )
531       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR" )
532       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
533         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
534         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
535     layoutTransitionData.AddPropertyAnimator( container, map );
536   }
537   {
538     // Shrink the children
539     Property::Map map;
540     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE_WIDTH;
541     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = 0.0f;
542     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
543       .Add( LayoutTransitionData::AnimatorKey::TYPE, "ANIMATE_TO" )
544       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR")
545       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
546         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
547         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
548     layoutTransitionData.AddPropertyAnimator( Actor(), map );
549   }
550   {
551     // Shrink the children
552     Property::Map map;
553     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE_HEIGHT;
554     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = 0.0f;
555     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
556       .Add( LayoutTransitionData::AnimatorKey::TYPE, "ANIMATE_TO" )
557       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR")
558       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
559         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
560         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
561     layoutTransitionData.AddPropertyAnimator( Actor(), map );
562   }
563   {
564     // Instant position for a child
565     Property::Map map;
566     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION_X;
567     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
568       .Add( LayoutTransitionData::AnimatorKey::TYPE, "ANIMATE_TO" )
569       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR")
570       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
571         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
572         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
573     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
574   }
575   {
576     // Instant position for a child
577     Property::Map map;
578     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION_Y;
579     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
580       .Add( LayoutTransitionData::AnimatorKey::TYPE, "ANIMATE_TO" )
581       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR")
582       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
583         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
584         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
585     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
586   }
587
588   horizontalLayout.SetTransitionData( LayoutTransitionData::ON_CHILD_REMOVE, layoutTransitionData );
589   container.Remove( controls[1] );
590
591   bool signalReceived(false);
592   LayoutTransitionFinishCheck finishCheck(signalReceived);
593   layoutTransitionData.FinishedSignal().Connect(&application, finishCheck);
594
595   application.SendNotification();
596   application.Render( 1u /*just very beginning of the animation*/ );
597
598   finishCheck.CheckSignalNotReceived();
599   // Animation just started
600   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
601   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
602   DALI_TEST_EQUALS( controls[1].GetCurrentPosition(), Vector3( 100.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
603
604   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
605   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 0.0f, 0.0f, 0.0f ), 1.0f, TEST_LOCATION );
606   // this control is already removed from the tree.
607   DALI_TEST_EQUALS( controls[1].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
608
609   application.SendNotification();
610   application.Render(static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
611
612   // Animation just finished
613   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
614   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
615   // this control is already removed from the tree.
616   DALI_TEST_EQUALS( controls[1].GetCurrentPosition(), Vector3( 100.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
617
618   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
619   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 0.0f, 0.0f, 0.0f ), 1.0f, TEST_LOCATION );
620   // this control is already removed from the tree.
621   DALI_TEST_EQUALS( controls[1].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
622
623   application.SendNotification();
624   application.Render( 10u /* wait a bit more for a signal */ );
625
626   // Now sizes and positions are finally set
627   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
628   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
629   // this control is already removed from the tree.
630   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 100.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
631
632   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
633   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
634   // this control is already removed from the tree.
635   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
636
637   finishCheck.CheckSignalReceived();
638
639   END_TEST;
640 }
641
642 int UtcDaliLayouting_AddChildLayoutTransition02_KeyFrames(void)
643 {
644   ToolkitTestApplication application;
645   tet_infoline(" UtcDaliLayouting_AddChildLayoutTransition02_KeyFrames");
646
647   Stage stage = Stage::GetCurrent();
648   auto container = Control::New();
649   auto horizontalLayout = LinearLayout::New();
650   horizontalLayout.SetAnimateLayout( true );
651   horizontalLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
652
653   DevelControl::SetLayout( container, horizontalLayout );
654   container.SetName( "Container");
655
656   std::vector< Control > controls;
657   controls.push_back( CreateLeafControl( 100, 100 ) );
658   container.SetParentOrigin( ParentOrigin::CENTER );
659   container.SetAnchorPoint( AnchorPoint::CENTER );
660   stage.Add( container );
661
662   auto layoutTransitionData = LayoutTransitionData::New();
663   {
664     // Instant resize for parent
665     Property::Map map;
666     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE;
667     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Property::Value(); // capture from layout update
668     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
669       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR" )
670       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
671         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
672         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
673     layoutTransitionData.AddPropertyAnimator( container, map );
674   }
675   {
676     // Instant position for a child
677     Property::Map map;
678     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION;
679     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
680        .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR")
681        .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
682          .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
683          .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
684     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
685   }
686   {
687     // Grow a child from (0,0) size to full size with key frames
688     KeyFrames keyFrames = KeyFrames::New();
689     keyFrames.Add( 0.0f, Vector3( 0.0f, 0.0f, 0 ) );
690     keyFrames.Add( 0.5f, Vector3( 100.0f, 100.0f, 0 ) );
691
692     Property::Map map;
693     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE;
694     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
695       .Add( LayoutTransitionData::AnimatorKey::TYPE, "ANIMATE_BETWEEN")
696       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR")
697       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
698         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
699         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
700     layoutTransitionData.AddPropertyAnimator( controls[0], map, keyFrames, Animation::Interpolation::Linear );
701   }
702
703   horizontalLayout.SetTransitionData( LayoutTransitionData::ON_CHILD_ADD, layoutTransitionData );
704   container.Add( controls[0] );
705
706   bool signalReceived(false);
707   LayoutTransitionFinishCheck finishCheck(signalReceived);
708   layoutTransitionData.FinishedSignal().Connect(&application, finishCheck);
709
710   application.SendNotification();
711   application.Render( 1u /*just very beginning of the animation*/ );
712
713   finishCheck.CheckSignalNotReceived();
714   // The animation just started
715   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
716   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
717
718   application.SendNotification();
719   application.Render(static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
720
721   // The animation just finished
722   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
723   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
724
725   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
726   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
727
728   application.SendNotification();
729   application.Render( 10u /* wait a bit more for a signal */ );
730
731   // Now sizes and positions are finally set
732   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
733   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
734
735   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
736   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
737
738   finishCheck.CheckSignalReceived();
739
740   END_TEST;
741 }
742
743 int UtcDaliLayouting_AddChildLayoutTransition03_Path(void)
744 {
745   ToolkitTestApplication application;
746   tet_infoline(" UtcDaliLayouting_AddChildLayoutTransition03_Path");
747
748   Stage stage = Stage::GetCurrent();
749   auto container = Control::New();
750   auto horizontalLayout = LinearLayout::New();
751   horizontalLayout.SetAnimateLayout( true );
752   horizontalLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
753
754   DevelControl::SetLayout( container, horizontalLayout );
755   container.SetName( "Container");
756
757   std::vector< Control > controls;
758   controls.push_back( CreateLeafControl( 100, 100 ) );
759   container.SetParentOrigin( ParentOrigin::CENTER );
760   container.SetAnchorPoint( AnchorPoint::CENTER );
761   stage.Add( container );
762
763   auto layoutTransitionData = LayoutTransitionData::New();
764   {
765     // Instant resize for parent
766     Property::Map map;
767     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE;
768     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Property::Value(); // capture from layout update
769     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
770       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR" )
771       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
772         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
773         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
774     layoutTransitionData.AddPropertyAnimator( container, map );
775   }
776
777   Dali::Path path = Dali::Path::New();
778   {
779     // Curve position for a child
780     Property::Map map;
781     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION;
782     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
783        .Add( LayoutTransitionData::AnimatorKey::TYPE, "ANIMATE_PATH")
784        .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR")
785        .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
786          .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
787          .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f ) );
788
789     // Build the path
790     Vector3 position0( 30.0,  80.0,  0.0 );
791     Vector3 position1( 70.0,  120.0, 0.0 );
792     Vector3 position2( 0.0, 350.0, 0.0 );
793
794     //Dali::Path path = Dali::Path::New();
795     path.AddPoint( position0 );
796     path.AddPoint( position1 );
797     path.AddPoint( position2 );
798
799     // Control points for first segment
800     path.AddControlPoint( Vector3( 39.0,  90.0, 0.0 ) );
801     path.AddControlPoint( Vector3( 56.0, 119.0, 0.0 ) );
802
803     // Control points for second segment
804     path.AddControlPoint( Vector3( 78.0, 120.0, 0.0 ) );
805     path.AddControlPoint( Vector3( 93.0, 104.0, 0.0 ) );
806
807     layoutTransitionData.AddPropertyAnimator( controls[0], map, path, Vector3::XAXIS );
808   }
809   {
810     // Grow a child from (0,0) size to full size (captured)
811     Property::Map map;
812     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = "size";
813     map[ LayoutTransitionData::AnimatorKey::INITIAL_VALUE ] = Vector3( 0.0f, 0.0f, 0 );
814     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
815       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR")
816       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
817         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
818         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
819     layoutTransitionData.AddPropertyAnimator( controls[0], map );
820   }
821
822   horizontalLayout.SetTransitionData( LayoutTransitionData::ON_CHILD_ADD, layoutTransitionData );
823   container.Add( controls[0] );
824
825   bool signalReceived(false);
826   LayoutTransitionFinishCheck finishCheck(signalReceived);
827   layoutTransitionData.FinishedSignal().Connect(&application, finishCheck);
828
829   application.SendNotification();
830   application.Render( 0 );
831
832   finishCheck.CheckSignalNotReceived();
833   // The animation just started
834   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
835
836   Vector3 position, tangent;
837   Quaternion rotation;
838   path.Sample( 0.0f, position, tangent );
839   rotation = Quaternion( Vector3::XAXIS, tangent );
840   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), position,  0.0001f, TEST_LOCATION );
841   DALI_TEST_EQUALS( controls[0].GetCurrentOrientation(), rotation, 0.0001f, TEST_LOCATION );
842
843   application.SendNotification();
844   application.Render(static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
845
846   path.Sample( 1.0f, position, tangent );
847   rotation = Quaternion( Vector3::XAXIS, tangent );
848   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), position, 0.0001f, TEST_LOCATION );
849   DALI_TEST_EQUALS( controls[0].GetCurrentOrientation(), rotation, 0.0001f, TEST_LOCATION );
850
851   // The animation just finished
852   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
853   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
854
855   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
856   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
857
858   application.SendNotification();
859   application.Render( 10u /* wait a bit more for a signal */ );
860
861   // Now sizes and positions are finally set
862   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
863   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
864
865   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
866   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
867
868   finishCheck.CheckSignalReceived();
869
870   END_TEST;
871 }
872
873 int UtcDaliLayouting_AddChildLayoutTransition04_AnimateBy(void)
874 {
875   ToolkitTestApplication application;
876   tet_infoline(" UtcDaliLayouting_AddChildLayoutTransition04_AnimateBy");
877
878   Stage stage = Stage::GetCurrent();
879   auto container = Control::New();
880   auto horizontalLayout = LinearLayout::New();
881   horizontalLayout.SetAnimateLayout( true );
882   horizontalLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
883
884   DevelControl::SetLayout( container, horizontalLayout );
885   container.SetName( "Container");
886
887   std::vector< Control > controls;
888   controls.push_back( CreateLeafControl( 100, 100 ) );
889   container.SetParentOrigin( ParentOrigin::CENTER );
890   container.SetAnchorPoint( AnchorPoint::CENTER );
891   stage.Add( container );
892
893   auto layoutTransitionData = LayoutTransitionData::New();
894   {
895     // Instant resize for parent
896     Property::Map map;
897     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE;
898     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Property::Value(); // capture from layout update
899     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
900       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR" )
901       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
902         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
903         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
904     layoutTransitionData.AddPropertyAnimator( container, map );
905   }
906   {
907     // Instant position for a child
908     Property::Map map;
909     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION;
910     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
911        .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR")
912        .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
913          .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
914          .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
915     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
916   }
917   {
918     Property::Map map;
919     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE;
920     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Vector3( 0.0f, 350.0f, 0 );
921     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
922       .Add( LayoutTransitionData::AnimatorKey::TYPE, "ANIMATE_BY")
923       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR")
924       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
925         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
926         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
927     layoutTransitionData.AddPropertyAnimator( controls[0], map );
928   }
929
930   horizontalLayout.SetTransitionData( LayoutTransitionData::ON_CHILD_ADD, layoutTransitionData );
931   container.Add( controls[0] );
932
933   bool signalReceived(false);
934   LayoutTransitionFinishCheck finishCheck(signalReceived);
935   layoutTransitionData.FinishedSignal().Connect(&application, finishCheck);
936
937   application.SendNotification();
938   application.Render( 1u /*just very beginning of the animation*/ );
939
940   finishCheck.CheckSignalNotReceived();
941   // The animation just started
942   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
943   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
944
945   application.SendNotification();
946   application.Render( static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
947
948   // The animation just finished
949   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
950   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
951
952   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
953   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
954
955   application.SendNotification();
956   application.Render( 10u /* wait a bit more for a signal */ );
957
958   // Now sizes and positions are finally set
959   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
960   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
961
962   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
963   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
964
965   finishCheck.CheckSignalReceived();
966
967   END_TEST;
968 }
969
970 int UtcDaliLayouting_AddChildLayoutTransition05(void)
971 {
972   ToolkitTestApplication application;
973   tet_infoline(" UtcDaliLayouting_AddChildLayoutTransition05");
974
975   Stage stage = Stage::GetCurrent();
976   auto container = Control::New();
977   auto horizontalLayout = LinearLayout::New();
978   horizontalLayout.SetAnimateLayout( true );
979   horizontalLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
980
981   DevelControl::SetLayout( container, horizontalLayout );
982   container.SetName( "Container");
983
984   std::vector< Control > controls;
985   controls.push_back( CreateLeafControl( 100, 100 ) );
986   container.SetParentOrigin( ParentOrigin::CENTER );
987   container.SetAnchorPoint( AnchorPoint::CENTER );
988   stage.Add( container );
989
990   auto layoutTransitionData = LayoutTransitionData::New();
991   {
992     // Instant resize for parent
993     Property::Map map;
994     map[ "property" ] = Actor::Property::SIZE;
995     map[ "targetValue" ] = Property::Value(); // capture from layout update
996     map[ "animator" ] = Property::Map()
997       .Add( "name", "InstantAnimator" )
998       .Add( "type", "ANIMATE_TO")
999       .Add( "alphaFunction", "LINEAR" )
1000       .Add( "timePeriod", Property::Map()
1001         .Add( "delay", 0.0f )
1002         .Add( "duration", 0.0f ) );
1003     layoutTransitionData.AddPropertyAnimator( container, map );
1004   }
1005   {
1006     // Instant position for a child
1007     Property::Map map;
1008     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::COLOR_ALPHA;
1009     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = "InstantAnimator";
1010     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1011   }
1012   {
1013     // Grow a child from (0,0) size to full size (captured)
1014     Property::Map map;
1015     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE;
1016     map[ LayoutTransitionData::AnimatorKey::INITIAL_VALUE ] = Vector3( 0.0f, 0.0f, 0 );
1017     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = std::string();
1018     layoutTransitionData.AddPropertyAnimator( controls[0], map );
1019   }
1020   {
1021     // Instant opacity for a child, for testing
1022     Property::Map map;
1023     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION;
1024     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = "InstantAnimator";
1025     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1026   }
1027
1028   // Just throw all other alpha functions in
1029   { // no property, not going to be used, but going to be parsed
1030     Property::Map map;
1031     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1032       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "WRONG" );
1033     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1034   }
1035   { // no property, not going to be used, but going to be parsed
1036     Property::Map map;
1037     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1038       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR" );
1039     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1040   }
1041   { // no property, not going to be used, but going to be parsed
1042     Property::Map map;
1043     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1044       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "REVERSE" );
1045     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1046   }
1047   { // no property, not going to be used, but going to be parsed
1048     Property::Map map;
1049     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1050       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "EASE_IN_SQUARE" );
1051     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1052   }
1053   { // no property, not going to be used, but going to be parsed
1054     Property::Map map;
1055     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1056       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "EASE_OUT_SQUARE" );
1057     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1058   }
1059   { // no property, not going to be used, but going to be parsed
1060     Property::Map map;
1061     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1062       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "EASE_IN" );
1063     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1064   }
1065   { // no property, not going to be used, but going to be parsed
1066     Property::Map map;
1067     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1068       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "EASE_IN" );
1069     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1070   }
1071   { // no property, not going to be used, but going to be parsed
1072     Property::Map map;
1073     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1074       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "EASE_OUT" );
1075     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1076   }
1077   { // no property, not going to be used, but going to be parsed
1078     Property::Map map;
1079     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1080       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "EASE_IN_OUT" );
1081     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1082   }
1083   { // no property, not going to be used, but going to be parsed
1084     Property::Map map;
1085     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1086       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "EASE_IN_OUT_SINE" );
1087     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1088   }
1089   { // no property, not going to be used, but going to be parsed
1090     Property::Map map;
1091     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1092       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "EASE_IN_SINE" );
1093     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1094   }
1095   { // no property, not going to be used, but going to be parsed
1096     Property::Map map;
1097     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1098       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "EASE_OUT_SINE" );
1099     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1100   }
1101   { // no property, not going to be used, but going to be parsed
1102     Property::Map map;
1103     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1104       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "BOUNCE" );
1105     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1106   }
1107   { // no property, not going to be used, but going to be parsed
1108     Property::Map map;
1109     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1110       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "SIN" );
1111     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1112   }
1113   { // no property, not going to be used, but going to be parsed
1114     Property::Map map;
1115     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1116       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "EASE_OUT_BACK" );
1117     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1118   }
1119   { // no property, not going to be used, but going to be parsed
1120     Property::Map map;
1121     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1122       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, Vector4( 0.0f, 1.0f, 2.0f, 3.0f ) );
1123     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1124   }
1125   { // no property, not going to be used, but going to be parsed
1126     Property::Map map;
1127     // valid
1128     Property::Array array;
1129     array.Reserve( 4 );
1130     array.PushBack( 0.0f );
1131     array.PushBack( 1.0f );
1132     array.PushBack( 2.0f );
1133     array.PushBack( 3.0f );
1134     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1135       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, array );
1136     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1137   }
1138   { // no property, not going to be used, but going to be parsed
1139     Property::Map map;
1140     // invalid
1141     Property::Array array;
1142     array.Reserve( 3 );
1143     array.PushBack( 0.0f );
1144     array.PushBack( 1.0f );
1145     array.PushBack( 2.0f );
1146     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1147       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, array );
1148     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1149   }
1150   { // no property, not going to be used, but going to be parsed
1151     Property::Map map;
1152     // invalid
1153     Property::Array array;
1154     array.Reserve( 4 );
1155     array.PushBack( 0.0f );
1156     array.PushBack( 10 );
1157     array.PushBack( 2.0f );
1158     array.PushBack( 3.0f );
1159     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1160       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, array );
1161     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1162   }
1163   { // no property, not going to be used, but going to be parsed
1164     Property::Map map;
1165     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = 0; // invalid
1166     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1167   }
1168
1169   horizontalLayout.SetTransitionData( LayoutTransitionData::ON_CHILD_ADD, layoutTransitionData );
1170   container.Add( controls[0] );
1171
1172   bool signalReceived(false);
1173   LayoutTransitionFinishCheck finishCheck(signalReceived);
1174   layoutTransitionData.FinishedSignal().Connect(&application, finishCheck);
1175
1176   application.SendNotification();
1177   application.Render( 1u /*just very beginning of the animation*/ );
1178
1179   finishCheck.CheckSignalNotReceived();
1180   // The animation just started
1181   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1182   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1183
1184   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 1.0f, TEST_LOCATION );
1185   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 0.0f, 0.0f, 0.0f ), 1.0f, TEST_LOCATION );
1186
1187   application.SendNotification();
1188   application.Render(static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
1189
1190   // The animation just finished
1191   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1192   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1193
1194   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1195   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1196
1197   application.SendNotification();
1198   application.Render( 10u /* wait a bit more for a signal */ );
1199
1200   // Now sizes and positions are finally set
1201   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1202   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1203
1204   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1205   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1206
1207   finishCheck.CheckSignalReceived();
1208
1209   END_TEST;
1210 }
1211