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-ItemView.cpp;h=da5ce83797ba1f559585c25e05794b7d8f0769f9;hp=1ba8d0bff0cd05175e921b531ab778858deab70e;hb=be93fd772a1b1b09425ac0aaec1ea1b64e9a9e60;hpb=9f0861c204ec42bcd02bdc19845832b9d06cdbe0 diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ItemView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ItemView.cpp index 1ba8d0b..da5ce83 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ItemView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ItemView.cpp @@ -24,7 +24,7 @@ #include #include #include - +#include using namespace Dali; using namespace Toolkit; @@ -50,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) { @@ -66,6 +67,12 @@ static void OnScrollUpdate( const Vector2& position ) gOnScrollUpdateCalled = true; } +static bool OnWheelEvent( Actor actor, const Dali::WheelEvent& wheelEvent ) +{ + gOnWheelEventCalled = true; + return false; +} + Integration::TouchEvent GenerateSingleTouch( PointState::Type state, const Vector2& screenPosition, uint32_t time ) { Integration::TouchEvent touchEvent; @@ -1323,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; +}