Merge "Fix ImageView Padding and Margin issues" into devel/master
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 5 Jul 2018 15:03:18 +0000 (15:03 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Thu, 5 Jul 2018 15:03:18 +0000 (15:03 +0000)
automated-tests/src/dali-toolkit/utc-Dali-Layouting.cpp

index f31b2e6..a7d622c 100644 (file)
@@ -1638,3 +1638,44 @@ int UtcDaliLayouting_LayoutChildren04(void)
 
   END_TEST;
 }
+
+int UtcDaliLayouting_SetLayoutOrder(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliLayouting_SetLayoutOrder - Call SetLayout after adding the control to the root layout");
+
+  Stage stage = Stage::GetCurrent();
+
+  auto rootControl = Control::New();
+  auto absoluteLayout = AbsoluteLayout::New();
+  DevelControl::SetLayout( rootControl, absoluteLayout );
+  rootControl.SetName( "AbsoluteLayout" );
+  stage.Add( rootControl );
+
+  tet_infoline(" UtcDaliLayouting_SetLayoutOrder - Creating control");
+  auto hbox = Control::New();
+  auto hboxLayout = LinearLayout::New();
+  hbox.SetName( "HBox");
+
+  tet_infoline(" UtcDaliLayouting_SetLayoutOrder - Add control to root layout");
+  rootControl.Add( hbox );
+
+  tet_infoline(" UtcDaliLayouting_SetLayoutOrder - Set layout to control AFTER control added to root");
+  DevelControl::SetLayout( hbox, hboxLayout );
+
+  // Add a Child control
+  std::vector< Control > controls;
+  controls.push_back( CreateLeafControl( 100, 100 ) ); // Single control
+  for( auto&& iter : controls )
+  {
+    hbox.Add( iter );
+  }
+
+  // Ensure layouting happens
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+
+  END_TEST;
+}