+}
+
+int UtcDaliToolkitTextEditorStrikethroughGeneration(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliToolkitTextEditorStrikethroughGeneration");
+
+ TextEditor textEditor = TextEditor::New();
+ textEditor.SetProperty(TextEditor::Property::TEXT, "Test");
+ textEditor.SetProperty(Actor::Property::SIZE, Vector2(200.0f, 100.f));
+ textEditor.SetProperty(TextEditor::Property::POINT_SIZE, 10);
+ textEditor.SetProperty(TextEditor::Property::FONT_FAMILY, "DejaVu Sans");
+
+ application.GetScene().Add(textEditor);
+ application.SendNotification();
+ application.Render();
+
+ Property::Map strikethroughMapSet;
+ Property::Map strikethroughMapGet;
+
+ strikethroughMapSet.Insert("enable", true);
+ strikethroughMapSet.Insert("color", Color::RED);
+ strikethroughMapSet.Insert("height", 2.0f);
+
+ // Check the strikethrough property
+ textEditor.SetProperty(DevelTextEditor::Property::STRIKETHROUGH, strikethroughMapSet);
+ strikethroughMapGet = textEditor.GetProperty<Property::Map>(DevelTextEditor::Property::STRIKETHROUGH);
+ textEditor.SetProperty(TextEditor::Property::TEXT, "Test1");
+ DALI_TEST_EQUALS(strikethroughMapGet.Count(), strikethroughMapSet.Count(), TEST_LOCATION);
+ DALI_TEST_EQUALS(DaliTestCheckMaps(strikethroughMapGet, strikethroughMapSet), true, TEST_LOCATION);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ strikethroughMapSet.Clear();
+ strikethroughMapGet.Clear();
+
+ END_TEST;
+}
+
+int utcDaliTextEditorInsertCharacterAfterInitWithResizePolicyNaturalSize(void)
+{
+ //This is to test a crash when used Resize Policy equals USE_NATURAL_SIZE
+ //DaliException on vector: "Iterator not inside vector"
+
+ ToolkitTestApplication application;
+ tet_infoline(" utcDaliTextEditorInsertCharacterAfterInitWithResizePolicyNaturalSize");
+
+ TextEditor editor = TextEditor::New();
+ DALI_TEST_CHECK(editor);
+
+ application.GetScene().Add(editor);
+
+ // Avoid a crash when core load gl resources.
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
+
+ //Set multilines text
+ editor.SetProperty(Dali::Toolkit::TextEditor::Property::TEXT, "Hello \n World");
+ editor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ editor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+
+ //Set ResizePolicy to NaturalSize
+ editor.SetProperty(Dali::Actor::Property::WIDTH_RESIZE_POLICY, ResizePolicy::USE_NATURAL_SIZE);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Create a tap event to touch the text editor.
+ TestGenerateTap(application, 5.0f, 5.0f);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Set currsor and add character (in first line)
+ editor.SetProperty(DevelTextEditor::Property::PRIMARY_CURSOR_POSITION, 5);
+ application.ProcessEvent(GenerateKey("d", "", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::DOWN, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+ application.ProcessEvent(GenerateKey("d", "", "d", KEY_D_CODE, 0, 0, Integration::KeyEvent::UP, "d", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ //Check the changed text and cursor position
+ DALI_TEST_EQUALS(editor.GetProperty(TextEditor::Property::TEXT).Get<std::string>(), "Hellod \n World", TEST_LOCATION);
+ DALI_TEST_EQUALS(editor.GetProperty(DevelTextEditor::Property::PRIMARY_CURSOR_POSITION).Get<int>(), 6, TEST_LOCATION);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ END_TEST;
+}
+
+int utcDaliTextEditorRemoveCharacterAfterInitWithResizePolicyNaturalSize(void)
+{
+ //This is to test a crash when used Resize Policy equals USE_NATURAL_SIZE
+ //DaliException on vector: "Iterator not inside vector"
+
+ ToolkitTestApplication application;
+ tet_infoline(" utcDaliTextEditorRemoveCharacterAfterInitWithResizePolicyNaturalSize");
+
+ TextEditor editor = TextEditor::New();
+ DALI_TEST_CHECK(editor);
+
+ application.GetScene().Add(editor);
+
+ // Avoid a crash when core load gl resources.
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
+
+ //Set multilines text
+ editor.SetProperty(Dali::Toolkit::TextEditor::Property::TEXT, "Hello \n World");
+ editor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ editor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+
+ //Set ResizePolicy to NaturalSize
+ editor.SetProperty(Dali::Actor::Property::WIDTH_RESIZE_POLICY, ResizePolicy::USE_NATURAL_SIZE);
+
+ // Set currsor
+ editor.SetProperty(DevelTextEditor::Property::PRIMARY_CURSOR_POSITION, 5);
+ application.SendNotification();
+ application.Render();
+
+ // Set focus and remove character
+ editor.SetKeyInputFocus();
+ application.ProcessEvent(GenerateKey("", "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ //Check the changed text and cursor position
+ DALI_TEST_EQUALS(editor.GetProperty(TextEditor::Property::TEXT).Get<std::string>(), "Hell \n World", TEST_LOCATION);
+ DALI_TEST_EQUALS(editor.GetProperty(DevelTextEditor::Property::PRIMARY_CURSOR_POSITION).Get<int>(), 4, TEST_LOCATION);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ END_TEST;
+}
+
+int utcDaliTextEditorCutSelectedTextAfterInitWithResizePolicyNaturalSize(void)
+{
+ //This is to test a crash when used Resize Policy equals USE_NATURAL_SIZE
+ //DaliException on vector: "Iterator not inside vector"
+
+ ToolkitTestApplication application;
+ tet_infoline(" utcDaliTextEditorCutSelectedTextAfterInitWithResizePolicyNaturalSize");
+
+ TextEditor editor = TextEditor::New();
+ DALI_TEST_CHECK(editor);
+
+ application.GetScene().Add(editor);
+
+ // Avoid a crash when core load gl resources.
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
+
+ //Set multilines text
+ editor.SetProperty(Dali::Toolkit::TextEditor::Property::TEXT, "Hello \n World");
+ editor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ editor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+
+ //Set ResizePolicy to NaturalSize
+ editor.SetProperty(Dali::Actor::Property::WIDTH_RESIZE_POLICY, ResizePolicy::USE_NATURAL_SIZE);
+
+ //Select text at initialization (before the first render)
+ DevelTextEditor::SelectText(editor, 3, 5);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ //Cut text
+ application.ProcessEvent(GenerateKey("", "", "", Dali::DevelKey::DALI_KEY_CONTROL_LEFT, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+ application.ProcessEvent(GenerateKey("x", "x", "x", KEY_X_CODE, KEY_CONTROL_MODIFIER, 0, Integration::KeyEvent::DOWN, "x", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ //Check the changed text and cursor position
+ DALI_TEST_EQUALS(editor.GetProperty(TextEditor::Property::TEXT).Get<std::string>(), "Hel \n World", TEST_LOCATION);
+ DALI_TEST_EQUALS(editor.GetProperty(DevelTextEditor::Property::PRIMARY_CURSOR_POSITION).Get<int>(), 3, TEST_LOCATION);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ END_TEST;
+}
+
+int utcDaliTextEditorDoubleEnterAfterInitWithResizePolicyNaturalSize(void)
+{
+ //This is to test a crash when used Resize Policy equals USE_NATURAL_SIZE
+ //DaliException on vector: "Iterator not inside vector"
+
+ ToolkitTestApplication application;
+ tet_infoline(" utcDaliTextEditorDoubleEnterAfterInitWithResizePolicyNaturalSize");
+
+ TextEditor editor = TextEditor::New();
+ DALI_TEST_CHECK(editor);
+
+ application.GetScene().Add(editor);
+
+ // Avoid a crash when core load gl resources.
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
+
+ //Set multilines text
+ editor.SetProperty(Dali::Toolkit::TextEditor::Property::TEXT, "Hello \n World");
+ editor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ editor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+
+ //Set ResizePolicy to NaturalSize
+ editor.SetProperty(Dali::Actor::Property::WIDTH_RESIZE_POLICY, ResizePolicy::USE_NATURAL_SIZE);
+
+ // Set currsor
+ editor.SetProperty(DevelTextEditor::Property::PRIMARY_CURSOR_POSITION, 5);
+ application.SendNotification();
+ application.Render();
+
+ // Set focus and double enter (new line)
+ editor.SetKeyInputFocus();
+ application.ProcessEvent(GenerateKey("Enter", "", "\n", 13, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+ application.ProcessEvent(GenerateKey("Enter", "", "\n", 13, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE));
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ //Check the changed text and cursor position
+ DALI_TEST_EQUALS(editor.GetProperty(TextEditor::Property::TEXT).Get<std::string>(), "Hello\n\n \n World", TEST_LOCATION);
+ DALI_TEST_EQUALS(editor.GetProperty(DevelTextEditor::Property::PRIMARY_CURSOR_POSITION).Get<int>(), 7, TEST_LOCATION);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ END_TEST;
+}
+
+int UtcDaliToolkitTextEditorUnderlineTypesGeneration1(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliToolkitTextEditorUnderlineTypesGeneration1");
+ TextEditor textEditor = TextEditor::New();
+ textEditor.SetProperty(TextEditor::Property::TEXT, "Test");
+ textEditor.SetProperty(Actor::Property::SIZE, Vector2(200.0f, 100.f));
+ textEditor.SetProperty(TextEditor::Property::POINT_SIZE, 10);
+ textEditor.SetProperty(TextEditor::Property::FONT_FAMILY, "DejaVu Sans");
+
+ application.GetScene().Add(textEditor);
+ application.SendNotification();
+ application.Render();
+
+ Property::Map underlineMapSet;
+ Property::Map underlineMapGet;
+
+ underlineMapSet.Insert("enable", true);
+ underlineMapSet.Insert("color", Color::RED);
+ underlineMapSet.Insert("height", 1);
+ underlineMapSet.Insert("type", Text::Underline::SOLID);
+ underlineMapSet.Insert("dashWidth", 2);
+ underlineMapSet.Insert("dashGap", 1);
+
+ // Check the underline property
+ textEditor.SetProperty(TextEditor::Property::UNDERLINE, underlineMapSet);
+
+ underlineMapGet = textEditor.GetProperty<Property::Map>(TextEditor::Property::UNDERLINE);
+ DALI_TEST_EQUALS(underlineMapGet.Count(), underlineMapSet.Count(), TEST_LOCATION);
+ DALI_TEST_EQUALS(DaliTestCheckMaps(underlineMapGet, underlineMapSet), true, TEST_LOCATION);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ underlineMapSet.Clear();
+ underlineMapGet.Clear();
+
+ underlineMapSet.Insert("enable", true);
+ underlineMapSet.Insert("color", Color::BLUE);
+ underlineMapSet.Insert("height", 1);
+ underlineMapSet.Insert("type", Text::Underline::DASHED);
+ underlineMapSet.Insert("dashWidth", 4);
+ underlineMapSet.Insert("dashGap", 2);
+
+ // Check the dashed underline property
+ textEditor.SetProperty(TextEditor::Property::UNDERLINE, underlineMapSet);
+
+ underlineMapGet = textEditor.GetProperty<Property::Map>(TextEditor::Property::UNDERLINE);
+ DALI_TEST_EQUALS(underlineMapGet.Count(), underlineMapSet.Count(), TEST_LOCATION);
+ DALI_TEST_EQUALS(DaliTestCheckMaps(underlineMapGet, underlineMapSet), true, TEST_LOCATION);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ underlineMapSet.Clear();
+ underlineMapGet.Clear();
+
+ underlineMapSet.Insert("enable", true);
+ underlineMapSet.Insert("color", Color::BLUE);
+ underlineMapSet.Insert("height", 1);
+ underlineMapSet.Insert("type", Text::Underline::DOUBLE);
+ underlineMapSet.Insert("dashWidth", 4);
+ underlineMapSet.Insert("dashGap", 2);
+
+ // Check the dashed underline property
+ textEditor.SetProperty(TextEditor::Property::UNDERLINE, underlineMapSet);
+
+ underlineMapGet = textEditor.GetProperty<Property::Map>(TextEditor::Property::UNDERLINE);
+ DALI_TEST_EQUALS(underlineMapGet.Count(), underlineMapSet.Count(), TEST_LOCATION);
+ DALI_TEST_EQUALS(DaliTestCheckMaps(underlineMapGet, underlineMapSet), true, TEST_LOCATION);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ underlineMapSet.Clear();
+ underlineMapGet.Clear();
+
+ END_TEST;
+}
+
+int UtcDaliToolkitTextEditorUnderlineTypesGeneration2(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliToolkitTextEditorUnderlineTypesGeneration2");
+
+ TextEditor textEditor1 = TextEditor::New();
+ textEditor1.SetProperty(TextEditor::Property::TEXT, "Test");
+ textEditor1.SetProperty(Actor::Property::SIZE, Vector2(200.0f, 100.f));
+ textEditor1.SetProperty(TextEditor::Property::POINT_SIZE, 10);
+ textEditor1.SetProperty(TextEditor::Property::FONT_FAMILY, "DejaVu Sans");
+
+ Property::Map underlineMapSet1;
+ Property::Map underlineMapGet1;
+
+ underlineMapSet1.Insert("enable", true);
+ underlineMapSet1.Insert("color", Color::RED);
+ underlineMapSet1.Insert("height", 1);
+ underlineMapSet1.Insert("type", Text::Underline::SOLID);
+ underlineMapSet1.Insert("dashWidth", 2);
+ underlineMapSet1.Insert("dashGap", 1);
+
+ // Check the underline property
+ textEditor1.SetProperty(TextEditor::Property::UNDERLINE, underlineMapSet1);
+
+ underlineMapGet1 = textEditor1.GetProperty<Property::Map>(TextEditor::Property::UNDERLINE);
+ DALI_TEST_EQUALS(underlineMapGet1.Count(), underlineMapSet1.Count(), TEST_LOCATION);
+ DALI_TEST_EQUALS(DaliTestCheckMaps(underlineMapGet1, underlineMapSet1), true, TEST_LOCATION);
+
+ application.GetScene().Add(textEditor1);
+ application.SendNotification();
+ application.Render();
+
+ TextEditor textEditor2 = TextEditor::New();
+ textEditor2.SetProperty(TextEditor::Property::TEXT, "Test");
+ textEditor2.SetProperty(Actor::Property::SIZE, Vector2(200.0f, 100.f));
+ textEditor2.SetProperty(TextEditor::Property::POINT_SIZE, 10);
+ textEditor2.SetProperty(TextEditor::Property::FONT_FAMILY, "DejaVu Sans");
+
+ Property::Map underlineMapSet2;
+ Property::Map underlineMapGet2;
+
+ underlineMapSet2.Insert("enable", true);
+ underlineMapSet2.Insert("color", Color::BLUE);
+ underlineMapSet2.Insert("height", 1);
+ underlineMapSet2.Insert("type", Text::Underline::DASHED);
+ underlineMapSet2.Insert("dashWidth", 4);
+ underlineMapSet2.Insert("dashGap", 2);
+
+ // Check the dashed underline property
+ textEditor2.SetProperty(TextEditor::Property::UNDERLINE, underlineMapSet2);
+
+ underlineMapGet2 = textEditor2.GetProperty<Property::Map>(TextEditor::Property::UNDERLINE);
+ DALI_TEST_EQUALS(underlineMapGet2.Count(), underlineMapSet2.Count(), TEST_LOCATION);
+ DALI_TEST_EQUALS(DaliTestCheckMaps(underlineMapGet2, underlineMapSet2), true, TEST_LOCATION);
+
+ application.GetScene().Add(textEditor2);
+ application.SendNotification();
+ application.Render();
+
+ TextEditor textEditor3 = TextEditor::New();
+ textEditor3.SetProperty(TextEditor::Property::TEXT, "Test");
+ textEditor3.SetProperty(Actor::Property::SIZE, Vector2(200.0f, 100.f));
+ textEditor3.SetProperty(TextEditor::Property::POINT_SIZE, 10);
+ textEditor3.SetProperty(TextEditor::Property::FONT_FAMILY, "DejaVu Sans");
+
+ Property::Map underlineMapSet3;
+ Property::Map underlineMapGet3;
+
+ underlineMapSet3.Insert("enable", true);
+ underlineMapSet3.Insert("color", Color::BLUE);
+ underlineMapSet3.Insert("height", 1);
+ underlineMapSet3.Insert("type", Text::Underline::DOUBLE);
+ underlineMapSet3.Insert("dashWidth", 4);
+ underlineMapSet3.Insert("dashGap", 2);
+
+ // Check the dashed underline property
+ textEditor3.SetProperty(TextEditor::Property::UNDERLINE, underlineMapSet3);
+
+ underlineMapGet3 = textEditor3.GetProperty<Property::Map>(TextEditor::Property::UNDERLINE);
+ DALI_TEST_EQUALS(underlineMapGet3.Count(), underlineMapSet3.Count(), TEST_LOCATION);
+ DALI_TEST_EQUALS(DaliTestCheckMaps(underlineMapGet3, underlineMapSet3), true, TEST_LOCATION);
+
+ application.GetScene().Add(textEditor3);
+ application.SendNotification();
+ application.Render();
+
+ END_TEST;
+}
+
+int UtcDaliToolkitTextEditorUnderlineTypesGeneration3(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliToolkitTextEditorUnderlineTypesGeneration3");
+
+ TextEditor textEditor1 = TextEditor::New();
+ textEditor1.SetProperty(TextEditor::Property::TEXT, "Test1");
+ textEditor1.SetProperty(Actor::Property::SIZE, Vector2(200.0f, 100.f));
+ textEditor1.SetProperty(TextEditor::Property::POINT_SIZE, 10);
+ textEditor1.SetProperty(TextEditor::Property::FONT_FAMILY, "DejaVu Sans");
+
+ Property::Map underlineMapSet1;
+ Property::Map underlineMapGet1;
+
+ underlineMapSet1.Insert("enable", true);
+ underlineMapSet1.Insert("color", Color::RED);
+ underlineMapSet1.Insert("height", 1);
+ underlineMapSet1.Insert("type", Text::Underline::SOLID);
+ underlineMapSet1.Insert("dashWidth", 2);
+ underlineMapSet1.Insert("dashGap", 1);
+
+ // Check the underline property
+ textEditor1.SetProperty(TextEditor::Property::UNDERLINE, underlineMapSet1);
+ //textEditor1.SetProperty( TextEditor::Property::TEXT, "Test2" );
+
+ underlineMapGet1 = textEditor1.GetProperty<Property::Map>(TextEditor::Property::UNDERLINE);
+ DALI_TEST_EQUALS(underlineMapGet1.Count(), underlineMapSet1.Count(), TEST_LOCATION);
+ DALI_TEST_EQUALS(DaliTestCheckMaps(underlineMapGet1, underlineMapSet1), true, TEST_LOCATION);
+
+ application.GetScene().Add(textEditor1);
+
+ application.SendNotification();
+ application.Render();
+
+ END_TEST;
+}
+
+int UtcDaliToolkitTextEditorRelativeLineHeight(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliToolkitTextEditorRelativeLineHeight");
+
+ TextEditor editor = TextEditor::New();
+ editor.SetProperty(Actor::Property::SIZE, Vector2(200.0f, 300.f));
+ editor.SetProperty(TextEditor::Property::POINT_SIZE, 10);
+ editor.SetProperty(TextEditor::Property::TEXT, "Hello\nWorld");
+
+ application.GetScene().Add(editor);
+ application.SendNotification();
+ application.Render();
+
+ Vector3 naturalSize = editor.GetNaturalSize();
+
+ editor.SetProperty(DevelTextEditor::Property::RELATIVE_LINE_SIZE, 0.5f);
+
+ application.SendNotification();
+ application.Render();
+
+ Vector3 relativeNaturalSize = editor.GetNaturalSize();
+
+ DALI_TEST_EQUALS(naturalSize.y, relativeNaturalSize.y * 2, TEST_LOCATION);
+
+ editor.SetProperty(DevelTextEditor::Property::RELATIVE_LINE_SIZE, 2.0f);
+
+ application.SendNotification();
+ application.Render();
+
+ relativeNaturalSize = editor.GetNaturalSize();
+
+ DALI_TEST_EQUALS(naturalSize.y * 2, relativeNaturalSize.y, TEST_LOCATION);
+ END_TEST;
+}
+
+int UtcDaliTextEditorCharacterSpacing(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliTextEditorCharacterSpacing ");
+
+ TextEditor textEditor = TextEditor::New();
+
+ textEditor.SetProperty(Actor::Property::SIZE, Vector2(150.0f, 300.f));
+
+ application.GetScene().Add(textEditor);
+ application.SendNotification();
+ application.Render();
+
+ textEditor.SetProperty(TextEditor::Property::TEXT, "Hi Experiment");
+ textEditor.SetProperty(DevelTextEditor::Property::CHARACTER_SPACING, 10.f);
+ DALI_TEST_EQUALS(textEditor.GetProperty<float>(DevelTextEditor::Property::CHARACTER_SPACING), 10.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION);
+
+ application.SendNotification();
+ application.Render();
+
+ END_TEST;
+}
+
+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 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;