X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit-internal%2Futc-Dali-TextLabel-internal.cpp;h=e03fec1d09fbda2198329b53a20548e816f71022;hb=refs%2Fchanges%2F86%2F257786%2F12;hp=f67d88a4f7b3a040fd41e939aa591c59963a95a3;hpb=93ad73e0e2c46aca4c191a1e2f075061e167e8b5;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git
diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-TextLabel-internal.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-TextLabel-internal.cpp
index f67d88a..e03fec1 100755
--- a/automated-tests/src/dali-toolkit-internal/utc-Dali-TextLabel-internal.cpp
+++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-TextLabel-internal.cpp
@@ -97,4 +97,68 @@ int UtcDaliTextLabelBackgroundTag(void)
DALI_TEST_EQUALS( backgroundColorIndicesBuffer[7], 2u, TEST_LOCATION);
END_TEST;
+}
+
+int UtcDaliTextLabelTextWithSpan(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliTextLabelTextWithSpan\n");
+
+ TextLabel label = TextLabel::New();
+ DALI_TEST_CHECK( label );
+
+ label.SetProperty( TextLabel ::Property::ENABLE_MARKUP, true );
+ label.SetProperty( TextLabel::Property::TEXT, "Hello Span" );
+ application.GetScene().Add( label );
+
+ application.SendNotification();
+ application.Render();
+
+ Vector3 originalSize = label.GetNaturalSize();
+ label.SetProperty( TextLabel::Property::TEXT, "Hello Span" );
+
+ application.SendNotification();
+ application.Render();
+
+ Vector3 spanSize = label.GetNaturalSize();
+
+ DALI_TEST_GREATER(spanSize.width, originalSize.width, TEST_LOCATION);
+
+ Toolkit::Internal::TextLabel& labelImpl = GetImpl( label );
+ const ColorIndex* const colorIndicesBuffer1 = labelImpl.getController()->GetTextModel()->GetColorIndices();
+
+ DALI_TEST_CHECK( colorIndicesBuffer1 );
+
+ //default color
+ DALI_TEST_EQUALS( colorIndicesBuffer1[0], 0u, TEST_LOCATION);
+
+ //span color
+ DALI_TEST_EQUALS( colorIndicesBuffer1[1], 1u, TEST_LOCATION);
+
+ //default color
+ DALI_TEST_EQUALS( colorIndicesBuffer1[6], 0u, TEST_LOCATION);
+
+
+ label.SetProperty( TextLabel::Property::TEXT, "Hello Span" );
+
+ application.SendNotification();
+ application.Render();
+
+ const ColorIndex* const colorIndicesBuffer2 = labelImpl.getController()->GetTextModel()->GetColorIndices();
+
+ DALI_TEST_CHECK( colorIndicesBuffer2 );
+
+ //default color
+ DALI_TEST_EQUALS( colorIndicesBuffer2[0], 0u, TEST_LOCATION);
+
+ //default color
+ DALI_TEST_EQUALS( colorIndicesBuffer2[1], 0u, TEST_LOCATION);
+
+ //span color
+ DALI_TEST_EQUALS( colorIndicesBuffer2[6], 1u, TEST_LOCATION);
+
+ //default color
+ DALI_TEST_EQUALS( colorIndicesBuffer2[7], 0u, TEST_LOCATION);
+
+ END_TEST;
}
\ No newline at end of file