WheelEvent class pimpling
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-ItemView.cpp
old mode 100755 (executable)
new mode 100644 (file)
index 3b5cefb..da5ce83
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 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.
 #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/pan-gesture-event.h>
-#include <dali-toolkit/devel-api/controls/scrollable/item-view/default-item-layout-property.h>
-#include <dali-toolkit/devel-api/controls/scrollable/item-view/item-view-devel.h>
-
+#include <dali/integration-api/events/wheel-event-integ.h>
 
 using namespace Dali;
 using namespace Toolkit;
@@ -53,6 +50,7 @@ const int RENDER_FRAME_INTERVAL = 16;                     ///< Duration of each
 static bool gObjectCreatedCallBackCalled;
 static bool gOnLayoutActivatedCalled;                     ///< Whether the LayoutActivated signal was invoked.
 static bool gOnScrollUpdateCalled;
+static bool gOnWheelEventCalled;                          ///< Whether the WheelEventSignal signal was invoked.
 
 static void TestCallback(BaseHandle handle)
 {
@@ -69,46 +67,24 @@ static void OnScrollUpdate( const Vector2& position )
   gOnScrollUpdateCalled = true;
 }
 
-// Generate a PanGestureEvent to send to Core
-Integration::PanGestureEvent GeneratePan(
-    Gesture::State state,
-    const Vector2& previousPosition,
-    const Vector2& currentPosition,
-    unsigned long timeDelta,
-    unsigned int numberOfTouches = 1)
+static bool OnWheelEvent( Actor actor, const Dali::WheelEvent& wheelEvent )
 {
-  Integration::PanGestureEvent pan(state);
-
-  pan.previousPosition = previousPosition;
-  pan.currentPosition = currentPosition;
-  pan.timeDelta = timeDelta;
-  pan.numberOfTouches = numberOfTouches;
-
-  return pan;
+  gOnWheelEventCalled = true;
+  return false;
 }
 
-/**
- * Helper to generate PanGestureEvent
- *
- * @param[in] application Application instance
- * @param[in] state The Gesture State
- * @param[in] pos The current position of touch.
- */
-static void SendPan(ToolkitTestApplication& application, Gesture::State state, const Vector2& pos)
+Integration::TouchEvent GenerateSingleTouch( PointState::Type state, const Vector2& screenPosition, uint32_t time )
 {
-  static Vector2 last;
-
-  if( (state == Gesture::Started) ||
-      (state == Gesture::Possible) )
-  {
-    last.x = pos.x;
-    last.y = pos.y;
-  }
-
-  application.ProcessEvent(GeneratePan(state, last, pos, RENDER_FRAME_INTERVAL));
-
-  last.x = pos.x;
-  last.y = pos.y;
+  Integration::TouchEvent touchEvent;
+  Integration::Point point;
+  point.SetState( state );
+  point.SetDeviceId(4);
+  point.SetScreenPosition( screenPosition );
+  point.SetDeviceClass( Device::Class::TOUCH );
+  point.SetDeviceSubclass( Device::Subclass::NONE );
+  touchEvent.points.push_back( point );
+  touchEvent.time = time;
+  return touchEvent;
 }
 
 /*
@@ -166,10 +142,7 @@ public: // From ItemFactory
   virtual Actor NewItem(unsigned int itemId)
   {
     // Create a renderable actor for this item
-    Image image = ResourceImage::New( TEST_IMAGE_FILE_NAME );
-    Actor actor = CreateRenderableActor(image);
-
-    return actor;
+    return ImageView::New( TEST_IMAGE_FILE_NAME );
   }
 };
 
@@ -187,7 +160,7 @@ int UtcDaliItemViewNew(void)
   DALI_TEST_CHECK(view);
 
   //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;
@@ -200,6 +173,75 @@ int UtcDaliItemViewNew(void)
   END_TEST;
 }
 
+int UtcDaliItemViewCopyConstructor(void)
+{
+  ToolkitTestApplication application;
+
+  TestItemFactory factory;
+  ItemView itemView = ItemView::New( factory );
+  DALI_TEST_CHECK( itemView );
+
+  ItemView copy( itemView );
+  DALI_TEST_CHECK( copy );
+
+  END_TEST;
+}
+
+int UtcDaliItemViewCopyAssignment(void)
+{
+  ToolkitTestApplication application;
+
+  TestItemFactory factory;
+  ItemView itemView = ItemView::New( factory );
+  DALI_TEST_CHECK( itemView );
+
+  ItemView copy;
+  copy = itemView;
+  DALI_TEST_CHECK( copy );
+  DALI_TEST_EQUALS( itemView, copy, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliItemViewMoveConstructor(void)
+{
+  ToolkitTestApplication application;
+
+  TestItemFactory factory;
+  ItemView itemView = ItemView::New( factory );
+  DALI_TEST_EQUALS( 1, itemView.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  itemView.SetProperty( Actor::Property::SENSITIVE, false );
+  DALI_TEST_CHECK( false == itemView.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+
+  ItemView moved = std::move( itemView );
+  DALI_TEST_CHECK( moved );
+  DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+  DALI_TEST_CHECK( !itemView );
+
+  END_TEST;
+}
+
+int UtcDaliItemViewMoveAssignment(void)
+{
+  ToolkitTestApplication application;
+
+  TestItemFactory factory;
+  ItemView itemView = ItemView::New( factory );
+  DALI_TEST_EQUALS( 1, itemView.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  itemView.SetProperty( Actor::Property::SENSITIVE, false );
+  DALI_TEST_CHECK( false == itemView.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+
+  ItemView moved;
+  moved = std::move( itemView );
+  DALI_TEST_CHECK( moved );
+  DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+  DALI_TEST_CHECK( !itemView );
+
+  END_TEST;
+}
+
 int UtcDaliItemViewDownCast(void)
 {
   ToolkitTestApplication application;
@@ -323,7 +365,7 @@ int UtcDaliItemViewActivateLayoutAndGetActiveLayout(void)
   DALI_TEST_CHECK(view.GetActiveLayout() == NULL);
 
   // Activate the depth layout
-  Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+  Vector3 stageSize(application.GetScene().GetSize());
   view.ActivateLayout(1, stageSize, 0.5f);
 
   // Check the current active layout is the depth layout
@@ -360,7 +402,7 @@ int UtcDaliItemViewDeactivateCurrentLayout(void)
   DALI_TEST_CHECK(view.GetActiveLayout() == NULL);
 
   // Activate the grid layout
-  Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+  Vector3 stageSize(application.GetScene().GetSize());
   view.ActivateLayout(0, stageSize, 0.5f);
 
   // Check the current active layout is the grid layout
@@ -388,7 +430,7 @@ int UtcDaliItemViewGetItemAndGetItemId(void)
   view.AddLayout(*gridLayout);
 
   // Activate the grid layout so that the items will be created and added to ItemView
-  Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+  Vector3 stageSize(application.GetScene().GetSize());
   view.ActivateLayout(0, stageSize, 0.5f);
 
   // Get the item given the item ID
@@ -413,7 +455,7 @@ int UtcDaliItemViewRemoveItem(void)
   view.AddLayout(*gridLayout);
 
   // Activate the grid layout so that the items will be created and added to ItemView
-  Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+  Vector3 stageSize(application.GetScene().GetSize());
   view.ActivateLayout(0, stageSize, 0.5f);
 
   // Get the item given the item ID 2 and 3
@@ -468,7 +510,7 @@ int UtcDaliItemViewGetCurrentLayoutPosition(void)
   view.AddLayout(*depthLayout);
 
   // Activate the grid layout so that the items will be created and added to ItemView
-  Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+  Vector3 stageSize(application.GetScene().GetSize());
   view.ActivateLayout(0, stageSize, 0.0f);
 
   // Check the current layout position for the 10th items is 9.0f
@@ -568,11 +610,11 @@ int UtcDaliItemViewScrollToItem(void)
   Vector3 vec(480.0f, 800.0f, 0.0f);
   ItemLayoutPtr layout = DefaultItemLayout::New( DefaultItemLayout::DEPTH );
 
-  view.SetName("view actor");
+  view.SetProperty( Dali::Actor::Property::NAME,"view actor");
   view.AddLayout(*layout);
-  view.SetSize(vec);
+  view.SetProperty( Actor::Property::SIZE, vec );
 
-  Stage::GetCurrent().Add(view);
+  application.GetScene().Add(view);
   layout->SetOrientation(ControlOrientation::Down);
   view.ActivateLayout(0, vec, 0.0f);
 
@@ -629,7 +671,7 @@ int UtcDaliItemViewScrollToItem(void)
     tet_result(TET_FAIL);
   }
 
-  Stage::GetCurrent().Remove(view);
+  application.GetScene().Remove(view);
   END_TEST;
 }
 
@@ -663,7 +705,7 @@ int UtcDaliItemViewInsertItemP(void)
   view.AddLayout(*gridLayout);
 
   // Activate the grid layout so that the items will be created and added to ItemView
-  Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+  Vector3 stageSize(application.GetScene().GetSize());
   view.ActivateLayout(0, stageSize, 0.0f);
 
   // Get the specified item where new item to be inserted before that
@@ -720,7 +762,7 @@ int UtcDaliItemViewInsertItemsP(void)
   view.AddLayout(*depthLayout);
 
   // Activate the grid layout so that the items will be created and added to ItemView
-  Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+  Vector3 stageSize(application.GetScene().GetSize());
   view.ActivateLayout(0, stageSize, 0.5f);
 
   unsigned int itemCount = view.GetChildCount();
@@ -737,7 +779,7 @@ int UtcDaliItemViewInsertItemsP(void)
   {
     Actor child = view.GetChildAt( i );
     Actor newActor = Actor::New();
-    newActor.SetName("Inserted");
+    newActor.SetProperty( Dali::Actor::Property::NAME,"Inserted");
     insertList.push_back( Item( view.GetItemId(child), newActor ) );
   }
 
@@ -758,7 +800,7 @@ int UtcDaliItemViewInsertItemsP(void)
   {
     Actor child = view.GetChildAt( i );
 
-    if( child.GetName() == "Inserted" )
+    if( child.GetProperty< std::string >( Dali::Actor::Property::NAME ) == "Inserted" )
     {
       removeList.push_back( view.GetItemId(child) );
     }
@@ -791,7 +833,7 @@ int UtcDaliItemViewReplaceItemP(void)
   view.AddLayout(*spiralLayout);
 
   // Activate the grid layout so that the items will be created and added to ItemView
-  Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+  Vector3 stageSize(application.GetScene().GetSize());
   view.ActivateLayout(0, stageSize, 0.5f);
 
   Actor newActor = Actor::New();
@@ -817,7 +859,7 @@ int UtcDaliItemViewReplaceItemsP(void)
   view.AddLayout(*spiralLayout);
 
   // Activate the grid layout so that the items will be created and added to ItemView
-  Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+  Vector3 stageSize(application.GetScene().GetSize());
   view.ActivateLayout(0, stageSize, 0.5f);
 
   ItemContainer replaceList;
@@ -826,7 +868,7 @@ int UtcDaliItemViewReplaceItemsP(void)
   {
     Actor child = view.GetItem( i );
     Actor newActor = Actor::New();
-    newActor.SetName("Replaced");
+    newActor.SetProperty( Dali::Actor::Property::NAME,"Replaced");
 
     replaceList.push_back( Item( i, newActor ) );
   }
@@ -836,8 +878,8 @@ int UtcDaliItemViewReplaceItemsP(void)
     view.ReplaceItems( replaceList, 0.5f );
   }
 
-  DALI_TEST_CHECK(view.GetItem(0).GetName() == "Replaced");
-  DALI_TEST_CHECK(view.GetItem(8).GetName() == "Replaced");
+  DALI_TEST_CHECK(view.GetItem(0).GetProperty< std::string >( Dali::Actor::Property::NAME ) == "Replaced");
+  DALI_TEST_CHECK(view.GetItem(8).GetProperty< std::string >( Dali::Actor::Property::NAME ) == "Replaced");
   END_TEST;
 }
 
@@ -855,7 +897,7 @@ int UtcDaliItemViewGetItemsRangeP(void)
   view.AddLayout(*spiralLayout);
 
   // Activate the grid layout so that the items will be created and added to ItemView
-  Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+  Vector3 stageSize(application.GetScene().GetSize());
   view.ActivateLayout(0, stageSize, 0.5f);
 
   ItemRange itemRange(0, 0);
@@ -880,7 +922,7 @@ int UtcDaliItemViewSetItemsAnchorPointP(void)
   view.AddLayout(*spiralLayout);
 
   // Activate the grid layout so that the items will be created and added to ItemView
-  Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+  Vector3 stageSize(application.GetScene().GetSize());
   view.ActivateLayout(0, stageSize, 0.5f);
 
   Vector3 anchorPoint(10.0f, 10.0f, 0.0f);
@@ -888,7 +930,7 @@ int UtcDaliItemViewSetItemsAnchorPointP(void)
   view.SetItemsAnchorPoint(anchorPoint);
 
   DALI_TEST_CHECK(view.GetItemsAnchorPoint() == anchorPoint);
-  DALI_TEST_CHECK(view.GetItem(0).GetCurrentAnchorPoint() == anchorPoint);
+  DALI_TEST_CHECK(view.GetItem(0).GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ) == anchorPoint);
   END_TEST;
 }
 
@@ -905,7 +947,7 @@ int UtcDaliItemViewSetItemsParentOriginP(void)
   view.AddLayout(*gridLayout);
 
   // Activate the grid layout so that the items will be created and added to ItemView
-  Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+  Vector3 stageSize(application.GetScene().GetSize());
   view.ActivateLayout(0, stageSize, 0.5f);
 
   Vector3 parentOrigin(10.0f, 10.0f, 0.0f);
@@ -913,7 +955,7 @@ int UtcDaliItemViewSetItemsParentOriginP(void)
   view.SetItemsParentOrigin(parentOrigin);
 
   DALI_TEST_CHECK(view.GetItemsParentOrigin() == parentOrigin);
-  DALI_TEST_CHECK(view.GetItem(0).GetCurrentParentOrigin() == parentOrigin);
+  DALI_TEST_CHECK(view.GetItem(0).GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ) == parentOrigin);
   END_TEST;
 }
 
@@ -937,7 +979,7 @@ int UtcDaliItemViewLayoutActivatedSignalP(void)
   ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
   view.AddLayout(*gridLayout);
 
-  Stage::GetCurrent().Add( view );
+  application.GetScene().Add( view );
 
   // Connect the layout activated signal
   view.LayoutActivatedSignal().Connect( &OnLayoutActivated );
@@ -949,7 +991,7 @@ int UtcDaliItemViewLayoutActivatedSignalP(void)
   application.Render();
 
   // Activate the grid layout so that the items will be created and added to ItemView
-  Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+  Vector3 stageSize(application.GetScene().GetSize());
   view.ActivateLayout(0, stageSize, 0.1f);
 
   // Wait for 0.1 second
@@ -1002,7 +1044,7 @@ int UtcDaliItemViewSetGetProperty(void)
   DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::REFRESH_INTERVAL).Get<float>(), 11.0f, TEST_LOCATION );
 
   // Test "layout" property
-  DALI_TEST_CHECK( view.GetPropertyIndex("layout") == DevelItemView::Property::LAYOUT  );
+  DALI_TEST_CHECK( view.GetPropertyIndex("layout") == ItemView::Property::LAYOUT  );
   Property::Map gridLayoutProperty;
   gridLayoutProperty.Insert( DefaultItemLayoutProperty::TYPE, Dali::Property::Value((int)DefaultItemLayout::GRID) );
   gridLayoutProperty.Insert( DefaultItemLayoutProperty::ITEM_SIZE, Dali::Property::Value(Vector3(200, 200,50)) );
@@ -1030,10 +1072,10 @@ int UtcDaliItemViewSetGetProperty(void)
   layoutArray.PushBack(spiralLayoutPrperty);
   layoutArray.PushBack(listLayoutPrperty);
 
-  view.SetProperty( DevelItemView::Property::LAYOUT, layoutArray);
+  view.SetProperty( ItemView::Property::LAYOUT, layoutArray);
 
   Property::Array getLayoutArray;
-  DALI_TEST_CHECK( view.GetProperty(DevelItemView::Property::LAYOUT ).Get( getLayoutArray ) );
+  DALI_TEST_CHECK( view.GetProperty( ItemView::Property::LAYOUT ).Get( getLayoutArray ) );
 
   //Check that the result is the same as
   DALI_TEST_EQUALS( layoutArray.Count(), getLayoutArray.Count(), TEST_LOCATION );
@@ -1063,7 +1105,7 @@ int UtcDaliItemViewSetGetProperty(void)
       DALI_TEST_EQUALS(number, 4, TEST_LOCATION );
     }
   }
-  view.SetProperty( DevelItemView::Property::LAYOUT, layoutArray);
+  view.SetProperty( ItemView::Property::LAYOUT, layoutArray);
 
 
   // Test "overshootEnabled" property
@@ -1123,7 +1165,7 @@ int UtcDaliItemViewSetGetProperty(void)
 int UtcDaliItemViewOvershootVertical(void)
 {
   ToolkitTestApplication application;
-  Dali::Stage stage = Dali::Stage::GetCurrent();
+  Dali::Integration::Scene stage = application.GetScene();
 
   // Create the ItemView actor
   TestItemFactory factory;
@@ -1147,36 +1189,41 @@ int UtcDaliItemViewOvershootVertical(void)
 
   // Do a pan starting from 100,100 and moving down
   Vector2 pos(100.0f, 100.0f);
-  SendPan(application, Gesture::Possible, pos);
-  SendPan(application, Gesture::Started, pos);
+
+  application.ProcessEvent( GenerateSingleTouch(PointState::DOWN, pos, 100 ) );
+  application.ProcessEvent( GenerateSingleTouch(PointState::MOTION, pos, 100 ) );
+
   pos.y += 5.0f;
   Wait(application, 100);
 
   for(int i = 0;i<200;i++)
   {
-    SendPan(application, Gesture::Continuing, pos);
+    application.ProcessEvent( GenerateSingleTouch(PointState::MOTION, pos, 100 ) );
     pos.y += 5.0f;
     Wait(application);
   }
 
-  SendPan(application, Gesture::Finished, pos);
+  application.ProcessEvent( GenerateSingleTouch(PointState::UP, pos, 100 ) );
+
   Wait(application, 100);
 
   // Do a pan starting from 100,100 and moving up
   pos = Vector2(100.0f, 300.0f);
-  SendPan(application, Gesture::Possible, pos);
-  SendPan(application, Gesture::Started, pos);
+
+  application.ProcessEvent( GenerateSingleTouch(PointState::DOWN, pos, 100 ) );
+  application.ProcessEvent( GenerateSingleTouch(PointState::MOTION, pos, 100 ) );
+
   pos.y -= 5.0f;
   Wait(application, 100);
 
   for(int i = 0;i<200;i++)
   {
-    SendPan(application, Gesture::Continuing, pos);
+    application.ProcessEvent( GenerateSingleTouch(PointState::MOTION, pos, 100 ) );
     pos.y -= 5.0f;
     Wait(application);
   }
 
-  SendPan(application, Gesture::Finished, pos);
+  application.ProcessEvent( GenerateSingleTouch(PointState::UP, pos, 100 ) );
   Wait(application, 100);
   END_TEST;
 }
@@ -1184,7 +1231,7 @@ int UtcDaliItemViewOvershootVertical(void)
 int UtcDaliItemViewOvershootHorizontal(void)
 {
   ToolkitTestApplication application;
-  Dali::Stage stage = Dali::Stage::GetCurrent();
+  Dali::Integration::Scene stage = application.GetScene();
 
   // Create the ItemView actor
   TestItemFactory factory;
@@ -1208,36 +1255,36 @@ int UtcDaliItemViewOvershootHorizontal(void)
 
   // Do a pan starting from 100,100 and moving left
   Vector2 pos(100.0f, 100.0f);
-  SendPan(application, Gesture::Possible, pos);
-  SendPan(application, Gesture::Started, pos);
+  application.ProcessEvent( GenerateSingleTouch(PointState::DOWN, pos, 100 ));
+  application.ProcessEvent( GenerateSingleTouch(PointState::MOTION, pos, 100 ));
   pos.x -= 5.0f;
   Wait(application, 100);
 
   for(int i = 0;i<200;i++)
   {
-    SendPan(application, Gesture::Continuing, pos);
+    application.ProcessEvent( GenerateSingleTouch(PointState::MOTION, pos, 100 ) );
     pos.x -= 5.0f;
     Wait(application);
   }
 
-  SendPan(application, Gesture::Finished, pos);
+  application.ProcessEvent( GenerateSingleTouch(PointState::UP, pos, 100 ) );
   Wait(application, 100);
 
   // Do a pan starting from 100,100 and moving right
   pos = Vector2(100.0f, 100.0f);
-  SendPan(application, Gesture::Possible, pos);
-  SendPan(application, Gesture::Started, pos);
+  application.ProcessEvent( GenerateSingleTouch(PointState::DOWN, pos, 100 ) );
+  application.ProcessEvent( GenerateSingleTouch(PointState::MOTION, pos, 100 ) );
   pos.x += 5.0f;
   Wait(application, 100);
 
   for(int i = 0;i<200;i++)
   {
-    SendPan(application, Gesture::Continuing, pos);
+    application.ProcessEvent( GenerateSingleTouch(PointState::MOTION, pos, 100 ) );
     pos.x += 5.0f;
     Wait(application);
   }
 
-  SendPan(application, Gesture::Finished, pos);
+  application.ProcessEvent( GenerateSingleTouch(PointState::UP, pos, 100 ) );
   Wait(application, 100);
 
   END_TEST;
@@ -1246,7 +1293,7 @@ int UtcDaliItemViewOvershootHorizontal(void)
 int UtcDaliItemEnableDisableRefresh(void)
 {
   ToolkitTestApplication application;
-  Dali::Stage stage = Dali::Stage::GetCurrent();
+  Dali::Integration::Scene stage = application.GetScene();
 
   // Create the ItemView actor
   TestItemFactory factory;
@@ -1283,3 +1330,40 @@ int UtcDaliItemEnableDisableRefresh(void)
 
   END_TEST;
 }
+
+int UtcDaliItemViewWheelEvent(void)
+{
+  ToolkitTestApplication application;
+  Dali::Integration::Scene stage = application.GetScene();
+
+  // Create the ItemView actor
+  TestItemFactory factory;
+  ItemView view = ItemView::New( factory );
+
+  // Create a grid layout and add it to ItemView
+  ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+  view.AddLayout( *gridLayout );
+  stage.Add( view );
+
+  // Activate the grid layout so that the items will be created and added to ItemView
+  Vector3 stageSize( stage.GetSize() );
+  view.ActivateLayout (0, stageSize, 0.5f );
+
+  //Connect to wheel event signal
+  view.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 );
+
+  END_TEST;
+}