Changed Control::SetLayout to handle empty layouts
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-Layouting.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
22 #include <dali-toolkit/dali-toolkit.h>
23 #include <dali-toolkit/devel-api/controls/control-devel.h>
24 #include <dali-toolkit/devel-api/layouting/absolute-layout.h>
25 #include <dali-toolkit/devel-api/layouting/linear-layout.h>
26
27 #include <../custom-layout.h>
28
29 #include <layout-utils.h>
30
31 using namespace Dali;
32 using namespace Toolkit;
33
34 void utc_dali_toolkit_layouting_startup(void)
35 {
36   test_return_value = TET_UNDEF;
37 }
38
39 void utc_dali_toolkit_layouting_cleanup(void)
40 {
41   test_return_value = TET_PASS;
42 }
43
44 int UtcDaliLayouting_HboxLayout01(void)
45 {
46   ToolkitTestApplication application;
47   tet_infoline(" UtcDaliLayouting_HboxLayout01");
48
49   Stage stage = Stage::GetCurrent();
50   auto hbox = Control::New();
51   auto hboxLayout = LinearLayout::New();
52   hboxLayout.SetCellPadding( LayoutSize( 10, 0 ) );
53   DevelControl::SetLayout( hbox, hboxLayout );
54   hbox.SetName( "HBox");
55
56   std::vector< Control > controls;
57   controls.push_back( CreateLeafControl( 40, 40 ) );
58   controls.push_back( CreateLeafControl( 60, 40 ) );
59   controls.push_back( CreateLeafControl( 80, 40 ) );
60   controls.push_back( CreateLeafControl( 100, 40 ) );
61
62   for( auto&& iter : controls )
63   {
64     hbox.Add( iter );
65   }
66   hbox.SetParentOrigin( ParentOrigin::CENTER );
67   hbox.SetAnchorPoint( AnchorPoint::CENTER );
68   stage.Add( hbox );
69
70   // Ensure layouting happens
71   application.SendNotification();
72   application.Render();
73
74   // hbox centers elements vertically, it fills test harness stage, which is 480x800.
75   // hbox left justifies elements
76   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
77   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 50.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
78   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 120.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
79   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 210.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
80
81   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
82   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 60.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
83   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
84   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
85
86   // Change a layout
87   auto newHBoxLayout = LinearLayout::New();
88   newHBoxLayout.SetCellPadding( LayoutSize( 10, 0 ) );
89   DevelControl::SetLayout( hbox, newHBoxLayout );
90
91   application.SendNotification();
92   application.Render();
93
94   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
95   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 50.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
96   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 120.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
97   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 210.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
98
99   END_TEST;
100 }
101
102 int UtcDaliLayouting_HboxLayout02(void)
103 {
104   ToolkitTestApplication application;
105   tet_infoline(" UtcDaliLayouting_HboxLayout02 Test nested hboxes with default spec of WRAP_CONTENT");
106
107   Stage stage = Stage::GetCurrent();
108
109   auto hbox1 = Control::New();
110   auto hboxLayout1 = LinearLayout::New();
111   DevelControl::SetLayout( hbox1, hboxLayout1 );
112
113   auto hbox2 = Control::New();
114   auto hboxLayout2 = LinearLayout::New();
115   DevelControl::SetLayout( hbox2, hboxLayout2 );
116
117   hbox1.SetName( "HBox1");
118   hbox2.SetName( "HBox2");
119
120   std::vector< Control > controls;
121   controls.push_back( CreateLeafControl( 20, 40 ) );
122   controls.push_back( CreateLeafControl( 30, 50 ) );
123   controls.push_back( CreateLeafControl( 40, 60 ) );
124   controls.push_back( CreateLeafControl( 50, 70 ) );
125
126   controls.push_back( CreateLeafControl( 25, 40 ) );
127   controls.push_back( CreateLeafControl( 35, 50 ) );
128   controls.push_back( CreateLeafControl( 45, 60 ) );
129   controls.push_back( CreateLeafControl( 55, 70 ) );
130
131   int counter=0;
132   for( auto&& iter : controls )
133   {
134     if( counter < 4 )
135     {
136       hbox1.Add( iter );
137     }
138     else
139     {
140       hbox2.Add( iter );
141     }
142     ++counter;
143   }
144   hbox1.SetParentOrigin( ParentOrigin::CENTER );
145   hbox1.SetAnchorPoint( AnchorPoint::CENTER );
146   hbox2.SetParentOrigin( ParentOrigin::CENTER );
147   hbox2.SetAnchorPoint( AnchorPoint::CENTER );
148
149   auto hbox3 = Control::New();
150   auto hboxLayout3 = LinearLayout::New();
151   DevelControl::SetLayout( hbox3, hboxLayout3 );
152
153   hbox3.SetParentOrigin( ParentOrigin::CENTER );
154   hbox3.SetName( "HBox3");
155   hbox3.Add( hbox1 );
156   hbox3.Add( hbox2 );
157
158   stage.Add( hbox3 );
159
160   // Ensure layouting happens
161   application.SendNotification();
162   application.Render();
163
164
165   // hbox centers elements vertically, it fills test harness stage, which is 480x800.
166   // hbox left justifies elements
167   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3(  0.0f, 15.0f, 0.0f ), 0.0001f, TEST_LOCATION );
168   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 20.0f, 10.0f, 0.0f ), 0.0001f, TEST_LOCATION );
169   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 50.0f,  5.0f, 0.0f ), 0.0001f, TEST_LOCATION );
170   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 90.0f,  0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
171
172   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 20.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
173   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 30.0f, 50.0f, 0.0f ), 0.0001f, TEST_LOCATION );
174   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f, 60.0f, 0.0f ), 0.0001f, TEST_LOCATION );
175   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 50.0f, 70.0f, 0.0f ), 0.0001f, TEST_LOCATION );
176
177
178   DALI_TEST_EQUALS( controls[4].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3(  0.0f, 15.0f, 0.0f ), 0.0001f, TEST_LOCATION );
179   DALI_TEST_EQUALS( controls[5].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 25.0f, 10.0f, 0.0f ), 0.0001f, TEST_LOCATION );
180   DALI_TEST_EQUALS( controls[6].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 60.0f,  5.0f, 0.0f ), 0.0001f, TEST_LOCATION );
181   DALI_TEST_EQUALS( controls[7].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 105.0f,  0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
182
183   DALI_TEST_EQUALS( controls[4].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 25.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
184   DALI_TEST_EQUALS( controls[5].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 35.0f, 50.0f, 0.0f ), 0.0001f, TEST_LOCATION );
185   DALI_TEST_EQUALS( controls[6].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 45.0f, 60.0f, 0.0f ), 0.0001f, TEST_LOCATION );
186   DALI_TEST_EQUALS( controls[7].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 55.0f, 70.0f, 0.0f ), 0.0001f, TEST_LOCATION );
187
188   // Test hbox1 and 2 are sized to wrap their content
189   DALI_TEST_EQUALS( hbox1.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 140.0f, 70.0f, 0.0f ), 0.0001f, TEST_LOCATION );
190   DALI_TEST_EQUALS( hbox2.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 160.0f, 70.0f, 0.0f ), 0.0001f, TEST_LOCATION );
191   DALI_TEST_EQUALS( hbox1.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 365.0f, 0.0f ), 0.0001f, TEST_LOCATION );
192   DALI_TEST_EQUALS( hbox2.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 140.0f, 365.0f, 0.0f ), 0.0001f, TEST_LOCATION );
193
194   // Test hbox3 matches parent (root layer)
195   DALI_TEST_EQUALS( hbox3.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
196   DALI_TEST_EQUALS( hbox3.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
197
198   END_TEST;
199 }
200
201
202 int UtcDaliLayouting_HboxLayout03(void)
203 {
204   ToolkitTestApplication application;
205   tet_infoline(" UtcDaliLayouting_HboxLayout03 Test nested hboxes with MATCH_PARENT");
206
207   Stage stage = Stage::GetCurrent();
208
209   auto hbox1 = Control::New();
210   auto hboxLayout1 = LinearLayout::New();
211   DevelControl::SetLayout( hbox1, hboxLayout1 );
212
213   auto hbox2 = Control::New();
214   auto hboxLayout2 = LinearLayout::New();
215   DevelControl::SetLayout( hbox2, hboxLayout2 );
216
217   hbox1.SetName( "HBox1");
218   hbox2.SetName( "HBox2");
219   hbox1.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
220   hbox1.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
221   hbox2.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
222   hbox2.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
223
224   std::vector< Control > controls;
225   controls.push_back( CreateLeafControl( 20, 40 ) );
226   controls.push_back( CreateLeafControl( 30, 50 ) );
227   controls.push_back( CreateLeafControl( 40, 60 ) );
228   controls.push_back( CreateLeafControl( 50, 70 ) );
229
230   controls.push_back( CreateLeafControl( 25, 40 ) );
231   controls.push_back( CreateLeafControl( 35, 50 ) );
232   controls.push_back( CreateLeafControl( 45, 60 ) );
233   controls.push_back( CreateLeafControl( 55, 70 ) );
234
235   int counter=0;
236   for( auto&& iter : controls )
237   {
238     if( counter < 4 )
239     {
240       hbox1.Add( iter );
241     }
242     else
243     {
244       hbox2.Add( iter );
245     }
246     ++counter;
247   }
248   hbox1.SetParentOrigin( ParentOrigin::CENTER );
249   hbox1.SetAnchorPoint( AnchorPoint::CENTER );
250   hbox2.SetParentOrigin( ParentOrigin::CENTER );
251   hbox2.SetAnchorPoint( AnchorPoint::CENTER );
252
253   auto hbox3 = Control::New();
254   auto hboxLayout3 = LinearLayout::New();
255   DevelControl::SetLayout( hbox3, hboxLayout3);
256
257   hbox3.SetParentOrigin( ParentOrigin::CENTER );
258   hbox3.SetName( "HBox3");
259   hbox3.Add( hbox1 );
260   hbox3.Add( hbox2 );
261
262   stage.Add( hbox3 );
263
264   //std::ostringstream oss;
265   //DumpControlHierarchy( oss, Stage::GetCurrent().GetRootLayer() );
266   //printf("Control hierarchy: \n%s\n", oss.str().c_str() );
267
268   // Ensure layouting happens
269   application.SendNotification();
270   application.Render();
271
272
273   // hbox centers elements vertically, it fills test harness stage, which is 480x800.
274   // hbox left justifies elements
275   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
276   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 20.0f,375.0f, 0.0f ), 0.0001f, TEST_LOCATION );
277   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 50.0f,370.0f, 0.0f ), 0.0001f, TEST_LOCATION );
278   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 90.0f,365.0f, 0.0f ), 0.0001f, TEST_LOCATION );
279
280   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 20.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
281   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 30.0f, 50.0f, 0.0f ), 0.0001f, TEST_LOCATION );
282   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f, 60.0f, 0.0f ), 0.0001f, TEST_LOCATION );
283   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 50.0f, 70.0f, 0.0f ), 0.0001f, TEST_LOCATION );
284
285   DALI_TEST_EQUALS( controls[4].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3(  0.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
286   DALI_TEST_EQUALS( controls[5].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 25.0f, 375.0f, 0.0f ), 0.0001f, TEST_LOCATION );
287   DALI_TEST_EQUALS( controls[6].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 60.0f, 370.0f, 0.0f ), 0.0001f, TEST_LOCATION );
288   DALI_TEST_EQUALS( controls[7].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 105.0f,365.0f, 0.0f ), 0.0001f, TEST_LOCATION );
289
290   DALI_TEST_EQUALS( controls[4].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 25.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
291   DALI_TEST_EQUALS( controls[5].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 35.0f, 50.0f, 0.0f ), 0.0001f, TEST_LOCATION );
292   DALI_TEST_EQUALS( controls[6].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 45.0f, 60.0f, 0.0f ), 0.0001f, TEST_LOCATION );
293   DALI_TEST_EQUALS( controls[7].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 55.0f, 70.0f, 0.0f ), 0.0001f, TEST_LOCATION );
294
295   DALI_TEST_EQUALS( hbox1.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
296   DALI_TEST_EQUALS( hbox2.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
297   DALI_TEST_EQUALS( hbox1.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
298   DALI_TEST_EQUALS( hbox2.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 480.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
299
300   // Test hbox3 matches parent (root layer)
301   DALI_TEST_EQUALS( hbox3.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
302   DALI_TEST_EQUALS( hbox3.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
303
304   END_TEST;
305 }
306
307 int UtcDaliLayouting_HboxLayout04(void)
308 {
309   ToolkitTestApplication application;
310   tet_infoline(" UtcDaliLayouting_HboxLayout04 Test nested hboxes with explicit WRAP_CONTENT");
311
312   Stage stage = Stage::GetCurrent();
313
314   auto hbox1 = Control::New();
315   auto hboxLayout1 = LinearLayout::New();
316   DevelControl::SetLayout( hbox1, hboxLayout1 );
317
318   auto hbox2 = Control::New();
319   auto hboxLayout2 = LinearLayout::New();
320   DevelControl::SetLayout( hbox2, hboxLayout2 );
321
322   hbox1.SetName( "HBox1"); // Default spec is to wrap content
323   hbox2.SetName( "HBox2");
324   hbox1.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
325   hbox1.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
326   hbox2.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
327   hbox2.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
328
329   std::vector< Control > controls;
330   controls.push_back( CreateLeafControl( 80, 40 ) );
331   controls.push_back( CreateLeafControl( 80, 50 ) );
332   controls.push_back( CreateLeafControl( 80, 60 ) );
333   controls.push_back( CreateLeafControl( 80, 70 ) );
334
335   controls.push_back( CreateLeafControl( 80, 40 ) );
336   controls.push_back( CreateLeafControl( 80, 50 ) );
337   controls.push_back( CreateLeafControl( 80, 60 ) );
338   controls.push_back( CreateLeafControl( 80, 70 ) );
339
340   int counter=0;
341   for( auto&& iter : controls )
342   {
343     if( counter < 4 )
344     {
345       hbox1.Add( iter );
346     }
347     else
348     {
349       hbox2.Add( iter );
350     }
351     ++counter;
352   }
353
354   controls[6].SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
355   auto hbox3 = Control::New();
356   auto hboxLayout3 = LinearLayout::New();
357   DevelControl::SetLayout( hbox3, hboxLayout3 );
358
359   hbox3.SetParentOrigin( ParentOrigin::CENTER );
360   hbox3.SetName( "HBox3");
361   hbox3.Add( hbox1 );
362   hbox3.Add( hbox2 );
363   stage.Add( hbox3 );
364
365   //std::ostringstream oss;
366   //DumpControlHierarchy( oss, Stage::GetCurrent().GetRootLayer() );
367   //printf("Control hierarchy: \n%s\n", oss.str().c_str() );
368
369   // Ensure layouting happens
370   application.SendNotification();
371   application.Render();
372
373
374   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 15.0f, 0.0f ), 0.0001f, TEST_LOCATION );
375   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 80.0f,10.0f, 0.0f ), 0.0001f, TEST_LOCATION );
376   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 160.0f, 5.0f, 0.0f ), 0.0001f, TEST_LOCATION );
377   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 240.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
378
379   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
380   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 50.0f, 0.0f ), 0.0001f, TEST_LOCATION );
381   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 60.0f, 0.0f ), 0.0001f, TEST_LOCATION );
382   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 70.0f, 0.0f ), 0.0001f, TEST_LOCATION );
383
384   DALI_TEST_EQUALS( controls[4].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3(  0.0f, 15.0f, 0.0f ), 0.0001f, TEST_LOCATION );
385   DALI_TEST_EQUALS( controls[5].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 80.0f, 10.0f, 0.0f ), 0.0001f, TEST_LOCATION );
386   DALI_TEST_EQUALS( controls[6].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 160.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
387   DALI_TEST_EQUALS( controls[7].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 240.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
388
389   DALI_TEST_EQUALS( controls[4].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
390   DALI_TEST_EQUALS( controls[5].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 50.0f, 0.0f ), 0.0001f, TEST_LOCATION );
391   DALI_TEST_EQUALS( controls[6].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 70.0f, 0.0f ), 0.0001f, TEST_LOCATION );
392   DALI_TEST_EQUALS( controls[7].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 70.0f, 0.0f ), 0.0001f, TEST_LOCATION );
393
394   DALI_TEST_EQUALS( hbox1.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 320.0f, 70.0f, 0.0f ), 0.0001f, TEST_LOCATION );
395   DALI_TEST_EQUALS( hbox2.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 320.0f, 70.0f, 0.0f ), 0.0001f, TEST_LOCATION );
396   DALI_TEST_EQUALS( hbox1.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 365.0f, 0.0f ), 0.0001f, TEST_LOCATION );
397   DALI_TEST_EQUALS( hbox2.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 320.0f, 365.0f, 0.0f ), 0.0001f, TEST_LOCATION );
398
399
400   // Test hbox3 matches parent (root layer)
401   DALI_TEST_EQUALS( hbox3.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
402   DALI_TEST_EQUALS( hbox3.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
403
404   END_TEST;
405 }
406
407 int UtcDaliLayouting_HboxLayout05(void)
408 {
409   ToolkitTestApplication application;
410   tet_infoline(" UtcDaliLayouting_HboxLayout05 - Set children size explicitly via width & height specification");
411
412   Stage stage = Stage::GetCurrent();
413   auto hbox = Control::New();
414   auto hboxLayout = LinearLayout::New();
415   hboxLayout.SetCellPadding( LayoutSize( 10, 0 ) );
416   DevelControl::SetLayout( hbox, hboxLayout );
417   hbox.SetName( "HBox");
418
419   std::vector< Control > controls;
420   controls.push_back( CreateLeafControl( 40, 40 ) );
421   controls.push_back( CreateLeafControl( 60, 40 ) );
422   controls.push_back( CreateLeafControl( 80, 40 ) );
423   controls.push_back( CreateLeafControl( 100, 40 ) );
424
425   for( auto&& iter : controls )
426   {
427     hbox.Add( iter );
428     iter.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, 100 );
429     iter.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, 50 );
430   }
431
432   hbox.SetParentOrigin( ParentOrigin::CENTER );
433   hbox.SetAnchorPoint( AnchorPoint::CENTER );
434   stage.Add( hbox );
435
436   // Ensure layouting happens
437   application.SendNotification();
438   application.Render();
439
440   // hbox centers elements vertically, it fills test harness stage, which is 480x800.
441   // hbox left justifies elements
442   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 375.0f, 0.0f ), 0.0001f, TEST_LOCATION );
443   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 110.0f, 375.0f, 0.0f ), 0.0001f, TEST_LOCATION );
444   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 220.0f, 375.0f, 0.0f ), 0.0001f, TEST_LOCATION );
445   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 330.0f, 375.0f, 0.0f ), 0.0001f, TEST_LOCATION );
446
447   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 50.0f, 0.0f ), 0.0001f, TEST_LOCATION );
448   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 50.0f, 0.0f ), 0.0001f, TEST_LOCATION );
449   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 50.0f, 0.0f ), 0.0001f, TEST_LOCATION );
450   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 50.0f, 0.0f ), 0.0001f, TEST_LOCATION );
451
452   END_TEST;
453 }
454
455 int UtcDaliLayouting_HboxLayout06(void)
456 {
457   ToolkitTestApplication application;
458   tet_infoline(" UtcDaliLayouting_HboxLayout06 - Test nested layouts");
459
460   Stage stage = Stage::GetCurrent();
461
462   auto rootControl = Control::New();
463   auto absoluteLayout = AbsoluteLayout::New();
464   DevelControl::SetLayout( rootControl, absoluteLayout );
465   rootControl.SetName( "AbsoluteLayout" );
466   stage.Add( rootControl );
467
468   auto hbox = Control::New();
469   auto hboxLayout = LinearLayout::New();
470   hboxLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
471   DevelControl::SetLayout( hbox, hboxLayout );
472   hbox.SetName( "HBox" );
473
474   std::vector< Control > controls;
475   controls.push_back( CreateLeafControl( 40, 40 ) );
476   controls.push_back( CreateLeafControl( 60, 40 ) );
477
478   for( auto&& iter : controls )
479   {
480     hbox.Add( iter );
481   }
482   hbox.SetParentOrigin( ParentOrigin::CENTER );
483   hbox.SetAnchorPoint( AnchorPoint::CENTER );
484   rootControl.Add( hbox );
485
486   // Ensure layouting happens
487   application.SendNotification();
488   application.Render();
489
490   // hbox centers elements vertically, it fills test harness stage, which is 480x800.
491   // hbox left justifies elements
492   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
493   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 40.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
494
495   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
496   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 60.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
497
498   DALI_TEST_EQUALS( hbox.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
499
500   // Change a layout
501   auto newHBoxLayout = LinearLayout::New();
502   newHBoxLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
503   DevelControl::SetLayout( hbox, newHBoxLayout );
504
505   hbox.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
506   hbox.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
507
508   application.SendNotification();
509   application.Render();
510
511   DALI_TEST_EQUALS( hbox.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
512
513   // Change size specification
514   hbox.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
515   hbox.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
516
517   application.SendNotification();
518   application.Render();
519
520   DALI_TEST_EQUALS( hbox.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
521
522   // Use WRAP_CONTENT again
523   hbox.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
524   hbox.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
525
526   application.SendNotification();
527   application.Render();
528
529   DALI_TEST_EQUALS( hbox.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
530
531   END_TEST;
532 }
533
534
535 int UtcDaliLayouting_HboxLayout07(void)
536 {
537   ToolkitTestApplication application;
538   tet_infoline(" UtcDaliLayouting_HboxLayout07 - Set LTR/RTL direction");
539
540   Stage stage = Stage::GetCurrent();
541   auto hbox = Control::New();
542   auto hboxLayout = LinearLayout::New();
543   hboxLayout.SetCellPadding( LayoutSize( 10, 0 ) );
544   DevelControl::SetLayout( hbox, hboxLayout );
545   hbox.SetName( "HBox");
546
547   std::vector< Control > controls;
548   controls.push_back( CreateLeafControl( 40, 40 ) );
549   controls.push_back( CreateLeafControl( 60, 40 ) );
550   controls.push_back( CreateLeafControl( 80, 40 ) );
551   controls.push_back( CreateLeafControl( 100, 40 ) );
552
553   for( auto&& iter : controls )
554   {
555     hbox.Add( iter );
556   }
557   hbox.SetParentOrigin( ParentOrigin::CENTER );
558   hbox.SetAnchorPoint( AnchorPoint::CENTER );
559   stage.Add( hbox );
560
561   hbox.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::LEFT_TO_RIGHT );
562
563   // Ensure layouting happens
564   application.SendNotification();
565   application.Render();
566
567   // hbox centers elements vertically, it fills test harness stage, which is 480x800 from left to right.
568   // hbox left justifies elements
569   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
570   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 50.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
571   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 120.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
572   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 210.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
573
574   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
575   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 60.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
576   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
577   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
578
579   hbox.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::RIGHT_TO_LEFT );
580
581   // Ensure layouting happens
582   application.SendNotification();
583   application.Render();
584
585   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 470.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
586   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 400.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
587   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 310.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
588   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 200.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
589
590   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
591   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 60.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
592   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
593   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
594
595   END_TEST;
596 }
597
598 int UtcDaliLayouting_HboxLayout08(void)
599 {
600   ToolkitTestApplication application;
601   tet_infoline(" UtcDaliLayouting_HboxLayout08 - Test layout animation");
602
603   Stage stage = Stage::GetCurrent();
604
605   auto rootControl = Control::New();
606   auto absoluteLayout = AbsoluteLayout::New();
607   absoluteLayout.SetAnimateLayout( true );
608   DevelControl::SetLayout( rootControl, absoluteLayout );
609   rootControl.SetName( "AbsoluteLayout" );
610   stage.Add( rootControl );
611
612   Control control1 = CreateLeafControl( 40, 40 );
613   rootControl.Add( control1 );
614
615   auto hbox = Control::New();
616   auto hboxLayout = LinearLayout::New();
617   hboxLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
618   DevelControl::SetLayout( hbox, hboxLayout );
619   hbox.SetName( "HBox" );
620
621   Control control2 = CreateLeafControl( 40, 40 );
622   hbox.Add( control2 );
623
624   hbox.SetParentOrigin( ParentOrigin::CENTER );
625   hbox.SetAnchorPoint( AnchorPoint::CENTER );
626   rootControl.Add( hbox );
627
628   DALI_TEST_EQUALS( absoluteLayout.IsLayoutAnimated(), true, TEST_LOCATION );
629   DALI_TEST_EQUALS( DevelControl::GetLayout( control1 ).IsLayoutAnimated(), true, TEST_LOCATION );
630   DALI_TEST_EQUALS( hboxLayout.IsLayoutAnimated(), false, TEST_LOCATION );
631   DALI_TEST_EQUALS( DevelControl::GetLayout( control2 ).IsLayoutAnimated(), false, TEST_LOCATION );
632
633   hboxLayout.SetAnimateLayout( true );
634   absoluteLayout.SetAnimateLayout( false );
635
636   DALI_TEST_EQUALS( absoluteLayout.IsLayoutAnimated(), false, TEST_LOCATION );
637   DALI_TEST_EQUALS( DevelControl::GetLayout( control1 ).IsLayoutAnimated(), false, TEST_LOCATION );
638   DALI_TEST_EQUALS( hboxLayout.IsLayoutAnimated(), true, TEST_LOCATION );
639   DALI_TEST_EQUALS( DevelControl::GetLayout( control2 ).IsLayoutAnimated(), true, TEST_LOCATION );
640
641   END_TEST;
642 }
643
644 // Padding tests
645
646 int UtcDaliLayouting_HboxLayout_Padding01(void)
647 {
648   ToolkitTestApplication application;
649   tet_infoline("UtcDaliLayouting_HboxLayout_Padding01 - Adding Padding to a single child");
650
651   Stage stage = Stage::GetCurrent();
652   auto hbox = Control::New();
653   auto hboxLayout = LinearLayout::New();
654   DevelControl::SetLayout( hbox, hboxLayout );
655   hbox.SetName( "HBox");
656
657   std::vector< Control > controls;
658   controls.push_back( CreateLeafControl( 40, 40 ) );
659   controls.push_back( CreateLeafControl( 60, 40 ) );
660   controls.push_back( CreateLeafControl( 80, 40 ) );
661   controls.push_back( CreateLeafControl( 100, 40 ) );
662
663   const Extents CONTROL_PADDING = Extents(5, 10, 20, 2 );
664   tet_printf( "\nAdding Padding to control at index %u \n", 1 );
665   controls[1].SetProperty(Toolkit::Control::Property::PADDING, CONTROL_PADDING );
666
667   for( auto&& iter : controls )
668   {
669     hbox.Add( iter );
670   }
671   hbox.SetParentOrigin( ParentOrigin::CENTER );
672   hbox.SetAnchorPoint( AnchorPoint::CENTER );
673   stage.Add( hbox );
674
675   // Ensure layouting happens
676   application.SendNotification();
677   application.Render();
678
679   // hbox centers elements vertically, it fills test harness stage, which is 480x800.
680   // hbox left justifies elements
681   tet_infoline("Test Child Actor Position");
682   float xPositionOfControlBeingTested = 0.0f;
683   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested,
684                                                                                             380.0f,
685                                                                                             0.0f ), 0.0001f, TEST_LOCATION );
686   xPositionOfControlBeingTested += 40.0f;
687
688   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested,
689                                                                                             380.0f - ( ( CONTROL_PADDING.top + CONTROL_PADDING.bottom) * 0.5f ),                                                                                            0.0f ),
690                                                                                             0.0001f, TEST_LOCATION );
691
692   xPositionOfControlBeingTested += 60.0f + CONTROL_PADDING.start + CONTROL_PADDING.end;
693   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
694
695   xPositionOfControlBeingTested += 80.0f;
696   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested,380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
697
698   tet_infoline("Test Child Actor Size");
699   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
700
701   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 60.0f + CONTROL_PADDING.start + CONTROL_PADDING.end,
702                                                                                         40.0f + CONTROL_PADDING.top + CONTROL_PADDING.bottom , 0.0f ),
703                                                                                         0.0001f, TEST_LOCATION );
704
705   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
706   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
707
708   END_TEST;
709 }
710
711 int UtcDaliLayouting_HboxLayout_Padding02(void)
712 {
713   ToolkitTestApplication application;
714   tet_infoline("UtcDaliLayouting_HboxLayout_Padding02 - Adding Padding to a all children");
715
716   Stage stage = Stage::GetCurrent();
717   auto hbox = Control::New();
718   auto hboxLayout = LinearLayout::New();
719   DevelControl::SetLayout( hbox, hboxLayout );
720   hbox.SetName( "HBox");
721
722   std::vector< Control > controls;
723   controls.push_back( CreateLeafControl( 40, 40 ) );
724   controls.push_back( CreateLeafControl( 60, 40 ) );
725   controls.push_back( CreateLeafControl( 80, 40 ) );
726   controls.push_back( CreateLeafControl( 100, 40 ) );
727
728   const Extents CONTROL_PADDING = Extents(5, 10, 20, 2 );
729
730   for( auto&& iter : controls )
731   {
732     iter.SetProperty(Toolkit::Control::Property::PADDING, CONTROL_PADDING );
733     hbox.Add( iter );
734   }
735   hbox.SetParentOrigin( ParentOrigin::CENTER );
736   hbox.SetAnchorPoint( AnchorPoint::CENTER );
737   stage.Add( hbox );
738
739   // Ensure layouting happens
740   application.SendNotification();
741   application.Render();
742
743   // hbox centers elements vertically, it fills test harness stage, which is 480x800.
744   // hbox left justifies elements
745   tet_infoline("Test Child Actor Position");
746   float xPositionOfControlBeingTested = 0.0f;
747   float yPositionOfControlBeingTested = ( 800.0f * 0.5) - ( 0.5 * ( 40.0f + CONTROL_PADDING.top + CONTROL_PADDING.bottom ) );
748
749   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested,
750                                                                                             yPositionOfControlBeingTested,
751                                                                                             0.0f ), 0.0001f, TEST_LOCATION );
752   xPositionOfControlBeingTested += 40.0f + CONTROL_PADDING.start + CONTROL_PADDING.end;
753
754   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested,
755                                                                                             yPositionOfControlBeingTested,
756                                                                                             0.0f ),
757                                                                                             0.0001f, TEST_LOCATION );
758
759   xPositionOfControlBeingTested += 60.0f + CONTROL_PADDING.start + CONTROL_PADDING.end;
760   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested,
761                                                                                             yPositionOfControlBeingTested,
762                                                                                             0.0f ), 0.0001f, TEST_LOCATION );
763
764   xPositionOfControlBeingTested += 80.0f + CONTROL_PADDING.start + CONTROL_PADDING.end;
765   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested,
766                                                                                             yPositionOfControlBeingTested,
767                                                                                             0.0f ), 0.0001f, TEST_LOCATION );
768
769   tet_infoline("Test Child Actor Size");
770   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f + CONTROL_PADDING.start + CONTROL_PADDING.end,
771                                                                                         40.0f + CONTROL_PADDING.top + CONTROL_PADDING.bottom,
772                                                                                         0.0f ), 0.0001f, TEST_LOCATION );
773
774   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 60.0f + CONTROL_PADDING.start + CONTROL_PADDING.end,
775                                                                                         40.0f + CONTROL_PADDING.top + CONTROL_PADDING.bottom,
776                                                                                         0.0f ), 0.0001f, TEST_LOCATION );
777
778   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f + CONTROL_PADDING.start + CONTROL_PADDING.end ,
779                                                                                         40.0f + CONTROL_PADDING.top + CONTROL_PADDING.bottom,
780                                                                                         0.0f ), 0.0001f, TEST_LOCATION );
781
782   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f + CONTROL_PADDING.start + CONTROL_PADDING.end,
783                                                                                         40.0f + CONTROL_PADDING.top + CONTROL_PADDING.bottom,
784                                                                                         0.0f ), 0.0001f, TEST_LOCATION );
785
786   END_TEST;
787 }
788
789
790 int UtcDaliLayouting_HboxLayout_Padding03(void)
791 {
792   ToolkitTestApplication application;
793   tet_infoline("UtcDaliLayouting_HboxLayout_Padding03 - Changing padding on a single child");
794
795   Stage stage = Stage::GetCurrent();
796   auto hbox = Control::New();
797   auto hboxLayout = LinearLayout::New();
798   DevelControl::SetLayout( hbox, hboxLayout );
799   hbox.SetName( "HBox");
800
801   std::vector< Control > controls;
802   controls.push_back( CreateLeafControl( 40, 40 ) );
803   controls.push_back( CreateLeafControl( 40, 40 ) );
804   controls.push_back( CreateLeafControl( 40, 40 ) );
805
806   const Extents CONTROL_PADDING = Extents(5, 10, 20, 2 );
807   tet_printf( "\nAdding Padding to control at index 1 \n" );
808   controls[1].SetProperty(Toolkit::Control::Property::PADDING, CONTROL_PADDING );
809
810   for( auto&& iter : controls )
811   {
812     hbox.Add( iter );
813   }
814   hbox.SetParentOrigin( ParentOrigin::CENTER );
815   hbox.SetAnchorPoint( AnchorPoint::CENTER );
816   stage.Add( hbox );
817
818   // Ensure layouting happens
819   application.SendNotification();
820   application.Render();
821
822   // hbox centers elements vertically, it fills test harness stage, which is 480x800.
823   // hbox left justifies elements
824   tet_infoline("Test Child Actor Position");
825   float xPositionOfControlBeingTested = 0.0f;
826   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested,
827                                                                                             380.0f,
828                                                                                             0.0f ), 0.0001f, TEST_LOCATION );
829   xPositionOfControlBeingTested += 40.0f;
830
831   DALI_TEST_EQUALS( controls[ 1 ].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested,
832                                                                                             380.0f - ( ( CONTROL_PADDING.top + CONTROL_PADDING.bottom) * 0.5f ),                                                                                            0.0f ),
833                                                                                             0.0001f, TEST_LOCATION );
834
835   xPositionOfControlBeingTested += 40.0f + CONTROL_PADDING.start + CONTROL_PADDING.end;
836   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
837
838   const Extents NEW_CONTROL_PADDING = Extents(10, 10, 20, 2 );
839   tet_printf( "\nChanging Padding to control at index 1 \n" );
840   controls[1].SetProperty(Toolkit::Control::Property::PADDING, NEW_CONTROL_PADDING );
841
842   // Ensure layouting happens
843   application.SendNotification();
844   application.Render();
845
846   xPositionOfControlBeingTested = 0.0f; // reset
847
848   tet_infoline("Test Child Actor Position");
849   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested,
850                                                                                             380.0f,
851                                                                                             0.0f ), 0.0001f, TEST_LOCATION );
852   xPositionOfControlBeingTested += 40.0f;
853
854   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested,
855                                                                                             380.0f - ( ( NEW_CONTROL_PADDING.top + NEW_CONTROL_PADDING.bottom) * 0.5f ),                                                                                            0.0f ),
856                                                                                             0.0001f, TEST_LOCATION );
857
858   xPositionOfControlBeingTested += 40.0f + NEW_CONTROL_PADDING.start + NEW_CONTROL_PADDING.end;
859   tet_printf( "\nIf x position %u then change has not been processed \n", 40 + 40 + CONTROL_PADDING.start + CONTROL_PADDING.end );
860   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
861
862   tet_infoline("Test Child Actor Size");
863   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ) , Vector3( 40.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
864
865   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ) , Vector3( 40.0f + NEW_CONTROL_PADDING.start + NEW_CONTROL_PADDING.end,
866                                                                                         40.0f + NEW_CONTROL_PADDING.top + NEW_CONTROL_PADDING.bottom , 0.0f ),
867                                                                                         0.0001f, TEST_LOCATION );
868
869   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ) , Vector3( 40.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
870
871   END_TEST;
872 }
873
874 int UtcDaliLayouting_HboxLayout_Padding04(void)
875 {
876   ToolkitTestApplication application;
877   tet_infoline("UtcDaliLayouting_HboxLayout_Padding04 - Adding Padding to the hbox");
878
879   // Adding padding to the layout should offset the positioning of the children.
880
881   const Extents LAYOUT_PADDING = Extents(5, 10, 20, 2 );
882   const Size CONTROL_SIZE = Size( 40, 40 );
883
884   Stage stage = Stage::GetCurrent();
885   // Create a root layout, ideally Dali would have a default layout in the root layer.
886   // Without this root layer the LinearLayout (or any other layout) will not
887   // honour WIDTH_SPECIFICATION or HEIGHT_SPECIFICATION settings.
888   // It uses the default stage size and ideally should have a layout added to it.
889   auto rootLayoutControl = Control::New();
890   rootLayoutControl.SetName( "AbsoluteLayout");
891   auto rootLayout = AbsoluteLayout::New();
892   DevelControl::SetLayout( rootLayoutControl, rootLayout );
893   rootLayoutControl.SetAnchorPoint( AnchorPoint::CENTER );
894   rootLayoutControl.SetParentOrigin( ParentOrigin::CENTER );
895   stage.Add( rootLayoutControl );
896
897   auto hbox = Control::New();
898   auto hboxLayout = LinearLayout::New();
899   hboxLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
900   DevelControl::SetLayout( hbox, hboxLayout );
901   hbox.SetName( "HBox");
902   hbox.SetProperty(Toolkit::Control::Property::PADDING, LAYOUT_PADDING );
903   hbox.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
904   hbox.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
905
906   std::vector< Control > controls;
907   controls.push_back( CreateLeafControl( CONTROL_SIZE.width, CONTROL_SIZE.height ) );
908   controls.push_back( CreateLeafControl( CONTROL_SIZE.width, CONTROL_SIZE.height ) );
909   controls.push_back( CreateLeafControl( CONTROL_SIZE.width, CONTROL_SIZE.height ) );
910   controls.push_back( CreateLeafControl( CONTROL_SIZE.width, CONTROL_SIZE.height ) );
911
912   for( auto&& iter : controls )
913   {
914     hbox.Add( iter );
915   }
916
917   hbox.SetParentOrigin( ParentOrigin::CENTER );
918   hbox.SetAnchorPoint( AnchorPoint::CENTER );
919   rootLayoutControl.Add( hbox );
920
921   // Ensure layouting happens
922   application.SendNotification();
923   application.Render();
924
925   // Extra update needed to Relayout one more time. Catches any position updates, false positive without this seen.
926   application.SendNotification();
927
928   // hbox centers elements vertically, it fills test harness stage, which is 480x800.
929   // hbox left justifies elements
930   tet_infoline("Test Child Actor Position");
931
932   auto controlXPosition=0.0f;
933
934   controlXPosition = LAYOUT_PADDING.start;  // First child positioned at offset defined by the padding
935   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( LAYOUT_PADDING.start,
936                                                                                             LAYOUT_PADDING.top,
937                                                                                             0.0f ), 0.0001f, TEST_LOCATION );
938
939   controlXPosition+=CONTROL_SIZE.width; // Second child positioned is the position of the first child + the first child's width.
940   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( controlXPosition,
941                                                                                             LAYOUT_PADDING.top,
942                                                                                             0.0f ),
943                                                                                             0.0001f, TEST_LOCATION );
944
945   controlXPosition+=CONTROL_SIZE.width; // Third child positioned adjacent to second
946   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( controlXPosition,
947                                                                                             LAYOUT_PADDING.top,
948                                                                                             0.0f ), 0.0001f, TEST_LOCATION );
949
950   controlXPosition+=CONTROL_SIZE.width; // Forth passed adjacent to the third
951   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( controlXPosition,
952                                                                                             LAYOUT_PADDING.top,
953                                                                                             0.0f ), 0.0001f, TEST_LOCATION );
954
955   auto totalControlsWidth = CONTROL_SIZE.width * controls.size();
956   auto totalControlsHeight = CONTROL_SIZE.height;
957
958   DALI_TEST_EQUALS( hbox.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( totalControlsWidth + LAYOUT_PADDING.start + LAYOUT_PADDING.end,
959                                                                                  totalControlsHeight + LAYOUT_PADDING.top + LAYOUT_PADDING.bottom,
960                                                                                  0.0f ), 0.0001f, TEST_LOCATION );
961
962
963   END_TEST;
964 }
965
966 int UtcDaliLayouting_HboxLayout_Padding05(void)
967 {
968   ToolkitTestApplication application;
969   tet_infoline("UtcDaliLayouting_HboxLayout_Padding05 - Changing the hbox Padding");
970
971   // Adding padding to the layout should offset the positioning of the children.
972
973   const Extents LAYOUT_PADDING = Extents(5, 10, 20, 2 );
974   const Size CONTROL_SIZE = Size( 40, 40 );
975
976   Stage stage = Stage::GetCurrent();
977   // Create a root layout, ideally Dali would have a default layout in the root layer.
978   // Without this root layer the LinearLayout (or any other layout) will not
979   // honour WIDTH_SPECIFICATION or HEIGHT_SPECIFICATION settings.
980   // It uses the default stage size and ideally should have a layout added to it.
981   auto rootLayoutControl = Control::New();
982   rootLayoutControl.SetName( "AbsoluteLayout");
983   auto rootLayout = AbsoluteLayout::New();
984   DevelControl::SetLayout( rootLayoutControl, rootLayout );
985   rootLayoutControl.SetAnchorPoint( AnchorPoint::CENTER );
986   rootLayoutControl.SetParentOrigin( ParentOrigin::CENTER );
987   stage.Add( rootLayoutControl );
988
989   auto hbox = Control::New();
990   auto hboxLayout = LinearLayout::New();
991   hboxLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
992   DevelControl::SetLayout( hbox, hboxLayout );
993   hbox.SetName( "HBox");
994   hbox.SetProperty(Toolkit::Control::Property::PADDING, LAYOUT_PADDING );
995   hbox.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
996   hbox.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
997
998   std::vector< Control > controls;
999   controls.push_back( CreateLeafControl( CONTROL_SIZE.width, CONTROL_SIZE.height ) );
1000   controls.push_back( CreateLeafControl( CONTROL_SIZE.width, CONTROL_SIZE.height ) );
1001   controls.push_back( CreateLeafControl( CONTROL_SIZE.width, CONTROL_SIZE.height ) );
1002   controls.push_back( CreateLeafControl( CONTROL_SIZE.width, CONTROL_SIZE.height ) );
1003
1004   for( auto&& iter : controls )
1005   {
1006     hbox.Add( iter );
1007   }
1008
1009   hbox.SetParentOrigin( ParentOrigin::CENTER );
1010   hbox.SetAnchorPoint( AnchorPoint::CENTER );
1011   rootLayoutControl.Add( hbox );
1012
1013   // Ensure layouting happens
1014   application.SendNotification();
1015   application.Render();
1016
1017   // Extra update needed to Relayout one more time. Catches any position updates, false positive without this seen.
1018   application.SendNotification();
1019
1020   // hbox centers elements vertically, it fills test harness stage, which is 480x800.
1021   // hbox left justifies elements
1022   tet_infoline("Test Child Actor Position");
1023
1024   auto controlXPosition=0.0f;
1025
1026   controlXPosition = LAYOUT_PADDING.start;  // First child positioned at offset defined by the padding
1027   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( LAYOUT_PADDING.start,
1028                                                                                             LAYOUT_PADDING.top,
1029                                                                                             0.0f ), 0.0001f, TEST_LOCATION );
1030
1031   controlXPosition+=CONTROL_SIZE.width; // Second child positioned is the position of the first child + the first child's width.
1032   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( controlXPosition,
1033                                                                                             LAYOUT_PADDING.top,
1034                                                                                             0.0f ),
1035                                                                                             0.0001f, TEST_LOCATION );
1036
1037   controlXPosition+=CONTROL_SIZE.width; // Third child positioned adjacent to second
1038   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( controlXPosition,
1039                                                                                             LAYOUT_PADDING.top,
1040                                                                                             0.0f ), 0.0001f, TEST_LOCATION );
1041
1042   controlXPosition+=CONTROL_SIZE.width; // Forth passed adjacent to the third
1043   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( controlXPosition,
1044                                                                                             LAYOUT_PADDING.top,
1045                                                                                             0.0f ), 0.0001f, TEST_LOCATION );
1046
1047   auto totalControlsWidth = CONTROL_SIZE.width * controls.size();
1048   auto totalControlsHeight = CONTROL_SIZE.height;
1049
1050   DALI_TEST_EQUALS( hbox.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( totalControlsWidth + LAYOUT_PADDING.start + LAYOUT_PADDING.end,
1051                                                                                  totalControlsHeight + LAYOUT_PADDING.top + LAYOUT_PADDING.bottom,
1052                                                                                  0.0f ), 0.0001f, TEST_LOCATION );
1053
1054   // Change layout padding
1055   const Extents NEW_LAYOUT_PADDING = Extents(5, 20, 10, 2 );
1056   tet_printf( "\nChanging Padding to control at index 1 \n" );
1057   hbox.SetProperty(Toolkit::Control::Property::PADDING, NEW_LAYOUT_PADDING );
1058
1059   // Ensure layouting happens
1060   application.SendNotification();
1061   application.Render();
1062
1063   // Extra update needed to Relayout one more time. Catches any position updates, false positive without this seen.
1064   application.SendNotification();
1065
1066   controlXPosition = NEW_LAYOUT_PADDING.start;  // First child positioned at offset defined by the padding
1067   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( NEW_LAYOUT_PADDING.start,
1068                                                                                             NEW_LAYOUT_PADDING.top,
1069                                                                                             0.0f ), 0.0001f, TEST_LOCATION );
1070
1071   controlXPosition+=CONTROL_SIZE.width; // Second child positioned is the position of the first child + the first child's width.
1072   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( controlXPosition,
1073                                                                                             NEW_LAYOUT_PADDING.top,
1074                                                                                             0.0f ),
1075                                                                                             0.0001f, TEST_LOCATION );
1076
1077   controlXPosition+=CONTROL_SIZE.width; // Third child positioned adjacent to second
1078   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( controlXPosition,
1079                                                                                             NEW_LAYOUT_PADDING.top,
1080                                                                                             0.0f ), 0.0001f, TEST_LOCATION );
1081
1082   controlXPosition+=CONTROL_SIZE.width; // Forth passed adjacent to the third
1083   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( controlXPosition,
1084                                                                                             NEW_LAYOUT_PADDING.top,
1085                                                                                             0.0f ), 0.0001f, TEST_LOCATION );
1086   totalControlsWidth = CONTROL_SIZE.width * controls.size();
1087   totalControlsHeight = CONTROL_SIZE.height;
1088
1089   DALI_TEST_EQUALS( hbox.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( totalControlsWidth + NEW_LAYOUT_PADDING.start + NEW_LAYOUT_PADDING.end,
1090                                                                                  totalControlsHeight + NEW_LAYOUT_PADDING.top + NEW_LAYOUT_PADDING.bottom,
1091                                                                                  0.0f ), 0.0001f, TEST_LOCATION );
1092   END_TEST;
1093 }
1094
1095 // Margin Tests
1096
1097 int UtcDaliLayouting_HboxLayout_Margin01(void)
1098 {
1099   ToolkitTestApplication application;
1100   tet_infoline("UtcDaliLayouting_HboxLayout_Margin01 - Adding a margin to a single child");
1101
1102   Stage stage = Stage::GetCurrent();
1103   auto hbox = Control::New();
1104   auto hboxLayout = LinearLayout::New();
1105   DevelControl::SetLayout( hbox, hboxLayout );
1106   hbox.SetName( "HBox");
1107
1108   std::vector< Control > controls;
1109   controls.push_back( CreateLeafControl( 40, 40 ) );
1110   controls.push_back( CreateLeafControl( 60, 40 ) );
1111   controls.push_back( CreateLeafControl( 80, 40 ) );
1112   controls.push_back( CreateLeafControl( 100, 40 ) );
1113
1114   const Extents CONTROL_MARGIN = Extents(5, 10, 20, 0 );
1115   tet_printf( "\nAdding Margin to control at index 1 \n" );
1116   controls[1].SetProperty(Toolkit::Control::Property::MARGIN, CONTROL_MARGIN );
1117
1118   for( auto&& iter : controls )
1119   {
1120     hbox.Add( iter );
1121   }
1122   hbox.SetParentOrigin( ParentOrigin::CENTER );
1123   hbox.SetAnchorPoint( AnchorPoint::CENTER );
1124   stage.Add( hbox );
1125
1126   // Ensure layouting happens
1127   application.SendNotification();
1128   application.Render();
1129
1130   // hbox centers elements vertically, it fills test harness stage, which is 480x800.
1131   // hbox left justifies elements
1132   tet_infoline("Test Child Actor Position");
1133   auto xPositionOfControlBeingTested = 0.0f;
1134   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested,
1135                                                                                             380.0f,
1136                                                                                             0.0f ), 0.0001f, TEST_LOCATION );
1137   xPositionOfControlBeingTested += 40.0f + CONTROL_MARGIN.start;
1138
1139   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested,
1140                                                                                             380.0f + CONTROL_MARGIN.top, 0.0f ),
1141                                                                                             0.0001f, TEST_LOCATION );
1142
1143   xPositionOfControlBeingTested += 60.0f + CONTROL_MARGIN.end;
1144   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1145
1146   xPositionOfControlBeingTested += 80.0f;
1147   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( xPositionOfControlBeingTested,380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1148
1149   tet_infoline("Test Child Actor Size is the same after Margin added");
1150   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1151   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 60.0f, 40.0f , 0.0f ), 0.0001f, TEST_LOCATION );
1152   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1153   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1154
1155   END_TEST;
1156 }
1157
1158
1159 int UtcDaliLayouting_VboxLayout01(void)
1160 {
1161   ToolkitTestApplication application;
1162   tet_infoline(" UtcDaliLayouting_VboxLayout01");
1163
1164   Stage stage = Stage::GetCurrent();
1165   auto vbox = Control::New();
1166   auto vboxLayout = LinearLayout::New();
1167   vboxLayout.SetOrientation( LinearLayout::Orientation::VERTICAL );
1168   DevelControl::SetLayout( vbox, vboxLayout );
1169   vbox.SetName( "Vbox");
1170
1171   std::vector< Control > controls;
1172   controls.push_back( CreateLeafControl( 40, 40 ) );
1173   controls.push_back( CreateLeafControl( 60, 60 ) );
1174   controls.push_back( CreateLeafControl( 80, 80 ) );
1175   controls.push_back( CreateLeafControl( 100, 100 ) );
1176
1177   for( auto&& iter : controls )
1178   {
1179     vbox.Add( iter );
1180   }
1181   vbox.SetParentOrigin( ParentOrigin::CENTER );
1182   vbox.SetAnchorPoint( AnchorPoint::CENTER );
1183   stage.Add( vbox );
1184
1185   controls[2].SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
1186
1187   // Check it.
1188   DALI_TEST_EQUALS( controls[2].GetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION ), Property::Value( ChildLayoutData::MATCH_PARENT ), TEST_LOCATION );
1189
1190   // Ensure layouting happens
1191   application.SendNotification();
1192   application.Render();
1193
1194   // vbox centers elements horizontally, it fills test harness stage, which is 480x800.
1195   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 220.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1196   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 210.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1197   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1198   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 190.0f, 180.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1199
1200   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1201   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 60.0f, 60.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1202   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 480.0f, 80.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1203   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1204
1205   END_TEST;
1206 }
1207
1208 int UtcDaliLayouting_VboxLayout02(void)
1209 {
1210   ToolkitTestApplication application;
1211   tet_infoline(" UtcDaliLayouting_VboxLayout01");
1212
1213   Stage stage = Stage::GetCurrent();
1214
1215   // @todo Can't set specification properties on root control. Really need to make LayoutController a root
1216   // LayoutGroup for this to happen automatically.
1217   //
1218   // For this test, add an hbox instead
1219   auto rootControl = Control::New();
1220   auto absoluteLayout = AbsoluteLayout::New();
1221   DevelControl::SetLayout( rootControl, absoluteLayout );
1222   rootControl.SetName( "AbsoluteLayout");
1223   stage.Add( rootControl );
1224
1225   auto vbox = Control::New();
1226   auto vboxLayout = LinearLayout::New();
1227   vboxLayout.SetOrientation( LinearLayout::Orientation::VERTICAL );
1228   DevelControl::SetLayout( vbox, vboxLayout );
1229   vbox.SetName( "Vbox");
1230   rootControl.Add( vbox );
1231
1232   vbox.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
1233   vbox.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
1234
1235   std::vector< Control > controls;
1236   controls.push_back( CreateLeafControl( 40, 40 ) );
1237   controls.push_back( CreateLeafControl( 60, 60 ) );
1238   controls.push_back( CreateLeafControl( 80, 80 ) );
1239   controls.push_back( CreateLeafControl( 100, 100 ) );
1240
1241   for( auto&& iter : controls )
1242   {
1243     vbox.Add( iter );
1244   }
1245   vbox.SetParentOrigin( ParentOrigin::CENTER );
1246   vbox.SetAnchorPoint( AnchorPoint::CENTER );
1247
1248   controls[2].SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
1249
1250   // Check it.
1251   DALI_TEST_EQUALS( controls[2].GetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION ), Property::Value( ChildLayoutData::MATCH_PARENT ), TEST_LOCATION );
1252
1253   // Ensure layouting happens
1254   application.SendNotification();
1255   application.Render();
1256
1257   DALI_TEST_EQUALS( rootControl.GetProperty<Vector3>(Actor::Property::POSITION), Vector3(0,0,0),TEST_LOCATION);
1258   DALI_TEST_EQUALS( rootControl.GetProperty<Vector3>(Actor::Property::SIZE), Vector3(480,800,0),TEST_LOCATION);
1259
1260   // vbox centers elements horizontally, it should wrap it's content horizontally, i.e. it should take the width of the largest element (100)
1261   DALI_TEST_EQUALS( vbox.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1262   DALI_TEST_EQUALS( vbox.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1263
1264   // 3rd control is set to match parent - this should also be 100 wide
1265   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 30.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1266   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 20.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1267   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1268   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 180.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1269
1270   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1271   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 60.0f, 60.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1272   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 80.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1273   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1274
1275   END_TEST;
1276 }
1277
1278
1279 int UtcDaliLayouting_VboxLayout03(void)
1280 {
1281   ToolkitTestApplication application;
1282   tet_infoline(" UtcDaliLayouting_VboxLayout03 test with cell padding set");
1283
1284   Stage stage = Stage::GetCurrent();
1285
1286   // @todo Can't set specification properties on root control. Really need to make LayoutController a root
1287   // LayoutGroup for this to happen automatically.
1288   //
1289   // For this test, add an hbox instead
1290   auto hbox = Control::New();
1291   auto hboxLayout = LinearLayout::New();
1292   DevelControl::SetLayout( hbox, hboxLayout );
1293   hbox.SetName( "Hbox");
1294   stage.Add( hbox );
1295
1296   auto vbox = Control::New();
1297   auto vboxLayout = LinearLayout::New();
1298   vboxLayout.SetCellPadding( LayoutSize( 0, 10 ) );
1299   vboxLayout.SetOrientation( LinearLayout::Orientation::VERTICAL );
1300
1301   DALI_TEST_EQUALS( vboxLayout.GetCellPadding(), LayoutSize( 0, 10 ), TEST_LOCATION );
1302
1303   DevelControl::SetLayout( vbox, vboxLayout );
1304   vbox.SetName( "Vbox");
1305   hbox.Add( vbox );
1306
1307   vbox.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
1308   vbox.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
1309
1310   std::vector< Control > controls;
1311   controls.push_back( CreateLeafControl( 40, 40 ) );
1312   controls.push_back( CreateLeafControl( 60, 60 ) );
1313   controls.push_back( CreateLeafControl( 80, 80 ) );
1314   controls.push_back( CreateLeafControl( 100, 100 ) );
1315
1316   for( auto&& iter : controls )
1317   {
1318     vbox.Add( iter );
1319   }
1320   vbox.SetParentOrigin( ParentOrigin::CENTER );
1321   vbox.SetAnchorPoint( AnchorPoint::CENTER );
1322
1323   controls[2].SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
1324
1325   // Check it.
1326   DALI_TEST_EQUALS( controls[2].GetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION ), Property::Value( ChildLayoutData::MATCH_PARENT ), TEST_LOCATION );
1327
1328   // Ensure layouting happens
1329   application.SendNotification();
1330   application.Render();
1331
1332   DALI_TEST_EQUALS( hbox.GetProperty<Vector3>(Actor::Property::POSITION), Vector3(0,0,0),TEST_LOCATION);
1333   DALI_TEST_EQUALS( hbox.GetProperty<Vector3>(Actor::Property::SIZE), Vector3(480,800,0),TEST_LOCATION);
1334
1335   // vbox centers elements horizontally, it should wrap it's content horizontally, i.e. it should take the width of the largest element (100)
1336   DALI_TEST_EQUALS( vbox.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1337   DALI_TEST_EQUALS( vbox.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 800.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1338
1339   // 3rd control is set to match parent - this should also be 100 wide
1340   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 30.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1341   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 20.0f, 50.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1342   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 120.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1343   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 210.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1344
1345   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1346   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 60.0f, 60.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1347   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 80.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1348   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1349
1350   END_TEST;
1351 }
1352
1353
1354
1355 int UtcDaliLayouting_RelayoutOnChildOrderChanged(void)
1356 {
1357   ToolkitTestApplication application;
1358   tet_infoline(" UtcDaliLayouting_RelayoutOnChildOrderChanged");
1359   tet_infoline(" Test that if the sibling order changes, the container is re-laid out automatically");
1360
1361   Stage stage = Stage::GetCurrent();
1362
1363   auto hbox = Control::New();
1364   auto hboxLayout = Test::CustomLayout::New();
1365   DevelControl::SetLayout( hbox, hboxLayout );
1366   hbox.SetName( "HBox");
1367
1368   std::vector< Control > controls;
1369   controls.push_back( CreateLeafControl( 40, 40 ) );
1370   controls.push_back( CreateLeafControl( 60, 40 ) );
1371   controls.push_back( CreateLeafControl( 80, 40 ) );
1372   controls.push_back( CreateLeafControl( 100, 40 ) );
1373
1374   for( auto&& iter : controls )
1375   {
1376     hbox.Add( iter );
1377   }
1378   hbox.SetParentOrigin( ParentOrigin::CENTER );
1379   hbox.SetAnchorPoint( AnchorPoint::CENTER );
1380   stage.Add( hbox );
1381
1382   // Ensure layouting happens
1383   application.SendNotification();
1384   application.Render();
1385
1386   // hbox centers elements vertically, it fills test harness stage, which is 480x800.
1387   // hbox left justifies elements
1388   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1389   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 40.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1390   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 100.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1391   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 180.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1392
1393   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1394   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 60.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1395   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1396   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1397
1398   controls[0].RaiseToTop(); // 0->3; 1, 2, 3, 0
1399   controls[2].Lower();      // 2->1; 2, 1, 3, 0
1400
1401   application.SendNotification();
1402   application.Render();
1403
1404   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1405   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 80.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1406   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 140.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1407   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 240.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1408
1409   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1410   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 60.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1411   DALI_TEST_EQUALS( controls[2].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 80.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1412   DALI_TEST_EQUALS( controls[3].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1413
1414   END_TEST;
1415 }
1416
1417 int UtcDaliLayouting_HboxLayout_TargetSize(void)
1418 {
1419   ToolkitTestApplication application;
1420   tet_infoline(" UtcDaliLayouting_HboxLayout07 - Set target size on leaf");
1421
1422   Stage stage = Stage::GetCurrent();
1423   auto hbox = Control::New();
1424   auto hboxLayout = LinearLayout::New();
1425   DevelControl::SetLayout( hbox, hboxLayout );
1426   hbox.SetName( "HBox");
1427
1428   std::vector< Control > controls;
1429   controls.push_back( CreateLeafControl( 40, 40 ) );
1430   for( auto&& iter : controls )
1431   {
1432     iter.SetSize( 100, 100 );
1433     hbox.Add( iter );
1434   }
1435   hbox.SetParentOrigin( ParentOrigin::CENTER );
1436   hbox.SetAnchorPoint( AnchorPoint::CENTER );
1437   stage.Add( hbox );
1438
1439   // Ensure layouting happens
1440   application.SendNotification();
1441   application.Render();
1442
1443   // hbox centers elements vertically, it fills test harness stage, which is 480x800 from left to right.
1444   // hbox left justifies elements
1445   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 350.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1446   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1447
1448   END_TEST;
1449 }
1450
1451
1452 int UtcDaliLayouting_RemoveLayout01(void)
1453 {
1454   ToolkitTestApplication application;
1455   tet_infoline(" UtcDaliLayouting_RemoveLayout");
1456
1457   Stage stage = Stage::GetCurrent();
1458
1459   auto rootControl = Control::New();
1460   auto absoluteLayout = AbsoluteLayout::New();
1461   DevelControl::SetLayout( rootControl, absoluteLayout );
1462   rootControl.SetName( "AbsoluteLayout" );
1463   stage.Add( rootControl );
1464
1465   auto hbox = Control::New();
1466   auto hboxLayout = LinearLayout::New();
1467   hboxLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
1468   DevelControl::SetLayout( hbox, hboxLayout );
1469   hbox.SetName( "HBox" );
1470
1471   std::vector< Control > controls;
1472   controls.push_back( CreateLeafControl( 40, 40 ) );
1473   controls.push_back( CreateLeafControl( 60, 40 ) );
1474
1475   for( auto&& iter : controls )
1476   {
1477     hbox.Add( iter );
1478   }
1479   hbox.SetParentOrigin( ParentOrigin::CENTER );
1480   hbox.SetAnchorPoint( AnchorPoint::CENTER );
1481   rootControl.Add( hbox );
1482
1483   tet_infoline("Layout as normal");
1484   application.SendNotification();
1485   application.Render();
1486
1487   tet_infoline("Set an empty layout on hbox container");
1488   LinearLayout emptyLayout;
1489   DevelControl::SetLayout( hbox, emptyLayout );
1490
1491   tet_infoline("Run another layout");
1492   application.SendNotification();
1493   application.Render();
1494
1495   tet_infoline("Check leaf controls haven't moved");
1496
1497   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1498   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 40.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1499
1500   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1501   DALI_TEST_EQUALS( controls[1].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 60.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
1502
1503   END_TEST;
1504 }