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-ScrollView.cpp;h=1a88abb58a1878b9c309ff006aaa096eea9dd462;hp=fdd32b5f30a6ca71b331663507a5910e9a22d7c3;hb=a8d60282f49c906206c1ffb2f2425800b914d109;hpb=6fa08daf440e496896babb230e404aae7e77a5bb diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp index fdd32b5..1a88abb 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -249,8 +250,8 @@ static float TestOvershootSnapDuration(ToolkitTestApplication &application, Scro int timeToReachOrigin = -1; for(int i = 0;i(ScrollView::Property::OVERSHOOT_X); - float overshootYValue = scrollView.GetProperty(ScrollView::Property::OVERSHOOT_Y); + float overshootXValue = DevelHandle::GetCurrentProperty( scrollView, ScrollView::Property::OVERSHOOT_X ); + float overshootYValue = DevelHandle::GetCurrentProperty( scrollView, ScrollView::Property::OVERSHOOT_Y ); if(overshootXValue == 0.0f && overshootYValue == 0.0f) { break; @@ -1226,9 +1227,9 @@ int UtcDaliToolkitScrollViewOvershoot(void) // 1. Scroll page in NW (-500,-500 pixels), then inspect overshoot. (don't release touch) Vector2 currentPos = Vector2(100.0f, 100.0f); currentPos = PerformGestureDiagonalSwipe(application, currentPos, Vector2(5.0f, 5.0f), 100, false); - float overshootXValue = scrollView.GetProperty(ScrollView::Property::OVERSHOOT_X); - float overshootYValue = scrollView.GetProperty(ScrollView::Property::OVERSHOOT_Y); - Vector2 positionValue = scrollView.GetProperty(ScrollView::Property::SCROLL_POSITION); + float overshootXValue = DevelHandle::GetCurrentProperty< float >( scrollView, ScrollView::Property::OVERSHOOT_X ); + float overshootYValue = DevelHandle::GetCurrentProperty< float >( scrollView, ScrollView::Property::OVERSHOOT_Y ); + Vector2 positionValue = DevelHandle::GetCurrentProperty< Vector2 >( scrollView, ScrollView::Property::SCROLL_POSITION ); DALI_TEST_EQUALS(overshootXValue, 1.0f, TEST_LOCATION); DALI_TEST_EQUALS(overshootYValue, 1.0f, TEST_LOCATION); DALI_TEST_EQUALS(positionValue, Vector2::ZERO, TEST_LOCATION); @@ -1425,15 +1426,15 @@ int UtcDaliToolkitScrollViewSetMaxOvershootP(void) // Scroll page in NW (-20,-20 pixels), then check that overshoot should be 0. (don't release touch) Vector2 currentPos = PerformGestureDiagonalSwipe(application, OVERSHOOT_START_SCROLL_POSITION, Vector2(1.0f, 1.0f), 20, false); - float overshootXValue = scrollView.GetProperty(ScrollView::Property::OVERSHOOT_X); - float overshootYValue = scrollView.GetProperty(ScrollView::Property::OVERSHOOT_Y); + float overshootXValue = DevelHandle::GetCurrentProperty< float >( scrollView, ScrollView::Property::OVERSHOOT_X ); + float overshootYValue = DevelHandle::GetCurrentProperty< float >( scrollView, ScrollView::Property::OVERSHOOT_Y ); DALI_TEST_EQUALS(overshootXValue, 0.0f, TEST_LOCATION); DALI_TEST_EQUALS(overshootYValue, 0.0f, TEST_LOCATION); // Scroll page further in NW (-105,-105 pixels), then check that overshoot should be around 0.5. (don't release touch) currentPos = PerformGestureDiagonalSwipe(application, OVERSHOOT_START_SCROLL_POSITION, Vector2(1.0f, 1.0f), 105, false); - overshootXValue = scrollView.GetProperty(ScrollView::Property::OVERSHOOT_X); - overshootYValue = scrollView.GetProperty(ScrollView::Property::OVERSHOOT_Y); + overshootXValue = DevelHandle::GetCurrentProperty< float >( scrollView, ScrollView::Property::OVERSHOOT_X ); + overshootYValue = DevelHandle::GetCurrentProperty< float >( scrollView, ScrollView::Property::OVERSHOOT_Y ); // The overshoot value is a 0.0f - 1.0f ranged value of the amount overshot related to the maximum overshoot. // EG. If we move 105, max overshoot is 50, then we overshot 50 / 105. float correctOvershootValue = 50.0f / 105.f; @@ -1442,8 +1443,8 @@ int UtcDaliToolkitScrollViewSetMaxOvershootP(void) // Scroll page further in NW (-30,-30 pixels), then check that overshoot should be now 1.0. (don't release touch) currentPos = PerformGestureDiagonalSwipe(application, OVERSHOOT_START_SCROLL_POSITION, Vector2(1.0f, 1.0f), 30, false); - overshootXValue = scrollView.GetProperty(ScrollView::Property::OVERSHOOT_X); - overshootYValue = scrollView.GetProperty(ScrollView::Property::OVERSHOOT_Y); + overshootXValue = DevelHandle::GetCurrentProperty< float >( scrollView, ScrollView::Property::OVERSHOOT_X ); + overshootYValue = DevelHandle::GetCurrentProperty< float >( scrollView, ScrollView::Property::OVERSHOOT_Y ); DALI_TEST_EQUALS(overshootXValue, 1.0f, TEST_LOCATION); DALI_TEST_EQUALS(overshootYValue, 1.0f, TEST_LOCATION); @@ -1452,15 +1453,15 @@ int UtcDaliToolkitScrollViewSetMaxOvershootP(void) Wait(application); // Check that overshoot should be now around 0.8. - overshootXValue = scrollView.GetProperty(ScrollView::Property::OVERSHOOT_X); - overshootYValue = scrollView.GetProperty(ScrollView::Property::OVERSHOOT_Y); + overshootXValue = DevelHandle::GetCurrentProperty< float >( scrollView, ScrollView::Property::OVERSHOOT_X ); + overshootYValue = DevelHandle::GetCurrentProperty< float >( scrollView, ScrollView::Property::OVERSHOOT_Y ); DALI_TEST_CHECK(overshootXValue > 0.79f && overshootXValue < 0.81f); DALI_TEST_CHECK(overshootYValue > 0.79f && overshootYValue < 0.81f); // Scroll page further in NW (-30,-30 pixels), then check that overshoot should be now 1.0. (don't release touch) currentPos = PerformGestureDiagonalSwipe(application, OVERSHOOT_START_SCROLL_POSITION, Vector2(1.0f, 1.0f), 30, false); - overshootXValue = scrollView.GetProperty(ScrollView::Property::OVERSHOOT_X); - overshootYValue = scrollView.GetProperty(ScrollView::Property::OVERSHOOT_Y); + overshootXValue = DevelHandle::GetCurrentProperty< float >( scrollView, ScrollView::Property::OVERSHOOT_X ); + overshootYValue = DevelHandle::GetCurrentProperty< float >( scrollView, ScrollView::Property::OVERSHOOT_Y ); DALI_TEST_EQUALS(overshootXValue, 1.0f, TEST_LOCATION); DALI_TEST_EQUALS(overshootYValue, 1.0f, TEST_LOCATION);