X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-TableView.cpp;h=1a540a2303080e919ac98549d1de1527250b89a2;hp=9f599a14b1201d375eadfa0e2db6d5cba3eeb4c0;hb=8a647e87a01c5c78451653c1264a9eea81ac9b20;hpb=5e937a6322849b76d49d5b3f41cb5d91c94acd3e diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TableView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TableView.cpp index 9f599a1..1a540a2 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TableView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TableView.cpp @@ -20,6 +20,7 @@ #include #include #include +#include using namespace Dali; using namespace Toolkit; @@ -67,21 +68,21 @@ struct Constraint100 }; // Convenience function to quickly set up a 10x10 table with each cell being 10x10 pixels in size by default. -static void SetupTableViewAndActors(TableView& tableView, Actor& actor1, Actor& actor2, Actor& actor3) +static void SetupTableViewAndActors(Integration::Scene scene, TableView& tableView, Actor& actor1, Actor& actor2, Actor& actor3) { tableView = TableView::New( 10, 10 ); // 10 by 10 grid. DALI_TEST_CHECK( tableView ); - Stage::GetCurrent().Add( tableView ); - tableView.SetSize( Dali::Vector2( 100.0f, 100.0f ) ); + scene.Add( tableView ); + tableView.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) ); actor1 = Actor::New(); actor2 = Actor::New(); actor3 = Actor::New(); - actor1.SetSize( CELL_SIZE ); - actor2.SetSize( CELL_SIZE ); - actor3.SetSize( CELL_SIZE ); + actor1.SetProperty( Actor::Property::SIZE, CELL_SIZE ); + actor2.SetProperty( Actor::Property::SIZE, CELL_SIZE ); + actor3.SetProperty( Actor::Property::SIZE, CELL_SIZE ); tableView.AddChild( actor1, TableView::CellPosition( 0, 0 ) ); tableView.AddChild( actor2, TableView::CellPosition( 0, 1 ) ); @@ -92,7 +93,7 @@ static void SetupTableViewAndActors(TableView& tableView, Actor& actor1, Actor& int UtcDaliTableViewCtorCopyP(void) { - TestApplication application; + ToolkitTestApplication application; TableView actor1 = TableView::New(10,10); TableView actor2( actor1 ); @@ -109,7 +110,7 @@ int UtcDaliTableViewNew(void) DALI_TEST_CHECK(tableView); //Additional check to ensure object is created by checking if it's registered - ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry(); + ObjectRegistry registry = application.GetCore().GetObjectRegistry(); DALI_TEST_CHECK( registry ); gObjectCreatedCallBackCalled = false; @@ -133,7 +134,7 @@ int UtcDaliTableViewMetricsPadding(void) Actor actor2; Actor actor3; - SetupTableViewAndActors(tableView, actor1, actor2, actor3); + SetupTableViewAndActors(application.GetScene(), tableView, actor1, actor2, actor3); // 1. check that padding works. no padding: tableView.SetCellPadding(Size(0.0f, 0.0f)); @@ -167,7 +168,7 @@ int UtcDaliTableViewMetricsFit(void) Actor actor2; Actor actor3; - SetupTableViewAndActors(tableView, actor1, actor2, actor3); + SetupTableViewAndActors(application.GetScene(), tableView, actor1, actor2, actor3); application.SendNotification(); application.Render(); @@ -220,7 +221,7 @@ int UtcDaliTableViewMetricsFixed(void) Actor actor2; Actor actor3; - SetupTableViewAndActors(tableView, actor1, actor2, actor3); + SetupTableViewAndActors(application.GetScene(), tableView, actor1, actor2, actor3); application.SendNotification(); application.Render(); @@ -256,7 +257,7 @@ int UtcDaliTableViewMetricsRelative(void) Actor actor2; Actor actor3; - SetupTableViewAndActors(tableView, actor1, actor2, actor3); + SetupTableViewAndActors(application.GetScene(), tableView, actor1, actor2, actor3); application.SendNotification(); application.Render(); @@ -606,7 +607,7 @@ int UtcDaliTableViewSetGetProperty(void) // Create a 1x1 table-view TableView tableView = TableView::New(1,1); - tableView.SetSize( Vector2( 100.0f, 100.0f ) ); + tableView.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) ); DALI_TEST_CHECK( tableView ); // Test "rows" property @@ -710,8 +711,8 @@ int UtcDaliTableViewChildProperties(void) // Create a 10x10 table-view TableView tableView = TableView::New(10,10); - Stage::GetCurrent().Add( tableView ); - tableView.SetSize( Dali::Vector2( 100.0f, 100.0f ) ); + application.GetScene().Add( tableView ); + tableView.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) ); DALI_TEST_CHECK( tableView ); @@ -741,7 +742,7 @@ int UtcDaliTableViewChildProperties(void) // Create a third child actor with the cell alignment properties Actor child3 = Actor::New(); - child3.SetSize( 5.f,5.f ); + child3.SetProperty( Actor::Property::SIZE, Vector2( 5.f, 5.f ) ); child3.SetProperty( TableView::ChildProperty::CELL_HORIZONTAL_ALIGNMENT, "center" ); child3.SetProperty( TableView::ChildProperty::CELL_VERTICAL_ALIGNMENT, "bottom" ); tableView.Add( child3 ); @@ -857,7 +858,7 @@ int UtcDaliTableViewKeyboardFocus(void) ToolkitTestApplication application; TableView tableView = TableView::New(4,4); - tableView.SetKeyboardFocusable( true ); + tableView.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true ); tableView.SetProperty( Dali::Actor::Property::NAME, "TableView"); for ( int row = 0; row < 4; ++row ) @@ -868,12 +869,12 @@ int UtcDaliTableViewKeyboardFocus(void) std::ostringstream str; str << row << "-" << col; control.SetProperty( Dali::Actor::Property::NAME, str.str() ); - control.SetKeyboardFocusable( true ); + control.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true ); tableView.AddChild( control, TableView::CellPosition( row, col ) ); } } - Stage::GetCurrent().Add( tableView ); + application.GetScene().Add( tableView ); application.SendNotification(); application.Render(); @@ -938,7 +939,7 @@ int UtcDaliTableViewKeyboardFocusInNestedTableView(void) ToolkitTestApplication application; TableView tableView = TableView::New(3, 3); - tableView.SetKeyboardFocusable( true ); + tableView.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true ); tableView.SetProperty( Dali::Actor::Property::NAME, "TableView"); for ( int row = 0; row < 3; ++row ) @@ -962,7 +963,7 @@ int UtcDaliTableViewKeyboardFocusInNestedTableView(void) std::ostringstream nameStr; nameStr << row << "-" << col << "-" << childRow << "-" << childCol; control.SetProperty( Dali::Actor::Property::NAME, nameStr.str() ); - control.SetKeyboardFocusable( true ); + control.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true ); childTableView.AddChild( control, TableView::CellPosition( childRow, childCol ) ); } } @@ -972,13 +973,13 @@ int UtcDaliTableViewKeyboardFocusInNestedTableView(void) { Control control = Control::New(); control.SetProperty( Dali::Actor::Property::NAME, str.str() ); - control.SetKeyboardFocusable( true ); + control.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true ); tableView.AddChild( control, TableView::CellPosition( row, col ) ); } } } - Stage::GetCurrent().Add( tableView ); + application.GetScene().Add( tableView ); application.SendNotification(); application.Render();