Add the logical key to Integration::KeyEvent
[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/focus-manager/keyinput-focus-manager.h>
25 #include <dali-toolkit/devel-api/controls/control-devel.h>
26 #include <dali-toolkit/devel-api/layouting/absolute-layout.h>
27 #include <dali-toolkit/devel-api/layouting/grid.h>
28 #include <dali-toolkit/devel-api/layouting/linear-layout.h>
29 #include <dali-toolkit/devel-api/layouting/layout-item-impl.h>
30 #include <dali-toolkit/devel-api/layouting/layout-group-impl.h>
31
32 #include <../custom-layout.h>
33
34 #include <layout-utils.h>
35
36 using namespace Dali;
37 using namespace Toolkit;
38
39 void utc_dali_toolkit_layouting_animation_startup(void)
40 {
41   test_return_value = TET_UNDEF;
42 }
43
44 void utc_dali_toolkit_layouting_animation_cleanup(void)
45 {
46   test_return_value = TET_PASS;
47 }
48
49 namespace
50 {
51
52 // Functor to test whether a Finish signal is emitted
53 struct LayoutTransitionFinishCheck
54 {
55   LayoutTransitionFinishCheck( bool& signalReceived )
56   : mSignalReceived( signalReceived )
57   {
58   }
59
60   void operator()( LayoutTransitionData::Type type, LayoutTransitionData& layoutTransitionData )
61   {
62     mSignalReceived = true;
63   }
64
65   void Reset()
66   {
67     mSignalReceived = false;
68   }
69
70   void CheckSignalReceived()
71   {
72     if (!mSignalReceived)
73     {
74       tet_printf("Expected Finish signal was not received\n");
75       tet_result(TET_FAIL);
76     }
77     else
78     {
79       tet_result(TET_PASS);
80     }
81   }
82
83   void CheckSignalNotReceived()
84   {
85     if (mSignalReceived)
86     {
87       tet_printf("Unexpected Finish signal was received\n");
88       tet_result(TET_FAIL);
89     }
90     else
91     {
92       tet_result(TET_PASS);
93     }
94   }
95
96   bool& mSignalReceived; // owned by individual tests
97 };
98
99 } // anon namespace
100
101 int UtcDaliLayouting_LayoutTransitionDataConstructorP(void)
102 {
103   TestApplication application;
104
105   LayoutTransitionData layoutTransitionData;
106
107   DALI_TEST_CHECK( !layoutTransitionData );
108   END_TEST;
109 }
110
111 int UtcDaliLayouting_LayoutTransitionDataNewP(void)
112 {
113   TestApplication application;
114
115   LayoutTransitionData layoutTransitionData = LayoutTransitionData::New();
116
117   DALI_TEST_CHECK(layoutTransitionData);
118   END_TEST;
119 }
120
121 int UtcDaliLayouting_LayoutTransitionDataDownCastP(void)
122 {
123   TestApplication application;
124
125   LayoutTransitionData layoutTransitionData = LayoutTransitionData::New();
126   BaseHandle object(layoutTransitionData);
127
128   LayoutTransitionData layoutTransitionData2 = LayoutTransitionData::DownCast(object);
129   DALI_TEST_CHECK(layoutTransitionData2);
130
131   LayoutTransitionData layoutTransitionData3 = DownCast< LayoutTransitionData >(object);
132   DALI_TEST_CHECK(layoutTransitionData2);
133   END_TEST;
134 }
135
136 int UtcDaliLayouting_LayoutTransitionDataDownCastN(void)
137 {
138   TestApplication application;
139
140   BaseHandle unInitializedObject;
141
142   LayoutTransitionData layoutTransitionData1 = LayoutTransitionData::DownCast( unInitializedObject );
143   DALI_TEST_CHECK( !layoutTransitionData1 );
144
145   LayoutTransitionData layoutTransitionData2 = DownCast< LayoutTransitionData >( unInitializedObject );
146   DALI_TEST_CHECK( !layoutTransitionData2 );
147   END_TEST;
148 }
149
150 int UtcDaliLayouting_LayoutTransitionDataSetGetTransition(void)
151 {
152   TestApplication application;
153
154   auto layout = LinearLayout::New();
155   auto layoutTransitionData = LayoutTransitionData::New();
156
157   layout.SetTransitionData( LayoutTransitionData::ON_CHILD_ADD, layoutTransitionData );
158   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_CHILD_ADD ) == layoutTransitionData );
159   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_CHILD_REMOVE ) == LayoutTransitionData() );
160   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_CHILD_FOCUS ) == LayoutTransitionData() );
161   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_OWNER_SET ) == LayoutTransitionData() );
162   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_LAYOUT_CHANGE ) == LayoutTransitionData() );
163
164   layout.SetTransitionData( LayoutTransitionData::ON_CHILD_ADD, LayoutTransitionData() );
165   layout.SetTransitionData( LayoutTransitionData::ON_CHILD_REMOVE, layoutTransitionData );
166   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_CHILD_ADD ) == LayoutTransitionData() );
167   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_CHILD_REMOVE ) == layoutTransitionData );
168   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_CHILD_FOCUS ) == LayoutTransitionData() );
169   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_OWNER_SET ) == LayoutTransitionData() );
170   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_LAYOUT_CHANGE ) == LayoutTransitionData() );
171
172   layout.SetTransitionData( LayoutTransitionData::ON_CHILD_REMOVE, LayoutTransitionData() );
173   layout.SetTransitionData( LayoutTransitionData::ON_CHILD_FOCUS, layoutTransitionData );
174   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_CHILD_ADD ) == LayoutTransitionData() );
175   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_CHILD_REMOVE ) == LayoutTransitionData() );
176   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_CHILD_FOCUS ) == layoutTransitionData );
177   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_OWNER_SET ) == LayoutTransitionData() );
178   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_LAYOUT_CHANGE ) == LayoutTransitionData() );
179
180   layout.SetTransitionData( LayoutTransitionData::ON_CHILD_FOCUS, LayoutTransitionData() );
181   layout.SetTransitionData( LayoutTransitionData::ON_OWNER_SET, layoutTransitionData );
182   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_CHILD_ADD ) == LayoutTransitionData() );
183   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_CHILD_REMOVE ) == LayoutTransitionData() );
184   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_CHILD_FOCUS ) == LayoutTransitionData() );
185   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_OWNER_SET ) == layoutTransitionData );
186   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_LAYOUT_CHANGE ) == LayoutTransitionData() );
187
188   layout.SetTransitionData( LayoutTransitionData::ON_OWNER_SET, LayoutTransitionData() );
189   layout.SetTransitionData( LayoutTransitionData::ON_LAYOUT_CHANGE, layoutTransitionData );
190   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_CHILD_ADD ) == LayoutTransitionData() );
191   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_CHILD_REMOVE ) == LayoutTransitionData() );
192   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_CHILD_FOCUS ) == LayoutTransitionData() );
193   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_OWNER_SET ) == LayoutTransitionData() );
194   DALI_TEST_CHECK( layout.GetTransitionData( LayoutTransitionData::ON_LAYOUT_CHANGE ) == layoutTransitionData );
195
196   END_TEST;
197 }
198
199 int UtcDaliLayouting_SetLayoutTransition01(void)
200 {
201   ToolkitTestApplication application;
202   tet_infoline(" UtcDaliLayouting_SetLayoutTransition01" );
203
204   Stage stage = Stage::GetCurrent();
205   auto container = Control::New();
206   auto horizontalLayout = LinearLayout::New();
207   horizontalLayout.SetAnimateLayout( false );
208   horizontalLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
209
210   auto verticalLayout = LinearLayout::New();
211   verticalLayout.SetAnimateLayout( false );
212   verticalLayout.SetOrientation( LinearLayout::Orientation::VERTICAL );
213
214   DevelControl::SetLayout( container, horizontalLayout );
215   container.SetName( "Container");
216
217   std::vector< Control > controls;
218   controls.push_back( CreateLeafControl( 100, 100 ) );
219   controls.push_back( CreateLeafControl( 100, 100 ) );
220   for( auto&& iter : controls )
221   {
222     container.Add( iter );
223   }
224   stage.Add( container );
225
226   auto layoutTransitionData = LayoutTransitionData::New();
227   {
228     // Instant resize for parent
229     Property::Map map;
230     map["property"] = "size";
231     map["targetValue"] = Property::Value(); // capture from layout update
232     map["animator"] = Property::Map()
233       .Add("alphaFunction", "LINEAR")
234       .Add("timePeriod", Property::Map()
235         .Add("delay", 0.0f)
236         .Add("duration", 0.0f));
237     layoutTransitionData.AddPropertyAnimator( container, map );
238   }
239   {
240     Property::Map map;
241     map["property"] = "opacity";
242     map["initialValue"] = 0.0f;
243     map["targetValue"] = 1.0f;
244     map["animator"] = Property::Map()
245       .Add("alphaFunction", "LINEAR")
246       .Add("timePeriod", Property::Map()
247         .Add("delay", 0.0f)
248         .Add("duration", 0.5f));
249     layoutTransitionData.AddPropertyAnimator( container, map );
250   }
251   {
252     // Instant position for children
253     Property::Map map;
254     map["property"] = "position";
255     map["animator"] = Property::Map()
256        .Add("alphaFunction", "LINEAR")
257        .Add("timePeriod", Property::Map()
258          .Add("delay", 0.0f)
259          .Add("duration", 0.0f));
260     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
261   }
262   {
263     // Grow children from (0,0) size to full size (captured)
264     Property::Map map;
265     map["property"] = "size";
266     map["initialValue"] = Vector3( 0.0f, 0.0f, 0 );
267     map["animator"] = Property::Map()
268       .Add("alphaFunction", "LINEAR")
269       .Add("timePeriod", Property::Map()
270         .Add("delay", 0.0f)
271         .Add("duration", 0.5f));
272     layoutTransitionData.AddPropertyAnimator( Actor(), map );
273   }
274
275   // Ensure layouting happens
276   application.SendNotification();
277   application.Render();
278
279   // First round, no animation
280   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
281   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
282   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 100.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
283
284   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
285   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
286   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
287
288   bool signalReceived(false);
289   LayoutTransitionFinishCheck finishCheck(signalReceived);
290   layoutTransitionData.FinishedSignal().Connect(&application, finishCheck);
291
292   horizontalLayout.SetAnimateLayout( true );
293   verticalLayout.SetAnimateLayout( true );
294
295   // Change a layout, start transition
296   verticalLayout.SetTransitionData( LayoutTransitionData::ON_OWNER_SET, layoutTransitionData );
297   DevelControl::SetLayout( container, verticalLayout );
298
299   application.SendNotification();
300   application.Render( 1u /*just very beginning of the animation*/ );
301
302   finishCheck.CheckSignalNotReceived();
303   // Second round, animation just started
304   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
305   DALI_TEST_EQUALS( container.GetCurrentOpacity(), 0.0f, 0.1f, TEST_LOCATION );
306   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 300.0f, 0.0f ), 0.0001f, TEST_LOCATION );
307   DALI_TEST_EQUALS( controls[1].GetCurrentPosition(), Vector3( 0.0f, 400.0f, 0.0f ), 0.0001f, TEST_LOCATION );
308
309   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
310   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 0.0f, 0.0f, 0.0f ), 1.0f, TEST_LOCATION );
311   DALI_TEST_EQUALS( controls[1].GetCurrentSize(), Vector3( 0.0f, 0.0f, 0.0f ), 1.0f, TEST_LOCATION );
312
313   application.SendNotification();
314   application.Render(static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
315
316   // Third round, animation just finished
317   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
318   DALI_TEST_EQUALS( container.GetCurrentOpacity(), 1.0f, 0.0001f, TEST_LOCATION );
319   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 300.0f, 0.0f ), 0.0001f, TEST_LOCATION );
320   DALI_TEST_EQUALS( controls[1].GetCurrentPosition(), Vector3( 0.0f, 400.0f, 0.0f ), 0.0001f, TEST_LOCATION );
321
322   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
323   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
324   DALI_TEST_EQUALS( controls[1].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
325
326   application.SendNotification();
327   application.Render( 10u /* wait a bit more for a signal */ );
328
329   finishCheck.CheckSignalReceived();
330
331   // Now sizes and positions are finally set
332   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
333   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 300.0f, 0.0f ), 0.0001f, TEST_LOCATION );
334   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 400.0f, 0.0f ), 0.0001f, TEST_LOCATION );
335
336   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
337   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
338   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
339
340   // Transition back now with default transition
341   DevelControl::SetLayout( container, horizontalLayout );
342
343   application.SendNotification();
344   application.Render( 1u /*just very beginning of the animation*/ );
345
346   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
347   DALI_TEST_EQUALS( container.GetCurrentOpacity(), 1.0f, 0.0001f, TEST_LOCATION );
348   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 300.0f, 0.0f ), 1.0f, TEST_LOCATION );
349   DALI_TEST_EQUALS( controls[1].GetCurrentPosition(), Vector3( 0.0f, 400.0f, 0.0f ), 1.0f, TEST_LOCATION );
350
351   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
352   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
353   DALI_TEST_EQUALS( controls[1].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
354
355   application.SendNotification();
356   application.Render(static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
357
358   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
359   DALI_TEST_EQUALS( container.GetCurrentOpacity(), 1.0f, 0.0001f, TEST_LOCATION );
360   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
361   DALI_TEST_EQUALS( controls[1].GetCurrentPosition(), Vector3( 100.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
362
363   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
364   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
365   DALI_TEST_EQUALS( controls[1].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
366
367   application.SendNotification();
368   application.Render( 10u /* wait a bit more for complete default animation */ );
369
370   // Now sizes and positions are finally set
371   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
372   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
373   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 100.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
374
375   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
376   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
377   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
378
379   END_TEST;
380 }
381
382 int UtcDaliLayouting_AddChildLayoutTransition01(void)
383 {
384   ToolkitTestApplication application;
385   tet_infoline(" UtcDaliLayouting_AddChildLayoutTransition01" );
386
387   Stage stage = Stage::GetCurrent();
388   auto container = Control::New();
389   auto horizontalLayout = LinearLayout::New();
390   horizontalLayout.SetAnimateLayout( true );
391   horizontalLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
392
393   DevelControl::SetLayout( container, horizontalLayout );
394   container.SetName( "Container");
395
396   std::vector< Control > controls;
397   controls.push_back( CreateLeafControl( 100, 100 ) );
398   stage.Add( container );
399
400   auto layoutTransitionData = LayoutTransitionData::New();
401   {
402     // Instant resize for parent
403     Property::Map map;
404     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = "size";
405     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Property::Value(); // capture from layout update
406     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
407       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR" )
408       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
409         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
410         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
411     layoutTransitionData.AddPropertyAnimator( container, map );
412   }
413   {
414     // Instant position for a child
415     Property::Map map;
416     map[ LayoutTransitionData::AnimatorKey::CONDITION ] = LayoutTransitionData::Condition::NONE;
417     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = "position";
418     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
419        .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR")
420        .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
421          .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
422          .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
423     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
424   }
425   {
426     // Grow a child from (0,0) size to full size (captured)
427     Property::Map map;
428     map[ LayoutTransitionData::AnimatorKey::CONDITION ] = LayoutTransitionData::Condition::ON_ADD;
429     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = "size";
430     map[ LayoutTransitionData::AnimatorKey::INITIAL_VALUE ] = Vector3( 0.0f, 0.0f, 0 );
431     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
432       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR")
433       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
434         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
435         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
436     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to an added child
437   }
438
439   horizontalLayout.SetTransitionData( LayoutTransitionData::ON_CHILD_ADD, layoutTransitionData );
440   container.Add( controls[0] );
441
442   bool signalReceived(false);
443   LayoutTransitionFinishCheck finishCheck(signalReceived);
444   layoutTransitionData.FinishedSignal().Connect(&application, finishCheck);
445
446   application.SendNotification();
447   application.Render( 1u /*just very beginning of the animation*/ );
448
449   finishCheck.CheckSignalNotReceived();
450   // The animation just started
451   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
452   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
453
454   application.SendNotification();
455   application.Render(static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
456
457   // The animation just finished
458   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
459   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
460
461   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
462   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
463
464   application.SendNotification();
465   application.Render( 10u /* wait a bit more for a signal */ );
466
467   // Now sizes and positions are finally set
468   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
469   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
470
471   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
472   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
473
474   finishCheck.CheckSignalReceived();
475
476   END_TEST;
477 }
478
479 int UtcDaliLayouting_RemoveChildLayoutTransition01(void)
480 {
481   ToolkitTestApplication application;
482   tet_infoline(" UtcDaliLayouting_RemoveChildLayoutTransition01" );
483
484   Stage stage = Stage::GetCurrent();
485   auto container = Control::New();
486   auto horizontalLayout = LinearLayout::New();
487   horizontalLayout.SetAnimateLayout( false );
488   horizontalLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
489
490   DevelControl::SetLayout( container, horizontalLayout );
491   container.SetName( "Container" );
492
493   std::vector< Control > controls;
494   controls.push_back( CreateLeafControl( 100, 100 ) );
495   controls.push_back( CreateLeafControl( 100, 100 ) );
496
497   stage.Add( container );
498   container.Add( controls[0] );
499   container.Add( controls[1] );
500
501   // Initial rendering done
502   application.SendNotification();
503   application.Render();
504
505   horizontalLayout.SetAnimateLayout( true );
506
507   auto layoutTransitionData = LayoutTransitionData::New();
508   {
509     // Instant resize for parent width
510     Property::Map map;
511     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE_WIDTH;
512     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Property::Value(); // capture from layout update
513     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
514       .Add( LayoutTransitionData::AnimatorKey::TYPE, "ANIMATE_TO" )
515       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR" )
516       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
517         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
518         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
519     layoutTransitionData.AddPropertyAnimator( container, map );
520   }
521   {
522     // Instant resize for parent height
523     Property::Map map;
524     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE_HEIGHT;
525     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Property::Value(); // capture from layout update
526     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
527       .Add( LayoutTransitionData::AnimatorKey::TYPE, "ANIMATE_TO" )
528       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR" )
529       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
530         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
531         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
532     layoutTransitionData.AddPropertyAnimator( container, map );
533   }
534   {
535     // Instant position for parent X position
536     Property::Map map;
537     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION_X;
538     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Property::Value(); // capture from layout update
539     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
540       .Add( LayoutTransitionData::AnimatorKey::TYPE, "ANIMATE_TO" )
541       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR" )
542       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
543         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
544         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
545     layoutTransitionData.AddPropertyAnimator( container, map );
546   }
547   {
548     // Instant position for parent Y position
549     Property::Map map;
550     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION_Y;
551     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Property::Value(); // capture from layout update
552     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
553       .Add( LayoutTransitionData::AnimatorKey::TYPE, "ANIMATE_TO" )
554       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR" )
555       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
556         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
557         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
558     layoutTransitionData.AddPropertyAnimator( container, map );
559   }
560   {
561     // Shrink the children
562     Property::Map map;
563     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE_WIDTH;
564     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = 0.0f;
565     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
566       .Add( LayoutTransitionData::AnimatorKey::TYPE, "ANIMATE_TO" )
567       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR")
568       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
569         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
570         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
571     layoutTransitionData.AddPropertyAnimator( Actor(), map );
572   }
573   {
574     // Shrink the children
575     Property::Map map;
576     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE_HEIGHT;
577     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = 0.0f;
578     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
579       .Add( LayoutTransitionData::AnimatorKey::TYPE, "ANIMATE_TO" )
580       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR")
581       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
582         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
583         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
584     layoutTransitionData.AddPropertyAnimator( Actor(), map );
585   }
586   {
587     // Shrink the removed child
588     Property::Map map;
589     map[ LayoutTransitionData::AnimatorKey::CONDITION ] = LayoutTransitionData::Condition::ON_REMOVE;
590     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE;
591     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Size( 0.0f, 0.0f );
592     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
593       .Add( LayoutTransitionData::AnimatorKey::TYPE, "ANIMATE_TO" )
594       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR")
595       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
596         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
597         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
598     layoutTransitionData.AddPropertyAnimator( Actor(), map );
599   }
600   {
601     // Instant position for children
602     Property::Map map;
603     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION_X;
604     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
605       .Add( LayoutTransitionData::AnimatorKey::TYPE, "ANIMATE_TO" )
606       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR")
607       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
608         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
609         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
610     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
611   }
612   {
613     // Instant position for children
614     Property::Map map;
615     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION_Y;
616     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
617       .Add( LayoutTransitionData::AnimatorKey::TYPE, "ANIMATE_TO" )
618       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR")
619       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
620         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
621         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
622     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
623   }
624
625   horizontalLayout.SetTransitionData( LayoutTransitionData::ON_CHILD_REMOVE, layoutTransitionData );
626   container.Remove( controls[1] );
627
628   bool signalReceived(false);
629   LayoutTransitionFinishCheck finishCheck(signalReceived);
630   layoutTransitionData.FinishedSignal().Connect(&application, finishCheck);
631
632   application.SendNotification();
633   application.Render( 1u /*just very beginning of the animation*/ );
634
635   finishCheck.CheckSignalNotReceived();
636   // Animation just started
637   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
638   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
639   DALI_TEST_EQUALS( controls[1].GetCurrentPosition(), Vector3( 100.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
640
641   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
642   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 1.0f, TEST_LOCATION );
643   // this control is already removed from the tree.
644   DALI_TEST_EQUALS( controls[1].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
645
646   application.SendNotification();
647   application.Render(static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
648
649   // Animation just finished
650   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
651   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
652   // this control is already removed from the tree.
653   DALI_TEST_EQUALS( controls[1].GetCurrentPosition(), Vector3( 100.0f, 350.0f, 0.0f ), 1.0f, TEST_LOCATION );
654
655   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
656   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 0.0f, 0.0f, 0.0f ), 1.0f, TEST_LOCATION );
657   // this control is already removed from the tree.
658   DALI_TEST_EQUALS( controls[1].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
659
660   application.SendNotification();
661   application.Render( 10u /* wait a bit more for a signal */ );
662
663   // Now sizes and positions are finally set
664   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
665   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
666   // this control is already removed from the tree.
667   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 100.0f, 350.0f, 0.0f ), 1.0f, TEST_LOCATION );
668
669   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
670   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
671   // this control is already removed from the tree.
672   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 1.0f, TEST_LOCATION );
673
674   finishCheck.CheckSignalReceived();
675
676   END_TEST;
677 }
678
679 int UtcDaliLayouting_FocusChildLayoutTransition01(void)
680 {
681   ToolkitTestApplication application;
682   tet_infoline(" UtcDaliLayouting_FocusChildLayoutTransition01" );
683
684   Stage stage = Stage::GetCurrent();
685   auto container = Control::New();
686   auto horizontalLayout = LinearLayout::New();
687   horizontalLayout.SetAnimateLayout( false );
688   horizontalLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
689
690   DevelControl::SetLayout( container, horizontalLayout );
691   container.SetName( "Container" );
692
693   std::vector< Control > controls;
694   controls.push_back( CreateLeafControl( 100, 100 ) );
695   controls.push_back( CreateLeafControl( 100, 100 ) );
696
697   stage.Add( container );
698   container.Add( controls[0] );
699   container.Add( controls[1] );
700
701   KeyInputFocusManager manager = KeyInputFocusManager::Get();
702   manager.SetFocus( controls[0] );
703
704   // Initial rendering done
705   application.SendNotification();
706   application.Render();
707
708   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
709   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
710   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 100.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
711
712   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
713   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
714   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
715
716   horizontalLayout.SetAnimateLayout( true );
717
718   auto layoutTransitionData = LayoutTransitionData::New();
719   {
720     // Instant resize for parent
721     Property::Map map;
722     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE;
723     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Property::Value(); // capture from layout update
724     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
725       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR" )
726       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
727         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
728         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
729     layoutTransitionData.AddPropertyAnimator( container, map );
730   }
731   {
732     // Instant position for parent
733     Property::Map map;
734     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION;
735     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Property::Value(); // capture from layout update
736     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
737        .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR" )
738        .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
739          .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
740          .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
741     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
742   }
743   {
744     // Shrink the lost focus child
745     Property::Map map;
746     map[ "affectsSiblings" ] = false;
747     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE;
748     map[ LayoutTransitionData::AnimatorKey::CONDITION ] = LayoutTransitionData::Condition::ON_FOCUS_LOST;
749     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Vector3( 80.0f, 80.0f, 0 );
750     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
751          .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR" )
752          .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
753            .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
754            .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
755     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to on focus lost child
756   }
757   {
758     // Grow the gained focus child
759     Property::Map map;
760     map[ "affectsSiblings" ] = false;
761     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE;
762     map[ LayoutTransitionData::AnimatorKey::CONDITION ] = LayoutTransitionData::Condition::ON_FOCUS_GAINED;
763     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Vector3( 120.0f, 120.0f, 0 );
764     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
765          .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR")
766          .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
767            .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
768            .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
769     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to on focus gained child
770   }
771
772   horizontalLayout.SetTransitionData( LayoutTransitionData::ON_CHILD_FOCUS, layoutTransitionData );
773
774   bool signalReceived(false);
775   LayoutTransitionFinishCheck finishCheck(signalReceived);
776   layoutTransitionData.FinishedSignal().Connect(&application, finishCheck);
777   manager.SetFocus( controls[1] );
778
779   application.SendNotification();
780   application.Render( 1u /*just very beginning of the animation*/ );
781
782   finishCheck.CheckSignalNotReceived();
783   // Animation just started
784   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
785   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
786   DALI_TEST_EQUALS( controls[1].GetCurrentPosition(), Vector3( 100.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
787
788   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
789   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 1.0f, TEST_LOCATION );
790   DALI_TEST_EQUALS( controls[1].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 1.0f, TEST_LOCATION );
791
792   application.SendNotification();
793   application.Render(static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
794
795   // Animation just finished
796   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
797   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
798   DALI_TEST_EQUALS( controls[1].GetCurrentPosition(), Vector3( 100.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
799
800   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
801   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 80.0f, 80.0f, 0.0f ), 1.0f, TEST_LOCATION );
802   DALI_TEST_EQUALS( controls[1].GetCurrentSize(), Vector3( 120.0f, 120.0f, 0.0f ), 1.0f, TEST_LOCATION );
803
804   application.SendNotification();
805   application.Render( 10u /* wait a bit more for a signal */ );
806
807   // Now sizes and positions are finally set
808   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
809   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
810   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 100.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
811
812   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
813   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 80.0f, 0.0f ), 0.0001f, TEST_LOCATION );
814   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 120.0f, 120.0f, 0.0f ), 0.0001f, TEST_LOCATION );
815
816   finishCheck.CheckSignalReceived();
817
818   END_TEST;
819 }
820
821 int UtcDaliLayouting_FocusChildLayoutTransition02(void)
822 {
823   ToolkitTestApplication application;
824   tet_infoline(" UtcDaliLayouting_FocusChildLayoutTransition02" );
825
826   Stage stage = Stage::GetCurrent();
827   auto container = Control::New();
828   auto horizontalLayout = LinearLayout::New();
829   horizontalLayout.SetAnimateLayout( false );
830   horizontalLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
831
832   DevelControl::SetLayout( container, horizontalLayout );
833   container.SetName( "Container" );
834
835   std::vector< Control > controls;
836   controls.push_back( CreateLeafControl( 100, 100 ) );
837   controls.push_back( CreateLeafControl( 100, 100 ) );
838
839   stage.Add( container );
840   container.Add( controls[0] );
841   container.Add( controls[1] );
842
843   KeyInputFocusManager manager = KeyInputFocusManager::Get();
844   manager.SetFocus( controls[0] );
845
846   // Initial rendering done
847   application.SendNotification();
848   application.Render();
849
850   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
851   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
852   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 100.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
853
854   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
855   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
856   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
857
858   horizontalLayout.SetAnimateLayout( true );
859
860   auto layoutTransitionData = LayoutTransitionData::New();
861   {
862     // Shrink the lost focus child width
863     Property::Map map;
864     map[ LayoutTransitionData::AnimatorKey::AFFECTS_SIBLINGS ] = false;
865     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION;
866     map[ LayoutTransitionData::AnimatorKey::TYPE ] = LayoutTransitionData::Animator::ANIMATE_TO;
867     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
868          .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::LINEAR )
869          .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
870            .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
871            .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
872     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // move all children
873   }
874   {
875     // Shrink the lost focus child width
876     Property::Map map;
877     map[ LayoutTransitionData::AnimatorKey::AFFECTS_SIBLINGS ] = true;
878     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE_WIDTH;
879     map[ LayoutTransitionData::AnimatorKey::CONDITION ] = LayoutTransitionData::Condition::ON_FOCUS_LOST;
880     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = 80.0f;
881     map[ LayoutTransitionData::AnimatorKey::TYPE ] = LayoutTransitionData::Animator::ANIMATE_TO;
882     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
883          .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::LINEAR )
884          .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
885            .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
886            .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
887     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to on focus lost child
888   }
889   {
890     // Shrink the lost focus child height
891     Property::Map map;
892     map[ LayoutTransitionData::AnimatorKey::AFFECTS_SIBLINGS ] = true;
893     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE_HEIGHT;
894     map[ LayoutTransitionData::AnimatorKey::CONDITION ] = LayoutTransitionData::Condition::ON_FOCUS_LOST;
895     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = 80.0f;
896     map[ LayoutTransitionData::AnimatorKey::TYPE ] = LayoutTransitionData::Animator::ANIMATE_TO;
897     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
898          .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::LINEAR )
899          .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
900            .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
901            .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
902     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to on focus lost child
903   }
904   {
905     // Grow the gained focus child
906     Property::Map map;
907     map[ LayoutTransitionData::AnimatorKey::AFFECTS_SIBLINGS ] = true;
908     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE;
909     map[ LayoutTransitionData::AnimatorKey::CONDITION ] = LayoutTransitionData::Condition::ON_FOCUS_GAINED;
910     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Vector3( 120.0f, 120.0f, 0 );
911     map[ LayoutTransitionData::AnimatorKey::TYPE ] = LayoutTransitionData::Animator::ANIMATE_TO;
912     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
913          .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::LINEAR )
914          .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
915            .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
916            .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
917     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to on focus gained child
918   }
919
920   horizontalLayout.SetTransitionData( LayoutTransitionData::ON_CHILD_FOCUS, layoutTransitionData );
921
922   bool signalReceived(false);
923   LayoutTransitionFinishCheck finishCheck(signalReceived);
924   layoutTransitionData.FinishedSignal().Connect(&application, finishCheck);
925   manager.SetFocus( controls[1] );
926
927   application.SendNotification();
928   application.Render( 1u /*just very beginning of the animation*/ );
929
930   finishCheck.CheckSignalNotReceived();
931   // Animation just started
932   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
933   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 1.0f, TEST_LOCATION );
934   DALI_TEST_EQUALS( controls[1].GetCurrentPosition(), Vector3( 100.0f, 350.0f, 0.0f ), 1.0f, TEST_LOCATION );
935
936   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
937   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 1.0f, TEST_LOCATION );
938   DALI_TEST_EQUALS( controls[1].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 1.0f, TEST_LOCATION );
939
940   application.SendNotification();
941   application.Render(static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
942
943   // Animation just finished
944   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
945   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 360.0f, 0.0f ), 0.0001f, TEST_LOCATION );
946   DALI_TEST_EQUALS( controls[1].GetCurrentPosition(), Vector3( 80.0f, 340.0f, 0.0f ), 0.0001f, TEST_LOCATION );
947
948   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
949   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 80.0f, 80.0f, 0.0f ), 1.0f, TEST_LOCATION );
950   DALI_TEST_EQUALS( controls[1].GetCurrentSize(), Vector3( 120.0f, 120.0f, 0.0f ), 1.0f, TEST_LOCATION );
951
952   application.SendNotification();
953   application.Render( 10u /* wait a bit more for a signal */ );
954
955   // Now sizes and positions are finally set
956   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
957   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 360.0f, 0.0f ), 0.0001f, TEST_LOCATION );
958   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 80.0f, 340.0f, 0.0f ), 0.0001f, TEST_LOCATION );
959
960   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
961   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 80.0f, 0.0f ), 0.0001f, TEST_LOCATION );
962   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 120.0f, 120.0f, 0.0f ), 0.0001f, TEST_LOCATION );
963
964   finishCheck.CheckSignalReceived();
965
966   END_TEST;
967 }
968
969 int UtcDaliLayouting_FocusChildLayoutTransition03(void)
970 {
971   ToolkitTestApplication application;
972   tet_infoline(" UtcDaliLayouting_FocusChildLayoutTransition03" );
973
974   Stage stage = Stage::GetCurrent();
975   auto container = Control::New();
976   auto horizontalLayout = LinearLayout::New();
977   horizontalLayout.SetAnimateLayout( false );
978   horizontalLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
979
980   DevelControl::SetLayout( container, horizontalLayout );
981   container.SetName( "Container" );
982
983   std::vector< Control > controls;
984   controls.push_back( CreateLeafControl( 100, 100 ) );
985   controls.push_back( CreateLeafControl( 100, 100 ) );
986
987   stage.Add( container );
988   container.Add( controls[0] );
989   container.Add( controls[1] );
990
991   KeyInputFocusManager manager = KeyInputFocusManager::Get();
992   manager.SetFocus( controls[0] );
993
994   // Initial rendering done
995   application.SendNotification();
996   application.Render();
997
998   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
999   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1000   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 100.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1001
1002   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1003   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1004   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1005
1006   horizontalLayout.SetAnimateLayout( true );
1007
1008   auto layoutTransitionData = LayoutTransitionData::New();
1009   {
1010     // Shrink the lost focus child width
1011     Property::Map map;
1012     map[ LayoutTransitionData::AnimatorKey::AFFECTS_SIBLINGS ] = false;
1013     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION;
1014     map[ LayoutTransitionData::AnimatorKey::TYPE ] = LayoutTransitionData::Animator::ANIMATE_TO;
1015     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1016          .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::LINEAR )
1017          .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
1018            .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
1019            .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
1020     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // move all children
1021   }
1022   {
1023     // Shrink the lost focus child width
1024     Property::Map map;
1025     map[ LayoutTransitionData::AnimatorKey::AFFECTS_SIBLINGS ] = true;
1026     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SCALE_X;
1027     map[ LayoutTransitionData::AnimatorKey::CONDITION ] = LayoutTransitionData::Condition::ON_FOCUS_LOST;
1028     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = 0.8f;
1029     map[ LayoutTransitionData::AnimatorKey::TYPE ] = LayoutTransitionData::Animator::ANIMATE_TO;
1030     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1031          .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::LINEAR )
1032          .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
1033            .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
1034            .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
1035     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to on focus lost child
1036   }
1037   {
1038     // Shrink the lost focus child height
1039     Property::Map map;
1040     map[ LayoutTransitionData::AnimatorKey::AFFECTS_SIBLINGS ] = true;
1041     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SCALE_Y;
1042     map[ LayoutTransitionData::AnimatorKey::CONDITION ] = LayoutTransitionData::Condition::ON_FOCUS_LOST;
1043     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = 0.8f;
1044     map[ LayoutTransitionData::AnimatorKey::TYPE ] = LayoutTransitionData::Animator::ANIMATE_TO;
1045     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1046          .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::LINEAR )
1047          .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
1048            .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
1049            .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
1050     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to on focus lost child
1051   }
1052   {
1053     // Grow the gained focus child
1054     Property::Map map;
1055     map[ LayoutTransitionData::AnimatorKey::AFFECTS_SIBLINGS ] = true;
1056     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SCALE;
1057     map[ LayoutTransitionData::AnimatorKey::CONDITION ] = LayoutTransitionData::Condition::ON_FOCUS_GAINED;
1058     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Vector3( 1.2f, 1.2f, 1.0f );
1059     map[ LayoutTransitionData::AnimatorKey::TYPE ] = LayoutTransitionData::Animator::ANIMATE_TO;
1060     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1061          .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::LINEAR )
1062          .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
1063            .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
1064            .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
1065     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to on focus gained child
1066   }
1067
1068   horizontalLayout.SetTransitionData( LayoutTransitionData::ON_CHILD_FOCUS, layoutTransitionData );
1069
1070   bool signalReceived(false);
1071   LayoutTransitionFinishCheck finishCheck(signalReceived);
1072   layoutTransitionData.FinishedSignal().Connect(&application, finishCheck);
1073   manager.SetFocus( controls[1] );
1074
1075   application.SendNotification();
1076   application.Render( 1u /*just very beginning of the animation*/ );
1077
1078   finishCheck.CheckSignalNotReceived();
1079   // Animation just started
1080   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1081   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 1.0f, TEST_LOCATION );
1082   DALI_TEST_EQUALS( controls[1].GetCurrentPosition(), Vector3( 100.0f, 350.0f, 0.0f ), 1.0f, TEST_LOCATION );
1083
1084   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1085   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 1.0f, TEST_LOCATION );
1086   DALI_TEST_EQUALS( controls[1].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 1.0f, TEST_LOCATION );
1087
1088   application.SendNotification();
1089   application.Render(static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
1090
1091   // Animation just finished
1092   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1093   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( -10.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1094   DALI_TEST_EQUALS( controls[1].GetCurrentPosition(), Vector3( 90.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1095
1096   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1097   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1098   DALI_TEST_EQUALS( controls[1].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1099   DALI_TEST_EQUALS( controls[0].GetCurrentSize() * controls[0].GetCurrentScale(), Vector3( 80.0f, 80.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1100   DALI_TEST_EQUALS( controls[1].GetCurrentSize() * controls[1].GetCurrentScale(), Vector3( 120.0f, 120.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1101
1102   application.SendNotification();
1103   application.Render( 10u /* wait a bit more for a signal */ );
1104
1105   // Now sizes and positions are finally set
1106   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1107   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( -10.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1108   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 90.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1109
1110   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1111   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1112   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1113   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ) * controls[0].GetProperty<Vector3>( Actor::Property::SCALE ), Vector3( 80.0f, 80.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1114   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ) * controls[1].GetProperty<Vector3>( Actor::Property::SCALE ), Vector3( 120.0f, 120.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1115
1116   finishCheck.CheckSignalReceived();
1117
1118   END_TEST;
1119 }
1120
1121 int UtcDaliLayouting_AddChildLayoutTransition02_KeyFrames(void)
1122 {
1123   ToolkitTestApplication application;
1124   tet_infoline(" UtcDaliLayouting_AddChildLayoutTransition02_KeyFrames" );
1125
1126   Stage stage = Stage::GetCurrent();
1127   auto container = Control::New();
1128   auto horizontalLayout = LinearLayout::New();
1129   horizontalLayout.SetAnimateLayout( true );
1130   horizontalLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
1131
1132   DevelControl::SetLayout( container, horizontalLayout );
1133   container.SetName( "Container");
1134
1135   std::vector< Control > controls;
1136   controls.push_back( CreateLeafControl( 100, 100 ) );
1137   stage.Add( container );
1138
1139   auto layoutTransitionData = LayoutTransitionData::New();
1140   {
1141     // Instant resize for parent
1142     Property::Map map;
1143     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE;
1144     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Property::Value(); // capture from layout update
1145     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1146       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR" )
1147       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
1148         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
1149         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
1150     layoutTransitionData.AddPropertyAnimator( container, map );
1151   }
1152   {
1153     // Instant position for a child
1154     Property::Map map;
1155     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION;
1156     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1157        .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR")
1158        .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
1159          .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
1160          .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
1161     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1162   }
1163   {
1164     // Grow a child from (0,0) size to full size with key frames
1165     KeyFrames keyFrames = KeyFrames::New();
1166     keyFrames.Add( 0.0f, Vector3( 0.0f, 0.0f, 0 ) );
1167     keyFrames.Add( 0.5f, Vector3( 100.0f, 100.0f, 0 ) );
1168
1169     Property::Map map;
1170     map[ "property" ] = Actor::Property::SIZE;
1171     map[ "condition" ] = LayoutTransitionData::Condition::ON_ADD;
1172     map[ "animator" ] = Property::Map()
1173       .Add( "type", "ANIMATE_BETWEEN")
1174       .Add( "alphaFunction", "LINEAR")
1175       .Add( "timePeriod", Property::Map()
1176         .Add( "delay", 0.0f)
1177         .Add( "duration", 0.5f));
1178     layoutTransitionData.AddPropertyAnimator( Actor(), map, keyFrames, Animation::Interpolation::Linear );
1179   }
1180
1181   horizontalLayout.SetTransitionData( LayoutTransitionData::ON_CHILD_ADD, layoutTransitionData );
1182   container.Add( controls[0] );
1183
1184   bool signalReceived(false);
1185   LayoutTransitionFinishCheck finishCheck(signalReceived);
1186   layoutTransitionData.FinishedSignal().Connect(&application, finishCheck);
1187
1188   application.SendNotification();
1189   application.Render( 1u /*just very beginning of the animation*/ );
1190
1191   finishCheck.CheckSignalNotReceived();
1192   // The animation just started
1193   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1194   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1195
1196   application.SendNotification();
1197   application.Render(static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
1198
1199   // The animation just finished
1200   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1201   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1202
1203   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1204   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1205
1206   application.SendNotification();
1207   application.Render( 10u /* wait a bit more for a signal */ );
1208
1209   // Now sizes and positions are finally set
1210   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1211   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1212
1213   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1214   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1215
1216   finishCheck.CheckSignalReceived();
1217
1218   END_TEST;
1219 }
1220
1221 int UtcDaliLayouting_AddChildLayoutTransition03_Path(void)
1222 {
1223   ToolkitTestApplication application;
1224   tet_infoline(" UtcDaliLayouting_AddChildLayoutTransition03_Path" );
1225
1226   Stage stage = Stage::GetCurrent();
1227   auto container = Control::New();
1228   auto horizontalLayout = LinearLayout::New();
1229   horizontalLayout.SetAnimateLayout( true );
1230   horizontalLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
1231
1232   DevelControl::SetLayout( container, horizontalLayout );
1233   container.SetName( "Container");
1234
1235   std::vector< Control > controls;
1236   controls.push_back( CreateLeafControl( 100, 100 ) );
1237   stage.Add( container );
1238
1239   auto layoutTransitionData = LayoutTransitionData::New();
1240   {
1241     // Instant resize for parent
1242     Property::Map map;
1243     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE;
1244     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Property::Value(); // capture from layout update
1245     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1246       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR" )
1247       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
1248         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
1249         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
1250     layoutTransitionData.AddPropertyAnimator( container, map );
1251   }
1252
1253   Dali::Path path = Dali::Path::New();
1254   {
1255     // Curve position for a child
1256     Property::Map map;
1257     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION;
1258     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1259        .Add( LayoutTransitionData::AnimatorKey::TYPE, "ANIMATE_PATH")
1260        .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR")
1261        .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
1262          .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
1263          .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f ) );
1264
1265     // Build the path
1266     Vector3 position0( 30.0,  80.0,  0.0 );
1267     Vector3 position1( 70.0,  120.0, 0.0 );
1268     Vector3 position2( 0.0, 350.0, 0.0 );
1269
1270     //Dali::Path path = Dali::Path::New();
1271     path.AddPoint( position0 );
1272     path.AddPoint( position1 );
1273     path.AddPoint( position2 );
1274
1275     // Control points for first segment
1276     path.AddControlPoint( Vector3( 39.0,  90.0, 0.0 ) );
1277     path.AddControlPoint( Vector3( 56.0, 119.0, 0.0 ) );
1278
1279     // Control points for second segment
1280     path.AddControlPoint( Vector3( 78.0, 120.0, 0.0 ) );
1281     path.AddControlPoint( Vector3( 93.0, 104.0, 0.0 ) );
1282
1283     layoutTransitionData.AddPropertyAnimator( controls[0], map, path, Vector3::XAXIS );
1284   }
1285   {
1286     // Grow a child from (0,0) size to full size (captured)
1287     Property::Map map;
1288     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = "size";
1289     map[ LayoutTransitionData::AnimatorKey::INITIAL_VALUE ] = Vector3( 0.0f, 0.0f, 0 );
1290     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1291       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR")
1292       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
1293         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
1294         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
1295     layoutTransitionData.AddPropertyAnimator( controls[0], map );
1296   }
1297
1298   horizontalLayout.SetTransitionData( LayoutTransitionData::ON_CHILD_ADD, layoutTransitionData );
1299   container.Add( controls[0] );
1300
1301   bool signalReceived(false);
1302   LayoutTransitionFinishCheck finishCheck(signalReceived);
1303   layoutTransitionData.FinishedSignal().Connect(&application, finishCheck);
1304
1305   application.SendNotification();
1306   application.Render( 0 );
1307
1308   finishCheck.CheckSignalNotReceived();
1309   // The animation just started
1310   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1311
1312   Vector3 position, tangent;
1313   Quaternion rotation;
1314   path.Sample( 0.0f, position, tangent );
1315   rotation = Quaternion( Vector3::XAXIS, tangent );
1316   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), position,  0.0001f, TEST_LOCATION );
1317   DALI_TEST_EQUALS( controls[0].GetCurrentOrientation(), rotation, 0.0001f, TEST_LOCATION );
1318
1319   application.SendNotification();
1320   application.Render(static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
1321
1322   path.Sample( 1.0f, position, tangent );
1323   rotation = Quaternion( Vector3::XAXIS, tangent );
1324   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), position, 0.0001f, TEST_LOCATION );
1325   DALI_TEST_EQUALS( controls[0].GetCurrentOrientation(), rotation, 0.0001f, TEST_LOCATION );
1326
1327   // The animation just finished
1328   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1329   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1330
1331   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1332   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1333
1334   application.SendNotification();
1335   application.Render( 10u /* wait a bit more for a signal */ );
1336
1337   // Now sizes and positions are finally set
1338   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1339   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1340
1341   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1342   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1343
1344   finishCheck.CheckSignalReceived();
1345
1346   END_TEST;
1347 }
1348
1349 int UtcDaliLayouting_AddChildLayoutTransition04_AnimateBy(void)
1350 {
1351   ToolkitTestApplication application;
1352   tet_infoline(" UtcDaliLayouting_AddChildLayoutTransition04_AnimateBy" );
1353
1354   Stage stage = Stage::GetCurrent();
1355   auto container = Control::New();
1356   auto horizontalLayout = LinearLayout::New();
1357   horizontalLayout.SetAnimateLayout( true );
1358   horizontalLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
1359
1360   DevelControl::SetLayout( container, horizontalLayout );
1361   container.SetName( "Container");
1362
1363   std::vector< Control > controls;
1364   controls.push_back( CreateLeafControl( 100, 100 ) );
1365   stage.Add( container );
1366
1367   auto layoutTransitionData = LayoutTransitionData::New();
1368   {
1369     // Instant resize for parent
1370     Property::Map map;
1371     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE;
1372     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Property::Value(); // capture from layout update
1373     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1374       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR" )
1375       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
1376         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
1377         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
1378     layoutTransitionData.AddPropertyAnimator( container, map );
1379   }
1380   {
1381     // Instant position for a child
1382     Property::Map map;
1383     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION;
1384     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1385        .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR")
1386        .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
1387          .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
1388          .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
1389     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1390   }
1391   {
1392     Property::Map map;
1393     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE;
1394     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Vector3( 10.0f, 10.0f, 0 );
1395     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1396       .Add( LayoutTransitionData::AnimatorKey::TYPE, "ANIMATE_BY")
1397       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR")
1398       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
1399         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
1400         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
1401     layoutTransitionData.AddPropertyAnimator( controls[0], map );
1402   }
1403
1404   horizontalLayout.SetTransitionData( LayoutTransitionData::ON_CHILD_ADD, layoutTransitionData );
1405   container.Add( controls[0] );
1406
1407   bool signalReceived(false);
1408   LayoutTransitionFinishCheck finishCheck(signalReceived);
1409   layoutTransitionData.FinishedSignal().Connect(&application, finishCheck);
1410
1411   application.SendNotification();
1412   application.Render( 1u /*just very beginning of the animation*/ );
1413
1414   finishCheck.CheckSignalNotReceived();
1415   // The animation just started
1416   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1417   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1418
1419   application.SendNotification();
1420   application.Render( static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
1421
1422   // The animation just finished
1423   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1424   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1425
1426   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1427   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 110.0f, 110.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1428
1429   application.SendNotification();
1430   application.Render( 10u /* wait a bit more for a signal */ );
1431
1432   // Now sizes and positions are finally set
1433   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1434   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1435
1436   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1437   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 110.0f, 110.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1438
1439   finishCheck.CheckSignalReceived();
1440
1441   END_TEST;
1442 }
1443
1444 int UtcDaliLayouting_AddChildLayoutTransition05(void)
1445 {
1446   ToolkitTestApplication application;
1447   tet_infoline(" UtcDaliLayouting_AddChildLayoutTransition05" );
1448
1449   Stage stage = Stage::GetCurrent();
1450   auto container = Control::New();
1451   auto horizontalLayout = LinearLayout::New();
1452   horizontalLayout.SetAnimateLayout( true );
1453   horizontalLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
1454
1455   DevelControl::SetLayout( container, horizontalLayout );
1456   container.SetName( "Container");
1457
1458   std::vector< Control > controls;
1459   controls.push_back( CreateLeafControl( 100, 100 ) );
1460   stage.Add( container );
1461
1462   auto layoutTransitionData = LayoutTransitionData::New();
1463   {
1464     // Instant resize for parent
1465     Property::Map map;
1466     map[ "property" ] = Actor::Property::SIZE;
1467     map[ "targetValue" ] = Property::Value(); // capture from layout update
1468     map[ "animator" ] = Property::Map()
1469       .Add( "name", "InstantAnimator" )
1470       .Add( "type", "ANIMATE_TO")
1471       .Add( "alphaFunction", "LINEAR" )
1472       .Add( "timePeriod", Property::Map()
1473         .Add( "delay", 0.0f )
1474         .Add( "duration", 0.0f ) );
1475     layoutTransitionData.AddPropertyAnimator( container, map );
1476   }
1477   {
1478     // Instant position for a child
1479     Property::Map map;
1480     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::COLOR_ALPHA;
1481     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = "InstantAnimator";
1482     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1483   }
1484   {
1485     // Grow a child from (0,0) size to full size (captured)
1486     Property::Map map;
1487     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE;
1488     map[ LayoutTransitionData::AnimatorKey::INITIAL_VALUE ] = Vector3( 0.0f, 0.0f, 0 );
1489     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = std::string();
1490     layoutTransitionData.AddPropertyAnimator( controls[0], map );
1491   }
1492   {
1493     // Instant opacity for a child, for testing
1494     Property::Map map;
1495     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION;
1496     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = "InstantAnimator";
1497     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1498   }
1499
1500   // Just throw all other alpha functions in
1501   { // no property, not going to be used, but going to be parsed
1502     Property::Map map;
1503     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1504       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "WRONG" );
1505     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1506   }
1507   { // no property, not going to be used, but going to be parsed
1508     Property::Map map;
1509     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1510       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "LINEAR" );
1511     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1512   }
1513   { // no property, not going to be used, but going to be parsed
1514     Property::Map map;
1515     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1516       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "REVERSE" );
1517     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1518   }
1519   { // no property, not going to be used, but going to be parsed
1520     Property::Map map;
1521     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1522       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "EASE_IN_SQUARE" );
1523     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1524   }
1525   { // no property, not going to be used, but going to be parsed
1526     Property::Map map;
1527     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1528       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "EASE_OUT_SQUARE" );
1529     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1530   }
1531   { // no property, not going to be used, but going to be parsed
1532     Property::Map map;
1533     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1534       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "EASE_IN" );
1535     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1536   }
1537   { // no property, not going to be used, but going to be parsed
1538     Property::Map map;
1539     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1540       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "EASE_IN" );
1541     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1542   }
1543   { // no property, not going to be used, but going to be parsed
1544     Property::Map map;
1545     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1546       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "EASE_OUT" );
1547     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1548   }
1549   { // no property, not going to be used, but going to be parsed
1550     Property::Map map;
1551     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1552       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "EASE_IN_OUT" );
1553     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1554   }
1555   { // no property, not going to be used, but going to be parsed
1556     Property::Map map;
1557     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1558       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "EASE_IN_OUT_SINE" );
1559     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1560   }
1561   { // no property, not going to be used, but going to be parsed
1562     Property::Map map;
1563     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1564       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "EASE_IN_SINE" );
1565     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1566   }
1567   { // no property, not going to be used, but going to be parsed
1568     Property::Map map;
1569     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1570       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "EASE_OUT_SINE" );
1571     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1572   }
1573   { // no property, not going to be used, but going to be parsed
1574     Property::Map map;
1575     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1576       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "BOUNCE" );
1577     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1578   }
1579   { // no property, not going to be used, but going to be parsed
1580     Property::Map map;
1581     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1582       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "SIN" );
1583     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1584   }
1585   { // no property, not going to be used, but going to be parsed
1586     Property::Map map;
1587     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1588       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, "EASE_OUT_BACK" );
1589     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1590   }
1591   { // no property, not going to be used, but going to be parsed
1592     Property::Map map;
1593     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1594       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, Vector4( 0.0f, 1.0f, 2.0f, 3.0f ) );
1595     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1596   }
1597   { // no property, not going to be used, but going to be parsed
1598     Property::Map map;
1599     // valid
1600     Property::Array array;
1601     array.Reserve( 4 );
1602     array.PushBack( 0.0f );
1603     array.PushBack( 1.0f );
1604     array.PushBack( 2.0f );
1605     array.PushBack( 3.0f );
1606     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1607       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, array );
1608     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1609   }
1610   { // no property, not going to be used, but going to be parsed
1611     Property::Map map;
1612     // invalid
1613     Property::Array array;
1614     array.Reserve( 3 );
1615     array.PushBack( 0.0f );
1616     array.PushBack( 1.0f );
1617     array.PushBack( 2.0f );
1618     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1619       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, array );
1620     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1621   }
1622   { // no property, not going to be used, but going to be parsed
1623     Property::Map map;
1624     // invalid
1625     Property::Array array;
1626     array.Reserve( 4 );
1627     array.PushBack( 0.0f );
1628     array.PushBack( 10 );
1629     array.PushBack( 2.0f );
1630     array.PushBack( 3.0f );
1631     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1632       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, array );
1633     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1634   }
1635   { // no property, not going to be used, but going to be parsed
1636     Property::Map map;
1637     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = 0; // invalid
1638     layoutTransitionData.AddPropertyAnimator( Actor(), map ); // apply to all children except parent
1639   }
1640
1641   horizontalLayout.SetTransitionData( LayoutTransitionData::ON_CHILD_ADD, layoutTransitionData );
1642   container.Add( controls[0] );
1643
1644   bool signalReceived(false);
1645   LayoutTransitionFinishCheck finishCheck(signalReceived);
1646   layoutTransitionData.FinishedSignal().Connect(&application, finishCheck);
1647
1648   application.SendNotification();
1649   application.Render( 1u /*just very beginning of the animation*/ );
1650
1651   finishCheck.CheckSignalNotReceived();
1652   // The animation just started
1653   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1654   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1655
1656   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 1.0f, TEST_LOCATION );
1657   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 0.0f, 0.0f, 0.0f ), 1.0f, TEST_LOCATION );
1658
1659   application.SendNotification();
1660   application.Render(static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
1661
1662   // The animation just finished
1663   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1664   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1665
1666   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1667   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1668
1669   application.SendNotification();
1670   application.Render( 10u /* wait a bit more for a signal */ );
1671
1672   // Now sizes and positions are finally set
1673   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1674   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1675
1676   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1677   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1678
1679   finishCheck.CheckSignalReceived();
1680
1681   END_TEST;
1682 }
1683
1684 int UtcDaliLayouting_DefaultTransition01(void)
1685 {
1686   ToolkitTestApplication application;
1687   tet_infoline(" UtcDaliLayouting_DefaultTransition01" );
1688
1689   Stage stage = Stage::GetCurrent();
1690   auto container = Control::New();
1691   auto horizontalLayout = LinearLayout::New();
1692   horizontalLayout.SetAnimateLayout( false );
1693   horizontalLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
1694
1695   DevelControl::SetLayout( container, horizontalLayout );
1696   container.SetName( "Container" );
1697
1698   std::vector< Control > controls;
1699   controls.push_back( CreateLeafControl( 100, 100 ) );
1700   controls.push_back( CreateLeafControl( 100, 100 ) );
1701
1702   stage.Add( container );
1703   container.Add( controls[0] );
1704   container.Add( controls[1] );
1705
1706   // Initial rendering done
1707   application.SendNotification();
1708   application.Render();
1709
1710   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1711   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1712   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 100.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1713
1714   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1715   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1716   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1717
1718   horizontalLayout.SetAnimateLayout( true );
1719
1720   auto layoutTransitionData0 = LayoutTransitionData::New();
1721   {
1722     // Default instant resize
1723     Property::Map map;
1724     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE;
1725     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Property::Value(); // capture from layout update
1726     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1727       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::LINEAR )
1728       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
1729         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
1730         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
1731     layoutTransitionData0.AddPropertyAnimator( controls[0], map );
1732   }
1733   {
1734     // Instant instant position
1735     Property::Map map;
1736     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION;
1737     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Property::Value(); // capture from layout update
1738     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1739        .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::LINEAR )
1740        .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
1741          .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
1742          .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
1743     layoutTransitionData0.AddPropertyAnimator( controls[0], map );
1744   }
1745   DevelControl::GetLayout( controls[0] ).SetTransitionData( LayoutTransitionData::Type::ON_LAYOUT_CHANGE, layoutTransitionData0 );
1746
1747   auto layoutTransitionData1 = LayoutTransitionData::New();
1748   {
1749     // Default instant resize
1750     Property::Map map;
1751     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE;
1752     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Property::Value(); // capture from layout update
1753     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1754       .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::LINEAR )
1755       .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
1756         .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
1757         .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
1758     layoutTransitionData1.AddPropertyAnimator( controls[1], map );
1759   }
1760   {
1761     // Instant instant position
1762     Property::Map map;
1763     map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION;
1764     map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Property::Value(); // capture from layout update
1765     map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
1766        .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::LINEAR )
1767        .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
1768          .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
1769          .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
1770     layoutTransitionData1.AddPropertyAnimator( controls[1], map );
1771   }
1772   DevelControl::GetLayout( controls[1] ).SetTransitionData( LayoutTransitionData::Type::ON_LAYOUT_CHANGE, layoutTransitionData1 );
1773
1774   horizontalLayout.SetOrientation( LinearLayout::Orientation::VERTICAL );
1775
1776   application.SendNotification();
1777   application.Render( 10u /*just very beginning of the animation*/ );
1778
1779   // Animation just finished
1780   DALI_TEST_EQUALS( container.GetCurrentPosition(), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1781   DALI_TEST_EQUALS( controls[0].GetCurrentPosition(), Vector3( 0.0f, 300.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1782   DALI_TEST_EQUALS( controls[1].GetCurrentPosition(), Vector3( 0.0f, 400.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1783
1784   DALI_TEST_EQUALS( container.GetCurrentSize(), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1785   DALI_TEST_EQUALS( controls[0].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 1.0f, TEST_LOCATION );
1786   DALI_TEST_EQUALS( controls[1].GetCurrentSize(), Vector3( 100.0f, 100.0f, 0.0f ), 1.0f, TEST_LOCATION );
1787
1788   // Now sizes and positions are set
1789   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1790   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 300.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1791   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 400.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1792
1793   DALI_TEST_EQUALS( container.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1794   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1795   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1796
1797   END_TEST;
1798 }
1799