2 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
22 #include <dali-toolkit-test-suite-utils.h>
23 #include <dali-toolkit/dali-toolkit.h>
24 #include <dali-toolkit/devel-api/controls/text-controls/text-label-devel.h>
25 #include <dali-toolkit/devel-api/text/text-enumerations-devel.h>
28 using namespace Toolkit;
30 void dali_textlabel_startup(void)
32 test_return_value = TET_UNDEF;
35 void dali_textlabel_cleanup(void)
37 test_return_value = TET_PASS;
43 const char* const PROPERTY_NAME_RENDERING_BACKEND = "renderingBackend";
44 const char* const PROPERTY_NAME_TEXT = "text";
45 const char* const PROPERTY_NAME_FONT_FAMILY = "fontFamily";
46 const char* const PROPERTY_NAME_FONT_STYLE = "fontStyle";
47 const char* const PROPERTY_NAME_POINT_SIZE = "pointSize";
48 const char* const PROPERTY_NAME_MULTI_LINE = "multiLine";
49 const char* const PROPERTY_NAME_HORIZONTAL_ALIGNMENT = "horizontalAlignment";
50 const char* const PROPERTY_NAME_VERTICAL_ALIGNMENT = "verticalAlignment";
51 const char* const PROPERTY_NAME_TEXT_COLOR = "textColor";
52 const char* const PROPERTY_NAME_SHADOW_OFFSET = "shadowOffset";
53 const char* const PROPERTY_NAME_SHADOW_COLOR = "shadowColor";
54 const char* const PROPERTY_NAME_UNDERLINE_ENABLED = "underlineEnabled";
55 const char* const PROPERTY_NAME_UNDERLINE_COLOR = "underlineColor";
56 const char* const PROPERTY_NAME_UNDERLINE_HEIGHT = "underlineHeight";
57 const char* const PROPERTY_NAME_ENABLE_MARKUP = "enableMarkup";
58 const char* const PROPERTY_NAME_ENABLE_AUTO_SCROLL = "enableAutoScroll";
59 const char* const PROPERTY_NAME_ENABLE_AUTO_SCROLL_SPEED = "autoScrollSpeed";
60 const char* const PROPERTY_NAME_ENABLE_AUTO_SCROLL_LOOPS = "autoScrollLoopCount";
61 const char* const PROPERTY_NAME_ENABLE_AUTO_SCROLL_GAP = "autoScrollGap";
63 const char* const PROPERTY_NAME_LINE_SPACING = "lineSpacing";
64 const char* const PROPERTY_NAME_UNDERLINE = "underline";
65 const char* const PROPERTY_NAME_SHADOW = "shadow";
66 const char* const PROPERTY_NAME_EMBOSS = "emboss";
67 const char* const PROPERTY_NAME_OUTLINE = "outline";
68 const char* const PROPERTY_NAME_BACKGROUND = "textBackground";
70 const char* const PROPERTY_NAME_PIXEL_SIZE = "pixelSize";
71 const char* const PROPERTY_NAME_ELLIPSIS = "ellipsis";
72 const char* const PROPERTY_NAME_AUTO_SCROLL_LOOP_DELAY = "autoScrollLoopDelay";
74 const int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND;
75 const std::string DEFAULT_FONT_DIR( "/resources/fonts" );
76 const unsigned int EMOJI_FONT_SIZE = 3840u; // 60 * 64
78 bool DaliTestCheckMaps( const Property::Map& fontStyleMapGet, const Property::Map& fontStyleMapSet )
80 if( fontStyleMapGet.Count() == fontStyleMapSet.Count() )
82 for( unsigned int index = 0u; index < fontStyleMapGet.Count(); ++index )
84 const KeyValuePair& valueGet = fontStyleMapGet.GetKeyValue( index );
86 Property::Value* valueSet = NULL;
87 if ( valueGet.first.type == Property::Key::INDEX )
89 valueSet = fontStyleMapSet.Find( valueGet.first.indexKey );
93 // Get Key is a string so searching Set Map for a string key
94 valueSet = fontStyleMapSet.Find( valueGet.first.stringKey );
97 if( NULL != valueSet )
99 if( valueSet->GetType() == Dali::Property::STRING && ( valueGet.second.Get<std::string>() != valueSet->Get<std::string>() ) )
101 tet_printf( "Value got : [%s], expected : [%s]", valueGet.second.Get<std::string>().c_str(), valueSet->Get<std::string>().c_str() );
104 else if( valueSet->GetType() == Dali::Property::BOOLEAN && ( valueGet.second.Get<bool>() != valueSet->Get<bool>() ) )
106 tet_printf( "Value got : [%d], expected : [%d]", valueGet.second.Get<bool>(), valueSet->Get<bool>() );
109 else if( valueSet->GetType() == Dali::Property::INTEGER && ( valueGet.second.Get<int>() != valueSet->Get<int>() ) )
111 tet_printf( "Value got : [%d], expected : [%d]", valueGet.second.Get<int>(), valueSet->Get<int>() );
114 else if( valueSet->GetType() == Dali::Property::FLOAT && ( valueGet.second.Get<float>() != valueSet->Get<float>() ) )
116 tet_printf( "Value got : [%f], expected : [%f]", valueGet.second.Get<float>(), valueSet->Get<float>() );
119 else if( valueSet->GetType() == Dali::Property::VECTOR2 && ( valueGet.second.Get<Vector2>() != valueSet->Get<Vector2>() ) )
121 Vector2 vector2Get = valueGet.second.Get<Vector2>();
122 Vector2 vector2Set = valueSet->Get<Vector2>();
123 tet_printf( "Value got : [%f, %f], expected : [%f, %f]", vector2Get.x, vector2Get.y, vector2Set.x, vector2Set.y );
126 else if( valueSet->GetType() == Dali::Property::VECTOR4 && ( valueGet.second.Get<Vector4>() != valueSet->Get<Vector4>() ) )
128 Vector4 vector4Get = valueGet.second.Get<Vector4>();
129 Vector4 vector4Set = valueSet->Get<Vector4>();
130 tet_printf( "Value got : [%f, %f, %f, %f], expected : [%f, %f, %f, %f]", vector4Get.r, vector4Get.g, vector4Get.b, vector4Get.a, vector4Set.r, vector4Set.g, vector4Set.b, vector4Set.a );
136 if ( valueGet.first.type == Property::Key::INDEX )
138 tet_printf( " The key %d doesn't exist.", valueGet.first.indexKey );
142 tet_printf( " The key %s doesn't exist.", valueGet.first.stringKey.c_str() );
154 int UtcDaliToolkitTextLabelConstructorP(void)
156 ToolkitTestApplication application;
157 tet_infoline(" UtcDaliToolkitTextLabelConstructorP");
159 DALI_TEST_CHECK( !textLabel );
163 int UtcDaliToolkitTextLabelNewP(void)
165 ToolkitTestApplication application;
166 tet_infoline(" UtcDaliToolkitTextLabelNewP");
167 TextLabel textLabel = TextLabel::New( "Test Text" );
168 DALI_TEST_CHECK( textLabel );
172 int UtcDaliToolkitTextLabelDownCastP(void)
174 ToolkitTestApplication application;
175 tet_infoline(" UtcDaliToolkitTextLabelDownCastP");
176 TextLabel textLabel1 = TextLabel::New();
177 BaseHandle object( textLabel1 );
179 TextLabel textLabel2 = TextLabel::DownCast( object );
180 DALI_TEST_CHECK( textLabel2 );
182 TextLabel textLabel3 = DownCast< TextLabel >( object );
183 DALI_TEST_CHECK( textLabel3 );
187 int UtcDaliToolkitTextLabelDownCastN(void)
189 ToolkitTestApplication application;
190 tet_infoline(" UtcDaliToolkitTextLabelDownCastN");
191 BaseHandle uninitializedObject;
192 TextLabel textLabel1 = TextLabel::DownCast( uninitializedObject );
193 DALI_TEST_CHECK( !textLabel1 );
195 TextLabel textLabel2 = DownCast< TextLabel >( uninitializedObject );
196 DALI_TEST_CHECK( !textLabel2 );
200 int UtcDaliToolkitTextLabelCopyConstructorP(void)
202 ToolkitTestApplication application;
203 tet_infoline(" UtcDaliToolkitTextLabelCopyConstructorP");
204 TextLabel textLabel = TextLabel::New();
205 textLabel.SetProperty( TextLabel::Property::TEXT_COLOR, Color::RED );
207 TextLabel copy( textLabel );
208 DALI_TEST_CHECK( copy );
209 DALI_TEST_CHECK( copy.GetProperty<Vector4>( TextLabel::Property::TEXT_COLOR ) == textLabel.GetProperty<Vector4>( TextLabel::Property::TEXT_COLOR ) );
213 int UtcDaliToolkitTextLabelAssignmentOperatorP(void)
215 ToolkitTestApplication application;
216 tet_infoline(" UtcDaliToolkitTextLabelAssingmentOperatorP");
217 TextLabel textLabel = TextLabel::New();
218 textLabel.SetProperty( TextLabel::Property::TEXT_COLOR, Color::RED );
220 TextLabel copy = textLabel;
221 DALI_TEST_CHECK( copy );
222 DALI_TEST_CHECK( copy.GetProperty<Vector4>( TextLabel::Property::TEXT_COLOR ) == textLabel.GetProperty<Vector4>( TextLabel::Property::TEXT_COLOR ) );
226 // Positive test case for a method
227 int UtcDaliToolkitTextLabelGetPropertyP(void)
229 ToolkitTestApplication application;
230 tet_infoline(" UtcDaliToolkitTextLabelGetPropertyP");
231 TextLabel label = TextLabel::New("Test Text");
232 DALI_TEST_CHECK( label );
234 // Check Property Indices are correct
235 DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_RENDERING_BACKEND ) == TextLabel::Property::RENDERING_BACKEND );
236 DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_TEXT ) == TextLabel::Property::TEXT );
237 DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_FONT_FAMILY ) == TextLabel::Property::FONT_FAMILY );
238 DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_FONT_STYLE ) == TextLabel::Property::FONT_STYLE );
239 DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_POINT_SIZE ) == TextLabel::Property::POINT_SIZE );
240 DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_MULTI_LINE ) == TextLabel::Property::MULTI_LINE );
241 DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_HORIZONTAL_ALIGNMENT ) == TextLabel::Property::HORIZONTAL_ALIGNMENT );
242 DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_VERTICAL_ALIGNMENT ) == TextLabel::Property::VERTICAL_ALIGNMENT );
243 DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_TEXT_COLOR ) == TextLabel::Property::TEXT_COLOR );
244 DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_SHADOW_OFFSET ) == TextLabel::Property::SHADOW_OFFSET );
245 DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_SHADOW_COLOR ) == TextLabel::Property::SHADOW_COLOR );
246 DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_UNDERLINE_ENABLED ) == TextLabel::Property::UNDERLINE_ENABLED );
247 DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_UNDERLINE_COLOR ) == TextLabel::Property::UNDERLINE_COLOR );
248 DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_UNDERLINE_HEIGHT) == TextLabel::Property::UNDERLINE_HEIGHT );
249 DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ENABLE_MARKUP) == TextLabel::Property::ENABLE_MARKUP );
250 DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ENABLE_AUTO_SCROLL ) == TextLabel::Property::ENABLE_AUTO_SCROLL );
251 DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ENABLE_AUTO_SCROLL_SPEED ) == TextLabel::Property::AUTO_SCROLL_SPEED );
252 DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ENABLE_AUTO_SCROLL_LOOPS ) == TextLabel::Property::AUTO_SCROLL_LOOP_COUNT );
253 DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ENABLE_AUTO_SCROLL_GAP ) == TextLabel::Property::AUTO_SCROLL_GAP );
254 DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_LINE_SPACING ) == TextLabel::Property::LINE_SPACING );
255 DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_UNDERLINE ) == TextLabel::Property::UNDERLINE );
256 DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_SHADOW ) == TextLabel::Property::SHADOW );
257 DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_EMBOSS ) == TextLabel::Property::EMBOSS );
258 DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_OUTLINE ) == TextLabel::Property::OUTLINE );
259 DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_BACKGROUND ) == DevelTextLabel::Property::BACKGROUND );
260 DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_PIXEL_SIZE ) == TextLabel::Property::PIXEL_SIZE );
261 DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ELLIPSIS ) == TextLabel::Property::ELLIPSIS );
262 DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_AUTO_SCROLL_LOOP_DELAY ) == TextLabel::Property::AUTO_SCROLL_LOOP_DELAY );
267 int UtcDaliToolkitTextLabelSetPropertyP(void)
269 ToolkitTestApplication application;
270 tet_infoline(" UtcDaliToolkitTextLabelSetPropertyP");
271 TextLabel label = TextLabel::New();
272 DALI_TEST_CHECK( label );
274 Stage::GetCurrent().Add( label );
276 // Note - we can't check the defaults since the stylesheets are platform-specific
277 label.SetProperty( TextLabel::Property::RENDERING_BACKEND, Text::RENDERING_SHARED_ATLAS );
278 DALI_TEST_EQUALS( (Text::RenderingType)label.GetProperty<int>( TextLabel::Property::RENDERING_BACKEND ), Text::RENDERING_SHARED_ATLAS, TEST_LOCATION );
280 // Check that text can be correctly reset
281 label.SetProperty( TextLabel::Property::TEXT, "Setting Text" );
282 DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::TEXT ), std::string("Setting Text"), TEST_LOCATION );
284 // Check font properties.
285 label.SetProperty( TextLabel::Property::FONT_FAMILY, "Setting font family" );
286 DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::FONT_FAMILY ), std::string("Setting font family"), TEST_LOCATION );
288 Property::Map fontStyleMapSet;
289 Property::Map fontStyleMapGet;
291 fontStyleMapSet.Insert( "weight", "bold" );
292 fontStyleMapSet.Insert( "width", "condensed" );
293 fontStyleMapSet.Insert( "slant", "italic" );
294 label.SetProperty( TextLabel::Property::FONT_STYLE, fontStyleMapSet );
296 fontStyleMapGet = label.GetProperty<Property::Map>( TextLabel::Property::FONT_STYLE );
297 DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
298 DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
300 // Check the old font style format.
301 fontStyleMapSet.Clear();
302 fontStyleMapSet.Insert( "weight", "thin" );
303 fontStyleMapSet.Insert( "width", "expanded" );
304 fontStyleMapSet.Insert( "slant", "oblique" );
305 const std::string strFontStyle = "{\"weight\":\"thin\",\"width\":\"expanded\",\"slant\":\"oblique\"}";
307 label.SetProperty( TextLabel::Property::FONT_STYLE, "{\"weight\":\"thin\",\"width\":\"expanded\",\"slant\":\"oblique\"}" );
308 std::string getFontStyle = label.GetProperty<std::string>( TextLabel::Property::FONT_STYLE );
309 DALI_TEST_EQUALS( getFontStyle, strFontStyle, TEST_LOCATION );
311 label.SetProperty( TextLabel::Property::POINT_SIZE, 10.f );
312 DALI_TEST_EQUALS( label.GetProperty<float>( TextLabel::Property::POINT_SIZE ), 10.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
315 fontStyleMapSet.Clear();
316 fontStyleMapSet.Insert( "weight", "normal" );
317 fontStyleMapSet.Insert( "slant", "oblique" );
319 label.SetProperty( TextLabel::Property::FONT_STYLE, fontStyleMapSet );
320 fontStyleMapGet = label.GetProperty<Property::Map>( TextLabel::Property::FONT_STYLE );
321 DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
322 DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
324 fontStyleMapSet.Clear();
325 fontStyleMapSet.Insert( "slant", "roman" );
327 label.SetProperty( TextLabel::Property::FONT_STYLE, fontStyleMapSet );
328 fontStyleMapGet = label.GetProperty<Property::Map>( TextLabel::Property::FONT_STYLE );
329 DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
331 // Replace 'roman' for 'normal'.
332 Property::Value* slantValue = fontStyleMapGet.Find( "slant" );
333 if( NULL != slantValue )
335 if( "normal" == slantValue->Get<std::string>() )
337 fontStyleMapGet["slant"] = "roman";
340 DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
342 fontStyleMapSet.Clear();
344 label.SetProperty( TextLabel::Property::FONT_STYLE, fontStyleMapSet );
345 fontStyleMapGet = label.GetProperty<Property::Map>( TextLabel::Property::FONT_STYLE );
346 DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
347 DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
350 label.SetProperty( TextLabel::Property::MULTI_LINE, true );
351 DALI_TEST_EQUALS( label.GetProperty<bool>( TextLabel::Property::MULTI_LINE ), true, TEST_LOCATION );
353 // Check that the Alignment properties can be correctly set
354 label.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
355 DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::HORIZONTAL_ALIGNMENT ), "CENTER", TEST_LOCATION );
356 label.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
357 DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::VERTICAL_ALIGNMENT ), "CENTER", TEST_LOCATION );
359 // Check that text color can be properly set
360 label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::BLUE );
361 DALI_TEST_EQUALS( label.GetProperty<Vector4>( TextLabel::Property::TEXT_COLOR ), Color::BLUE, TEST_LOCATION );
362 // The underline color is changed as well.
363 DALI_TEST_EQUALS( label.GetProperty<Vector4>( TextLabel::Property::UNDERLINE_COLOR ), Color::BLUE, TEST_LOCATION );
365 Property::Map underlineMapSet;
366 Property::Map underlineMapGet;
368 underlineMapSet.Insert( "enable", "false" );
369 underlineMapSet.Insert( "color", "blue" );
370 underlineMapSet.Insert( "height", "0" );
372 underlineMapGet = label.GetProperty<Property::Map>( TextLabel::Property::UNDERLINE );
373 DALI_TEST_EQUALS( underlineMapGet.Count(), underlineMapSet.Count(), TEST_LOCATION );
374 DALI_TEST_EQUALS( DaliTestCheckMaps( underlineMapGet, underlineMapSet ), true, TEST_LOCATION );
376 // Check that shadow parameters can be correctly set
377 label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 3.0f, 3.0f ) );
378 DALI_TEST_EQUALS( label.GetProperty<Vector2>( TextLabel::Property::SHADOW_OFFSET ), Vector2( 3.0f, 3.0f ), TEST_LOCATION );
379 label.SetProperty( TextLabel::Property::SHADOW_COLOR, Color::BLUE );
380 DALI_TEST_EQUALS( label.GetProperty<Vector4>( TextLabel::Property::SHADOW_COLOR ), Color::BLUE, TEST_LOCATION );
382 // Check that underline parameters can be correctly set
383 label.SetProperty( TextLabel::Property::UNDERLINE_ENABLED, true );
384 DALI_TEST_EQUALS( label.GetProperty<bool>( TextLabel::Property::UNDERLINE_ENABLED ), true, TEST_LOCATION );
385 label.SetProperty( TextLabel::Property::UNDERLINE_COLOR, Color::RED );
386 DALI_TEST_EQUALS( label.GetProperty<Vector4>( TextLabel::Property::UNDERLINE_COLOR ), Color::RED, TEST_LOCATION );
387 label.SetProperty( TextLabel::Property::UNDERLINE_HEIGHT, 1.0f );
388 DALI_TEST_EQUALS( label.GetProperty<float>( TextLabel::Property::UNDERLINE_HEIGHT ), 1.0f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
390 TextLabel label2 = TextLabel::New( "New text" );
391 DALI_TEST_CHECK( label2 );
392 DALI_TEST_EQUALS( label2.GetProperty<std::string>( TextLabel::Property::TEXT ), std::string("New text"), TEST_LOCATION );
394 // Check the enable markup property.
395 DALI_TEST_CHECK( !label.GetProperty<bool>( TextLabel::Property::ENABLE_MARKUP ) );
396 label.SetProperty( TextLabel::Property::ENABLE_MARKUP, true );
397 DALI_TEST_CHECK( label.GetProperty<bool>( TextLabel::Property::ENABLE_MARKUP ) );
399 // Check the text property when markup is enabled
400 label.SetProperty( TextLabel::Property::TEXT, "<color value='white'>Markup</color><color value='cyan'>Text</color>" );
401 DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::TEXT ), std::string("MarkupText"), TEST_LOCATION );
403 application.SendNotification();
404 application.Render();
406 // Check autoscroll properties
407 const int SCROLL_SPEED = 80;
408 const int SCROLL_LOOPS = 4;
409 const float SCROLL_GAP = 50.0f;
410 const float SCROLL_LOOP_DELAY = 0.3f;
411 const std::string STOP_IMMEDIATE = std::string( "IMMEDIATE" );
412 const std::string STOP_FINISH_LOOP = std::string( "FINISH_LOOP" );
414 label.SetProperty( TextLabel::Property::MULTI_LINE, false ); // Autoscroll only supported in single line
415 DALI_TEST_CHECK( !label.GetProperty<bool>( TextLabel::Property::ENABLE_AUTO_SCROLL ) );
416 label.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
417 DALI_TEST_CHECK( label.GetProperty<bool>( TextLabel::Property::ENABLE_AUTO_SCROLL ) );
418 label.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, SCROLL_SPEED );
419 DALI_TEST_EQUALS( SCROLL_SPEED, label.GetProperty<int>( TextLabel::Property::AUTO_SCROLL_SPEED ), TEST_LOCATION );
420 label.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, SCROLL_LOOPS );
421 DALI_TEST_EQUALS( SCROLL_LOOPS, label.GetProperty<int>( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT ), TEST_LOCATION );
422 label.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, SCROLL_GAP );
423 DALI_TEST_EQUALS( SCROLL_GAP, label.GetProperty<float>( TextLabel::Property::AUTO_SCROLL_GAP ), TEST_LOCATION );
424 label.SetProperty(TextLabel::Property::AUTO_SCROLL_LOOP_DELAY, SCROLL_LOOP_DELAY );
425 DALI_TEST_EQUALS( SCROLL_LOOP_DELAY, label.GetProperty<float>( TextLabel::Property::AUTO_SCROLL_LOOP_DELAY ), TEST_LOCATION );
427 //Check autoscroll stop type property
428 label.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::IMMEDIATE );
429 DALI_TEST_EQUALS( STOP_IMMEDIATE, label.GetProperty<std::string>( TextLabel::Property::AUTO_SCROLL_STOP_MODE ), TEST_LOCATION );
431 label.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::FINISH_LOOP );
432 DALI_TEST_EQUALS( STOP_FINISH_LOOP, label.GetProperty<std::string>( TextLabel::Property::AUTO_SCROLL_STOP_MODE ), TEST_LOCATION );
434 // test natural size with multi-line and line spacing
436 TextLabel label3 = TextLabel::New("Some text here\nend there\nend here");
437 Vector3 expected0(414.f, 192.f, 0.0f);
438 Vector3 expected1(414.f, 252.f, 0.0f);
439 label3.SetProperty(TextLabel::Property::MULTI_LINE, true);
440 label3.SetProperty(TextLabel::Property::LINE_SPACING, 0);
441 DALI_TEST_EQUALS(expected0, label3.GetNaturalSize(), TEST_LOCATION);
442 label3.SetProperty(TextLabel::Property::LINE_SPACING, 20);
443 DALI_TEST_EQUALS(expected1, label3.GetNaturalSize(), TEST_LOCATION);
446 // single line, line spacing must not affect natural size
448 const Vector3 expected0(948.f, 64.f, 0.0f);
449 const Vector3 expected1(948.f, 84.f, 0.0f);
450 TextLabel label3 = TextLabel::New("Some text here end there end here");
451 label3.SetProperty(TextLabel::Property::MULTI_LINE, false);
452 label3.SetProperty(TextLabel::Property::LINE_SPACING, 0);
453 DALI_TEST_EQUALS(expected0, label3.GetNaturalSize(), TEST_LOCATION);
454 label3.SetProperty(TextLabel::Property::LINE_SPACING, 20);
455 DALI_TEST_EQUALS(expected1, label3.GetNaturalSize(), TEST_LOCATION);
457 // Check the line spacing property
458 DALI_TEST_EQUALS( label.GetProperty<float>( TextLabel::Property::LINE_SPACING ), 0.0f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
459 label.SetProperty( TextLabel::Property::LINE_SPACING, 10.f );
460 DALI_TEST_EQUALS( label.GetProperty<float>( TextLabel::Property::LINE_SPACING ), 10.0f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
462 // Check the underline property
463 underlineMapSet.Clear();
464 underlineMapSet.Insert( "enable", "true" );
465 underlineMapSet.Insert( "color", "red" );
466 underlineMapSet.Insert( "height", "1" );
468 label.SetProperty( TextLabel::Property::UNDERLINE, underlineMapSet );
470 application.SendNotification();
471 application.Render();
473 underlineMapGet = label.GetProperty<Property::Map>( TextLabel::Property::UNDERLINE );
474 DALI_TEST_EQUALS( underlineMapGet.Count(), underlineMapSet.Count(), TEST_LOCATION );
475 DALI_TEST_EQUALS( DaliTestCheckMaps( underlineMapGet, underlineMapSet ), true, TEST_LOCATION );
477 underlineMapSet.Clear();
479 Property::Map underlineDisabledMapGet;
480 underlineDisabledMapGet.Insert( "enable", "false" );
481 underlineDisabledMapGet.Insert( "color", "red" );
482 underlineDisabledMapGet.Insert( "height", "1" );
484 label.SetProperty( TextLabel::Property::UNDERLINE, underlineMapSet );
485 underlineMapGet = label.GetProperty<Property::Map>( TextLabel::Property::UNDERLINE );
486 DALI_TEST_EQUALS( underlineMapGet.Count(), underlineDisabledMapGet.Count(), TEST_LOCATION );
487 DALI_TEST_EQUALS( DaliTestCheckMaps( underlineMapGet, underlineDisabledMapGet ), true, TEST_LOCATION );
489 // Check the shadow property
491 Property::Map shadowMapSet;
492 Property::Map shadowMapGet;
494 shadowMapSet.Insert( "color", Color::GREEN );
495 shadowMapSet.Insert( "offset", Vector2(2.0f, 2.0f) );
496 shadowMapSet.Insert( "blurRadius", 5.0f );
498 label.SetProperty( TextLabel::Property::SHADOW, shadowMapSet );
500 shadowMapGet = label.GetProperty<Property::Map>( TextLabel::Property::SHADOW );
501 DALI_TEST_EQUALS( shadowMapGet.Count(), shadowMapSet.Count(), TEST_LOCATION );
502 DALI_TEST_EQUALS( DaliTestCheckMaps( shadowMapGet, shadowMapSet ), true, TEST_LOCATION );
504 shadowMapSet.Clear();
505 Property::Map shadowDisabledMapGet;
506 shadowDisabledMapGet.Insert( "color", Color::GREEN );
507 shadowDisabledMapGet.Insert( "offset", Vector2(0.0f, 0.0f) );
508 shadowDisabledMapGet.Insert( "blurRadius", 5.0f );
510 label.SetProperty( TextLabel::Property::SHADOW, shadowMapSet );
512 shadowMapGet = label.GetProperty<Property::Map>( TextLabel::Property::SHADOW );
513 DALI_TEST_EQUALS( shadowMapGet.Count(), shadowDisabledMapGet.Count(), TEST_LOCATION );
514 DALI_TEST_EQUALS( DaliTestCheckMaps( shadowMapGet, shadowDisabledMapGet ), true, TEST_LOCATION );
516 // Check the emboss property
517 label.SetProperty( TextLabel::Property::EMBOSS, "Emboss properties" );
518 DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::EMBOSS ), std::string("Emboss properties"), TEST_LOCATION );
520 // Check the outline property
522 // Test string type first
523 // This is purely to maintain backward compatibility, but we don't support string as the outline property type.
524 label.SetProperty( TextLabel::Property::OUTLINE, "Outline properties" );
525 DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::OUTLINE ), std::string("Outline properties"), TEST_LOCATION );
527 // Then test the property map type
528 Property::Map outlineMapSet;
529 Property::Map outlineMapGet;
531 outlineMapSet["color"] = Color::RED;
532 outlineMapSet["width"] = 2.0f;
533 label.SetProperty( TextLabel::Property::OUTLINE, outlineMapSet );
535 outlineMapGet = label.GetProperty<Property::Map>( TextLabel::Property::OUTLINE );
536 DALI_TEST_EQUALS( outlineMapGet.Count(), outlineMapSet.Count(), TEST_LOCATION );
537 DALI_TEST_EQUALS( DaliTestCheckMaps( outlineMapGet, outlineMapSet ), true, TEST_LOCATION );
539 // Check the background property
540 Property::Map backgroundMapSet;
541 Property::Map backgroundMapGet;
543 backgroundMapSet["enable"] = true;
544 backgroundMapSet["color"] = Color::RED;
545 label.SetProperty( DevelTextLabel::Property::BACKGROUND, backgroundMapSet );
547 backgroundMapGet = label.GetProperty<Property::Map>( DevelTextLabel::Property::BACKGROUND );
548 DALI_TEST_EQUALS( backgroundMapGet.Count(), backgroundMapSet.Count(), TEST_LOCATION );
549 DALI_TEST_EQUALS( DaliTestCheckMaps( backgroundMapGet, backgroundMapSet ), true, TEST_LOCATION );
551 // Check the pixel size of font
552 label.SetProperty( TextLabel::Property::PIXEL_SIZE, 20.f );
553 DALI_TEST_EQUALS( label.GetProperty<float>( TextLabel::Property::PIXEL_SIZE ), 20.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
555 // Check the ellipsis property
556 DALI_TEST_CHECK( !label.GetProperty<bool>( TextLabel::Property::ELLIPSIS ) );
557 label.SetProperty( TextLabel::Property::ELLIPSIS, true );
558 DALI_TEST_CHECK( label.GetProperty<bool>( TextLabel::Property::ELLIPSIS ) );
560 // Check the layout direction property
561 label.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::RIGHT_TO_LEFT );
562 DALI_TEST_EQUALS( label.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::RIGHT_TO_LEFT ), TEST_LOCATION );
564 application.SendNotification();
565 application.Render();
570 int UtcDaliToolkitTextlabelAtlasRenderP(void)
572 ToolkitTestApplication application;
573 tet_infoline(" UtcDaliToolkitTextLabelAtlasRenderP");
574 TextLabel label = TextLabel::New("Test Text");
575 DALI_TEST_CHECK( label );
577 // Avoid a crash when core load gl resources.
578 application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
580 Stage::GetCurrent().Add( label );
582 // Turn on all the effects
583 label.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
584 label.SetProperty( TextLabel::Property::MULTI_LINE, true );
585 label.SetProperty( TextLabel::Property::UNDERLINE_ENABLED, true );
586 label.SetProperty( TextLabel::Property::UNDERLINE_COLOR, Color::RED );
587 label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 1.0f, 1.0f ) );
588 label.SetProperty( TextLabel::Property::SHADOW_COLOR, Color::BLUE );
592 // Render some text with the shared atlas backend
593 label.SetProperty( TextLabel::Property::RENDERING_BACKEND, Text::RENDERING_SHARED_ATLAS );
594 application.SendNotification();
595 application.Render();
599 tet_result(TET_FAIL);
604 // Render some text with the shared atlas backend
605 label.SetProperty( TextLabel::Property::RENDERING_BACKEND, Text::RENDERING_VECTOR_BASED );
606 application.SendNotification();
607 application.Render();
611 tet_result(TET_FAIL);
616 int UtcDaliToolkitTextLabelLanguagesP(void)
618 ToolkitTestApplication application;
619 tet_infoline(" UtcDaliToolkitTextLabelLanguagesP");
620 TextLabel label = TextLabel::New();
621 DALI_TEST_CHECK( label );
623 Stage::GetCurrent().Add( label );
625 const std::string scripts( " привет мир, γειά σου Κόσμε, Hello world, مرحبا بالعالم, שלום עולם, "
626 "բարեւ աշխարհը, მსოფლიოში, 안녕하세요, 你好世界, ひらがな, カタカナ, "
627 "ওহে বিশ্ব, မင်္ဂလာပါကမ္ဘာလောက, हैलो वर्ल्ड, હેલો વર્લ્ડ, ਸਤਿ ਸ੍ਰੀ ਅਕਾਲ ਦੁਨਿਆ, ಹಲೋ ವರ್ಲ್ಡ್, "
628 "ഹലോ വേൾഡ്, ଓଡ଼ିଆ, හෙලෝ වර්ල්ඩ්, ஹலோ உலகம், హలో వరల్డ్, "
629 "ສະບາຍດີໂລກ, สวัสดีโลก, ជំរាបសួរពិភពលោក, "
630 "\xF0\x9F\x98\x81 \xF0\x9F\x98\x82 \xF0\x9F\x98\x83 \xF0\x9F\x98\x84." ); // these characters on the last line are emojis.
632 label.SetProperty( TextLabel::Property::TEXT, scripts );
633 DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::TEXT ), scripts, TEST_LOCATION );
635 application.SendNotification();
636 application.Render();
641 int UtcDaliToolkitTextLabelEmojisP(void)
643 ToolkitTestApplication application;
644 tet_infoline(" UtcDaliToolkitTextLabelLanguagesP");
645 TextLabel label = TextLabel::New();
646 DALI_TEST_CHECK( label );
648 Stage::GetCurrent().Add( label );
650 TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
652 char* pathNamePtr = get_current_dir_name();
653 const std::string pathName( pathNamePtr );
656 TextAbstraction::FontDescription fontDescription;
657 fontDescription.path = pathName + DEFAULT_FONT_DIR + "/tizen/BreezeColorEmoji.ttf";
658 fontDescription.family = "BreezeColorEmoji";
659 fontDescription.width = TextAbstraction::FontWidth::NONE;
660 fontDescription.weight = TextAbstraction::FontWeight::NORMAL;
661 fontDescription.slant = TextAbstraction::FontSlant::NONE;
663 fontClient.GetFontId( fontDescription, EMOJI_FONT_SIZE );
665 const std::string emojis = "<font family='BreezeColorEmoji' size='60'>\xF0\x9F\x98\x81 \xF0\x9F\x98\x82 \xF0\x9F\x98\x83 \xF0\x9F\x98\x84</font>";
666 label.SetProperty( TextLabel::Property::ENABLE_MARKUP, true );
667 label.SetProperty( TextLabel::Property::TEXT, emojis );
669 Property::Map shadowMap;
670 shadowMap.Insert( "color", "green" );
671 shadowMap.Insert( "offset", "2 2" );
672 label.SetProperty( TextLabel::Property::SHADOW, shadowMap );
674 application.SendNotification();
675 application.Render();
680 int UtcDaliToolkitTextlabelScrollingP(void)
682 ToolkitTestApplication application;
683 tet_infoline(" UtcDaliToolkitTextLabelScrollingP");
684 TextLabel labelImmediate = TextLabel::New("Some text to scroll");
685 TextLabel labelFinished = TextLabel::New("مرحبا بالعالم");
687 DALI_TEST_CHECK( labelImmediate );
688 DALI_TEST_CHECK( labelFinished );
689 // Avoid a crash when core load gl resources.
690 application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
691 Stage::GetCurrent().Add( labelImmediate );
692 // Turn on all the effects
693 labelImmediate.SetProperty( TextLabel::Property::MULTI_LINE, false );
694 labelImmediate.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
695 labelImmediate.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
696 labelImmediate.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
697 labelImmediate.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::IMMEDIATE );
699 Stage::GetCurrent().Add( labelFinished );
700 // Turn on all the effects
701 labelFinished.SetProperty( TextLabel::Property::MULTI_LINE, false );
702 labelFinished.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
703 labelFinished.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
704 labelFinished.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
705 labelFinished.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::FINISH_LOOP );
711 // Render some text with the shared atlas backend
712 labelImmediate.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
713 labelFinished.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
715 labelImmediate.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
716 labelFinished.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
718 labelImmediate.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
719 labelFinished.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
720 application.SendNotification();
721 application.Render();
723 labelImmediate.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
724 labelFinished.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
725 application.SendNotification();
726 application.Render();
731 tet_result(TET_FAIL);
737 int UtcDaliToolkitTextlabelScrollingCenterAlignP(void)
739 ToolkitTestApplication application;
740 TextLabel labelShort = TextLabel::New("Some text to scroll");
741 TextLabel labelLong = TextLabel::New("Some text to scroll that is greater than the width of the text. The quick brown fox jumps over the lazy dog. Hello World, we meet again!");
743 DALI_TEST_CHECK( labelShort );
744 DALI_TEST_CHECK( labelLong );
745 // Avoid a crash when core load gl resources.
746 application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
747 Stage::GetCurrent().Add( labelShort );
748 // Turn on all the effects
749 labelShort.SetProperty( TextLabel::Property::MULTI_LINE, false );
750 labelShort.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
751 labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
752 labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
753 labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
754 labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::IMMEDIATE );
756 Stage::GetCurrent().Add( labelLong );
757 // Turn on all the effects
758 labelLong.SetProperty( TextLabel::Property::MULTI_LINE, false );
759 labelLong.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
760 labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
761 labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
762 labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
763 labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::FINISH_LOOP );
767 // Render some text with the shared atlas backend
768 labelShort.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
769 labelLong.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
770 application.SendNotification();
771 application.Render();
773 labelShort.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
774 labelLong.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
775 application.SendNotification();
776 application.Render();
781 tet_result(TET_FAIL);
787 int UtcDaliToolkitTextlabelScrollingCenterAlignRTLP(void)
789 ToolkitTestApplication application;
790 TextLabel labelShort = TextLabel::New("مرحبا بالعالم");
791 TextLabel labelLong = TextLabel::New("لكن لا بد أن أوضح لك أن كل هذه الأفكار المغلوطة حول استنكار النشوة وتمجيد الألم نشأت بالفعل، وسأعرض لك التفاصيل لتكتشف حقيقة وأساس تلك السعادة البشرية، فلا أحد يرفض أو يكره أو يتجنب الشعور بالسعادة، ولكن بفضل هؤلاء الأشخاص الذين لا يدركون بأن السعادة لا بد أن نستشعرها بصورة أكثر عقلانية ومنطقية فيعرضهم هذا لمواجهة الظروف الأليمة، وأكرر بأنه لا يوجد من يرغب في الحب ونيل المنال ويتلذذ بالآلام، الألم هو الألم ولكن نتيجة لظروف ما قد تكمن السعاده فيما نتحمله من كد وأسي");
793 DALI_TEST_CHECK( labelShort );
794 DALI_TEST_CHECK( labelLong );
795 // Avoid a crash when core load gl resources.
796 application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
797 Stage::GetCurrent().Add( labelShort );
798 // Turn on all the effects
799 labelShort.SetProperty( TextLabel::Property::MULTI_LINE, false );
800 labelShort.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
801 labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
802 labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
803 labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
804 labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::IMMEDIATE );
806 Stage::GetCurrent().Add( labelLong );
807 // Turn on all the effects
808 labelLong.SetProperty( TextLabel::Property::MULTI_LINE, false );
809 labelLong.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
810 labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
811 labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
812 labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
813 labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::FINISH_LOOP );
817 // Render some text with the shared atlas backend
818 labelShort.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
819 labelLong.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
820 application.SendNotification();
821 application.Render();
823 labelShort.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
824 labelLong.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
825 application.SendNotification();
826 application.Render();
831 tet_result(TET_FAIL);
837 int UtcDaliToolkitTextlabelScrollingEndAlignP(void)
839 ToolkitTestApplication application;
840 TextLabel labelShort = TextLabel::New("Some text to scroll");
841 TextLabel labelLong = TextLabel::New("Some text to scroll that is greater than the width of the text. The quick brown fox jumps over the lazy dog. Hello World, we meet again!");
843 DALI_TEST_CHECK( labelShort );
844 DALI_TEST_CHECK( labelLong );
845 // Avoid a crash when core load gl resources.
846 application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
847 Stage::GetCurrent().Add( labelShort );
848 // Turn on all the effects
849 labelShort.SetProperty( TextLabel::Property::MULTI_LINE, false );
850 labelShort.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "END" );
851 labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
852 labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
853 labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
854 labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::IMMEDIATE );
856 Stage::GetCurrent().Add( labelLong );
857 // Turn on all the effects
858 labelLong.SetProperty( TextLabel::Property::MULTI_LINE, false );
859 labelLong.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "END" );
860 labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
861 labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
862 labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
863 labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::FINISH_LOOP );
867 // Render some text with the shared atlas backend
868 labelShort.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
869 labelLong.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
870 application.SendNotification();
871 application.Render();
873 labelShort.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
874 labelLong.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
875 application.SendNotification();
876 application.Render();
881 tet_result(TET_FAIL);
887 int UtcDaliToolkitTextlabelScrollingEndAlignRTLP(void)
889 ToolkitTestApplication application;
890 TextLabel labelShort = TextLabel::New("مرحبا بالعالم");
891 TextLabel labelLong = TextLabel::New("لكن لا بد أن أوضح لك أن كل هذه الأفكار المغلوطة حول استنكار النشوة وتمجيد الألم نشأت بالفعل، وسأعرض لك التفاصيل لتكتشف حقيقة وأساس تلك السعادة البشرية، فلا أحد يرفض أو يكره أو يتجنب الشعور بالسعادة، ولكن بفضل هؤلاء الأشخاص الذين لا يدركون بأن السعادة لا بد أن نستشعرها بصورة أكثر عقلانية ومنطقية فيعرضهم هذا لمواجهة الظروف الأليمة، وأكرر بأنه لا يوجد من يرغب في الحب ونيل المنال ويتلذذ بالآلام، الألم هو الألم ولكن نتيجة لظروف ما قد تكمن السعاده فيما نتحمله من كد وأسي");
893 DALI_TEST_CHECK( labelShort );
894 DALI_TEST_CHECK( labelLong );
895 // Avoid a crash when core load gl resources.
896 application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
897 Stage::GetCurrent().Add( labelShort );
898 // Turn on all the effects
899 labelShort.SetProperty( TextLabel::Property::MULTI_LINE, false );
900 labelShort.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "END" );
901 labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
902 labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
903 labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
904 labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::IMMEDIATE );
906 Stage::GetCurrent().Add( labelLong );
907 // Turn on all the effects
908 labelLong.SetProperty( TextLabel::Property::MULTI_LINE, false );
909 labelLong.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "END" );
910 labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
911 labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
912 labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
913 labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::FINISH_LOOP );
917 // Render some text with the shared atlas backend
918 labelShort.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
919 labelLong.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
920 application.SendNotification();
921 application.Render();
923 labelShort.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
924 labelLong.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
925 application.SendNotification();
926 application.Render();
931 tet_result(TET_FAIL);
937 int UtcDaliToolkitTextlabelScrollingInterruptedP(void)
939 ToolkitTestApplication application;
940 tet_infoline(" UtcDaliToolkitTextlabelScrollingInterruptedP");
941 TextLabel label = TextLabel::New("Some text to scroll");
942 DALI_TEST_CHECK( label );
943 // Avoid a crash when core load gl resources.
944 application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
945 Stage::GetCurrent().Add( label );
946 label.SetSize( 360.0f, 20.f );
947 // Turn on all the effects
948 label.SetProperty( TextLabel::Property::MULTI_LINE, false );
949 label.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
950 label.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
951 label.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
954 application.SendNotification();
955 application.Render();
957 unsigned int actorCount1 = label.GetChildCount();
958 tet_printf("Initial actor count is(%d)\n", actorCount1 );
962 // Render some text with the shared atlas backend
963 label.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
964 application.SendNotification();
965 application.Render(2000);
967 unsigned int actorCount1 = label.GetChildCount();
968 tet_printf("Actor count after scrolling is(%d)\n", actorCount1 );
970 label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::RED );
973 application.SendNotification();
974 application.Render();
976 unsigned int actorCount2 = label.GetChildCount();
977 tet_printf("After changing color the actor count is(%d)\n", actorCount2 );
979 DALI_TEST_EQUALS( actorCount1, actorCount2, TEST_LOCATION );
984 tet_result(TET_FAIL);
990 int UtcDaliToolkitTextlabelScrollingN(void)
992 ToolkitTestApplication application;
993 tet_infoline(" UtcDaliToolkitTextlabelScrollingN");
995 TextLabel label = TextLabel::New("Some text to scroll");
996 DALI_TEST_CHECK( label );
998 Stage::GetCurrent().Add( label );
1000 // Avoid a crash when core load gl resources.
1001 application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
1003 // The text scrolling works only on single line text.
1004 label.SetProperty( TextLabel::Property::MULTI_LINE, true );
1006 // Turn on all the effects.
1007 label.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
1008 label.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
1009 label.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
1011 // Enable the auto scrolling effect.
1012 label.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
1014 // The auto scrolling shouldn't be enabled.
1015 const bool enabled = label.GetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL ).Get<bool>();
1016 DALI_TEST_CHECK( !enabled );
1021 int UtcDaliToolkitTextlabelEllipsis(void)
1023 ToolkitTestApplication application;
1024 tet_infoline(" UtcDaliToolkitTextlabelEllipsis");
1026 TextLabel label = TextLabel::New("Hello world");
1027 DALI_TEST_CHECK( label );
1029 // Avoid a crash when core load gl resources.
1030 application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
1032 Stage::GetCurrent().Add( label );
1034 // Turn on all the effects
1035 label.SetAnchorPoint( AnchorPoint::CENTER );
1036 label.SetParentOrigin( ParentOrigin::CENTER );
1037 label.SetSize( 360.0f, 10.f );
1042 application.SendNotification();
1043 application.Render();
1047 tet_result(TET_FAIL);
1053 int UtcDaliToolkitTextlabelTextWrapMode(void)
1055 ToolkitTestApplication application;
1056 tet_infoline(" UtcDaliToolkitTextlabelTextWarpMode");
1060 TextLabel label = TextLabel::New();
1061 label.SetSize( 300.0f, 300.f );
1062 label.SetProperty( TextLabel::Property::TEXT, "Hello world Hello world" );
1063 label.SetProperty( TextLabel::Property::MULTI_LINE, true );
1067 //label.SetProperty( TextLabel::Property::POINT_SIZE, 18 );
1068 Stage::GetCurrent().Add( label );
1070 label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, "WORD" );
1071 DALI_TEST_EQUALS( label.GetProperty< int >( TextLabel::Property::LINE_WRAP_MODE ), static_cast< int >( Text::LineWrap::WORD ), TEST_LOCATION );
1073 application.SendNotification();
1074 application.Render();
1076 lineCount = label.GetProperty<int>( TextLabel::Property::LINE_COUNT );
1077 DALI_TEST_EQUALS( lineCount, 4, TEST_LOCATION );
1079 label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, "CHARACTER" );
1080 DALI_TEST_EQUALS( label.GetProperty< int >( TextLabel::Property::LINE_WRAP_MODE ), static_cast< int >( Text::LineWrap::CHARACTER ), TEST_LOCATION );
1082 application.SendNotification();
1083 application.Render();
1085 label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, Text::LineWrap::WORD );
1086 DALI_TEST_EQUALS( label.GetProperty< int >( TextLabel::Property::LINE_WRAP_MODE ), static_cast< int >( Text::LineWrap::WORD ), TEST_LOCATION );
1088 application.SendNotification();
1089 application.Render();
1091 lineCount = label.GetProperty<int>( TextLabel::Property::LINE_COUNT );
1092 DALI_TEST_EQUALS( lineCount, 4, TEST_LOCATION );
1094 label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, Text::LineWrap::CHARACTER );
1095 DALI_TEST_EQUALS( label.GetProperty< int >( TextLabel::Property::LINE_WRAP_MODE ), static_cast< int >( Text::LineWrap::CHARACTER ), TEST_LOCATION );
1097 application.SendNotification();
1098 application.Render();
1100 lineCount = label.GetProperty<int>( TextLabel::Property::LINE_COUNT );
1101 DALI_TEST_EQUALS( lineCount, 3, TEST_LOCATION );
1103 tet_infoline( "Ensure invalid string does not change wrapping mode" );
1104 label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, "InvalidWrapMode" );
1105 DALI_TEST_EQUALS( label.GetProperty< int >( TextLabel::Property::LINE_WRAP_MODE ), static_cast< int >( Text::LineWrap::CHARACTER ), TEST_LOCATION );
1110 int UtcDaliToolkitTextLabelColorComponents(void)
1112 ToolkitTestApplication application;
1114 TextLabel label = TextLabel::New();
1115 label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::RED );
1116 DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_RED ), 1.0f, TEST_LOCATION );
1117 DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_GREEN ), 0.0f, TEST_LOCATION );
1118 DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_BLUE ), 0.0f, TEST_LOCATION );
1119 DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_ALPHA ), 1.0f, TEST_LOCATION );
1121 label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::GREEN );
1122 DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_RED ), 0.0f, TEST_LOCATION );
1123 DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_GREEN ), 1.0f, TEST_LOCATION );
1124 DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_BLUE ), 0.0f, TEST_LOCATION );
1125 DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_ALPHA ), 1.0f, TEST_LOCATION );
1127 label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::BLUE );
1128 DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_RED ), 0.0f, TEST_LOCATION );
1129 DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_GREEN ), 0.0f, TEST_LOCATION );
1130 DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_BLUE ), 1.0f, TEST_LOCATION );
1131 DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_ALPHA ), 1.0f, TEST_LOCATION );
1133 label.SetProperty( TextLabel::Property::TEXT_COLOR_ALPHA, 0.6f );
1134 DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_ALPHA ), 0.6f, TEST_LOCATION );
1135 DALI_TEST_EQUALS( label.GetProperty< Vector4 >( TextLabel::Property::TEXT_COLOR ), Vector4( 0.0f, 0.0f, 1.0f, 0.6f ), TEST_LOCATION );
1136 DALI_TEST_EQUALS( label.GetProperty< Vector4 >( TextLabel::Property::UNUSED_PROPERTY_TEXT_COLOR ), Vector4( 0.0f, 0.0f, 1.0f, 0.6f ), TEST_LOCATION );
1138 // Test a transparent text - Rendering should be skipped.
1139 label.SetProperty( TextLabel::Property::TEXT, "Hello world Hello world" );
1140 label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::BLUE );
1142 Stage::GetCurrent().Add( label );
1144 TraceCallStack& drawTrace = application.GetGlAbstraction().GetDrawTrace();
1145 drawTrace.Enable( true );
1147 application.SendNotification();
1148 application.Render();
1150 DALI_TEST_EQUALS( drawTrace.FindMethod( "DrawArrays" ), true, TEST_LOCATION ); // Should be rendered
1152 label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::TRANSPARENT );
1156 application.SendNotification();
1157 application.Render();
1159 DALI_TEST_EQUALS( drawTrace.FindMethod( "DrawArrays" ), false, TEST_LOCATION ); // Rendering should be skipped
1161 label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::RED );
1165 application.SendNotification();
1166 application.Render();
1168 DALI_TEST_EQUALS( drawTrace.FindMethod( "DrawArrays" ), true, TEST_LOCATION ); // Should be rendered again
1173 int UtcDaliToolkitTextlabelTextStyle01(void)
1175 ToolkitTestApplication application;
1176 tet_infoline(" UtcDaliToolkitTextlabelTextStyle Setting Outline after Shadow");
1178 TextLabel label = TextLabel::New();
1179 label.SetSize( 300.0f, 300.f );
1180 label.SetProperty( TextLabel::Property::TEXT, "Hello world Hello world" );
1181 label.SetProperty( TextLabel::Property::POINT_SIZE, 12 );
1182 Stage::GetCurrent().Add( label );
1184 Property::Map outlineMapSet;
1185 Property::Map outlineMapGet;
1187 outlineMapSet["color"] = Color::BLUE;
1188 outlineMapSet["width"] = 2.0f;
1189 label.SetProperty( TextLabel::Property::OUTLINE, outlineMapSet );
1191 application.SendNotification();
1192 application.Render();
1194 Property::Map shadowMapSet;
1195 shadowMapSet.Insert( "color", "green" );
1196 shadowMapSet.Insert( "offset", "2 2" );
1197 shadowMapSet.Insert( "blurRadius", "3" );
1198 label.SetProperty( TextLabel::Property::SHADOW, shadowMapSet );
1200 outlineMapSet["color"] = Color::RED;
1201 outlineMapSet["width"] = 0.0f;
1202 label.SetProperty( TextLabel::Property::OUTLINE, outlineMapSet );
1204 application.SendNotification();
1205 application.Render();
1207 outlineMapGet = label.GetProperty<Property::Map>( TextLabel::Property::OUTLINE );
1209 Property::Value* colorValue = outlineMapGet.Find("color");
1211 bool colorMatched( false );
1215 Property::Type valueType = colorValue->GetType();
1217 if ( Property::STRING == valueType )
1219 std::string stringValue;
1220 colorValue->Get( stringValue );
1221 if ( stringValue == "red" )
1223 colorMatched = true;
1226 else if ( Property::VECTOR4 == valueType )
1228 Vector4 colorVector4;
1229 colorValue->Get( colorVector4 );
1230 if ( colorVector4 == Color::RED )
1232 colorMatched = true;
1237 DALI_TEST_EQUALS( colorMatched, true, TEST_LOCATION );
1242 int UtcDaliToolkitTextlabelMultiline(void)
1244 ToolkitTestApplication application;
1245 tet_infoline(" UtcDaliToolkitTextlabelMultiline");
1247 TextLabel label = TextLabel::New();
1248 label.SetProperty( TextLabel::Property::TEXT, "Hello world Hello world Hello world Hello world Hello world Hello world" );
1249 label.SetProperty( TextLabel::Property::POINT_SIZE, 20 );
1250 label.SetProperty( TextLabel::Property::MULTI_LINE, false );
1251 Stage::GetCurrent().Add( label );
1253 application.SendNotification();
1254 application.Render();
1256 int lineCount = label.GetProperty<int>( TextLabel::Property::LINE_COUNT );
1257 DALI_TEST_EQUALS( lineCount, 1, TEST_LOCATION );
1259 label.SetProperty( TextLabel::Property::MULTI_LINE, true );
1261 application.SendNotification();
1262 application.Render();
1264 lineCount = label.GetProperty<int>( TextLabel::Property::LINE_COUNT );
1265 DALI_TEST_EQUALS( true, (lineCount > 1) , TEST_LOCATION );
1271 int UtcDaliToolkitTextlabelTextDirection(void)
1273 ToolkitTestApplication application;
1274 tet_infoline(" UtcDaliToolkitTextlabelTextDirection");
1276 TextLabel label = TextLabel::New();
1277 DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::TEXT_DIRECTION ), static_cast< int >( Toolkit::DevelText::TextDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
1279 label.SetProperty( TextLabel::Property::TEXT, "Hello world" );
1280 label.SetProperty( TextLabel::Property::POINT_SIZE, 20 );
1281 Stage::GetCurrent().Add( label );
1284 DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::TEXT_DIRECTION ), static_cast< int >( Toolkit::DevelText::TextDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
1287 label.SetProperty( TextLabel::Property::TEXT, "ﻡﺮﺤﺑﺍ ﺏﺎﻠﻋﺎﻠﻣ ﻡﺮﺤﺑﺍ" );
1288 DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::TEXT_DIRECTION ), static_cast< int >( Toolkit::DevelText::TextDirection::RIGHT_TO_LEFT ), TEST_LOCATION );
1290 // Test RTL text starting with weak character
1291 label.SetProperty( TextLabel::Property::TEXT, "()ﻡﺮﺤﺑﺍ ﺏﺎﻠﻋﺎﻠﻣ ﻡﺮﺤﺑﺍ" );
1292 DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::TEXT_DIRECTION ), static_cast< int >( Toolkit::DevelText::TextDirection::RIGHT_TO_LEFT ), TEST_LOCATION );
1294 // Test RTL text string with emoji and weak character
1295 label.SetProperty( TextLabel::Property::TEXT, "\xF0\x9F\x98\x81 () ﻡﺮﺤﺑﺍ ﺏﺎﻠﻋﺎﻠﻣ ﻡﺮﺤﺑﺍ" );
1296 DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::TEXT_DIRECTION ), static_cast< int >( Toolkit::DevelText::TextDirection::RIGHT_TO_LEFT ), TEST_LOCATION );
1301 int UtcDaliToolkitTextlabelVerticalLineAlignment(void)
1303 ToolkitTestApplication application;
1304 tet_infoline(" UtcDaliToolkitTextlabelVerticalLineAlignment");
1306 TextLabel label = TextLabel::New();
1308 label.SetProperty( DevelTextLabel::Property::VERTICAL_LINE_ALIGNMENT, DevelText::VerticalLineAlignment::TOP );
1309 label.SetProperty( TextLabel::Property::TEXT, "Hello world" );
1310 label.SetProperty( TextLabel::Property::POINT_SIZE, 15 );
1311 label.SetProperty( TextLabel::Property::LINE_SPACING, 12 );
1312 Stage::GetCurrent().Add( label );
1313 DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::VERTICAL_LINE_ALIGNMENT ), static_cast< int >( Toolkit::DevelText::VerticalLineAlignment::TOP ), TEST_LOCATION );
1315 label.SetProperty( DevelTextLabel::Property::VERTICAL_LINE_ALIGNMENT, DevelText::VerticalLineAlignment::MIDDLE );
1316 DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::VERTICAL_LINE_ALIGNMENT ), static_cast< int >( Toolkit::DevelText::VerticalLineAlignment::MIDDLE ), TEST_LOCATION );
1318 label.SetProperty( DevelTextLabel::Property::VERTICAL_LINE_ALIGNMENT, DevelText::VerticalLineAlignment::BOTTOM );
1319 DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::VERTICAL_LINE_ALIGNMENT ), static_cast< int >( Toolkit::DevelText::VerticalLineAlignment::BOTTOM ), TEST_LOCATION );