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-TextSelectionPopup.cpp;h=dc7fcc7f1d605d9fa4b3a3a527c735ed7a0fe133;hp=b1d76da86f9e57c152c012742dde1334ec492140;hb=30f34e317e33abd5f6926cc418584a4f8d0c60fc;hpb=8e7cfd0c114bf778287cc6e67d0f42f3c866e205 diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextSelectionPopup.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextSelectionPopup.cpp index b1d76da..dc7fcc7 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextSelectionPopup.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextSelectionPopup.cpp @@ -25,6 +25,13 @@ using namespace Dali; using namespace Toolkit; +namespace +{ + +const char* TEST_IMAGE_FILE_NAME = "selection-popup-border.9.png"; + +} + void dali_textselectionpopup_startup(void) { test_return_value = TET_UNDEF; @@ -107,6 +114,33 @@ int UtcDaliToolkitTextSelectionPopupDownCastP(void) END_TEST; } +int UtcDaliToolkitTextSelectionPopupBackgroundBorderP(void) +{ + ToolkitTestApplication application; + TextSelectionPopup textSelectionPopup; + textSelectionPopup = TextSelectionPopup::New( NULL ); + + textSelectionPopup.SetProperty( TextSelectionPopup::Property::BACKGROUND_BORDER, + Property::Map().Add( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME ) ); + + Property::Value value = textSelectionPopup.GetProperty( TextSelectionPopup::Property::BACKGROUND_BORDER ); + + Property::Map map; + value.Get( map ); + + Property::Value* returnValue = map.Find( Dali::Toolkit::ImageVisual::Property::URL ); + DALI_TEST_CHECK( NULL != returnValue ); + + if( returnValue ) + { + std::string url; + returnValue->Get( url ); + DALI_TEST_EQUALS( TEST_IMAGE_FILE_NAME, url, TEST_LOCATION ); + } + + END_TEST; +} + // TextSelectionToolBar is used TextSelectionPopup, below tests it individually int UtcDaliToolkitTextSelectionToolBarP(void) @@ -163,3 +197,36 @@ int UtcDaliToolkitTextSelectionToolBarScrollBarP(void) DALI_TEST_CHECK( toolbar ); END_TEST; } + +int UtcDaliToolkitTextSelectionToolBarScrollView(void) +{ + // Configures the ScrollView within the TextSelectionToolbar + ToolkitTestApplication application; + + TextSelectionToolbar toolbar = TextSelectionToolbar::New(); + DALI_TEST_CHECK( toolbar ); + Stage::GetCurrent().Add( toolbar ); + + Property::Map map; + map["overshootEffectColor"] = Color::RED; + map["overshootSize"] = Vector2(50.0f, 50.f); + toolbar.SetProperty( Toolkit::TextSelectionToolbar::Property::SCROLL_VIEW, map ); + + application.SendNotification(); + application.Render(); + + Actor actor = toolbar.FindChildByName("TextSelectionScrollView"); + DALI_TEST_CHECK( actor ); + + ScrollView scrollView = ScrollView::DownCast( actor ); + DALI_TEST_CHECK( scrollView ); + + Vector4 color = scrollView.GetProperty( Toolkit::Scrollable::Property::OVERSHOOT_EFFECT_COLOR ); + DALI_TEST_EQUALS( color, Color::RED, TEST_LOCATION ); + + Vector2 size = scrollView.GetProperty( Toolkit::Scrollable::Property::OVERSHOOT_SIZE ); + DALI_TEST_EQUALS( size, Vector2(50.0f, 50.f), TEST_LOCATION ); + + END_TEST; +} +