2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 #include <dali-toolkit-test-suite-utils.h>
22 #include <dali-toolkit/dali-toolkit.h>
23 #include <dali-toolkit/devel-api/controls/table-view/table-view.h>
26 using namespace Toolkit;
28 void dali_tableview_startup(void)
30 test_return_value = TET_UNDEF;
33 void dali_tableview_cleanup(void)
35 test_return_value = TET_PASS;
41 const char* const PROPERTY_NAME_ROWS = "rows";
42 const char* const PROPERTY_NAME_COLUMNS = "columns";
43 const char* const PROPERTY_NAME_CELL_PADDING = "cellPadding";
44 const char* const PROPERTY_NAME_LAYOUT_ROWS = "layoutRows";
45 const char* const PROPERTY_NAME_LAYOUT_COLUMNS = "layoutColumns";
46 const Vector2 CELL_SIZE( 10, 10 );
48 static bool gObjectCreatedCallBackCalled;
50 static void TestCallback(BaseHandle handle)
52 gObjectCreatedCallBackCalled = true;
62 * function operator to apply the parent size
64 void operator()( Dali::Vector3& current, const PropertyInputContainer& /* inputs */ )
66 current.x = current.y = current.z = 100.0f;
70 // Convenience function to quickly set up a 10x10 table with each cell being 10x10 pixels in size by default.
71 static void SetupTableViewAndActors(Integration::Scene scene, TableView& tableView, Actor& actor1, Actor& actor2, Actor& actor3)
73 tableView = TableView::New( 10, 10 ); // 10 by 10 grid.
74 DALI_TEST_CHECK( tableView );
76 scene.Add( tableView );
77 tableView.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
79 actor1 = Actor::New();
80 actor2 = Actor::New();
81 actor3 = Actor::New();
83 actor1.SetProperty( Actor::Property::SIZE, CELL_SIZE );
84 actor2.SetProperty( Actor::Property::SIZE, CELL_SIZE );
85 actor3.SetProperty( Actor::Property::SIZE, CELL_SIZE );
87 tableView.AddChild( actor1, TableView::CellPosition( 0, 0 ) );
88 tableView.AddChild( actor2, TableView::CellPosition( 0, 1 ) );
89 tableView.AddChild( actor3, TableView::CellPosition( 1, 0 ) );
94 int UtcDaliTableViewCtorCopyP(void)
96 TestApplication application;
98 TableView actor1 = TableView::New(10,10);
99 TableView actor2( actor1 );
101 DALI_TEST_EQUALS( actor1, actor2, TEST_LOCATION );
105 int UtcDaliTableViewNew(void)
107 ToolkitTestApplication application;
109 TableView tableView = TableView::New(10,10);
110 DALI_TEST_CHECK(tableView);
112 //Additional check to ensure object is created by checking if it's registered
113 ObjectRegistry registry = application.GetCore().GetObjectRegistry();
114 DALI_TEST_CHECK( registry );
116 gObjectCreatedCallBackCalled = false;
117 registry.ObjectCreatedSignal().Connect(&TestCallback);
119 TableView tableView = TableView::New(10,10);
121 DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
125 // Test adjusting the metric values for the cell.
126 int UtcDaliTableViewMetricsPadding(void)
128 ToolkitTestApplication application;
130 tet_infoline("UtcDaliTableViewMetricsPadding");
137 SetupTableViewAndActors(application.GetScene(), tableView, actor1, actor2, actor3);
139 // 1. check that padding works. no padding:
140 tableView.SetCellPadding(Size(0.0f, 0.0f));
141 application.SendNotification();
142 application.Render();
144 DALI_TEST_EQUALS( tableView.GetCellPadding(), Size(0.0f, 0.0f), TEST_LOCATION );
145 DALI_TEST_EQUALS( actor1.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
146 DALI_TEST_EQUALS( actor2.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION );
147 DALI_TEST_EQUALS( actor3.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION );
149 // 1. check that padding works. some padding:
150 tableView.SetCellPadding(Size(5.0f, 10.0f));
151 application.SendNotification();
152 application.Render();
154 DALI_TEST_EQUALS( tableView.GetCellPadding(), Size(5.0f, 10.0f), TEST_LOCATION );
155 DALI_TEST_EQUALS( actor1.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(5.0f, 10.0f, 0.0f), TEST_LOCATION );
159 // Test adjusting the metric values for the cell.
160 int UtcDaliTableViewMetricsFit(void)
162 ToolkitTestApplication application;
164 tet_infoline("UtcDaliTableViewMetricsFit");
171 SetupTableViewAndActors(application.GetScene(), tableView, actor1, actor2, actor3);
172 application.SendNotification();
173 application.Render();
175 // 1. check that with no fixed width/heights, actors are in default position.
176 DALI_TEST_EQUALS( actor1.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
177 DALI_TEST_EQUALS( actor2.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION );
178 DALI_TEST_EQUALS( actor3.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION );
180 // 2. check that with a fixed width & height, actors to the right and below are offsetted.
181 tableView.SetFitHeight(0);
182 tableView.SetFitWidth(0);
183 DALI_TEST_EQUALS( tableView.IsFitHeight(0), true, TEST_LOCATION );
184 DALI_TEST_EQUALS( tableView.IsFitWidth(0), true, TEST_LOCATION );
186 application.SendNotification();
187 application.Render();
189 DALI_TEST_EQUALS( actor1.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
190 DALI_TEST_EQUALS( actor2.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION );
191 DALI_TEST_EQUALS( actor3.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION );
193 tableView.SetProperty( Dali::Actor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::RIGHT_TO_LEFT );
194 application.SendNotification();
195 application.Render();
197 DALI_TEST_EQUALS( actor1.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(90.0f, 0.0f, 0.0f), TEST_LOCATION );
198 DALI_TEST_EQUALS( actor2.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(80.0f, 0.0f, 0.0f), TEST_LOCATION );
199 DALI_TEST_EQUALS( actor3.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(90.0f, 10.0f, 0.0f), TEST_LOCATION );
201 tableView.SetProperty( Dali::Actor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::LEFT_TO_RIGHT );
202 application.SendNotification();
203 application.Render();
205 DALI_TEST_EQUALS( actor1.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
206 DALI_TEST_EQUALS( actor2.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION );
207 DALI_TEST_EQUALS( actor3.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION );
212 // Test adjusting the metric values for the cell.
213 int UtcDaliTableViewMetricsFixed(void)
215 ToolkitTestApplication application;
217 tet_infoline("UtcDaliTableViewMetricsFixed");
224 SetupTableViewAndActors(application.GetScene(), tableView, actor1, actor2, actor3);
225 application.SendNotification();
226 application.Render();
228 // 1. check that with no fixed width/heights, actors are in default position.
229 DALI_TEST_EQUALS( actor1.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
230 DALI_TEST_EQUALS( actor2.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION );
231 DALI_TEST_EQUALS( actor3.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION );
233 // 2. check that with a fixed width & height, actors to the right and below are offsetted.
234 tableView.SetFixedWidth(0, 20.0f);
235 tableView.SetFixedHeight(0, 50.0f);
236 DALI_TEST_EQUALS( tableView.GetFixedWidth(0), 20.0f, TEST_LOCATION );
237 DALI_TEST_EQUALS( tableView.GetFixedHeight(0), 50.0f, TEST_LOCATION );
239 application.SendNotification();
240 application.Render();
242 DALI_TEST_EQUALS( actor1.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
243 DALI_TEST_EQUALS( actor2.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(20.0f, 0.0f, 0.0f), TEST_LOCATION );
244 DALI_TEST_EQUALS( actor3.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 50.0f, 0.0f), TEST_LOCATION );
248 // Test adjusting the metric values for the cell.
249 int UtcDaliTableViewMetricsRelative(void)
251 ToolkitTestApplication application;
253 tet_infoline("UtcDaliTableViewMetricsRelative");
260 SetupTableViewAndActors(application.GetScene(), tableView, actor1, actor2, actor3);
261 application.SendNotification();
262 application.Render();
264 // 1. check that with no relative width/heights, actors are in default position.
265 DALI_TEST_EQUALS( actor1.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
266 DALI_TEST_EQUALS( actor2.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION );
267 DALI_TEST_EQUALS( actor3.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION );
269 // 2. check that with a relative width & height, actors to the right and below are offsetted.
270 tableView.SetRelativeWidth(0, 0.3f); // cell 0,0 occupies 30%x50% of the grid (i.e. 30x50 pixels)
271 tableView.SetRelativeHeight(0, 0.5f);
272 DALI_TEST_EQUALS( tableView.GetRelativeWidth(0), 0.3f, TEST_LOCATION );
273 DALI_TEST_EQUALS( tableView.GetRelativeHeight(0), 0.5f, TEST_LOCATION );
275 application.SendNotification();
276 application.Render();
278 DALI_TEST_EQUALS( actor1.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
279 DALI_TEST_EQUALS( actor2.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(30.0f, 0.0f, 0.0f), TEST_LOCATION );
280 DALI_TEST_EQUALS( actor3.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 50.0f, 0.0f), TEST_LOCATION );
285 // Test Adding/Removing/Finding Children.
286 int UtcDaliTableViewChild(void)
288 ToolkitTestApplication application;
290 tet_infoline("UtcDaliTableViewChild");
292 // Create a 10x10 table-view
293 TableView tableView = TableView::New(10,10);
294 DALI_TEST_CHECK( tableView );
296 // Check if actor doesn't exist.
297 DALI_TEST_CHECK( !tableView.GetChildAt(TableView::CellPosition(0,0)) );
299 // Add an actor to it at 0,0
300 Actor actor = Actor::New();
301 tableView.AddChild(actor, TableView::CellPosition());
304 DALI_TEST_CHECK( tableView.GetChildAt(TableView::CellPosition(0,0)) );
307 tableView.RemoveChildAt(TableView::CellPosition());
309 // Check if actor no longer exists.
310 DALI_TEST_CHECK( !tableView.GetChildAt(TableView::CellPosition(0,0)) );
312 // Add actor to it again, but at 2,5
313 tableView.AddChild(actor, TableView::CellPosition(2,5));
315 // Add another actor somewhere else 7,8
316 Actor actor2 = Actor::New();
317 tableView.AddChild(actor2, TableView::CellPosition(7,8));
321 // Check that no actor exists in a few random places.
322 DALI_TEST_CHECK( !tableView.GetChildAt(TableView::CellPosition(0,0)) );
323 DALI_TEST_CHECK( !tableView.GetChildAt(TableView::CellPosition(2,1)) );
324 DALI_TEST_CHECK( !tableView.GetChildAt(TableView::CellPosition(6,3)) );
325 DALI_TEST_CHECK( !tableView.GetChildAt(TableView::CellPosition(9,5)) );
327 // Check for actors at actual positions.
328 searchActor = tableView.GetChildAt(TableView::CellPosition(2,5));
329 DALI_TEST_CHECK( searchActor == actor);
331 searchActor = tableView.GetChildAt(TableView::CellPosition(7,8));
332 DALI_TEST_CHECK( searchActor == actor2);
334 // Create a second table, and add already added Child to new one.
335 TableView tableView2 = TableView::New(5,5);
336 tableView2.AddChild(actor, TableView::CellPosition(2,2));
337 DALI_TEST_CHECK( tableView2.GetChildAt(TableView::CellPosition(2,2)) );
341 // Test calling Add on it's own (to invoke the OnChildAdd)
342 int UtcDaliTableViewAdd(void)
344 ToolkitTestApplication application;
346 tet_infoline("UtcDaliTableViewAdd");
348 // Create a 4x1 table-view, and just keep adding.
349 TableView tableView = TableView::New(1,4);
350 DALI_TEST_CHECK( tableView );
352 for(unsigned int i = 0;i<16;i++)
354 Actor currentActor = Actor::New();
355 TableView::CellPosition position = TableView::CellPosition();
356 tableView.Add( currentActor );
357 tableView.FindChildPosition(currentActor, position);
358 tet_printf("%dx%d (%d,%d)\n", tableView.GetColumns(), tableView.GetRows(), position.columnIndex, position.rowIndex);
360 DALI_TEST_EQUALS((position.rowIndex * 4 + position.columnIndex), i, TEST_LOCATION);
365 // Test cell modification.
366 int UtcDaliTableViewCells(void)
368 ToolkitTestApplication application;
369 tet_infoline("UtcDaliTableViewCells");
371 // Create a 10x10 table-view
372 TableView tableView = TableView::New(10,10);
373 DALI_TEST_CHECK( tableView );
375 // Add a few actors to the table.
376 Actor actor1 = Actor::New();
377 Actor actor2 = Actor::New();
378 Actor actor3 = Actor::New();
379 actor1.SetProperty( Dali::Actor::Property::NAME,"Actor1");
380 actor2.SetProperty( Dali::Actor::Property::NAME,"Actor2");
381 actor3.SetProperty( Dali::Actor::Property::NAME,"Actor3");
383 // note: positions are specified in reversed cartesian coords - row,col (i.e. y,x)
384 tableView.AddChild(actor1, TableView::CellPosition(0,0));
385 tableView.AddChild(actor2, TableView::CellPosition(5,5));
386 tableView.AddChild(actor3, TableView::CellPosition(7,2));
388 DALI_TEST_CHECK( tableView.GetRows() == 10 && tableView.GetColumns() == 10 );
390 // Add a row between actor1 and actor2 | insert column on actor1 and see what happens...
391 tableView.InsertRow(3);
392 tableView.InsertColumn(0);
393 DALI_TEST_CHECK( tableView.GetRows() == 11 && tableView.GetColumns() == 11 );
395 TableView::CellPosition cellPosition;
398 result = tableView.FindChildPosition(actor1, cellPosition);
399 DALI_TEST_CHECK( result && cellPosition.rowIndex == 0 && cellPosition.columnIndex == 1);
400 result = tableView.FindChildPosition(actor2, cellPosition);
401 DALI_TEST_CHECK( result && cellPosition.rowIndex == 6 && cellPosition.columnIndex == 6);
402 result = tableView.FindChildPosition(actor3, cellPosition);
403 DALI_TEST_CHECK( result && cellPosition.rowIndex == 8 && cellPosition.columnIndex == 3);
405 // Delete a row between actor2 and actor3 | delete column on actor2 and see what happens...
406 tableView.DeleteRow(7);
407 tableView.DeleteColumn(6);
408 DALI_TEST_CHECK( tableView.GetRows() == 10 && tableView.GetColumns() == 10 );
410 result = tableView.FindChildPosition(actor1, cellPosition);
411 DALI_TEST_CHECK( result && cellPosition.rowIndex == 0 && cellPosition.columnIndex == 1);
412 result = tableView.FindChildPosition(actor2, cellPosition);
413 DALI_TEST_CHECK( !result );
414 result = tableView.FindChildPosition(actor3, cellPosition);
415 DALI_TEST_CHECK( result && cellPosition.rowIndex == 7 && cellPosition.columnIndex == 3);
417 // Delete the other two remaining actors by a row delete and a column delete.
418 std::vector<Actor> actorsRemoved;
419 tableView.DeleteRow(0, actorsRemoved);
420 tet_printf("Row Delete >> Actors Removed: %d {", actorsRemoved.size());
421 for(size_t i = 0;i<actorsRemoved.size();i++) tet_printf("%d => %s, ", i, actorsRemoved[i].GetProperty< std::string >( Dali::Actor::Property::NAME ).c_str());
423 DALI_TEST_EQUALS( static_cast<int>(actorsRemoved.size()), 1, TEST_LOCATION );
424 DALI_TEST_CHECK( actorsRemoved[0] == actor1 );
426 actorsRemoved.clear();
427 tableView.DeleteColumn(3, actorsRemoved);
428 tet_printf("Column Delete >> Actors Removed: %d {", actorsRemoved.size());
429 for(size_t i = 0;i<actorsRemoved.size();i++) tet_printf("%d => %s, ", i, actorsRemoved[i].GetProperty< std::string >( Dali::Actor::Property::NAME ).c_str());
431 DALI_TEST_EQUALS( static_cast<int>(actorsRemoved.size()), 1, TEST_LOCATION );
432 DALI_TEST_CHECK( actorsRemoved[0] == actor3 );
434 DALI_TEST_CHECK( tableView.GetRows() == 9 && tableView.GetColumns() == 9 );
436 tableView.AddChild(actor1, TableView::CellPosition(5,8));
437 tableView.Resize(100,100);
438 DALI_TEST_CHECK( tableView.GetRows() == 100 && tableView.GetColumns() == 100 );
440 tableView.AddChild(actor2, TableView::CellPosition(69,57));
441 DALI_TEST_CHECK( tableView.FindChildPosition(actor1, cellPosition) && tableView.FindChildPosition(actor2, cellPosition) );
443 tableView.Resize(20,20);
444 DALI_TEST_CHECK( tableView.FindChildPosition(actor1, cellPosition) && !tableView.FindChildPosition(actor2, cellPosition) );
446 actorsRemoved.clear();
447 tableView.Resize(1,1, actorsRemoved);
448 DALI_TEST_CHECK( !tableView.FindChildPosition(actor1, cellPosition) && !tableView.FindChildPosition(actor2, cellPosition) );
449 DALI_TEST_EQUALS( static_cast<int>(actorsRemoved.size()), 1, TEST_LOCATION );
450 DALI_TEST_CHECK( actorsRemoved[0] == actor1 );
452 // Add child outside table size, forcing a resize.
453 tableView.AddChild(actor1, TableView::CellPosition(100, 100, 1, 1));
454 DALI_TEST_CHECK( tableView.GetRows() == 101 && tableView.GetColumns() == 101 );
456 // Add child outside table size, forcing a resize.
457 tableView.AddChild(actor1, TableView::CellPosition(110, 110, 5, 5));
458 DALI_TEST_CHECK( tableView.GetRows() == 115 && tableView.GetColumns() == 115 );
460 // Set the alignment of the cell
461 tableView.SetCellAlignment( TableView::CellPosition(100, 100, 1, 1), HorizontalAlignment::CENTER, VerticalAlignment::CENTER );
462 tableView.SetCellAlignment( TableView::CellPosition(110, 110, 5, 5), HorizontalAlignment::LEFT, VerticalAlignment::TOP );
464 DALI_TEST_CHECK( true );
468 int UtcDaliTableViewChildAssert(void)
470 ToolkitTestApplication application;
471 tet_infoline("UtcDaliTableViewChildAssert");
473 // Create a 10x10 table-view
474 TableView tableView = TableView::New(10,10);
475 DALI_TEST_CHECK( tableView );
480 tableView.AddChild( childActor, TableView::CellPosition(0,0,5,5) );
482 tet_result(TET_FAIL);
484 catch( Dali::DaliException& e )
486 DALI_TEST_PRINT_ASSERT( e );
487 DALI_TEST_EQUALS(e.condition, "child", TEST_LOCATION);
492 int UtcDaliTableViewMetricsAssert(void)
494 ToolkitTestApplication application;
495 tet_infoline("UtcDaliTableViewChildAssert");
497 // Create a 10x10 table-view
498 TableView tableView = TableView::New(10,10);
499 DALI_TEST_CHECK( tableView );
505 tableView.SetFixedHeight( 10, 1.0f );
507 tet_result(TET_FAIL);
509 catch( Dali::DaliException& e )
511 DALI_TEST_PRINT_ASSERT( e );
512 DALI_TEST_EQUALS(e.condition, "rowIndex < mRowData.Size()", TEST_LOCATION);
517 tableView.GetFixedHeight( 10 );
519 tet_result(TET_FAIL);
521 catch( Dali::DaliException& e )
523 DALI_TEST_PRINT_ASSERT( e );
524 DALI_TEST_EQUALS(e.condition, "rowIndex < mRowData.Size()", TEST_LOCATION);
529 tableView.SetFixedWidth( 10, 1.0f );
531 tet_result(TET_FAIL);
533 catch( Dali::DaliException& e )
535 DALI_TEST_PRINT_ASSERT( e );
536 DALI_TEST_EQUALS(e.condition, "columnIndex < mColumnData.Size()", TEST_LOCATION);
541 tableView.GetFixedWidth( 10 );
543 tet_result(TET_FAIL);
545 catch( Dali::DaliException& e )
547 DALI_TEST_PRINT_ASSERT( e );
548 DALI_TEST_EQUALS(e.condition, "columnIndex < mColumnData.Size()", TEST_LOCATION);
555 tableView.SetRelativeHeight( 10, 0.1f );
557 tet_result(TET_FAIL);
559 catch( Dali::DaliException& e )
561 DALI_TEST_PRINT_ASSERT( e );
562 DALI_TEST_EQUALS(e.condition, "rowIndex < mRowData.Size()", TEST_LOCATION);
567 tableView.GetRelativeHeight( 10 );
569 tet_result(TET_FAIL);
571 catch( Dali::DaliException& e )
573 DALI_TEST_PRINT_ASSERT( e );
574 DALI_TEST_EQUALS(e.condition, "rowIndex < mRowData.Size()", TEST_LOCATION);
579 tableView.SetRelativeWidth( 10, 0.1f );
581 tet_result(TET_FAIL);
583 catch( Dali::DaliException& e )
585 DALI_TEST_PRINT_ASSERT( e );
586 DALI_TEST_EQUALS(e.condition, "columnIndex < mColumnData.Size()", TEST_LOCATION);
591 tableView.GetRelativeWidth( 10 );
593 tet_result(TET_FAIL);
595 catch( Dali::DaliException& e )
597 DALI_TEST_PRINT_ASSERT( e );
598 DALI_TEST_EQUALS(e.condition, "columnIndex < mColumnData.Size()", TEST_LOCATION);
603 int UtcDaliTableViewSetGetProperty(void)
605 ToolkitTestApplication application;
606 tet_infoline("UtcDaliTableViewSetGetProperty");
608 // Create a 1x1 table-view
609 TableView tableView = TableView::New(1,1);
610 tableView.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
611 DALI_TEST_CHECK( tableView );
613 // Test "rows" property
614 DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_ROWS ) == TableView::Property::ROWS );
616 tableView.SetProperty( TableView::Property::ROWS, 4 );
618 DALI_TEST_CHECK( tableView.GetRows() == 4u );
619 DALI_TEST_CHECK( tableView.GetProperty(TableView::Property::ROWS).Get<int>() == 4 );
621 // Test "columns" property
622 DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_COLUMNS ) == TableView::Property::COLUMNS );
624 tableView.SetProperty( TableView::Property::COLUMNS, 5 );
626 DALI_TEST_CHECK( tableView.GetColumns() == 5u );
627 DALI_TEST_CHECK( tableView.GetProperty(TableView::Property::COLUMNS).Get<int>() == 5 );
629 // Test "cellPadding" property
630 DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_CELL_PADDING ) == TableView::Property::CELL_PADDING );
632 tableView.SetProperty( TableView::Property::CELL_PADDING, Size( 6.f, 8.f ) );
634 DALI_TEST_EQUALS( tableView.GetCellPadding(), Size(6.f, 8.f), TEST_LOCATION );
635 DALI_TEST_EQUALS( tableView.GetProperty(TableView::Property::CELL_PADDING).Get<Vector2>(), Vector2(6.f,8.f), TEST_LOCATION );
637 //{ "policy": "fixed", "value": 30.0 },
639 item1[ "policy" ] = "fixed";
640 item1[ "value" ] = 30.f;
641 //{ "policy": "relative", "value": 0.2 },
643 item2[ "policy" ] = "relative";
644 item2[ "value" ] = 0.2f;
646 // Test "layoutRows" property
647 DALI_TEST_CHECK( tableView.GetPropertyIndex(PROPERTY_NAME_LAYOUT_ROWS) == TableView::Property::LAYOUT_ROWS );
652 * "1": { "policy": "fixed", "value": 30 },
653 * "3": { "policy": "relative", "value": 0.2 }
656 Property::Map layoutRows;
657 layoutRows[ "1" ] = item1;
658 layoutRows[ "3" ] = item2;
659 tableView.SetProperty( TableView::Property::LAYOUT_ROWS, layoutRows );
661 DALI_TEST_EQUALS( tableView.GetFixedHeight( 1u ), 30.f, TEST_LOCATION );
662 DALI_TEST_EQUALS( tableView.GetRelativeHeight( 3u ), 0.2f, TEST_LOCATION );
664 Property::Map layoutRowsGet = tableView.GetProperty(TableView::Property::LAYOUT_ROWS).Get<Property::Map>();
666 DALI_TEST_EQUALS( layoutRowsGet.GetKey(1).compare(layoutRows.GetKey(0)), 0, TEST_LOCATION );
667 Property::Map* childMap =layoutRowsGet.GetValue(1).GetMap();
668 DALI_TEST_CHECK( childMap->Find( "policy" )->Get<std::string>().compare("fixed") == 0 );
669 DALI_TEST_EQUALS( childMap->Find( "value" )->Get<float>(), 30.f, TEST_LOCATION );
671 childMap =layoutRowsGet.GetValue(3).GetMap();
672 DALI_TEST_CHECK( layoutRowsGet.GetKey(3).compare(layoutRows.GetKey(1)) == 0 );
673 DALI_TEST_CHECK( childMap->Find( "policy" )->Get<std::string>().compare("relative") == 0 );
674 DALI_TEST_EQUALS( childMap->Find( "value" )->Get<float>(), 0.2f, TEST_LOCATION );
676 // Test "layoutColumns" property
677 DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_LAYOUT_COLUMNS ) == TableView::Property::LAYOUT_COLUMNS );
682 * "2": { "policy": "relative", "value": 0.2 },
683 * "3": { "policy": "fixed", "value": 30 }
686 Property::Map layoutColumns;
687 layoutColumns[ "2" ] = item2;
688 layoutColumns[ "3" ] = item1;
689 tableView.SetProperty( TableView::Property::LAYOUT_COLUMNS, layoutColumns );
691 DALI_TEST_EQUALS( tableView.GetRelativeWidth( 2u ), 0.2f, TEST_LOCATION );
692 DALI_TEST_EQUALS( tableView.GetFixedWidth( 3u ), 30.f, TEST_LOCATION );
694 Property::Map layoutColumnsGet = tableView.GetProperty(TableView::Property::LAYOUT_COLUMNS).Get<Property::Map>();
695 DALI_TEST_CHECK( layoutColumnsGet.GetKey(2).compare(layoutColumns.GetKey(0)) == 0 );
696 childMap =layoutColumnsGet.GetValue(2).GetMap();
697 DALI_TEST_CHECK( childMap->Find( "policy" )->Get<std::string>().compare("relative") == 0 );
698 DALI_TEST_EQUALS( childMap->Find( "value" )->Get<float>(), 0.2f, TEST_LOCATION );
699 childMap =layoutColumnsGet.GetValue(3).GetMap();
700 DALI_TEST_CHECK( layoutColumnsGet.GetKey(3).compare(layoutColumns.GetKey(1)) == 0 );
701 DALI_TEST_CHECK( childMap->Find( "policy" )->Get<std::string>().compare("fixed") == 0 );
702 DALI_TEST_EQUALS( childMap->Find( "value" )->Get<float>(),30.f, TEST_LOCATION );
707 int UtcDaliTableViewChildProperties(void)
709 ToolkitTestApplication application;
710 tet_infoline("UtcDaliTableViewChildProperties");
712 // Create a 10x10 table-view
713 TableView tableView = TableView::New(10,10);
714 application.GetScene().Add( tableView );
715 tableView.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
717 DALI_TEST_CHECK( tableView );
719 // Create a child actor with the custom properties
720 Actor child1 = Actor::New();
721 child1.SetProperty( TableView::ChildProperty::CELL_INDEX, Vector2( 3, 4 ) );
722 tableView.Add( child1 );
723 // Check for actors at actual positions.
724 DALI_TEST_CHECK( tableView.GetChildAt(TableView::CellPosition(3,4)) == child1);
726 // Create a second child actor with the custom properties
727 Actor child2 = Actor::New();
729 float columnSpan = 2.f;
730 child2.SetProperty( TableView::ChildProperty::CELL_INDEX, Vector2( 6, 1 ) );
731 child2.SetProperty( TableView::ChildProperty::ROW_SPAN, rowSpan );
732 child2.SetProperty( TableView::ChildProperty::COLUMN_SPAN, columnSpan );
733 tableView.Add( child2 );
734 // Check for actors at actual positions.
735 for( int i=0; i<rowSpan; i++ )
737 for(int j=0; j<columnSpan; j++)
739 DALI_TEST_CHECK( tableView.GetChildAt(TableView::CellPosition(6+i,1+j)) == child2);
743 // Create a third child actor with the cell alignment properties
744 Actor child3 = Actor::New();
745 child3.SetProperty( Actor::Property::SIZE, Vector2( 5.f, 5.f ) );
746 child3.SetProperty( TableView::ChildProperty::CELL_HORIZONTAL_ALIGNMENT, "center" );
747 child3.SetProperty( TableView::ChildProperty::CELL_VERTICAL_ALIGNMENT, "bottom" );
748 tableView.Add( child3 );
750 // store the actor in the first available cell
751 DALI_TEST_CHECK( tableView.GetChildAt(TableView::CellPosition(0,0)) == child3)
752 application.SendNotification();
753 application.Render();
755 DALI_TEST_EQUALS( child3.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ), AnchorPoint::TOP_LEFT, TEST_LOCATION );
756 DALI_TEST_EQUALS( child3.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ), ParentOrigin::TOP_LEFT, TEST_LOCATION );
757 DALI_TEST_EQUALS( child3.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(2.5f, 5.0f, 0.0f), TEST_LOCATION );
762 int UtcDaliTableViewGetChildAtN(void)
764 ToolkitTestApplication application;
766 TableView tableView = TableView::New(10,10);
768 Actor actor = tableView.GetChildAt( TableView::CellPosition( 200, 200 ) );
769 DALI_TEST_CHECK( !actor );
774 int UtcDaliTableViewAddChildN(void)
776 ToolkitTestApplication application;
778 TableView tableView = TableView::New(10,10);
779 DALI_TEST_CHECK( tableView.AddChild( Actor::New(), TableView::CellPosition( 0, 0 ) ) );
780 DALI_TEST_CHECK( ! tableView.AddChild( Actor::New(), TableView::CellPosition( 0, 0 ) ) );
785 int UtcDaliTableViewInsertRowAtZero(void)
787 ToolkitTestApplication application;
789 TableView tableView = TableView::New(10,10);
790 DALI_TEST_CHECK( tableView.AddChild( Actor::New(), TableView::CellPosition( 0, 0 , 10, 10 ) ) );
791 tableView.InsertRow(0);
793 DALI_TEST_CHECK( tableView.GetRows() == 11 );
798 int UtcDaliTableViewDeleteRowAtZero(void)
800 ToolkitTestApplication application;
802 TableView tableView = TableView::New(10,10);
803 DALI_TEST_CHECK( tableView.AddChild( Actor::New(), TableView::CellPosition( 0, 0 , 10, 10 ) ) );
804 tableView.DeleteRow(0);
806 DALI_TEST_CHECK( tableView.GetRows() == 9 );
811 int UtcDaliTableViewInsertColumnAtZero(void)
813 ToolkitTestApplication application;
815 TableView tableView = TableView::New(10,10);
816 DALI_TEST_CHECK( tableView.AddChild( Actor::New(), TableView::CellPosition( 0, 0 , 10, 10 ) ) );
817 tableView.InsertColumn(0);
819 DALI_TEST_CHECK( tableView.GetColumns() == 11 );
824 int UtcDaliTableViewDeleteColumnAtZero(void)
826 ToolkitTestApplication application;
828 TableView tableView = TableView::New(10,10);
829 DALI_TEST_CHECK( tableView.AddChild( Actor::New(), TableView::CellPosition( 0, 0 , 10, 10 ) ) );
830 tableView.DeleteColumn(0);
832 DALI_TEST_CHECK( tableView.GetColumns() == 9 );
837 int UtcDaliTableViewTypeRegistry(void)
839 ToolkitTestApplication application;
841 TypeRegistry typeRegistry = TypeRegistry::Get();
842 DALI_TEST_CHECK( typeRegistry );
844 TypeInfo typeInfo = typeRegistry.GetTypeInfo( "TableView" );
845 DALI_TEST_CHECK( typeInfo );
847 BaseHandle handle = typeInfo.CreateInstance();
848 DALI_TEST_CHECK( handle );
850 TableView view = TableView::DownCast( handle );
851 DALI_TEST_CHECK( view );
856 int UtcDaliTableViewKeyboardFocus(void)
858 ToolkitTestApplication application;
860 TableView tableView = TableView::New(4,4);
861 tableView.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true );
862 tableView.SetProperty( Dali::Actor::Property::NAME, "TableView");
864 for ( int row = 0; row < 4; ++row )
866 for ( int col = 0; col < 4; ++col )
868 Control control = Control::New();
869 std::ostringstream str;
870 str << row << "-" << col;
871 control.SetProperty( Dali::Actor::Property::NAME, str.str() );
872 control.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true );
873 tableView.AddChild( control, TableView::CellPosition( row, col ) );
877 application.GetScene().Add( tableView );
879 application.SendNotification();
880 application.Render();
882 Actor firstFocusActor = Toolkit::Internal::GetImplementation( tableView ).GetNextKeyboardFocusableActor( Actor(), Control::KeyboardFocus::RIGHT, true );
883 DALI_TEST_CHECK( firstFocusActor );
884 DALI_TEST_CHECK( firstFocusActor.GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-0" );
886 KeyboardFocusManager manager = KeyboardFocusManager::Get();
887 manager.SetFocusGroupLoop( true );
888 manager.SetCurrentFocusActor( firstFocusActor );
890 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-0" );
891 manager.MoveFocus( Control::KeyboardFocus::RIGHT );
892 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-1" );
893 manager.MoveFocus( Control::KeyboardFocus::RIGHT );
894 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-2" );
895 manager.MoveFocus( Control::KeyboardFocus::RIGHT );
896 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-3" );
897 manager.MoveFocus( Control::KeyboardFocus::RIGHT );
898 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-0" );
900 manager.MoveFocus( Control::KeyboardFocus::LEFT );
901 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-3" );
902 manager.MoveFocus( Control::KeyboardFocus::LEFT );
903 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-2" );
904 manager.MoveFocus( Control::KeyboardFocus::LEFT );
905 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-1" );
906 manager.MoveFocus( Control::KeyboardFocus::LEFT );
907 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-0" );
908 manager.MoveFocus( Control::KeyboardFocus::LEFT );
909 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "3-3" );
911 manager.MoveFocus( Control::KeyboardFocus::RIGHT );
912 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-0" );
913 manager.MoveFocus( Control::KeyboardFocus::RIGHT );
914 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-1" );
916 manager.MoveFocus( Control::KeyboardFocus::DOWN );
917 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-1" );
918 manager.MoveFocus( Control::KeyboardFocus::DOWN );
919 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "2-1" );
920 manager.MoveFocus( Control::KeyboardFocus::DOWN );
921 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "3-1" );
922 manager.MoveFocus( Control::KeyboardFocus::DOWN );
923 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-1" );
925 manager.MoveFocus( Control::KeyboardFocus::UP );
926 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "3-1" );
927 manager.MoveFocus( Control::KeyboardFocus::UP );
928 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "2-1" );
929 manager.MoveFocus( Control::KeyboardFocus::UP );
930 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-1" );
931 manager.MoveFocus( Control::KeyboardFocus::UP );
932 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-1" );
937 int UtcDaliTableViewKeyboardFocusInNestedTableView(void)
939 ToolkitTestApplication application;
941 TableView tableView = TableView::New(3, 3);
942 tableView.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true );
943 tableView.SetProperty( Dali::Actor::Property::NAME, "TableView");
945 for ( int row = 0; row < 3; ++row )
947 for ( int col = 0; col < 3; ++col )
949 std::ostringstream str;
950 str << row << "-" << col;
952 if (row == 1 && col ==1)
954 // Add a nested 2x2 table view in the middle cell of the parent table view
955 TableView childTableView = TableView::New(2, 2);
956 childTableView.SetProperty( Dali::Actor::Property::NAME, str.str() );
958 for(int childRow = 0; childRow < 2; childRow++)
960 for(int childCol = 0; childCol < 2; childCol++)
962 Control control = Control::New();
963 std::ostringstream nameStr;
964 nameStr << row << "-" << col << "-" << childRow << "-" << childCol;
965 control.SetProperty( Dali::Actor::Property::NAME, nameStr.str() );
966 control.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true );
967 childTableView.AddChild( control, TableView::CellPosition( childRow, childCol ) );
970 tableView.AddChild( childTableView, TableView::CellPosition( row, col ) );
974 Control control = Control::New();
975 control.SetProperty( Dali::Actor::Property::NAME, str.str() );
976 control.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true );
977 tableView.AddChild( control, TableView::CellPosition( row, col ) );
982 application.GetScene().Add( tableView );
984 application.SendNotification();
985 application.Render();
987 Actor firstFocusActor = Toolkit::Internal::GetImplementation( tableView ).GetNextKeyboardFocusableActor( Actor(), Control::KeyboardFocus::RIGHT, true );
988 DALI_TEST_CHECK( firstFocusActor );
989 DALI_TEST_CHECK( firstFocusActor.GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-0" );
991 KeyboardFocusManager manager = KeyboardFocusManager::Get();
992 manager.SetFocusGroupLoop( false );
993 manager.SetCurrentFocusActor( firstFocusActor );
995 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-0" );
996 manager.MoveFocus( Control::KeyboardFocus::RIGHT );
997 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-1" );
998 manager.MoveFocus( Control::KeyboardFocus::RIGHT );
999 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-2" );
1000 manager.MoveFocus( Control::KeyboardFocus::RIGHT );
1001 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-0" );
1002 manager.MoveFocus( Control::KeyboardFocus::RIGHT );
1003 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-1-0-0" );
1004 manager.MoveFocus( Control::KeyboardFocus::RIGHT );
1005 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-1-0-1" );
1006 manager.MoveFocus( Control::KeyboardFocus::RIGHT );
1007 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-1-1-0" );
1008 manager.MoveFocus( Control::KeyboardFocus::RIGHT );
1009 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-1-1-1" );
1010 manager.MoveFocus( Control::KeyboardFocus::RIGHT );
1011 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-2" );
1012 manager.MoveFocus( Control::KeyboardFocus::RIGHT );
1013 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "2-0" );
1014 manager.MoveFocus( Control::KeyboardFocus::RIGHT );
1015 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "2-1" );
1016 manager.MoveFocus( Control::KeyboardFocus::RIGHT );
1017 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "2-2" );
1019 manager.MoveFocus( Control::KeyboardFocus::LEFT );
1020 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "2-1" );
1021 manager.MoveFocus( Control::KeyboardFocus::LEFT );
1022 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "2-0" );
1023 manager.MoveFocus( Control::KeyboardFocus::LEFT );
1024 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-2" );
1025 manager.MoveFocus( Control::KeyboardFocus::LEFT );
1026 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-1-1-1" );
1027 manager.MoveFocus( Control::KeyboardFocus::LEFT );
1028 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-1-1-0" );
1029 manager.MoveFocus( Control::KeyboardFocus::LEFT );
1030 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-1-0-1" );
1031 manager.MoveFocus( Control::KeyboardFocus::LEFT );
1032 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-1-0-0" );
1033 manager.MoveFocus( Control::KeyboardFocus::LEFT );
1034 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-0" );
1035 manager.MoveFocus( Control::KeyboardFocus::LEFT );
1036 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-2" );
1037 manager.MoveFocus( Control::KeyboardFocus::LEFT );
1038 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-1" );
1039 manager.MoveFocus( Control::KeyboardFocus::LEFT );
1040 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-0" );
1042 manager.MoveFocus( Control::KeyboardFocus::RIGHT );
1043 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-1" );
1044 manager.MoveFocus( Control::KeyboardFocus::DOWN );
1045 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-1-0-0" );
1046 manager.MoveFocus( Control::KeyboardFocus::DOWN );
1047 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-1-1-0" );
1048 manager.MoveFocus( Control::KeyboardFocus::DOWN );
1049 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "2-1" );
1051 manager.MoveFocus( Control::KeyboardFocus::UP );
1052 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-1-1-1" );
1053 manager.MoveFocus( Control::KeyboardFocus::UP );
1054 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-1-0-1" );
1055 manager.MoveFocus( Control::KeyboardFocus::UP );
1056 DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-1" );