X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-TextView.cpp;h=cb3f34a418b7fb6edb20a616c1fe0e8987b4a103;hb=7f35cb5ac96b2360bba850dfa20d88bbc9f9a362;hp=08e37d1d5e462fc24a3dc162a7ac565135fe8cb7;hpb=d5e3ed5f5b1c8fdba3ae97ead8729620f54b3836;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextView.cpp
index 08e37d1..cb3f34a 100644
--- a/automated-tests/src/dali-toolkit/utc-Dali-TextView.cpp
+++ b/automated-tests/src/dali-toolkit/utc-Dali-TextView.cpp
@@ -47,10 +47,7 @@ const char* const PROPERTY_MULTILINE_POLICY = "multiline-policy";
const char* const PROPERTY_WIDTH_EXCEED_POLICY = "width-exceed-policy";
const char* const PROPERTY_HEIGHT_EXCEED_POLICY = "height-exceed-policy";
const char* const PROPERTY_LINE_JUSTIFICATION = "line-justification";
-const char* const PROPERTY_FADE_BOUNDARY_LEFT = "fade-boundary-left";
-const char* const PROPERTY_FADE_BOUNDARY_RIGHT = "fade-boundary-right";
-const char* const PROPERTY_FADE_BOUNDARY_TOP = "fade-boundary-top";
-const char* const PROPERTY_FADE_BOUNDARY_BOTTOM = "fade-boundary-bottom";
+const char* const PROPERTY_FADE_BOUNDARY = "fade-boundary";
const char* const PROPERTY_LINE_HEIGHT_OFFSET = "line-height-offset";
const char* const PROPERTY_HORIZONTAL_ALIGNMENT = "horizontal-alignment";
const char* const PROPERTY_VERTICAL_ALIGNMENT = "vertical-alignment";
@@ -236,13 +233,15 @@ int UtcDaliTextViewSetAndGetText(void)
ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
DALI_TEST_CHECK( registry );
- gNumberObjectCreated = 0;
+ gNumberObjectCreated = 0u;
registry.ObjectCreatedSignal().Connect(&TestCallback);
// Following string should create three text-actors ([Hel], [lo wo] and [rld]).
std::string text( "Hello world!\n"
"\n" );
+ view.SetMarkupProcessingEnabled( true ); // Enables markup processing.
+
Stage::GetCurrent().Add( view );
view.SetText( text );
@@ -451,7 +450,7 @@ int UtcDaliTextViewSetAndGetHeightExceedPolicy(void)
}
catch( Dali::DaliException& e )
{
- DALI_TEST_EQUALS( e.mCondition, "!\"TextView::CombineExceedPolicies() Invalid width and height exceed policies combination\"", TEST_LOCATION );
+ DALI_TEST_EQUALS( e.condition, "!\"TextView::CombineExceedPolicies() Invalid width and height exceed policies combination\"", TEST_LOCATION );
}
catch( ... )
{
@@ -487,6 +486,7 @@ int UtcDaliTextViewTestLayoutOptions02(void)
TextView textView = TextView::New();
textView.SetSnapshotModeEnabled( false ); // Disables offscreen rendering.
+ textView.SetMarkupProcessingEnabled( true ); // Enables markup processing.
Stage::GetCurrent().Add( textView );
@@ -626,7 +626,9 @@ int UtcDaliTextViewSnapshotEnable(void)
// Avoids the frame buffer texture to throw an exception.
application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
- TextView view = TextView::New( "Hello world! This is a snapshot test." );
+ TextView view = TextView::New();
+ view.SetMarkupProcessingEnabled( true ); // Enables markup processing.
+ view.SetText( "Hello world! This is a snapshot test." );
Stage::GetCurrent().Add( view );
@@ -746,25 +748,13 @@ int UtcDaliTextViewSetProperty(void)
DALI_TEST_CHECK( Toolkit::TextView::Justified == view.GetLineJustification() );
//Test fade boundary property
- unsigned int testValue = 23;
- PixelSize leftFadeBoundary(testValue);
- view.SetProperty(view.GetPropertyIndex(PROPERTY_FADE_BOUNDARY_LEFT), testValue);
- DALI_TEST_CHECK( leftFadeBoundary == view.GetFadeBoundary().mLeft );
-
- testValue = 26;
- PixelSize rightFadeBoundary(testValue);
- view.SetProperty(view.GetPropertyIndex(PROPERTY_FADE_BOUNDARY_RIGHT), testValue);
- DALI_TEST_CHECK( rightFadeBoundary == view.GetFadeBoundary().mRight );
-
- testValue = 2;
- PixelSize topFadeBoundary(testValue);
- view.SetProperty(view.GetPropertyIndex(PROPERTY_FADE_BOUNDARY_TOP), testValue);
- DALI_TEST_CHECK( topFadeBoundary == view.GetFadeBoundary().mTop );
-
- testValue = 11;
- PixelSize bottomFadeBoundary(testValue);
- view.SetProperty(view.GetPropertyIndex(PROPERTY_FADE_BOUNDARY_BOTTOM), testValue);
- DALI_TEST_CHECK( bottomFadeBoundary == view.GetFadeBoundary().mBottom );
+ const Vector4 testValue( 23.f, 26.f, 2.f, 11.f );
+
+ view.SetProperty(view.GetPropertyIndex(PROPERTY_FADE_BOUNDARY), testValue);
+ DALI_TEST_CHECK( testValue.x == view.GetFadeBoundary().mLeft );
+ DALI_TEST_CHECK( testValue.y == view.GetFadeBoundary().mRight );
+ DALI_TEST_CHECK( testValue.z == view.GetFadeBoundary().mTop );
+ DALI_TEST_CHECK( testValue.w == view.GetFadeBoundary().mBottom );
//Test Line height offset property
float testOffsetValue = 14.04f;
@@ -801,8 +791,10 @@ int UtcDaliTextViewUnderlineText(void)
tet_infoline("UtcDaliTextViewUnderlineText: ");
ToolkitTestApplication application;
- TextView textView = TextView::New( "gggggggggggggg" );
+ TextView textView = TextView::New();
textView.SetSnapshotModeEnabled( false );
+ textView.SetMarkupProcessingEnabled( true );
+ textView.SetText( "gggggggggggggg" );
textView.SetSize( 150.f, 100.f );