X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-TextField.cpp;h=893d26ab2ba0bbcd763e4ec35113fff6bcd5be01;hp=8b1005f285e26ea297fe55c921813592aafde236;hb=5a49c794732c6e87a5fa1fa3ae71be376a40434d;hpb=c7b9e9c65ace4c1210dabd95d0c2b71fb3c17e0b diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp index 8b1005f..893d26a 100755 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp @@ -1749,8 +1749,6 @@ int utcDaliTextFieldEvent02(void) // Move the cursor and check the position changes. Vector3 position1 = cursor.GetCurrentPosition(); - - application.ProcessEvent( GenerateKey( "", "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); application.ProcessEvent( GenerateKey( "", "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify @@ -1758,20 +1756,28 @@ int utcDaliTextFieldEvent02(void) application.Render(); Vector3 position2 = cursor.GetCurrentPosition(); - DALI_TEST_CHECK( position2.x < position1.x ); application.ProcessEvent( GenerateKey( "", "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", "", DALI_KEY_CURSOR_RIGHT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); // Render and notify application.SendNotification(); application.Render(); Vector3 position3 = cursor.GetCurrentPosition(); - DALI_TEST_EQUALS( position1, position3, TEST_LOCATION ); // Should be in the same position1. + + // Move the cursor to the first position. + application.ProcessEvent( GenerateKey( "", "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", "", DALI_KEY_CURSOR_LEFT, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); + + // Render and notify + application.SendNotification(); + application.Render(); + + Vector3 position4 = cursor.GetCurrentPosition(); + // Send some taps and check the cursor positions. // Try to tap at the beginning. @@ -1783,9 +1789,9 @@ int utcDaliTextFieldEvent02(void) application.Render(); // Cursor position should be the same than position1. - Vector3 position4 = cursor.GetCurrentPosition(); + Vector3 position5 = cursor.GetCurrentPosition(); - DALI_TEST_EQUALS( position2, position4, TEST_LOCATION ); // Should be in the same position2. + DALI_TEST_EQUALS( position4, position5, TEST_LOCATION ); // Should be in the same position2. // Tap away from the start position. application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 16.f, 25.0f ) ) ); @@ -1795,9 +1801,9 @@ int utcDaliTextFieldEvent02(void) application.SendNotification(); application.Render(); - Vector3 position5 = cursor.GetCurrentPosition(); + Vector3 position6 = cursor.GetCurrentPosition(); - DALI_TEST_CHECK( position5.x > position4.x ); + DALI_TEST_CHECK( position6.x > position5.x ); // Remove all the text. application.ProcessEvent( GenerateKey( "", "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); @@ -1809,9 +1815,9 @@ int utcDaliTextFieldEvent02(void) application.Render(); // Cursor position should be the same than position2. - Vector3 position6 = cursor.GetCurrentPosition(); + Vector3 position7 = cursor.GetCurrentPosition(); - DALI_TEST_EQUALS( position2, position6, TEST_LOCATION );// Should be in the same position2. + DALI_TEST_EQUALS( position4, position7, TEST_LOCATION );// Should be in the same position2. // Should not be a renderer. DALI_TEST_EQUALS( stencil.GetChildCount(), 0u, TEST_LOCATION );