Revert "Remove ScrollViewCustomEffect"
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-ScrollViewEffect.cpp
index f0b6215..02d0df1 100644 (file)
@@ -1,18 +1,19 @@
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+/*
+ * Copyright (c) 2014 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 #include <iostream>
 #include <stdlib.h>
@@ -41,12 +42,6 @@ void utc_dali_toolkit_scroll_view_effect_cleanup(void)
 
 namespace
 {
-static bool gObjectCreatedCallBackCalled;
-
-static void TestCallback(BaseHandle handle)
-{
-  gObjectCreatedCallBackCalled = true;
-}
 
 const int MILLISECONDS_PER_SECOND = 1000;
 const int RENDER_FRAME_INTERVAL = 16;                           ///< Duration of each frame in ms. (at approx 60FPS)
@@ -99,10 +94,6 @@ RulerPtr CreateRuler(float gridSize = 0.0f)
 static bool gOnScrollStartCalled;                       ///< Whether the OnScrollStart signal was invoked.
 static bool gOnScrollUpdateCalled;                      ///< Whether the OnScrollUpdate signal was invoked.
 static bool gOnScrollCompleteCalled;                    ///< Whether the OnScrollComplete signal was invoked.
-static bool gOnScrollClampedCalled;                     ///< Whether the OnScrollClamped signal was invoked.
-static bool gOnSnapStartCalled;                         ///< Whether the OnSnapStart signal was invoked.
-static ClampState3 gLastClampPosition;                  ///< Clamping information from OnScrollClampedEvent.
-static SnapType gLastSnapType;                          ///< Snaping information from SnapEvent.
 static Vector3 gConstraintResult;                       ///< Result from constraint.
 
 static ActorContainer gPages;                                ///< Keeps track of all the pages for applying effects.
@@ -144,28 +135,6 @@ static void OnScrollComplete( const Vector3& position )
   gOnScrollCompleteCalled = true;
 }
 
-/**
- * Invoked when scrolling clamped.
- *
- * @param[in] event The position/scale/rotation axes that were clamped.
- */
-static void OnScrollClamped( const ScrollView::ClampEvent& event )
-{
-  gOnScrollClampedCalled = true;
-  gLastClampPosition = event.position;
-}
-
-/**
- * Invoked when a snap or flick started.
- *
- * @param[in] event The type of snap and the target position/scale/rotation.
- */
-static void OnSnapStart( const ScrollView::SnapEvent& event )
-{
-  gOnSnapStartCalled = true;
-  gLastSnapType = event.type;
-}
-
 ScrollView SetupTestScrollView(int rows, int columns, Vector2 size)
 {
   ScrollView scrollView = ScrollView::New();
@@ -173,9 +142,7 @@ ScrollView SetupTestScrollView(int rows, int columns, Vector2 size)
   scrollView.SetAnchorPoint(AnchorPoint::CENTER);
   scrollView.SetParentOrigin(ParentOrigin::CENTER);
   scrollView.ApplyConstraint( Constraint::New<Dali::Vector3>( Dali::Actor::SIZE, Dali::ParentSource( Dali::Actor::SIZE ), Dali::EqualToConstraint() ) );
-  // Disable Refresh signal (TET environment cannot use adaptor's Timer)
   scrollView.SetWrapMode(false);
-  scrollView.SetRefreshInterval(0);
   scrollView.ScrollStartedSignal().Connect( &OnScrollStart );
   scrollView.ScrollUpdatedSignal().Connect( &OnScrollUpdate );
   scrollView.ScrollCompletedSignal().Connect( &OnScrollComplete );
@@ -340,24 +307,6 @@ int UtcDaliScrollViewSlideEffectSetup(void)
   END_TEST;
 }
 
-int UtcDaliScrollViewTwistEffectSetup(void)
-{
-  tet_infoline(" UtcDaliScrollViewTwistEffectSetup");
-
-  ScrollViewTwistEffect effect;
-
-  DALI_TEST_CHECK( !effect );
-
-  BaseHandle handle = ScrollViewTwistEffect::New();
-
-  DALI_TEST_CHECK( handle );
-
-  effect = ScrollViewTwistEffect::DownCast(handle);
-
-  DALI_TEST_CHECK( effect );
-  END_TEST;
-}
-
 int UtcDaliScrollViewCubeEffectTest(void)
 {
   ToolkitTestApplication application;
@@ -473,46 +422,6 @@ int UtcDaliScrollViewSlideEffectTest(void)
   END_TEST;
 }
 
-int UtcDaliScrollViewTwistEffectTest(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliScrollViewTwistEffectTest");
-
-  Vector2 size = Stage::GetCurrent().GetSize();
-
-  ScrollView scrollView = SetupTestScrollView(1, 3, size);
-  Actor testPage = gPages[1];
-  Wait(application, 500);
-
-  ScrollViewTwistEffect effect = ScrollViewTwistEffect::New();
-  float shrinkDist = 0.2f;
-  effect.SetMinimumDistanceForShrink(shrinkDist);
-  DALI_TEST_CHECK((shrinkDist - effect.GetMinimumDistanceForShrink()) < Math::MACHINE_EPSILON_0);
-  effect.EnableEffect(true);
-  scrollView.ApplyEffect(effect);
-
-  Actor actor = AddActorToPage(testPage, 0.5f, 0.5f, 3, 3);
-  Wait(application);
-  Vector3 actorPrePosition = actor.GetCurrentPosition();
-
-  effect.ApplyToActor( actor,
-      true,
-      Vector2(Math::PI_2, Math::PI_2),
-      0.0f);
-
-  scrollView.ScrollTo(1);
-  while(!gOnScrollCompleteCalled)
-  {
-    Wait(application);
-  }
-  // test that the first page has reached centre of screen
-  Vector3 actorPostPosition = actor.GetCurrentPosition();
-  // just check the actor has moved
-  DALI_TEST_CHECK((actorPostPosition - actorPrePosition).Length() > Math::MACHINE_EPSILON_1);
-  CleanupTest();
-  END_TEST;
-}
-
 int UtcDaliScrollViewCustomEffectTest(void)
 {
   ToolkitTestApplication application;