+}
+
+int UtcDaliTextLabelMarkupParagraphTagAlignAttribute(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliTextLabelMarkupParagraphTagAlignAttribute ");
+
+ // Apply alignment for each type on property level on three paragraphs and in-between text.
+ // Apply align in markup on the three paragraphs (each one a type).
+ // Using the same text to gain similar results from both the property level and the markup.
+ // Compare line alignment between the property level and the markup.
+
+ std::string textAlignOnPropertyLevel = "text outside<p>Paragraph end</p>text outside<p>Paragraph center</p>text outside<p>Paragraph begin</p><p>Paragraph property alignment</p>";
+ std::string textAlignInMarkup = "text outside<p align='end'>Paragraph end</p>text outside<p align='center'>Paragraph center</p>text outside<p align='begin' >Paragraph begin</p><p>Paragraph property alignment</p>";
+
+ //Set size to avoid automatic eliding
+ Vector2 controllerSize = Vector2(1025, 1025);
+
+ TextLabel textLabelBeginAlign = TextLabel::New();
+ TextLabel textLabelCenterAlign = TextLabel::New();
+ TextLabel textLabelEndAlign = TextLabel::New();
+ TextLabel textLabelMultiAlign = TextLabel::New();
+
+ application.GetScene().Add(textLabelBeginAlign);
+ application.GetScene().Add(textLabelCenterAlign);
+ application.GetScene().Add(textLabelEndAlign);
+ application.GetScene().Add(textLabelMultiAlign);
+
+ textLabelBeginAlign.SetProperty(TextLabel::Property::TEXT, textAlignOnPropertyLevel);
+ textLabelBeginAlign.SetProperty(TextLabel ::Property::ENABLE_MARKUP, true);
+ textLabelBeginAlign.SetProperty(TextLabel::Property::MULTI_LINE, true);
+ textLabelBeginAlign.SetProperty(TextLabel::Property::ELLIPSIS, false);
+ textLabelBeginAlign.SetProperty(TextLabel::Property::HORIZONTAL_ALIGNMENT, Dali::Toolkit::Text::HorizontalAlignment::BEGIN);
+ textLabelBeginAlign.SetProperty(Actor::Property::SIZE, controllerSize);
+
+ textLabelCenterAlign.SetProperty(TextLabel::Property::TEXT, textAlignOnPropertyLevel);
+ textLabelCenterAlign.SetProperty(TextLabel ::Property::ENABLE_MARKUP, true);
+ textLabelCenterAlign.SetProperty(TextLabel::Property::MULTI_LINE, true);
+ textLabelCenterAlign.SetProperty(TextLabel::Property::ELLIPSIS, false);
+ textLabelCenterAlign.SetProperty(TextLabel::Property::HORIZONTAL_ALIGNMENT, Dali::Toolkit::Text::HorizontalAlignment::CENTER);
+ textLabelCenterAlign.SetProperty(Actor::Property::SIZE, controllerSize);
+
+ textLabelEndAlign.SetProperty(TextLabel::Property::TEXT, textAlignOnPropertyLevel);
+ textLabelEndAlign.SetProperty(TextLabel ::Property::ENABLE_MARKUP, true);
+ textLabelEndAlign.SetProperty(TextLabel::Property::MULTI_LINE, true);
+ textLabelEndAlign.SetProperty(TextLabel::Property::ELLIPSIS, false);
+ textLabelEndAlign.SetProperty(TextLabel::Property::HORIZONTAL_ALIGNMENT, Dali::Toolkit::Text::HorizontalAlignment::END);
+ textLabelEndAlign.SetProperty(Actor::Property::SIZE, controllerSize);
+
+ textLabelMultiAlign.SetProperty(TextLabel::Property::TEXT, textAlignInMarkup);
+ textLabelMultiAlign.SetProperty(TextLabel ::Property::ENABLE_MARKUP, true);
+ textLabelMultiAlign.SetProperty(TextLabel::Property::MULTI_LINE, true);
+ textLabelMultiAlign.SetProperty(TextLabel::Property::ELLIPSIS, false);
+ textLabelMultiAlign.SetProperty(TextLabel::Property::HORIZONTAL_ALIGNMENT, Dali::Toolkit::Text::HorizontalAlignment::CENTER);
+ textLabelMultiAlign.SetProperty(Actor::Property::SIZE, controllerSize);
+
+ application.SendNotification();
+ application.Render();
+
+ uint32_t expectedNumberOfBoundedParagraphRuns = 4u;
+ uint32_t expectedNumberOfLines = 7u;
+
+ Toolkit::Internal::TextLabel& textLabelMultiAlignImpl = GetImpl(textLabelMultiAlign);
+ Toolkit::Internal::TextLabel& textLabelBeginAlignImpl = GetImpl(textLabelBeginAlign);
+ Toolkit::Internal::TextLabel& textLabelCenterAlignImpl = GetImpl(textLabelCenterAlign);
+ Toolkit::Internal::TextLabel& textLabelEndAlignImpl = GetImpl(textLabelEndAlign);
+
+ const Text::Length numberOfBoundedParagraphRuns = textLabelMultiAlignImpl.GetTextController()->GetTextModel()->GetNumberOfBoundedParagraphRuns();
+ DALI_TEST_EQUALS(numberOfBoundedParagraphRuns, expectedNumberOfBoundedParagraphRuns, TEST_LOCATION);
+
+ DALI_TEST_EQUALS(textLabelMultiAlignImpl.GetTextController()->GetTextModel()->GetNumberOfLines(), expectedNumberOfLines, TEST_LOCATION);
+ DALI_TEST_CHECK(textLabelMultiAlignImpl.GetTextController()->GetTextModel()->GetLines());
+
+ DALI_TEST_EQUALS(textLabelBeginAlignImpl.GetTextController()->GetTextModel()->GetNumberOfLines(), expectedNumberOfLines, TEST_LOCATION);
+ DALI_TEST_CHECK(textLabelBeginAlignImpl.GetTextController()->GetTextModel()->GetLines());
+
+ DALI_TEST_EQUALS(textLabelCenterAlignImpl.GetTextController()->GetTextModel()->GetNumberOfLines(), expectedNumberOfLines, TEST_LOCATION);
+ DALI_TEST_CHECK(textLabelCenterAlignImpl.GetTextController()->GetTextModel()->GetLines());
+
+ DALI_TEST_EQUALS(textLabelEndAlignImpl.GetTextController()->GetTextModel()->GetNumberOfLines(), expectedNumberOfLines, TEST_LOCATION);
+ DALI_TEST_CHECK(textLabelEndAlignImpl.GetTextController()->GetTextModel()->GetLines());
+
+ const uint32_t LINE_INDEX_ALIGN_END = 1u;
+ const uint32_t LINE_INDEX_ALIGN_CENTER = 3u;
+ const uint32_t LINE_INDEX_ALIGN_BEGIN = 5u;
+ const uint32_t LINE_INDEX_OUTSIDE_1 = 0u;
+ const uint32_t LINE_INDEX_OUTSIDE_2 = 2u;
+ const uint32_t LINE_INDEX_OUTSIDE_3 = 4u;
+ const uint32_t LINE_INDEX_PARAGRAPH = 6u;
+
+ //<p align='end'>Paragraph end</p>
+ const LineRun& lineEndFromMultiAlign = *(textLabelMultiAlignImpl.GetTextController()->GetTextModel()->GetLines() + LINE_INDEX_ALIGN_END);
+ const LineRun& lineEndFromEndAlign = *(textLabelEndAlignImpl.GetTextController()->GetTextModel()->GetLines() + LINE_INDEX_ALIGN_END);
+ tet_infoline(" UtcDaliTextLabelMarkupParagraphTagAlignAttribute - <p align='end'>Paragraph end</p>");
+ DALI_TEST_EQUALS(lineEndFromMultiAlign.alignmentOffset, lineEndFromEndAlign.alignmentOffset, TEST_LOCATION);
+ DALI_TEST_EQUALS(lineEndFromMultiAlign.width, lineEndFromEndAlign.width, TEST_LOCATION);
+
+ //<p align='center'>Paragraph center</p>
+ const LineRun& lineCenterFromMultiAlign = *(textLabelMultiAlignImpl.GetTextController()->GetTextModel()->GetLines() + LINE_INDEX_ALIGN_CENTER);
+ const LineRun& lineEndFromCenterAlign = *(textLabelCenterAlignImpl.GetTextController()->GetTextModel()->GetLines() + LINE_INDEX_ALIGN_CENTER);
+ tet_infoline(" UtcDaliTextLabelMarkupParagraphTagAlignAttribute - <p align='center'>Paragraph center</p>");
+ DALI_TEST_EQUALS(lineCenterFromMultiAlign.alignmentOffset, lineEndFromCenterAlign.alignmentOffset, TEST_LOCATION);
+ DALI_TEST_EQUALS(lineCenterFromMultiAlign.width, lineEndFromCenterAlign.width, TEST_LOCATION);
+
+ //<p align='begin' >Paragraph begin</p>
+ const LineRun& lineBeginFromMultiAlign = *(textLabelMultiAlignImpl.GetTextController()->GetTextModel()->GetLines() + LINE_INDEX_ALIGN_BEGIN);
+ const LineRun& lineEndFromBeginAlign = *(textLabelBeginAlignImpl.GetTextController()->GetTextModel()->GetLines() + LINE_INDEX_ALIGN_BEGIN);
+ tet_infoline(" UtcDaliTextLabelMarkupParagraphTagAlignAttribute - <p align='begin' >Paragraph begin</p>");
+ DALI_TEST_EQUALS(lineBeginFromMultiAlign.alignmentOffset, lineEndFromBeginAlign.alignmentOffset, TEST_LOCATION);
+ DALI_TEST_EQUALS(lineBeginFromMultiAlign.width, lineEndFromBeginAlign.width, TEST_LOCATION);
+
+ //text outside
+ const LineRun& lineOutsideOneFromMultiAlign = *(textLabelMultiAlignImpl.GetTextController()->GetTextModel()->GetLines() + LINE_INDEX_OUTSIDE_1);
+ const LineRun& lineOutsideOneFromCenterAlign = *(textLabelCenterAlignImpl.GetTextController()->GetTextModel()->GetLines() + LINE_INDEX_OUTSIDE_1);
+ tet_infoline(" UtcDaliTextLabelMarkupParagraphTagAlignAttribute - text outside one");
+ DALI_TEST_EQUALS(lineOutsideOneFromMultiAlign.alignmentOffset, lineOutsideOneFromCenterAlign.alignmentOffset, TEST_LOCATION);
+ DALI_TEST_EQUALS(lineOutsideOneFromMultiAlign.width, lineOutsideOneFromCenterAlign.width, TEST_LOCATION);
+
+ const LineRun& lineOutsideTwoFromMultiAlign = *(textLabelMultiAlignImpl.GetTextController()->GetTextModel()->GetLines() + LINE_INDEX_OUTSIDE_2);
+ const LineRun& lineOutsideTwoFromCenterAlign = *(textLabelCenterAlignImpl.GetTextController()->GetTextModel()->GetLines() + LINE_INDEX_OUTSIDE_2);
+ tet_infoline(" UtcDaliTextLabelMarkupParagraphTagAlignAttribute - text outside two");
+ DALI_TEST_EQUALS(lineOutsideTwoFromMultiAlign.alignmentOffset, lineOutsideTwoFromCenterAlign.alignmentOffset, TEST_LOCATION);
+ DALI_TEST_EQUALS(lineOutsideTwoFromMultiAlign.width, lineOutsideTwoFromCenterAlign.width, TEST_LOCATION);
+
+ const LineRun& lineOutsideThreeFromMultiAlign = *(textLabelMultiAlignImpl.GetTextController()->GetTextModel()->GetLines() + LINE_INDEX_OUTSIDE_3);
+ const LineRun& lineOutsideThreeFromCenterAlign = *(textLabelCenterAlignImpl.GetTextController()->GetTextModel()->GetLines() + LINE_INDEX_OUTSIDE_3);
+ tet_infoline(" UtcDaliTextLabelMarkupParagraphTagAlignAttribute - text outside three");
+ DALI_TEST_EQUALS(lineOutsideThreeFromMultiAlign.alignmentOffset, lineOutsideThreeFromCenterAlign.alignmentOffset, TEST_LOCATION);
+ DALI_TEST_EQUALS(lineOutsideThreeFromMultiAlign.width, lineOutsideThreeFromCenterAlign.width, TEST_LOCATION);
+
+ const LineRun& lineParagraphFromMultiAlign = *(textLabelMultiAlignImpl.GetTextController()->GetTextModel()->GetLines() + LINE_INDEX_PARAGRAPH);
+ const LineRun& lineParagraphFromCenterAlign = *(textLabelCenterAlignImpl.GetTextController()->GetTextModel()->GetLines() + LINE_INDEX_PARAGRAPH);
+ tet_infoline(" UtcDaliTextLabelMarkupParagraphTagAlignAttribute - <p>Paragraph property alignment</p>");
+ DALI_TEST_EQUALS(lineParagraphFromMultiAlign.alignmentOffset, lineParagraphFromCenterAlign.alignmentOffset, TEST_LOCATION);
+ DALI_TEST_EQUALS(lineParagraphFromMultiAlign.width, lineParagraphFromCenterAlign.width, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliTextLabelMarkupCharacterSpacingTag(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliTextLabelMarkupCharacterSpacingTag ");
+
+ const Length EXPECTED_NUMBER_OF_GLYPHS = 21u;
+
+ const float expandedCharSpacing = 10.0f;
+ const float condensedCharSpacing = -5.0f;
+
+ TextLabel textLabel = TextLabel::New();
+
+ textLabel.SetProperty(TextLabel::Property::TEXT, "ABC EF\n<char-spacing value='-5.0f'>ABC EF\n</char-spacing><char-spacing value='10.0f'>ABC EF\n</char-spacing>");
+ textLabel.SetProperty(TextLabel ::Property::ENABLE_MARKUP, true);
+ textLabel.SetProperty(TextLabel::Property::MULTI_LINE, true);
+
+ application.GetScene().Add(textLabel);
+
+ application.SendNotification();
+ application.Render();
+
+ Toolkit::Internal::TextLabel& textLabelImpl = GetImpl(textLabel);
+ Text::ViewInterface& view = textLabelImpl.GetTextController()->GetView();
+
+ Length numberOfGlyphs = view.GetNumberOfGlyphs();
+
+ DALI_TEST_EQUALS(numberOfGlyphs, EXPECTED_NUMBER_OF_GLYPHS, Math::MACHINE_EPSILON_1000, TEST_LOCATION);
+
+ Vector<GlyphInfo> glyphs;
+ glyphs.Resize(numberOfGlyphs);
+
+ Vector<Vector2> positions;
+ positions.Resize(numberOfGlyphs);
+
+ float alignmentOffset = 0u;
+ numberOfGlyphs = view.GetGlyphs(glyphs.Begin(),
+ positions.Begin(),
+ alignmentOffset,
+ 0u,
+ numberOfGlyphs);
+
+ const Length numberOfGlyphsOneLine = 7u;
+ for(Length i = 0; i < numberOfGlyphsOneLine - 1u; i++)
+ {
+ float diffLineNoCharSpacing = positions[i + 1].x - positions[i].x;
+
+ float diffLineCondensedCharSpacing = positions[numberOfGlyphsOneLine + i + 1].x - positions[numberOfGlyphsOneLine + i].x;
+ DALI_TEST_EQUALS(diffLineCondensedCharSpacing, diffLineNoCharSpacing + condensedCharSpacing, Math::MACHINE_EPSILON_1000, TEST_LOCATION);
+
+ float diffLineExpandedCharSpacing = positions[2u * numberOfGlyphsOneLine + i + 1].x - positions[2u * numberOfGlyphsOneLine + i].x;
+ DALI_TEST_EQUALS(diffLineExpandedCharSpacing, diffLineNoCharSpacing + expandedCharSpacing, Math::MACHINE_EPSILON_1000, TEST_LOCATION);
+ }
+
+ END_TEST;
+}
+
+int UtcDaliTextLabelMarkupSpanCharacterSpacing(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliTextLabelMarkupSpanCharacterSpacing ");
+
+ const Length EXPECTED_NUMBER_OF_GLYPHS = 21u;
+
+ const float expandedCharSpacing = 10.0f;
+ const float condensedCharSpacing = -5.0f;
+
+ std::string testText =
+ "<span font-size='20' font-family='DejaVu Sans' font-width='condensed' font-slant='italic' text-color='blue' >ABC EF\n</span>"
+ "<span font-size='20' font-family='DejaVu Sans' font-width='condensed' font-slant='italic' text-color='red' char-space-value='-5.0f'>ABC EF\n</span>"
+ "<span font-size='20' font-family='DejaVu Sans' font-width='condensed' font-slant='italic' text-color='green' char-space-value='10.0f'>ABC EF\n</span>";
+
+ TextLabel textLabel = TextLabel::New();
+
+ textLabel.SetProperty(TextLabel::Property::TEXT, testText);
+ textLabel.SetProperty(TextLabel ::Property::ENABLE_MARKUP, true);
+ textLabel.SetProperty(TextLabel::Property::MULTI_LINE, true);
+
+ application.GetScene().Add(textLabel);
+
+ application.SendNotification();
+ application.Render();
+
+ Toolkit::Internal::TextLabel& textLabelImpl = GetImpl(textLabel);
+ Text::ViewInterface& view = textLabelImpl.GetTextController()->GetView();
+
+ Length numberOfGlyphs = view.GetNumberOfGlyphs();
+
+ DALI_TEST_EQUALS(numberOfGlyphs, EXPECTED_NUMBER_OF_GLYPHS, Math::MACHINE_EPSILON_1000, TEST_LOCATION);
+
+ Vector<GlyphInfo> glyphs;
+ glyphs.Resize(numberOfGlyphs);
+
+ Vector<Vector2> positions;
+ positions.Resize(numberOfGlyphs);
+
+ float alignmentOffset = 0u;
+ numberOfGlyphs = view.GetGlyphs(glyphs.Begin(),
+ positions.Begin(),
+ alignmentOffset,
+ 0u,
+ numberOfGlyphs);
+
+ const Length numberOfGlyphsOneLine = 7u;
+ for(Length i = 0; i < numberOfGlyphsOneLine - 1u; i++)
+ {
+ float diffLineNoCharSpacing = positions[i + 1].x - positions[i].x;
+
+ float diffLineCondensedCharSpacing = positions[numberOfGlyphsOneLine + i + 1].x - positions[numberOfGlyphsOneLine + i].x;
+ DALI_TEST_EQUALS(diffLineCondensedCharSpacing, diffLineNoCharSpacing + condensedCharSpacing, Math::MACHINE_EPSILON_1000, TEST_LOCATION);
+
+ float diffLineExpandedCharSpacing = positions[2u * numberOfGlyphsOneLine + i + 1].x - positions[2u * numberOfGlyphsOneLine + i].x;
+ DALI_TEST_EQUALS(diffLineExpandedCharSpacing, diffLineNoCharSpacing + expandedCharSpacing, Math::MACHINE_EPSILON_1000, TEST_LOCATION);
+ }
+
+ END_TEST;
+}
+
+int UtcDaliTextLabelLocaleChange01(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliTextLabelLocaleChange01");
+
+ Adaptor& adaptor = application.GetAdaptor();
+ TextLabel textLabel = TextLabel::New();
+ application.GetScene().Add(textLabel);
+
+ application.SendNotification();
+ application.Render();
+
+ std::string newLocale = "label_TEST";
+ adaptor.LocaleChangedSignal().Emit(newLocale);
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS(newLocale.data(), GetImpl(textLabel).GetLocale(), TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliTextLabelLocaleChange02(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliTextLabelLocaleChange02");
+
+ // Avoid a crash when core load gl resources.
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
+
+ TextLabel label = TextLabel::New();
+ DALI_TEST_CHECK(label);
+
+ float expectedWidth = 100.0f;
+ float expectedHeight = 100.0f;
+
+ label.SetProperty(DevelTextLabel::Property::RENDER_MODE, DevelTextLabel::Render::ASYNC_AUTO);
+ label.SetProperty(TextLabel::Property::TEXT, "Hello world Hello world");
+ label.SetProperty(Actor::Property::SIZE, Vector2(expectedWidth, expectedHeight));
+ label.SetProperty(TextLabel::Property::POINT_SIZE, 12);
+ label.SetProperty(TextLabel::Property::MULTI_LINE, true);
+ application.GetScene().Add(label);
+
+ // Connect to the async text rendered signal.
+ ConnectionTracker* testTracker = new ConnectionTracker();
+ DevelTextLabel::AsyncTextRenderedSignal(label).Connect(&TestAsyncTextRendered);
+
+ bool asyncTextRendered = false;
+ label.ConnectSignal(testTracker, "asyncTextRendered", CallbackFunctor(&asyncTextRendered));
+
+ gAsyncTextRenderedCalled = false;
+ gAsyncTextRenderedWidth = 0.0f;
+ gAsyncTextRenderedHeight = 0.0f;
+
+ // Request render automatically.
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1, ASYNC_TEXT_THREAD_TIMEOUT), true, TEST_LOCATION);
+
+ DALI_TEST_CHECK(gAsyncTextRenderedCalled);
+ DALI_TEST_CHECK(asyncTextRendered);
+
+ DALI_TEST_EQUALS(expectedWidth, gAsyncTextRenderedWidth, Math::MACHINE_EPSILON_1000, TEST_LOCATION);
+ DALI_TEST_EQUALS(expectedHeight, gAsyncTextRenderedHeight, Math::MACHINE_EPSILON_1000, TEST_LOCATION);
+ DALI_TEST_EQUALS(false, label.GetProperty<bool>(DevelTextLabel::Property::MANUAL_RENDERED), TEST_LOCATION);
+
+ Adaptor& adaptor = application.GetAdaptor();
+
+ application.SendNotification();
+ application.Render();
+
+ std::string newLocale = "label_TEST";
+ adaptor.LocaleChangedSignal().Emit(newLocale);
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS(newLocale.data(), GetImpl(label).GetLocale(), TEST_LOCATION);
+
+ // dummy text for test.
+ TextLabel dummy1 = TextLabel::New();
+ DALI_TEST_CHECK(dummy1);
+ dummy1.SetProperty(DevelTextLabel::Property::RENDER_MODE, DevelTextLabel::Render::ASYNC_MANUAL);
+ dummy1.SetProperty(Actor::Property::SIZE, Vector2(expectedWidth, expectedHeight));
+ dummy1.SetProperty(TextLabel::Property::POINT_SIZE, 20);
+ dummy1.SetProperty(TextLabel::Property::MULTI_LINE, true);
+
+ TextLabel dummy2 = TextLabel::New();
+ DALI_TEST_CHECK(dummy2);
+ dummy2.SetProperty(DevelTextLabel::Property::RENDER_MODE, DevelTextLabel::Render::ASYNC_MANUAL);
+ dummy2.SetProperty(Actor::Property::SIZE, Vector2(expectedWidth, expectedHeight));
+ dummy2.SetProperty(TextLabel::Property::POINT_SIZE, 20);
+ dummy2.SetProperty(TextLabel::Property::MULTI_LINE, true);
+
+ asyncTextRendered = false;
+ gAsyncTextRenderedCalled = false;
+ gAsyncTextRenderedWidth = 0.0f;
+ gAsyncTextRenderedHeight = 0.0f;
+
+ expectedWidth = 50.0f;
+ expectedHeight = 50.0f;
+ float dummySize = 100.0f;
+
+ std::string text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.";
+ dummy1.SetProperty(TextLabel::Property::TEXT, text);
+ dummy2.SetProperty(TextLabel::Property::TEXT, text);
+ label.SetProperty(TextLabel::Property::TEXT, text);
+
+ // Request size computation, due to dummy's requests, text manager's loader queue is full.
+ DevelTextLabel::RequestAsyncNaturalSize(dummy1);
+ DevelTextLabel::RequestAsyncHeightForWidth(dummy1, dummySize);
+ DevelTextLabel::RequestAsyncNaturalSize(dummy2);
+ DevelTextLabel::RequestAsyncHeightForWidth(dummy2, dummySize);
+
+ // Request render.
+ DevelTextLabel::RequestAsyncRenderWithFixedSize(label, expectedWidth, expectedHeight);
+
+ newLocale = "label_TEST_2";
+ adaptor.LocaleChangedSignal().Emit(newLocale);
+
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(5, ASYNC_TEXT_THREAD_TIMEOUT), true, TEST_LOCATION);
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_CHECK(gAsyncTextRenderedCalled);
+ DALI_TEST_CHECK(asyncTextRendered);
+
+ DALI_TEST_EQUALS(expectedWidth, gAsyncTextRenderedWidth, Math::MACHINE_EPSILON_1000, TEST_LOCATION);
+ DALI_TEST_EQUALS(expectedHeight, gAsyncTextRenderedHeight, Math::MACHINE_EPSILON_1000, TEST_LOCATION);
+ DALI_TEST_EQUALS(true, label.GetProperty<bool>(DevelTextLabel::Property::MANUAL_RENDERED), TEST_LOCATION);
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS(newLocale.data(), GetImpl(label).GetLocale(), TEST_LOCATION);
+
+ END_TEST;