From: Adeel Kazmi Date: Thu, 5 Jul 2018 15:03:18 +0000 (+0000) Subject: Merge "Fix ImageView Padding and Margin issues" into devel/master X-Git-Tag: dali_1.3.31~2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=5e110a596a3beb09bc6e2f9ae3d3b68d6a30c72c;hp=5daf80c30657d359f5eb95a00dc9fe7c50180cda Merge "Fix ImageView Padding and Margin issues" into devel/master --- diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Layouting.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Layouting.cpp index f31b2e6..a7d622c 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Layouting.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Layouting.cpp @@ -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( Actor::Property::SIZE ), Vector3( 100.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION ); + + END_TEST; +}