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-Popup.cpp;h=cd38bc380c55589d0e3391a16e487aaeed35b6e6;hp=c3eaa4bdfcdea1edef8d4c999142f5b9be9087ec;hb=44aaab9bdcb6bbd8d7c3a4266abe330767c209c4;hpb=47937fd0ad346e3b9f48126bc611e36cb4e271d5 diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp index c3eaa4b..cd38bc3 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -916,11 +916,11 @@ int UtcDaliPopupPropertyContextualMode(void) // Test all contextual modes. const char* mode[5] = { "NON_CONTEXTUAL", "ABOVE", "RIGHT", "BELOW", "LEFT" }; Vector2 offsetValues[5]; - offsetValues[0] = Vector2( 0.0f, 0.0f ); - offsetValues[1] = Vector2( 0.0f, -10.0f ); - offsetValues[2] = Vector2( 10.0f, 0.0f ); - offsetValues[3] = Vector2( 0.0f, 10.0f ); - offsetValues[4] = Vector2( -10.0f, 0.0f ); + offsetValues[0] = Vector2( 0.375f, 0.0f ); + offsetValues[1] = Vector2( -0.125f, -10.5f ); + offsetValues[2] = Vector2( 10.875f, -0.5f ); + offsetValues[3] = Vector2( -0.125f, 10.5f ); + offsetValues[4] = Vector2( -10.875f, -0.5f ); for( int i = 0; i < 5; ++i ) { @@ -1014,11 +1014,11 @@ int UtcDaliPopupPropertyBackgroundImage(void) Popup popup = Popup::New(); Stage::GetCurrent().Add( popup ); - // Check setting an invalid image. + // Check setting an image popup.SetProperty( Toolkit::Popup::Property::POPUP_BACKGROUND_IMAGE, "invalid-image.png" ); std::string resultString; popup.GetProperty( Toolkit::Popup::Property::POPUP_BACKGROUND_IMAGE ).Get( resultString ); - DALI_TEST_EQUALS( resultString, std::string(""), TEST_LOCATION ); + DALI_TEST_EQUALS( resultString, "invalid-image.png", TEST_LOCATION ); END_TEST; } @@ -1433,3 +1433,26 @@ int UtcDaliPopupOnKeyEvent(void) END_TEST; } + +int UtcDaliPopupSetPopupBackgroundBorderProperty(void) +{ + ToolkitTestApplication application; + + tet_infoline( "Set the background border property of a popup & retrieve it" ); + Popup popup = Popup::New(); + + Rect< int > rect( 40, 30, 20, 10 ); + tet_infoline( "Ensure value we want to set is different from what is already set" ); + DALI_TEST_CHECK( rect != popup.GetProperty( Popup::Property::POPUP_BACKGROUND_BORDER ).Get< Rect< int > >() ); + + tet_infoline( "Set the property and retrieve it to make sure it's the value we set" ); + popup.SetProperty( Popup::Property::POPUP_BACKGROUND_BORDER, rect ); + DALI_TEST_EQUALS( rect, popup.GetProperty( Popup::Property::POPUP_BACKGROUND_BORDER ).Get< Rect< int > >(), TEST_LOCATION ); + + tet_infoline( "Set a vector4 as well which should also work" ); + Vector4 vectorValue( 10.0f, 20.0f, 30.0f, 40.0f ); + popup.SetProperty( Popup::Property::POPUP_BACKGROUND_BORDER, vectorValue ); + DALI_TEST_EQUALS( Rect< int >( 10, 20, 30, 40 ), popup.GetProperty( Popup::Property::POPUP_BACKGROUND_BORDER ).Get< Rect< int > >(), TEST_LOCATION ); + + END_TEST; +}