X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-TextLabel.cpp;h=659eb5420039ab9be5e8f91b3aa4d4d7d7535714;hb=6c3f5edbc48a8bed629b24d3f8cdf10b0675c14f;hp=846446bf5ce3005b1f40b9dc6fab144f45df2381;hpb=6d44334a46a0b3321824ee05854cef4aa57b1e21;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 846446b..659eb54 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(); @@ -954,7 +969,7 @@ int UtcDaliToolkitTextlabelEllipsis(void) END_TEST; } -int UtcDaliToolkitTextlabelTextWarpMode(void) +int UtcDaliToolkitTextlabelTextWrapMode(void) { ToolkitTestApplication application; tet_infoline(" UtcDaliToolkitTextlabelTextWarpMode"); @@ -971,7 +986,8 @@ int UtcDaliToolkitTextlabelTextWarpMode(void) //label.SetProperty( TextLabel::Property::POINT_SIZE, 18 ); Stage::GetCurrent().Add( label ); - label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, "WRAP_MODE_WORD" ); + label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, "WORD" ); + DALI_TEST_EQUALS( label.GetProperty< int >( TextLabel::Property::LINE_WRAP_MODE ), static_cast< int >( Text::LineWrap::WORD ), TEST_LOCATION ); application.SendNotification(); application.Render(); @@ -979,17 +995,34 @@ int UtcDaliToolkitTextlabelTextWarpMode(void) lineCount = label.GetProperty( TextLabel::Property::LINE_COUNT ); DALI_TEST_EQUALS( lineCount, 4, TEST_LOCATION ); + label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, "CHARACTER" ); + DALI_TEST_EQUALS( label.GetProperty< int >( TextLabel::Property::LINE_WRAP_MODE ), static_cast< int >( Text::LineWrap::CHARACTER ), TEST_LOCATION ); + application.SendNotification(); + application.Render(); - label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, "WRAP_MODE_CHARACTER" ); + label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, Text::LineWrap::WORD ); + DALI_TEST_EQUALS( label.GetProperty< int >( TextLabel::Property::LINE_WRAP_MODE ), static_cast< int >( Text::LineWrap::WORD ), TEST_LOCATION ); application.SendNotification(); application.Render(); + lineCount = label.GetProperty( TextLabel::Property::LINE_COUNT ); + DALI_TEST_EQUALS( lineCount, 4, TEST_LOCATION ); + + label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, Text::LineWrap::CHARACTER ); + DALI_TEST_EQUALS( label.GetProperty< int >( TextLabel::Property::LINE_WRAP_MODE ), static_cast< int >( Text::LineWrap::CHARACTER ), TEST_LOCATION ); + + application.SendNotification(); + application.Render(); lineCount = label.GetProperty( TextLabel::Property::LINE_COUNT ); DALI_TEST_EQUALS( lineCount, 3, TEST_LOCATION ); + tet_infoline( "Ensure invalid string does not change wrapping mode" ); + label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, "InvalidWrapMode" ); + DALI_TEST_EQUALS( label.GetProperty< int >( TextLabel::Property::LINE_WRAP_MODE ), static_cast< int >( Text::LineWrap::CHARACTER ), TEST_LOCATION ); + END_TEST; } @@ -1048,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;