// Need to override adaptor classes for toolkit test harness, so include
// test harness headers before dali headers.
#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>
+
using namespace Dali;
using namespace Toolkit;
namespace
{
+
const unsigned int TOTAL_ITEM_NUMBER = 100;
const char* TEST_IMAGE_FILE_NAME = "gallery_image_01.jpg";
+const int RENDER_FRAME_INTERVAL = 16; ///< Duration of each frame in ms. (at approx 60FPS)
+
static bool gObjectCreatedCallBackCalled;
+static bool gOnLayoutActivatedCalled; ///< Whether the LayoutActivated signal was invoked.
static void TestCallback(BaseHandle handle)
{
gObjectCreatedCallBackCalled = true;
}
+static void OnLayoutActivated()
+{
+ gOnLayoutActivatedCalled = 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)
+{
+ Integration::PanGestureEvent pan(state);
+
+ pan.previousPosition = previousPosition;
+ pan.currentPosition = currentPosition;
+ pan.timeDelta = timeDelta;
+ pan.numberOfTouches = numberOfTouches;
+
+ return pan;
+}
+
+/**
+ * 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)
+{
+ 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;
+}
+
+/*
+ * Simulate time passed by.
+ *
+ * @note this will always process at least 1 frame (1/60 sec)
+ *
+ * @param application Test application instance
+ * @param duration Time to pass in milliseconds.
+ * @return The actual time passed in milliseconds
+ */
+int Wait(ToolkitTestApplication& application, int duration = 0)
+{
+ int time = 0;
+
+ for(int i = 0; i <= ( duration / RENDER_FRAME_INTERVAL); i++)
+ {
+ application.SendNotification();
+ application.Render(RENDER_FRAME_INTERVAL);
+ time += RENDER_FRAME_INTERVAL;
+ }
+
+ return time;
+}
// Implementation of ItemFactory for providing actors to ItemView
class TestItemFactory : public ItemFactory
*/
virtual Actor NewItem(unsigned int itemId)
{
- // Create an image actor for this item
+ // Create a renderable actor for this item
Image image = ResourceImage::New( TEST_IMAGE_FILE_NAME );
- Actor actor = ImageActor::New(image);
+ Actor actor = CreateRenderableActor(image);
return actor;
}
ItemView view = ItemView::New(factory);
// Create a grid layout and add it to ItemView
- GridLayoutPtr gridLayout = GridLayout::New();
+ ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
view.AddLayout(*gridLayout);
// As we have added one layout, check the number of layout is now 1
DALI_TEST_CHECK(view.GetLayoutCount() == 1);
// Create a depth layout and add it to ItemView
- DepthLayoutPtr depthLayout = DepthLayout::New();
+ ItemLayoutPtr depthLayout = DefaultItemLayout::New( DefaultItemLayout::DEPTH );
view.AddLayout(*depthLayout);
// As we have added another layout, check the number of layout is now 2
DALI_TEST_CHECK(view.GetLayoutCount() == 2);
// Create a spiral layout and add it to ItemView
- SpiralLayoutPtr spiralLayout = SpiralLayout::New();
+ ItemLayoutPtr spiralLayout = DefaultItemLayout::New( DefaultItemLayout::SPIRAL );
view.AddLayout(*spiralLayout);
// As we have added another layout, check the number of layout is now 3
ItemView view = ItemView::New(factory);
// Create a grid layout and add it to ItemView
- GridLayoutPtr gridLayout = GridLayout::New();
+ ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
view.AddLayout(*gridLayout);
// As we have added one layout, check the number of layout is now 1
DALI_TEST_CHECK(view.GetLayoutCount() == 1);
// Create a depth layout and add it to ItemView
- DepthLayoutPtr depthLayout = DepthLayout::New();
+ ItemLayoutPtr depthLayout = DefaultItemLayout::New( DefaultItemLayout::DEPTH );
view.AddLayout(*depthLayout);
// As we have added another layout, check the number of layout is now 2
ItemView view = ItemView::New(factory);
// Create a grid layout and add it to ItemView
- GridLayoutPtr gridLayout = GridLayout::New();
+ ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
view.AddLayout(*gridLayout);
// Create a depth layout and add it to ItemView
- DepthLayoutPtr depthLayout = DepthLayout::New();
+ ItemLayoutPtr depthLayout = DefaultItemLayout::New( DefaultItemLayout::DEPTH );
view.AddLayout(*depthLayout);
// Create a spiral layout and add it to ItemView
- SpiralLayoutPtr spiralLayout = SpiralLayout::New();
+ ItemLayoutPtr spiralLayout = DefaultItemLayout::New( DefaultItemLayout::SPIRAL );
view.AddLayout(*spiralLayout);
// As we have added three layouts, check the number of layout is now 3
ItemView view = ItemView::New(factory);
// Create a grid layout and add it to ItemView
- GridLayoutPtr gridLayout = GridLayout::New();
+ ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
view.AddLayout(*gridLayout);
// Check there is no active layout at the moment
ItemView view = ItemView::New(factory);
// Create a grid layout and add it to ItemView
- GridLayoutPtr gridLayout = GridLayout::New();
+ ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
view.AddLayout(*gridLayout);
// Activate the grid layout so that the items will be created and added to ItemView
ItemView view = ItemView::New(factory);
// Create a grid layout and add it to ItemView
- GridLayoutPtr gridLayout = GridLayout::New();
+ ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
view.AddLayout(*gridLayout);
// Activate the grid layout so that the items will be created and added to ItemView
ItemView view = ItemView::New(factory);
// Create a grid layout and add it to ItemView
- GridLayoutPtr gridLayout = GridLayout::New();
+ ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
view.AddLayout(*gridLayout);
// Activate the grid layout so that the items will be created and added to ItemView
// Set the interval between refreshes to be 20
view.SetRefreshInterval(20);
+ view.Refresh();
+
// Check the interval between refreshes is 20
DALI_TEST_CHECK(view.GetRefreshInterval() == 20);
END_TEST;
TestItemFactory factory;
ItemView view = ItemView::New(factory);
Vector3 vec(480.0f, 800.0f, 0.0f);
- GridLayoutPtr layout = GridLayout::New();
+ ItemLayoutPtr layout = DefaultItemLayout::New( DefaultItemLayout::GRID );
view.SetName("view actor");
view.AddLayout(*layout);
END_TEST;
}
-int UtcDaliItemViewSetAndGetMouseWheelScrollDistanceStep(void)
+int UtcDaliItemViewSetAndGetWheelScrollDistanceStep(void)
{
ToolkitTestApplication application;
TestItemFactory factory;
ItemView view = ItemView::New(factory);
- // Set the scroll distance step for the mouse wheel event to be 100.0f
- view.SetMouseWheelScrollDistanceStep(100.0f);
+ // Set the scroll distance step for the wheel event to be 100.0f
+ view.SetWheelScrollDistanceStep(100.0f);
// Check the scroll distance step is 100.0f
- DALI_TEST_EQUALS(view.GetMouseWheelScrollDistanceStep(), 100.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(view.GetWheelScrollDistanceStep(), 100.0f, TEST_LOCATION );
+ END_TEST;
+}
+
+int UtcDaliItemViewInsertItemP(void)
+{
+ ToolkitTestApplication application;
+
+ // 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);
+
+ // Activate the grid layout so that the items will be created and added to ItemView
+ Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ view.ActivateLayout(0, stageSize, 0.5f);
+
+ // Get the item given the item ID
+ Actor itemActor = view.GetItem(2);
+
+ ItemId id = view.GetItemId( itemActor );
+
+ // Check we are getting the correct Item ID given the specified actor
+ DALI_TEST_CHECK(view.GetItemId(itemActor) == 2);
+
+ Actor newActor = Actor::New();
+
+ view.InsertItem(Item(id, newActor), 0.5f);
+
+ DALI_TEST_CHECK(view.GetItem(2) == newActor);
+ END_TEST;
+}
+
+int UtcDaliItemViewInsertItemsP(void)
+{
+ ToolkitTestApplication application;
+
+ // 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);
+
+ // Activate the grid layout so that the items will be created and added to ItemView
+ Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ view.ActivateLayout(0, stageSize, 0.5f);
+
+ unsigned int itemCount = view.GetChildCount();
+
+ ItemContainer insertList;
+
+ for( unsigned int i = 0u; i < 10; ++i )
+ {
+ Actor child = view.GetChildAt( i );
+ Actor newActor = Actor::New();
+ newActor.SetName("Inserted");
+ insertList.push_back( Item( view.GetItemId(child), newActor ) );
+ }
+
+ if( !insertList.empty() )
+ {
+ view.InsertItems( insertList, 0.5f );
+ }
+
+ DALI_TEST_CHECK(view.GetChildCount() == itemCount + 10);
+
+ ItemIdContainer removeList;
+
+ for( unsigned int i = 0u; i < view.GetChildCount(); ++i )
+ {
+ Actor child = view.GetChildAt( i );
+
+ if( child.GetName() == "Inserted" )
+ {
+ removeList.push_back( view.GetItemId(child) );
+ }
+ }
+
+ if( ! removeList.empty() )
+ {
+ view.RemoveItems( removeList, 0.5f );
+ }
+
+ DALI_TEST_CHECK(view.GetChildCount() == itemCount);
+ END_TEST;
+}
+
+int UtcDaliItemViewReplaceItemP(void)
+{
+ ToolkitTestApplication application;
+
+ // 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);
+
+ // Activate the grid layout so that the items will be created and added to ItemView
+ Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ view.ActivateLayout(0, stageSize, 0.5f);
+
+ Actor newActor = Actor::New();
+
+ view.ReplaceItem( Item( 0, newActor ), 0.5f );
+
+ DALI_TEST_CHECK(view.GetItem(0) == newActor);
+ END_TEST;
+}
+
+int UtcDaliItemViewReplaceItemsP(void)
+{
+ ToolkitTestApplication application;
+
+ // 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);
+
+ // Activate the grid layout so that the items will be created and added to ItemView
+ Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ view.ActivateLayout(0, stageSize, 0.5f);
+
+ ItemContainer replaceList;
+
+ for( unsigned int i = 0u; i < 10; ++i )
+ {
+ Actor child = view.GetItem( i );
+ Actor newActor = Actor::New();
+ newActor.SetName("Replaced");
+
+ replaceList.push_back( Item( i, newActor ) );
+ }
+
+ if( !replaceList.empty() )
+ {
+ view.ReplaceItems( replaceList, 0.5f );
+ }
+
+ DALI_TEST_CHECK(view.GetItem(0).GetName() == "Replaced");
+ DALI_TEST_CHECK(view.GetItem(8).GetName() == "Replaced");
+ END_TEST;
+}
+
+int UtcDaliItemViewGetItemsRangeP(void)
+{
+ ToolkitTestApplication application;
+
+ // 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);
+
+ // Activate the grid layout so that the items will be created and added to ItemView
+ Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ view.ActivateLayout(0, stageSize, 0.5f);
+
+ ItemRange itemRange(0, 0);
+
+ view.GetItemsRange(itemRange);
+
+ DALI_TEST_CHECK(itemRange.Within(0));
+ END_TEST;
+}
+
+int UtcDaliItemViewSetItemsAnchorPointP(void)
+{
+ ToolkitTestApplication application;
+
+ // 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);
+
+ // Activate the grid layout so that the items will be created and added to ItemView
+ Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ view.ActivateLayout(0, stageSize, 0.5f);
+
+ Vector3 anchorPoint(10.0f, 10.0f, 0.0f);
+
+ view.SetItemsAnchorPoint(anchorPoint);
+
+ DALI_TEST_CHECK(view.GetItemsAnchorPoint() == anchorPoint);
+ DALI_TEST_CHECK(view.GetItem(0).GetCurrentAnchorPoint() == anchorPoint);
+ END_TEST;
+}
+
+int UtcDaliItemViewSetItemsParentOriginP(void)
+{
+ ToolkitTestApplication application;
+
+ // 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);
+
+ // Activate the grid layout so that the items will be created and added to ItemView
+ Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ view.ActivateLayout(0, stageSize, 0.5f);
+
+ Vector3 parentOrigin(10.0f, 10.0f, 0.0f);
+
+ view.SetItemsParentOrigin(parentOrigin);
+
+ DALI_TEST_CHECK(view.GetItemsParentOrigin() == parentOrigin);
+ DALI_TEST_CHECK(view.GetItem(0).GetCurrentParentOrigin() == parentOrigin);
+ END_TEST;
+}
+
+int UtcDaliItemFactoryGetExtention(void)
+{
+ ToolkitTestApplication application;
+ TestItemFactory factory;
+ DALI_TEST_CHECK( factory.GetExtension() == NULL );
+ END_TEST;
+}
+
+int UtcDaliItemViewLayoutActivatedSignalP(void)
+{
+ ToolkitTestApplication application;
+
+ // 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::GetCurrent().Add( view );
+
+ // Connect the layout activated signal
+ view.LayoutActivatedSignal().Connect( &OnLayoutActivated );
+
+ gOnLayoutActivatedCalled = false;
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Activate the grid layout so that the items will be created and added to ItemView
+ Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ view.ActivateLayout(0, stageSize, 0.1f);
+
+ // Wait for 0.1 second
+ Wait(application, 100);
+
+ DALI_TEST_EQUALS( gOnLayoutActivatedCalled, true, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliItemViewSetGetProperty(void)
+{
+ ToolkitTestApplication application;
+
+ // Create the ItemView actor
+ TestItemFactory factory;
+ ItemView view = ItemView::New(factory);
+ DALI_TEST_CHECK(view);
+
+ // Event side properties
+
+ // Test "minimumSwipeSpeed" property
+ DALI_TEST_CHECK( view.GetPropertyIndex("minimumSwipeSpeed") == ItemView::Property::MINIMUM_SWIPE_SPEED );
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::MINIMUM_SWIPE_SPEED).Get<float>(), view.GetMinimumSwipeSpeed(), TEST_LOCATION );
+ view.SetProperty( ItemView::Property::MINIMUM_SWIPE_SPEED, 2.5f );
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::MINIMUM_SWIPE_SPEED).Get<float>(), 2.5f, TEST_LOCATION );
+
+ // Test "minimumSwipeDistance" property
+ DALI_TEST_CHECK( view.GetPropertyIndex("minimumSwipeDistance") == ItemView::Property::MINIMUM_SWIPE_DISTANCE );
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::MINIMUM_SWIPE_DISTANCE).Get<float>(), view.GetMinimumSwipeDistance(), TEST_LOCATION );
+ view.SetProperty( ItemView::Property::MINIMUM_SWIPE_DISTANCE, 8.725f );
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::MINIMUM_SWIPE_DISTANCE).Get<float>(), 8.725f, TEST_LOCATION );
+
+ // Test "wheelScrollDistanceStep" property
+ DALI_TEST_CHECK( view.GetPropertyIndex("wheelScrollDistanceStep") == ItemView::Property::WHEEL_SCROLL_DISTANCE_STEP );
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::WHEEL_SCROLL_DISTANCE_STEP).Get<float>(), view.GetWheelScrollDistanceStep(), TEST_LOCATION );
+ view.SetProperty( ItemView::Property::WHEEL_SCROLL_DISTANCE_STEP, 5.0f );
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::WHEEL_SCROLL_DISTANCE_STEP).Get<float>(), 5.0f, TEST_LOCATION );
+
+ // Test "snapToItemEnabled" property
+ DALI_TEST_CHECK( view.GetPropertyIndex("snapToItemEnabled") == ItemView::Property::SNAP_TO_ITEM_ENABLED );
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::SNAP_TO_ITEM_ENABLED).Get<bool>(), view.GetAnchoring(), TEST_LOCATION );
+ view.SetProperty( ItemView::Property::SNAP_TO_ITEM_ENABLED, true );
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::SNAP_TO_ITEM_ENABLED).Get<bool>(), true, TEST_LOCATION );
+
+ // Test "refreshInterval" property
+ DALI_TEST_CHECK( view.GetPropertyIndex("refreshInterval") == ItemView::Property::REFRESH_INTERVAL );
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::REFRESH_INTERVAL).Get<float>(), view.GetRefreshInterval(), TEST_LOCATION );
+ view.SetProperty( ItemView::Property::REFRESH_INTERVAL, 11.0f );
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::REFRESH_INTERVAL).Get<float>(), 11.0f, TEST_LOCATION );
+
+ // Test "overshootEnabled" property
+ DALI_TEST_CHECK( view.GetPropertyIndex("overshootEnabled") == Scrollable::Property::OVERSHOOT_ENABLED );
+ DALI_TEST_EQUALS( view.GetProperty(Scrollable::Property::OVERSHOOT_ENABLED).Get<bool>(), view.IsOvershootEnabled(), TEST_LOCATION );
+ view.SetProperty( Scrollable::Property::OVERSHOOT_ENABLED, false );
+ DALI_TEST_EQUALS( view.GetProperty(Scrollable::Property::OVERSHOOT_ENABLED).Get<bool>(), false, TEST_LOCATION );
+
+ // Animatable properties
+
+ // Test "layoutPosition" property
+ DALI_TEST_CHECK( view.GetPropertyIndex("layoutPosition") == ItemView::Property::LAYOUT_POSITION );
+ view.SetProperty( ItemView::Property::LAYOUT_POSITION, 20.5f );
+ Wait(application);
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::LAYOUT_POSITION).Get<float>(), 20.5f, TEST_LOCATION );
+
+ // Test "scrollSpeed" property
+ DALI_TEST_CHECK( view.GetPropertyIndex("scrollSpeed") == ItemView::Property::SCROLL_SPEED );
+ view.SetProperty( ItemView::Property::SCROLL_SPEED, 3.35f );
+ Wait(application);
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::SCROLL_SPEED).Get<float>(), 3.35f, TEST_LOCATION );
+
+ // Test "overshoot" property
+ DALI_TEST_CHECK( view.GetPropertyIndex("overshoot") == ItemView::Property::OVERSHOOT );
+ view.SetProperty( ItemView::Property::OVERSHOOT, 0.15f );
+ Wait(application);
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::OVERSHOOT).Get<float>(), 0.15f, TEST_LOCATION );
+
+ // Test "scrollDirection" property
+ DALI_TEST_CHECK( view.GetPropertyIndex("scrollDirection") == ItemView::Property::SCROLL_DIRECTION );
+ view.SetProperty( ItemView::Property::SCROLL_DIRECTION, Vector2(0.85f, 0.5f) );
+ Wait(application);
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::SCROLL_DIRECTION).Get<Vector2>(), Vector2(0.85f, 0.5f), TEST_LOCATION );
+
+ // Test "layoutOrientation" property
+ DALI_TEST_CHECK( view.GetPropertyIndex("layoutOrientation") == ItemView::Property::LAYOUT_ORIENTATION );
+ view.SetProperty( ItemView::Property::LAYOUT_ORIENTATION, 2 );
+ Wait(application);
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::LAYOUT_ORIENTATION).Get<int>(), 2, TEST_LOCATION );
+
+ // Test "scrollContentSize" property
+ DALI_TEST_CHECK( view.GetPropertyIndex("scrollContentSize") == ItemView::Property::SCROLL_CONTENT_SIZE );
+ view.SetProperty( ItemView::Property::SCROLL_CONTENT_SIZE, 250.0f );
+ Wait(application);
+ DALI_TEST_EQUALS( view.GetProperty(ItemView::Property::SCROLL_CONTENT_SIZE).Get<float>(), 250.0f, TEST_LOCATION );
+
+ END_TEST;
+}
+
+
+int UtcDaliItemViewOvershootVertical(void)
+{
+ ToolkitTestApplication application;
+ Dali::Stage stage = Dali::Stage::GetCurrent();
+
+ // 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);
+
+ view.SetProperty( Scrollable::Property::OVERSHOOT_ENABLED, true );
+ DALI_TEST_EQUALS( view.GetProperty(Scrollable::Property::OVERSHOOT_ENABLED).Get<bool>(), true, TEST_LOCATION );
+
+ view.SetProperty( Scrollable::Property::OVERSHOOT_SIZE, Vector2(30, 30) );
+
+ Wait(application);
+
+ // 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);
+ pos.y += 5.0f;
+ Wait(application, 100);
+
+ for(int i = 0;i<200;i++)
+ {
+ SendPan(application, Gesture::Continuing, pos);
+ pos.y += 5.0f;
+ Wait(application);
+ }
+
+ SendPan(application, Gesture::Finished, pos);
+ 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);
+ pos.y -= 5.0f;
+ Wait(application, 100);
+
+ for(int i = 0;i<200;i++)
+ {
+ SendPan(application, Gesture::Continuing, pos);
+ pos.y -= 5.0f;
+ Wait(application);
+ }
+
+ SendPan(application, Gesture::Finished, pos);
+ Wait(application, 100);
+ END_TEST;
+}
+
+int UtcDaliItemViewOvershootHorizontal(void)
+{
+ ToolkitTestApplication application;
+ Dali::Stage stage = Dali::Stage::GetCurrent();
+
+ // 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::SPIRAL );
+ 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);
+
+ view.SetProperty( Scrollable::Property::OVERSHOOT_ENABLED, true );
+ DALI_TEST_EQUALS( view.GetProperty(Scrollable::Property::OVERSHOOT_ENABLED).Get<bool>(), true, TEST_LOCATION );
+
+ view.SetProperty( Scrollable::Property::OVERSHOOT_SIZE, Vector2(30, 30) );
+
+ Wait(application);
+
+ // 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);
+ pos.x -= 5.0f;
+ Wait(application, 100);
+
+ for(int i = 0;i<200;i++)
+ {
+ SendPan(application, Gesture::Continuing, pos);
+ pos.x -= 5.0f;
+ Wait(application);
+ }
+
+ SendPan(application, Gesture::Finished, pos);
+ 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);
+ pos.x += 5.0f;
+ Wait(application, 100);
+
+ for(int i = 0;i<200;i++)
+ {
+ SendPan(application, Gesture::Continuing, pos);
+ pos.x += 5.0f;
+ Wait(application);
+ }
+
+ SendPan(application, Gesture::Finished, pos);
+ Wait(application, 100);
+
END_TEST;
}