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-Text-Controller.cpp;h=cdb29f982d22a9e5c6242ed889f393ce28238a43;hp=748043589aeaabd4db67fd98ba7f960d235dc1df;hb=406208364fe0ee31f31f475ba7ee7709e56d3e27;hpb=cbff244b295bcd2758fe93155a9b3199d85ee164 diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp index 7480435..cdb29f9 100644 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp @@ -19,10 +19,13 @@ #include #include +#include #include #include #include +#include +#include using namespace Dali; using namespace Toolkit; @@ -40,7 +43,9 @@ const char* const OPTION_CLIPBOARD("optionClipboard"); // "Clipboard" popup const Size CONTROL_SIZE( 300.f, 60.f ); -class ControlImpl : public ControlInterface +const std::string DEFAULT_FONT_DIR( "/resources/fonts" ); + +class ControlImpl : public ControlInterface, public Text::EditableControlInterface { public: ControlImpl() @@ -80,8 +85,7 @@ int UtcDaliTextController(void) ToolkitTestApplication application; // Creates a text controller. - ControlImpl controlImpl; - ControllerPtr controller = Controller::New( controlImpl ); + ControllerPtr controller = Controller::New(); DALI_TEST_CHECK( controller ); @@ -95,8 +99,7 @@ int UtcDaliTextControllerEnableCursorBlinking(void) ToolkitTestApplication application; // Creates a text controller. - ControlImpl controlImpl; - ControllerPtr controller = Controller::New( controlImpl ); + ControllerPtr controller = Controller::New(); DALI_TEST_CHECK( controller ); @@ -131,8 +134,7 @@ int UtcDaliTextControllerImfEvent(void) ToolkitTestApplication application; // Creates a text controller. - ControlImpl controlImpl; - ControllerPtr controller = Controller::New( controlImpl ); + ControllerPtr controller = Controller::New(); std::string text; ImfManager::ImfEventData imfEvent; @@ -214,8 +216,7 @@ int UtcDaliTextControllerTextPopupButtonTouched(void) ToolkitTestApplication application; // Creates a text controller. - ControlImpl controlImpl; - ControllerPtr controller = Controller::New( controlImpl ); + ControllerPtr controller = Controller::New(); DALI_TEST_CHECK( controller ); @@ -330,3 +331,74 @@ int UtcDaliTextControllerTextPopupButtonTouched(void) tet_result(TET_PASS); END_TEST; } + +int UtcDaliTextControllerGetInputShadowProperty(void) +{ + tet_infoline(" UtcDaliTextControllerGetInputShadowProperty"); + ToolkitTestApplication application; + + // Creates a text controller. + ControllerPtr controller = Controller::New(); + + DALI_TEST_CHECK( controller ); + + const std::string& shadowProperties = controller->GetInputShadowProperties(); + + DALI_TEST_CHECK( shadowProperties.empty() ); + + tet_result(TET_PASS); + END_TEST; +} + +int UtcDaliTextControllerGetInputUnderlineProperty(void) +{ + tet_infoline(" UtcDaliTextControllerGetInputUnderlineProperty"); + ToolkitTestApplication application; + + // Creates a text controller. + ControllerPtr controller = Controller::New(); + + DALI_TEST_CHECK( controller ); + + const std::string& underlineProperties = controller->GetInputUnderlineProperties(); + + DALI_TEST_CHECK( underlineProperties.empty() ); + + tet_result(TET_PASS); + END_TEST; +} + +int UtcDaliTextControllerSetGetAutoScrollEnabled(void) +{ + tet_infoline(" UtcDaliTextControllerSetGetAutoScrollEnabled"); + ToolkitTestApplication application; + + // Creates a text controller. + ControllerPtr controller = Controller::New(); + + DALI_TEST_CHECK( controller ); + + DALI_TEST_CHECK( !controller->IsAutoScrollEnabled() ); + + // The auto scrolling shouldn't be enabled if the multi-line is enabled. + + // Enable multi-line. + controller->SetMultiLineEnabled( true ); + + // Enable text scrolling. + controller->SetAutoScrollEnabled( true ); + + DALI_TEST_CHECK( !controller->IsAutoScrollEnabled() ); + + // Disable multi-line. + controller->SetMultiLineEnabled( false ); + + // Enable text scrolling. + controller->SetAutoScrollEnabled( true ); + + // Should be ebabled now. + DALI_TEST_CHECK( controller->IsAutoScrollEnabled() ); + + tet_result(TET_PASS); + END_TEST; +}