WheelEvent class pimpling
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-ScrollView.cpp
index 29c22a0..4e050f3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -20,6 +20,7 @@
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali/integration-api/events/touch-event-integ.h>
+#include <dali/integration-api/events/wheel-event-integ.h>
 
 using namespace Dali;
 using namespace Toolkit;
@@ -113,6 +114,7 @@ static bool gOnScrollStartCalled;                       ///< Whether the OnScrol
 static bool gOnScrollUpdateCalled;                      ///< Whether the OnScrollUpdate signal was invoked.
 static bool gOnScrollCompleteCalled;                    ///< Whether the OnScrollComplete signal was invoked.
 static bool gOnSnapStartCalled;                         ///< Whether the OnSnapStart signal was invoked.
+static bool gOnWheelEventCalled;                        ///< Whether the WheelEventSignal signal was invoked.
 static SnapType gLastSnapType;                          ///< Snaping information from SnapEvent.
 static Vector3 gConstraintResult;                       ///< Result from constraint.
 
@@ -158,6 +160,19 @@ static void OnSnapStart( const ScrollView::SnapEvent& event )
 }
 
 /**
+ * Invoked after a wheel-event is received
+ *
+ * @param[in] actor The owing actor
+ * @param[in] event The wheel event
+ * @return True if the event should be consumed
+ */
+static bool OnWheelEvent( Actor actor, const Dali::WheelEvent& wheelEvent )
+{
+  gOnWheelEventCalled = true;
+  return false;
+}
+
+/**
  * TestSumConstraint
  *
  * Summation of current value, property, and offset.
@@ -289,6 +304,24 @@ int UtcDaliToolkitScrollViewCopyConstructorP(void)
   END_TEST;
 }
 
+int UtcDaliScrollViewMoveConstructor(void)
+{
+  ToolkitTestApplication application;
+
+  ScrollView scrollView = ScrollView::New();
+  DALI_TEST_EQUALS( 1, scrollView.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  scrollView.SetProperty( ScrollView::Property::SCROLL_POSITION, Vector2(10.0f, 10.0f) );
+  DALI_TEST_EQUALS( scrollView.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ), Vector2(10.0f, 10.0f), TEST_LOCATION );
+
+  ScrollView moved = std::move( scrollView );
+  DALI_TEST_CHECK( moved );
+  DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( moved.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ), Vector2(10.0f, 10.0f), TEST_LOCATION );
+  DALI_TEST_CHECK( !scrollView );
+
+  END_TEST;
+}
+
 int UtcDaliToolkitScrollViewAssignmentOperatorP(void)
 {
   ToolkitTestApplication application;
@@ -296,12 +329,32 @@ int UtcDaliToolkitScrollViewAssignmentOperatorP(void)
   ScrollView scrollView = ScrollView::New();
   scrollView.SetProperty( ScrollView::Property::SCROLL_POSITION, Vector2(10.0f, 10.0f) );
 
-  ScrollView copy = scrollView;
+  ScrollView copy;
+  copy = scrollView;
   DALI_TEST_CHECK( copy );
   DALI_TEST_CHECK( copy.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ) == scrollView.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ) );
   END_TEST;
 }
 
+int UtcDaliScrollViewMoveAssignment(void)
+{
+  ToolkitTestApplication application;
+
+  ScrollView scrollView = ScrollView::New();
+  DALI_TEST_EQUALS( 1, scrollView.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  scrollView.SetProperty( ScrollView::Property::SCROLL_POSITION, Vector2(10.0f, 10.0f) );
+  DALI_TEST_EQUALS( scrollView.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ), Vector2(10.0f, 10.0f), TEST_LOCATION );
+
+  ScrollView moved;
+  moved = std::move( scrollView );
+  DALI_TEST_CHECK( moved );
+  DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( moved.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ), Vector2(10.0f, 10.0f), TEST_LOCATION );
+  DALI_TEST_CHECK( !scrollView );
+
+  END_TEST;
+}
+
 int UtcDaliScrollViewDestructorP(void)
 {
   ToolkitTestApplication application;
@@ -331,7 +384,7 @@ int UtcDaliToolkitScrollViewNewP1(void)
   DALI_TEST_CHECK( scrollView2 == scrollView );
 
   //Additional check to ensure object is created by checking if it's registered
-  ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
+  ObjectRegistry registry = application.GetCore().GetObjectRegistry();
   DALI_TEST_CHECK( registry );
 
   gObjectCreatedCallBackCalled = false;
@@ -383,7 +436,7 @@ int UtcDaliToolkitScrollViewScrollToPositionP(void)
 
   // Create the ScrollView actor
   ScrollView scrollView = ScrollView::New();
-  Stage::GetCurrent().Add( scrollView );
+  application.GetScene().Add( scrollView );
 
   const Vector2 target = Vector2(100.0f, 200.0f);
   const Vector2 target2 = Vector2(300.0f, 100.0f);
@@ -404,7 +457,7 @@ int UtcDaliToolkitScrollViewScrollToPositionWithDirectionBiasP(void)
   tet_infoline(" UtcDaliToolkitScrollViewScrollToPositionWithDirectionBiasP");
 
   ScrollView scrollView = ScrollView::New();
-  Stage::GetCurrent().Add( scrollView );
+  application.GetScene().Add( scrollView );
   RulerPtr rulerX = new FixedRuler( 100.0f );
   rulerX->SetDomain( RulerDomain(0.0f, 200.0f, true) );
   RulerPtr rulerY = new FixedRuler( 100.0f );
@@ -447,7 +500,7 @@ int UtcDaliToolkitScrollViewScrollToPositionWithAlphaFunctionP(void)
 
   // Create the ScrollView actor
   ScrollView scrollView = ScrollView::New();
-  Stage::GetCurrent().Add( scrollView );
+  application.GetScene().Add( scrollView );
 
   const Vector2 target = Vector2(100.0f, 200.0f);
   const Vector2 target2 = Vector2(300.0f, 100.0f);
@@ -476,7 +529,7 @@ int UtcDaliToolkitScrollViewScrollToPositionWithAlphaFunctionAndDirectionBiasP(v
   tet_infoline(" UtcDaliToolkitScrollViewScrollToPositionWithAlphaFunctionAndDirectionBiasP");
 
   ScrollView scrollView = ScrollView::New();
-  Stage::GetCurrent().Add( scrollView );
+  application.GetScene().Add( scrollView );
   RulerPtr rulerX = new FixedRuler( 100.0f );
   rulerX->SetDomain( RulerDomain(0.0f, 200.0f, true) );
   RulerPtr rulerY = new FixedRuler( 100.0f );
@@ -524,7 +577,7 @@ int UtcDaliToolkitScrollViewScrollToPageP(void)
   tet_infoline(" UtcDaliToolkitScrollViewScrollToPageP");
 
   ScrollView scrollView = ScrollView::New();
-  Stage::GetCurrent().Add( scrollView );
+  application.GetScene().Add( scrollView );
   RulerPtr rulerX = new FixedRuler( 100.0f );
   rulerX->SetDomain( RulerDomain(0.0f, 800.0f, true) );
   RulerPtr rulerY = new FixedRuler( 100.0f );
@@ -590,10 +643,10 @@ int UtcDaliToolkitScrollModeP1(void)
   // Do not rely on stage size for UTC tests.
   Vector2 viewPageSize( 720.0f, 1280.0f );
   scrollView.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
-  scrollView.SetSize( viewPageSize );
+  scrollView.SetProperty( Actor::Property::SIZE, viewPageSize );
   scrollView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
   scrollView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
-  scrollView.SetPosition( 0.0f, 0.0f, 0.0f );
+  scrollView.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, 0.0f, 0.0f ));
 
   // Position rulers.
   Property::Map rulerMap;
@@ -606,7 +659,7 @@ int UtcDaliToolkitScrollModeP1(void)
   scrollView.SetWrapMode( false );
   scrollView.SetScrollSensitive( true );
 
-  Stage::GetCurrent().Add( scrollView );
+  application.GetScene().Add( scrollView );
 
   // Set up a gesture to perform.
   Vector2 startPos( 50.0f, 0.0f );
@@ -647,10 +700,10 @@ int UtcDaliToolkitScrollModeP2(void)
   // Do not rely on stage size for UTC tests.
   Vector2 viewPageSize( 720.0f, 1280.0f );
   scrollView.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
-  scrollView.SetSize( viewPageSize );
+  scrollView.SetProperty( Actor::Property::SIZE, viewPageSize );
   scrollView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
   scrollView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
-  scrollView.SetPosition( 0.0f, 0.0f, 0.0f );
+  scrollView.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, 0.0f, 0.0f ));
 
   // Position rulers.
   Property::Map rulerMap;
@@ -663,7 +716,7 @@ int UtcDaliToolkitScrollModeP2(void)
   scrollView.SetWrapMode( false );
   scrollView.SetScrollSensitive( true );
 
-  Stage::GetCurrent().Add( scrollView );
+  application.GetScene().Add( scrollView );
 
   // Set up a gesture to perform.
   Vector2 startPos( 0.0f, 50.0f );
@@ -705,10 +758,10 @@ int UtcDaliToolkitScrollModeP3(void)
   // Do not rely on stage size for UTC tests.
   Vector2 viewPageSize( 720.0f, 1280.0f );
   scrollView.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
-  scrollView.SetSize( viewPageSize );
+  scrollView.SetProperty( Actor::Property::SIZE, viewPageSize );
   scrollView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
   scrollView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
-  scrollView.SetPosition( 0.0f, 0.0f, 0.0f );
+  scrollView.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, 0.0f, 0.0f ));
 
   // Position rulers.
   Property::Map rulerMap;
@@ -721,7 +774,7 @@ int UtcDaliToolkitScrollModeP3(void)
   scrollView.SetWrapMode( false );
   scrollView.SetScrollSensitive( true );
 
-  Stage::GetCurrent().Add( scrollView );
+  application.GetScene().Add( scrollView );
 
   // Set up a gesture to perform.
   Vector2 startPos( 0.0f, 50.0f );
@@ -762,10 +815,10 @@ int UtcDaliToolkitScrollModeP4(void)
   // Do not rely on stage size for UTC tests.
   Vector2 viewPageSize( 720.0f, 1280.0f );
   scrollView.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
-  scrollView.SetSize( viewPageSize );
+  scrollView.SetProperty( Actor::Property::SIZE, viewPageSize );
   scrollView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
   scrollView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
-  scrollView.SetPosition( 0.0f, 0.0f, 0.0f );
+  scrollView.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, 0.0f, 0.0f ));
 
   // Position rulers - expect Default rulers to be used which don't snap
   Property::Map rulerMap;
@@ -776,7 +829,7 @@ int UtcDaliToolkitScrollModeP4(void)
   scrollView.SetWrapMode( false );
   scrollView.SetScrollSensitive( true );
 
-  Stage::GetCurrent().Add( scrollView );
+  application.GetScene().Add( scrollView );
 
   Vector2 START_POSITION = Vector2(10.0f, 10.0f);
 
@@ -817,7 +870,7 @@ int UtcDaliToolkitScrollViewScrollToPageWithDirectionBiasP(void)
   tet_infoline(" UtcDaliToolkitScrollViewScrollToPageWithDirectionBiasP");
 
   ScrollView scrollView = ScrollView::New();
-  Stage::GetCurrent().Add( scrollView );
+  application.GetScene().Add( scrollView );
   RulerPtr rulerX = new FixedRuler( 100.0f );
   rulerX->SetDomain( RulerDomain(0.0f, 200.0f, true) );
   RulerPtr rulerY = new FixedRuler( 100.0f );
@@ -859,16 +912,16 @@ int UtcDaliToolkitScrollViewScrollToActorP(void)
   tet_infoline(" UtcDaliToolkitScrollViewScrollToActorP");
 
   ScrollView scrollView = ScrollView::New();
-  Stage::GetCurrent().Add( scrollView );
+  application.GetScene().Add( scrollView );
 
   Actor actorA = Actor::New();
   const Vector3 positionA = Vector3(100.0f, 400.0f, 0.0f);
-  actorA.SetPosition(positionA);
+  actorA.SetProperty( Actor::Property::POSITION, positionA );
   scrollView.Add(actorA);
 
   Actor actorB = Actor::New();
   const Vector3 positionB = Vector3(500.0f, 200.0f, 0.0f);
-  actorB.SetPosition(positionB);
+  actorB.SetProperty( Actor::Property::POSITION, positionB );
   scrollView.Add(actorB);
 
   Wait(application);
@@ -898,7 +951,7 @@ int UtcDaliToolkitScrollViewScrollToSnapPointP(void)
   tet_infoline(" UtcDaliToolkitScrollViewScrollToSnapPointP");
 
   ScrollView scrollView = ScrollView::New();
-  Stage::GetCurrent().Add( scrollView );
+  application.GetScene().Add( scrollView );
   RulerPtr rulerX = new FixedRuler( 100.0f );
   rulerX->SetDomain( RulerDomain(0.0f, 800.0f, true) );
   RulerPtr rulerY = new FixedRuler( 100.0f );
@@ -940,7 +993,7 @@ int UtcDaliToolkitScrollViewSetWrapModeP(void)
   tet_infoline(" UtcDaliToolkitScrollViewSetWrapModeP");
 
   ScrollView scrollView = ScrollView::New();
-  Stage::GetCurrent().Add( scrollView );
+  application.GetScene().Add( scrollView );
 
   Actor actor = Actor::New();
   scrollView.Add( actor );
@@ -971,7 +1024,7 @@ int UtcDaliToolkitScrollViewActorAutoSnap(void)
   tet_infoline(" UtcDaliToolkitScrollViewActorAutoSnap");
 
   ScrollView scrollView = ScrollView::New();
-  Stage::GetCurrent().Add( scrollView );
+  application.GetScene().Add( scrollView );
 
   // Position rulers.
   RulerPtr rulerX = new DefaultRuler();
@@ -984,12 +1037,12 @@ int UtcDaliToolkitScrollViewActorAutoSnap(void)
   const Vector3 aPosition = Vector3(200.0f, 50.0f, 0.0f);
   Actor a = Actor::New();
   scrollView.Add(a);
-  a.SetPosition(aPosition);
+  a.SetProperty( Actor::Property::POSITION, aPosition );
 
   const Vector3 bPosition = Vector3(600.0f, 600.0f, 0.0f);
   Actor b = Actor::New();
   scrollView.Add(b);
-  b.SetPosition(bPosition);
+  b.SetProperty( Actor::Property::POSITION, bPosition );
 
   // Goto a random position, and execute snap (should not move)
   Vector2 targetScroll = Vector2(500.0f, 500.0f);
@@ -1022,7 +1075,7 @@ int UtcDaliToolkitScrollViewSignalsStartComplete(void)
   gOnScrollCompleteCalled = false;
 
   ScrollView scrollView = ScrollView::New();
-  Stage::GetCurrent().Add( scrollView );
+  application.GetScene().Add( scrollView );
 
   // Position rulers.
   RulerPtr rulerX = new DefaultRuler();
@@ -1052,9 +1105,9 @@ int UtcDaliToolkitScrollViewSignalsUpdate01(void)
   gOnScrollCompleteCalled = false;
 
   ScrollView scrollView = ScrollView::New();
-  Stage::GetCurrent().Add( scrollView );
-  Vector2 stageSize = Stage::GetCurrent().GetSize();
-  scrollView.SetSize(stageSize);
+  application.GetScene().Add( scrollView );
+  Vector2 stageSize = application.GetScene().GetSize();
+  scrollView.SetProperty( Actor::Property::SIZE, stageSize);
   scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
   scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
 
@@ -1070,7 +1123,7 @@ int UtcDaliToolkitScrollViewSignalsUpdate01(void)
   scrollView.ScrollCompletedSignal().Connect( &OnScrollComplete );
 
   Actor image = Actor::New();
-  image.SetSize(stageSize);
+  image.SetProperty( Actor::Property::SIZE, stageSize);
   image.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
   image.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
   scrollView.Add(image);
@@ -1114,9 +1167,9 @@ int UtcDaliToolkitScrollViewSignalsUpdate02(void)
   gOnScrollCompleteCalled = false;
 
   ScrollView scrollView = ScrollView::New();
-  Stage::GetCurrent().Add( scrollView );
-  Vector2 stageSize = Stage::GetCurrent().GetSize();
-  scrollView.SetSize(stageSize);
+  application.GetScene().Add( scrollView );
+  Vector2 stageSize = application.GetScene().GetSize();
+  scrollView.SetProperty( Actor::Property::SIZE, stageSize);
   scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
   scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
 
@@ -1136,7 +1189,7 @@ int UtcDaliToolkitScrollViewSignalsUpdate02(void)
   DALI_TEST_CHECK(scrollView.ConnectSignal( &tracker, "scrollCompleted", CallbackFunctor(&scrollCompleted) ));
 
   Actor image = Actor::New();
-  image.SetSize(stageSize);
+  image.SetProperty( Actor::Property::SIZE, stageSize);
   image.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
   image.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
   scrollView.Add(image);
@@ -1168,7 +1221,7 @@ int UtcDaliToolkitScrollViewSignalsUpdate02(void)
   DALI_TEST_CHECK(scrollUpdated);
   DALI_TEST_CHECK(scrollCompleted);
 
-  Stage::GetCurrent().Remove( scrollView );
+  application.GetScene().Remove( scrollView );
 
   END_TEST;
 }
@@ -1181,9 +1234,9 @@ int UtcDaliToolkitScrollViewScrollSensitive(void)
   // Set up a scrollView...
   ScrollView scrollView = ScrollView::New();
   scrollView.SetOvershootEnabled(true);
-  Stage::GetCurrent().Add( scrollView );
-  Vector2 stageSize = Stage::GetCurrent().GetSize();
-  scrollView.SetSize(stageSize);
+  application.GetScene().Add( scrollView );
+  Vector2 stageSize = application.GetScene().GetSize();
+  scrollView.SetProperty( Actor::Property::SIZE, stageSize);
   scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
   scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
 
@@ -1228,9 +1281,9 @@ int UtcDaliToolkitScrollViewAxisAutoLock(void)
 
   // Set up a scrollView...
   ScrollView scrollView = ScrollView::New();
-  Stage::GetCurrent().Add( scrollView );
-  Vector2 stageSize = Stage::GetCurrent().GetSize();
-  scrollView.SetSize(stageSize);
+  application.GetScene().Add( scrollView );
+  Vector2 stageSize = application.GetScene().GetSize();
+  scrollView.SetProperty( Actor::Property::SIZE, stageSize);
   scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
   scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
 
@@ -1333,9 +1386,9 @@ int UtcDaliToolkitScrollViewConstraints(void)
 
   // Set up a scrollView...
   ScrollView scrollView = ScrollView::New();
-  Stage::GetCurrent().Add( scrollView );
-  Vector2 stageSize = Stage::GetCurrent().GetSize();
-  scrollView.SetSize(stageSize);
+  application.GetScene().Add( scrollView );
+  Vector2 stageSize = application.GetScene().GetSize();
+  scrollView.SetProperty( Actor::Property::SIZE, stageSize);
   scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
   scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
 
@@ -1352,7 +1405,7 @@ int UtcDaliToolkitScrollViewConstraints(void)
   gConstraintResult = Vector3::ZERO;
   Actor a = Actor::New();
   scrollView.Add(a);
-  a.SetPosition( TEST_ACTOR_POSITION );
+  a.SetProperty( Actor::Property::POSITION, TEST_ACTOR_POSITION);
   Wait(application);
 
   Constraint constraint = Constraint::New<Vector3>( scrollView, Actor::Property::POSITION, TestSumConstraint( TEST_CONSTRAINT_OFFSET ) );
@@ -1378,9 +1431,9 @@ int UtcDaliToolkitScrollViewBind(void)
 
   // Set up a scrollView...
   ScrollView scrollView = ScrollView::New();
-  Stage::GetCurrent().Add( scrollView );
-  Vector2 stageSize = Stage::GetCurrent().GetSize();
-  scrollView.SetSize(stageSize);
+  application.GetScene().Add( scrollView );
+  Vector2 stageSize = application.GetScene().GetSize();
+  scrollView.SetProperty( Actor::Property::SIZE, stageSize);
   scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
   scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
 
@@ -1398,7 +1451,7 @@ int UtcDaliToolkitScrollViewBind(void)
   gConstraintResult = Vector3::ZERO;
   Actor a = Actor::New();
   scrollView.Add(a);
-  a.SetPosition( TEST_ACTOR_POSITION );
+  a.SetProperty( Actor::Property::POSITION, TEST_ACTOR_POSITION);
   Wait(application);
 
   // apply this constraint to scrollview
@@ -1439,9 +1492,9 @@ int UtcDaliToolkitScrollViewOvershoot(void)
   scrollView.SetProperty( Scrollable::Property::OVERSHOOT_SIZE, overshootSize );
   DALI_TEST_EQUALS( scrollView.GetProperty(Scrollable::Property::OVERSHOOT_SIZE).Get<Vector2>(), overshootSize, TEST_LOCATION );
 
-  Stage::GetCurrent().Add( scrollView );
-  Vector2 stageSize = Stage::GetCurrent().GetSize();
-  scrollView.SetSize(stageSize);
+  application.GetScene().Add( scrollView );
+  Vector2 stageSize = application.GetScene().GetSize();
+  scrollView.SetProperty( Actor::Property::SIZE, stageSize);
   scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
   scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
 
@@ -1571,9 +1624,9 @@ int UtcDaliToolkitScrollViewSnapStartedSignalP(void)
 
   // Set up a scrollView...
   ScrollView scrollView = ScrollView::New();
-  Stage::GetCurrent().Add( scrollView );
-  Vector2 stageSize = Stage::GetCurrent().GetSize();
-  scrollView.SetSize(stageSize);
+  application.GetScene().Add( scrollView );
+  Vector2 stageSize = application.GetScene().GetSize();
+  scrollView.SetProperty( Actor::Property::SIZE, stageSize);
   scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
   scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
 
@@ -1610,7 +1663,7 @@ int UtcDaliToolkitScrollViewGetCurrentPageP(void)
   tet_infoline(" UtcDaliToolkitScrollViewGetCurrentPageP");
 
   ScrollView scrollView = ScrollView::New();
-  Stage::GetCurrent().Add( scrollView );
+  application.GetScene().Add( scrollView );
   RulerPtr rulerX = new FixedRuler( 100.0f );
   rulerX->SetDomain( RulerDomain(0.0f, 800.0f, true) );
   RulerPtr rulerY = new FixedRuler( 100.0f );
@@ -1641,9 +1694,9 @@ int UtcDaliToolkitScrollViewSetMaxOvershootP(void)
 
   // Set up a scrollView...
   ScrollView scrollView = ScrollView::New();
-  Stage::GetCurrent().Add( scrollView );
-  Vector2 stageSize = Stage::GetCurrent().GetSize();
-  scrollView.SetSize(stageSize);
+  application.GetScene().Add( scrollView );
+  Vector2 stageSize = application.GetScene().GetSize();
+  scrollView.SetProperty( Actor::Property::SIZE, stageSize);
   scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
   scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
 
@@ -1732,9 +1785,9 @@ int UtcDaliToolkitScrollViewSetScrollingDirectionP(void)
 
   // Set up a scrollView...
   ScrollView scrollView = ScrollView::New();
-  Stage::GetCurrent().Add( scrollView );
-  Vector2 stageSize = Stage::GetCurrent().GetSize();
-  scrollView.SetSize(stageSize);
+  application.GetScene().Add( scrollView );
+  Vector2 stageSize = application.GetScene().GetSize();
+  scrollView.SetProperty( Actor::Property::SIZE, stageSize);
   scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
   scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
 
@@ -1818,9 +1871,9 @@ int UtcDaliToolkitScrollViewRemoveScrollingDirectionP(void)
 
   // Set up a scrollView...
   ScrollView scrollView = ScrollView::New();
-  Stage::GetCurrent().Add( scrollView );
-  Vector2 stageSize = Stage::GetCurrent().GetSize();
-  scrollView.SetSize(stageSize);
+  application.GetScene().Add( scrollView );
+  Vector2 stageSize = application.GetScene().GetSize();
+  scrollView.SetProperty( Actor::Property::SIZE, stageSize);
   scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
   scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
 
@@ -1882,7 +1935,7 @@ int UtcDaliToolkitScrollViewSetRulerXP(void)
   tet_infoline(" UtcDaliToolkitScrollViewSetRulerXP");
 
   ScrollView scrollView = ScrollView::New();
-  Stage::GetCurrent().Add( scrollView );
+  application.GetScene().Add( scrollView );
   RulerPtr rulerX = new FixedRuler( 100.0f );
   rulerX->SetDomain( RulerDomain(0.0f, 800.0f, true) );
 
@@ -1910,7 +1963,7 @@ int UtcDaliToolkitScrollViewSetRulerYP(void)
   tet_infoline(" UtcDaliToolkitScrollViewSetRulerYP");
 
   ScrollView scrollView = ScrollView::New();
-  Stage::GetCurrent().Add( scrollView );
+  application.GetScene().Add( scrollView );
 
   RulerPtr rulerY = new FixedRuler( 200.0f );
   rulerY->SetDomain( RulerDomain(0.0f, 400.0f, true) );
@@ -2641,9 +2694,9 @@ int UtcDaliToolkitScrollViewConstraintsMove(void)
 
   // Set up a scrollView...
   ScrollView scrollView = ScrollView::New();
-  Stage::GetCurrent().Add( scrollView );
-  Vector2 stageSize = Stage::GetCurrent().GetSize();
-  scrollView.SetSize(stageSize);
+  application.GetScene().Add( scrollView );
+  Vector2 stageSize = application.GetScene().GetSize();
+  scrollView.SetProperty( Actor::Property::SIZE, stageSize);
   scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
   scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
 
@@ -2658,7 +2711,7 @@ int UtcDaliToolkitScrollViewConstraintsMove(void)
   // Add an Actor to ScrollView,
   Actor a = Actor::New();
   scrollView.Add(a);
-  a.SetPosition( TEST_ACTOR_POSITION );
+  a.SetProperty( Actor::Property::POSITION, TEST_ACTOR_POSITION);
   Wait(application);
 
   const Vector2 target = Vector2(100.0f, 100.0f);
@@ -2686,9 +2739,9 @@ int UtcDaliToolkitScrollViewConstraintsWrap(void)
 
   // Set up a scrollView...
   ScrollView scrollView = ScrollView::New();
-  Stage::GetCurrent().Add( scrollView );
-  Vector2 stageSize = Stage::GetCurrent().GetSize();
-  scrollView.SetSize(stageSize);
+  application.GetScene().Add( scrollView );
+  Vector2 stageSize = application.GetScene().GetSize();
+  scrollView.SetProperty( Actor::Property::SIZE, stageSize);
   scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
   scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
 
@@ -2703,7 +2756,7 @@ int UtcDaliToolkitScrollViewConstraintsWrap(void)
   // Add an Actor to ScrollView,
   Actor a = Actor::New();
   scrollView.Add(a);
-  a.SetPosition( TEST_ACTOR_POSITION );
+  a.SetProperty( Actor::Property::POSITION, TEST_ACTOR_POSITION);
   Wait(application);
 
   const Vector2 target = Vector2(100.0f, 100.0f);
@@ -2744,10 +2797,10 @@ int UtcDaliToolkitScrollViewGesturePageLimit(void)
   // Do not rely on stage size for UTC tests.
   Vector2 viewPageSize( 720.0f, 1280.0f );
   scrollView.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
-  scrollView.SetSize( viewPageSize );
+  scrollView.SetProperty( Actor::Property::SIZE, viewPageSize );
   scrollView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
   scrollView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
-  scrollView.SetPosition( 0.0f, 0.0f, 0.0f );
+  scrollView.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, 0.0f, 0.0f ));
 
   // Position rulers.
   // We set the X ruler to fixed to give us pages to snap to.
@@ -2763,7 +2816,7 @@ int UtcDaliToolkitScrollViewGesturePageLimit(void)
   scrollView.SetWrapMode( false );
   scrollView.SetScrollSensitive( true );
 
-  Stage::GetCurrent().Add( scrollView );
+  application.GetScene().Add( scrollView );
 
   // Set up a gesture to perform.
   Vector2 startPos( 50.0f, 0.0f );
@@ -2955,3 +3008,81 @@ int UtcDaliScrollViewSetGetProperty(void)
 
   END_TEST;
 }
+
+int UtcDaliToolkitScrollViewWheelEvent(void)
+{
+  ToolkitTestApplication application;
+
+  // Set up a scrollView.
+  ScrollView scrollView = ScrollView::New();
+
+  // Do not rely on stage size for UTC tests.
+  Vector2 viewPageSize( 720.0f, 1280.0f );
+  scrollView.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
+  scrollView.SetProperty( Actor::Property::SIZE, viewPageSize );
+  scrollView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+  scrollView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+  scrollView.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, 0.0f, 0.0f ));
+
+  // Position rulers.
+  // We set the X ruler to fixed to give us pages to snap to.
+  Dali::Toolkit::FixedRuler* rulerX = new Dali::Toolkit::FixedRuler( viewPageSize.width );
+  // Note: The 3x page width is arbitary, but we need enough to show that we are
+  // capping page movement by the page limiter, and not the domain.
+  rulerX->SetDomain( Dali::Toolkit::RulerDomain( 0.0f, viewPageSize.width * 3.0f, false ) );
+  Dali::Toolkit::RulerPtr rulerY = new Dali::Toolkit::DefaultRuler();
+  rulerY->Disable();
+  scrollView.SetRulerX( rulerX );
+  scrollView.SetRulerY( rulerY );
+
+  scrollView.SetWrapMode( false );
+
+  application.GetScene().Add( scrollView );
+
+  //Connect to wheel event signal
+  scrollView.WheelEventSignal().Connect( &OnWheelEvent );
+
+  DALI_TEST_CHECK( !gOnWheelEventCalled );
+
+  // Render and notify
+  application.Render();
+  application.SendNotification();
+  application.Render();
+  application.SendNotification();
+
+  // Perform a wheel event
+  Dali::Integration::WheelEvent wheelEvent( Dali::Integration::WheelEvent::MOUSE_WHEEL, 0, 0u, Vector2( 10.0f, 10.0f ), 1, 1000u );
+  application.ProcessEvent( wheelEvent );
+  DALI_TEST_CHECK( gOnWheelEventCalled );
+
+  // Set X ruler to free
+  Dali::Toolkit::DefaultRuler* defaultRuler = new Dali::Toolkit::DefaultRuler();
+  scrollView.SetRulerX( defaultRuler );
+
+  // Perform a wheel event
+  gOnWheelEventCalled = false;
+  application.ProcessEvent( wheelEvent );
+  DALI_TEST_CHECK( gOnWheelEventCalled );
+
+  // Enable Y ruler
+  rulerY->Enable();
+
+  // Perform a wheel event
+  gOnWheelEventCalled = false;
+  application.ProcessEvent( wheelEvent );
+  DALI_TEST_CHECK( gOnWheelEventCalled );
+
+  // Wait until it finishes scrolling
+  Wait(application, RENDER_DELAY_SCROLL);
+
+  // Set Y ruler to fixed
+  Dali::Toolkit::FixedRuler* fixedRulerY = new Dali::Toolkit::FixedRuler( viewPageSize.height );
+  scrollView.SetRulerY( fixedRulerY );
+
+  // Perform a wheel event
+  gOnWheelEventCalled = false;
+  application.ProcessEvent( wheelEvent );
+  DALI_TEST_CHECK( gOnWheelEventCalled );
+
+  END_TEST;
+}