X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-TextField.cpp;h=df1c60b899cf004b04212b9d15a4f292a4aca6c7;hb=445e30972982b11ab35060ef95f6fbb76b9bb99b;hp=f24108c2ea70135795be24db45cf7b477962c440;hpb=aa6d5ffc76e7c5ad6785a4a426b9b6ba2ef4d99b;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp index f24108c..df1c60b 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp @@ -513,7 +513,7 @@ int UtcDaliToolkitTextFieldCopyConstructorP(void) TextField copy(textField); DALI_TEST_CHECK(copy); - DALI_TEST_CHECK(copy.GetProperty(TextLabel::Property::TEXT) == textField.GetProperty(TextLabel::Property::TEXT)); + DALI_TEST_CHECK(copy.GetProperty(TextField::Property::TEXT) == textField.GetProperty(TextField::Property::TEXT)); END_TEST; } @@ -2701,14 +2701,14 @@ int utcDaliTextFieldEvent03(void) application.Render(); // Tap first to get the focus. - TestGenerateTap(application, 3.0f, 25.0f); + TestGenerateTap(application, 3.0f, 25.0f, 100); // Render and notify application.SendNotification(); application.Render(); // Double tap to select a word. - TestGenerateTap(application, 3.0f, 25.0f); + TestGenerateTap(application, 3.0f, 25.0f, 200); // Render and notify application.SendNotification(); @@ -4875,6 +4875,44 @@ int utcDaliTextFieldGeometryGlyphMiddle(void) END_TEST; } + +int utcDaliTextFieldGeometryNullPtr(void) +{ + ToolkitTestApplication application; + tet_infoline("utcDaliTextFieldGeometryNullPtr"); + + TextField field = TextField::New(); + DALI_TEST_CHECK(field); + + application.GetScene().Add(field); + + field.SetProperty(TextField::Property::POINT_SIZE, 7.f); + field.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f)); + field.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT); + field.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); + field.SetProperty(TextField::Property::ENABLE_MARKUP, true); + field.SetProperty(TextField::Property::TEXT, ""); + + // Avoid a crash when core load gl resources. + application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE); + + unsigned int expectedCount = 0; + unsigned int startIndex = 0; + unsigned int endIndex = 0; + + Vector positionsList = DevelTextField::GetTextPosition(field, startIndex, endIndex); + Vector sizeList = DevelTextField::GetTextSize(field, startIndex, endIndex); + + // Render and notify + application.SendNotification(); + application.Render(); + + DALI_TEST_EQUALS(positionsList.Size(), expectedCount, TEST_LOCATION); + DALI_TEST_EQUALS(sizeList.Size(), expectedCount, TEST_LOCATION); + + END_TEST; +} + int utcDaliTextFieldSelectionClearedSignal(void) { ToolkitTestApplication application;