+
+int UtcDaliTextEditorTextSizeNegativeLineSpacing(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliTextEditorTextSizeNegativeLineSpacing");
+
+ TextEditor editor = TextEditor::New();
+
+ float lineSpacing = -20.f;
+
+ editor.SetProperty(Actor::Property::SIZE, Vector2(450.0f, 300.f));
+ editor.SetProperty(TextEditor::Property::POINT_SIZE, 10.f);
+ editor.SetProperty(DevelTextEditor::Property::LINE_SPACING, lineSpacing);
+ editor.SetProperty(TextEditor::Property::TEXT, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.");
+
+ application.GetScene().Add(editor);
+ application.SendNotification();
+ application.Render();
+
+ Vector<Vector2> positionsList = DevelTextEditor::GetTextPosition(editor, 0, 123);
+ Vector<Vector2> sizeList = DevelTextEditor::GetTextSize(editor, 0, 123);
+
+ Vector2 lastLinePos = positionsList[positionsList.Size() - 1];
+ Vector2 lastLineSize = sizeList[sizeList.Size() - 1];
+
+ DALI_TEST_EQUALS(sizeList[0].y * (sizeList.Size() - 1), lastLinePos.y, Math::MACHINE_EPSILON_1000, TEST_LOCATION);
+ DALI_TEST_EQUALS(sizeList[0].y - lineSpacing, lastLineSize.y, Math::MACHINE_EPSILON_1000, TEST_LOCATION);
+
+ application.SendNotification();
+ application.Render();
+
+ END_TEST;
+}
+
+int UtcDaliTextEditorLineSpacingKeyArrowDown(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliTextEditorLineSpacingKeyArrowDown");
+
+ TextEditor editor = TextEditor::New();
+ DALI_TEST_CHECK(editor);
+
+ application.GetScene().Add(editor);
+
+ std::string cutText = "";
+ std::string copiedText = "";
+
+ editor.SetProperty(TextEditor::Property::TEXT, "l1\nl2\nl3\n4");
+ editor.SetProperty(TextEditor::Property::POINT_SIZE, 10.f);
+ editor.SetProperty(Actor::Property::SIZE, Vector2(300.f, 200.f));
+ editor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ editor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ editor.SetProperty(TextEditor::Property::ENABLE_MARKUP, true);
+ editor.SetProperty(TextEditor::Property::LINE_SPACING, -15);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Tap on the text editor
+ TestGenerateTap(application, 1.0f, 1.0f);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Move to second line of the text.
+ application.ProcessEvent(GenerateKey("", "", "", DALI_KEY_CURSOR_DOWN, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS(editor.GetProperty(DevelTextEditor::Property::PRIMARY_CURSOR_POSITION).Get<int>(), 3, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliTextEditorNegativeLineSpacingWithEllipsis(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliTextEditorNegativeLineSpacingWithEllipsis");
+
+ TextEditor editor = TextEditor::New();
+
+ float lineSpacing = -20.f;
+
+ editor.SetProperty(Actor::Property::SIZE, Vector2(480.0f, 100.f));
+ editor.SetProperty(TextEditor::Property::POINT_SIZE, 11.0f);
+ editor.SetProperty(DevelTextEditor::Property::LINE_SPACING, lineSpacing);
+ editor.SetProperty(TextEditor::Property::TEXT, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.");
+ editor.SetProperty(DevelTextEditor::Property::ELLIPSIS, true);
+
+ application.GetScene().Add(editor);
+ application.SendNotification();
+ application.Render();
+
+ Vector<Vector2> sizeList = DevelTextEditor::GetTextSize(editor, 0, 123);
+
+ int lineCount = sizeList.Size();
+ DALI_TEST_EQUALS(4, lineCount, TEST_LOCATION);
+
+ application.SendNotification();
+ application.Render();
+
+ END_TEST;
+}
+
+int UtcDaliToolkitTexteditorParagraphTag(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliToolkitTexteditorParagraphTag");
+ TextEditor editorNewlineSeparator = TextEditor::New();
+ TextEditor editorParagraphTag = TextEditor::New();
+ DALI_TEST_CHECK(editorNewlineSeparator);
+ DALI_TEST_CHECK(editorParagraphTag);
+
+ application.GetScene().Add(editorNewlineSeparator);
+ application.GetScene().Add(editorParagraphTag);
+
+ //Same utterance uses new-line to split paragraphs should give similar results for paragraph tag.
+ editorNewlineSeparator.SetProperty(TextEditor::Property::ENABLE_MARKUP, true);
+ editorNewlineSeparator.SetProperty(Actor::Property::SIZE, Vector2(100.f, 50.f));
+ editorNewlineSeparator.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ editorNewlineSeparator.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ editorNewlineSeparator.SetProperty(TextEditor::Property::TEXT, "test paragraph tag \ntest paragraph tag \ntest paragraph tag ");
+
+ editorParagraphTag.SetProperty(TextEditor::Property::ENABLE_MARKUP, true);
+ editorParagraphTag.SetProperty(Actor::Property::SIZE, Vector2(100.f, 50.f));
+ editorParagraphTag.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ editorParagraphTag.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ editorParagraphTag.SetProperty(TextEditor::Property::TEXT, "test paragraph tag <p>test paragraph tag </p>test paragraph tag ");
+
+ application.SendNotification();
+ application.Render();
+
+ Vector3 textNaturalSizeNewlineSeparator = editorNewlineSeparator.GetNaturalSize();
+ Vector3 textNaturalSizeParagraphTag = editorParagraphTag.GetNaturalSize();
+
+ DALI_TEST_EQUALS(textNaturalSizeNewlineSeparator, textNaturalSizeParagraphTag, TEST_LOCATION);
+
+ application.SendNotification();
+ application.Render();
+
+ END_TEST;
+}
+
+//Handle Emoji clustering for cursor handling
+int utcDaliTextEditorClusteredEmojiDeletionBackSpaceKey(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" utcDaliTextEditorClusteredEmojiDeletionBackSpaceKey ");
+ TextEditor textEditor = TextEditor::New();
+ DALI_TEST_CHECK(textEditor);
+
+ application.GetScene().Add(textEditor);
+
+ // Avoid a crash when core load gl resources.
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
+
+ textEditor.SetProperty(TextEditor::Property::TEXT, "ABC👨‍👩‍👧‍👦XY");
+ textEditor.SetProperty(Dali::Toolkit::TextEditor::Property::ENABLE_MARKUP, true);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Set currsor
+ textEditor.SetProperty(DevelTextEditor::Property::PRIMARY_CURSOR_POSITION, 10);
+ application.SendNotification();
+ application.Render();
+
+ // Set focus and remove Emoji
+ textEditor.SetKeyInputFocus();
+ application.ProcessEvent(GenerateKey("", "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+
+ //Check the changed text and cursor position
+ DALI_TEST_EQUALS(textEditor.GetProperty(TextEditor::Property::TEXT).Get<std::string>(), "ABCXY", TEST_LOCATION);
+ DALI_TEST_EQUALS(textEditor.GetProperty(DevelTextEditor::Property::PRIMARY_CURSOR_POSITION).Get<int>(), 3, TEST_LOCATION);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ END_TEST;
+}
+
+int utcDaliTextEditorClusteredEmojiDeletionDeleteKey(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" utcDaliTextEditorClusteredEmojiDeletionDeleteKey ");
+ TextEditor textEditor = TextEditor::New();
+ DALI_TEST_CHECK(textEditor);
+
+ application.GetScene().Add(textEditor);
+
+ // Avoid a crash when core load gl resources.
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
+
+ textEditor.SetProperty(TextEditor::Property::TEXT, "ABC👨‍👩‍👧‍👦XY");
+ textEditor.SetProperty(Dali::Toolkit::TextEditor::Property::ENABLE_MARKUP, true);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Set currsor
+ textEditor.SetProperty(DevelTextEditor::Property::PRIMARY_CURSOR_POSITION, 3);
+ application.SendNotification();
+ application.Render();
+
+ // Set focus and remove Emoji
+ textEditor.SetKeyInputFocus();
+ application.ProcessEvent(GenerateKey("", "", "", Dali::DevelKey::DALI_KEY_DELETE, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+
+ //Check the changed text and cursor position
+ DALI_TEST_EQUALS(textEditor.GetProperty(TextEditor::Property::TEXT).Get<std::string>(), "ABCXY", TEST_LOCATION);
+ DALI_TEST_EQUALS(textEditor.GetProperty(DevelTextEditor::Property::PRIMARY_CURSOR_POSITION).Get<int>(), 3, TEST_LOCATION);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ END_TEST;
+}
\ No newline at end of file