[AT-SPI] Squashed implementation
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-TableView.cpp
index e0c1cdc..1a540a2 100644 (file)
@@ -20,6 +20,7 @@
 #include <sstream>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/table-view/table-view.h>
 
 using namespace Dali;
 using namespace Toolkit;
@@ -67,12 +68,12 @@ 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 );
+  scene.Add( tableView );
   tableView.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
 
   actor1 = Actor::New();
@@ -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();
 
@@ -710,7 +711,7 @@ int UtcDaliTableViewChildProperties(void)
 
   // Create a 10x10 table-view
   TableView tableView = TableView::New(10,10);
-  Stage::GetCurrent().Add( tableView );
+  application.GetScene().Add( tableView );
   tableView.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
 
   DALI_TEST_CHECK( tableView );
@@ -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();