Merge "Add ApplyCustomFragmentPrefix" into devel/master
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit-internal / utc-Dali-Text-ViewModel.cpp
index f243f08..b9de8c1 100755 (executable)
@@ -572,6 +572,24 @@ int UtcDaliTextViewModelElideText01(void)
   DALI_TEST_CHECK( NULL != glyphs );
   DALI_TEST_CHECK( NULL != layouts );
 
+  // When the ellipsis is enabled, at least a glyph has to be rendered.
+  // Even if the given width is too narrow for rendering an ellipsis glyph.
+  controller->SetText( "…" );
+  Vector3 sizeEllipsis = controller->GetNaturalSize();
+  controller->SetText( "A" );
+  Vector3 sizeA = controller->GetNaturalSize();
+  float testWidth = sizeA.width < sizeEllipsis.width ? sizeA.width : sizeEllipsis.width - 1.0;
+
+  controller->SetText( "AB" );
+  Vector3 sizeAB = controller->GetNaturalSize();
+
+  controller->Relayout( Size(testWidth, sizeAB.height) );
+
+  // Elide the glyphs.
+  model->ElideGlyphs();
+  DALI_TEST_EQUALS( 1u, model->GetNumberOfGlyphs(), TEST_LOCATION );
+  DALI_TEST_EQUALS( 1u, model->GetNumberOfLines(), TEST_LOCATION );
+
   tet_result(TET_PASS);
   END_TEST;
 }
@@ -586,10 +604,10 @@ int UtcDaliTextViewModelElideText02(void)
   float positions01[] = { 0.f, 8.f, 16.f, 26.f, 34.f, 43.f, 47.f, 58.f, 64.0f };
 
   Size textSize02( 80.f, 100.f );
-  float positions02[] = { 69.f, 63.f, 58.f, 50.f, 45.f, 41.f, 32.f, 23.f, 9.f };
+  float positions02[] = { 69.f, 63.f, 58.f, 50.f, 45.f, 41.f, 32.f, 23.f, 5.f };
 
   Size textSize03( 80.f, 100.f );
-  float positions03[] = { 54.f, 47.f, 44.f, 41.f, 36.f, 29.f, 25.f, 20.f, 13.f, 8.f, 4.f, 6.f };
+  float positions03[] = { 72.f, 65.f, 61.f, 59.f, 53.f, 47.f, 43.f, 38.f, 30.f, 25.f, 21.f, 7.f };
 
   Size textSize04( 80.f, 10.f );
   float positions04[] = { 2.f };