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-CheckBoxButton.cpp;h=d6dc8d419231b71014beed33292ccc0ff35936ee;hp=f0169006b8af8f9abe8b2d6f6eddd100bcc9e35c;hb=c11c7538e070434e84856ebd4af000dff4ca3f9a;hpb=c803046c24398c2037a83d105a932976dede943f diff --git a/automated-tests/src/dali-toolkit/utc-Dali-CheckBoxButton.cpp b/automated-tests/src/dali-toolkit/utc-Dali-CheckBoxButton.cpp index f016900..d6dc8d4 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-CheckBoxButton.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-CheckBoxButton.cpp @@ -27,9 +27,9 @@ namespace { static bool gCheckBoxButtonState = false; -bool CheckBoxButtonClicked( Button button, bool state ) +bool CheckBoxButtonClicked( Button button ) { - gCheckBoxButtonState = state; + gCheckBoxButtonState = button.IsSelected(); return true; } @@ -37,7 +37,7 @@ bool CheckBoxButtonClicked( Button button, bool state ) Image CreateSolidColorImage( const Vector4& color, unsigned int width, unsigned int height ) { - BitmapImage imageData = BitmapImage::New( width, height, Pixel::RGBA8888 ); + BufferImage imageData = BufferImage::New( width, height, Pixel::RGBA8888 ); // Create the image PixelBuffer* pixbuf = imageData.GetBuffer(); @@ -69,10 +69,10 @@ void checkbox_button_cleanup(void) test_return_value = TET_PASS; } -int UtcDaliCheckBoxButtonSetGetChecked(void) +int UtcDaliCheckBoxButtonSetGetSelected(void) { ToolkitTestApplication application; - tet_infoline(" UtcDaliCheckBoxButtonSetGetChecked"); + tet_infoline(" UtcDaliCheckBoxButtonSetGetSelected"); CheckBoxButton checkBoxButton = CheckBoxButton::New(); checkBoxButton.StateChangedSignal().Connect( &CheckBoxButtonClicked ); @@ -80,19 +80,19 @@ int UtcDaliCheckBoxButtonSetGetChecked(void) // global var used to check if CheckBoxButtonClicked is called; gCheckBoxButtonState = false; - checkBoxButton.SetChecked( true ); + checkBoxButton.SetSelected( true ); - DALI_TEST_CHECK( checkBoxButton.IsChecked() ); + DALI_TEST_CHECK( checkBoxButton.IsSelected() ); DALI_TEST_CHECK( gCheckBoxButtonState ); - checkBoxButton.SetChecked( false ); + checkBoxButton.SetSelected( false ); - DALI_TEST_CHECK( !checkBoxButton.IsChecked() ); + DALI_TEST_CHECK( !checkBoxButton.IsSelected() ); DALI_TEST_CHECK( !gCheckBoxButtonState ); - checkBoxButton.SetChecked( true ); + checkBoxButton.SetSelected( true ); - DALI_TEST_CHECK( checkBoxButton.IsChecked() ); + DALI_TEST_CHECK( checkBoxButton.IsSelected() ); DALI_TEST_CHECK( gCheckBoxButtonState ); END_TEST; } @@ -111,6 +111,7 @@ int UtcDaliCheckBoxButtonSetImages(void) Image image02 = CreateSolidColorImage( Color::RED, 30, 30 ); ImageActor imageActor02 = CreateSolidColorActor( Color::RED ); imageActor02.SetSize( 40, 40 ); + imageActor02.SetName( "imageActor02" ); Image image03 = CreateSolidColorImage( Color::RED, 50, 50 ); ImageActor imageActor03 = CreateSolidColorActor( Color::RED ); @@ -122,6 +123,8 @@ int UtcDaliCheckBoxButtonSetImages(void) Vector3 size; CheckBoxButton checkBoxButton = CheckBoxButton::New(); + checkBoxButton.SetName( "UtcDaliCheckBoxButtonSetImages" ); + Stage::GetCurrent().Add( checkBoxButton ); application.SendNotification(); application.Render(); @@ -133,79 +136,12 @@ int UtcDaliCheckBoxButtonSetImages(void) application.SendNotification(); application.Render(); - size = checkBoxButton.GetBackgroundImage().GetCurrentSize(); + size = checkBoxButton.GetCurrentSize(); DALI_TEST_EQUALS( size.width, 10.f, TEST_LOCATION ); DALI_TEST_EQUALS( size.height, 10.f, TEST_LOCATION ); checkBoxButton.SetBackgroundImage( imageActor01 ); - application.SendNotification(); - application.Render(); - - size = checkBoxButton.GetBackgroundImage().GetCurrentSize(); - - DALI_TEST_EQUALS( size.width, 20.f, TEST_LOCATION ); - DALI_TEST_EQUALS( size.height, 20.f, TEST_LOCATION ); - - checkBoxButton.SetCheckedImage( image02 ); - - application.SendNotification(); - application.Render(); - - size = checkBoxButton.GetCheckedImage().GetCurrentSize(); - - DALI_TEST_EQUALS( size.width, 30.f, TEST_LOCATION ); - DALI_TEST_EQUALS( size.height, 30.f, TEST_LOCATION ); - - checkBoxButton.SetCheckedImage( imageActor02 ); - - application.SendNotification(); - application.Render(); - - size = checkBoxButton.GetCheckedImage().GetCurrentSize(); - - DALI_TEST_EQUALS( size.width, 40.f, TEST_LOCATION ); - DALI_TEST_EQUALS( size.height, 40.f, TEST_LOCATION ); - - checkBoxButton.SetDisabledBackgroundImage( image03 ); - - application.SendNotification(); - application.Render(); - - size = checkBoxButton.GetDisabledBackgroundImage().GetCurrentSize(); - - DALI_TEST_EQUALS( size.width, 50.f, TEST_LOCATION ); - DALI_TEST_EQUALS( size.height, 50.f, TEST_LOCATION ); - - checkBoxButton.SetDisabledBackgroundImage( imageActor03 ); - - application.SendNotification(); - application.Render(); - - size = checkBoxButton.GetDisabledBackgroundImage().GetCurrentSize(); - - DALI_TEST_EQUALS( size.width, 60.f, TEST_LOCATION ); - DALI_TEST_EQUALS( size.height, 60.f, TEST_LOCATION ); - - checkBoxButton.SetDisabledCheckedImage( image04 ); - - application.SendNotification(); - application.Render(); - - size = checkBoxButton.GetDisabledCheckedImage().GetCurrentSize(); - - DALI_TEST_EQUALS( size.width, 70.f, TEST_LOCATION ); - DALI_TEST_EQUALS( size.height, 70.f, TEST_LOCATION ); - - checkBoxButton.SetDisabledCheckedImage( imageActor04 ); - - application.SendNotification(); - application.Render(); - - size = checkBoxButton.GetDisabledCheckedImage().GetCurrentSize(); - - DALI_TEST_EQUALS( size.width, 80.f, TEST_LOCATION ); - DALI_TEST_EQUALS( size.height, 80.f, TEST_LOCATION ); END_TEST; }