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=0b18d11930ef2cfee2d9e8a53b5973665702a52d;hp=09c5078a9de55910e997756d83253827ef1b73f5;hb=e0c063be9e7ecde0e5665079289489d456828abf;hpb=85a9005b80fce7dedf0acc52cf73aa950905e3ec 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 09c5078..0b18d11 100755 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-TextEditor-internal.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-TextEditor-internal.cpp @@ -90,13 +90,13 @@ int UtcDaliTextEditorMarkupUnderline(void) uint32_t expectedNumberOfUnderlinedGlyphs = 5u; Toolkit::Internal::TextEditor& textEditorImpl = GetImpl( textEditor ); - const Text::Length numberOfUnderlineRuns = textEditorImpl.getController()->GetTextModel()->GetNumberOfUnderlineRuns(); + const Text::Length numberOfUnderlineRuns = textEditorImpl.GetTextController()->GetTextModel()->GetNumberOfUnderlineRuns(); DALI_TEST_EQUALS( numberOfUnderlineRuns, expectedNumberOfUnderlinedGlyphs, TEST_LOCATION ); Vector underlineRuns; underlineRuns.Resize(numberOfUnderlineRuns); - textEditorImpl.getController()->GetTextModel()->GetUnderlineRuns(underlineRuns.Begin(), 0u, numberOfUnderlineRuns); + textEditorImpl.GetTextController()->GetTextModel()->GetUnderlineRuns(underlineRuns.Begin(), 0u, numberOfUnderlineRuns); //ABC are underlined DALI_TEST_EQUALS( underlineRuns[0u].glyphIndex, 0u, TEST_LOCATION); @@ -184,7 +184,7 @@ int UtcDaliTextEditorBackgroundTag(void) application.Render(); Toolkit::Internal::TextEditor& editorImpl = GetImpl( editor ); - const ColorIndex* const backgroundColorIndicesBuffer = editorImpl.getController()->GetTextModel()->GetBackgroundColorIndices(); + const ColorIndex* const backgroundColorIndicesBuffer = editorImpl.GetTextController()->GetTextModel()->GetBackgroundColorIndices(); DALI_TEST_CHECK( backgroundColorIndicesBuffer ); @@ -226,7 +226,7 @@ int UtcDaliTextEditorTextWithSpan(void) DALI_TEST_GREATER(spanSize.width, originalSize.width, TEST_LOCATION); Toolkit::Internal::TextEditor& editorImpl = GetImpl( editor ); - const ColorIndex* const colorIndicesBuffer1 = editorImpl.getController()->GetTextModel()->GetColorIndices(); + const ColorIndex* const colorIndicesBuffer1 = editorImpl.GetTextController()->GetTextModel()->GetColorIndices(); DALI_TEST_CHECK( colorIndicesBuffer1 ); @@ -245,7 +245,7 @@ int UtcDaliTextEditorTextWithSpan(void) application.SendNotification(); application.Render(); - const ColorIndex* const colorIndicesBuffer2 = editorImpl.getController()->GetTextModel()->GetColorIndices(); + const ColorIndex* const colorIndicesBuffer2 = editorImpl.GetTextController()->GetTextModel()->GetColorIndices(); DALI_TEST_CHECK( colorIndicesBuffer2 ); @@ -262,4 +262,39 @@ int UtcDaliTextEditorTextWithSpan(void) DALI_TEST_EQUALS( colorIndicesBuffer2[7], 0u, TEST_LOCATION); END_TEST; -} \ No newline at end of file +} + +int UtcDaliTextEditorControlBackgroundColor(void) +{ + ToolkitTestApplication application; + tet_infoline(" UtcDaliTextEditorControlBackgroundColor\n"); + + TextEditor editor = TextEditor::New(); + DALI_TEST_CHECK(editor); + + Vector4 backgroundColor; + + editor.SetProperty(TextEditor::Property::TEXT, "Background Color"); + application.GetScene().Add(editor); + application.SendNotification(); + application.Render(); + + Toolkit::Internal::TextEditor& editorImpl = GetImpl(editor); + ControllerPtr controller = editorImpl.GetTextController(); + Controller::Impl& controllerImpl = Controller::Impl::GetImplementation(*controller.Get()); + + // Default color is transparent + controllerImpl.mEditableControlInterface->GetControlBackgroundColor(backgroundColor); + DALI_TEST_EQUALS(backgroundColor, Color::TRANSPARENT, TEST_LOCATION); + + // Set background color to red + editor.SetBackgroundColor(Color::RED); + application.SendNotification(); + application.Render(); + + // Should be red + controllerImpl.mEditableControlInterface->GetControlBackgroundColor(backgroundColor); + DALI_TEST_EQUALS(backgroundColor, Color::RED, TEST_LOCATION); + + END_TEST; +}