X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-TextLabel.cpp;h=93a644baeef5a901328c1039159c9393d5ed4c3c;hb=5e351965bad7e1de2e94027548b022bac692603c;hp=5471c95b1d9980bca54d1c438d7436713581e922;hpb=f2a6a134e4b939815b40f417f5aca61a6fccf92e;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp index 5471c95..93a644b 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp @@ -420,8 +420,9 @@ int UtcDaliToolkitTextLabelSetPropertyP(void) Property::Map shadowMapSet; Property::Map shadowMapGet; - shadowMapSet.Insert( "color", "green" ); - shadowMapSet.Insert( "offset", "2 2" ); + shadowMapSet.Insert( "color", Color::GREEN ); + shadowMapSet.Insert( "offset", Vector2(2.0f, 2.0f) ); + shadowMapSet.Insert( "blurRadius", 5.0f ); label.SetProperty( TextLabel::Property::SHADOW, shadowMapSet ); @@ -431,8 +432,9 @@ int UtcDaliToolkitTextLabelSetPropertyP(void) shadowMapSet.Clear(); Property::Map shadowDisabledMapGet; - shadowDisabledMapGet.Insert( "color", "green" ); - shadowDisabledMapGet.Insert( "offset", "0 0" ); + shadowDisabledMapGet.Insert( "color", Color::GREEN ); + shadowDisabledMapGet.Insert( "offset", Vector2(0.0f, 0.0f) ); + shadowDisabledMapGet.Insert( "blurRadius", 5.0f ); label.SetProperty( TextLabel::Property::SHADOW, shadowMapSet ); @@ -474,6 +476,13 @@ int UtcDaliToolkitTextLabelSetPropertyP(void) label.SetProperty( TextLabel::Property::ELLIPSIS, true ); DALI_TEST_CHECK( label.GetProperty( TextLabel::Property::ELLIPSIS ) ); + // Check the layout direction property + label.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::RIGHT_TO_LEFT ); + DALI_TEST_EQUALS( label.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::RIGHT_TO_LEFT ), TEST_LOCATION ); + + application.SendNotification(); + application.Render(); + END_TEST; } @@ -621,6 +630,12 @@ int UtcDaliToolkitTextlabelScrollingP(void) // Render some text with the shared atlas backend labelImmediate.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true ); labelFinished.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true ); + + labelImmediate.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false ); + labelFinished.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false ); + + labelImmediate.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true ); + labelFinished.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true ); application.SendNotification(); application.Render(); @@ -1066,6 +1081,7 @@ int UtcDaliToolkitTextlabelTextStyle01(void) Property::Map shadowMapSet; shadowMapSet.Insert( "color", "green" ); shadowMapSet.Insert( "offset", "2 2" ); + shadowMapSet.Insert( "blurRadius", "3" ); label.SetProperty( TextLabel::Property::SHADOW, shadowMapSet ); outlineMapSet["color"] = Color::RED; @@ -1109,3 +1125,32 @@ int UtcDaliToolkitTextlabelTextStyle01(void) END_TEST; } + +int UtcDaliToolkitTextlabelMultiline(void) +{ + ToolkitTestApplication application; + tet_infoline(" UtcDaliToolkitTextlabelMultiline"); + + TextLabel label = TextLabel::New(); + label.SetProperty( TextLabel::Property::TEXT, "Hello world Hello world Hello world Hello world Hello world Hello world" ); + label.SetProperty( TextLabel::Property::POINT_SIZE, 20 ); + label.SetProperty( TextLabel::Property::MULTI_LINE, false ); + Stage::GetCurrent().Add( label ); + + application.SendNotification(); + application.Render(); + + int lineCount = label.GetProperty( TextLabel::Property::LINE_COUNT ); + DALI_TEST_EQUALS( lineCount, 1, TEST_LOCATION ); + + label.SetProperty( TextLabel::Property::MULTI_LINE, true ); + + application.SendNotification(); + application.Render(); + + lineCount = label.GetProperty( TextLabel::Property::LINE_COUNT ); + DALI_TEST_EQUALS( true, (lineCount > 1) , TEST_LOCATION ); + + + END_TEST; +}