X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit-internal%2Futc-Dali-TextEditor-internal.cpp;h=0af3a345fac66c0189036e21bc9295aa7369ae5f;hp=0c55d97eec6b2624ce0b0d616d269610490a2336;hb=41e93476dff5dd7dd826f43e99aa3ef7e3ee2906;hpb=04194fd795542d80b5cf7c1b954ca14593e536d4 diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-TextEditor-internal.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-TextEditor-internal.cpp index 0c55d97..0af3a34 100644 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-TextEditor-internal.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-TextEditor-internal.cpp @@ -87,25 +87,515 @@ int UtcDaliTextEditorMarkupUnderline(void) application.SendNotification(); application.Render(); - uint32_t expectedNumberOfUnderlinedGlyphs = 5u; + uint32_t expectedNumberOfUnderlineRuns = 2u; Toolkit::Internal::TextEditor& textEditorImpl = GetImpl(textEditor); const Text::Length numberOfUnderlineRuns = textEditorImpl.GetTextController()->GetTextModel()->GetNumberOfUnderlineRuns(); - DALI_TEST_EQUALS(numberOfUnderlineRuns, expectedNumberOfUnderlinedGlyphs, TEST_LOCATION); + DALI_TEST_EQUALS(numberOfUnderlineRuns, expectedNumberOfUnderlineRuns, TEST_LOCATION); - Vector underlineRuns; + Vector underlineRuns; underlineRuns.Resize(numberOfUnderlineRuns); textEditorImpl.GetTextController()->GetTextModel()->GetUnderlineRuns(underlineRuns.Begin(), 0u, numberOfUnderlineRuns); //ABC are underlined - DALI_TEST_EQUALS(underlineRuns[0u].glyphIndex, 0u, TEST_LOCATION); - DALI_TEST_EQUALS(underlineRuns[1u].glyphIndex, 1u, TEST_LOCATION); - DALI_TEST_EQUALS(underlineRuns[2u].glyphIndex, 2u, TEST_LOCATION); + DALI_TEST_EQUALS(underlineRuns[0u].glyphRun.glyphIndex, 0u, TEST_LOCATION); + DALI_TEST_EQUALS(underlineRuns[0u].glyphRun.numberOfGlyphs, 3u, TEST_LOCATION); //GH are underlined - DALI_TEST_EQUALS(underlineRuns[3u].glyphIndex, 5u, TEST_LOCATION); - DALI_TEST_EQUALS(underlineRuns[4u].glyphIndex, 6u, TEST_LOCATION); + DALI_TEST_EQUALS(underlineRuns[1u].glyphRun.glyphIndex, 5u, TEST_LOCATION); + DALI_TEST_EQUALS(underlineRuns[1u].glyphRun.numberOfGlyphs, 2u, TEST_LOCATION); + + END_TEST; +} + +int UtcDaliTextEditorMarkupUnderlineAttributes(void) +{ + ToolkitTestApplication application; + tet_infoline(" UtcDaliTextEditorMarkupUnderlineAttributes "); + + TextEditor textEditor = TextEditor::New(); + + application.GetScene().Add(textEditor); + + std::string testText = + "startABC1then" + "ABC2then" + "ABC3then" + "ABC4then" + "ABC5then" + "ABC6then" + "ABC7then" + "ABC8then" + "ABC9end"; + + textEditor.SetProperty(TextEditor::Property::TEXT, testText); + textEditor.SetProperty(TextEditor ::Property::ENABLE_MARKUP, true); + + application.SendNotification(); + application.Render(); + + const uint32_t expectedNumberOfUnderlineRuns = 9u; + + Toolkit::Internal::TextEditor& textEditorImpl = GetImpl(textEditor); + const Text::Length numberOfUnderlineRuns = textEditorImpl.GetTextController()->GetTextModel()->GetNumberOfUnderlineRuns(); + + DALI_TEST_EQUALS(numberOfUnderlineRuns, expectedNumberOfUnderlineRuns, TEST_LOCATION); + + Vector underlineRuns; + underlineRuns.Resize(numberOfUnderlineRuns); + textEditorImpl.GetTextController()->GetTextModel()->GetUnderlineRuns(underlineRuns.Begin(), 0u, numberOfUnderlineRuns); + + struct DataOfCase + { + std::string title; + GlyphIndex glyphIndex; + Length numberOfGlyphs; + UnderlineStyleProperties properties; + }; + DataOfCase data[] = + { + //ABC1 + {"ABC1", + 5u, + 4u, + { + Text::Underline::SOLID, + Color::BLACK, + 0u, + 1u, + 2u, + false, + false, + false, + false, + false, + }}, + + //ABC2 + {"ABC2", + 13u, + 4u, + { + Text::Underline::SOLID, + Color::BLACK, + 0u, + 1u, + 2u, + true, + false, + false, + false, + false, + }}, + + //ABC3 + {"ABC3", + 21u, + 4u, + { + Text::Underline::DASHED, + Color::BLACK, + 0u, + 1u, + 2u, + true, + false, + false, + false, + false, + }}, + + //ABC4 + {"ABC4", + 29u, + 4u, + { + Text::Underline::DOUBLE, + Color::BLACK, + 0u, + 1u, + 2u, + true, + false, + false, + false, + false, + }}, + + //ABC5 + {"ABC5", + 37u, + 4u, + { + Text::Underline::SOLID, + Color::GREEN, + 0u, + 1u, + 2u, + false, + true, + false, + false, + false, + }}, + + //ABC6 + {"ABC6", + 45u, + 4u, + { + Text::Underline::SOLID, + Color::BLACK, + 5u, + 1u, + 2u, + false, + false, + true, + false, + false, + }}, + + //ABC7 + {"ABC7", + 53u, + 4u, + { + Text::Underline::DASHED, + Color::BLACK, + 0u, + 3u, + 2u, + true, + false, + false, + true, + false, + }}, + + //ABC8 + {"ABC8", + 61u, + 4u, + { + Text::Underline::DASHED, + Color::BLACK, + 0u, + 1u, + 4u, + true, + false, + false, + false, + true, + }}, + + // + {"", + 69u, + 4u, + { + Text::Underline::DASHED, + Color::BLUE, + 4u, + 2u, + 3u, + true, + true, + true, + true, + true, + }}, + + }; + + for(uint32_t i = 0; i < expectedNumberOfUnderlineRuns; i++) + { + tet_infoline(data[i].title.c_str()); + DALI_TEST_EQUALS(underlineRuns[i].glyphRun.glyphIndex, data[i].glyphIndex, TEST_LOCATION); + DALI_TEST_EQUALS(underlineRuns[i].glyphRun.numberOfGlyphs, data[i].numberOfGlyphs, TEST_LOCATION); + DALI_TEST_CHECK(data[i].properties == underlineRuns[i].properties); + } + + END_TEST; +} + +int UtcDaliTextEditorMarkupSpanUnderline(void) +{ + ToolkitTestApplication application; + tet_infoline(" UtcDaliTextEditorMarkupSpanUnderline "); + + TextEditor textEditor = TextEditor::New(); + + application.GetScene().Add(textEditor); + + std::string testText = + "startABC1then" + "ABC2then" + "ABC3then" + "ABC4then" + "ABC5then" + "ABC6then" + "ABC7then" + "ABC8then" + "ABC9end"; + + textEditor.SetProperty(TextEditor::Property::TEXT, testText); + textEditor.SetProperty(TextEditor ::Property::ENABLE_MARKUP, true); + + application.SendNotification(); + application.Render(); + + const uint32_t expectedNumberOfUnderlineRuns = 8u; + + Toolkit::Internal::TextEditor& textEditorImpl = GetImpl(textEditor); + const Text::Length numberOfUnderlineRuns = textEditorImpl.GetTextController()->GetTextModel()->GetNumberOfUnderlineRuns(); + + DALI_TEST_EQUALS(numberOfUnderlineRuns, expectedNumberOfUnderlineRuns, TEST_LOCATION); + + Vector underlineRuns; + underlineRuns.Resize(numberOfUnderlineRuns); + textEditorImpl.GetTextController()->GetTextModel()->GetUnderlineRuns(underlineRuns.Begin(), 0u, numberOfUnderlineRuns); + + struct DataOfCase + { + std::string title; + GlyphIndex glyphIndex; + Length numberOfGlyphs; + UnderlineStyleProperties properties; + }; + DataOfCase data[] = + { + //ABC2 + {"ABC2", + 13u, + 4u, + { + Text::Underline::SOLID, + Color::BLACK, + 0u, + 1u, + 2u, + true, + false, + false, + false, + false, + }}, + + //ABC3 + {"ABC3", + 21u, + 4u, + { + Text::Underline::DASHED, + Color::BLACK, + 0u, + 1u, + 2u, + true, + false, + false, + false, + false, + }}, + + //ABC4 + {"ABC4", + 29u, + 4u, + { + Text::Underline::DOUBLE, + Color::BLACK, + 0u, + 1u, + 2u, + true, + false, + false, + false, + false, + }}, + + //ABC5 + {"ABC5", + 37u, + 4u, + { + Text::Underline::SOLID, + Color::GREEN, + 0u, + 1u, + 2u, + false, + true, + false, + false, + false, + }}, + + //ABC6 + {"ABC6", + 45u, + 4u, + { + Text::Underline::SOLID, + Color::BLACK, + 5u, + 1u, + 2u, + false, + false, + true, + false, + false, + }}, + + //ABC7 + {"ABC7", + 53u, + 4u, + { + Text::Underline::DASHED, + Color::BLACK, + 0u, + 3u, + 2u, + true, + false, + false, + true, + false, + }}, + + //ABC8 + {"ABC8", + 61u, + 4u, + { + Text::Underline::DASHED, + Color::BLACK, + 0u, + 1u, + 4u, + true, + false, + false, + false, + true, + }}, + + // + {"ABC9", + 69u, + 4u, + { + Text::Underline::DASHED, + Color::BLUE, + 4u, + 2u, + 3u, + true, + true, + true, + true, + true, + }}, + + }; + + for(uint32_t i = 0; i < expectedNumberOfUnderlineRuns; i++) + { + tet_infoline(data[i].title.c_str()); + DALI_TEST_EQUALS(underlineRuns[i].glyphRun.glyphIndex, data[i].glyphIndex, TEST_LOCATION); + DALI_TEST_EQUALS(underlineRuns[i].glyphRun.numberOfGlyphs, data[i].numberOfGlyphs, TEST_LOCATION); + DALI_TEST_CHECK(data[i].properties == underlineRuns[i].properties); + } + + END_TEST; +} + +int UtcDaliTextEditorMarkupNestedUnderlineTags(void) +{ + ToolkitTestApplication application; + tet_infoline(" UtcDaliTextEditorMarkupNestedUnderlineTags "); + + TextEditor textEditor = TextEditor::New(); + + application.GetScene().Add(textEditor); + + std::string testText = "startABXYZCDEend"; + + textEditor.SetProperty(TextEditor::Property::TEXT, testText); + textEditor.SetProperty(TextEditor ::Property::ENABLE_MARKUP, true); + + application.SendNotification(); + application.Render(); + + const uint32_t expectedNumberOfUnderlineRuns = 2u; + + Toolkit::Internal::TextEditor& textEditorImpl = GetImpl(textEditor); + const Text::Length numberOfUnderlineRuns = textEditorImpl.GetTextController()->GetTextModel()->GetNumberOfUnderlineRuns(); + + DALI_TEST_EQUALS(numberOfUnderlineRuns, expectedNumberOfUnderlineRuns, TEST_LOCATION); + + Vector underlineRuns; + underlineRuns.Resize(numberOfUnderlineRuns); + textEditorImpl.GetTextController()->GetTextModel()->GetUnderlineRuns(underlineRuns.Begin(), 0u, numberOfUnderlineRuns); + + struct DataOfCase + { + std::string title; + GlyphIndex glyphIndex; + Length numberOfGlyphs; + UnderlineStyleProperties properties; + }; + DataOfCase data[] = + { + //Outter + {"ABXYZCDE", + 5u, + 8u, + { + Text::Underline::SOLID, + Color::GREEN, + 5u, + 1u, + 2u, + false, + true, + true, + false, + false, + }}, + + //Inner + {"XYZ", + 7u, + 3u, + { + Text::Underline::SOLID, + Color::BLUE, + 5u, + 1u, + 2u, + false, + true, + true, + false, + false, + }}, + + }; + + for(uint32_t i = 0; i < expectedNumberOfUnderlineRuns; i++) + { + tet_infoline(data[i].title.c_str()); + DALI_TEST_EQUALS(underlineRuns[i].glyphRun.glyphIndex, data[i].glyphIndex, TEST_LOCATION); + DALI_TEST_EQUALS(underlineRuns[i].glyphRun.numberOfGlyphs, data[i].numberOfGlyphs, TEST_LOCATION); + DALI_TEST_CHECK(data[i].properties == underlineRuns[i].properties); + } END_TEST; } @@ -199,6 +689,37 @@ int UtcDaliTextEditorBackgroundTag(void) END_TEST; } +int UtcDaliTextEditorSpanBackgroundTag(void) +{ + ToolkitTestApplication application; + tet_infoline("UtcDaliTextEditorSpanBackgroundTag\n"); + + TextEditor editor = TextEditor::New(); + DALI_TEST_CHECK(editor); + + editor.SetProperty(TextEditor ::Property::ENABLE_MARKUP, true); + editor.SetProperty(TextEditor::Property::TEXT, "He World"); + application.GetScene().Add(editor); + application.SendNotification(); + application.Render(); + + Toolkit::Internal::TextEditor& editorImpl = GetImpl(editor); + const ColorIndex* const backgroundColorIndicesBuffer = editorImpl.GetTextController()->GetTextModel()->GetBackgroundColorIndices(); + + DALI_TEST_CHECK(backgroundColorIndicesBuffer); + + //default color + DALI_TEST_EQUALS(backgroundColorIndicesBuffer[0], 0u, TEST_LOCATION); + + //red color + DALI_TEST_EQUALS(backgroundColorIndicesBuffer[1], 1u, TEST_LOCATION); + + //yellow color + DALI_TEST_EQUALS(backgroundColorIndicesBuffer[7], 2u, TEST_LOCATION); + + END_TEST; +} + int UtcDaliTextEditorTextWithSpan(void) { ToolkitTestApplication application; @@ -376,3 +897,195 @@ int UtcDaliTextEditorMarkupStrikethrough(void) END_TEST; } + +int UtcDaliTextEditorMarkupStrikethroughNoEndTag(void) +{ + ToolkitTestApplication application; + tet_infoline(" UtcDaliTextEditorMarkupStrikethroughNoEndTag "); + + TextEditor textEditor = TextEditor::New(); + + application.GetScene().Add(textEditor); + + textEditor.SetProperty(TextEditor::Property::TEXT, "ABC"); + textEditor.SetProperty(TextEditor ::Property::ENABLE_MARKUP, true); + + application.SendNotification(); + application.Render(); + + uint32_t expectedNumberOfStrikethroughGlyphs = 0u; + + Toolkit::Internal::TextEditor& textEditorImpl = GetImpl(textEditor); + Text::Length numberOfStrikethroughRuns = textEditorImpl.GetTextController()->GetTextModel()->GetNumberOfStrikethroughRuns(); + + DALI_TEST_EQUALS(numberOfStrikethroughRuns, expectedNumberOfStrikethroughGlyphs, TEST_LOCATION); + + END_TEST; +} + +int UtcDaliTextEditorMarkupParagraphTag(void) + +{ + ToolkitTestApplication application; + tet_infoline(" UtcDaliTextEditorMarkupParagraphTag "); + + TextEditor textEditor = TextEditor::New(); + application.GetScene().Add(textEditor); + + textEditor.SetProperty(TextEditor::Property::TEXT, "text one

Paragraph two

text three

Paragraph four

text five"); + textEditor.SetProperty(TextEditor ::Property::ENABLE_MARKUP, true); + + application.SendNotification(); + application.Render(); + + uint32_t expectedNumberOfBoundedParagraphRuns = 2u; + + Toolkit::Internal::TextEditor& textEditorImpl = GetImpl(textEditor); + const Text::Length numberOfBoundedParagraphRuns = textEditorImpl.GetTextController()->GetTextModel()->GetNumberOfBoundedParagraphRuns(); + DALI_TEST_EQUALS(numberOfBoundedParagraphRuns, expectedNumberOfBoundedParagraphRuns, TEST_LOCATION); + + const Vector& boundedParagraphRuns = textEditorImpl.GetTextController()->GetTextModel()->GetBoundedParagraphRuns(); + + //

Paragraph two

+ DALI_TEST_EQUALS(boundedParagraphRuns[0u].characterRun.characterIndex, 10u, TEST_LOCATION); + DALI_TEST_EQUALS(boundedParagraphRuns[0u].characterRun.numberOfCharacters, 14u, TEST_LOCATION); + + //

Paragraph four

+ DALI_TEST_EQUALS(boundedParagraphRuns[1u].characterRun.characterIndex, 37u, TEST_LOCATION); + DALI_TEST_EQUALS(boundedParagraphRuns[1u].characterRun.numberOfCharacters, 15u, TEST_LOCATION); + + END_TEST; +} + +int UtcDaliTextEditorMarkupParagraphTagAlignAttribute(void) +{ + ToolkitTestApplication application; + tet_infoline(" UtcDaliTextEditorMarkupParagraphTagAlignAttribute "); + + // 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

Paragraph end

text outside

Paragraph center

text outside

Paragraph begin

Paragraph property alignment

"; + std::string textAlignInMarkup = "text outside

Paragraph end

text outside

Paragraph center

text outside

Paragraph begin

Paragraph property alignment

"; + + //Set size to avoid automatic eliding + Vector2 controllerSize = Vector2(1025, 1025); + + TextEditor textEditorBeginAlign = TextEditor::New(); + TextEditor textEditorCenterAlign = TextEditor::New(); + TextEditor textEditorEndAlign = TextEditor::New(); + TextEditor textEditorMultiAlign = TextEditor::New(); + + application.GetScene().Add(textEditorBeginAlign); + application.GetScene().Add(textEditorCenterAlign); + application.GetScene().Add(textEditorEndAlign); + application.GetScene().Add(textEditorMultiAlign); + + textEditorBeginAlign.SetProperty(TextEditor::Property::TEXT, textAlignOnPropertyLevel); + textEditorBeginAlign.SetProperty(TextEditor ::Property::ENABLE_MARKUP, true); + textEditorBeginAlign.SetProperty(DevelTextEditor::Property::ELLIPSIS, false); + textEditorBeginAlign.SetProperty(TextEditor::Property::HORIZONTAL_ALIGNMENT, Dali::Toolkit::Text::HorizontalAlignment::BEGIN); + textEditorBeginAlign.SetProperty(Actor::Property::SIZE, controllerSize); + + textEditorCenterAlign.SetProperty(TextEditor::Property::TEXT, textAlignOnPropertyLevel); + textEditorCenterAlign.SetProperty(TextEditor ::Property::ENABLE_MARKUP, true); + textEditorCenterAlign.SetProperty(DevelTextEditor::Property::ELLIPSIS, false); + textEditorCenterAlign.SetProperty(TextEditor::Property::HORIZONTAL_ALIGNMENT, Dali::Toolkit::Text::HorizontalAlignment::CENTER); + textEditorCenterAlign.SetProperty(Actor::Property::SIZE, controllerSize); + + textEditorEndAlign.SetProperty(TextEditor::Property::TEXT, textAlignOnPropertyLevel); + textEditorEndAlign.SetProperty(TextEditor ::Property::ENABLE_MARKUP, true); + textEditorEndAlign.SetProperty(DevelTextEditor::Property::ELLIPSIS, false); + textEditorEndAlign.SetProperty(TextEditor::Property::HORIZONTAL_ALIGNMENT, Dali::Toolkit::Text::HorizontalAlignment::END); + textEditorEndAlign.SetProperty(Actor::Property::SIZE, controllerSize); + + textEditorMultiAlign.SetProperty(TextEditor::Property::TEXT, textAlignInMarkup); + textEditorMultiAlign.SetProperty(TextEditor ::Property::ENABLE_MARKUP, true); + textEditorMultiAlign.SetProperty(DevelTextEditor::Property::ELLIPSIS, false); + textEditorMultiAlign.SetProperty(TextEditor::Property::HORIZONTAL_ALIGNMENT, Dali::Toolkit::Text::HorizontalAlignment::CENTER); + textEditorMultiAlign.SetProperty(Actor::Property::SIZE, controllerSize); + + application.SendNotification(); + application.Render(); + + uint32_t expectedNumberOfBoundedParagraphRuns = 4u; + uint32_t expectedNumberOfLines = 7u; + + Toolkit::Internal::TextEditor& textEditorMultiAlignImpl = GetImpl(textEditorMultiAlign); + Toolkit::Internal::TextEditor& textEditorBeginAlignImpl = GetImpl(textEditorBeginAlign); + Toolkit::Internal::TextEditor& textEditorCenterAlignImpl = GetImpl(textEditorCenterAlign); + Toolkit::Internal::TextEditor& textEditorEndAlignImpl = GetImpl(textEditorEndAlign); + + const Text::Length numberOfBoundedParagraphRuns = textEditorMultiAlignImpl.GetTextController()->GetTextModel()->GetNumberOfBoundedParagraphRuns(); + DALI_TEST_EQUALS(numberOfBoundedParagraphRuns, expectedNumberOfBoundedParagraphRuns, TEST_LOCATION); + + DALI_TEST_EQUALS(textEditorMultiAlignImpl.GetTextController()->GetTextModel()->GetNumberOfLines(), expectedNumberOfLines, TEST_LOCATION); + DALI_TEST_CHECK(textEditorMultiAlignImpl.GetTextController()->GetTextModel()->GetLines()); + + DALI_TEST_EQUALS(textEditorBeginAlignImpl.GetTextController()->GetTextModel()->GetNumberOfLines(), expectedNumberOfLines, TEST_LOCATION); + DALI_TEST_CHECK(textEditorBeginAlignImpl.GetTextController()->GetTextModel()->GetLines()); + + DALI_TEST_EQUALS(textEditorCenterAlignImpl.GetTextController()->GetTextModel()->GetNumberOfLines(), expectedNumberOfLines, TEST_LOCATION); + DALI_TEST_CHECK(textEditorCenterAlignImpl.GetTextController()->GetTextModel()->GetLines()); + + DALI_TEST_EQUALS(textEditorEndAlignImpl.GetTextController()->GetTextModel()->GetNumberOfLines(), expectedNumberOfLines, TEST_LOCATION); + DALI_TEST_CHECK(textEditorEndAlignImpl.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; + + //

Paragraph end

+ const LineRun& lineEndFromMultiAlign = *(textEditorMultiAlignImpl.GetTextController()->GetTextModel()->GetLines() + LINE_INDEX_ALIGN_END); + const LineRun& lineEndFromEndAlign = *(textEditorEndAlignImpl.GetTextController()->GetTextModel()->GetLines() + LINE_INDEX_ALIGN_END); + tet_infoline(" UtcDaliTextEditorMarkupParagraphTagAlignAttribute -

Paragraph end

"); + DALI_TEST_EQUALS(lineEndFromMultiAlign.alignmentOffset, lineEndFromEndAlign.alignmentOffset, TEST_LOCATION); + DALI_TEST_EQUALS(lineEndFromMultiAlign.width, lineEndFromEndAlign.width, TEST_LOCATION); + + //

Paragraph center

+ const LineRun& lineCenterFromMultiAlign = *(textEditorMultiAlignImpl.GetTextController()->GetTextModel()->GetLines() + LINE_INDEX_ALIGN_CENTER); + const LineRun& lineEndFromCenterAlign = *(textEditorCenterAlignImpl.GetTextController()->GetTextModel()->GetLines() + LINE_INDEX_ALIGN_CENTER); + tet_infoline(" UtcDaliTextEditorMarkupParagraphTagAlignAttribute -

Paragraph center

"); + DALI_TEST_EQUALS(lineCenterFromMultiAlign.alignmentOffset, lineEndFromCenterAlign.alignmentOffset, TEST_LOCATION); + DALI_TEST_EQUALS(lineCenterFromMultiAlign.width, lineEndFromCenterAlign.width, TEST_LOCATION); + + //

Paragraph begin

+ const LineRun& lineBeginFromMultiAlign = *(textEditorMultiAlignImpl.GetTextController()->GetTextModel()->GetLines() + LINE_INDEX_ALIGN_BEGIN); + const LineRun& lineEndFromBeginAlign = *(textEditorBeginAlignImpl.GetTextController()->GetTextModel()->GetLines() + LINE_INDEX_ALIGN_BEGIN); + tet_infoline(" UtcDaliTextEditorMarkupParagraphTagAlignAttribute -

Paragraph begin

"); + DALI_TEST_EQUALS(lineBeginFromMultiAlign.alignmentOffset, lineEndFromBeginAlign.alignmentOffset, TEST_LOCATION); + DALI_TEST_EQUALS(lineBeginFromMultiAlign.width, lineEndFromBeginAlign.width, TEST_LOCATION); + + //text outside + const LineRun& lineOutsideOneFromMultiAlign = *(textEditorMultiAlignImpl.GetTextController()->GetTextModel()->GetLines() + LINE_INDEX_OUTSIDE_1); + const LineRun& lineOutsideOneFromCenterAlign = *(textEditorCenterAlignImpl.GetTextController()->GetTextModel()->GetLines() + LINE_INDEX_OUTSIDE_1); + tet_infoline(" UtcDaliTextEditorMarkupParagraphTagAlignAttribute - text outside one"); + DALI_TEST_EQUALS(lineOutsideOneFromMultiAlign.alignmentOffset, lineOutsideOneFromCenterAlign.alignmentOffset, TEST_LOCATION); + DALI_TEST_EQUALS(lineOutsideOneFromMultiAlign.width, lineOutsideOneFromCenterAlign.width, TEST_LOCATION); + + const LineRun& lineOutsideTwoFromMultiAlign = *(textEditorMultiAlignImpl.GetTextController()->GetTextModel()->GetLines() + LINE_INDEX_OUTSIDE_2); + const LineRun& lineOutsideTwoFromCenterAlign = *(textEditorCenterAlignImpl.GetTextController()->GetTextModel()->GetLines() + LINE_INDEX_OUTSIDE_2); + tet_infoline(" UtcDaliTextEditorMarkupParagraphTagAlignAttribute - text outside two"); + DALI_TEST_EQUALS(lineOutsideTwoFromMultiAlign.alignmentOffset, lineOutsideTwoFromCenterAlign.alignmentOffset, TEST_LOCATION); + DALI_TEST_EQUALS(lineOutsideTwoFromMultiAlign.width, lineOutsideTwoFromCenterAlign.width, TEST_LOCATION); + + const LineRun& lineOutsideThreeFromMultiAlign = *(textEditorMultiAlignImpl.GetTextController()->GetTextModel()->GetLines() + LINE_INDEX_OUTSIDE_3); + const LineRun& lineOutsideThreeFromCenterAlign = *(textEditorCenterAlignImpl.GetTextController()->GetTextModel()->GetLines() + LINE_INDEX_OUTSIDE_3); + tet_infoline(" UtcDaliTextEditorMarkupParagraphTagAlignAttribute - text outside three"); + DALI_TEST_EQUALS(lineOutsideThreeFromMultiAlign.alignmentOffset, lineOutsideThreeFromCenterAlign.alignmentOffset, TEST_LOCATION); + DALI_TEST_EQUALS(lineOutsideThreeFromMultiAlign.width, lineOutsideThreeFromCenterAlign.width, TEST_LOCATION); + + const LineRun& lineParagraphFromMultiAlign = *(textEditorMultiAlignImpl.GetTextController()->GetTextModel()->GetLines() + LINE_INDEX_PARAGRAPH); + const LineRun& lineParagraphFromCenterAlign = *(textEditorCenterAlignImpl.GetTextController()->GetTextModel()->GetLines() + LINE_INDEX_PARAGRAPH); + tet_infoline(" UtcDaliTextEditorMarkupParagraphTagAlignAttribute -

Paragraph property alignment

"); + DALI_TEST_EQUALS(lineParagraphFromMultiAlign.alignmentOffset, lineParagraphFromCenterAlign.alignmentOffset, TEST_LOCATION); + DALI_TEST_EQUALS(lineParagraphFromMultiAlign.width, lineParagraphFromCenterAlign.width, TEST_LOCATION); + + END_TEST; +}