Stop resetting transform values to default in OnRelayout & OnSizeSet
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-TableView.cpp
1 /*
2  * Copyright (c) 2014 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 <sstream>
21 #include <dali-toolkit-test-suite-utils.h>
22 #include <dali-toolkit/dali-toolkit.h>
23
24 using namespace Dali;
25 using namespace Toolkit;
26
27 void dali_tableview_startup(void)
28 {
29   test_return_value = TET_UNDEF;
30 }
31
32 void dali_tableview_cleanup(void)
33 {
34   test_return_value = TET_PASS;
35 }
36
37 namespace
38 {
39
40 const char* const PROPERTY_NAME_ROWS = "rows";
41 const char* const PROPERTY_NAME_COLUMNS = "columns";
42 const char* const PROPERTY_NAME_CELL_PADDING = "cellPadding";
43 const char* const PROPERTY_NAME_LAYOUT_ROWS = "layoutRows";
44 const char* const PROPERTY_NAME_LAYOUT_COLUMNS = "layoutColumns";
45 const Vector2 CELL_SIZE( 10, 10 );
46
47 static bool gObjectCreatedCallBackCalled;
48
49 static void TestCallback(BaseHandle handle)
50 {
51   gObjectCreatedCallBackCalled = true;
52 }
53
54 struct Constraint100
55 {
56   Constraint100( )
57   {
58   }
59
60   /**
61    * function operator to apply the parent size
62    */
63   void operator()( Dali::Vector3& current, const PropertyInputContainer& /* inputs */ )
64   {
65     current.x = current.y = current.z = 100.0f;
66   }
67 };
68
69 // Convenience function to quickly set up a 10x10 table with each cell being 10x10 pixels in size by default.
70 static void SetupTableViewAndActors(TableView& tableView, Actor& actor1, Actor& actor2, Actor& actor3)
71 {
72   tableView = TableView::New( 10, 10 ); // 10 by 10 grid.
73   DALI_TEST_CHECK( tableView );
74
75   Stage::GetCurrent().Add( tableView );
76   tableView.SetSize( Dali::Vector2( 100.0f, 100.0f ) );
77
78   actor1 = Actor::New();
79   actor2 = Actor::New();
80   actor3 = Actor::New();
81
82   actor1.SetSize( CELL_SIZE );
83   actor2.SetSize( CELL_SIZE );
84   actor3.SetSize( CELL_SIZE );
85
86   tableView.AddChild( actor1, TableView::CellPosition( 0, 0 ) );
87   tableView.AddChild( actor2, TableView::CellPosition( 0, 1 ) );
88   tableView.AddChild( actor3, TableView::CellPosition( 1, 0 ) );
89 }
90
91 } // namespace
92
93 int UtcDaliTableViewCtorCopyP(void)
94 {
95   TestApplication application;
96
97   TableView actor1 = TableView::New(10,10);
98   TableView actor2( actor1 );
99
100   DALI_TEST_EQUALS( actor1, actor2, TEST_LOCATION );
101   END_TEST;
102 }
103
104 int UtcDaliTableViewNew(void)
105 {
106   ToolkitTestApplication application;
107
108   TableView tableView = TableView::New(10,10);
109   DALI_TEST_CHECK(tableView);
110
111   //Additional check to ensure object is created by checking if it's registered
112   ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
113   DALI_TEST_CHECK( registry );
114
115   gObjectCreatedCallBackCalled = false;
116   registry.ObjectCreatedSignal().Connect(&TestCallback);
117   {
118     TableView tableView = TableView::New(10,10);
119   }
120   DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
121   END_TEST;
122 }
123
124 // Test adjusting the metric values for the cell.
125 int UtcDaliTableViewMetricsPadding(void)
126 {
127   ToolkitTestApplication application;
128
129   tet_infoline("UtcDaliTableViewMetricsPadding");
130
131   TableView tableView;
132   Actor actor1;
133   Actor actor2;
134   Actor actor3;
135
136   SetupTableViewAndActors(tableView, actor1, actor2, actor3);
137
138   // 1. check that padding works. no padding:
139   tableView.SetCellPadding(Size(0.0f, 0.0f));
140   application.SendNotification();
141   application.Render();
142
143   DALI_TEST_EQUALS( tableView.GetCellPadding(), Size(0.0f, 0.0f), TEST_LOCATION );
144   DALI_TEST_EQUALS( actor1.GetCurrentPosition(), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
145   DALI_TEST_EQUALS( actor2.GetCurrentPosition(), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION );
146   DALI_TEST_EQUALS( actor3.GetCurrentPosition(), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION );
147
148   // 1. check that padding works. some padding:
149   tableView.SetCellPadding(Size(5.0f, 10.0f));
150   application.SendNotification();
151   application.Render();
152
153   DALI_TEST_EQUALS( tableView.GetCellPadding(), Size(5.0f, 10.0f), TEST_LOCATION );
154   DALI_TEST_EQUALS( actor1.GetCurrentPosition(), Vector3(5.0f, 10.0f, 0.0f), TEST_LOCATION );
155   END_TEST;
156 }
157
158 // Test adjusting the metric values for the cell.
159 int UtcDaliTableViewMetricsFit(void)
160 {
161   ToolkitTestApplication application;
162
163   tet_infoline("UtcDaliTableViewMetricsFit");
164
165   TableView tableView;
166   Actor actor1;
167   Actor actor2;
168   Actor actor3;
169
170   SetupTableViewAndActors(tableView, actor1, actor2, actor3);
171   application.SendNotification();
172   application.Render();
173
174   // 1. check that with no fixed width/heights, actors are in default position.
175   DALI_TEST_EQUALS( actor1.GetCurrentPosition(), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
176   DALI_TEST_EQUALS( actor2.GetCurrentPosition(), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION );
177   DALI_TEST_EQUALS( actor3.GetCurrentPosition(), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION );
178
179   // 2. check that with a fixed width & height, actors to the right and below are offsetted.
180   tableView.SetFitHeight(0);
181   tableView.SetFitWidth(0);
182   DALI_TEST_EQUALS( tableView.IsFitHeight(0), true, TEST_LOCATION );
183   DALI_TEST_EQUALS( tableView.IsFitWidth(0), true, TEST_LOCATION );
184
185   application.SendNotification();
186   application.Render();
187
188   DALI_TEST_EQUALS( actor1.GetCurrentPosition(), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
189   DALI_TEST_EQUALS( actor2.GetCurrentPosition(), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION );
190   DALI_TEST_EQUALS( actor3.GetCurrentPosition(), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION );
191   END_TEST;
192 }
193
194 // Test adjusting the metric values for the cell.
195 int UtcDaliTableViewMetricsFixed(void)
196 {
197   ToolkitTestApplication application;
198
199   tet_infoline("UtcDaliTableViewMetricsFixed");
200
201   TableView tableView;
202   Actor actor1;
203   Actor actor2;
204   Actor actor3;
205
206   SetupTableViewAndActors(tableView, actor1, actor2, actor3);
207   application.SendNotification();
208   application.Render();
209
210   // 1. check that with no fixed width/heights, actors are in default position.
211   DALI_TEST_EQUALS( actor1.GetCurrentPosition(), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
212   DALI_TEST_EQUALS( actor2.GetCurrentPosition(), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION );
213   DALI_TEST_EQUALS( actor3.GetCurrentPosition(), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION );
214
215   // 2. check that with a fixed width & height, actors to the right and below are offsetted.
216   tableView.SetFixedWidth(0, 20.0f);
217   tableView.SetFixedHeight(0, 50.0f);
218   DALI_TEST_EQUALS( tableView.GetFixedWidth(0), 20.0f, TEST_LOCATION );
219   DALI_TEST_EQUALS( tableView.GetFixedHeight(0), 50.0f, TEST_LOCATION );
220
221   application.SendNotification();
222   application.Render();
223
224   DALI_TEST_EQUALS( actor1.GetCurrentPosition(), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
225   DALI_TEST_EQUALS( actor2.GetCurrentPosition(), Vector3(20.0f, 0.0f, 0.0f), TEST_LOCATION );
226   DALI_TEST_EQUALS( actor3.GetCurrentPosition(), Vector3(0.0f, 50.0f, 0.0f), TEST_LOCATION );
227   END_TEST;
228 }
229
230 // Test adjusting the metric values for the cell.
231 int UtcDaliTableViewMetricsRelative(void)
232 {
233   ToolkitTestApplication application;
234
235   tet_infoline("UtcDaliTableViewMetricsRelative");
236
237   TableView tableView;
238   Actor actor1;
239   Actor actor2;
240   Actor actor3;
241
242   SetupTableViewAndActors(tableView, actor1, actor2, actor3);
243   application.SendNotification();
244   application.Render();
245
246   // 1. check that with no relative width/heights, actors are in default position.
247   DALI_TEST_EQUALS( actor1.GetCurrentPosition(), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
248   DALI_TEST_EQUALS( actor2.GetCurrentPosition(), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION );
249   DALI_TEST_EQUALS( actor3.GetCurrentPosition(), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION );
250
251   // 2. check that with a relative width & height, actors to the right and below are offsetted.
252   tableView.SetRelativeWidth(0, 0.3f); // cell 0,0 occupies 30%x50% of the grid (i.e. 30x50 pixels)
253   tableView.SetRelativeHeight(0, 0.5f);
254   DALI_TEST_EQUALS( tableView.GetRelativeWidth(0), 0.3f, TEST_LOCATION );
255   DALI_TEST_EQUALS( tableView.GetRelativeHeight(0), 0.5f, TEST_LOCATION );
256
257   application.SendNotification();
258   application.Render();
259
260   DALI_TEST_EQUALS( actor1.GetCurrentPosition(), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
261   DALI_TEST_EQUALS( actor2.GetCurrentPosition(), Vector3(30.0f, 0.0f, 0.0f), TEST_LOCATION );
262   DALI_TEST_EQUALS( actor3.GetCurrentPosition(), Vector3(0.0f, 50.0f, 0.0f), TEST_LOCATION );
263   END_TEST;
264 }
265
266
267 // Test Adding/Removing/Finding Children.
268 int UtcDaliTableViewChild(void)
269 {
270   ToolkitTestApplication application;
271
272   tet_infoline("UtcDaliTableViewChild");
273
274   // Create a 10x10 table-view
275   TableView tableView = TableView::New(10,10);
276   DALI_TEST_CHECK( tableView );
277
278   // Check if actor doesn't exist.
279   DALI_TEST_CHECK( !tableView.GetChildAt(TableView::CellPosition(0,0)) );
280
281   // Add an actor to it at 0,0
282   Actor actor = Actor::New();
283   tableView.AddChild(actor, TableView::CellPosition());
284
285   // Check if exists.
286   DALI_TEST_CHECK( tableView.GetChildAt(TableView::CellPosition(0,0)) );
287
288   // Remove this actor
289   tableView.RemoveChildAt(TableView::CellPosition());
290
291   // Check if actor no longer exists.
292   DALI_TEST_CHECK( !tableView.GetChildAt(TableView::CellPosition(0,0)) );
293
294   // Add actor to it again, but at 2,5
295   tableView.AddChild(actor, TableView::CellPosition(2,5));
296
297   // Add another actor somewhere else 7,8
298   Actor actor2 = Actor::New();
299   tableView.AddChild(actor2, TableView::CellPosition(7,8));
300
301   Actor searchActor;
302
303   // Check that no actor exists in a few random places.
304   DALI_TEST_CHECK( !tableView.GetChildAt(TableView::CellPosition(0,0)) );
305   DALI_TEST_CHECK( !tableView.GetChildAt(TableView::CellPosition(2,1)) );
306   DALI_TEST_CHECK( !tableView.GetChildAt(TableView::CellPosition(6,3)) );
307   DALI_TEST_CHECK( !tableView.GetChildAt(TableView::CellPosition(9,5)) );
308
309   // Check for actors at actual positions.
310   searchActor = tableView.GetChildAt(TableView::CellPosition(2,5));
311   DALI_TEST_CHECK( searchActor == actor);
312
313   searchActor = tableView.GetChildAt(TableView::CellPosition(7,8));
314   DALI_TEST_CHECK( searchActor == actor2);
315
316   // Create a second table, and add already added Child to new one.
317   TableView tableView2 = TableView::New(5,5);
318   tableView2.AddChild(actor, TableView::CellPosition(2,2));
319   DALI_TEST_CHECK( tableView2.GetChildAt(TableView::CellPosition(2,2)) );
320   END_TEST;
321 }
322
323 // Test calling Add on it's own (to invoke the OnChildAdd)
324 int UtcDaliTableViewAdd(void)
325 {
326   ToolkitTestApplication application;
327
328   tet_infoline("UtcDaliTableViewAdd");
329
330   // Create a 4x1 table-view, and just keep adding.
331   TableView tableView = TableView::New(1,4);
332   DALI_TEST_CHECK( tableView );
333
334   for(unsigned int i = 0;i<16;i++)
335   {
336     Actor currentActor = Actor::New();
337     TableView::CellPosition position = TableView::CellPosition();
338     tableView.Add( currentActor );
339     tableView.FindChildPosition(currentActor, position);
340     tet_printf("%dx%d (%d,%d)\n", tableView.GetColumns(), tableView.GetRows(), position.columnIndex, position.rowIndex);
341
342     DALI_TEST_EQUALS((position.rowIndex * 4 + position.columnIndex), i, TEST_LOCATION);
343   }
344   END_TEST;
345 }
346
347 // Test cell modification.
348 int UtcDaliTableViewCells(void)
349 {
350   ToolkitTestApplication application;
351   tet_infoline("UtcDaliTableViewCells");
352
353   // Create a 10x10 table-view
354   TableView tableView = TableView::New(10,10);
355   DALI_TEST_CHECK( tableView );
356
357   // Add a few actors to the table.
358   Actor actor1 = Actor::New();
359   Actor actor2 = Actor::New();
360   Actor actor3 = Actor::New();
361   actor1.SetName("Actor1");
362   actor2.SetName("Actor2");
363   actor3.SetName("Actor3");
364
365   // note: positions are specified in reversed cartesian coords - row,col (i.e. y,x)
366   tableView.AddChild(actor1, TableView::CellPosition(0,0));
367   tableView.AddChild(actor2, TableView::CellPosition(5,5));
368   tableView.AddChild(actor3, TableView::CellPosition(7,2));
369
370   DALI_TEST_CHECK( tableView.GetRows() == 10 && tableView.GetColumns() == 10 );
371
372   // Add a row between actor1 and actor2 | insert column on actor1 and see what happens...
373   tableView.InsertRow(3);
374   tableView.InsertColumn(0);
375   DALI_TEST_CHECK( tableView.GetRows() == 11 && tableView.GetColumns() == 11 );
376
377   TableView::CellPosition cellPosition;
378   bool result;
379
380   result = tableView.FindChildPosition(actor1, cellPosition);
381   DALI_TEST_CHECK( result && cellPosition.rowIndex == 0 && cellPosition.columnIndex == 1);
382   result = tableView.FindChildPosition(actor2, cellPosition);
383   DALI_TEST_CHECK( result && cellPosition.rowIndex == 6 && cellPosition.columnIndex == 6);
384   result = tableView.FindChildPosition(actor3, cellPosition);
385   DALI_TEST_CHECK( result && cellPosition.rowIndex == 8 && cellPosition.columnIndex == 3);
386
387   // Delete a row between actor2 and actor3 | delete column on actor2 and see what happens...
388   tableView.DeleteRow(7);
389   tableView.DeleteColumn(6);
390   DALI_TEST_CHECK( tableView.GetRows() == 10 && tableView.GetColumns() == 10 );
391
392   result = tableView.FindChildPosition(actor1, cellPosition);
393   DALI_TEST_CHECK( result && cellPosition.rowIndex == 0 && cellPosition.columnIndex == 1);
394   result = tableView.FindChildPosition(actor2, cellPosition);
395   DALI_TEST_CHECK( !result );
396   result = tableView.FindChildPosition(actor3, cellPosition);
397   DALI_TEST_CHECK( result && cellPosition.rowIndex == 7 && cellPosition.columnIndex == 3);
398
399   // Delete the other two remaining actors by a row delete and a column delete.
400   std::vector<Actor> actorsRemoved;
401   tableView.DeleteRow(0, actorsRemoved);
402   tet_printf("Row Delete >> Actors Removed: %d {", actorsRemoved.size());
403   for(size_t i = 0;i<actorsRemoved.size();i++) tet_printf("%d => %s, ", i, actorsRemoved[i].GetName().c_str());
404   tet_printf("}\n");
405   DALI_TEST_EQUALS( static_cast<int>(actorsRemoved.size()), 1, TEST_LOCATION );
406   DALI_TEST_CHECK( actorsRemoved[0] == actor1 );
407
408   actorsRemoved.clear();
409   tableView.DeleteColumn(3, actorsRemoved);
410   tet_printf("Column Delete >> Actors Removed: %d {", actorsRemoved.size());
411   for(size_t i = 0;i<actorsRemoved.size();i++) tet_printf("%d => %s, ", i, actorsRemoved[i].GetName().c_str());
412   tet_printf("}\n");
413   DALI_TEST_EQUALS( static_cast<int>(actorsRemoved.size()), 1, TEST_LOCATION );
414   DALI_TEST_CHECK( actorsRemoved[0] == actor3 );
415
416   DALI_TEST_CHECK( tableView.GetRows() == 9 && tableView.GetColumns() == 9 );
417
418   tableView.AddChild(actor1, TableView::CellPosition(5,8));
419   tableView.Resize(100,100);
420   DALI_TEST_CHECK( tableView.GetRows() == 100 && tableView.GetColumns() == 100 );
421
422   tableView.AddChild(actor2, TableView::CellPosition(69,57));
423   DALI_TEST_CHECK( tableView.FindChildPosition(actor1, cellPosition) && tableView.FindChildPosition(actor2, cellPosition) );
424
425   tableView.Resize(20,20);
426   DALI_TEST_CHECK( tableView.FindChildPosition(actor1, cellPosition) && !tableView.FindChildPosition(actor2, cellPosition) );
427
428   actorsRemoved.clear();
429   tableView.Resize(1,1, actorsRemoved);
430   DALI_TEST_CHECK( !tableView.FindChildPosition(actor1, cellPosition) && !tableView.FindChildPosition(actor2, cellPosition) );
431   DALI_TEST_EQUALS( static_cast<int>(actorsRemoved.size()), 1, TEST_LOCATION );
432   DALI_TEST_CHECK( actorsRemoved[0] == actor1 );
433
434   // Add child outside table size, forcing a resize.
435   tableView.AddChild(actor1, TableView::CellPosition(100, 100, 1, 1));
436   DALI_TEST_CHECK( tableView.GetRows() == 101 && tableView.GetColumns() == 101 );
437
438   // Add child outside table size, forcing a resize.
439   tableView.AddChild(actor1, TableView::CellPosition(110, 110, 5, 5));
440   DALI_TEST_CHECK( tableView.GetRows() == 115 && tableView.GetColumns() == 115 );
441
442   // Set the alignment of the cell
443   tableView.SetCellAlignment( TableView::CellPosition(100, 100, 1, 1), HorizontalAlignment::CENTER, VerticalAlignment::CENTER );
444   tableView.SetCellAlignment( TableView::CellPosition(110, 110, 5, 5), HorizontalAlignment::LEFT, VerticalAlignment::TOP );
445
446   DALI_TEST_CHECK( true );
447   END_TEST;
448 }
449
450 int UtcDaliTableViewChildAssert(void)
451 {
452   ToolkitTestApplication application;
453   tet_infoline("UtcDaliTableViewChildAssert");
454
455   // Create a 10x10 table-view
456   TableView tableView = TableView::New(10,10);
457   DALI_TEST_CHECK( tableView );
458   Actor childActor;
459
460   try
461   {
462     tableView.AddChild( childActor, TableView::CellPosition(0,0,5,5) );
463     // should assert
464     tet_result(TET_FAIL);
465   }
466   catch( Dali::DaliException& e )
467   {
468     DALI_TEST_PRINT_ASSERT( e );
469     DALI_TEST_EQUALS(e.condition, "child", TEST_LOCATION);
470   }
471   END_TEST;
472 }
473
474 int UtcDaliTableViewMetricsAssert(void)
475 {
476   ToolkitTestApplication application;
477   tet_infoline("UtcDaliTableViewChildAssert");
478
479   // Create a 10x10 table-view
480   TableView tableView = TableView::New(10,10);
481   DALI_TEST_CHECK( tableView );
482
483   // fixeds...
484
485   try
486   {
487     tableView.SetFixedHeight( 10, 1.0f );
488
489     tet_result(TET_FAIL);
490   }
491   catch( Dali::DaliException& e )
492   {
493     DALI_TEST_PRINT_ASSERT( e );
494     DALI_TEST_EQUALS(e.condition, "rowIndex < mRowData.Size()", TEST_LOCATION);
495   }
496
497   try
498   {
499     tableView.GetFixedHeight( 10 );
500
501     tet_result(TET_FAIL);
502   }
503   catch( Dali::DaliException& e )
504   {
505     DALI_TEST_PRINT_ASSERT( e );
506     DALI_TEST_EQUALS(e.condition, "rowIndex < mRowData.Size()", TEST_LOCATION);
507   }
508
509   try
510   {
511     tableView.SetFixedWidth( 10, 1.0f );
512
513     tet_result(TET_FAIL);
514   }
515   catch( Dali::DaliException& e )
516   {
517     DALI_TEST_PRINT_ASSERT( e );
518     DALI_TEST_EQUALS(e.condition, "columnIndex < mColumnData.Size()", TEST_LOCATION);
519   }
520
521   try
522   {
523     tableView.GetFixedWidth( 10 );
524
525     tet_result(TET_FAIL);
526   }
527   catch( Dali::DaliException& e )
528   {
529     DALI_TEST_PRINT_ASSERT( e );
530     DALI_TEST_EQUALS(e.condition, "columnIndex < mColumnData.Size()", TEST_LOCATION);
531   }
532
533   // relatives...
534
535   try
536   {
537     tableView.SetRelativeHeight( 10, 0.1f );
538
539     tet_result(TET_FAIL);
540   }
541   catch( Dali::DaliException& e )
542   {
543     DALI_TEST_PRINT_ASSERT( e );
544     DALI_TEST_EQUALS(e.condition, "rowIndex < mRowData.Size()", TEST_LOCATION);
545   }
546
547   try
548   {
549     tableView.GetRelativeHeight( 10 );
550
551     tet_result(TET_FAIL);
552   }
553   catch( Dali::DaliException& e )
554   {
555     DALI_TEST_PRINT_ASSERT( e );
556     DALI_TEST_EQUALS(e.condition, "rowIndex < mRowData.Size()", TEST_LOCATION);
557   }
558
559   try
560   {
561     tableView.SetRelativeWidth( 10, 0.1f );
562
563     tet_result(TET_FAIL);
564   }
565   catch( Dali::DaliException& e )
566   {
567     DALI_TEST_PRINT_ASSERT( e );
568     DALI_TEST_EQUALS(e.condition, "columnIndex < mColumnData.Size()", TEST_LOCATION);
569   }
570
571   try
572   {
573     tableView.GetRelativeWidth( 10 );
574
575     tet_result(TET_FAIL);
576   }
577   catch( Dali::DaliException& e )
578   {
579     DALI_TEST_PRINT_ASSERT( e );
580     DALI_TEST_EQUALS(e.condition, "columnIndex < mColumnData.Size()", TEST_LOCATION);
581   }
582   END_TEST;
583 }
584
585 int UtcDaliTableViewSetGetProperty(void)
586 {
587   ToolkitTestApplication application;
588   tet_infoline("UtcDaliTableViewSetGetProperty");
589
590   // Create a 1x1 table-view
591   TableView tableView = TableView::New(1,1);
592   tableView.SetSize( Vector2( 100.0f, 100.0f ) );
593   DALI_TEST_CHECK( tableView );
594
595   // Test "rows" property
596   DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_ROWS ) == TableView::Property::ROWS );
597
598   tableView.SetProperty( TableView::Property::ROWS, 4 );
599
600   DALI_TEST_CHECK( tableView.GetRows() == 4u );
601   DALI_TEST_CHECK( tableView.GetProperty(TableView::Property::ROWS).Get<int>() == 4 );
602
603   // Test "columns" property
604   DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_COLUMNS ) == TableView::Property::COLUMNS );
605
606   tableView.SetProperty( TableView::Property::COLUMNS, 5 );
607
608   DALI_TEST_CHECK( tableView.GetColumns() == 5u );
609   DALI_TEST_CHECK( tableView.GetProperty(TableView::Property::COLUMNS).Get<int>() == 5 );
610
611   // Test "cellPadding" property
612   DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_CELL_PADDING ) == TableView::Property::CELL_PADDING );
613
614   tableView.SetProperty( TableView::Property::CELL_PADDING, Size( 6.f, 8.f ) );
615
616   DALI_TEST_EQUALS( tableView.GetCellPadding(), Size(6.f, 8.f), TEST_LOCATION );
617   DALI_TEST_EQUALS( tableView.GetProperty(TableView::Property::CELL_PADDING).Get<Vector2>(), Vector2(6.f,8.f), TEST_LOCATION );
618
619   //{ "policy": "fixed", "value": 30.0 },
620   Property::Map item1;
621   item1[ "policy" ] = "fixed";
622   item1[ "value" ] = 30.f;
623   //{ "policy": "relative", "value": 0.2 },
624   Property::Map item2;
625   item2[ "policy" ] = "relative";
626   item2[ "value" ] = 0.2f;
627
628   // Test "layoutRows" property
629   DALI_TEST_CHECK( tableView.GetPropertyIndex(PROPERTY_NAME_LAYOUT_ROWS) == TableView::Property::LAYOUT_ROWS );
630
631   /*
632    * "layoutRows":
633    *  {
634    *    "1": { "policy": "fixed", "value": 30 },
635    *    "3": { "policy": "relative", "value": 0.2 }
636    *   }
637    */
638   Property::Map layoutRows;
639   layoutRows[ "1" ] = item1;
640   layoutRows[ "3" ] = item2;
641   tableView.SetProperty( TableView::Property::LAYOUT_ROWS, layoutRows );
642
643   DALI_TEST_EQUALS( tableView.GetFixedHeight( 1u ), 30.f, TEST_LOCATION );
644   DALI_TEST_EQUALS( tableView.GetRelativeHeight( 3u ), 0.2f, TEST_LOCATION );
645
646   Property::Map layoutRowsGet = tableView.GetProperty(TableView::Property::LAYOUT_ROWS).Get<Property::Map>();
647
648   DALI_TEST_EQUALS( layoutRowsGet.GetKey(1).compare(layoutRows.GetKey(0)), 0, TEST_LOCATION );
649   Property::Map* childMap =layoutRowsGet.GetValue(1).GetMap();
650   DALI_TEST_CHECK( childMap->Find( "policy" )->Get<std::string>().compare("fixed") == 0 );
651   DALI_TEST_EQUALS( childMap->Find( "value" )->Get<float>(), 30.f, TEST_LOCATION );
652
653   childMap =layoutRowsGet.GetValue(3).GetMap();
654   DALI_TEST_CHECK( layoutRowsGet.GetKey(3).compare(layoutRows.GetKey(1)) == 0 );
655   DALI_TEST_CHECK( childMap->Find( "policy" )->Get<std::string>().compare("relative") == 0 );
656   DALI_TEST_EQUALS( childMap->Find( "value" )->Get<float>(), 0.2f, TEST_LOCATION );
657
658   // Test "layoutColumns" property
659   DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_LAYOUT_COLUMNS ) == TableView::Property::LAYOUT_COLUMNS );
660
661   /*
662    * "layoutColumns":
663    *  {
664    *    "2": { "policy": "relative", "value": 0.2 },
665    *    "3": { "policy": "fixed", "value": 30 }
666    *   }
667    */
668   Property::Map layoutColumns;
669   layoutColumns[ "2" ] = item2;
670   layoutColumns[ "3" ] = item1;
671   tableView.SetProperty( TableView::Property::LAYOUT_COLUMNS, layoutColumns );
672
673   DALI_TEST_EQUALS( tableView.GetRelativeWidth( 2u ), 0.2f, TEST_LOCATION );
674   DALI_TEST_EQUALS( tableView.GetFixedWidth( 3u ), 30.f, TEST_LOCATION );
675
676   Property::Map layoutColumnsGet = tableView.GetProperty(TableView::Property::LAYOUT_COLUMNS).Get<Property::Map>();
677   DALI_TEST_CHECK( layoutColumnsGet.GetKey(2).compare(layoutColumns.GetKey(0)) == 0 );
678   childMap =layoutColumnsGet.GetValue(2).GetMap();
679   DALI_TEST_CHECK( childMap->Find( "policy" )->Get<std::string>().compare("relative") == 0 );
680   DALI_TEST_EQUALS( childMap->Find( "value" )->Get<float>(), 0.2f, TEST_LOCATION );
681   childMap =layoutColumnsGet.GetValue(3).GetMap();
682   DALI_TEST_CHECK( layoutColumnsGet.GetKey(3).compare(layoutColumns.GetKey(1)) == 0 );
683   DALI_TEST_CHECK( childMap->Find( "policy" )->Get<std::string>().compare("fixed") == 0 );
684   DALI_TEST_EQUALS( childMap->Find( "value" )->Get<float>(),30.f, TEST_LOCATION );
685
686   END_TEST;
687 }
688
689 int UtcDaliTableViewChildProperties(void)
690 {
691   ToolkitTestApplication application;
692   tet_infoline("UtcDaliTableViewChildProperties");
693
694   // Create a 10x10 table-view
695   TableView tableView = TableView::New(10,10);
696   Stage::GetCurrent().Add( tableView );
697   tableView.SetSize( Dali::Vector2( 100.0f, 100.0f ) );
698
699   DALI_TEST_CHECK( tableView );
700
701   // Create a child actor with the custom properties
702   Actor child1 = Actor::New();
703   child1.SetProperty( TableView::ChildProperty::CELL_INDEX, Vector2( 3, 4 ) );
704   tableView.Add( child1 );
705   // Check for actors at actual positions.
706   DALI_TEST_CHECK( tableView.GetChildAt(TableView::CellPosition(3,4)) == child1);
707
708   // Create a second child actor with the custom properties
709   Actor child2 = Actor::New();
710   float rowSpan = 3.f;
711   float columnSpan = 2.f;
712   child2.SetProperty( TableView::ChildProperty::CELL_INDEX, Vector2( 6, 1 ) );
713   child2.SetProperty( TableView::ChildProperty::ROW_SPAN, rowSpan );
714   child2.SetProperty( TableView::ChildProperty::COLUMN_SPAN, columnSpan );
715   tableView.Add( child2 );
716   // Check for actors at actual positions.
717   for( int i=0; i<rowSpan; i++ )
718   {
719     for(int j=0; j<columnSpan; j++)
720     {
721       DALI_TEST_CHECK( tableView.GetChildAt(TableView::CellPosition(6+i,1+j)) == child2);
722     }
723   }
724
725   // Create a third child actor with the cell alignment properties
726   Actor child3 = Actor::New();
727   child3.SetSize( 5.f,5.f );
728   child3.SetProperty( TableView::ChildProperty::CELL_HORIZONTAL_ALIGNMENT, "center" );
729   child3.SetProperty( TableView::ChildProperty::CELL_VERTICAL_ALIGNMENT,   "bottom" );
730   tableView.Add( child3 );
731
732   // store the actor in the first available cell
733   DALI_TEST_CHECK( tableView.GetChildAt(TableView::CellPosition(0,0)) == child3)
734   application.SendNotification();
735   application.Render();
736
737   DALI_TEST_EQUALS( child3.GetCurrentAnchorPoint(), AnchorPoint::TOP_LEFT, TEST_LOCATION );
738   DALI_TEST_EQUALS( child3.GetCurrentParentOrigin(), ParentOrigin::TOP_LEFT, TEST_LOCATION );
739   DALI_TEST_EQUALS( child3.GetCurrentPosition(), Vector3(2.5f, 5.0f, 0.0f), TEST_LOCATION );
740
741   END_TEST;
742 }
743
744 int UtcDaliTableViewGetChildAtN(void)
745 {
746   ToolkitTestApplication application;
747
748   TableView tableView = TableView::New(10,10);
749
750   Actor actor = tableView.GetChildAt( TableView::CellPosition( 200, 200 ) );
751   DALI_TEST_CHECK( !actor );
752
753   END_TEST;
754 }
755
756 int UtcDaliTableViewAddChildN(void)
757 {
758   ToolkitTestApplication application;
759
760   TableView tableView = TableView::New(10,10);
761   DALI_TEST_CHECK( tableView.AddChild( Actor::New(), TableView::CellPosition( 0, 0 ) ) );
762   DALI_TEST_CHECK( ! tableView.AddChild( Actor::New(), TableView::CellPosition( 0, 0 ) ) );
763
764   END_TEST;
765 }
766
767 int UtcDaliTableViewInsertRowAtZero(void)
768 {
769   ToolkitTestApplication application;
770
771   TableView tableView = TableView::New(10,10);
772   DALI_TEST_CHECK( tableView.AddChild( Actor::New(), TableView::CellPosition( 0, 0 , 10, 10 ) ) );
773   tableView.InsertRow(0);
774
775   DALI_TEST_CHECK( tableView.GetRows() == 11 );
776
777   END_TEST;
778 }
779
780 int UtcDaliTableViewDeleteRowAtZero(void)
781 {
782   ToolkitTestApplication application;
783
784   TableView tableView = TableView::New(10,10);
785   DALI_TEST_CHECK( tableView.AddChild( Actor::New(), TableView::CellPosition( 0, 0 , 10, 10 ) ) );
786   tableView.DeleteRow(0);
787
788   DALI_TEST_CHECK( tableView.GetRows() == 9 );
789
790   END_TEST;
791 }
792
793 int UtcDaliTableViewInsertColumnAtZero(void)
794 {
795   ToolkitTestApplication application;
796
797   TableView tableView = TableView::New(10,10);
798   DALI_TEST_CHECK( tableView.AddChild( Actor::New(), TableView::CellPosition( 0, 0 , 10, 10 ) ) );
799   tableView.InsertColumn(0);
800
801   DALI_TEST_CHECK( tableView.GetColumns() == 11 );
802
803   END_TEST;
804 }
805
806 int UtcDaliTableViewDeleteColumnAtZero(void)
807 {
808   ToolkitTestApplication application;
809
810   TableView tableView = TableView::New(10,10);
811   DALI_TEST_CHECK( tableView.AddChild( Actor::New(), TableView::CellPosition( 0, 0 , 10, 10 ) ) );
812   tableView.DeleteColumn(0);
813
814   DALI_TEST_CHECK( tableView.GetColumns() == 9 );
815
816   END_TEST;
817 }
818
819 int UtcDaliTableViewTypeRegistry(void)
820 {
821   ToolkitTestApplication application;
822
823   TypeRegistry typeRegistry = TypeRegistry::Get();
824   DALI_TEST_CHECK( typeRegistry );
825
826   TypeInfo typeInfo = typeRegistry.GetTypeInfo( "TableView" );
827   DALI_TEST_CHECK( typeInfo );
828
829   BaseHandle handle = typeInfo.CreateInstance();
830   DALI_TEST_CHECK( handle );
831
832   TableView view = TableView::DownCast( handle );
833   DALI_TEST_CHECK( view );
834
835   END_TEST;
836 }
837
838 int UtcDaliTableViewKeyboardFocus(void)
839 {
840   ToolkitTestApplication application;
841
842   TableView tableView = TableView::New(4,4);
843   tableView.SetKeyboardFocusable( true );
844   tableView.SetName( "TableView");
845
846   for ( int row = 0; row < 4; ++row )
847   {
848     for ( int col = 0; col < 4; ++col )
849     {
850       Control control = Control::New();
851       std::ostringstream str;
852       str << row << "-" << col;
853       control.SetName( str.str() );
854       control.SetKeyboardFocusable( true );
855       tableView.AddChild( control, TableView::CellPosition( row, col ) );
856     }
857   }
858
859   Stage::GetCurrent().Add( tableView );
860
861   application.SendNotification();
862   application.Render();
863
864   Actor firstFocusActor = Toolkit::Internal::GetImplementation( tableView ).GetNextKeyboardFocusableActor( Actor(), Control::KeyboardFocus::RIGHT, true );
865   DALI_TEST_CHECK( firstFocusActor );
866   DALI_TEST_CHECK( firstFocusActor.GetName() == "0-0" );
867
868   KeyboardFocusManager manager = KeyboardFocusManager::Get();
869   manager.SetFocusGroupLoop( true );
870   manager.SetCurrentFocusActor( firstFocusActor );
871
872   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-0" );
873   manager.MoveFocus( Control::KeyboardFocus::RIGHT );
874   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-1" );
875   manager.MoveFocus( Control::KeyboardFocus::RIGHT );
876   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-2" );
877   manager.MoveFocus( Control::KeyboardFocus::RIGHT );
878   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-3" );
879   manager.MoveFocus( Control::KeyboardFocus::RIGHT );
880   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-0" );
881
882   manager.MoveFocus( Control::KeyboardFocus::LEFT );
883   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-3" );
884   manager.MoveFocus( Control::KeyboardFocus::LEFT );
885   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-2" );
886   manager.MoveFocus( Control::KeyboardFocus::LEFT );
887   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-1" );
888   manager.MoveFocus( Control::KeyboardFocus::LEFT );
889   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-0" );
890   manager.MoveFocus( Control::KeyboardFocus::LEFT );
891   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "3-3" );
892
893   manager.MoveFocus( Control::KeyboardFocus::RIGHT );
894   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-0" );
895   manager.MoveFocus( Control::KeyboardFocus::RIGHT );
896   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-1" );
897
898   manager.MoveFocus( Control::KeyboardFocus::DOWN );
899   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-1" );
900   manager.MoveFocus( Control::KeyboardFocus::DOWN );
901   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "2-1" );
902   manager.MoveFocus( Control::KeyboardFocus::DOWN );
903   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "3-1" );
904   manager.MoveFocus( Control::KeyboardFocus::DOWN );
905   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-1" );
906
907   manager.MoveFocus( Control::KeyboardFocus::UP );
908   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "3-1" );
909   manager.MoveFocus( Control::KeyboardFocus::UP );
910   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "2-1" );
911   manager.MoveFocus( Control::KeyboardFocus::UP );
912   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-1" );
913   manager.MoveFocus( Control::KeyboardFocus::UP );
914   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-1" );
915
916   END_TEST;
917 }
918
919 int UtcDaliTableViewKeyboardFocusInNestedTableView(void)
920 {
921   ToolkitTestApplication application;
922
923   TableView tableView = TableView::New(3, 3);
924   tableView.SetKeyboardFocusable( true );
925   tableView.SetName( "TableView");
926
927   for ( int row = 0; row < 3; ++row )
928   {
929     for ( int col = 0; col < 3; ++col )
930     {
931       std::ostringstream str;
932       str << row << "-" << col;
933
934       if (row == 1 && col ==1)
935       {
936         // Add a nested 2x2 table view in the middle cell of the parent table view
937         TableView childTableView = TableView::New(2, 2);
938         childTableView.SetName( str.str() );
939
940         for(int childRow = 0; childRow < 2; childRow++)
941         {
942           for(int childCol = 0; childCol < 2; childCol++)
943           {
944             Control control = Control::New();
945             std::ostringstream nameStr;
946             nameStr << row << "-" << col << "-" << childRow << "-" << childCol;
947             control.SetName( nameStr.str() );
948             control.SetKeyboardFocusable( true );
949             childTableView.AddChild( control, TableView::CellPosition( childRow, childCol ) );
950           }
951         }
952         tableView.AddChild( childTableView, TableView::CellPosition( row, col ) );
953       }
954       else
955       {
956         Control control = Control::New();
957         control.SetName( str.str() );
958         control.SetKeyboardFocusable( true );
959         tableView.AddChild( control, TableView::CellPosition( row, col ) );
960       }
961     }
962   }
963
964   Stage::GetCurrent().Add( tableView );
965
966   application.SendNotification();
967   application.Render();
968
969   Actor firstFocusActor = Toolkit::Internal::GetImplementation( tableView ).GetNextKeyboardFocusableActor( Actor(), Control::KeyboardFocus::RIGHT, true );
970   DALI_TEST_CHECK( firstFocusActor );
971   DALI_TEST_CHECK( firstFocusActor.GetName() == "0-0" );
972
973   KeyboardFocusManager manager = KeyboardFocusManager::Get();
974   manager.SetFocusGroupLoop( false );
975   manager.SetCurrentFocusActor( firstFocusActor );
976
977   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-0" );
978   manager.MoveFocus( Control::KeyboardFocus::RIGHT );
979   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-1" );
980   manager.MoveFocus( Control::KeyboardFocus::RIGHT );
981   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-2" );
982   manager.MoveFocus( Control::KeyboardFocus::RIGHT );
983   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-0" );
984   manager.MoveFocus( Control::KeyboardFocus::RIGHT );
985   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-1-0-0" );
986   manager.MoveFocus( Control::KeyboardFocus::RIGHT );
987   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-1-0-1" );
988   manager.MoveFocus( Control::KeyboardFocus::RIGHT );
989   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-1-1-0" );
990   manager.MoveFocus( Control::KeyboardFocus::RIGHT );
991   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-1-1-1" );
992   manager.MoveFocus( Control::KeyboardFocus::RIGHT );
993   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-2" );
994   manager.MoveFocus( Control::KeyboardFocus::RIGHT );
995   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "2-0" );
996   manager.MoveFocus( Control::KeyboardFocus::RIGHT );
997   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "2-1" );
998   manager.MoveFocus( Control::KeyboardFocus::RIGHT );
999   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "2-2" );
1000
1001   manager.MoveFocus( Control::KeyboardFocus::LEFT );
1002   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "2-1" );
1003   manager.MoveFocus( Control::KeyboardFocus::LEFT );
1004   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "2-0" );
1005   manager.MoveFocus( Control::KeyboardFocus::LEFT );
1006   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-2" );
1007   manager.MoveFocus( Control::KeyboardFocus::LEFT );
1008   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-1-1-1" );
1009   manager.MoveFocus( Control::KeyboardFocus::LEFT );
1010   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-1-1-0" );
1011   manager.MoveFocus( Control::KeyboardFocus::LEFT );
1012   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-1-0-1" );
1013   manager.MoveFocus( Control::KeyboardFocus::LEFT );
1014   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-1-0-0" );
1015   manager.MoveFocus( Control::KeyboardFocus::LEFT );
1016   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-0" );
1017   manager.MoveFocus( Control::KeyboardFocus::LEFT );
1018   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-2" );
1019   manager.MoveFocus( Control::KeyboardFocus::LEFT );
1020   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-1" );
1021   manager.MoveFocus( Control::KeyboardFocus::LEFT );
1022   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-0" );
1023
1024   manager.MoveFocus( Control::KeyboardFocus::RIGHT );
1025   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-1" );
1026   manager.MoveFocus( Control::KeyboardFocus::DOWN );
1027   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-1-0-0" );
1028   manager.MoveFocus( Control::KeyboardFocus::DOWN );
1029   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-1-1-0" );
1030   manager.MoveFocus( Control::KeyboardFocus::DOWN );
1031   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "2-1" );
1032
1033   manager.MoveFocus( Control::KeyboardFocus::UP );
1034   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-1-1-1" );
1035   manager.MoveFocus( Control::KeyboardFocus::UP );
1036   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-1-0-1" );
1037   manager.MoveFocus( Control::KeyboardFocus::UP );
1038   DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-1" );
1039
1040   END_TEST;
1041 }