Add a callback for navigation policy in web view.
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-TextLabel.cpp
1 /*
2  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 #include <iostream>
19 #include <stdlib.h>
20 #include <unistd.h>
21
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/controls/text-controls/text-style-properties-devel.h>
26 #include <dali-toolkit/devel-api/text/text-enumerations-devel.h>
27 #include <dali/devel-api/text-abstraction/bitmap-font.h>
28 #include <dali/devel-api/text-abstraction/font-client.h>
29 #include <dali/devel-api/adaptor-framework/image-loading.h>
30 #include <dali-toolkit/devel-api/text/bitmap-font.h>
31 #include <dali-toolkit/devel-api/text/rendering-backend.h>
32 #include <dali-toolkit/devel-api/text/text-utils-devel.h>
33 #include "test-text-geometry-utils.h"
34
35 using namespace Dali;
36 using namespace Toolkit;
37
38 void dali_textlabel_startup(void)
39 {
40   test_return_value = TET_UNDEF;
41 }
42
43 void dali_textlabel_cleanup(void)
44 {
45   test_return_value = TET_PASS;
46 }
47
48 namespace
49 {
50
51 const char* const PROPERTY_NAME_RENDERING_BACKEND = "renderingBackend";
52 const char* const PROPERTY_NAME_TEXT = "text";
53 const char* const PROPERTY_NAME_FONT_FAMILY = "fontFamily";
54 const char* const PROPERTY_NAME_FONT_STYLE = "fontStyle";
55 const char* const PROPERTY_NAME_POINT_SIZE = "pointSize";
56 const char* const PROPERTY_NAME_MULTI_LINE =  "multiLine";
57 const char* const PROPERTY_NAME_HORIZONTAL_ALIGNMENT = "horizontalAlignment";
58 const char* const PROPERTY_NAME_VERTICAL_ALIGNMENT = "verticalAlignment";
59 const char* const PROPERTY_NAME_TEXT_COLOR = "textColor";
60 const char* const PROPERTY_NAME_ENABLE_MARKUP = "enableMarkup";
61 const char* const PROPERTY_NAME_ENABLE_AUTO_SCROLL = "enableAutoScroll";
62 const char* const PROPERTY_NAME_ENABLE_AUTO_SCROLL_SPEED = "autoScrollSpeed";
63 const char* const PROPERTY_NAME_ENABLE_AUTO_SCROLL_LOOPS = "autoScrollLoopCount";
64 const char* const PROPERTY_NAME_ENABLE_AUTO_SCROLL_GAP = "autoScrollGap";
65
66 const char* const PROPERTY_NAME_LINE_SPACING = "lineSpacing";
67 const char* const PROPERTY_NAME_UNDERLINE = "underline";
68 const char* const PROPERTY_NAME_SHADOW = "shadow";
69 const char* const PROPERTY_NAME_EMBOSS = "emboss";
70 const char* const PROPERTY_NAME_OUTLINE = "outline";
71 const char* const PROPERTY_NAME_BACKGROUND = "textBackground";
72
73 const char* const PROPERTY_NAME_PIXEL_SIZE = "pixelSize";
74 const char* const PROPERTY_NAME_ELLIPSIS = "ellipsis";
75 const char* const PROPERTY_NAME_AUTO_SCROLL_LOOP_DELAY = "autoScrollLoopDelay";
76 const char* const PROPERTY_NAME_FONT_SIZE_SCALE = "fontSizeScale";
77
78 const char* const PROPERTY_NAME_ELLIPSIS_POSITION = "ellipsisPosition";
79
80 const std::string DEFAULT_FONT_DIR( "/resources/fonts" );
81 const unsigned int EMOJI_FONT_SIZE = 3840u; // 60 * 64
82
83 static bool gAnchorClickedCallBackCalled;
84 static bool gAnchorClickedCallBackNotCalled;
85
86 static bool gTextFitChangedCallBackCalled;
87
88 struct CallbackFunctor
89 {
90   CallbackFunctor(bool* callbackFlag)
91   : mCallbackFlag( callbackFlag )
92   {
93   }
94
95   void operator()()
96   {
97     *mCallbackFlag = true;
98   }
99   bool* mCallbackFlag;
100 };
101
102 static void TestAnchorClickedCallback(TextLabel control, const char* href, unsigned int hrefLength)
103 {
104   tet_infoline(" TestAnchorClickedCallback");
105
106   gAnchorClickedCallBackNotCalled = false;
107
108   if (!strcmp(href, "https://www.tizen.org") && hrefLength == strlen(href))
109   {
110     gAnchorClickedCallBackCalled = true;
111   }
112 }
113
114 static void TestTextFitChangedCallback(TextLabel control)
115 {
116   tet_infoline(" TestTextFitChangedCallback");
117   gTextFitChangedCallBackCalled = true;
118 }
119
120 bool DaliTestCheckMaps( const Property::Map& mapGet, const Property::Map& mapSet, const std::vector<std::string>& indexConversionTable = std::vector<std::string>() )
121 {
122   const Property::Map::SizeType size = mapGet.Count();
123
124   if( size == mapSet.Count() )
125   {
126     for( unsigned int index = 0u; index < size; ++index )
127     {
128       const KeyValuePair& valueGet = mapGet.GetKeyValue( index );
129
130       // Find the keys of the 'get' map
131       Property::Index indexKey = valueGet.first.indexKey;
132       std::string stringKey = valueGet.first.stringKey;
133
134       if( !indexConversionTable.empty() )
135       {
136         if( stringKey.empty() )
137         {
138           stringKey = indexConversionTable[ indexKey ];
139         }
140
141         if( ( indexKey == Property::INVALID_INDEX ) && !stringKey.empty() )
142         {
143           Property::Index index = 0u;
144           for( auto key : indexConversionTable )
145           {
146             if( key == stringKey )
147             {
148               indexKey = index;
149               break;
150             }
151             ++index;
152           }
153         }
154       }
155
156       const Property::Value* const valueSet = mapSet.Find( indexKey, stringKey );
157
158       if( nullptr != valueSet )
159       {
160         if( ( valueSet->GetType() == Dali::Property::STRING ) && ( valueGet.second.Get<std::string>() != valueSet->Get<std::string>() ) )
161         {
162           tet_printf( "Value got : [%s], expected : [%s]", valueGet.second.Get<std::string>().c_str(), valueSet->Get<std::string>().c_str() );
163           return false;
164         }
165         else if( ( valueSet->GetType() == Dali::Property::BOOLEAN ) && ( valueGet.second.Get<bool>() != valueSet->Get<bool>() ) )
166         {
167           tet_printf( "Value got : [%d], expected : [%d]", valueGet.second.Get<bool>(), valueSet->Get<bool>() );
168           return false;
169         }
170         else if( ( valueSet->GetType() == Dali::Property::INTEGER ) && ( valueGet.second.Get<int>() != valueSet->Get<int>() ) )
171         {
172           tet_printf( "Value got : [%d], expected : [%d]", valueGet.second.Get<int>(), valueSet->Get<int>() );
173           return false;
174         }
175         else if( ( valueSet->GetType() == Dali::Property::FLOAT ) && ( valueGet.second.Get<float>() != valueSet->Get<float>() ) )
176         {
177           tet_printf( "Value got : [%f], expected : [%f]", valueGet.second.Get<float>(), valueSet->Get<float>() );
178           return false;
179         }
180         else if( ( valueSet->GetType() == Dali::Property::VECTOR2 ) && ( valueGet.second.Get<Vector2>() != valueSet->Get<Vector2>() ) )
181         {
182           Vector2 vector2Get = valueGet.second.Get<Vector2>();
183           Vector2 vector2Set = valueSet->Get<Vector2>();
184           tet_printf( "Value got : [%f, %f], expected : [%f, %f]", vector2Get.x, vector2Get.y, vector2Set.x, vector2Set.y );
185           return false;
186         }
187         else if( ( valueSet->GetType() == Dali::Property::VECTOR4 ) && ( valueGet.second.Get<Vector4>() != valueSet->Get<Vector4>() ) )
188         {
189           Vector4 vector4Get = valueGet.second.Get<Vector4>();
190           Vector4 vector4Set = valueSet->Get<Vector4>();
191           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 );
192           return false;
193         }
194       }
195       else
196       {
197         if ( valueGet.first.type == Property::Key::INDEX )
198         {
199           tet_printf( "  The key %d doesn't exist.", valueGet.first.indexKey );
200         }
201         else
202         {
203           tet_printf( "  The key %s doesn't exist.", valueGet.first.stringKey.c_str() );
204         }
205         return false;
206       }
207     }
208   }
209
210   return true;
211 }
212
213 } // namespace
214
215 int UtcDaliToolkitTextLabelConstructorP(void)
216 {
217   ToolkitTestApplication application;
218   tet_infoline(" UtcDaliToolkitTextLabelConstructorP");
219   TextLabel textLabel;
220   DALI_TEST_CHECK( !textLabel );
221   END_TEST;
222 }
223
224 int UtcDaliToolkitTextLabelNewP(void)
225 {
226   ToolkitTestApplication application;
227   tet_infoline(" UtcDaliToolkitTextLabelNewP");
228   TextLabel textLabel = TextLabel::New( "Test Text" );
229   DALI_TEST_CHECK( textLabel );
230   END_TEST;
231 }
232
233 int UtcDaliToolkitTextLabelDownCastP(void)
234 {
235   ToolkitTestApplication application;
236   tet_infoline(" UtcDaliToolkitTextLabelDownCastP");
237   TextLabel textLabel1 = TextLabel::New();
238   BaseHandle object( textLabel1 );
239
240   TextLabel textLabel2 = TextLabel::DownCast( object );
241   DALI_TEST_CHECK( textLabel2 );
242
243   TextLabel textLabel3 = DownCast< TextLabel >( object );
244   DALI_TEST_CHECK( textLabel3 );
245   END_TEST;
246 }
247
248 int UtcDaliToolkitTextLabelDownCastN(void)
249 {
250   ToolkitTestApplication application;
251   tet_infoline(" UtcDaliToolkitTextLabelDownCastN");
252   BaseHandle uninitializedObject;
253   TextLabel textLabel1 = TextLabel::DownCast( uninitializedObject );
254   DALI_TEST_CHECK( !textLabel1 );
255
256   TextLabel textLabel2 = DownCast< TextLabel >( uninitializedObject );
257   DALI_TEST_CHECK( !textLabel2 );
258   END_TEST;
259 }
260
261 int UtcDaliToolkitTextLabelCopyConstructorP(void)
262 {
263   ToolkitTestApplication application;
264   tet_infoline(" UtcDaliToolkitTextLabelCopyConstructorP");
265   TextLabel textLabel = TextLabel::New();
266   textLabel.SetProperty( TextLabel::Property::TEXT_COLOR, Color::RED );
267
268   TextLabel copy( textLabel );
269   DALI_TEST_CHECK( copy );
270   DALI_TEST_CHECK( copy.GetProperty<Vector4>( TextLabel::Property::TEXT_COLOR ) == textLabel.GetProperty<Vector4>( TextLabel::Property::TEXT_COLOR ) );
271   END_TEST;
272 }
273
274 int UtcDaliTextLabelMoveConstructor(void)
275 {
276   ToolkitTestApplication application;
277
278   TextLabel textLabel = TextLabel::New();
279   textLabel.SetProperty( TextLabel::Property::TEXT, "Test" );
280   DALI_TEST_CHECK( textLabel.GetProperty<std::string>( TextLabel::Property::TEXT ) == "Test" );
281
282   TextLabel moved = std::move( textLabel );
283   DALI_TEST_CHECK( moved );
284   DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
285   DALI_TEST_CHECK( moved.GetProperty<std::string>( TextLabel::Property::TEXT ) == "Test" );
286   DALI_TEST_CHECK( !textLabel );
287
288   END_TEST;
289 }
290
291 int UtcDaliToolkitTextLabelAssignmentOperatorP(void)
292 {
293   ToolkitTestApplication application;
294   tet_infoline(" UtcDaliToolkitTextLabelAssingmentOperatorP");
295   TextLabel textLabel = TextLabel::New();
296   textLabel.SetProperty( TextLabel::Property::TEXT_COLOR, Color::RED );
297
298   TextLabel copy = textLabel;
299   DALI_TEST_CHECK( copy );
300   DALI_TEST_CHECK( copy.GetProperty<Vector4>( TextLabel::Property::TEXT_COLOR ) == textLabel.GetProperty<Vector4>( TextLabel::Property::TEXT_COLOR ) );
301   END_TEST;
302 }
303
304 int UtcDaliTextLabelMoveAssignment(void)
305 {
306   ToolkitTestApplication application;
307
308   TextLabel textLabel = TextLabel::New();
309   textLabel.SetProperty( TextLabel::Property::TEXT, "Test" );
310   DALI_TEST_CHECK( textLabel.GetProperty<std::string>( TextLabel::Property::TEXT ) == "Test" );
311
312   TextLabel moved;
313   moved = std::move( textLabel );
314   DALI_TEST_CHECK( moved );
315   DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
316   DALI_TEST_CHECK( moved.GetProperty<std::string>( TextLabel::Property::TEXT ) == "Test" );
317   DALI_TEST_CHECK( !textLabel );
318
319   END_TEST;
320 }
321
322 // Positive test case for a method
323 int UtcDaliToolkitTextLabelGetPropertyP(void)
324 {
325   ToolkitTestApplication application;
326   tet_infoline(" UtcDaliToolkitTextLabelGetPropertyP");
327   TextLabel label = TextLabel::New("Test Text");
328   DALI_TEST_CHECK( label );
329
330   // Check Property Indices are correct
331   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_RENDERING_BACKEND ) == DevelTextLabel::Property::RENDERING_BACKEND );
332   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_TEXT ) == TextLabel::Property::TEXT );
333   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_FONT_FAMILY ) == TextLabel::Property::FONT_FAMILY );
334   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_FONT_STYLE ) == TextLabel::Property::FONT_STYLE );
335   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_POINT_SIZE ) == TextLabel::Property::POINT_SIZE );
336   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_MULTI_LINE ) == TextLabel::Property::MULTI_LINE );
337   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_HORIZONTAL_ALIGNMENT ) == TextLabel::Property::HORIZONTAL_ALIGNMENT );
338   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_VERTICAL_ALIGNMENT ) == TextLabel::Property::VERTICAL_ALIGNMENT );
339   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_TEXT_COLOR ) == TextLabel::Property::TEXT_COLOR );
340   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ENABLE_MARKUP) == TextLabel::Property::ENABLE_MARKUP );
341   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ENABLE_AUTO_SCROLL ) == TextLabel::Property::ENABLE_AUTO_SCROLL );
342   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ENABLE_AUTO_SCROLL_SPEED ) == TextLabel::Property::AUTO_SCROLL_SPEED );
343   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ENABLE_AUTO_SCROLL_LOOPS ) == TextLabel::Property::AUTO_SCROLL_LOOP_COUNT );
344   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ENABLE_AUTO_SCROLL_GAP ) == TextLabel::Property::AUTO_SCROLL_GAP );
345   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_LINE_SPACING ) == TextLabel::Property::LINE_SPACING );
346   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_UNDERLINE ) == TextLabel::Property::UNDERLINE );
347   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_SHADOW ) == TextLabel::Property::SHADOW );
348   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_EMBOSS ) == TextLabel::Property::EMBOSS );
349   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_OUTLINE ) == TextLabel::Property::OUTLINE );
350   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_BACKGROUND ) == DevelTextLabel::Property::BACKGROUND );
351   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_PIXEL_SIZE ) == TextLabel::Property::PIXEL_SIZE );
352   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ELLIPSIS ) == TextLabel::Property::ELLIPSIS );
353   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_AUTO_SCROLL_LOOP_DELAY ) == TextLabel::Property::AUTO_SCROLL_LOOP_DELAY );
354   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_FONT_SIZE_SCALE ) == DevelTextLabel::Property::FONT_SIZE_SCALE );
355   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ELLIPSIS_POSITION ) == DevelTextLabel::Property::ELLIPSIS_POSITION );
356
357   END_TEST;
358 }
359
360 int UtcDaliToolkitTextLabelSetPropertyP(void)
361 {
362   ToolkitTestApplication application;
363   tet_infoline(" UtcDaliToolkitTextLabelSetPropertyP");
364   TextLabel label = TextLabel::New();
365   DALI_TEST_CHECK( label );
366
367   application.GetScene().Add( label );
368
369   // Note - we can't check the defaults since the stylesheets are platform-specific
370   label.SetProperty( DevelTextLabel::Property::RENDERING_BACKEND, DevelText::RENDERING_SHARED_ATLAS );
371   DALI_TEST_EQUALS( (DevelText::RenderingType)label.GetProperty<int>( DevelTextLabel::Property::RENDERING_BACKEND ), DevelText::RENDERING_SHARED_ATLAS, TEST_LOCATION );
372
373   // Check that text can be correctly reset
374   label.SetProperty( TextLabel::Property::TEXT, "Setting Text" );
375   DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::TEXT ), std::string("Setting Text"), TEST_LOCATION );
376
377   // Check font properties.
378   label.SetProperty( TextLabel::Property::FONT_FAMILY, "Setting font family" );
379   DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::FONT_FAMILY ), std::string("Setting font family"), TEST_LOCATION );
380
381   Property::Map fontStyleMapSet;
382   Property::Map fontStyleMapGet;
383
384   fontStyleMapSet.Insert( "weight", "bold" );
385   fontStyleMapSet.Insert( "width", "condensed" );
386   fontStyleMapSet.Insert( "slant", "italic" );
387   label.SetProperty( TextLabel::Property::FONT_STYLE, fontStyleMapSet );
388
389   fontStyleMapGet = label.GetProperty<Property::Map>( TextLabel::Property::FONT_STYLE );
390   DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
391   DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
392
393   // Check the old font style format.
394   fontStyleMapSet.Clear();
395   fontStyleMapSet.Insert( "weight", "thin" );
396   fontStyleMapSet.Insert( "width", "expanded" );
397   fontStyleMapSet.Insert( "slant", "oblique" );
398   const std::string strFontStyle = "{\"weight\":\"thin\",\"width\":\"expanded\",\"slant\":\"oblique\"}";
399
400   label.SetProperty( TextLabel::Property::FONT_STYLE, "{\"weight\":\"thin\",\"width\":\"expanded\",\"slant\":\"oblique\"}" );
401   std::string getFontStyle = label.GetProperty<std::string>( TextLabel::Property::FONT_STYLE );
402   DALI_TEST_EQUALS( getFontStyle, strFontStyle, TEST_LOCATION );
403
404   label.SetProperty( TextLabel::Property::POINT_SIZE, 10.f );
405   DALI_TEST_EQUALS( label.GetProperty<float>( TextLabel::Property::POINT_SIZE ), 10.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
406
407   label.SetProperty( DevelTextLabel::Property::FONT_SIZE_SCALE, 2.5f );
408   DALI_TEST_EQUALS( label.GetProperty<float>( DevelTextLabel::Property::FONT_SIZE_SCALE ), 2.5f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
409   label.SetProperty( DevelTextLabel::Property::FONT_SIZE_SCALE, 1.0f );
410
411   // Reset font style.
412   fontStyleMapSet.Clear();
413   fontStyleMapSet.Insert( "weight", "normal" );
414   fontStyleMapSet.Insert( "slant", "oblique" );
415
416   label.SetProperty( TextLabel::Property::FONT_STYLE, fontStyleMapSet );
417   fontStyleMapGet = label.GetProperty<Property::Map>( TextLabel::Property::FONT_STYLE );
418   DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
419   DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
420
421   fontStyleMapSet.Clear();
422   fontStyleMapSet.Insert( "slant", "roman" );
423
424   label.SetProperty( TextLabel::Property::FONT_STYLE, fontStyleMapSet );
425   fontStyleMapGet = label.GetProperty<Property::Map>( TextLabel::Property::FONT_STYLE );
426   DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
427
428   // Replace 'roman' for 'normal'.
429   Property::Value* slantValue = fontStyleMapGet.Find( "slant" );
430   if( NULL != slantValue )
431   {
432     if( "normal" == slantValue->Get<std::string>() )
433     {
434       fontStyleMapGet["slant"] = "roman";
435     }
436   }
437   DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
438
439   fontStyleMapSet.Clear();
440
441   label.SetProperty( TextLabel::Property::FONT_STYLE, fontStyleMapSet );
442   fontStyleMapGet = label.GetProperty<Property::Map>( TextLabel::Property::FONT_STYLE );
443   DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
444   DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
445
446   // Toggle multi-line
447   label.SetProperty( TextLabel::Property::MULTI_LINE, true );
448   DALI_TEST_EQUALS( label.GetProperty<bool>( TextLabel::Property::MULTI_LINE ), true, TEST_LOCATION );
449
450   // Check that the Alignment properties can be correctly set
451   label.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
452   DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::HORIZONTAL_ALIGNMENT ), "CENTER", TEST_LOCATION );
453   label.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
454   DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::VERTICAL_ALIGNMENT ), "CENTER", TEST_LOCATION );
455
456   // Check that text color can be properly set
457   label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::BLUE );
458   DALI_TEST_EQUALS( label.GetProperty<Vector4>( TextLabel::Property::TEXT_COLOR ), Color::BLUE, TEST_LOCATION );
459
460   Property::Map underlineMapSet;
461   Property::Map underlineMapGet;
462
463   underlineMapSet.Insert( "enable", false );
464   underlineMapSet.Insert( "color", Color::BLUE );
465   underlineMapSet.Insert( "height", 0 );
466
467   underlineMapGet = label.GetProperty<Property::Map>( TextLabel::Property::UNDERLINE );
468   DALI_TEST_EQUALS( underlineMapGet.Count(), underlineMapSet.Count(), TEST_LOCATION );
469   DALI_TEST_EQUALS( DaliTestCheckMaps( underlineMapGet, underlineMapSet ), true, TEST_LOCATION );
470
471   TextLabel label2 = TextLabel::New( "New text" );
472   DALI_TEST_CHECK( label2 );
473   DALI_TEST_EQUALS( label2.GetProperty<std::string>( TextLabel::Property::TEXT ), std::string("New text"), TEST_LOCATION );
474
475   // Check the enable markup property.
476   DALI_TEST_CHECK( !label.GetProperty<bool>( TextLabel::Property::ENABLE_MARKUP ) );
477   label.SetProperty( TextLabel::Property::ENABLE_MARKUP, true );
478   DALI_TEST_CHECK( label.GetProperty<bool>( TextLabel::Property::ENABLE_MARKUP ) );
479
480   // Check the text property when markup is enabled
481   label.SetProperty( TextLabel::Property::TEXT, "<color value='white'>Markup</color><color value='cyan'>Text</color>" );
482   DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::TEXT ), std::string("MarkupText"), TEST_LOCATION );
483
484   // Check for incomplete marks.
485   label.SetProperty( TextLabel::Property::TEXT, "<color='white'><i>Markup</i><b>Text</b></color>" );
486   DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::TEXT ), std::string("MarkupText"), TEST_LOCATION );
487   try
488   {
489     application.SendNotification();
490     application.Render();
491   }
492   catch( ... )
493   {
494     tet_result(TET_FAIL);
495   }
496
497   // Check autoscroll properties
498   const int SCROLL_SPEED = 80;
499   const int SCROLL_LOOPS = 4;
500   const float SCROLL_GAP = 50.0f;
501   const float SCROLL_LOOP_DELAY = 0.3f;
502   const std::string STOP_IMMEDIATE = std::string( "IMMEDIATE" );
503   const std::string STOP_FINISH_LOOP = std::string( "FINISH_LOOP" );
504
505   label.SetProperty( TextLabel::Property::MULTI_LINE, false ); // Autoscroll only supported in single line
506   DALI_TEST_CHECK( !label.GetProperty<bool>( TextLabel::Property::ENABLE_AUTO_SCROLL ) );
507   label.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
508   DALI_TEST_CHECK( label.GetProperty<bool>( TextLabel::Property::ENABLE_AUTO_SCROLL ) );
509   label.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, SCROLL_SPEED );
510   DALI_TEST_EQUALS( SCROLL_SPEED, label.GetProperty<int>( TextLabel::Property::AUTO_SCROLL_SPEED ), TEST_LOCATION );
511   label.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, SCROLL_LOOPS );
512   DALI_TEST_EQUALS( SCROLL_LOOPS, label.GetProperty<int>( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT ), TEST_LOCATION );
513   label.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, SCROLL_GAP );
514   DALI_TEST_EQUALS( SCROLL_GAP, label.GetProperty<float>( TextLabel::Property::AUTO_SCROLL_GAP ), TEST_LOCATION );
515   label.SetProperty(TextLabel::Property::AUTO_SCROLL_LOOP_DELAY, SCROLL_LOOP_DELAY );
516   DALI_TEST_EQUALS( SCROLL_LOOP_DELAY, label.GetProperty<float>( TextLabel::Property::AUTO_SCROLL_LOOP_DELAY ), TEST_LOCATION );
517
518   //Check autoscroll stop type property
519   label.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::IMMEDIATE );
520   DALI_TEST_EQUALS( STOP_IMMEDIATE, label.GetProperty<std::string>( TextLabel::Property::AUTO_SCROLL_STOP_MODE ), TEST_LOCATION );
521
522   label.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::FINISH_LOOP );
523   DALI_TEST_EQUALS( STOP_FINISH_LOOP, label.GetProperty<std::string>( TextLabel::Property::AUTO_SCROLL_STOP_MODE ), TEST_LOCATION );
524
525   // test natural size with multi-line and line spacing
526   {
527     TextLabel label3 = TextLabel::New("Some text here\nend there\nend here");
528     Vector3 oneLineNaturalSize = label3.GetNaturalSize();
529     label3.SetProperty(TextLabel::Property::MULTI_LINE, true);
530     label3.SetProperty(TextLabel::Property::LINE_SPACING, 0);
531     Vector3 multiLineNaturalSize = label3.GetNaturalSize();
532
533     // The width of the text when multi-line is enabled will be smaller (lines separated on '\n')
534     // The height of the text when multi-line is enabled will be larger
535     DALI_TEST_CHECK( oneLineNaturalSize.width > multiLineNaturalSize.width );
536     DALI_TEST_CHECK( oneLineNaturalSize.height < multiLineNaturalSize.height );
537
538     // Change line spacing, meaning height will increase by 3 times the amount specified as we have three lines
539     // Everything else will remain the same
540     int lineSpacing = 20;
541     label3.SetProperty( TextLabel::Property::LINE_SPACING, lineSpacing );
542     Vector3 expectedAfterLineSpacingApplied( multiLineNaturalSize );
543     expectedAfterLineSpacingApplied.height += 3 * lineSpacing;
544     DALI_TEST_EQUALS( expectedAfterLineSpacingApplied, label3.GetNaturalSize(), TEST_LOCATION );
545   }
546
547   // single line, line spacing must not affect natural size of the text, only add the spacing to the height
548   {
549     TextLabel label3 = TextLabel::New("Some text here end there end here");
550     label3.SetProperty(TextLabel::Property::MULTI_LINE, false);
551     label3.SetProperty(TextLabel::Property::LINE_SPACING, 0);
552     Vector3 textNaturalSize = label3.GetNaturalSize();
553     int lineSpacing = 20;
554     label3.SetProperty( TextLabel::Property::LINE_SPACING, lineSpacing );
555     Vector3 expectedNaturalSizeWithLineSpacing( textNaturalSize );
556     expectedNaturalSizeWithLineSpacing.height += lineSpacing;
557     DALI_TEST_EQUALS( expectedNaturalSizeWithLineSpacing, label3.GetNaturalSize(), TEST_LOCATION );
558   }
559   // Check the line spacing property
560   DALI_TEST_EQUALS( label.GetProperty<float>( TextLabel::Property::LINE_SPACING ), 0.0f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
561   label.SetProperty( TextLabel::Property::LINE_SPACING, 10.f );
562   DALI_TEST_EQUALS( label.GetProperty<float>( TextLabel::Property::LINE_SPACING ), 10.0f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
563
564   // Check the underline property
565   underlineMapSet.Clear();
566   underlineMapSet.Insert( "enable", true );
567   underlineMapSet.Insert( "color", Color::RED );
568   underlineMapSet.Insert( "height", 1 );
569
570   label.SetProperty( TextLabel::Property::UNDERLINE, underlineMapSet );
571
572   application.SendNotification();
573   application.Render();
574
575   underlineMapGet = label.GetProperty<Property::Map>( TextLabel::Property::UNDERLINE );
576   DALI_TEST_EQUALS( underlineMapGet.Count(), underlineMapSet.Count(), TEST_LOCATION );
577   DALI_TEST_EQUALS( DaliTestCheckMaps( underlineMapGet, underlineMapSet ), true, TEST_LOCATION );
578
579   underlineMapSet.Clear();
580   underlineMapSet.Insert( Toolkit::DevelText::Underline::Property::ENABLE, true );
581   underlineMapSet.Insert( Toolkit::DevelText::Underline::Property::COLOR, Color::GREEN );
582   underlineMapSet.Insert( Toolkit::DevelText::Underline::Property::HEIGHT, 2 );
583
584   label.SetProperty( TextLabel::Property::UNDERLINE, underlineMapSet );
585
586   application.SendNotification();
587   application.Render();
588
589   underlineMapGet = label.GetProperty<Property::Map>( TextLabel::Property::UNDERLINE );
590   DALI_TEST_EQUALS( underlineMapGet.Count(), underlineMapSet.Count(), TEST_LOCATION );
591   std::vector<std::string> underlineIndicesConversionTable = { "enable", "color", "height" };
592   DALI_TEST_EQUALS( DaliTestCheckMaps( underlineMapGet, underlineMapSet, underlineIndicesConversionTable ), true, TEST_LOCATION );
593
594   underlineMapSet.Clear();
595
596   Property::Map underlineDisabledMapGet;
597   underlineDisabledMapGet.Insert( "enable", false );
598   underlineDisabledMapGet.Insert( "color", Color::GREEN );
599   underlineDisabledMapGet.Insert( "height", 2 );
600
601   label.SetProperty( TextLabel::Property::UNDERLINE, underlineMapSet );
602
603   application.SendNotification();
604   application.Render();
605
606   underlineMapGet = label.GetProperty<Property::Map>( TextLabel::Property::UNDERLINE );
607   DALI_TEST_EQUALS( underlineMapGet.Count(), underlineDisabledMapGet.Count(), TEST_LOCATION );
608   DALI_TEST_EQUALS( DaliTestCheckMaps( underlineMapGet, underlineDisabledMapGet ), true, TEST_LOCATION );
609
610   // Check the shadow property
611
612   Property::Map shadowMapSet;
613   Property::Map shadowMapGet;
614
615   shadowMapSet.Insert( "color", Color::GREEN );
616   shadowMapSet.Insert( "offset", Vector2(2.0f, 2.0f) );
617   shadowMapSet.Insert( "blurRadius", 5.0f );
618
619   label.SetProperty( TextLabel::Property::SHADOW, shadowMapSet );
620
621   shadowMapGet = label.GetProperty<Property::Map>( TextLabel::Property::SHADOW );
622   DALI_TEST_EQUALS( shadowMapGet.Count(), shadowMapSet.Count(), TEST_LOCATION );
623   DALI_TEST_EQUALS( DaliTestCheckMaps( shadowMapGet, shadowMapSet ), true, TEST_LOCATION );
624
625   shadowMapSet.Clear();
626
627   shadowMapSet.Insert( Toolkit::DevelText::Shadow::Property::COLOR, Color::BLUE );
628   shadowMapSet.Insert( Toolkit::DevelText::Shadow::Property::OFFSET, "3.0 3.0" );
629   shadowMapSet.Insert( Toolkit::DevelText::Shadow::Property::BLUR_RADIUS, 3.0f );
630
631   label.SetProperty( TextLabel::Property::SHADOW, shadowMapSet );
632
633   // Replace the offset (string) by a vector2
634   shadowMapSet.Clear();
635   shadowMapSet.Insert( Toolkit::DevelText::Shadow::Property::COLOR, Color::BLUE );
636   shadowMapSet.Insert( Toolkit::DevelText::Shadow::Property::OFFSET, Vector2( 3.0, 3.0 ) );
637   shadowMapSet.Insert( Toolkit::DevelText::Shadow::Property::BLUR_RADIUS, 3.0f );
638
639   shadowMapGet = label.GetProperty<Property::Map>( TextLabel::Property::SHADOW );
640   DALI_TEST_EQUALS( shadowMapGet.Count(), shadowMapSet.Count(), TEST_LOCATION );
641   std::vector<std::string> shadowIndicesConversionTable = { "color", "offset", "blurRadius" };
642   DALI_TEST_EQUALS( DaliTestCheckMaps( shadowMapGet, shadowMapSet, shadowIndicesConversionTable ), true, TEST_LOCATION );
643
644   shadowMapSet.Clear();
645   Property::Map shadowDisabledMapGet;
646   shadowDisabledMapGet.Insert( "color", Color::BLUE );
647   shadowDisabledMapGet.Insert( "offset", Vector2(0.0f, 0.0f) );
648   shadowDisabledMapGet.Insert( "blurRadius", 3.0f );
649
650   label.SetProperty( TextLabel::Property::SHADOW, shadowMapSet );
651
652   shadowMapGet = label.GetProperty<Property::Map>( TextLabel::Property::SHADOW );
653   DALI_TEST_EQUALS( shadowMapGet.Count(), shadowDisabledMapGet.Count(), TEST_LOCATION );
654   DALI_TEST_EQUALS( DaliTestCheckMaps( shadowMapGet, shadowDisabledMapGet ), true, TEST_LOCATION );
655
656   // Check the emboss property
657   label.SetProperty( TextLabel::Property::EMBOSS, "Emboss properties" );
658   DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::EMBOSS ), std::string("Emboss properties"), TEST_LOCATION );
659
660   // Check the outline property
661
662   // Test string type first
663   // This is purely to maintain backward compatibility, but we don't support string as the outline property type.
664   label.SetProperty( TextLabel::Property::OUTLINE, "Outline properties" );
665   DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::OUTLINE ), std::string("Outline properties"), TEST_LOCATION );
666
667   // Then test the property map type
668   Property::Map outlineMapSet;
669   Property::Map outlineMapGet;
670
671   outlineMapSet["color"] = Color::RED;
672   outlineMapSet["width"] = 2.0f;
673   label.SetProperty( TextLabel::Property::OUTLINE, outlineMapSet );
674
675   outlineMapGet = label.GetProperty<Property::Map>( TextLabel::Property::OUTLINE );
676   DALI_TEST_EQUALS( outlineMapGet.Count(), outlineMapSet.Count(), TEST_LOCATION );
677   DALI_TEST_EQUALS( DaliTestCheckMaps( outlineMapGet, outlineMapSet ), true, TEST_LOCATION );
678
679   outlineMapSet.Clear();
680   outlineMapSet[Toolkit::DevelText::Outline::Property::COLOR] = Color::BLUE;
681   outlineMapSet[Toolkit::DevelText::Outline::Property::WIDTH] = 3.0f;
682   label.SetProperty( TextLabel::Property::OUTLINE, outlineMapSet );
683
684   outlineMapGet = label.GetProperty<Property::Map>( TextLabel::Property::OUTLINE );
685   DALI_TEST_EQUALS( outlineMapGet.Count(), outlineMapSet.Count(), TEST_LOCATION );
686   std::vector<std::string> outlineIndicesConversionTable = { "color", "width" };
687   DALI_TEST_EQUALS( DaliTestCheckMaps( outlineMapGet, outlineMapSet, outlineIndicesConversionTable ), true, TEST_LOCATION );
688
689   // Check the background property
690   Property::Map backgroundMapSet;
691   Property::Map backgroundMapGet;
692
693   backgroundMapSet["enable"] = true;
694   backgroundMapSet["color"] = Color::RED;
695   label.SetProperty( DevelTextLabel::Property::BACKGROUND, backgroundMapSet );
696
697   backgroundMapGet = label.GetProperty<Property::Map>( DevelTextLabel::Property::BACKGROUND );
698   DALI_TEST_EQUALS( backgroundMapGet.Count(), backgroundMapSet.Count(), TEST_LOCATION );
699   DALI_TEST_EQUALS( DaliTestCheckMaps( backgroundMapGet, backgroundMapSet ), true, TEST_LOCATION );
700
701   backgroundMapSet.Clear();
702   backgroundMapSet[Toolkit::DevelText::Background::Property::ENABLE] = true;
703   backgroundMapSet[Toolkit::DevelText::Background::Property::COLOR] = Color::GREEN;
704   label.SetProperty( DevelTextLabel::Property::BACKGROUND, backgroundMapSet );
705
706   backgroundMapGet = label.GetProperty<Property::Map>( DevelTextLabel::Property::BACKGROUND );
707   DALI_TEST_EQUALS( backgroundMapGet.Count(), backgroundMapSet.Count(), TEST_LOCATION );
708   std::vector<std::string> backgroundIndicesConversionTable = { "enable", "color" };
709   DALI_TEST_EQUALS( DaliTestCheckMaps( backgroundMapGet, backgroundMapSet, backgroundIndicesConversionTable ), true, TEST_LOCATION );
710
711   // Check the pixel size of font
712   label.SetProperty( TextLabel::Property::PIXEL_SIZE, 20.f );
713   DALI_TEST_EQUALS( label.GetProperty<float>( TextLabel::Property::PIXEL_SIZE ), 20.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
714
715   // Check the ellipsis property
716   DALI_TEST_CHECK( label.GetProperty<bool>( TextLabel::Property::ELLIPSIS ) );
717   label.SetProperty( TextLabel::Property::ELLIPSIS, false );
718   DALI_TEST_CHECK( !label.GetProperty<bool>( TextLabel::Property::ELLIPSIS ) );
719
720   // Check the layout direction property
721   label.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::RIGHT_TO_LEFT );
722   DALI_TEST_EQUALS( label.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::RIGHT_TO_LEFT ), TEST_LOCATION );
723
724   // Check the line size property
725   DALI_TEST_EQUALS( label.GetProperty<float>( DevelTextLabel::Property::MIN_LINE_SIZE ), 0.0f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
726   label.SetProperty( DevelTextLabel::Property::MIN_LINE_SIZE, 50.f );
727   DALI_TEST_EQUALS( label.GetProperty<float>( DevelTextLabel::Property::MIN_LINE_SIZE ), 50.0f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
728
729   application.SendNotification();
730   application.Render();
731
732   END_TEST;
733 }
734
735 int UtcDaliToolkitTextlabelAtlasRenderP(void)
736 {
737   ToolkitTestApplication application;
738   tet_infoline(" UtcDaliToolkitTextLabelAtlasRenderP");
739   TextLabel label = TextLabel::New("Test Text");
740   DALI_TEST_CHECK( label );
741
742   // Avoid a crash when core load gl resources.
743   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
744
745   application.GetScene().Add( label );
746
747   // Turn on all the effects
748   label.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
749   label.SetProperty( TextLabel::Property::MULTI_LINE, true );
750
751   Property::Map underlineMap;
752   underlineMap.Insert( "enable", true );
753   underlineMap.Insert( "color", Color::RED );
754   label.SetProperty( TextLabel::Property::UNDERLINE, underlineMap );
755
756   Property::Map shadowMap;
757   shadowMap.Insert( "color", Color::BLUE );
758   shadowMap.Insert( "offset", Vector2( 1.0f, 1.0f ) );
759   label.SetProperty( TextLabel::Property::SHADOW, shadowMap );
760
761   try
762   {
763     // Render some text with the shared atlas backend
764     label.SetProperty( DevelTextLabel::Property::RENDERING_BACKEND, DevelText::RENDERING_SHARED_ATLAS );
765     application.SendNotification();
766     application.Render();
767   }
768   catch( ... )
769   {
770     tet_result(TET_FAIL);
771   }
772
773   try
774   {
775     // Render some text with the shared atlas backend
776     label.SetProperty( DevelTextLabel::Property::RENDERING_BACKEND, DevelText::RENDERING_VECTOR_BASED );
777     application.SendNotification();
778     application.Render();
779   }
780   catch( ... )
781   {
782     tet_result(TET_FAIL);
783   }
784   END_TEST;
785 }
786
787 int UtcDaliToolkitTextLabelLanguagesP(void)
788 {
789   ToolkitTestApplication application;
790   tet_infoline(" UtcDaliToolkitTextLabelLanguagesP");
791   TextLabel label = TextLabel::New();
792   DALI_TEST_CHECK( label );
793
794   application.GetScene().Add( label );
795
796   const std::string scripts( " привет мир, γειά σου Κόσμε, Hello world, مرحبا بالعالم, שלום עולם, "
797                              "բարեւ աշխարհը, მსოფლიოში, 안녕하세요, 你好世界, ひらがな, カタカナ, "
798                              "ওহে বিশ্ব, မင်္ဂလာပါကမ္ဘာလောက, हैलो वर्ल्ड, હેલો વર્લ્ડ, ਸਤਿ ਸ੍ਰੀ ਅਕਾਲ ਦੁਨਿਆ, ಹಲೋ ವರ್ಲ್ಡ್, "
799                              "ഹലോ വേൾഡ്, ଓଡ଼ିଆ, හෙලෝ වර්ල්ඩ්, ஹலோ உலகம், హలో వరల్డ్, "
800                              "ສະບາຍດີໂລກ, สวัสดีโลก, ជំរាបសួរពិភពលោក, "
801                              "\xF0\x9F\x98\x81 \xF0\x9F\x98\x82 \xF0\x9F\x98\x83 \xF0\x9F\x98\x84." ); // these characters on the last line are emojis.
802
803   label.SetProperty( TextLabel::Property::TEXT, scripts );
804   DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::TEXT ), scripts, TEST_LOCATION );
805
806   application.SendNotification();
807   application.Render();
808
809   END_TEST;
810 }
811
812 int UtcDaliToolkitTextLabelEmojisP(void)
813 {
814   ToolkitTestApplication application;
815   tet_infoline(" UtcDaliToolkitTextLabelLanguagesP");
816   TextLabel label = TextLabel::New();
817   DALI_TEST_CHECK( label );
818
819   application.GetScene().Add( label );
820
821   TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
822
823   char* pathNamePtr = get_current_dir_name();
824   const std::string pathName( pathNamePtr );
825   free( pathNamePtr );
826
827   TextAbstraction::FontDescription fontDescription;
828   fontDescription.path = pathName + DEFAULT_FONT_DIR + "/tizen/BreezeColorEmoji.ttf";
829   fontDescription.family = "BreezeColorEmoji";
830   fontDescription.width = TextAbstraction::FontWidth::NONE;
831   fontDescription.weight = TextAbstraction::FontWeight::NORMAL;
832   fontDescription.slant = TextAbstraction::FontSlant::NONE;
833
834   fontClient.GetFontId( fontDescription, EMOJI_FONT_SIZE );
835
836   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>";
837   label.SetProperty( TextLabel::Property::ENABLE_MARKUP, true );
838   label.SetProperty( TextLabel::Property::TEXT, emojis );
839
840   Property::Map shadowMap;
841   shadowMap.Insert( "color", "green" );
842   shadowMap.Insert( "offset", "2 2" );
843   label.SetProperty( TextLabel::Property::SHADOW, shadowMap );
844
845   application.SendNotification();
846   application.Render();
847
848   // EMOJI + ZWJ + EMOJI case for coverage.
849   const std::string emojiWithZWJ = "&#x1f469;&#x200d;&#x1f52c;";
850   label.SetProperty( TextLabel::Property::TEXT, emojiWithZWJ );
851
852   application.SendNotification();
853   application.Render();
854
855   // EMOJI Sequences case for coverage.
856   std::string emojiSequences =
857        "Text VS15 &#x262a;&#xfe0e;\n"                                                         //text presentation sequence and selector
858       "Color VS16 &#x262a;&#xfe0f;\n"                                                        //emoji presentation sequence and selector
859       "Default &#x262a; \n"                                                                  //default presentation
860       "FamilyManWomanGirlBoy &#x1F468;&#x200D;&#x1F469;&#x200D;&#x1F467;&#x200D;&#x1F466;\n" // emoji multi zwj sequence
861       "WomanScientist &#x1f469;&#x200d;&#x1f52c;\n"                                          // emoji zwj sequence
862       "WomanScientistLightSkinTone&#x1F469;&#x1F3FB;&#x200D;&#x1F52C; \n"                    //emoji modifier sequence: skin tone & JWZ
863       "LeftRightArrowText&#x2194;&#xfe0e;\n"                                                 //text presentation sequence and selector
864       "LeftRightArrowEmoji&#x2194;&#xfe0f;\n"                                                //emoji presentation sequence and selector
865       "SouthKoreaFlag&#x1f1f0;&#x1f1f7;\n"                                                   //emoji flag sequence
866       "JordanFlag&#x1f1ef;&#x1f1f4;\n"                                                       // emoji flag sequence
867       "EnglandFlag&#x1F3F4;&#xE0067;&#xE0062;&#xE0065;&#xE006E;&#xE0067;&#xE007F;\n"         //emoji tag sequence like England flag
868       "Runner &#x1f3c3;&#x200d;&#x27a1;&#xfe0f; \n"
869       "VictoryHandMediumLightSkinTone:&#x270C;&#xFE0F;&#x1F3FC;\n"               //emoji modifier sequence: skin tone
870       "RainbowFlag:&#x1F3F3;&#xFE0F;&#x200D;&#x1F308; \n"                        //emoji zwj sequence: Rainbow Flag
871       "keycap# &#x0023;&#xFE0F;&#x20E3; \n"                                      // fully-qualified  emoji keycap sequence
872       "keycap#_text &#x0023;&#x20E3; \n"                                         // unqualified emoji keycap sequence
873       "keycap3 &#x0033;&#xfe0f;&#x20e3; \n"                                      // fully-qualified  emoji keycap sequence
874       "keycap3_text &#x0033;&#x20e3; \n"                                         // unqualified emoji keycap sequence
875       "two adjacent glyphs &#x262a;&#xfe0f;&#xfe0f;&#xfe0f;&#x262a;&#xfe0f;\n"   //This line should be rendered as two adjacent glyphs
876       "Digit 8&#xfe0f; 8&#xfe0e; 8\n"                                            // should be rendered according to selector
877       "Surfing Medium Skin Female:  &#x1f3c4;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;"; // Person Surfing + Medium Skin Tone +? Zero Width Joiner + Female Sign
878
879   label.SetProperty( TextLabel::Property::TEXT, emojiSequences );
880   label.SetProperty( TextLabel::Property::ENABLE_MARKUP, true );
881   label.SetProperty( TextLabel::Property::MULTI_LINE, true);
882   label.SetProperty( TextLabel::Property::ELLIPSIS, false);
883
884   application.SendNotification();
885   application.Render();
886   END_TEST;
887 }
888
889 int UtcDaliToolkitTextlabelScrollingP(void)
890 {
891   ToolkitTestApplication application;
892   tet_infoline(" UtcDaliToolkitTextLabelScrollingP");
893   TextLabel labelImmediate = TextLabel::New("Some text to scroll");
894   TextLabel labelFinished = TextLabel::New("مرحبا بالعالم");
895
896   DALI_TEST_CHECK( labelImmediate );
897   DALI_TEST_CHECK( labelFinished );
898   // Avoid a crash when core load gl resources.
899   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
900   application.GetScene().Add( labelImmediate );
901   // Turn on all the effects
902   labelImmediate.SetProperty( TextLabel::Property::MULTI_LINE, false );
903   labelImmediate.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
904   labelImmediate.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
905   labelImmediate.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
906   labelImmediate.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::IMMEDIATE );
907
908   application.GetScene().Add( labelFinished );
909   // Turn on all the effects
910   labelFinished.SetProperty( TextLabel::Property::MULTI_LINE, false );
911   labelFinished.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
912   labelFinished.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
913   labelFinished.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
914   labelFinished.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::FINISH_LOOP );
915
916
917
918   try
919   {
920     // Render some text with the shared atlas backend
921     labelImmediate.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
922     labelFinished.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
923
924     labelImmediate.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
925     labelFinished.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
926
927     labelImmediate.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
928     labelFinished.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
929     application.SendNotification();
930     application.Render();
931
932     labelImmediate.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
933     labelFinished.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
934     application.SendNotification();
935     application.Render();
936
937   }
938   catch( ... )
939   {
940     tet_result(TET_FAIL);
941   }
942
943   END_TEST;
944 }
945
946 int UtcDaliToolkitTextlabelScrollingCenterAlignP(void)
947 {
948   ToolkitTestApplication application;
949   TextLabel labelShort = TextLabel::New("Some text to scroll");
950   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!");
951
952   DALI_TEST_CHECK( labelShort );
953   DALI_TEST_CHECK( labelLong );
954   // Avoid a crash when core load gl resources.
955   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
956   application.GetScene().Add( labelShort );
957   // Turn on all the effects
958   labelShort.SetProperty( TextLabel::Property::MULTI_LINE, false );
959   labelShort.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
960   labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
961   labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
962   labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
963   labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::IMMEDIATE );
964
965   application.GetScene().Add( labelLong );
966   // Turn on all the effects
967   labelLong.SetProperty( TextLabel::Property::MULTI_LINE, false );
968   labelLong.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
969   labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
970   labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
971   labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
972   labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::FINISH_LOOP );
973
974   try
975   {
976     // Render some text with the shared atlas backend
977     labelShort.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
978     labelLong.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
979     application.SendNotification();
980     application.Render();
981
982     labelShort.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
983     labelLong.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
984     application.SendNotification();
985     application.Render();
986
987   }
988   catch( ... )
989   {
990     tet_result(TET_FAIL);
991   }
992
993   END_TEST;
994 }
995
996 int UtcDaliToolkitTextlabelScrollingCenterAlignRTLP(void)
997 {
998   ToolkitTestApplication application;
999   TextLabel labelShort = TextLabel::New("مرحبا بالعالم");
1000   TextLabel labelLong = TextLabel::New("لكن لا بد أن أوضح لك أن كل هذه الأفكار المغلوطة حول استنكار  النشوة وتمجيد الألم نشأت بالفعل، وسأعرض لك التفاصيل لتكتشف حقيقة وأساس تلك السعادة البشرية، فلا أحد يرفض أو يكره أو يتجنب الشعور بالسعادة، ولكن بفضل هؤلاء الأشخاص الذين لا يدركون بأن السعادة لا بد أن نستشعرها بصورة أكثر عقلانية ومنطقية فيعرضهم هذا لمواجهة الظروف الأليمة، وأكرر بأنه لا يوجد من يرغب في الحب ونيل المنال ويتلذذ بالآلام، الألم هو الألم ولكن نتيجة لظروف ما قد تكمن السعاده فيما نتحمله من كد وأسي");
1001
1002   DALI_TEST_CHECK( labelShort );
1003   DALI_TEST_CHECK( labelLong );
1004   // Avoid a crash when core load gl resources.
1005   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
1006   application.GetScene().Add( labelShort );
1007   // Turn on all the effects
1008   labelShort.SetProperty( TextLabel::Property::MULTI_LINE, false );
1009   labelShort.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
1010   labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
1011   labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
1012   labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
1013   labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::IMMEDIATE );
1014
1015   application.GetScene().Add( labelLong );
1016   // Turn on all the effects
1017   labelLong.SetProperty( TextLabel::Property::MULTI_LINE, false );
1018   labelLong.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
1019   labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
1020   labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
1021   labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
1022   labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::FINISH_LOOP );
1023
1024   try
1025   {
1026     // Render some text with the shared atlas backend
1027     labelShort.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
1028     labelLong.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
1029     application.SendNotification();
1030     application.Render();
1031
1032     labelShort.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
1033     labelLong.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
1034     application.SendNotification();
1035     application.Render();
1036
1037   }
1038   catch( ... )
1039   {
1040     tet_result(TET_FAIL);
1041   }
1042
1043   END_TEST;
1044 }
1045
1046 int UtcDaliToolkitTextlabelScrollingEndAlignP(void)
1047 {
1048   ToolkitTestApplication application;
1049   TextLabel labelShort = TextLabel::New("Some text to scroll");
1050   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!");
1051
1052   DALI_TEST_CHECK( labelShort );
1053   DALI_TEST_CHECK( labelLong );
1054   // Avoid a crash when core load gl resources.
1055   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
1056   application.GetScene().Add( labelShort );
1057   // Turn on all the effects
1058   labelShort.SetProperty( TextLabel::Property::MULTI_LINE, false );
1059   labelShort.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "END" );
1060   labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
1061   labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
1062   labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
1063   labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::IMMEDIATE );
1064
1065   application.GetScene().Add( labelLong );
1066   // Turn on all the effects
1067   labelLong.SetProperty( TextLabel::Property::MULTI_LINE, false );
1068   labelLong.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "END" );
1069   labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
1070   labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
1071   labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
1072   labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::FINISH_LOOP );
1073
1074   try
1075   {
1076     // Render some text with the shared atlas backend
1077     labelShort.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
1078     labelLong.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
1079     application.SendNotification();
1080     application.Render();
1081
1082     labelShort.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
1083     labelLong.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
1084     application.SendNotification();
1085     application.Render();
1086
1087   }
1088   catch( ... )
1089   {
1090     tet_result(TET_FAIL);
1091   }
1092
1093   END_TEST;
1094 }
1095
1096 int UtcDaliToolkitTextlabelScrollingEndAlignRTLP(void)
1097 {
1098   ToolkitTestApplication application;
1099   TextLabel labelShort = TextLabel::New("مرحبا بالعالم");
1100   TextLabel labelLong = TextLabel::New("لكن لا بد أن أوضح لك أن كل هذه الأفكار المغلوطة حول استنكار  النشوة وتمجيد الألم نشأت بالفعل، وسأعرض لك التفاصيل لتكتشف حقيقة وأساس تلك السعادة البشرية، فلا أحد يرفض أو يكره أو يتجنب الشعور بالسعادة، ولكن بفضل هؤلاء الأشخاص الذين لا يدركون بأن السعادة لا بد أن نستشعرها بصورة أكثر عقلانية ومنطقية فيعرضهم هذا لمواجهة الظروف الأليمة، وأكرر بأنه لا يوجد من يرغب في الحب ونيل المنال ويتلذذ بالآلام، الألم هو الألم ولكن نتيجة لظروف ما قد تكمن السعاده فيما نتحمله من كد وأسي");
1101
1102   DALI_TEST_CHECK( labelShort );
1103   DALI_TEST_CHECK( labelLong );
1104   // Avoid a crash when core load gl resources.
1105   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
1106   application.GetScene().Add( labelShort );
1107   // Turn on all the effects
1108   labelShort.SetProperty( TextLabel::Property::MULTI_LINE, false );
1109   labelShort.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "END" );
1110   labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
1111   labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
1112   labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
1113   labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::IMMEDIATE );
1114
1115   application.GetScene().Add( labelLong );
1116   // Turn on all the effects
1117   labelLong.SetProperty( TextLabel::Property::MULTI_LINE, false );
1118   labelLong.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "END" );
1119   labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
1120   labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
1121   labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
1122   labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::FINISH_LOOP );
1123
1124   try
1125   {
1126     // Render some text with the shared atlas backend
1127     labelShort.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
1128     labelLong.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
1129     application.SendNotification();
1130     application.Render();
1131
1132     labelShort.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
1133     labelLong.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
1134     application.SendNotification();
1135     application.Render();
1136
1137   }
1138   catch( ... )
1139   {
1140     tet_result(TET_FAIL);
1141   }
1142
1143   END_TEST;
1144 }
1145
1146 int UtcDaliToolkitTextlabelScrollingInterruptedP(void)
1147 {
1148   ToolkitTestApplication application;
1149   tet_infoline(" UtcDaliToolkitTextlabelScrollingInterruptedP");
1150   TextLabel label = TextLabel::New("Some text to scroll");
1151   DALI_TEST_CHECK( label );
1152   // Avoid a crash when core load gl resources.
1153   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
1154   application.GetScene().Add( label );
1155   label.SetProperty( Actor::Property::SIZE, Vector2( 360.0f, 20.f ) );
1156   // Turn on all the effects
1157   label.SetProperty( TextLabel::Property::MULTI_LINE, false );
1158   label.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
1159   label.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
1160   label.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
1161
1162   // Render the text.
1163   application.SendNotification();
1164   application.Render();
1165
1166   unsigned int actorCount1 = label.GetChildCount();
1167   tet_printf("Initial actor count is(%d)\n", actorCount1 );
1168
1169   try
1170   {
1171     // Render some text with the shared atlas backend
1172     label.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
1173     application.SendNotification();
1174     application.Render(2000);
1175
1176     unsigned int actorCount1 = label.GetChildCount();
1177     tet_printf("Actor count after scrolling is(%d)\n", actorCount1 );
1178
1179     label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::RED );
1180
1181     // Render the text.
1182     application.SendNotification();
1183     application.Render();
1184
1185     unsigned int actorCount2 = label.GetChildCount();
1186     tet_printf("After changing color the actor count is(%d)\n", actorCount2 );
1187
1188     DALI_TEST_EQUALS( actorCount1, actorCount2, TEST_LOCATION );
1189
1190   }
1191   catch( ... )
1192   {
1193     tet_result(TET_FAIL);
1194   }
1195
1196   END_TEST;
1197 }
1198
1199 int UtcDaliToolkitTextlabelScrollingN(void)
1200 {
1201   ToolkitTestApplication application;
1202   tet_infoline(" UtcDaliToolkitTextlabelScrollingN");
1203
1204   TextLabel label = TextLabel::New("Some text to scroll");
1205   DALI_TEST_CHECK( label );
1206
1207   application.GetScene().Add( label );
1208
1209   // Avoid a crash when core load gl resources.
1210   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
1211
1212   // The text scrolling works only on single line text.
1213   label.SetProperty( TextLabel::Property::MULTI_LINE, true );
1214
1215   // Turn on all the effects.
1216   label.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
1217   label.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
1218   label.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
1219
1220   // Enable the auto scrolling effect.
1221   label.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
1222
1223   // The auto scrolling shouldn't be enabled.
1224   const bool enabled = label.GetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL ).Get<bool>();
1225   DALI_TEST_CHECK( !enabled );
1226
1227   END_TEST;
1228 }
1229
1230 int UtcDaliToolkitTextlabelScrollingWithEllipsis(void)
1231 {
1232   ToolkitTestApplication application;
1233   tet_infoline(" UtcDaliToolkitTextlabelScrollingWithEllipsis");
1234
1235   TextLabel label = TextLabel::New("Some text to scroll");
1236   DALI_TEST_CHECK( label );
1237
1238   application.GetScene().Add( label );
1239
1240   // Avoid a crash when core load gl resources.
1241   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
1242
1243   // Turn on all the effects.
1244   label.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
1245   label.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
1246   label.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
1247
1248   try
1249   {
1250     // Enable the auto scrolling effect.
1251     label.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
1252     label.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::IMMEDIATE );
1253
1254     // Disable the ellipsis
1255     label.SetProperty( TextLabel::Property::ELLIPSIS, false );
1256
1257     // Render the text.
1258     application.SendNotification();
1259     application.Render();
1260
1261     // Stop auto scrolling
1262     label.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
1263
1264     // Check the ellipsis property
1265     DALI_TEST_CHECK( !label.GetProperty<bool>( TextLabel::Property::ELLIPSIS ) );
1266   }
1267   catch( ... )
1268   {
1269     tet_result(TET_FAIL);
1270   }
1271
1272   END_TEST;
1273 }
1274
1275 int UtcDaliToolkitTextlabelEllipsis(void)
1276 {
1277   ToolkitTestApplication application;
1278   tet_infoline(" UtcDaliToolkitTextlabelEllipsis");
1279
1280   TextLabel label = TextLabel::New("Hello world");
1281   DALI_TEST_CHECK( label );
1282
1283   // Avoid a crash when core load gl resources.
1284   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
1285
1286   application.GetScene().Add( label );
1287
1288   // Turn on all the effects
1289   label.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
1290   label.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
1291   label.SetProperty( Actor::Property::SIZE, Vector2( 360.0f, 10.f ) );
1292
1293   try
1294   {
1295     // Render the text.
1296     application.SendNotification();
1297     application.Render();
1298   }
1299   catch( ... )
1300   {
1301     tet_result(TET_FAIL);
1302   }
1303
1304   label.SetProperty( TextLabel::Property::TEXT, "Hello world                                        " );
1305   label.SetProperty( DevelTextLabel::Property::IGNORE_SPACES_AFTER_TEXT, false );
1306   label.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 10.f ) );
1307
1308   try
1309   {
1310     // Render the text.
1311     application.SendNotification();
1312     application.Render();
1313   }
1314   catch( ... )
1315   {
1316     tet_result(TET_FAIL);
1317   }
1318
1319
1320   label.SetProperty( TextLabel::Property::TEXT, "Hello world" );
1321   label.SetProperty( DevelTextLabel::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION, true );
1322   label.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 10.f ) );
1323
1324   try
1325   {
1326     // Render the text.
1327     application.SendNotification();
1328     application.Render();
1329   }
1330   catch( ... )
1331   {
1332     tet_result(TET_FAIL);
1333   }
1334
1335   END_TEST;
1336 }
1337
1338 int UtcDaliToolkitTextlabelTextWrapMode(void)
1339 {
1340   ToolkitTestApplication application;
1341   tet_infoline(" UtcDaliToolkitTextlabelTextWarpMode");
1342
1343   int lineCount =0 ;
1344
1345   TextLabel label = TextLabel::New();
1346   label.SetProperty( Actor::Property::SIZE, Vector2( 300.0f, 300.f ) );
1347   label.SetProperty( TextLabel::Property::TEXT, "Hello world Hello world" );
1348   label.SetProperty( TextLabel::Property::MULTI_LINE, true );
1349
1350
1351
1352   //label.SetProperty( TextLabel::Property::POINT_SIZE, 18 );
1353   application.GetScene().Add( label );
1354
1355   label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, "WORD" );
1356   DALI_TEST_EQUALS( label.GetProperty< int >( TextLabel::Property::LINE_WRAP_MODE ), static_cast< int >( Text::LineWrap::WORD ), TEST_LOCATION );
1357
1358   application.SendNotification();
1359   application.Render();
1360
1361   lineCount =  label.GetProperty<int>( TextLabel::Property::LINE_COUNT );
1362   DALI_TEST_EQUALS( lineCount, 2, TEST_LOCATION );
1363
1364   label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, "CHARACTER" );
1365   DALI_TEST_EQUALS( label.GetProperty< int >( TextLabel::Property::LINE_WRAP_MODE ), static_cast< int >( Text::LineWrap::CHARACTER ), TEST_LOCATION );
1366
1367   application.SendNotification();
1368   application.Render();
1369
1370   label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, Text::LineWrap::WORD );
1371   DALI_TEST_EQUALS( label.GetProperty< int >( TextLabel::Property::LINE_WRAP_MODE ), static_cast< int >( Text::LineWrap::WORD ), TEST_LOCATION );
1372
1373   application.SendNotification();
1374   application.Render();
1375
1376   lineCount =  label.GetProperty<int>( TextLabel::Property::LINE_COUNT );
1377   DALI_TEST_EQUALS( lineCount, 2, TEST_LOCATION );
1378
1379   label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, Text::LineWrap::CHARACTER );
1380   DALI_TEST_EQUALS( label.GetProperty< int >( TextLabel::Property::LINE_WRAP_MODE ), static_cast< int >( Text::LineWrap::CHARACTER ), TEST_LOCATION );
1381
1382   application.SendNotification();
1383   application.Render();
1384
1385   lineCount =  label.GetProperty<int>( TextLabel::Property::LINE_COUNT );
1386   DALI_TEST_EQUALS( lineCount, 2, TEST_LOCATION );
1387
1388   tet_infoline( "Ensure invalid string does not change wrapping mode" );
1389   label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, "InvalidWrapMode" );
1390   DALI_TEST_EQUALS( label.GetProperty< int >( TextLabel::Property::LINE_WRAP_MODE ), static_cast< int >( Text::LineWrap::CHARACTER ), TEST_LOCATION );
1391
1392   END_TEST;
1393 }
1394
1395 int UtcDaliToolkitTextLabelColorComponents(void)
1396 {
1397   ToolkitTestApplication application;
1398
1399   TextLabel label = TextLabel::New();
1400   label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::RED );
1401   DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_RED ),   1.0f, TEST_LOCATION );
1402   DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_GREEN ), 0.0f, TEST_LOCATION );
1403   DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_BLUE ),  0.0f, TEST_LOCATION );
1404   DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_ALPHA ), 1.0f, TEST_LOCATION );
1405
1406   label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::GREEN );
1407   DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_RED ),   0.0f, TEST_LOCATION );
1408   DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_GREEN ), 1.0f, TEST_LOCATION );
1409   DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_BLUE ),  0.0f, TEST_LOCATION );
1410   DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_ALPHA ), 1.0f, TEST_LOCATION );
1411
1412   label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::BLUE );
1413   DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_RED ),   0.0f, TEST_LOCATION );
1414   DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_GREEN ), 0.0f, TEST_LOCATION );
1415   DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_BLUE ),  1.0f, TEST_LOCATION );
1416   DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_ALPHA ), 1.0f, TEST_LOCATION );
1417
1418   label.SetProperty( TextLabel::Property::TEXT_COLOR_ALPHA, 0.6f );
1419   DALI_TEST_EQUALS( label.GetProperty< float >( TextLabel::Property::TEXT_COLOR_ALPHA ), 0.6f, TEST_LOCATION );
1420   DALI_TEST_EQUALS( label.GetProperty< Vector4 >( TextLabel::Property::TEXT_COLOR ), Vector4( 0.0f, 0.0f, 1.0f, 0.6f ), TEST_LOCATION );
1421
1422   // Test a transparent text - Rendering should be skipped.
1423   label.SetProperty( TextLabel::Property::TEXT, "Hello world Hello world" );
1424   label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::BLUE );
1425
1426   application.GetScene().Add( label );
1427
1428   TraceCallStack& drawTrace = application.GetGlAbstraction().GetDrawTrace();
1429   drawTrace.Enable( true );
1430
1431   application.SendNotification();
1432   application.Render();
1433
1434   DALI_TEST_EQUALS( drawTrace.FindMethod( "DrawArrays" ), true, TEST_LOCATION );  // Should be rendered
1435
1436   label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::TRANSPARENT );
1437
1438   drawTrace.Reset();
1439
1440   application.SendNotification();
1441   application.Render();
1442
1443   DALI_TEST_EQUALS( drawTrace.FindMethod( "DrawArrays" ), false, TEST_LOCATION ); // Rendering should be skipped
1444
1445   label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::RED );
1446
1447   drawTrace.Reset();
1448
1449   application.SendNotification();
1450   application.Render();
1451
1452   DALI_TEST_EQUALS( drawTrace.FindMethod( "DrawArrays" ), true, TEST_LOCATION ); // Should be rendered again
1453
1454   END_TEST;
1455 }
1456
1457 int UtcDaliToolkitTextlabelTextStyle01(void)
1458 {
1459   ToolkitTestApplication application;
1460   tet_infoline(" UtcDaliToolkitTextlabelTextStyle Setting Outline after Shadow");
1461
1462   TextLabel label = TextLabel::New();
1463   label.SetProperty( Actor::Property::SIZE, Vector2( 300.0f, 300.f ) );
1464   label.SetProperty( TextLabel::Property::TEXT, "Hello world Hello world" );
1465   label.SetProperty( TextLabel::Property::POINT_SIZE, 12 );
1466   application.GetScene().Add( label );
1467
1468   Property::Map outlineMapSet;
1469   Property::Map outlineMapGet;
1470
1471   outlineMapSet["color"] = Color::BLUE;
1472   outlineMapSet["width"] = 2.0f;
1473   label.SetProperty( TextLabel::Property::OUTLINE, outlineMapSet );
1474
1475   application.SendNotification();
1476   application.Render();
1477
1478   Property::Map shadowMapSet;
1479   shadowMapSet.Insert( "color", "green" );
1480   shadowMapSet.Insert( "offset", "2 2" );
1481   shadowMapSet.Insert( "blurRadius", "3" );
1482   label.SetProperty( TextLabel::Property::SHADOW, shadowMapSet );
1483
1484   outlineMapSet["color"] = Color::RED;
1485   outlineMapSet["width"] = 0.0f;
1486   label.SetProperty( TextLabel::Property::OUTLINE, outlineMapSet );
1487
1488   application.SendNotification();
1489   application.Render();
1490
1491   outlineMapGet = label.GetProperty<Property::Map>( TextLabel::Property::OUTLINE );
1492
1493   Property::Value* colorValue = outlineMapGet.Find("color");
1494
1495   bool colorMatched( false );
1496
1497   if ( colorValue )
1498   {
1499      Property::Type valueType = colorValue->GetType();
1500
1501      if ( Property::STRING == valueType )
1502      {
1503        std::string stringValue;
1504        colorValue->Get( stringValue );
1505        if (  stringValue == "red" )
1506        {
1507          colorMatched = true;
1508        }
1509      }
1510      else if ( Property::VECTOR4 == valueType )
1511      {
1512        Vector4 colorVector4;
1513        colorValue->Get( colorVector4 );
1514        if (  colorVector4 == Color::RED )
1515        {
1516          colorMatched = true;
1517        }
1518      }
1519   }
1520
1521   DALI_TEST_EQUALS( colorMatched, true, TEST_LOCATION );
1522
1523   END_TEST;
1524 }
1525
1526 int UtcDaliToolkitTextlabelMultiline(void)
1527 {
1528   ToolkitTestApplication application;
1529   tet_infoline(" UtcDaliToolkitTextlabelMultiline");
1530
1531   TextLabel label = TextLabel::New();
1532   label.SetProperty( TextLabel::Property::TEXT, "Hello world Hello world Hello world Hello world Hello world Hello world" );
1533   label.SetProperty( TextLabel::Property::POINT_SIZE, 20 );
1534   label.SetProperty( TextLabel::Property::MULTI_LINE, false );
1535   application.GetScene().Add( label );
1536
1537   application.SendNotification();
1538   application.Render();
1539
1540   int lineCount =  label.GetProperty<int>( TextLabel::Property::LINE_COUNT );
1541   DALI_TEST_EQUALS( lineCount, 1, TEST_LOCATION );
1542
1543   label.SetProperty( TextLabel::Property::MULTI_LINE, true );
1544
1545   application.SendNotification();
1546   application.Render();
1547
1548   lineCount =  label.GetProperty<int>( TextLabel::Property::LINE_COUNT );
1549   DALI_TEST_EQUALS( true, (lineCount > 1) , TEST_LOCATION );
1550
1551
1552   END_TEST;
1553 }
1554
1555 int UtcDaliToolkitTextlabelTextDirection(void)
1556 {
1557   ToolkitTestApplication application;
1558   tet_infoline(" UtcDaliToolkitTextlabelTextDirection");
1559
1560   TextLabel label = TextLabel::New();
1561   DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::TEXT_DIRECTION ), static_cast< int >( Toolkit::DevelText::TextDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
1562
1563   label.SetProperty( TextLabel::Property::TEXT, "Hello world" );
1564   label.SetProperty( TextLabel::Property::POINT_SIZE, 20 );
1565   label.SetProperty( DevelTextLabel::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION, false );
1566   application.GetScene().Add( label );
1567
1568   // Test LTR text
1569   DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::TEXT_DIRECTION ), static_cast< int >( Toolkit::DevelText::TextDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
1570
1571   // Test RTL text
1572   label.SetProperty( TextLabel::Property::TEXT, "ﻡﺮﺤﺑﺍ ﺏﺎﻠﻋﺎﻠﻣ ﻡﺮﺤﺑﺍ" );
1573   DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::TEXT_DIRECTION ), static_cast< int >( Toolkit::DevelText::TextDirection::RIGHT_TO_LEFT ), TEST_LOCATION );
1574
1575   // Test RTL text starting with weak character
1576   label.SetProperty( TextLabel::Property::TEXT, "()ﻡﺮﺤﺑﺍ ﺏﺎﻠﻋﺎﻠﻣ ﻡﺮﺤﺑﺍ" );
1577   DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::TEXT_DIRECTION ), static_cast< int >( Toolkit::DevelText::TextDirection::RIGHT_TO_LEFT ), TEST_LOCATION );
1578
1579   // Test RTL text string with emoji and weak character
1580   label.SetProperty( TextLabel::Property::TEXT, "\xF0\x9F\x98\x81 () ﻡﺮﺤﺑﺍ ﺏﺎﻠﻋﺎﻠﻣ ﻡﺮﺤﺑﺍ" );
1581   DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::TEXT_DIRECTION ), static_cast< int >( Toolkit::DevelText::TextDirection::RIGHT_TO_LEFT ), TEST_LOCATION );
1582
1583   END_TEST;
1584 }
1585
1586 int UtcDaliToolkitTextlabelVerticalLineAlignment(void)
1587 {
1588   ToolkitTestApplication application;
1589   tet_infoline(" UtcDaliToolkitTextlabelVerticalLineAlignment");
1590
1591   TextLabel label = TextLabel::New();
1592
1593   label.SetProperty( DevelTextLabel::Property::VERTICAL_LINE_ALIGNMENT, DevelText::VerticalLineAlignment::TOP  );
1594   label.SetProperty( TextLabel::Property::TEXT, "Hello world" );
1595   label.SetProperty( TextLabel::Property::POINT_SIZE, 15 );
1596   label.SetProperty( TextLabel::Property::LINE_SPACING, 12 );
1597   application.GetScene().Add( label );
1598   DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::VERTICAL_LINE_ALIGNMENT ), static_cast< int >( Toolkit::DevelText::VerticalLineAlignment::TOP ), TEST_LOCATION );
1599
1600   label.SetProperty( DevelTextLabel::Property::VERTICAL_LINE_ALIGNMENT, DevelText::VerticalLineAlignment::MIDDLE  );
1601   DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::VERTICAL_LINE_ALIGNMENT ), static_cast< int >( Toolkit::DevelText::VerticalLineAlignment::MIDDLE ), TEST_LOCATION );
1602
1603   label.SetProperty( DevelTextLabel::Property::VERTICAL_LINE_ALIGNMENT, DevelText::VerticalLineAlignment::BOTTOM  );
1604   DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::VERTICAL_LINE_ALIGNMENT ), static_cast< int >( Toolkit::DevelText::VerticalLineAlignment::BOTTOM ), TEST_LOCATION );
1605
1606   END_TEST;
1607 }
1608
1609 int UtcDaliToolkitTextLabelBitmapFont(void)
1610 {
1611   ToolkitTestApplication application;
1612   tet_infoline(" UtcDaliToolkitTextLabelBitmapFont");
1613
1614   DevelText::BitmapFontDescription fontDescription;
1615   fontDescription.name = "Digits";
1616   fontDescription.underlinePosition = 0.f;
1617   fontDescription.underlineThickness = 0.f;
1618
1619   fontDescription.glyphs.push_back( { TEST_RESOURCE_DIR "/fonts/bitmap/u0030.png", ":", 34.f, 0.f } );
1620   fontDescription.glyphs.push_back( { TEST_RESOURCE_DIR "/fonts/bitmap/u0031.png", "0", 34.f, 0.f } );
1621   fontDescription.glyphs.push_back( { TEST_RESOURCE_DIR "/fonts/bitmap/u0032.png", "1", 34.f, 0.f } );
1622   fontDescription.glyphs.push_back( { TEST_RESOURCE_DIR "/fonts/bitmap/u0033.png", "2", 34.f, 0.f } );
1623   fontDescription.glyphs.push_back( { TEST_RESOURCE_DIR "/fonts/bitmap/u0034.png", "3", 34.f, 0.f } );
1624   fontDescription.glyphs.push_back( { TEST_RESOURCE_DIR "/fonts/bitmap/u0035.png", "4", 34.f, 0.f } );
1625   fontDescription.glyphs.push_back( { TEST_RESOURCE_DIR "/fonts/bitmap/u0036.png", "5", 34.f, 0.f } );
1626   fontDescription.glyphs.push_back( { TEST_RESOURCE_DIR "/fonts/bitmap/u0037.png", "6", 34.f, 0.f } );
1627   fontDescription.glyphs.push_back( { TEST_RESOURCE_DIR "/fonts/bitmap/u0038.png", "7", 34.f, 0.f } );
1628   fontDescription.glyphs.push_back( { TEST_RESOURCE_DIR "/fonts/bitmap/u0039.png", "8", 34.f, 0.f } );
1629   fontDescription.glyphs.push_back( { TEST_RESOURCE_DIR "/fonts/bitmap/u003a.png", "9", 34.f, 0.f } );
1630
1631   TextAbstraction::BitmapFont bitmapFont;
1632   DevelText::CreateBitmapFont( fontDescription, bitmapFont );
1633
1634   TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
1635   fontClient.GetFontId( bitmapFont );
1636
1637   TextLabel label = TextLabel::New();
1638
1639   label.SetProperty( TextLabel::Property::TEXT, "0123456789:" );
1640   label.SetProperty( TextLabel::Property::FONT_FAMILY, "Digits" );
1641
1642   // The text has been laid out with the bitmap font if the natural size is the sum of all the width (322) and 34 height.
1643   DALI_TEST_EQUALS( label.GetNaturalSize(), Vector3(322.f, 34.f, 0.f), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
1644
1645   application.GetScene().Add( label );
1646
1647   application.SendNotification();
1648   application.Render();
1649
1650   // The text has been rendered if the height of the text-label is the height of the line.
1651   DALI_TEST_EQUALS( label.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).height, 34.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
1652
1653   END_TEST;
1654 }
1655
1656 int ConvertPointToPixel( float point )
1657 {
1658   unsigned int horizontalDpi = 0u;
1659   unsigned int verticalDpi = 0u;
1660   TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
1661   fontClient.GetDpi( horizontalDpi, verticalDpi );
1662
1663   return ( point * 72.f ) / static_cast< float >( horizontalDpi );
1664 }
1665
1666 int UtcDaliToolkitTextlabelTextFit(void)
1667 {
1668   ToolkitTestApplication application;
1669   tet_infoline(" UtcDaliToolkitTextlabelTextFit");
1670   TextLabel label = TextLabel::New();
1671   Vector2 size( 460.0f, 100.0f );
1672   label.SetProperty( Actor::Property::SIZE, size );
1673   label.SetProperty( TextLabel::Property::TEXT, "Hello world" );
1674
1675    // connect to the text git changed signal.
1676   ConnectionTracker* testTracker = new ConnectionTracker();
1677   DevelTextLabel::TextFitChangedSignal(label).Connect(&TestTextFitChangedCallback);
1678   bool textFitChangedSignal = false;
1679   label.ConnectSignal(testTracker, "textFitChanged", CallbackFunctor(&textFitChangedSignal));
1680   gTextFitChangedCallBackCalled = false;
1681
1682   // check point size
1683   Property::Map textFitMapSet;
1684   textFitMapSet["enable"] = true;
1685   textFitMapSet["minSize"] = 10.f;
1686   textFitMapSet["maxSize"] = 100.f;
1687   textFitMapSet["stepSize"] = -1.f;
1688   textFitMapSet["fontSizeType"] = "pointSize";
1689
1690   label.SetProperty( Toolkit::DevelTextLabel::Property::TEXT_FIT, textFitMapSet );
1691   label.SetProperty( TextLabel::Property::POINT_SIZE, 120.f);
1692
1693   application.GetScene().Add( label );
1694
1695   application.SendNotification();
1696   application.Render();
1697
1698   const Vector3 EXPECTED_NATURAL_SIZE( 450.0f, 96.0f, 0.0f );
1699   DALI_TEST_EQUALS( EXPECTED_NATURAL_SIZE, label.GetNaturalSize(), TEST_LOCATION );
1700
1701   DALI_TEST_CHECK(gTextFitChangedCallBackCalled);
1702   DALI_TEST_CHECK(textFitChangedSignal);
1703
1704   // check pixel size
1705   textFitMapSet.Clear();
1706   textFitMapSet["enable"] = true;
1707   textFitMapSet["minSize"] = ConvertPointToPixel( 10.f );
1708   textFitMapSet["maxSize"] = ConvertPointToPixel( 100.f );
1709   textFitMapSet["stepSize"] = ConvertPointToPixel ( 1.f );
1710   textFitMapSet["fontSizeType"] = "pixelSize";
1711
1712   label.SetProperty( Toolkit::DevelTextLabel::Property::TEXT_FIT, textFitMapSet );
1713
1714   application.SendNotification();
1715   application.Render();
1716
1717   DALI_TEST_EQUALS( EXPECTED_NATURAL_SIZE, label.GetNaturalSize(), TEST_LOCATION );
1718
1719   END_TEST;
1720 }
1721
1722 int UtcDaliToolkitTextlabelMaxTextureSet(void)
1723 {
1724   ToolkitTestApplication application;
1725   tet_infoline(" UtcDaliToolkitTextlabelMaxTextureSet");
1726
1727   DevelText::BitmapFontDescription fontDescription;
1728   fontDescription.name = "Digits";
1729   fontDescription.glyphs.push_back( { TEST_RESOURCE_DIR "/fonts/bitmap/u0030.png", ":", 200.f, 0.f } );
1730
1731   TextAbstraction::BitmapFont bitmapFont;
1732   DevelText::CreateBitmapFont( fontDescription, bitmapFont );
1733
1734   TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
1735   fontClient.GetFontId( bitmapFont );
1736
1737   TextLabel label = TextLabel::New();
1738   label.SetProperty( TextLabel::Property::FONT_FAMILY, "Digits" );
1739   label.SetProperty( TextLabel::Property::ENABLE_MARKUP, true );
1740   label.SetProperty( TextLabel::Property::TEXT, ":This is a long sample text made to allow max texture size to be exceeded." );
1741   label.SetProperty( TextLabel::Property::POINT_SIZE, 200.f );
1742   label.SetProperty( TextLabel::Property::MULTI_LINE, true );
1743
1744   Property::Map underlineMapSet;
1745   underlineMapSet.Clear();
1746   underlineMapSet.Insert( "enable", true );
1747   underlineMapSet.Insert( "color", Color::RED );
1748   underlineMapSet.Insert( "height", 1 );
1749   label.SetProperty( TextLabel::Property::UNDERLINE, underlineMapSet );
1750   label.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::BLUE );
1751
1752   application.GetScene().Add( label );
1753
1754   application.SendNotification();
1755   application.Render();
1756
1757   const int maxTextureSize = Dali::GetMaxTextureSize();
1758   // Whether the rendered text is greater than maxTextureSize
1759   DALI_TEST_CHECK( label.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).height > maxTextureSize );
1760
1761   // Check if the number of renderers is greater than 1.
1762   DALI_TEST_CHECK( label.GetRendererCount() > 1u );
1763
1764   END_TEST;
1765 }
1766
1767 int UtcDaliToolkitTextlabelLastCharacterIndex(void)
1768 {
1769   ToolkitTestApplication application;
1770   tet_infoline(" UtcDaliToolkitTextlabelLastCharacterIndex");
1771
1772   Vector2 size( 300.0f, 100.0f );
1773
1774   Dali::Toolkit::DevelText::RendererParameters textParameters;
1775   textParameters.text = "This is a sample text to get the last index.";
1776   textParameters.layout = "multiLine";
1777   textParameters.fontSize = 20.f;
1778   textParameters.textWidth = 300u;
1779   textParameters.textHeight = 100u;
1780   textParameters.ellipsisEnabled = true;
1781   Dali::Property::Array indexArray = Dali::Toolkit::DevelText::GetLastCharacterIndex( textParameters );
1782
1783   DALI_TEST_CHECK( !indexArray.Empty() );
1784   DALI_TEST_EQUALS( indexArray.GetElementAt(0).Get<int>(), 10, TEST_LOCATION );
1785
1786   END_TEST;
1787 }
1788
1789 int UtcDaliToolkitTextlabelFontSizeScale(void)
1790 {
1791   ToolkitTestApplication application;
1792   tet_infoline(" UtcDaliToolkitTextlabelFontSizeScale");
1793
1794   TextLabel label = TextLabel::New();
1795   label.SetProperty( TextLabel::Property::POINT_SIZE, 30.f );
1796   label.SetProperty( TextLabel::Property::TEXT, "Test" );
1797   Vector3 nonScaledSize = label.GetNaturalSize();
1798
1799   TextLabel labelScaled = TextLabel::New();
1800   labelScaled.SetProperty( TextLabel::Property::POINT_SIZE, 15.f );
1801   labelScaled.SetProperty( Toolkit::DevelTextLabel::Property::FONT_SIZE_SCALE, 2.f );
1802   labelScaled.SetProperty( TextLabel::Property::TEXT, "Test" );
1803   Vector3 scaledSize = labelScaled.GetNaturalSize();
1804
1805   DALI_TEST_EQUALS( nonScaledSize, scaledSize, TEST_LOCATION );
1806
1807   label.SetProperty( TextLabel::Property::PIXEL_SIZE, 30.f );
1808   label.SetProperty( TextLabel::Property::TEXT, "Test" );
1809   nonScaledSize = label.GetNaturalSize();
1810
1811   labelScaled.SetProperty( TextLabel::Property::PIXEL_SIZE, 15.f );
1812   labelScaled.SetProperty( Toolkit::DevelTextLabel::Property::FONT_SIZE_SCALE, 2.f );
1813   labelScaled.SetProperty( TextLabel::Property::TEXT, "Test" );
1814   scaledSize = labelScaled.GetNaturalSize();
1815
1816   DALI_TEST_EQUALS( nonScaledSize, scaledSize, TEST_LOCATION );
1817
1818   END_TEST;
1819 }
1820
1821 // Positive test for the anchorClicked signal.
1822 int UtcDaliToolkitTextlabelAnchorClicked(void)
1823 {
1824   ToolkitTestApplication application;
1825   tet_infoline(" UtcDaliToolkitTextlabelAnchorClicked");
1826   TextLabel label = TextLabel::New();
1827   DALI_TEST_CHECK(label);
1828
1829   application.GetScene().Add(label);
1830
1831   // connect to the anchor clicked signal.
1832   ConnectionTracker* testTracker = new ConnectionTracker();
1833   DevelTextLabel::AnchorClickedSignal(label).Connect(&TestAnchorClickedCallback);
1834   bool anchorClickedSignal = false;
1835   label.ConnectSignal(testTracker, "anchorClicked", CallbackFunctor(&anchorClickedSignal));
1836
1837   gAnchorClickedCallBackCalled = false;
1838   label.SetProperty(TextLabel::Property::TEXT, "<a href='https://www.tizen.org'>TIZEN</a>");
1839   label.SetProperty(TextLabel::Property::ENABLE_MARKUP, true);
1840   label.SetProperty(Actor::Property::SIZE, Vector2(100.f, 50.f));
1841   label.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
1842   label.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
1843
1844   application.SendNotification();
1845   application.Render();
1846
1847   // Create a tap event to touch the text label.
1848   TestGenerateTap(application, 5.0f, 25.0f, 100);
1849   application.SendNotification();
1850   application.Render();
1851
1852   DALI_TEST_CHECK(gAnchorClickedCallBackCalled);
1853   DALI_TEST_CHECK(anchorClickedSignal);
1854
1855   // reset
1856   gAnchorClickedCallBackCalled = false;
1857   anchorClickedSignal = false;
1858   label.SetProperty(TextLabel::Property::TEXT, "");
1859   label.SetProperty(TextLabel::Property::ENABLE_MARKUP, false);
1860
1861   application.SendNotification();
1862   application.Render();
1863
1864   // sets anchor text
1865   label.SetProperty(TextLabel::Property::ENABLE_MARKUP, true);
1866   label.SetProperty(TextLabel::Property::TEXT, "<a href='https://www.tizen.org'>TIZEN</a>");
1867   label.SetProperty(Actor::Property::SIZE, Vector2(100.f, 50.f));
1868   label.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
1869   label.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
1870
1871   application.SendNotification();
1872   application.Render();
1873
1874   // Create a tap event to touch the text label.
1875   TestGenerateTap(application, 5.0f, 25.0f, 200);
1876   application.SendNotification();
1877   application.Render();
1878
1879   DALI_TEST_CHECK(gAnchorClickedCallBackCalled);
1880   DALI_TEST_CHECK(anchorClickedSignal);
1881
1882
1883   gAnchorClickedCallBackNotCalled = true;
1884   // Tap the outside of anchor, callback should not be called.
1885   TestGenerateTap(application, 150.f, 100.f, 300);
1886   application.SendNotification();
1887   application.Render();
1888
1889   DALI_TEST_CHECK(gAnchorClickedCallBackNotCalled);
1890
1891   END_TEST;
1892 }
1893
1894 int UtcDaliTextLabelAtlasLimitationIsEnabledForLargeFontPointSize(void)
1895 {
1896   ToolkitTestApplication application;
1897   tet_infoline(" UtcDaliTextLabelAtlasLimitationIsEnabledForLargeFontPointSize ");
1898
1899   //TextLabel is not using Atlas but this is to unify font-size on text-controllers
1900
1901   // +2: First one to handle the equal case. Second one to handle odd to even case of GetNaturalSize
1902   const uint32_t lessThanWidth = TextAbstraction::FontClient::MAX_TEXT_ATLAS_WIDTH - TextAbstraction::FontClient::PADDING_TEXT_ATLAS_BLOCK + 2;
1903   const uint32_t lessThanHeight = TextAbstraction::FontClient::MAX_TEXT_ATLAS_HEIGHT - TextAbstraction::FontClient::PADDING_TEXT_ATLAS_BLOCK + 2;
1904
1905   // Create a text editor
1906   TextLabel textLabel = TextLabel::New();
1907   //Set size to avoid automatic eliding
1908   textLabel.SetProperty( Actor::Property::SIZE, Vector2(1025, 1025));
1909   //Set very large font-size using point-size
1910   textLabel.SetProperty( TextLabel::Property::POINT_SIZE, 1000);
1911   //Specify font-family
1912   textLabel.SetProperty( TextLabel::Property::FONT_FAMILY, "DejaVu Sans");
1913   //Set text to check if appear or not
1914   textLabel.SetProperty( TextLabel::Property::TEXT, "A");
1915
1916   application.GetScene().Add( textLabel );
1917
1918   application.SendNotification();
1919   application.Render();
1920   //Use GetNaturalSize to verify that size of block does not exceed Atlas size
1921   Vector3 naturalSize = textLabel.GetNaturalSize();
1922
1923   DALI_TEST_GREATER( lessThanWidth, static_cast<uint32_t>(naturalSize.width), TEST_LOCATION );
1924   DALI_TEST_GREATER( lessThanHeight, static_cast<uint32_t>(naturalSize.height), TEST_LOCATION );
1925
1926   END_TEST;
1927 }
1928
1929 int UtcDaliTextLabelHyphenWrapMode(void)
1930 {
1931   ToolkitTestApplication application;
1932   tet_infoline(" UtcDaliTextLabelHyphenWrapMode ");
1933
1934   int lineCount =0;
1935   TextLabel label = TextLabel::New();
1936   label.SetProperty( Actor::Property::SIZE, Vector2( 150.0f, 300.f ));
1937   label.SetProperty( TextLabel::Property::POINT_SIZE, 12.f );
1938   label.SetProperty( TextLabel::Property::MULTI_LINE, true);
1939   application.GetScene().Add( label );
1940   application.SendNotification();
1941   application.Render();
1942
1943   label.SetProperty( TextLabel::Property::TEXT, "Hi Experimen" );
1944   label.SetProperty(TextLabel::Property::LINE_WRAP_MODE,DevelText::LineWrap::HYPHENATION);
1945   DALI_TEST_EQUALS( label.GetProperty< int >( TextLabel::Property::LINE_WRAP_MODE ), static_cast< int >( DevelText::LineWrap::HYPHENATION ), TEST_LOCATION );
1946
1947   application.SendNotification();
1948   application.Render();
1949
1950   lineCount = label.GetProperty<int>( TextLabel::Property::LINE_COUNT );
1951   /*
1952     text will be :
1953     Hi Exp-
1954     erimen
1955   */
1956   DALI_TEST_EQUALS( lineCount, 2, TEST_LOCATION );
1957
1958   label.SetProperty( TextLabel::Property::TEXT, "Hi Experimen" );
1959   label.SetProperty(TextLabel::Property::LINE_WRAP_MODE,DevelText::LineWrap::MIXED);
1960   DALI_TEST_EQUALS( label.GetProperty< int >( TextLabel::Property::LINE_WRAP_MODE ), static_cast< int >( DevelText::LineWrap::MIXED ), TEST_LOCATION );
1961
1962   application.SendNotification();
1963   application.Render();
1964
1965   lineCount = label.GetProperty<int>( TextLabel::Property::LINE_COUNT );
1966   /*
1967     text will be :
1968     Hi
1969     Experi-
1970     men
1971   */
1972   DALI_TEST_EQUALS( lineCount, 3, TEST_LOCATION );
1973
1974   END_TEST;
1975 }
1976
1977
1978 int utcDaliTextLabelGetHeightForWidthChangeLineCountWhenTextChanged(void)
1979 {
1980   ToolkitTestApplication application;
1981
1982   tet_infoline(" utcDaliTextLabelGetHeightForWidthChangeLineCountWhenTextChanged ");
1983
1984   int lineCountBefore =0 ;
1985   int lineCountAfter =0 ;
1986
1987   // Create a text editor
1988   TextLabel textLabel = TextLabel::New();
1989   //Set very large font-size using point-size
1990   textLabel.SetProperty( TextLabel::Property::POINT_SIZE, 10) ;
1991   //Specify font-family
1992   textLabel.SetProperty( TextLabel::Property::FONT_FAMILY, "DejaVu Sans");
1993   //Specify size
1994   textLabel.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 100.f ) );
1995   //Set text longer than width of textLabel
1996   textLabel.SetProperty( TextLabel::Property::TEXT, "Short text");
1997   //Set line wrap mode Character
1998   textLabel.SetProperty(TextLabel::Property::LINE_WRAP_MODE, "CHARACTER");
1999   textLabel.SetProperty(TextLabel::Property::MULTI_LINE, true);
2000
2001   application.GetScene().Add( textLabel );
2002
2003   application.SendNotification();
2004   application.Render();
2005
2006
2007   lineCountBefore =  textLabel.GetProperty<int>( TextLabel::Property::LINE_COUNT );
2008
2009   textLabel.SetProperty( TextLabel::Property::TEXT, "This is very loooooooooooooooooooooooooooooooooooong text for test");
2010   lineCountAfter =  textLabel.GetProperty<int>( TextLabel::Property::LINE_COUNT );
2011
2012   // When the text changed, the Line-count should be updated according to new text.
2013   // Because the GetHeightForWidth is called in Controller::GetLineCount(float width)
2014   DALI_TEST_EQUALS( lineCountBefore ,1, TEST_LOCATION );
2015   DALI_TEST_GREATER( lineCountAfter,1, TEST_LOCATION );
2016
2017
2018   END_TEST;
2019 }
2020
2021 int utcDaliTextLabelGeometryRTL(void)
2022 {
2023   ToolkitTestApplication application;
2024   tet_infoline(" utcDaliTextLabelGeometryRTL");
2025
2026   TextLabel label = TextLabel::New();
2027   DALI_TEST_CHECK( label );
2028
2029   application.GetScene().Add( label );
2030
2031   label.SetProperty( TextLabel::Property::POINT_SIZE, 7.f );
2032   label.SetProperty( Actor::Property::SIZE, Vector2( 150.f, 100.f ) );
2033   label.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
2034   label.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
2035   label.SetProperty( TextLabel::Property::ENABLE_MARKUP, true );
2036   label.SetProperty( TextLabel::Property::MULTI_LINE, true);
2037   label.SetProperty( TextLabel::Property::TEXT, "line1 \nline2\nline 3\nالاخيرالسطر" );
2038
2039   // Avoid a crash when core load gl resources.
2040   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
2041
2042   // Render and notify
2043   application.SendNotification();
2044   application.Render();
2045
2046   unsigned int expectedCount = 4;
2047   unsigned int startIndex = 3;
2048   unsigned int endIndex = 24;
2049
2050   Vector<Vector2> positionsList = DevelTextLabel::GetTextPosition(label, startIndex, endIndex);
2051   Vector<Vector2> sizeList = DevelTextLabel::GetTextSize(label, startIndex, endIndex);
2052
2053   DALI_TEST_EQUALS(positionsList.Size(), expectedCount, TEST_LOCATION);
2054   DALI_TEST_EQUALS(sizeList.Size(), expectedCount, TEST_LOCATION);
2055
2056   Vector<Vector2> expectedSizes;
2057   Vector<Vector2> expectedPositions;
2058
2059   expectedPositions.PushBack(Vector2(24, 0));
2060   expectedSizes.PushBack(Vector2(33, 25));
2061
2062   expectedPositions.PushBack(Vector2(-1, 25));
2063   expectedSizes.PushBack(Vector2(52, 25));
2064
2065   expectedPositions.PushBack(Vector2(-1, 50));
2066   expectedSizes.PushBack(Vector2(59, 25));
2067
2068   expectedPositions.PushBack(Vector2(73, 75));
2069   expectedSizes.PushBack(Vector2(37, 25));
2070
2071   TestTextGeometryUtils::CheckGeometryResult(positionsList, sizeList, expectedPositions, expectedSizes);
2072
2073   END_TEST;
2074 }
2075
2076 int utcDaliTextLabelGeometryGlyphMiddle(void)
2077 {
2078   ToolkitTestApplication application;
2079   tet_infoline(" utcDaliTextLabelGeometryGlyphMiddle");
2080
2081   TextLabel label = TextLabel::New();
2082   DALI_TEST_CHECK( label );
2083
2084   application.GetScene().Add( label );
2085
2086   label.SetProperty( TextLabel::Property::POINT_SIZE, 7.f );
2087   label.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
2088   label.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
2089   label.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
2090   label.SetProperty( TextLabel::Property::ENABLE_MARKUP, true );
2091   label.SetProperty( TextLabel::Property::TEXT, "لا تحتوي على لا" );
2092
2093   // Avoid a crash when core load gl resources.
2094   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
2095
2096   // Render and notify
2097   application.SendNotification();
2098   application.Render();
2099
2100   unsigned int expectedCount = 1;
2101   unsigned int startIndex = 1;
2102   unsigned int endIndex = 13;
2103
2104   Vector<Vector2> positionsList = DevelTextLabel::GetTextPosition(label, startIndex, endIndex);
2105   Vector<Vector2> sizeList = DevelTextLabel::GetTextSize(label, startIndex, endIndex);
2106
2107   DALI_TEST_EQUALS(positionsList.Size(), expectedCount, TEST_LOCATION);
2108   DALI_TEST_EQUALS(sizeList.Size(), expectedCount, TEST_LOCATION);
2109
2110   Vector<Vector2> expectedSizes;
2111   Vector<Vector2> expectedPositions;
2112
2113   expectedPositions.PushBack(Vector2(12, 0));
2114   expectedSizes.PushBack(Vector2(118, 25));
2115
2116   TestTextGeometryUtils::CheckGeometryResult(positionsList, sizeList, expectedPositions, expectedSizes);
2117
2118   END_TEST;
2119 }
2120
2121 int UtcDaliToolkitTextlabelEllipsisPositionProperty(void)
2122 {
2123   ToolkitTestApplication application;
2124   tet_infoline(" UtcDaliToolkitTextlabelEllipsisPositionProperty ");
2125   TextLabel textLabel = TextLabel::New();
2126
2127   tet_infoline(" UtcDaliToolkitTextlabelEllipsisPositionProperty - Default is END");
2128   DALI_TEST_EQUALS( textLabel.GetProperty< int >( DevelTextLabel::Property::ELLIPSIS_POSITION ), static_cast< int >( Toolkit::DevelText::EllipsisPosition::END ), TEST_LOCATION );
2129
2130   tet_infoline(" UtcDaliToolkitTextlabelEllipsisPositionProperty - Change to START");
2131   textLabel.SetProperty(DevelTextLabel::Property::ELLIPSIS_POSITION, DevelText::EllipsisPosition::START);
2132   DALI_TEST_EQUALS( textLabel.GetProperty< int >( DevelTextLabel::Property::ELLIPSIS_POSITION ), static_cast< int >( Toolkit::DevelText::EllipsisPosition::START ), TEST_LOCATION );
2133
2134   tet_infoline(" UtcDaliToolkitTextlabelEllipsisPositionProperty - Change to MIDDLE");
2135   textLabel.SetProperty(DevelTextLabel::Property::ELLIPSIS_POSITION, DevelText::EllipsisPosition::MIDDLE);
2136   DALI_TEST_EQUALS( textLabel.GetProperty< int >( DevelTextLabel::Property::ELLIPSIS_POSITION ), static_cast< int >( Toolkit::DevelText::EllipsisPosition::MIDDLE ), TEST_LOCATION );
2137
2138   tet_infoline(" UtcDaliToolkitTextlabelEllipsisPositionProperty - Change to END");
2139   textLabel.SetProperty(DevelTextLabel::Property::ELLIPSIS_POSITION, DevelText::EllipsisPosition::END);
2140   DALI_TEST_EQUALS( textLabel.GetProperty< int >( DevelTextLabel::Property::ELLIPSIS_POSITION ), static_cast< int >( Toolkit::DevelText::EllipsisPosition::END ), TEST_LOCATION );
2141
2142   tet_infoline(" UtcDaliToolkitTextlabelEllipsisPositionProperty - Change to START using integer");
2143   textLabel.SetProperty(DevelTextLabel::Property::ELLIPSIS_POSITION, 1);
2144   DALI_TEST_EQUALS( textLabel.GetProperty< int >( DevelTextLabel::Property::ELLIPSIS_POSITION ), static_cast< int >( Toolkit::DevelText::EllipsisPosition::START ), TEST_LOCATION );
2145
2146   tet_infoline(" UtcDaliToolkitTextlabelEllipsisPositionProperty - Change to MIDDLE using integer");
2147   textLabel.SetProperty(DevelTextLabel::Property::ELLIPSIS_POSITION, 2);
2148   DALI_TEST_EQUALS( textLabel.GetProperty< int >( DevelTextLabel::Property::ELLIPSIS_POSITION ), static_cast< int >( Toolkit::DevelText::EllipsisPosition::MIDDLE ), TEST_LOCATION );
2149
2150   tet_infoline(" UtcDaliToolkitTextlabelEllipsisPositionProperty - Change to END using integer");
2151   textLabel.SetProperty(DevelTextLabel::Property::ELLIPSIS_POSITION, 0);
2152   DALI_TEST_EQUALS( textLabel.GetProperty< int >( DevelTextLabel::Property::ELLIPSIS_POSITION ), static_cast< int >( Toolkit::DevelText::EllipsisPosition::END ), TEST_LOCATION );
2153
2154   tet_infoline(" UtcDaliToolkitTextlabelEllipsisPositionProperty - Change to START using string - uppercase");
2155   textLabel.SetProperty(DevelTextLabel::Property::ELLIPSIS_POSITION, "START");
2156   DALI_TEST_EQUALS( textLabel.GetProperty< int >( DevelTextLabel::Property::ELLIPSIS_POSITION ), static_cast< int >( Toolkit::DevelText::EllipsisPosition::START ), TEST_LOCATION );
2157
2158   tet_infoline(" UtcDaliToolkitTextlabelEllipsisPositionProperty - Change to MIDDLE using string - uppercase");
2159   textLabel.SetProperty(DevelTextLabel::Property::ELLIPSIS_POSITION, "MIDDLE");
2160   DALI_TEST_EQUALS( textLabel.GetProperty< int >( DevelTextLabel::Property::ELLIPSIS_POSITION ), static_cast< int >( Toolkit::DevelText::EllipsisPosition::MIDDLE ), TEST_LOCATION );
2161
2162   tet_infoline(" UtcDaliToolkitTextlabelEllipsisPositionProperty - Change to END using string - uppercase");
2163   textLabel.SetProperty(DevelTextLabel::Property::ELLIPSIS_POSITION, "END");
2164   DALI_TEST_EQUALS( textLabel.GetProperty< int >( DevelTextLabel::Property::ELLIPSIS_POSITION ), static_cast< int >( Toolkit::DevelText::EllipsisPosition::END ), TEST_LOCATION );
2165
2166   tet_infoline(" UtcDaliToolkitTextlabelEllipsisPositionProperty - Change to START using string - lowercase");
2167   textLabel.SetProperty(DevelTextLabel::Property::ELLIPSIS_POSITION, "start");
2168   DALI_TEST_EQUALS( textLabel.GetProperty< int >( DevelTextLabel::Property::ELLIPSIS_POSITION ), static_cast< int >( Toolkit::DevelText::EllipsisPosition::START ), TEST_LOCATION );
2169
2170   tet_infoline(" UtcDaliToolkitTextlabelEllipsisPositionProperty - Change to MIDDLE using string - lowercase");
2171   textLabel.SetProperty(DevelTextLabel::Property::ELLIPSIS_POSITION, "middle");
2172   DALI_TEST_EQUALS( textLabel.GetProperty< int >( DevelTextLabel::Property::ELLIPSIS_POSITION ), static_cast< int >( Toolkit::DevelText::EllipsisPosition::MIDDLE ), TEST_LOCATION );
2173
2174   tet_infoline(" UtcDaliToolkitTextlabelEllipsisPositionProperty - Change to END using string - lowercase");
2175   textLabel.SetProperty(DevelTextLabel::Property::ELLIPSIS_POSITION, "end");
2176   DALI_TEST_EQUALS( textLabel.GetProperty< int >( DevelTextLabel::Property::ELLIPSIS_POSITION ), static_cast< int >( Toolkit::DevelText::EllipsisPosition::END ), TEST_LOCATION );
2177
2178
2179   END_TEST;
2180 }