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.
18 #include <dali-toolkit-test-suite-utils.h>
19 #include <dali-toolkit/dali-toolkit.h>
20 #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;
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);
47 static bool gObjectCreatedCallBackCalled;
49 static void TestCallback(BaseHandle handle)
51 gObjectCreatedCallBackCalled = true;
61 * function operator to apply the parent size
63 void operator()(Dali::Vector3& current, const PropertyInputContainer& /* inputs */)
65 current.x = current.y = current.z = 100.0f;
69 // Convenience function to quickly set up a 10x10 table with each cell being 10x10 pixels in size by default.
70 static void SetupTableViewAndActors(Integration::Scene scene, TableView& tableView, Actor& actor1, Actor& actor2, Actor& actor3)
72 tableView = TableView::New(10, 10); // 10 by 10 grid.
73 DALI_TEST_CHECK(tableView);
76 tableView.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
78 actor1 = Actor::New();
79 actor2 = Actor::New();
80 actor3 = Actor::New();
82 actor1.SetProperty(Actor::Property::SIZE, CELL_SIZE);
83 actor2.SetProperty(Actor::Property::SIZE, CELL_SIZE);
84 actor3.SetProperty(Actor::Property::SIZE, CELL_SIZE);
86 tableView.AddChild(actor1, TableView::CellPosition(0, 0));
87 tableView.AddChild(actor2, TableView::CellPosition(0, 1));
88 tableView.AddChild(actor3, TableView::CellPosition(1, 0));
93 int UtcDaliTableViewCtorCopyP(void)
95 ToolkitTestApplication application;
97 TableView actor1 = TableView::New(10, 10);
98 TableView actor2(actor1);
100 DALI_TEST_EQUALS(actor1, actor2, TEST_LOCATION);
104 int UtcDaliTableViewNew(void)
106 ToolkitTestApplication application;
108 TableView tableView = TableView::New(10, 10);
109 DALI_TEST_CHECK(tableView);
111 //Additional check to ensure object is created by checking if it's registered
112 ObjectRegistry registry = application.GetCore().GetObjectRegistry();
113 DALI_TEST_CHECK(registry);
115 gObjectCreatedCallBackCalled = false;
116 registry.ObjectCreatedSignal().Connect(&TestCallback);
118 TableView tableView = TableView::New(10, 10);
120 DALI_TEST_CHECK(gObjectCreatedCallBackCalled);
124 // Test adjusting the metric values for the cell.
125 int UtcDaliTableViewMetricsPadding(void)
127 ToolkitTestApplication application;
129 tet_infoline("UtcDaliTableViewMetricsPadding");
136 SetupTableViewAndActors(application.GetScene(), tableView, actor1, actor2, actor3);
138 // 1. check that padding works. no padding:
139 tableView.SetCellPadding(Size(0.0f, 0.0f));
140 application.SendNotification();
141 application.Render();
143 DALI_TEST_EQUALS(tableView.GetCellPadding(), Size(0.0f, 0.0f), TEST_LOCATION);
144 DALI_TEST_EQUALS(actor1.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION);
145 DALI_TEST_EQUALS(actor2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION);
146 DALI_TEST_EQUALS(actor3.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION);
148 // 1. check that padding works. some padding:
149 tableView.SetCellPadding(Size(5.0f, 10.0f));
150 application.SendNotification();
151 application.Render();
153 DALI_TEST_EQUALS(tableView.GetCellPadding(), Size(5.0f, 10.0f), TEST_LOCATION);
154 DALI_TEST_EQUALS(actor1.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(5.0f, 10.0f, 0.0f), TEST_LOCATION);
158 // Test adjusting the metric values for the cell.
159 int UtcDaliTableViewMetricsFit(void)
161 ToolkitTestApplication application;
163 tet_infoline("UtcDaliTableViewMetricsFit");
170 SetupTableViewAndActors(application.GetScene(), tableView, actor1, actor2, actor3);
171 application.SendNotification();
172 application.Render();
174 // 1. check that with no fixed width/heights, actors are in default position.
175 DALI_TEST_EQUALS(actor1.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION);
176 DALI_TEST_EQUALS(actor2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION);
177 DALI_TEST_EQUALS(actor3.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION);
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);
185 application.SendNotification();
186 application.Render();
188 DALI_TEST_EQUALS(actor1.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION);
189 DALI_TEST_EQUALS(actor2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION);
190 DALI_TEST_EQUALS(actor3.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION);
192 tableView.SetProperty(Dali::Actor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::RIGHT_TO_LEFT);
193 application.SendNotification();
194 application.Render();
196 DALI_TEST_EQUALS(actor1.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(90.0f, 0.0f, 0.0f), TEST_LOCATION);
197 DALI_TEST_EQUALS(actor2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(80.0f, 0.0f, 0.0f), TEST_LOCATION);
198 DALI_TEST_EQUALS(actor3.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(90.0f, 10.0f, 0.0f), TEST_LOCATION);
200 tableView.SetProperty(Dali::Actor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::LEFT_TO_RIGHT);
201 application.SendNotification();
202 application.Render();
204 DALI_TEST_EQUALS(actor1.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION);
205 DALI_TEST_EQUALS(actor2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION);
206 DALI_TEST_EQUALS(actor3.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION);
211 // Test adjusting the metric values for the cell.
212 int UtcDaliTableViewMetricsFixed(void)
214 ToolkitTestApplication application;
216 tet_infoline("UtcDaliTableViewMetricsFixed");
223 SetupTableViewAndActors(application.GetScene(), tableView, actor1, actor2, actor3);
224 application.SendNotification();
225 application.Render();
227 // 1. check that with no fixed width/heights, actors are in default position.
228 DALI_TEST_EQUALS(actor1.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION);
229 DALI_TEST_EQUALS(actor2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION);
230 DALI_TEST_EQUALS(actor3.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION);
232 // 2. check that with a fixed width & height, actors to the right and below are offsetted.
233 tableView.SetFixedWidth(0, 20.0f);
234 tableView.SetFixedHeight(0, 50.0f);
235 DALI_TEST_EQUALS(tableView.GetFixedWidth(0), 20.0f, TEST_LOCATION);
236 DALI_TEST_EQUALS(tableView.GetFixedHeight(0), 50.0f, TEST_LOCATION);
238 application.SendNotification();
239 application.Render();
241 DALI_TEST_EQUALS(actor1.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION);
242 DALI_TEST_EQUALS(actor2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(20.0f, 0.0f, 0.0f), TEST_LOCATION);
243 DALI_TEST_EQUALS(actor3.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 50.0f, 0.0f), TEST_LOCATION);
247 // Test adjusting the metric values for the cell.
248 int UtcDaliTableViewMetricsRelative(void)
250 ToolkitTestApplication application;
252 tet_infoline("UtcDaliTableViewMetricsRelative");
259 SetupTableViewAndActors(application.GetScene(), tableView, actor1, actor2, actor3);
260 application.SendNotification();
261 application.Render();
263 // 1. check that with no relative width/heights, actors are in default position.
264 DALI_TEST_EQUALS(actor1.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION);
265 DALI_TEST_EQUALS(actor2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION);
266 DALI_TEST_EQUALS(actor3.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION);
268 // 2. check that with a relative width & height, actors to the right and below are offsetted.
269 tableView.SetRelativeWidth(0, 0.3f); // cell 0,0 occupies 30%x50% of the grid (i.e. 30x50 pixels)
270 tableView.SetRelativeHeight(0, 0.5f);
271 DALI_TEST_EQUALS(tableView.GetRelativeWidth(0), 0.3f, TEST_LOCATION);
272 DALI_TEST_EQUALS(tableView.GetRelativeHeight(0), 0.5f, TEST_LOCATION);
274 application.SendNotification();
275 application.Render();
277 DALI_TEST_EQUALS(actor1.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION);
278 DALI_TEST_EQUALS(actor2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(30.0f, 0.0f, 0.0f), TEST_LOCATION);
279 DALI_TEST_EQUALS(actor3.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 50.0f, 0.0f), TEST_LOCATION);
283 // Test Adding/Removing/Finding Children.
284 int UtcDaliTableViewChild(void)
286 ToolkitTestApplication application;
288 tet_infoline("UtcDaliTableViewChild");
290 // Create a 10x10 table-view
291 TableView tableView = TableView::New(10, 10);
292 DALI_TEST_CHECK(tableView);
294 // Check if actor doesn't exist.
295 DALI_TEST_CHECK(!tableView.GetChildAt(TableView::CellPosition(0, 0)));
297 // Add an actor to it at 0,0
298 Actor actor = Actor::New();
299 tableView.AddChild(actor, TableView::CellPosition());
302 DALI_TEST_CHECK(tableView.GetChildAt(TableView::CellPosition(0, 0)));
305 tableView.RemoveChildAt(TableView::CellPosition());
307 // Check if actor no longer exists.
308 DALI_TEST_CHECK(!tableView.GetChildAt(TableView::CellPosition(0, 0)));
310 // Add actor to it again, but at 2,5
311 tableView.AddChild(actor, TableView::CellPosition(2, 5));
313 // Add another actor somewhere else 7,8
314 Actor actor2 = Actor::New();
315 tableView.AddChild(actor2, TableView::CellPosition(7, 8));
319 // Check that no actor exists in a few random places.
320 DALI_TEST_CHECK(!tableView.GetChildAt(TableView::CellPosition(0, 0)));
321 DALI_TEST_CHECK(!tableView.GetChildAt(TableView::CellPosition(2, 1)));
322 DALI_TEST_CHECK(!tableView.GetChildAt(TableView::CellPosition(6, 3)));
323 DALI_TEST_CHECK(!tableView.GetChildAt(TableView::CellPosition(9, 5)));
325 // Check for actors at actual positions.
326 searchActor = tableView.GetChildAt(TableView::CellPosition(2, 5));
327 DALI_TEST_CHECK(searchActor == actor);
329 searchActor = tableView.GetChildAt(TableView::CellPosition(7, 8));
330 DALI_TEST_CHECK(searchActor == actor2);
332 // Create a second table, and add already added Child to new one.
333 TableView tableView2 = TableView::New(5, 5);
334 tableView2.AddChild(actor, TableView::CellPosition(2, 2));
335 DALI_TEST_CHECK(tableView2.GetChildAt(TableView::CellPosition(2, 2)));
339 // Test calling Add on it's own (to invoke the OnChildAdd)
340 int UtcDaliTableViewAdd(void)
342 ToolkitTestApplication application;
344 tet_infoline("UtcDaliTableViewAdd");
346 // Create a 4x1 table-view, and just keep adding.
347 TableView tableView = TableView::New(1, 4);
348 DALI_TEST_CHECK(tableView);
350 for(unsigned int i = 0; i < 16; i++)
352 Actor currentActor = Actor::New();
353 TableView::CellPosition position = TableView::CellPosition();
354 tableView.Add(currentActor);
355 tableView.FindChildPosition(currentActor, position);
356 tet_printf("%dx%d (%d,%d)\n", tableView.GetColumns(), tableView.GetRows(), position.columnIndex, position.rowIndex);
358 DALI_TEST_EQUALS((position.rowIndex * 4 + position.columnIndex), i, TEST_LOCATION);
363 // Test cell modification.
364 int UtcDaliTableViewCells(void)
366 ToolkitTestApplication application;
367 tet_infoline("UtcDaliTableViewCells");
369 // Create a 10x10 table-view
370 TableView tableView = TableView::New(10, 10);
371 DALI_TEST_CHECK(tableView);
373 // Add a few actors to the table.
374 Actor actor1 = Actor::New();
375 Actor actor2 = Actor::New();
376 Actor actor3 = Actor::New();
377 actor1.SetProperty(Dali::Actor::Property::NAME, "Actor1");
378 actor2.SetProperty(Dali::Actor::Property::NAME, "Actor2");
379 actor3.SetProperty(Dali::Actor::Property::NAME, "Actor3");
381 // note: positions are specified in reversed cartesian coords - row,col (i.e. y,x)
382 tableView.AddChild(actor1, TableView::CellPosition(0, 0));
383 tableView.AddChild(actor2, TableView::CellPosition(5, 5));
384 tableView.AddChild(actor3, TableView::CellPosition(7, 2));
386 DALI_TEST_CHECK(tableView.GetRows() == 10 && tableView.GetColumns() == 10);
388 // Add a row between actor1 and actor2 | insert column on actor1 and see what happens...
389 tableView.InsertRow(3);
390 tableView.InsertColumn(0);
391 DALI_TEST_CHECK(tableView.GetRows() == 11 && tableView.GetColumns() == 11);
393 TableView::CellPosition cellPosition;
396 result = tableView.FindChildPosition(actor1, cellPosition);
397 DALI_TEST_CHECK(result && cellPosition.rowIndex == 0 && cellPosition.columnIndex == 1);
398 result = tableView.FindChildPosition(actor2, cellPosition);
399 DALI_TEST_CHECK(result && cellPosition.rowIndex == 6 && cellPosition.columnIndex == 6);
400 result = tableView.FindChildPosition(actor3, cellPosition);
401 DALI_TEST_CHECK(result && cellPosition.rowIndex == 8 && cellPosition.columnIndex == 3);
403 // Delete a row between actor2 and actor3 | delete column on actor2 and see what happens...
404 tableView.DeleteRow(7);
405 tableView.DeleteColumn(6);
406 DALI_TEST_CHECK(tableView.GetRows() == 10 && tableView.GetColumns() == 10);
408 result = tableView.FindChildPosition(actor1, cellPosition);
409 DALI_TEST_CHECK(result && cellPosition.rowIndex == 0 && cellPosition.columnIndex == 1);
410 result = tableView.FindChildPosition(actor2, cellPosition);
411 DALI_TEST_CHECK(!result);
412 result = tableView.FindChildPosition(actor3, cellPosition);
413 DALI_TEST_CHECK(result && cellPosition.rowIndex == 7 && cellPosition.columnIndex == 3);
415 // Delete the other two remaining actors by a row delete and a column delete.
416 std::vector<Actor> actorsRemoved;
417 tableView.DeleteRow(0, actorsRemoved);
418 tet_printf("Row Delete >> Actors Removed: %d {", actorsRemoved.size());
419 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());
421 DALI_TEST_EQUALS(static_cast<int>(actorsRemoved.size()), 1, TEST_LOCATION);
422 DALI_TEST_CHECK(actorsRemoved[0] == actor1);
424 actorsRemoved.clear();
425 tableView.DeleteColumn(3, actorsRemoved);
426 tet_printf("Column Delete >> Actors Removed: %d {", actorsRemoved.size());
427 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());
429 DALI_TEST_EQUALS(static_cast<int>(actorsRemoved.size()), 1, TEST_LOCATION);
430 DALI_TEST_CHECK(actorsRemoved[0] == actor3);
432 DALI_TEST_CHECK(tableView.GetRows() == 9 && tableView.GetColumns() == 9);
434 tableView.AddChild(actor1, TableView::CellPosition(5, 8));
435 tableView.Resize(100, 100);
436 DALI_TEST_CHECK(tableView.GetRows() == 100 && tableView.GetColumns() == 100);
438 tableView.AddChild(actor2, TableView::CellPosition(69, 57));
439 DALI_TEST_CHECK(tableView.FindChildPosition(actor1, cellPosition) && tableView.FindChildPosition(actor2, cellPosition));
441 tableView.Resize(20, 20);
442 DALI_TEST_CHECK(tableView.FindChildPosition(actor1, cellPosition) && !tableView.FindChildPosition(actor2, cellPosition));
444 actorsRemoved.clear();
445 tableView.Resize(1, 1, actorsRemoved);
446 DALI_TEST_CHECK(!tableView.FindChildPosition(actor1, cellPosition) && !tableView.FindChildPosition(actor2, cellPosition));
447 DALI_TEST_EQUALS(static_cast<int>(actorsRemoved.size()), 1, TEST_LOCATION);
448 DALI_TEST_CHECK(actorsRemoved[0] == actor1);
450 // Add child outside table size, forcing a resize.
451 tableView.AddChild(actor1, TableView::CellPosition(100, 100, 1, 1));
452 DALI_TEST_CHECK(tableView.GetRows() == 101 && tableView.GetColumns() == 101);
454 // Add child outside table size, forcing a resize.
455 tableView.AddChild(actor1, TableView::CellPosition(110, 110, 5, 5));
456 DALI_TEST_CHECK(tableView.GetRows() == 115 && tableView.GetColumns() == 115);
458 // Set the alignment of the cell
459 tableView.SetCellAlignment(TableView::CellPosition(100, 100, 1, 1), HorizontalAlignment::CENTER, VerticalAlignment::CENTER);
460 tableView.SetCellAlignment(TableView::CellPosition(110, 110, 5, 5), HorizontalAlignment::LEFT, VerticalAlignment::TOP);
462 DALI_TEST_CHECK(true);
466 int UtcDaliTableViewChildAssert(void)
468 ToolkitTestApplication application;
469 tet_infoline("UtcDaliTableViewChildAssert");
471 // Create a 10x10 table-view
472 TableView tableView = TableView::New(10, 10);
473 DALI_TEST_CHECK(tableView);
478 tableView.AddChild(childActor, TableView::CellPosition(0, 0, 5, 5));
480 tet_result(TET_FAIL);
482 catch(Dali::DaliException& e)
484 DALI_TEST_PRINT_ASSERT(e);
485 DALI_TEST_EQUALS(e.condition, "child", TEST_LOCATION);
490 int UtcDaliTableViewMetricsAssert(void)
492 ToolkitTestApplication application;
493 tet_infoline("UtcDaliTableViewChildAssert");
495 // Create a 10x10 table-view
496 TableView tableView = TableView::New(10, 10);
497 DALI_TEST_CHECK(tableView);
503 tableView.SetFixedHeight(10, 1.0f);
505 tet_result(TET_FAIL);
507 catch(Dali::DaliException& e)
509 DALI_TEST_PRINT_ASSERT(e);
510 DALI_TEST_EQUALS(e.condition, "rowIndex < mRowData.Size()", TEST_LOCATION);
515 tableView.GetFixedHeight(10);
517 tet_result(TET_FAIL);
519 catch(Dali::DaliException& e)
521 DALI_TEST_PRINT_ASSERT(e);
522 DALI_TEST_EQUALS(e.condition, "rowIndex < mRowData.Size()", TEST_LOCATION);
527 tableView.SetFixedWidth(10, 1.0f);
529 tet_result(TET_FAIL);
531 catch(Dali::DaliException& e)
533 DALI_TEST_PRINT_ASSERT(e);
534 DALI_TEST_EQUALS(e.condition, "columnIndex < mColumnData.Size()", TEST_LOCATION);
539 tableView.GetFixedWidth(10);
541 tet_result(TET_FAIL);
543 catch(Dali::DaliException& e)
545 DALI_TEST_PRINT_ASSERT(e);
546 DALI_TEST_EQUALS(e.condition, "columnIndex < mColumnData.Size()", TEST_LOCATION);
553 tableView.SetRelativeHeight(10, 0.1f);
555 tet_result(TET_FAIL);
557 catch(Dali::DaliException& e)
559 DALI_TEST_PRINT_ASSERT(e);
560 DALI_TEST_EQUALS(e.condition, "rowIndex < mRowData.Size()", TEST_LOCATION);
565 tableView.GetRelativeHeight(10);
567 tet_result(TET_FAIL);
569 catch(Dali::DaliException& e)
571 DALI_TEST_PRINT_ASSERT(e);
572 DALI_TEST_EQUALS(e.condition, "rowIndex < mRowData.Size()", TEST_LOCATION);
577 tableView.SetRelativeWidth(10, 0.1f);
579 tet_result(TET_FAIL);
581 catch(Dali::DaliException& e)
583 DALI_TEST_PRINT_ASSERT(e);
584 DALI_TEST_EQUALS(e.condition, "columnIndex < mColumnData.Size()", TEST_LOCATION);
589 tableView.GetRelativeWidth(10);
591 tet_result(TET_FAIL);
593 catch(Dali::DaliException& e)
595 DALI_TEST_PRINT_ASSERT(e);
596 DALI_TEST_EQUALS(e.condition, "columnIndex < mColumnData.Size()", TEST_LOCATION);
601 int UtcDaliTableViewSetGetProperty(void)
603 ToolkitTestApplication application;
604 tet_infoline("UtcDaliTableViewSetGetProperty");
606 // Create a 1x1 table-view
607 TableView tableView = TableView::New(1, 1);
608 tableView.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
609 DALI_TEST_CHECK(tableView);
611 // Test "rows" property
612 DALI_TEST_CHECK(tableView.GetPropertyIndex(PROPERTY_NAME_ROWS) == TableView::Property::ROWS);
614 tableView.SetProperty(TableView::Property::ROWS, 4);
616 DALI_TEST_CHECK(tableView.GetRows() == 4u);
617 DALI_TEST_CHECK(tableView.GetProperty(TableView::Property::ROWS).Get<int>() == 4);
619 // Test "columns" property
620 DALI_TEST_CHECK(tableView.GetPropertyIndex(PROPERTY_NAME_COLUMNS) == TableView::Property::COLUMNS);
622 tableView.SetProperty(TableView::Property::COLUMNS, 5);
624 DALI_TEST_CHECK(tableView.GetColumns() == 5u);
625 DALI_TEST_CHECK(tableView.GetProperty(TableView::Property::COLUMNS).Get<int>() == 5);
627 // Test "cellPadding" property
628 DALI_TEST_CHECK(tableView.GetPropertyIndex(PROPERTY_NAME_CELL_PADDING) == TableView::Property::CELL_PADDING);
630 tableView.SetProperty(TableView::Property::CELL_PADDING, Size(6.f, 8.f));
632 DALI_TEST_EQUALS(tableView.GetCellPadding(), Size(6.f, 8.f), TEST_LOCATION);
633 DALI_TEST_EQUALS(tableView.GetProperty(TableView::Property::CELL_PADDING).Get<Vector2>(), Vector2(6.f, 8.f), TEST_LOCATION);
635 //{ "policy": "fixed", "value": 30.0 },
637 item1["policy"] = "fixed";
638 item1["value"] = 30.f;
639 //{ "policy": "relative", "value": 0.2 },
641 item2["policy"] = "relative";
642 item2["value"] = 0.2f;
644 // Test "layoutRows" property
645 DALI_TEST_CHECK(tableView.GetPropertyIndex(PROPERTY_NAME_LAYOUT_ROWS) == TableView::Property::LAYOUT_ROWS);
650 * "1": { "policy": "fixed", "value": 30 },
651 * "3": { "policy": "relative", "value": 0.2 }
654 Property::Map layoutRows;
655 layoutRows["1"] = item1;
656 layoutRows["3"] = item2;
657 tableView.SetProperty(TableView::Property::LAYOUT_ROWS, layoutRows);
659 DALI_TEST_EQUALS(tableView.GetFixedHeight(1u), 30.f, TEST_LOCATION);
660 DALI_TEST_EQUALS(tableView.GetRelativeHeight(3u), 0.2f, TEST_LOCATION);
662 Property::Map layoutRowsGet = tableView.GetProperty(TableView::Property::LAYOUT_ROWS).Get<Property::Map>();
664 DALI_TEST_EQUALS(layoutRowsGet.GetKey(1).compare(layoutRows.GetKey(0)), 0, TEST_LOCATION);
665 Property::Map* childMap = layoutRowsGet.GetValue(1).GetMap();
666 DALI_TEST_CHECK(childMap->Find("policy")->Get<std::string>().compare("fixed") == 0);
667 DALI_TEST_EQUALS(childMap->Find("value")->Get<float>(), 30.f, TEST_LOCATION);
669 childMap = layoutRowsGet.GetValue(3).GetMap();
670 DALI_TEST_CHECK(layoutRowsGet.GetKey(3).compare(layoutRows.GetKey(1)) == 0);
671 DALI_TEST_CHECK(childMap->Find("policy")->Get<std::string>().compare("relative") == 0);
672 DALI_TEST_EQUALS(childMap->Find("value")->Get<float>(), 0.2f, TEST_LOCATION);
674 // Test "layoutColumns" property
675 DALI_TEST_CHECK(tableView.GetPropertyIndex(PROPERTY_NAME_LAYOUT_COLUMNS) == TableView::Property::LAYOUT_COLUMNS);
680 * "2": { "policy": "relative", "value": 0.2 },
681 * "3": { "policy": "fixed", "value": 30 }
684 Property::Map layoutColumns;
685 layoutColumns["2"] = item2;
686 layoutColumns["3"] = item1;
687 tableView.SetProperty(TableView::Property::LAYOUT_COLUMNS, layoutColumns);
689 DALI_TEST_EQUALS(tableView.GetRelativeWidth(2u), 0.2f, TEST_LOCATION);
690 DALI_TEST_EQUALS(tableView.GetFixedWidth(3u), 30.f, TEST_LOCATION);
692 Property::Map layoutColumnsGet = tableView.GetProperty(TableView::Property::LAYOUT_COLUMNS).Get<Property::Map>();
693 DALI_TEST_CHECK(layoutColumnsGet.GetKey(2).compare(layoutColumns.GetKey(0)) == 0);
694 childMap = layoutColumnsGet.GetValue(2).GetMap();
695 DALI_TEST_CHECK(childMap->Find("policy")->Get<std::string>().compare("relative") == 0);
696 DALI_TEST_EQUALS(childMap->Find("value")->Get<float>(), 0.2f, TEST_LOCATION);
697 childMap = layoutColumnsGet.GetValue(3).GetMap();
698 DALI_TEST_CHECK(layoutColumnsGet.GetKey(3).compare(layoutColumns.GetKey(1)) == 0);
699 DALI_TEST_CHECK(childMap->Find("policy")->Get<std::string>().compare("fixed") == 0);
700 DALI_TEST_EQUALS(childMap->Find("value")->Get<float>(), 30.f, TEST_LOCATION);
705 int UtcDaliTableViewChildProperties(void)
707 ToolkitTestApplication application;
708 tet_infoline("UtcDaliTableViewChildProperties");
710 // Create a 10x10 table-view
711 TableView tableView = TableView::New(10, 10);
712 application.GetScene().Add(tableView);
713 tableView.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
715 DALI_TEST_CHECK(tableView);
717 // Create a child actor with the custom properties
718 Actor child1 = Actor::New();
719 child1.SetProperty(TableView::ChildProperty::CELL_INDEX, Vector2(3, 4));
720 tableView.Add(child1);
721 // Check for actors at actual positions.
722 DALI_TEST_CHECK(tableView.GetChildAt(TableView::CellPosition(3, 4)) == child1);
724 // Create a second child actor with the custom properties
725 Actor child2 = Actor::New();
727 float columnSpan = 2.f;
728 child2.SetProperty(TableView::ChildProperty::CELL_INDEX, Vector2(6, 1));
729 child2.SetProperty(TableView::ChildProperty::ROW_SPAN, rowSpan);
730 child2.SetProperty(TableView::ChildProperty::COLUMN_SPAN, columnSpan);
731 tableView.Add(child2);
732 // Check for actors at actual positions.
733 for(int i = 0; i < rowSpan; i++)
735 for(int j = 0; j < columnSpan; j++)
737 DALI_TEST_CHECK(tableView.GetChildAt(TableView::CellPosition(6 + i, 1 + j)) == child2);
741 // Create a third child actor with the cell alignment properties
742 Actor child3 = Actor::New();
743 child3.SetProperty(Actor::Property::SIZE, Vector2(5.f, 5.f));
744 child3.SetProperty(TableView::ChildProperty::CELL_HORIZONTAL_ALIGNMENT, "center");
745 child3.SetProperty(TableView::ChildProperty::CELL_VERTICAL_ALIGNMENT, "bottom");
746 tableView.Add(child3);
748 // store the actor in the first available cell
749 DALI_TEST_CHECK(tableView.GetChildAt(TableView::CellPosition(0, 0)) == child3)
750 application.SendNotification();
751 application.Render();
753 DALI_TEST_EQUALS(child3.GetCurrentProperty<Vector3>(Actor::Property::ANCHOR_POINT), AnchorPoint::TOP_LEFT, TEST_LOCATION);
754 DALI_TEST_EQUALS(child3.GetCurrentProperty<Vector3>(Actor::Property::PARENT_ORIGIN), ParentOrigin::TOP_LEFT, TEST_LOCATION);
755 DALI_TEST_EQUALS(child3.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(2.5f, 5.0f, 0.0f), TEST_LOCATION);
760 int UtcDaliTableViewGetChildAtN(void)
762 ToolkitTestApplication application;
764 TableView tableView = TableView::New(10, 10);
766 Actor actor = tableView.GetChildAt(TableView::CellPosition(200, 200));
767 DALI_TEST_CHECK(!actor);
772 int UtcDaliTableViewAddChildN(void)
774 ToolkitTestApplication application;
776 TableView tableView = TableView::New(10, 10);
777 DALI_TEST_CHECK(tableView.AddChild(Actor::New(), TableView::CellPosition(0, 0)));
778 DALI_TEST_CHECK(!tableView.AddChild(Actor::New(), TableView::CellPosition(0, 0)));
783 int UtcDaliTableViewInsertRowAtZero(void)
785 ToolkitTestApplication application;
787 TableView tableView = TableView::New(10, 10);
788 DALI_TEST_CHECK(tableView.AddChild(Actor::New(), TableView::CellPosition(0, 0, 10, 10)));
789 tableView.InsertRow(0);
791 DALI_TEST_CHECK(tableView.GetRows() == 11);
796 int UtcDaliTableViewDeleteRowAtZero(void)
798 ToolkitTestApplication application;
800 TableView tableView = TableView::New(10, 10);
801 DALI_TEST_CHECK(tableView.AddChild(Actor::New(), TableView::CellPosition(0, 0, 10, 10)));
802 tableView.DeleteRow(0);
804 DALI_TEST_CHECK(tableView.GetRows() == 9);
809 int UtcDaliTableViewInsertColumnAtZero(void)
811 ToolkitTestApplication application;
813 TableView tableView = TableView::New(10, 10);
814 DALI_TEST_CHECK(tableView.AddChild(Actor::New(), TableView::CellPosition(0, 0, 10, 10)));
815 tableView.InsertColumn(0);
817 DALI_TEST_CHECK(tableView.GetColumns() == 11);
822 int UtcDaliTableViewDeleteColumnAtZero(void)
824 ToolkitTestApplication application;
826 TableView tableView = TableView::New(10, 10);
827 DALI_TEST_CHECK(tableView.AddChild(Actor::New(), TableView::CellPosition(0, 0, 10, 10)));
828 tableView.DeleteColumn(0);
830 DALI_TEST_CHECK(tableView.GetColumns() == 9);
835 int UtcDaliTableViewTypeRegistry(void)
837 ToolkitTestApplication application;
839 TypeRegistry typeRegistry = TypeRegistry::Get();
840 DALI_TEST_CHECK(typeRegistry);
842 TypeInfo typeInfo = typeRegistry.GetTypeInfo("TableView");
843 DALI_TEST_CHECK(typeInfo);
845 BaseHandle handle = typeInfo.CreateInstance();
846 DALI_TEST_CHECK(handle);
848 TableView view = TableView::DownCast(handle);
849 DALI_TEST_CHECK(view);
854 int UtcDaliTableViewKeyboardFocus(void)
856 ToolkitTestApplication application;
858 TableView tableView = TableView::New(4, 4);
859 tableView.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
860 tableView.SetProperty(Dali::Actor::Property::NAME, "TableView");
862 for(int row = 0; row < 4; ++row)
864 for(int col = 0; col < 4; ++col)
866 Control control = Control::New();
867 std::ostringstream str;
868 str << row << "-" << col;
869 control.SetProperty(Dali::Actor::Property::NAME, str.str());
870 control.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
871 tableView.AddChild(control, TableView::CellPosition(row, col));
875 application.GetScene().Add(tableView);
877 application.SendNotification();
878 application.Render();
880 Actor firstFocusActor = Toolkit::Internal::GetImplementation(tableView).GetNextKeyboardFocusableActor(Actor(), Control::KeyboardFocus::RIGHT, true);
881 DALI_TEST_CHECK(firstFocusActor);
882 DALI_TEST_CHECK(firstFocusActor.GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-0");
884 KeyboardFocusManager manager = KeyboardFocusManager::Get();
885 manager.SetFocusGroupLoop(true);
886 manager.SetCurrentFocusActor(firstFocusActor);
888 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-0");
889 manager.MoveFocus(Control::KeyboardFocus::RIGHT);
890 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-1");
891 manager.MoveFocus(Control::KeyboardFocus::RIGHT);
892 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-2");
893 manager.MoveFocus(Control::KeyboardFocus::RIGHT);
894 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-3");
895 manager.MoveFocus(Control::KeyboardFocus::RIGHT);
896 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-0");
898 manager.MoveFocus(Control::KeyboardFocus::LEFT);
899 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-3");
900 manager.MoveFocus(Control::KeyboardFocus::LEFT);
901 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-2");
902 manager.MoveFocus(Control::KeyboardFocus::LEFT);
903 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-1");
904 manager.MoveFocus(Control::KeyboardFocus::LEFT);
905 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-0");
906 manager.MoveFocus(Control::KeyboardFocus::LEFT);
907 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "3-3");
909 manager.MoveFocus(Control::KeyboardFocus::RIGHT);
910 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-0");
911 manager.MoveFocus(Control::KeyboardFocus::RIGHT);
912 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-1");
914 manager.MoveFocus(Control::KeyboardFocus::DOWN);
915 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-1");
916 manager.MoveFocus(Control::KeyboardFocus::DOWN);
917 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "2-1");
918 manager.MoveFocus(Control::KeyboardFocus::DOWN);
919 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "3-1");
920 manager.MoveFocus(Control::KeyboardFocus::DOWN);
921 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-1");
923 manager.MoveFocus(Control::KeyboardFocus::UP);
924 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "3-1");
925 manager.MoveFocus(Control::KeyboardFocus::UP);
926 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "2-1");
927 manager.MoveFocus(Control::KeyboardFocus::UP);
928 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-1");
929 manager.MoveFocus(Control::KeyboardFocus::UP);
930 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-1");
935 int UtcDaliTableViewKeyboardFocusInNestedTableView(void)
937 ToolkitTestApplication application;
939 TableView tableView = TableView::New(3, 3);
940 tableView.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
941 tableView.SetProperty(Dali::Actor::Property::NAME, "TableView");
943 for(int row = 0; row < 3; ++row)
945 for(int col = 0; col < 3; ++col)
947 std::ostringstream str;
948 str << row << "-" << col;
950 if(row == 1 && col == 1)
952 // Add a nested 2x2 table view in the middle cell of the parent table view
953 TableView childTableView = TableView::New(2, 2);
954 childTableView.SetProperty(Dali::Actor::Property::NAME, str.str());
956 for(int childRow = 0; childRow < 2; childRow++)
958 for(int childCol = 0; childCol < 2; childCol++)
960 Control control = Control::New();
961 std::ostringstream nameStr;
962 nameStr << row << "-" << col << "-" << childRow << "-" << childCol;
963 control.SetProperty(Dali::Actor::Property::NAME, nameStr.str());
964 control.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
965 childTableView.AddChild(control, TableView::CellPosition(childRow, childCol));
968 tableView.AddChild(childTableView, TableView::CellPosition(row, col));
972 Control control = Control::New();
973 control.SetProperty(Dali::Actor::Property::NAME, str.str());
974 control.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
975 tableView.AddChild(control, TableView::CellPosition(row, col));
980 application.GetScene().Add(tableView);
982 application.SendNotification();
983 application.Render();
985 Actor firstFocusActor = Toolkit::Internal::GetImplementation(tableView).GetNextKeyboardFocusableActor(Actor(), Control::KeyboardFocus::RIGHT, true);
986 DALI_TEST_CHECK(firstFocusActor);
987 DALI_TEST_CHECK(firstFocusActor.GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-0");
989 KeyboardFocusManager manager = KeyboardFocusManager::Get();
990 manager.SetFocusGroupLoop(false);
991 manager.SetCurrentFocusActor(firstFocusActor);
993 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-0");
994 manager.MoveFocus(Control::KeyboardFocus::RIGHT);
995 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-1");
996 manager.MoveFocus(Control::KeyboardFocus::RIGHT);
997 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-2");
998 manager.MoveFocus(Control::KeyboardFocus::RIGHT);
999 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-0");
1000 manager.MoveFocus(Control::KeyboardFocus::RIGHT);
1001 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-1-0-0");
1002 manager.MoveFocus(Control::KeyboardFocus::RIGHT);
1003 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-1-0-1");
1004 manager.MoveFocus(Control::KeyboardFocus::RIGHT);
1005 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-1-1-0");
1006 manager.MoveFocus(Control::KeyboardFocus::RIGHT);
1007 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-1-1-1");
1008 manager.MoveFocus(Control::KeyboardFocus::RIGHT);
1009 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-2");
1010 manager.MoveFocus(Control::KeyboardFocus::RIGHT);
1011 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "2-0");
1012 manager.MoveFocus(Control::KeyboardFocus::RIGHT);
1013 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "2-1");
1014 manager.MoveFocus(Control::KeyboardFocus::RIGHT);
1015 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "2-2");
1017 manager.MoveFocus(Control::KeyboardFocus::LEFT);
1018 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "2-1");
1019 manager.MoveFocus(Control::KeyboardFocus::LEFT);
1020 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "2-0");
1021 manager.MoveFocus(Control::KeyboardFocus::LEFT);
1022 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-2");
1023 manager.MoveFocus(Control::KeyboardFocus::LEFT);
1024 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-1-1-1");
1025 manager.MoveFocus(Control::KeyboardFocus::LEFT);
1026 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-1-1-0");
1027 manager.MoveFocus(Control::KeyboardFocus::LEFT);
1028 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-1-0-1");
1029 manager.MoveFocus(Control::KeyboardFocus::LEFT);
1030 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-1-0-0");
1031 manager.MoveFocus(Control::KeyboardFocus::LEFT);
1032 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-0");
1033 manager.MoveFocus(Control::KeyboardFocus::LEFT);
1034 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-2");
1035 manager.MoveFocus(Control::KeyboardFocus::LEFT);
1036 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-1");
1037 manager.MoveFocus(Control::KeyboardFocus::LEFT);
1038 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-0");
1040 manager.MoveFocus(Control::KeyboardFocus::RIGHT);
1041 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-1");
1042 manager.MoveFocus(Control::KeyboardFocus::DOWN);
1043 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-1-0-0");
1044 manager.MoveFocus(Control::KeyboardFocus::DOWN);
1045 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-1-1-0");
1046 manager.MoveFocus(Control::KeyboardFocus::DOWN);
1047 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "2-1");
1049 manager.MoveFocus(Control::KeyboardFocus::UP);
1050 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-1-1-1");
1051 manager.MoveFocus(Control::KeyboardFocus::UP);
1052 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-1-0-1");
1053 manager.MoveFocus(Control::KeyboardFocus::UP);
1054 DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-1");