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-Layouting.cpp;h=e5a57b3c62d4b75c9731ee40c020b6128e946f29;hp=6abc0c7ded5bb0c364e31497fa28cf38cd95cefb;hb=ae45011bfee6c5b17f4468241bddf3620a6d62f2;hpb=8e98f1407744af67cc5b5f37e979c2496468c50c diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Layouting.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Layouting.cpp index 6abc0c7..e5a57b3 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Layouting.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Layouting.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -81,6 +82,19 @@ int UtcDaliLayouting_HboxLayout01(void) DALI_TEST_EQUALS( controls[2].GetProperty( Actor::Property::SIZE ), Vector3( 80.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION ); DALI_TEST_EQUALS( controls[3].GetProperty( Actor::Property::SIZE ), Vector3( 100.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION ); + // Change a layout + auto newHBoxLayout = HboxLayout::New(); + newHBoxLayout.SetCellPadding( LayoutSize( 10, 0 ) ); + DevelControl::SetLayout( hbox, newHBoxLayout ); + + application.SendNotification(); + application.Render(); + + DALI_TEST_EQUALS( controls[0].GetProperty( Actor::Property::POSITION ), Vector3( 0.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION ); + DALI_TEST_EQUALS( controls[1].GetProperty( Actor::Property::POSITION ), Vector3( 50.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION ); + DALI_TEST_EQUALS( controls[2].GetProperty( Actor::Property::POSITION ), Vector3( 120.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION ); + DALI_TEST_EQUALS( controls[3].GetProperty( Actor::Property::POSITION ), Vector3( 210.0f, 380.0f, 0.0f ), 0.0001f, TEST_LOCATION ); + END_TEST; } @@ -790,17 +804,17 @@ int UtcDaliLayouting_VboxLayout02(void) // LayoutGroup for this to happen automatically. // // For this test, add an hbox instead - auto hbox = Control::New(); - auto hboxLayout = HboxLayout::New(); - DevelControl::SetLayout( hbox, hboxLayout ); - hbox.SetName( "Hbox"); - stage.Add( hbox ); + auto rootControl = Control::New(); + auto absoluteLayout = AbsoluteLayout::New(); + DevelControl::SetLayout( rootControl, absoluteLayout ); + rootControl.SetName( "AbsoluteLayout"); + stage.Add( rootControl ); auto vbox = Control::New(); auto vboxLayout = VboxLayout::New(); DevelControl::SetLayout( vbox, vboxLayout ); vbox.SetName( "Vbox"); - hbox.Add( vbox ); + rootControl.Add( vbox ); vbox.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::WRAP_CONTENT ); vbox.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::MATCH_PARENT ); @@ -827,8 +841,8 @@ int UtcDaliLayouting_VboxLayout02(void) application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( hbox.GetProperty(Actor::Property::POSITION), Vector3(0,0,0),TEST_LOCATION); - DALI_TEST_EQUALS( hbox.GetProperty(Actor::Property::SIZE), Vector3(480,800,0),TEST_LOCATION); + DALI_TEST_EQUALS( rootControl.GetProperty(Actor::Property::POSITION), Vector3(0,0,0),TEST_LOCATION); + DALI_TEST_EQUALS( rootControl.GetProperty(Actor::Property::SIZE), Vector3(480,800,0),TEST_LOCATION); // vbox centers elements horizontally, it should wrap it's content horizontally, i.e. it should take the width of the largest element (100) DALI_TEST_EQUALS( vbox.GetProperty( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );