Merge "Reduce the number of conversion between std::string <-> VisaulUrl at interal...
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit-internal / utc-Dali-Text-Ellipsis.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 <toolkit-text-utils.h>
25 #include <dali-toolkit/internal/text/font-description-run.h>
26 #include <dali-toolkit/internal/text/rendering/text-typesetter.h>
27 #include <dali-toolkit/internal/text/rendering/view-model.h>
28 #include <dali-toolkit/internal/text/text-controller.h>
29 #include <dali-toolkit/internal/text/text-view.h>
30
31
32 using namespace Dali;
33 using namespace Toolkit;
34 using namespace Text;
35
36
37 namespace
38 {
39
40   const std::string DEFAULT_FONT_DIR( "/resources/fonts" );
41
42   struct ElideData
43   {
44     std::string                                                description;
45     std::string                                                text;
46     bool                                                       isMultiLines;
47     DevelText::LineWrap::Mode                                  lineWrapMode;
48     DevelText::EllipsisPosition::Type                          ellipsisPosition;
49     bool                                                       isMarkup;
50     Vector2                                                    size;
51     unsigned int                                               numberOfLines;
52     unsigned int                                               numberOfGlyphs;
53     float*                                                     positions;
54   };
55
56
57   bool ElideTestViewModel( const ElideData& data )
58   {
59     std::cout << "  testing : " << data.description << std::endl;
60
61     // Load some fonts.
62     TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
63     fontClient.SetDpi( 93u, 93u );
64
65     char* pathNamePtr = get_current_dir_name();
66     const std::string pathName( pathNamePtr );
67     free( pathNamePtr );
68
69     fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansRegular.ttf" );
70     fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansHebrewRegular.ttf" );
71     fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansArabicRegular.ttf" );
72
73     // Creates a text controller.
74     ControllerPtr controller = Controller::New();
75
76     // Tests the rendering controller has been created.
77     TypesetterPtr typesetter = Typesetter::New( controller->GetTextModel() );
78     DALI_TEST_CHECK(typesetter);
79
80     // Tests the view model has been created.
81     ViewModel* model = typesetter->GetViewModel();
82     DALI_TEST_CHECK(model);
83
84     // Configures the text controller similarly to the text-label.
85     ConfigureTextLabel( controller );
86
87     // Sets a text and relais-out.
88     controller->SetMarkupProcessorEnabled( data.isMarkup );
89
90     controller->SetMultiLineEnabled( data.isMultiLines );
91     controller->SetLineWrapMode( (Text::LineWrap::Mode)(data.lineWrapMode) );
92     controller->SetEllipsisPosition( data.ellipsisPosition );
93
94     controller->SetText( data.text );
95     controller->Relayout( data.size );
96
97     // Elide the glyphs.
98     model->ElideGlyphs();
99
100     if( data.numberOfLines != model->GetNumberOfLines() )
101     {
102       std::cout << "  different number of lines : " << model->GetNumberOfLines() << ", expected : " << data.numberOfLines << std::endl;
103       return false;
104     }
105
106     Length numberOfGlyphs = model->GetNumberOfGlyphs();
107
108     if( data.numberOfGlyphs != numberOfGlyphs )
109     {
110       std::cout << "  different number of glyphs : " << numberOfGlyphs << ", expected : " << data.numberOfGlyphs << std::endl;
111       return false;
112     }
113
114     const Vector2* const layoutBuffer              = model->GetLayout();
115     const Length         numberOfLines             = model->GetNumberOfLines();
116     const GlyphIndex     startIndexOfGlyphs        = model->GetStartIndexOfElidedGlyphs();
117     const GlyphIndex     endIndexOfGlyphs          = model->GetEndIndexOfElidedGlyphs();
118     const GlyphIndex     firstMiddleIndexOfGlyphs  = model->GetFirstMiddleIndexOfElidedGlyphs();
119
120
121     if( numberOfLines != 0u )
122     {
123       Length   elidedLineIndex    = 0u;
124       for(Length lineIndex=0u; lineIndex < numberOfLines; lineIndex++)
125       {
126           const LineRun& tempLine         = *( model->GetLines() + elidedLineIndex);
127           if(tempLine.ellipsis)
128           {
129             elidedLineIndex = lineIndex;
130             break;
131           }
132       }
133       const LineRun& elidedLine                   = *( model->GetLines() + elidedLineIndex);
134       Length         numberOfLineGlyphs           = 0u;
135       Length         numberOfLineGlyphsSecondHalf = 0u;
136
137       switch(data.ellipsisPosition)
138       {
139         case DevelText::EllipsisPosition::START:
140         {
141           numberOfLineGlyphs = elidedLine.glyphRun.numberOfGlyphs - ( startIndexOfGlyphs - elidedLine.glyphRun.glyphIndex);
142           break;
143         }
144         case DevelText::EllipsisPosition::MIDDLE:
145         {
146           numberOfLineGlyphs = firstMiddleIndexOfGlyphs - elidedLine.glyphRun.glyphIndex +1u ;
147           break;
148         }
149         case DevelText::EllipsisPosition::END:
150         default:
151         {
152           numberOfLineGlyphs = endIndexOfGlyphs - elidedLine.glyphRun.glyphIndex + 1u;
153           break;
154         }
155       }
156
157       unsigned int index = 0u;
158       for( ; index < numberOfLineGlyphs; ++index )
159       {
160         if( *( data.positions + index ) != floor(elidedLine.alignmentOffset + ( *( layoutBuffer + index ) ).x ) )
161         {
162           std::cout << "  different layout :";
163           for( unsigned int i = 0; i < numberOfLineGlyphs; ++i )
164           {
165             std::cout << " " << floor( elidedLine.alignmentOffset + ( *( layoutBuffer + i ) ).x );
166           }
167           std::cout << std::endl;
168           std::cout << "          expected :";
169           for( unsigned int i = 0; i < numberOfLineGlyphs; ++i )
170           {
171             std::cout << " " << *( data.positions + i );
172           }
173           std::cout << std::endl;
174           return false;
175         }
176       }
177
178
179       for( ; index < numberOfLineGlyphsSecondHalf; ++index )
180       {
181         if( *( data.positions + index ) != floor(elidedLine.alignmentOffset + ( *( layoutBuffer + index ) ).x ) )
182         {
183           std::cout << "  different layout :";
184           for( unsigned int i = 0; i < numberOfLineGlyphsSecondHalf; ++i )
185           {
186             std::cout << " " << floor( elidedLine.alignmentOffset + ( *( layoutBuffer + i ) ).x );
187           }
188           std::cout << std::endl;
189           std::cout << "          expected :";
190           for( unsigned int i = 0; i < numberOfLineGlyphsSecondHalf; ++i )
191           {
192             std::cout << " " << *( data.positions + i );
193           }
194           std::cout << std::endl;
195           return false;
196         }
197       }
198
199     }
200
201     return true;
202   }
203
204   bool ElideTestTextView( const ElideData& data )
205   {
206     std::cout << "  testing : " << data.description << std::endl;
207
208     // Load some fonts.
209     TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
210     fontClient.SetDpi( 93u, 93u );
211
212     char* pathNamePtr = get_current_dir_name();
213     const std::string pathName( pathNamePtr );
214     free( pathNamePtr );
215
216     fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansRegular.ttf" );
217     fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansHebrewRegular.ttf" );
218     fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansArabicRegular.ttf" );
219
220     // Creates a text controller.
221     ControllerPtr controller = Controller::New();
222
223     if(data.isMultiLines)
224     {
225        // Configures the text controller similarly to the text-editor.
226        ConfigureTextEditor( controller );
227        controller->SetVerticalScrollEnabled( false );
228     }
229     else
230     {
231       // Configures the text controller similarly to the text-field.
232       ConfigureTextField( controller );
233     }
234
235     controller->SetDefaultFontFamily("TizenSansRegular");
236     controller->SetDefaultFontSize(12.0f, Text::Controller::POINT_SIZE);
237
238     controller->SetMultiLineEnabled( data.isMultiLines );
239     controller->SetLineWrapMode( (Text::LineWrap::Mode)(data.lineWrapMode) );
240
241     // Sets a text and relais-out.
242     controller->SetMarkupProcessorEnabled( data.isMarkup );
243
244     controller->SetTextElideEnabled( true );
245     controller->SetEllipsisPosition( data.ellipsisPosition );
246
247     controller->SetText( data.text );
248     controller->Relayout( data.size );
249
250     // Get view to elide the glyphs.
251     Text::ViewInterface& view = controller->GetView();
252
253     Length numberOfGlyphs = view.GetNumberOfGlyphs();
254
255     if(numberOfGlyphs == 0u)
256     {
257       return data.numberOfGlyphs == 0u;
258     }
259
260     Vector<GlyphInfo> glyphs;
261     glyphs.Resize(numberOfGlyphs);
262
263     Vector<Vector2> positions;
264     positions.Resize(numberOfGlyphs);
265
266     float alignmentOffset = 0u;
267     numberOfGlyphs = view.GetGlyphs(glyphs.Begin(),
268                                     positions.Begin(),
269                                     alignmentOffset,
270                                     0u,
271                                     numberOfGlyphs);
272
273     glyphs.Resize(numberOfGlyphs);
274     positions.Resize(numberOfGlyphs);
275
276
277     if( data.numberOfGlyphs != numberOfGlyphs )
278     {
279       std::cout << "  different number of glyphs : " << numberOfGlyphs << ", expected : " << data.numberOfGlyphs << std::endl;
280       return false;
281     }
282
283     // Tests the text model has been created.
284     const ModelInterface* textModel  = controller->GetTextModel();
285     DALI_TEST_CHECK(textModel);
286
287     if( data.numberOfLines != textModel->GetNumberOfLines() )
288     {
289       std::cout << "  different number of lines : " << textModel->GetNumberOfLines() << ", expected : " << data.numberOfLines << std::endl;
290       return false;
291     }
292
293     const Length     numberOfLines             = textModel->GetNumberOfLines();
294     const GlyphIndex startIndexOfGlyphs        = textModel->GetStartIndexOfElidedGlyphs();
295     const GlyphIndex endIndexOfGlyphs          = textModel->GetEndIndexOfElidedGlyphs();
296     const GlyphIndex firstMiddleIndexOfGlyphs  = textModel->GetFirstMiddleIndexOfElidedGlyphs();
297     const GlyphIndex secondMiddleIndexOfGlyphs = textModel->GetSecondMiddleIndexOfElidedGlyphs();
298
299     if( numberOfLines != 0u )
300     {
301       Length   elidedLineIndex    = 0u;
302       for(Length lineIndex=0u; lineIndex < numberOfLines; lineIndex++)
303       {
304           const LineRun& tempLine         = *( textModel->GetLines() + lineIndex);
305           if(tempLine.ellipsis)
306           {
307             elidedLineIndex = lineIndex;
308             break;
309           }
310       }
311       const LineRun& elidedLine         = *( textModel->GetLines() + elidedLineIndex);
312
313       Length         numberOfLineGlyphs           = 0u;
314       Length         numberOfLineGlyphsSecondHalf = 0u;
315
316       switch(data.ellipsisPosition)
317       {
318         case DevelText::EllipsisPosition::START:
319         {
320           numberOfLineGlyphs = elidedLine.glyphRun.numberOfGlyphs - ( startIndexOfGlyphs - elidedLine.glyphRun.glyphIndex);
321           break;
322         }
323         case DevelText::EllipsisPosition::MIDDLE:
324         {
325           numberOfLineGlyphs = firstMiddleIndexOfGlyphs == elidedLine.glyphRun.glyphIndex ? 0u : (firstMiddleIndexOfGlyphs - elidedLine.glyphRun.glyphIndex +1u);
326
327           if(elidedLine.isSplitToTwoHalves)
328           {
329             numberOfLineGlyphsSecondHalf = (elidedLine.glyphRunSecondHalf.glyphIndex + elidedLine.glyphRunSecondHalf.numberOfGlyphs) - secondMiddleIndexOfGlyphs ;
330
331           }
332           break;
333         }
334         case DevelText::EllipsisPosition::END:
335         default:
336         {
337           numberOfLineGlyphs = endIndexOfGlyphs - elidedLine.glyphRun.glyphIndex + 1u;
338           break;
339         }
340       }
341
342
343       unsigned int index = 0u;
344       for(  ; index < numberOfLineGlyphs; ++index )
345       {
346
347         if( *( data.positions + index ) != floor( elidedLine.alignmentOffset + positions[index].x ))
348         {
349           std::cout << "  different layout :";
350           for( unsigned int i = 0; i < numberOfLineGlyphs; ++i )
351           {
352             std::cout << " " << floor( elidedLine.alignmentOffset + positions[i].x );
353           }
354           std::cout << std::endl;
355           std::cout << "          expected :";
356           for( unsigned int i = 0; i < numberOfLineGlyphs; ++i )
357           {
358             std::cout << " " << *( data.positions + i );
359           }
360           std::cout << std::endl;
361           return false;
362         }
363       }
364
365       for( ; index < numberOfLineGlyphsSecondHalf; ++index )
366       {
367         if( *( data.positions + index ) != floor( elidedLine.alignmentOffset + positions[index].x ))
368         {
369           std::cout << "  different layout :";
370           for( unsigned int i = 0; i < numberOfLineGlyphsSecondHalf; ++i )
371           {
372             std::cout << " " << floor( elidedLine.alignmentOffset + positions[i].x );
373           }
374           std::cout << std::endl;
375           std::cout << "          expected :";
376           for( unsigned int i = 0; i < numberOfLineGlyphsSecondHalf; ++i )
377           {
378             std::cout << " " << *( data.positions + i );
379           }
380           std::cout << std::endl;
381           return false;
382         }
383       }
384     }
385
386     return true;
387   }
388
389 }
390
391 int UtcDaliTextLabelElideTextLocation(void)
392 {
393   tet_infoline(" UtcDaliTextLabelElideTextLocation ");
394
395   Size textSize00( 100.f, 100.f );
396
397   Size  textSize01( 120.0f, 50.0f );
398   float positions01[] = { 0.f, 11.f, 23.f, 32.f, 42.f, 52.f, 62.f, 73.f, 83.f, 95.f };
399
400   Size  textSize02( 120.0f, 50.0f );
401   float positions02[] = { 0.f, 11.f, 23.f, 32.f, 42.f, 52.f, 62.f, 73.f, 83.f, 93.f, 103.f, 112.f, 0.f, 10.f, 22.f, 31.f, 41.f, 51.f, 61.f, 72.f, 82.f, 94.f };
402
403   Size  textSize03( 120.0f, 60.0f );
404   float positions03[] = { 0.f, 12.f, 21.f, 26.f, 30.f, 39.f, 45.f, 57.f, 61.f, 0.f, 10.f, 19.f, 29.f, 39.f, 46.f, 50.f, 66.f, 76.f, 85.f, 0.f, 15.f, 25.f, 30.f, 38.f, 48.f, 64.f, 73.f, 79.f, 93.f };
405
406   Size  textSize04( 120.0f, 60.0f );
407   float positions04[] = { 0.f, 12.f, 21.f, 26.f, 30.f, 39.f, 45.f, 57.f, 61.f, 67.f, 77.f, 86.f, 96.f, 106.f, 113.f, 0.f, 15.f, 25.f, 34.f, 39.f, 55.f, 65.f, 69.f, 78.f, 88.f, 104.f, 112.f, 0.f, 12.f, 21.f, 26.f, 30.f, 39.f, 45.f, 57.f, 61.f, 67.f, 77.f, 86.f, 98.f };
408
409   Size  textSize05( 110.0f, 60.0f );
410   float positions05[] = { 0.f, 12.f, 21.f, 26.f, 30.f, 39.f, 45.f, 57.f, 61.f, 67.f, 77.f, 0.f, 10.f, 20.f, 26.f, 31.f, 46.f, 56.f, 65.f, 70.f, 86.f, 96.f, 0.f, 8.f, 18.f, 34.f, 43.f, 49.f, 61.f, 71.f, 75.f, 81.f };
411
412   Size  textSize06( 110.0f, 60.0f );
413   float positions06[] = { 0.f, 12.f, 21.f, 26.f, 30.f, 39.f, 45.f, 57.f, 61.f, 0.f, 10.f, 19.f, 29.f, 39.f, 46.f, 50.f, 66.f, 76.f, 85.f, 0.f, 15.f, 25.f, 30.f, 38.f, 48.f, 64.f, 73.f, 81.f };
414
415   Size  textSize07( 120.0f, 50.0f );
416   float positions07[] = { 6.0f, 23.0f, 32.0f, 42.0f, 53.0f, 63.0f, 73.0f, 83.0f, 93.0f, 104.0f, 113.0f } ;
417
418   Size  textSize08( 120.0f, 50.0f );
419   float positions08[] = { 5.0f, 22.0f, 31.0f, 41.0f, 51.0f, 62.0f, 72.0f, 82.0f, 92.0f, 102.0f, 112.0f };
420
421   Size  textSize09( 120.0f, 60.0f );
422   float positions09[] = { 9.0f, 25.0f, 30.0f, 38.0f, 48.0f, 64.0f, 73.0f, 79.0f, 91.0f, 101.0f, 105.0f, 110.0f, 118.0f };
423
424   Size  textSize10( 120.0f, 60.0f );
425   float positions10[] = { 8.0f, 25.0f, 34.0f, 39.0f, 55.0f, 65.0f, 69.0f, 78.0f, 88.0f, 104.0f, 112.0f };
426
427   Size  textSize11( 100.0f, 60.0f );
428   float positions11[] = { 5.0f, 21.0f, 26.0f, 30.0f, 39.0f, 45.0f, 57.0f, 61.0f, 67.0f, 77.0f };
429
430   Size  textSize12( 100.0f, 60.0f );
431   float positions12[] = { 5.0f, 21.0f, 26.0f, 30.0f, 39.0f, 45.0f, 57.0f, 61.0f };
432
433   Size  textSize13( 120.0f, 60.0f );
434   float positions13[] = { 118.0f, 111.0f, 96.0f, 88.0f, 79.0f, 73.0f, 62.0f, 57.0f, 52.0f, 43.0f, 35.0f, 29.0f, 19.0f, 6.0f };
435
436   Size  textSize14( 120.0f, 60.0f );
437   float positions14[] = { 114.0f, 108.0f, 93.0f, 85.0f, 76.0f, 70.0f, 59.0f, 54.0f, 49.0f, 40.0f, 32.0f, 27.0f, 112.0f, 103.0f, 93.0f, 88.0f, 86.0f, 79.0f, 76.0f, 66.0f, 57.0f, 52.0f, 42.0f, 35.0f, 32.0f, 27.0f, 140.0f, 128.0f, 123.0f, 119.0f, 116.0f, 106.0f, 102.0f, 87.0f, 79.0f, 70.0f, 67.0f, 61.0f, 55.0f, 50.0f, 38.0f };
438
439   Size  textSize15( 110.0f, 60.0f );
440   float positions15[] = { 107.0f, 100.0f, 86.0f, 77.0f, 68.0f, 62.0f, 52.0f, 46.0f, 42.0f, 33.0f, 24.0f, 18.0f, 8.0f, 0.0f, 95.0f, 90.0f, 87.0f, 81.0f, 78.0f, 67.0f, 59.0f, 54.0f, 44.0f, 37.0f, 33.0f, 27.0f, 24.0f, 12.0f, 7.0f, 2.0f, 0.0f, 93.0f, 89.0f, 75.0f, 66.0f, 57.0f, 55.0f, 49.0f, 43.0f, 37.0f, 28.0f, 15.0f };
441
442   Size  textSize16( 110.0f, 60.0f );
443   float positions16[] = { 104.0f, 98.0f, 83.0f, 75.0f, 66.0f, 60.0f, 49.0f, 44.0f, 39.0f, 30.0f, 22.0f, 17.0f, 102.0f, 93.0f, 83.0f, 78.0f, 76.0f, 69.0f, 66.0f, 56.0f, 47.0f, 42.0f, 32.0f, 25.0f, 22.0f, 17.0f, 116.0f, 104.0f, 99.0f, 94.0f, 91.0f, 82.0f, 78.0f, 63.0f, 54.0f, 45.0f, 43.0f, 37.0f, 23.0f };
444
445   Size  textSize17( 110.0f, 60.0f );
446   float positions17[] = { 104.0f, 98.0f, 83.0f, 75.0f, 66.0f, 60.0f, 49.0f, 44.0f, 39.0f, 30.0f, 22.0f, 17.0f, 102.0f, 93.0f, 83.0f, 78.0f, 76.0f, 69.0f, 66.0f, 56.0f, 47.0f, 42.0f, 32.0f, 25.0f, 22.0f, 17.0f, 116.0f, 104.0f, 99.0f, 94.0f, 91.0f, 82.0f, 78.0f, 63.0f, 54.0f, 45.0f, 43.0f, 37.0f, 23.0f };
447
448   Size  textSize18( 120.0f, 60.0f );
449   float positions18[] = { 96.0f, 84.0f, 75.0f, 73.0f, 66.0f, 61.0f, 55.0f, 46.0f, 32.0f, 29.0f, 17.0f, 10.0f, 3.0f };
450
451   Size  textSize19( 120.0f, 60.0f );
452   float positions19[] = { 102.0f, 89.0f, 84.0f, 82.0f, 75.0f, 72.0f, 62.0f, 53.0f, 48.0f, 38.0f, 31.0f, 28.0f, 23.0f, };
453
454   Size  textSize20( 110.0f, 60.0f );
455   float positions20[] = { 89.0f, 81.0f, 78.0f, 67.0f, 59.0f, 54.0f, 44.0f, 37.0f, 33.0f, 27.0f, 24.0f, 12.0f, 7.0f, 2.0f, 0.0f };
456
457   Size  textSize21( 110.0f, 60.0f );
458   float positions21[] = { 92.0f, 79.0f, 74.0f, 72.0f, 65.0f, 62.0f, 52.0f, 43.0f, 38.0f, 28.0f, 21.0f, 18.0f, 13.0f };
459
460   Size  textSize22( 110.0f, 60.0f );
461   float positions22[] = {  92.0f, 79.0f, 74.0f, 72.0f, 65.0f, 62.0f, 52.0f, 43.0f, 38.0f, 28.0f, 21.0f, 18.0f, 13.0f };
462
463   Size  textSize23( 120.0f, 50.0f );
464   float positions23[] = { 0.0f, 11.0f, 22.0f, 33.0f, 46.0f };
465
466   Size  textSize24( 120.0f, 50.0f );
467   float positions24[] = { 0.0f, 11.0f, 23.0f, 32.0f, 42.0f, 52.0f, 62.0f, 73.0f, 83.0f, 95.0f };
468
469   Size  textSize25( 120.0f, 60.0f );
470   float positions25[] = { 0.0f, 12.0f, 21.0f, 26.0f, 30.0f, 39.0f, 45.0f, 57.0f, 61.0f, 0.0f, 10.0f, 19.0f, 29.0f, 39.0f, 46.0f, 50.0f, 68.0f };
471
472   Size  textSize26( 120.0f, 60.0f );
473   float positions26[] = { 0.0f, 12.0f, 21.0f, 26.0f, 30.0f, 39.0f, 45.0f, 57.0f, 61.0f, 67.0f, 77.0f, 86.0f, 96.0f, 106.0f, 113.0f, 0.0f, 15.0f, 25.0f, 34.0f, 39.0f, 55.0f, 65.0f, 69.0f, 78.0f, 90.0f };
474
475   Size  textSize27( 110.0f, 60.0f );
476   float positions27[] = { 0.0f, 12.0f, 21.0f, 26.0f, 30.0f, 39.0f, 45.0f, 57.0f, 61.0f, 67.0f, 77.0f, 0.0f, 10.0f, 20.0f, 26.0f, 31.0f, 46.0f, 56.0f, 65.0f, 72.0f };
477
478   Size  textSize28( 110.0f, 60.0f );
479   float positions28[] = { 0.0f, 12.0f, 21.0f, 26.0f, 30.0f, 39.0f, 45.0f, 57.0f, 61.0f, 0.0f, 10.0f, 19.0f, 29.0f, 39.0f, 46.0f, 50.0f, 68.0f };
480
481   Size  textSize29( 120.0f, 60.0f );
482   float positions29[] = { 116.0f, 109.0f, 94.0f, 86.0f, 77.0f, 71.0f, 60.0f };
483
484   Size  textSize30( 120.0f, 60.0f );
485   float positions30[] = { 114.0f, 108.0f, 93.0f, 85.0f, 76.0f, 70.0f, 59.0f, 54.0f, 49.0f, 40.0f, 32.0f, 27.0f, 112.0f, 103.0f, 93.0f, 88.0f, 86.0f, 79.0f, 76.0f, 66.0f, 57.0f, 52.0f, 33.0f };
486
487   Size  textSize31( 110.0f, 60.0f );
488   float positions31[] = { 107.0f, 100.0f, 86.0f, 77.0f, 68.0f, 62.0f, 52.0f, 46.0f, 42.0f, 33.0f, 24.0f, 18.0f, 8.0f, 0.0f, 95.0f, 90.0f, 87.0f, 81.0f, 78.0f, 67.0f, 59.0f, 54.0f, 44.0f, 37.0f, 33.0f, 27.0f, 24.0f, 9.0f};
489
490   Size  textSize32( 110.0f, 60.0f );
491   float positions32[] = {  104.0f, 98.0f, 83.0f, 75.0f, 66.0f, 60.0f, 49.0f, 44.0f, 39.0f, 30.0f, 22.0f, 17.0f, 102.0f, 93.0f, 83.0f, 78.0f, 76.0f, 69.0f, 66.0f, 56.0f, 47.0f, 42.0f, 23.0f };
492
493   Size  textSize33( 110.0f, 60.0f );
494   float positions33[] = { 104.0f, 98.0f, 83.0f, 75.0f, 66.0f, 60.0f, 49.0f, 44.0f, 39.0f, 30.0f, 22.0f, 17.0f, 102.0f, 93.0f, 83.0f, 78.0f, 76.0f, 69.0f, 66.0f, 56.0f, 47.0f, 42.0f, 23.0f };
495
496   Size  textSize34( 120.0f, 30.0f );
497   float positions34[] = { 0.0f, 12.0f, 21.0f, 26.0f, 30.0f, 39.0f, 45.0f, 57.0f, 61.0f, 67.0f, 77.0f, 86.0f, 98.0f };
498
499   Size  textSize35( 120.0f, 30.0f );
500   float positions35[] = { 2.0f, 20.0f, 29.0f, 39.0f, 44.0f, 60.0f, 69.0f, 74.0f, 83.0f, 92.0f, 108.0f };
501
502   Size  textSize36( 120.0f, 30.0f );
503   float positions36[] = { 0.0f, 12.0f, 21.0f, 26.0f, 30.0f, 39.0f, 45.0f, 57.0f };
504
505   struct ElideData data[] =
506   {
507     {
508       "void text",
509       "",
510       false,
511       DevelText::LineWrap::WORD,
512       DevelText::EllipsisPosition::END,
513       false,
514       textSize00,
515       0u,
516       0u,
517       nullptr
518     },
519
520     {
521       "void text",
522       "",
523       false,
524       DevelText::LineWrap::WORD,
525       DevelText::EllipsisPosition::START,
526       false,
527       textSize00,
528       0u,
529       0u,
530       nullptr
531     },
532
533     {
534       "void text",
535       "",
536       false,
537       DevelText::LineWrap::WORD,
538       DevelText::EllipsisPosition::MIDDLE,
539       false,
540       textSize00,
541       0u,
542       0u,
543       nullptr
544     },
545
546    //END LTR cases
547     {
548       "EllipsisPosition: TextLabel: Basic case SingleLine LTR END",
549       "A0123456789 B0123456789 C0123456789 D0123456789 ",
550       false,
551       DevelText::LineWrap::WORD,
552       DevelText::EllipsisPosition::END,
553       false,
554       textSize01,
555       1u,
556       10u,
557       positions01
558     },
559
560     {
561       "EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR END",
562       "A0123456789 B0123456789 C0123456789 D0123456789 ",
563       true,
564       DevelText::LineWrap::WORD,
565       DevelText::EllipsisPosition::END,
566       false,
567       textSize02,
568       2u,
569       22u,
570       positions02
571     },
572
573     {
574       "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR END",
575       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
576       true,
577       DevelText::LineWrap::WORD,
578       DevelText::EllipsisPosition::END,
579       false,
580       textSize03,
581       3u,
582       29u,
583       positions03
584     },
585
586     {
587       "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR END",
588       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
589       true,
590       DevelText::LineWrap::CHARACTER,
591       DevelText::EllipsisPosition::END,
592       false,
593       textSize04,
594       3u,
595       40u,
596       positions04
597     },
598
599     {
600       "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR END",
601       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
602       true,
603       DevelText::LineWrap::HYPHENATION,
604       DevelText::EllipsisPosition::END,
605       false,
606       textSize05,
607       3u,
608       32u,
609       positions05
610     },
611
612     {
613       "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR END",
614       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
615       true,
616       DevelText::LineWrap::MIXED,
617       DevelText::EllipsisPosition::END,
618       false,
619       textSize06,
620       3u,
621       28u,
622       positions06
623     },
624
625    //START LTR cases
626     {
627       "EllipsisPosition: TextLabel: Basic case SingleLine LTR START",
628       "A0123456789 B0123456789 C0123456789 D0123456789 ",
629       false,
630       DevelText::LineWrap::WORD,
631       DevelText::EllipsisPosition::START,
632       false,
633       textSize07,
634       1u,
635       11u,
636       positions07
637     },
638
639     {
640       "EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR START",
641       "A0123456789 B0123456789 C0123456789 D0123456789 ",
642       true,
643       DevelText::LineWrap::WORD,
644       DevelText::EllipsisPosition::START,
645       false,
646       textSize08,
647       2u,
648       23u,
649       positions08
650     },
651
652     {
653       "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR START",
654       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
655       true,
656       DevelText::LineWrap::WORD,
657       DevelText::EllipsisPosition::START,
658       false,
659       textSize09,
660       3u,
661       33u,
662       positions09
663     },
664
665     {
666       "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR START",
667       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
668       true,
669       DevelText::LineWrap::CHARACTER,
670       DevelText::EllipsisPosition::START,
671       false,
672       textSize10,
673       3u,
674       37u,
675       positions10
676     },
677
678     {
679       "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR START",
680       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
681       true,
682       DevelText::LineWrap::HYPHENATION,
683       DevelText::EllipsisPosition::START,
684       false,
685       textSize11,
686       3u,
687       25u,
688       positions11
689     },
690
691     {
692       "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR START",
693       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
694       true,
695       DevelText::LineWrap::MIXED,
696       DevelText::EllipsisPosition::START,
697       false,
698       textSize12,
699       3u,
700       25u,
701       positions12
702     },
703
704   //END RTL cases
705     {
706       "EllipsisPosition: TextLabel: SingleLine RTL END",
707       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
708       false,
709       DevelText::LineWrap::WORD,
710       DevelText::EllipsisPosition::END,
711       false,
712       textSize13,
713       1u,
714       14u,
715       positions13
716     },
717
718     {
719       "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL END",
720       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
721       true,
722       DevelText::LineWrap::WORD,
723       DevelText::EllipsisPosition::END,
724       false,
725       textSize14,
726       3u,
727       41u,
728       positions14
729     },
730
731     {
732       "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL END",
733       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
734       true,
735       DevelText::LineWrap::CHARACTER,
736       DevelText::EllipsisPosition::END,
737       false,
738       textSize15,
739       3u,
740       42u,
741       positions15
742     },
743
744     {
745       "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL END",
746       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
747       true,
748       DevelText::LineWrap::HYPHENATION,
749       DevelText::EllipsisPosition::END,
750       false,
751       textSize16,
752       3u,
753       39u,
754       positions16
755     },
756
757     {
758       "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL END",
759       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
760       true,
761       DevelText::LineWrap::MIXED,
762       DevelText::EllipsisPosition::END,
763       false,
764       textSize17,
765       3u,
766       39u,
767       positions17
768     },
769
770    //START RTL cases
771     {
772       "EllipsisPosition: TextLabel: SingleLine RTL START",
773       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
774       false,
775       DevelText::LineWrap::WORD,
776       DevelText::EllipsisPosition::START,
777       false,
778       textSize18,
779       1u,
780       13u,
781       positions18
782     },
783
784     {
785       "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL START",
786       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
787       true,
788       DevelText::LineWrap::WORD,
789       DevelText::EllipsisPosition::START,
790       false,
791       textSize19,
792       3u,
793       33u,
794       positions19
795     },
796
797     {
798       "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL START",
799       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
800       true,
801       DevelText::LineWrap::CHARACTER,
802       DevelText::EllipsisPosition::START,
803       false,
804       textSize20,
805       3u,
806       30u,
807       positions20
808     },
809
810     {
811       "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL START",
812       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
813       true,
814       DevelText::LineWrap::HYPHENATION,
815       DevelText::EllipsisPosition::START,
816       false,
817       textSize21,
818       3u,
819       33u,
820       positions21
821     },
822
823     {
824       "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL START",
825       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
826       true,
827       DevelText::LineWrap::MIXED,
828       DevelText::EllipsisPosition::START,
829       false,
830       textSize22,
831       3u,
832       33u,
833       positions22
834     },
835
836   //MIDDLE LTR cases
837     {
838       "EllipsisPosition: TextLabel: Basic case SingleLine LTR MIDDLE",
839       "ABCDEFGHIJKLMNPQRSTUVWXYZ abcdefghijklmnpqrstuvwxyz",
840       false,
841       DevelText::LineWrap::WORD,
842       DevelText::EllipsisPosition::MIDDLE,
843       false,
844       textSize23,
845       1u,
846       10u,
847       positions23
848     },
849
850     {
851       "EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR MIDDLE",
852       "A0123456789 B0123456789 C0123456789 D0123456789 ",
853       true,
854       DevelText::LineWrap::WORD,
855       DevelText::EllipsisPosition::MIDDLE,
856       false,
857       textSize24,
858       2u,
859       22u,
860       positions24
861     },
862
863     {
864       "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR MIDDLE",
865       "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" ,
866       true,
867       DevelText::LineWrap::WORD,
868       DevelText::EllipsisPosition::MIDDLE,
869       false,
870       textSize25,
871       3u,
872       24u,
873       positions25
874     },
875
876     {
877       "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR MIDDLE",
878       "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" ,
879       true,
880       DevelText::LineWrap::CHARACTER,
881       DevelText::EllipsisPosition::MIDDLE,
882       false,
883       textSize26,
884       3u,
885       36u,
886       positions26
887     },
888
889     {
890       "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR MIDDLE",
891       "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" ,
892       true,
893       DevelText::LineWrap::HYPHENATION,
894       DevelText::EllipsisPosition::MIDDLE,
895       false,
896       textSize27,
897       3u,
898       27u,
899       positions27
900     },
901
902     {
903       "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR MIDDLE",
904       "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" ,
905       true,
906       DevelText::LineWrap::MIXED,
907       DevelText::EllipsisPosition::MIDDLE,
908       false,
909       textSize28,
910       3u,
911       24u,
912       positions28
913     },
914
915 //MIDDLE RTL cases
916     {
917       "EllipsisPosition: TextLabel: SingleLine RTL MIDDLE",
918       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
919       false,
920       DevelText::LineWrap::WORD,
921       DevelText::EllipsisPosition::MIDDLE,
922       false,
923       textSize29,
924       1u,
925       12u,
926       positions29
927     },
928
929     {
930       "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL MIDDLE",
931       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
932       true,
933       DevelText::LineWrap::WORD,
934       DevelText::EllipsisPosition::MIDDLE,
935       false,
936       textSize30,
937       3u,
938       31u,
939       positions30
940     },
941
942     {
943       "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL MIDDLE",
944       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
945       true,
946       DevelText::LineWrap::CHARACTER,
947       DevelText::EllipsisPosition::MIDDLE,
948       false,
949       textSize31,
950       3u,
951       30u,
952       positions31
953     },
954
955     {
956       "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL MIDDLE",
957       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
958       true,
959       DevelText::LineWrap::HYPHENATION,
960       DevelText::EllipsisPosition::MIDDLE,
961       false,
962       textSize32,
963       3u,
964       31u,
965       positions32
966     },
967
968     {
969       "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL MIDDLE",
970       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
971       true,
972       DevelText::LineWrap::MIXED,
973       DevelText::EllipsisPosition::MIDDLE,
974       false,
975       textSize33,
976       3u,
977       31u,
978       positions33
979     },
980
981     {
982       "EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR END",
983       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
984       true,
985       DevelText::LineWrap::WORD,
986       DevelText::EllipsisPosition::END,
987       false,
988       textSize34,
989       1u,
990       13u,
991       positions34
992     },
993
994     {
995       "EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR START",
996       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
997       true,
998       DevelText::LineWrap::WORD,
999       DevelText::EllipsisPosition::START,
1000       false,
1001       textSize35,
1002       1u,
1003       11u,
1004       positions35
1005     },
1006
1007     {
1008       "EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR MIDDLE",
1009       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1010       true,
1011       DevelText::LineWrap::WORD,
1012       DevelText::EllipsisPosition::MIDDLE,
1013       false,
1014       textSize36,
1015       1u,
1016       12u,
1017       positions36
1018     },
1019
1020   };
1021   const unsigned int numberOfTests = 39u;
1022
1023   for( unsigned int index = 0u; index < numberOfTests; ++index )
1024   {
1025     ToolkitTestApplication application;
1026     if( !ElideTestViewModel( data[index] ) )
1027     {
1028       tet_result(TET_FAIL);
1029     }
1030   }
1031
1032   tet_result(TET_PASS);
1033   END_TEST;
1034 }
1035
1036
1037 int UtcDaliTextFieldlElideTextLocation(void)
1038 {
1039   tet_infoline(" UtcDaliTextFieldlElideTextLocation ");
1040
1041   Size textSize00( 100.f, 100.f );
1042
1043   Size  textSize01( 120.0f, 50.0f );
1044   float positions01[] = { 0.0f, 11.0f, 23.0f, 32.0f, 42.0f, 52.0f, 62.0f, 73.0f, 83.0f, 95.0f };
1045
1046   Size  textSize02( 120.0f, 50.0f );
1047   float positions02[] = { 0.0f, 12.0f, 21.0f, 26.0f, 30.0f, 39.0f, 45.0f, 57.0f, 61.0f, 67.0f, 77.0f, 86.0f, 98.0f };
1048
1049   Size  textSize03( 120.0f, 50.0f );
1050   float positions03[] = { 118.0f, 111.0f, 97.0f, 89.0f, 80.0f, 74.0f, 63.0f, 58.0f, 53.0f, 44.0f, 35.0f, 29.0f, 20.0f, 7.0f };
1051
1052   Size  textSize04( 120.0f, 50.0f );
1053   float positions04[] = { 6.0f, 23.0f, 32.0f, 42.0f, 53.0f, 63.0f, 73.0f, 83.0f, 93.0f, 104.0f, 113.0f };
1054
1055   Size  textSize05( 120.0f, 50.0f );
1056   float positions05[] = { 2.0f, 20.0f, 29.0f, 39.0f, 44.0f, 60.0f, 69.0f, 74.0f, 83.0f, 92.0f, 108.0f };
1057
1058   Size  textSize06( 120.0f, 50.0f );
1059   float positions06[] = { 99.0f, 87.0f, 78.0f, 76.0f, 69.0f, 64.0f, 58.0f, 49.0f, 35.0f, 32.0f, 20.0f, 13.0f, 6.0f };
1060
1061   Size  textSize07( 120.0f, 50.0f );
1062   float positions07[] = { 0.0f, 11.0f, 23.0f, 32.0f, 42.0f, 57.0f, 73.0f };
1063
1064   Size  textSize08( 120.0f, 50.0f );
1065   float positions08[] = { 0.0f, 12.0f, 21.0f, 26.0f, 30.0f, 39.0f, 45.0f, 57.0f, 61.0f, 67.0f, 77.0f, 86.0f, 98.0f };
1066
1067   Size  textSize09( 120.0f, 50.0f );
1068   float positions09[] = { 118.0f, 111.0f, 97.0f, 89.0f, 80.0f, 74.0f, 63.0f, 58.0f, 53.0f, 44.0f, 35.0f, 29.0f, 20.0f, 7.0f };
1069
1070   Size  textSize10( 120.0f, 50.0f );
1071   float positions10[] = { 118.0f, 113.0f, 107.0f, 102.0f, 97.0f, 92.0f, 87.0f, 82.0f, 79.0f, 72.0f, 57.0f, 49.0f, 40.0f, 34.0f, 23.0f, 11.0f };
1072
1073   Size  textSize11( 120.0f, 50.0f );
1074   float positions11[] = { 95.0f, 78.0f, 75.0f, 64.0f, 56.0f, 49.0f, 44.0f, 39.0f, 34.0f, 29.0f, 23.0f, 18.0f, 13.0f, 8.0f, 3.0f };
1075
1076   Size  textSize12( 120.0f, 50.0f );
1077   float positions12[] = { 113.0f, 108.0f, 103.0f, 98.0f, 93.0f, 88.0f, 83.0f, 78.0f, 74.0f, 67.0f };
1078
1079   struct ElideData data[] =
1080   {
1081     {
1082       "void text",
1083       "",
1084       false,
1085       DevelText::LineWrap::WORD,
1086       DevelText::EllipsisPosition::END,
1087       false,
1088       textSize00,
1089       0u,
1090       0u,
1091       nullptr
1092     },
1093
1094     {
1095       "void text",
1096       "",
1097       false,
1098       DevelText::LineWrap::WORD,
1099       DevelText::EllipsisPosition::START,
1100       false,
1101       textSize00,
1102       0u,
1103       0u,
1104       nullptr
1105     },
1106
1107     {
1108       "void text",
1109       "",
1110       false,
1111       DevelText::LineWrap::WORD,
1112       DevelText::EllipsisPosition::MIDDLE,
1113       false,
1114       textSize00,
1115       0u,
1116       0u,
1117       nullptr
1118     },
1119
1120     {
1121       "EllipsisPosition: TextField: Basic case SingleLine LTR END",
1122       "A0123456789 B0123456789 C0123456789 D0123456789 ",
1123       false,
1124       DevelText::LineWrap::WORD,
1125       DevelText::EllipsisPosition::END,
1126       false,
1127       textSize01,
1128       1u,
1129       10u,
1130       positions01
1131     },
1132
1133     {
1134       "EllipsisPosition: TextField: SingleLine LTR END",
1135       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1136       false,
1137       DevelText::LineWrap::WORD,
1138       DevelText::EllipsisPosition::END,
1139       false,
1140       textSize02,
1141       1u,
1142       13u,
1143       positions02
1144     },
1145
1146     {
1147       "EllipsisPosition: TextField: SingleLine RTL END",
1148       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1149       false,
1150       DevelText::LineWrap::WORD,
1151       DevelText::EllipsisPosition::END,
1152       false,
1153       textSize03,
1154       1u,
1155       14u,
1156       positions03
1157     },
1158
1159     {
1160       "EllipsisPosition: TextField: Basic case SingleLine LTR START",
1161       "A0123456789 B0123456789 C0123456789 D0123456789 ",
1162       false,
1163       DevelText::LineWrap::WORD,
1164       DevelText::EllipsisPosition::START,
1165       false,
1166       textSize04,
1167       1u,
1168       11u,
1169       positions04
1170     },
1171
1172     {
1173       "EllipsisPosition: TextField: SingleLine LTR START",
1174       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1175       false,
1176       DevelText::LineWrap::WORD,
1177       DevelText::EllipsisPosition::START,
1178       false,
1179       textSize05,
1180       1u,
1181       11u,
1182       positions05
1183     },
1184
1185     {
1186       "EllipsisPosition: TextField: SingleLine RTL START",
1187       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1188       false,
1189       DevelText::LineWrap::WORD,
1190       DevelText::EllipsisPosition::START,
1191       false,
1192       textSize06,
1193       1u,
1194       13u,
1195       positions06
1196     },
1197
1198     {
1199       "EllipsisPosition: TextField: Basic case SingleLine LTR MIDDLE",
1200       "A0123456789 B0123456789 C0123456789 D0123456789 ",
1201       false,
1202       DevelText::LineWrap::WORD,
1203       DevelText::EllipsisPosition::MIDDLE,
1204       false,
1205       textSize07,
1206       1u,
1207       11u,
1208       positions07
1209     },
1210
1211     {
1212       "EllipsisPosition: TextField: SingleLine LTR MIDDLE",
1213       "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" ,
1214       false,
1215       DevelText::LineWrap::WORD,
1216       DevelText::EllipsisPosition::MIDDLE,
1217       false,
1218       textSize08,
1219       1u,
1220       13u,
1221       positions08
1222     },
1223
1224     {
1225       "EllipsisPosition: TextField: SingleLine RTL MIDDLE",
1226       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1227       false,
1228       DevelText::LineWrap::WORD,
1229       DevelText::EllipsisPosition::MIDDLE,
1230       false,
1231       textSize09,
1232       1u,
1233       12u,
1234       positions09
1235     },
1236
1237     {
1238       "EllipsisPosition: TextField: Head and Tail whitespaces RTL END",
1239       "        السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة         ",
1240       false,
1241       DevelText::LineWrap::WORD,
1242       DevelText::EllipsisPosition::END,
1243       false,
1244       textSize10,
1245       1u,
1246       16u,
1247       positions10
1248     },
1249
1250     {
1251       "EllipsisPosition: TextField: Head and Tail whitespaces RTL START",
1252       "        السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة         ",
1253       false,
1254       DevelText::LineWrap::WORD,
1255       DevelText::EllipsisPosition::START,
1256       false,
1257       textSize11,
1258       1u,
1259       15u,
1260       positions11
1261     },
1262
1263     {
1264       "EllipsisPosition: TextField: Head and Tail whitespaces RTL MIDDLE",
1265       "        السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة         ",
1266       false,
1267       DevelText::LineWrap::WORD,
1268       DevelText::EllipsisPosition::MIDDLE,
1269       false,
1270       textSize12,
1271       1u,
1272       20u,
1273       positions12
1274     },
1275
1276   };
1277
1278   const unsigned int numberOfTests = 15u;
1279
1280   for( unsigned int index = 0u; index < numberOfTests; ++index )
1281   {
1282     ToolkitTestApplication application;
1283     if( !ElideTestTextView( data[index] ) )
1284     {
1285       tet_result(TET_FAIL);
1286     }
1287   }
1288   tet_result(TET_PASS);
1289   END_TEST;
1290
1291 }
1292
1293
1294 int UtcDaliTextEditorElideTextLocation(void)
1295 {
1296   tet_infoline(" UtcDaliTextEditorElideTextLocation ");
1297
1298   Size textSize00( 100.f, 100.f );
1299
1300   Size  textSize01( 120.0f, 50.0f );
1301   float positions01[] = { 0.0f, 11.0f, 23.0f, 32.0f, 42.0f, 52.0f, 62.0f, 73.0f, 83.0f, 93.0f, 103.0f, 112.0f, 0.0f, 10.0f, 22.0f, 31.0f, 41.0f, 51.0f, 61.0f, 72.0f, 82.0f, 94.0f };
1302
1303   Size  textSize02( 120.0f, 60.0f );
1304   float positions02[] = { 0.0f, 12.0f, 21.0f, 26.0f, 30.0f, 39.0f, 45.0f, 57.0f, 61.0f, 0.0f, 10.0f, 19.0f, 29.0f, 39.0f, 46.0f, 50.0f, 66.0f, 76.0f, 85.0f, 0.0f, 15.0f, 25.0f, 30.0f, 38.0f, 48.0f, 64.0f, 73.0f, 79.0f, 93.0f };
1305
1306   Size  textSize03( 120.0f, 60.0f );
1307   float positions03[] = { 0.0f, 12.0f, 21.0f, 26.0f, 30.0f, 39.0f, 45.0f, 57.0f, 61.0f, 67.0f, 77.0f, 86.0f, 96.0f, 106.0f, 113.0f, 0.0f, 15.0f, 25.0f, 34.0f, 39.0f, 55.0f, 65.0f, 69.0f, 78.0f, 88.0f, 104.0f, 112.0f, 0.0f, 12.0f, 21.0f, 26.0f, 30.0f, 39.0f, 45.0f, 57.0f, 61.0f, 67.0f, 77.0f, 86.0f, 98.0f };
1308
1309   Size  textSize04( 110.0f, 60.0f );
1310   float positions04[] = { 0.0f, 12.0f, 21.0f, 26.0f, 30.0f, 39.0f, 45.0f, 57.0f, 61.0f, 67.0f, 77.0f, 0.0f, 10.0f, 20.0f, 26.0f, 31.0f, 46.0f, 56.0f, 65.0f, 70.0f, 86.0f, 96.0f, 0.0f, 8.0f, 18.0f, 34.0f, 43.0f, 49.0f, 61.0f, 71.0f, 75.0f, 81.0f };
1311
1312   Size  textSize05( 110.0f, 60.0f );
1313   float positions05[] = { 0.0f, 12.0f, 21.0f, 26.0f, 30.0f, 39.0f, 45.0f, 57.0f, 61.0f, 0.0f, 10.0f, 19.0f, 29.0f, 39.0f, 46.0f, 50.0f, 66.0f, 76.0f, 85.0f, 0.0f, 15.0f, 25.0f, 30.0f, 38.0f, 48.0f, 64.0f, 73.0f, 81.0f };
1314
1315   Size  textSize06( 120.0f, 50.0f );
1316   float positions06[] = { 5.0f, 22.0f, 31.0f, 41.0f, 51.0f, 62.0f, 72.0f, 82.0f, 92.0f, 102.0f, 112.0f };
1317
1318   Size  textSize07( 120.0f, 60.0f );
1319   float positions07[] = { 9.f, 25.f, 30.f, 38.f, 48.f, 64.f, 73.f, 79.f, 91.f, 101.f, 105.f, 110.f, 118.f };
1320
1321   Size  textSize08( 120.0f, 60.0f );
1322   float positions08[] = { 8.f, 25.f, 34.f, 39.f, 55.f, 65.f, 69.f, 78.f, 88.f, 104.f, 112.f };
1323
1324   Size  textSize09( 100.0f, 60.0f );
1325   float positions09[] = { 5.f, 21.f, 26.f, 30.f, 39.f, 45.f, 57.f, 61.f, 67.f, 77.f  };
1326
1327   Size  textSize10( 100.0f, 60.0f );
1328   float positions10[] = { 5.0f, 21.0f, 26.0f, 30.0f, 39.0f, 45.0f, 57.0f, 61.0f, 67.0f, 77.0f };
1329
1330   Size  textSize11( 120.0f, 60.0f );
1331   float positions11[] = { 119.0f, 112.0f, 98.0f, 89.0f, 80.0f, 74.0f, 63.0f, 58.0f, 53.0f, 45.0f, 36.0f, 31.0f, 112.0f, 103.0f, 93.0f };
1332
1333   Size  textSize12( 110.0f, 60.0f );
1334   float positions12[] = { 115.0f, 108.0f, 94.0f, 85.0f, 76.0f, 70.0f, 60.0f, 54.0f, 50.0f, 41.0f, 32.0f };
1335
1336   Size  textSize13( 110.0f, 60.0f );
1337   float positions13[] = { 113.0f, 106.0f, 92.0f, 83.0f, 74.0f, 68.0f, 58.0f, 52.0f, 48.0f, 39.0f, 30.0f, 25.0f, 106.0f };
1338
1339   Size  textSize14( 110.0f, 60.0f );
1340   float positions14[] = { 113.0f, 106.0f, 92.0f, 83.0f, 74.0f, 68.0f, 58.0f, 52.0f, 48.0f, 39.0f, 30.0f, 25.0f, 106.0f };
1341
1342   Size  textSize15( 120.0f, 60.0f );
1343   float positions15[] = { 125.f, 112.f, 107.f, 105.f, 98.f, 95.f, 85.f, 76.f, 71.f, 61.f, 54.f, 51.f, 46.f };
1344
1345   Size  textSize16( 110.0f, 60.0f );
1346   float positions16[] = { 89.f, 81.f, 78.f, 67.f, 59.f, 54.f, 44.f, 37.f, 33.f, 27.f, 24.f, 12.f, 7.f, 2.f, 0.f };
1347
1348   Size  textSize17( 110.0f, 60.0f );
1349   float positions17[] = { 105.f, 92.f, 87.f, 85.f, 78.f, 75.f, 65.f, 56.f, 51.f, 41.f, 34.f, 31.f, 26.f };
1350
1351   Size  textSize18( 110.0f, 60.0f );
1352   float positions18[] = { 105.f, 92.f, 87.f, 85.f, 78.f, 75.f, 65.f, 56.f, 51.f, 41.f, 34.f, 31.f, 26.f };
1353
1354   Size  textSize19( 120.0f, 50.0f );
1355   float positions19[] = { 0.f, 11.f, 23.f, 32.f, 42.f, 52.f, 62.f, 73.f, 83.f, 95.f };
1356
1357   Size  textSize20( 120.0f, 60.0f );
1358   float positions20[] = { 0.f, 12.f, 21.f, 26.f, 30.f, 39.f, 45.f, 57.f, 61.f, 0.f, 10.f, 19.f, 29.f, 39.f, 46.f, 50.f, 68.f };
1359
1360   Size  textSize21( 120.0f, 60.0f );
1361   float positions21[] = { 0.f, 12.f, 21.f, 26.f, 30.f, 39.f, 45.f, 57.f, 61.f, 67.f, 77.f, 86.f, 96.f, 106.f, 113.f, 0.f, 15.f, 25.f, 34.f, 39.f, 55.f, 65.f, 69.f, 78.f, 90.f };
1362
1363   Size  textSize22( 110.0f, 60.0f );
1364   float positions22[] = { 0.f, 12.f, 21.f, 26.f, 30.f, 39.f, 45.f, 57.f, 61.f, 67.f, 77.f, 0.f, 10.f, 20.f, 26.f, 31.f, 46.f, 56.f, 65.f, 72.f };
1365
1366   Size  textSize23( 110.0f, 60.0f );
1367   float positions23[] = { 0.f, 12.f, 21.f, 26.f, 30.f, 39.f, 45.f, 57.f, 61.f, 0.f, 10.f, 19.f, 29.f, 39.f, 46.f, 50.f, 68.f };
1368
1369   Size  textSize24( 120.0f, 60.0f );
1370   float positions24[] = { 137.0f, 131.0f, 116.0f, 108.0f, 99.0f, 93.0f, 82.0f, 77.0f, 72.0f, 63.0f, 55.0f };
1371
1372   Size  textSize25( 110.0f, 60.0f );
1373   float positions25[] = { 107.f, 100.f, 86.f, 77.f, 68.f, 62.f, 52.f, 46.f, 42.f, 33.f, 24.f, 18.f, 8.f, 0.f, 95.f, 90.f, 87.f, 81.f, 78.f, 67.f, 59.f, 54.f, 44.f, 37.f, 33.f, 27.f, 24.f, 9.f };
1374
1375   Size  textSize26( 110.0f, 60.0f );
1376   float positions26[] = { 117.0f, 111.0f, 96.0f, 88.0f, 79.0f, 73.0f, 62.0f, 57.0f, 52.0f, 43.0f, 35.0f };
1377
1378   Size  textSize27( 110.0f, 60.0f );
1379   float positions27[] = { 117.0f, 111.0f, 96.0f, 88.0f, 79.0f, 73.0f, 62.0f, 57.0f, 52.0f, 43.0f, 35.0f };
1380
1381   Size  textSize28( 120.0f, 30.0f );
1382   float positions28[] = { 0.0f, 12.0f, 21.0f, 26.0f, 30.0f, 39.0f, 45.0f, 57.0f, 61.0f, 67.0f, 77.0f, 86.0f, 98.0f };
1383
1384   Size  textSize29( 120.0f, 30.0f );
1385   float positions29[] = { 2.0f, 20.0f, 29.0f, 39.0f, 44.0f, 60.0f, 69.0f, 74.0f, 83.0f, 92.0f, 108.0f };
1386
1387   Size  textSize30( 120.0f, 30.0f );
1388   float positions30[] = { 0.0f, 12.0f, 21.0f, 26.0f, 30.0f, 39.0f, 45.0f, 57.0f };
1389
1390
1391   struct ElideData data[] =
1392   {
1393     {
1394       "void text",
1395       "",
1396       true,
1397       DevelText::LineWrap::WORD,
1398       DevelText::EllipsisPosition::END,
1399       false,
1400       textSize00,
1401       0u,
1402       0u,
1403       nullptr
1404     },
1405
1406     {
1407       "void text",
1408       "",
1409       true,
1410       DevelText::LineWrap::WORD,
1411       DevelText::EllipsisPosition::START,
1412       false,
1413       textSize00,
1414       0u,
1415       0u,
1416       nullptr
1417     },
1418
1419     {
1420       "void text",
1421       "",
1422       true,
1423       DevelText::LineWrap::WORD,
1424       DevelText::EllipsisPosition::MIDDLE,
1425       false,
1426       textSize00,
1427       0u,
1428       0u,
1429       nullptr
1430     },
1431
1432    //END LTR cases
1433
1434     {
1435       "EllipsisPosition: TextEditor: Basic case Mulitlines LineWrap-WORD LTR END",
1436       "A0123456789 B0123456789 C0123456789 D0123456789 ",
1437       true,
1438       DevelText::LineWrap::WORD,
1439       DevelText::EllipsisPosition::END,
1440       false,
1441       textSize01,
1442       2u,
1443       22u,
1444       positions01
1445     },
1446
1447     {
1448       "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD LTR END",
1449       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1450       true,
1451       DevelText::LineWrap::WORD,
1452       DevelText::EllipsisPosition::END,
1453       false,
1454       textSize02,
1455       3u,
1456       29u,
1457       positions02
1458     },
1459
1460     {
1461       "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER LTR END",
1462       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1463       true,
1464       DevelText::LineWrap::CHARACTER,
1465       DevelText::EllipsisPosition::END,
1466       false,
1467       textSize03,
1468       3u,
1469       40u,
1470       positions03
1471     },
1472
1473     {
1474       "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHAN LTR END",
1475       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1476       true,
1477       DevelText::LineWrap::HYPHENATION,
1478       DevelText::EllipsisPosition::END,
1479       false,
1480       textSize04,
1481       3u,
1482       32u,
1483       positions04
1484     },
1485
1486     {
1487       "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED LTR END",
1488       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1489       true,
1490       DevelText::LineWrap::MIXED,
1491       DevelText::EllipsisPosition::END,
1492       false,
1493       textSize05,
1494       3u,
1495       28u,
1496       positions05
1497     },
1498
1499    //START LTR cases
1500
1501     {
1502       "EllipsisPosition: TextEditor: Basic case Mulitlines LineWrap-WORD LTR START",
1503       "A0123456789 B0123456789 C0123456789 D0123456789 ",
1504       true,
1505       DevelText::LineWrap::WORD,
1506       DevelText::EllipsisPosition::START,
1507       false,
1508       textSize06,
1509       2u,
1510       23u,
1511       positions06
1512     },
1513
1514     {
1515       "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD LTR START",
1516       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1517       true,
1518       DevelText::LineWrap::WORD,
1519       DevelText::EllipsisPosition::START,
1520       false,
1521       textSize07,
1522       3u,
1523       33u,
1524       positions07
1525     },
1526
1527     {
1528       "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER LTR START",
1529       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1530       true,
1531       DevelText::LineWrap::CHARACTER,
1532       DevelText::EllipsisPosition::START,
1533       false,
1534       textSize08,
1535       3u,
1536       37u,
1537       positions08
1538     },
1539
1540     {
1541       "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHAN LTR START",
1542       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1543       true,
1544       DevelText::LineWrap::HYPHENATION,
1545       DevelText::EllipsisPosition::START,
1546       false,
1547       textSize09,
1548       3u,
1549       25u,
1550       positions09
1551     },
1552
1553     {
1554       "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED LTR START",
1555       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1556       true,
1557       DevelText::LineWrap::MIXED,
1558       DevelText::EllipsisPosition::START,
1559       false,
1560       textSize10,
1561       3u,
1562       25u,
1563       positions10
1564     },
1565
1566   //END RTL cases
1567
1568     {
1569       "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD RTL END",
1570       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1571       true,
1572       DevelText::LineWrap::WORD,
1573       DevelText::EllipsisPosition::END,
1574       false,
1575       textSize11,
1576       3u,
1577       41u,
1578       positions11
1579     },
1580
1581     {
1582       "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER RTL END",
1583       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1584       true,
1585       DevelText::LineWrap::CHARACTER,
1586       DevelText::EllipsisPosition::END,
1587       false,
1588       textSize12,
1589       3u,
1590       42u,
1591       positions12
1592     },
1593
1594     {
1595       "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHENATION RTL END",
1596       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1597       true,
1598       DevelText::LineWrap::HYPHENATION,
1599       DevelText::EllipsisPosition::END,
1600       false,
1601       textSize13,
1602       3u,
1603       39u,
1604       positions13
1605     },
1606
1607     {
1608       "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED RTL END",
1609       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1610       true,
1611       DevelText::LineWrap::MIXED,
1612       DevelText::EllipsisPosition::END,
1613       false,
1614       textSize14,
1615       3u,
1616       39u,
1617       positions14
1618     },
1619
1620    //START RTL cases
1621
1622     {
1623       "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD RTL START",
1624       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1625       true,
1626       DevelText::LineWrap::WORD,
1627       DevelText::EllipsisPosition::START,
1628       false,
1629       textSize15,
1630       3u,
1631       33u,
1632       positions15
1633     },
1634
1635     {
1636       "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER RTL START",
1637       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1638       true,
1639       DevelText::LineWrap::CHARACTER,
1640       DevelText::EllipsisPosition::START,
1641       false,
1642       textSize16,
1643       3u,
1644       30u,
1645       positions16
1646     },
1647
1648     {
1649       "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHENATION RTL START",
1650       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1651       true,
1652       DevelText::LineWrap::HYPHENATION,
1653       DevelText::EllipsisPosition::START,
1654       false,
1655       textSize17,
1656       3u,
1657       33u,
1658       positions17
1659     },
1660
1661     {
1662       "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED RTL START",
1663       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1664       true,
1665       DevelText::LineWrap::MIXED,
1666       DevelText::EllipsisPosition::START,
1667       false,
1668       textSize18,
1669       3u,
1670       33u,
1671       positions18
1672     },
1673
1674 //MIDDLE LTR cases
1675
1676     {
1677       "EllipsisPosition: TextEditor: Basic case Mulitlines LineWrap-WORD LTR MIDDLE",
1678       "A0123456789 B0123456789 C0123456789 D0123456789 ",
1679       true,
1680       DevelText::LineWrap::WORD,
1681       DevelText::EllipsisPosition::MIDDLE,
1682       false,
1683       textSize19,
1684       2u,
1685       22u,
1686       positions19
1687     },
1688
1689     {
1690       "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD LTR MIDDLE",
1691       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1692       true,
1693       DevelText::LineWrap::WORD,
1694       DevelText::EllipsisPosition::MIDDLE,
1695       false,
1696       textSize20,
1697       3u,
1698       24u,
1699       positions20
1700     },
1701
1702     {
1703       "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER LTR MIDDLE",
1704       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1705       true,
1706       DevelText::LineWrap::CHARACTER,
1707       DevelText::EllipsisPosition::MIDDLE,
1708       false,
1709       textSize21,
1710       3u,
1711       36u,
1712       positions21
1713     },
1714
1715     {
1716       "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHAN LTR MIDDLE",
1717       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1718       true,
1719       DevelText::LineWrap::HYPHENATION,
1720       DevelText::EllipsisPosition::MIDDLE,
1721       false,
1722       textSize22,
1723       3u,
1724       27u,
1725       positions22
1726     },
1727
1728     {
1729       "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED LTR MIDDLE",
1730       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1731       true,
1732       DevelText::LineWrap::MIXED,
1733       DevelText::EllipsisPosition::MIDDLE,
1734       false,
1735       textSize23,
1736       3u,
1737       24u,
1738       positions23
1739     },
1740
1741 //MIDDLE RTL cases
1742
1743     {
1744       "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD RTL MIDDLE",
1745       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1746       true,
1747       DevelText::LineWrap::WORD,
1748       DevelText::EllipsisPosition::MIDDLE,
1749       false,
1750       textSize24,
1751       3u,
1752       31u,
1753       positions24
1754     },
1755
1756     {
1757       "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER RTL MIDDLE",
1758       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1759       true,
1760       DevelText::LineWrap::CHARACTER,
1761       DevelText::EllipsisPosition::MIDDLE,
1762       false,
1763       textSize25,
1764       3u,
1765       30u,
1766       positions25
1767     },
1768
1769     {
1770       "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHENATION RTL MIDDLE",
1771       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1772       true,
1773       DevelText::LineWrap::HYPHENATION,
1774       DevelText::EllipsisPosition::MIDDLE,
1775       false,
1776       textSize26,
1777       3u,
1778       31u,
1779       positions26
1780     },
1781
1782     {
1783       "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED RTL MIDDLE",
1784       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1785       true,
1786       DevelText::LineWrap::MIXED,
1787       DevelText::EllipsisPosition::MIDDLE,
1788       false,
1789       textSize27,
1790       3u,
1791       31u,
1792       positions27
1793     },
1794
1795     {
1796       "EllipsisPosition: TextEditor: One-Line for Mulitlines LineWrap-WORD LTR END",
1797       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1798       true,
1799       DevelText::LineWrap::WORD,
1800       DevelText::EllipsisPosition::END,
1801       false,
1802       textSize28,
1803       1u,
1804       13u,
1805       positions28
1806     },
1807
1808     {
1809       "EllipsisPosition: TextEditor: One-Line for Mulitlines LineWrap-WORD LTR START",
1810       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1811       true,
1812       DevelText::LineWrap::WORD,
1813       DevelText::EllipsisPosition::START,
1814       false,
1815       textSize29,
1816       1u,
1817       11u,
1818       positions29
1819     },
1820
1821     {
1822       "EllipsisPosition: TextEditor: One-Line for Mulitlines LineWrap-WORD LTR MIDDLE",
1823       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1824       true,
1825       DevelText::LineWrap::WORD,
1826       DevelText::EllipsisPosition::MIDDLE,
1827       false,
1828       textSize30,
1829       1u,
1830       12u,
1831       positions30
1832     },
1833
1834   };
1835   const unsigned int numberOfTests = 33u;
1836
1837   for( unsigned int index = 0u; index < numberOfTests; ++index )
1838   {
1839     ToolkitTestApplication application;
1840     if( !ElideTestTextView( data[index] ) )
1841     {
1842       tet_result(TET_FAIL);
1843     }
1844   }
1845
1846   tet_result(TET_PASS);
1847   END_TEST;
1848 }