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-Button.cpp;h=5aff1464b572a3f85539eaa4a259665448db8902;hp=b5ec1f1852e1543c91d7b5cb594c7384b8666a0f;hb=958bd01cb1bc4cf43cbe740a7b041927d9d34ed6;hpb=08104f5a43a670c8078bec27bc0c3d4967cab325 diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Button.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Button.cpp index b5ec1f1..5aff146 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Button.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Button.cpp @@ -64,28 +64,6 @@ struct CallbackFunctor bool* mCallbackFlag; }; - -Image CreateSolidColorImage( const Vector4& color, unsigned int width, unsigned int height ) -{ - BufferImage imageData = BufferImage::New( width, height, Pixel::RGBA8888 ); - - // Create the image - PixelBuffer* pixbuf = imageData.GetBuffer(); - unsigned int size = width * height; - - for( size_t i = 0; i < size; i++ ) - { - pixbuf[i*4+0] = 0xFF * color.r; - pixbuf[i*4+1] = 0xFF * color.g; - pixbuf[i*4+2] = 0xFF * color.b; - pixbuf[i*4+3] = 0xFF * color.a; - } - - imageData.Update(); - - return imageData; -} - Dali::Integration::Point GetPointDownInside() { Dali::Integration::Point point; @@ -941,3 +919,56 @@ int UtcDaliButtonSetSelectedImageWithImageN(void) END_TEST; } + +int UtcDaliButtonSetSelectedColorP(void) +{ + ToolkitTestApplication application; + tet_infoline(" UtcDaliButtonSetSelectedColorP"); + + PushButton pushButton = PushButton::New(); + Stage::GetCurrent().Add( pushButton ); + + application.SendNotification(); + application.Render(); + + const Vector4 SET_COLOR = Color::BLUE; + + pushButton.SetSize( Vector2( 20.0f, 20.0f ) ); + pushButton.SetProperty( Button::Property::SELECTED_COLOR, SET_COLOR ); + + application.SendNotification(); + application.Render(); + + Vector4 color = pushButton.GetProperty( Button::Property::SELECTED_COLOR ); + + DALI_TEST_EQUALS( color, SET_COLOR, TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliButtonSetUnSelectedColorP(void) +{ + ToolkitTestApplication application; + tet_infoline(" UtcDaliButtonSetUnSelectedColorP"); + + PushButton pushButton = PushButton::New(); + Stage::GetCurrent().Add( pushButton ); + + application.SendNotification(); + application.Render(); + + const Vector4 SET_COLOR = Color::BLUE; + + pushButton.SetSize( Vector2( 20.0f, 20.0f ) ); + pushButton.SetProperty( Button::Property::UNSELECTED_COLOR, SET_COLOR ); + + application.SendNotification(); + application.Render(); + + Vector4 color = pushButton.GetProperty( Button::Property::UNSELECTED_COLOR ); + + DALI_TEST_EQUALS( color, SET_COLOR, TEST_LOCATION ); + + END_TEST; +} +