+
+ Vector3 itemSize(100.0f, 100.0f, 100.0f);
+ layout->SetItemSize(itemSize);
+
+ Vector3 itemSize1;
+ layout->GetItemSize(0u, Vector3(Stage::GetCurrent().GetSize()), itemSize1);
+
+ DALI_TEST_CHECK(itemSize == itemSize1);
+
+ float position = layout->GetClosestOnScreenLayoutPosition(0, 0.0f, Vector3(Stage::GetCurrent().GetSize()));
+
+ DALI_TEST_EQUALS(position, 0.0f, TEST_LOCATION);
+
+ int focusItem = layout->GetNextFocusItemID(0, TOTAL_ITEM_NUMBER, Control::KeyboardFocus::LEFT, true);
+
+ DALI_TEST_CHECK(focusItem != 0);
+
+ float flickSpeedFactor = layout->GetFlickSpeedFactor();
+
+ DALI_TEST_CHECK(flickSpeedFactor != 0.0f);
+
+ // White box test here: -( itemId / NoOfItemsPerRow(default 4) ) * NoOfItemsPerRow
+ DALI_TEST_EQUALS( -1.0f, gridLayout->GetItemScrollToPosition( 1 ), TEST_LOCATION );
+
+ ItemLayoutPtr depthLayout = DefaultItemLayout::New( DefaultItemLayout::DEPTH );
+ view.AddLayout(*depthLayout);
+
+ layout = view.GetLayout(1);
+ DALI_TEST_CHECK(depthLayout == layout);
+
+ ItemLayoutPtr listLayout = DefaultItemLayout::New( DefaultItemLayout::LIST );
+ view.AddLayout(*listLayout);
+
+ layout = view.GetLayout(2);
+ DALI_TEST_CHECK(listLayout == layout);
+
+ ItemLayoutPtr spiralLayout = DefaultItemLayout::New( DefaultItemLayout::SPIRAL );
+ view.AddLayout(*spiralLayout);
+
+ layout = view.GetLayout(3);
+ DALI_TEST_CHECK(spiralLayout == layout);
+ END_TEST;
+}
+
+int UtcDaliItemLayoutGetExtension(void)
+{
+ ToolkitTestApplication application;
+
+ ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+ DALI_TEST_CHECK( gridLayout );
+ DALI_TEST_CHECK( !gridLayout->GetExtension() );
+
+ END_TEST;
+}
+
+int UtcDaliItemLayoutGetClosestOnScreenLayoutPosition(void)
+{
+ ToolkitTestApplication application;
+
+ TestItemLayoutPtr layout = TestItemLayout::New();
+ DALI_TEST_CHECK( layout );
+ DALI_TEST_EQUALS(layout->GetClosestOnScreenLayoutPosition(0, 0.0f, Vector3::ZERO), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(layout->GetClosestOnScreenLayoutPosition(0, 0.0f, Vector3(-800.0f, -1200.0f, 0.0f)), 0.0f, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliItemLayoutGetNextFocusItemID(void)
+{
+ ToolkitTestApplication application;
+
+ TestItemLayoutPtr layout = TestItemLayout::New();
+ DALI_TEST_CHECK( layout );
+ DALI_TEST_EQUALS(layout->GetNextFocusItemID(0, 100, Control::KeyboardFocus::LEFT, true), 99, TEST_LOCATION );
+ DALI_TEST_EQUALS(layout->GetNextFocusItemID(110, 100, Control::KeyboardFocus::RIGHT, true), 0, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliItemRangeIntersection(void)
+{
+ ToolkitTestApplication application;
+
+ unsigned int uBeginItemFirst = 100u, uEndItemFirst = 300u;
+ unsigned int uBeginItemSecond = 290u, uEndItemSecond = 400;
+ unsigned int uInterBeginCheck=290u , uInterEndCheck=301u;
+ bool bIsInThisRange = false, bOutOfThisRange = false;
+
+ Toolkit::ItemRange objItemRangeFirst(uBeginItemFirst, uEndItemFirst);
+ Toolkit::ItemRange objItemRangeSecond(uBeginItemSecond, uEndItemSecond);
+ ItemRange itmInterSect = objItemRangeFirst.Intersection(objItemRangeSecond);
+
+ bIsInThisRange = itmInterSect.Within(uInterBeginCheck);
+ DALI_TEST_EQUALS(bIsInThisRange, true, TEST_LOCATION );
+
+ bOutOfThisRange = itmInterSect.Within(uInterEndCheck);
+ DALI_TEST_EQUALS(bOutOfThisRange, false, TEST_LOCATION );
+