X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-ScrollView.cpp;h=39af3d3ac91db0b4bfd6712b5b4b7f46f1773400;hb=402784aceba9171e57ffca8769ca46ef8aebcd2f;hp=9b9cad135b49283bbed8d74d8d16a7ace081eba6;hpb=8fef10ea440a32a1536b485dc7a035f9defa537c;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp index 9b9cad1..39af3d3 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp @@ -207,25 +207,13 @@ struct TestSumConstraint /** * @param[in] current The current base value - * @param[in] property The property to be added to current. + * @param[in] inputs Contains the property to be added to current. * @return The new current Vector. */ - Vector3 operator()(const Vector3& current) + void operator()( Vector3& current, const PropertyInputContainer& inputs ) { - gConstraintResult = current + mOffset; - return gConstraintResult; - } - - /** - * @param[in] current The current base value - * @param[in] property The property to be added to current. - * @return The new current Vector. - */ - Vector3 operator()(const Vector3& current, - const PropertyInput& property) - { - gConstraintResult = current + property.GetVector3() + mOffset; - return gConstraintResult; + gConstraintResult = current + inputs[0]->GetVector3() + mOffset; + current = gConstraintResult; } Vector3 mOffset; @@ -239,14 +227,11 @@ struct TestSumConstraint */ static float TestOvershootSnapDuration(ToolkitTestApplication &application, ScrollView scrollView) { - Property::Index overshootPropertyX = scrollView.GetPropertyIndex(ScrollView::SCROLL_OVERSHOOT_X_PROPERTY_NAME); - Property::Index overshootPropertyY = scrollView.GetPropertyIndex(ScrollView::SCROLL_OVERSHOOT_Y_PROPERTY_NAME); - int timeToReachOrigin = -1; for(int i = 0;i(overshootPropertyX); - float overshootYValue = scrollView.GetProperty(overshootPropertyY); + float overshootXValue = scrollView.GetProperty(ScrollView::Property::OVERSHOOT_X); + float overshootYValue = scrollView.GetProperty(ScrollView::Property::OVERSHOOT_Y); if(overshootXValue == 0.0f && overshootYValue == 0.0f) { break; @@ -817,10 +802,8 @@ int UtcDaliScrollViewConstraints(void) a.SetPosition( TEST_ACTOR_POSITION ); Wait(application); - Property::Index scrollPositionProperty = scrollView.GetPropertyIndex(ScrollView::SCROLL_POSITION_PROPERTY_NAME); - Constraint constraint = Constraint::New( Actor::Property::POSITION, - Source(scrollView, scrollPositionProperty), - TestSumConstraint( TEST_CONSTRAINT_OFFSET ) ); + Constraint constraint = Constraint::New( scrollView, Actor::Property::POSITION, TestSumConstraint( TEST_CONSTRAINT_OFFSET ) ); + constraint.AddSource( Source(scrollView, ScrollView::Property::SCROLL_POSITION) ); constraint.SetRemoveAction(Constraint::Discard); scrollView.ApplyConstraintToChildren(constraint); Wait(application); @@ -865,12 +848,9 @@ int UtcDaliScrollViewBind(void) a.SetPosition( TEST_ACTOR_POSITION ); Wait(application); - Property::Index scrollPositionProperty = scrollView.GetPropertyIndex(ScrollView::SCROLL_POSITION_PROPERTY_NAME); // apply this constraint to scrollview - Constraint constraint = Constraint::New( Actor::Property::POSITION, - Source(scrollView, scrollPositionProperty), - TestSumConstraint( TEST_CONSTRAINT_OFFSET ) ); - + Constraint constraint = Constraint::New( scrollView, Actor::Property::POSITION, TestSumConstraint( TEST_CONSTRAINT_OFFSET ) ); + constraint.AddSource( Source(scrollView, ScrollView::Property::SCROLL_POSITION) ); constraint.SetRemoveAction(Constraint::Discard); scrollView.ApplyConstraintToChildren(constraint); @@ -1034,12 +1014,9 @@ int UtcDaliScrollViewOvershoot(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); - Property::Index overshootXProperty = scrollView.GetPropertyIndex(ScrollView::SCROLL_OVERSHOOT_X_PROPERTY_NAME); - Property::Index overshootYProperty = scrollView.GetPropertyIndex(ScrollView::SCROLL_OVERSHOOT_Y_PROPERTY_NAME); - Property::Index scrollPositionProperty = scrollView.GetPropertyIndex(ScrollView::SCROLL_POSITION_PROPERTY_NAME); - float overshootXValue = scrollView.GetProperty(overshootXProperty); - float overshootYValue = scrollView.GetProperty(overshootYProperty); - Vector3 positionValue = scrollView.GetProperty(scrollPositionProperty); + float overshootXValue = scrollView.GetProperty(ScrollView::Property::OVERSHOOT_X); + float overshootYValue = scrollView.GetProperty(ScrollView::Property::OVERSHOOT_Y); + Vector3 positionValue = scrollView.GetProperty(ScrollView::Property::SCROLL_POSITION); DALI_TEST_EQUALS(overshootXValue, 1.0f, TEST_LOCATION); DALI_TEST_EQUALS(overshootYValue, 1.0f, TEST_LOCATION); DALI_TEST_EQUALS(positionValue, Vector3::ZERO, TEST_LOCATION);