projects
/
platform
/
core
/
uifw
/
dali-toolkit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "(Visual) Support CORNER_RADIUS_POLICY" into devel/master
[platform/core/uifw/dali-toolkit.git]
/
automated-tests
/
src
/
dali-toolkit
/
utc-Dali-ItemView.cpp
diff --git
a/automated-tests/src/dali-toolkit/utc-Dali-ItemView.cpp
b/automated-tests/src/dali-toolkit/utc-Dali-ItemView.cpp
old mode 100755
(executable)
new mode 100644
(file)
index
4891370
..
6b5f743
--- a/
automated-tests/src/dali-toolkit/utc-Dali-ItemView.cpp
+++ b/
automated-tests/src/dali-toolkit/utc-Dali-ItemView.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 20
19
Samsung Electronics Co., Ltd.
+ * Copyright (c) 20
20
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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-135,10
+135,7
@@
public: // From ItemFactory
virtual Actor NewItem(unsigned int itemId)
{
// Create a renderable actor for this item
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 );
}
};
}
};
@@
-156,7
+153,7
@@
int UtcDaliItemViewNew(void)
DALI_TEST_CHECK(view);
//Additional check to ensure object is created by checking if it's registered
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;
DALI_TEST_CHECK( registry );
gObjectCreatedCallBackCalled = false;
@@
-292,7
+289,7
@@
int UtcDaliItemViewActivateLayoutAndGetActiveLayout(void)
DALI_TEST_CHECK(view.GetActiveLayout() == NULL);
// Activate the depth layout
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
view.ActivateLayout(1, stageSize, 0.5f);
// Check the current active layout is the depth layout
@@
-329,7
+326,7
@@
int UtcDaliItemViewDeactivateCurrentLayout(void)
DALI_TEST_CHECK(view.GetActiveLayout() == NULL);
// Activate the grid layout
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
view.ActivateLayout(0, stageSize, 0.5f);
// Check the current active layout is the grid layout
@@
-357,7
+354,7
@@
int UtcDaliItemViewGetItemAndGetItemId(void)
view.AddLayout(*gridLayout);
// Activate the grid layout so that the items will be created and added to ItemView
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
view.ActivateLayout(0, stageSize, 0.5f);
// Get the item given the item ID
@@
-382,7
+379,7
@@
int UtcDaliItemViewRemoveItem(void)
view.AddLayout(*gridLayout);
// Activate the grid layout so that the items will be created and added to ItemView
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
view.ActivateLayout(0, stageSize, 0.5f);
// Get the item given the item ID 2 and 3
@@
-437,7
+434,7
@@
int UtcDaliItemViewGetCurrentLayoutPosition(void)
view.AddLayout(*depthLayout);
// Activate the grid layout so that the items will be created and added to ItemView
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
view.ActivateLayout(0, stageSize, 0.0f);
// Check the current layout position for the 10th items is 9.0f
@@
-537,11
+534,11
@@
int UtcDaliItemViewScrollToItem(void)
Vector3 vec(480.0f, 800.0f, 0.0f);
ItemLayoutPtr layout = DefaultItemLayout::New( DefaultItemLayout::DEPTH );
Vector3 vec(480.0f, 800.0f, 0.0f);
ItemLayoutPtr layout = DefaultItemLayout::New( DefaultItemLayout::DEPTH );
- view.Set
Name(
"view actor");
+ view.Set
Property( Dali::Actor::Property::NAME,
"view actor");
view.AddLayout(*layout);
view.AddLayout(*layout);
- view.Set
Size(vec
);
+ view.Set
Property( Actor::Property::SIZE, vec
);
-
Stage::GetCurrent
().Add(view);
+
application.GetScene
().Add(view);
layout->SetOrientation(ControlOrientation::Down);
view.ActivateLayout(0, vec, 0.0f);
layout->SetOrientation(ControlOrientation::Down);
view.ActivateLayout(0, vec, 0.0f);
@@
-598,7
+595,7
@@
int UtcDaliItemViewScrollToItem(void)
tet_result(TET_FAIL);
}
tet_result(TET_FAIL);
}
-
Stage::GetCurrent
().Remove(view);
+
application.GetScene
().Remove(view);
END_TEST;
}
END_TEST;
}
@@
-632,7
+629,7
@@
int UtcDaliItemViewInsertItemP(void)
view.AddLayout(*gridLayout);
// Activate the grid layout so that the items will be created and added to ItemView
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
view.ActivateLayout(0, stageSize, 0.0f);
// Get the specified item where new item to be inserted before that
@@
-689,7
+686,7
@@
int UtcDaliItemViewInsertItemsP(void)
view.AddLayout(*depthLayout);
// Activate the grid layout so that the items will be created and added to ItemView
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();
view.ActivateLayout(0, stageSize, 0.5f);
unsigned int itemCount = view.GetChildCount();
@@
-706,7
+703,7
@@
int UtcDaliItemViewInsertItemsP(void)
{
Actor child = view.GetChildAt( i );
Actor newActor = Actor::New();
{
Actor child = view.GetChildAt( i );
Actor newActor = Actor::New();
- newActor.Set
Name(
"Inserted");
+ newActor.Set
Property( Dali::Actor::Property::NAME,
"Inserted");
insertList.push_back( Item( view.GetItemId(child), newActor ) );
}
insertList.push_back( Item( view.GetItemId(child), newActor ) );
}
@@
-727,7
+724,7
@@
int UtcDaliItemViewInsertItemsP(void)
{
Actor child = view.GetChildAt( i );
{
Actor child = view.GetChildAt( i );
- if( child.Get
Name(
) == "Inserted" )
+ if( child.Get
Property< std::string >( Dali::Actor::Property::NAME
) == "Inserted" )
{
removeList.push_back( view.GetItemId(child) );
}
{
removeList.push_back( view.GetItemId(child) );
}
@@
-760,7
+757,7
@@
int UtcDaliItemViewReplaceItemP(void)
view.AddLayout(*spiralLayout);
// Activate the grid layout so that the items will be created and added to ItemView
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();
view.ActivateLayout(0, stageSize, 0.5f);
Actor newActor = Actor::New();
@@
-786,7
+783,7
@@
int UtcDaliItemViewReplaceItemsP(void)
view.AddLayout(*spiralLayout);
// Activate the grid layout so that the items will be created and added to ItemView
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;
view.ActivateLayout(0, stageSize, 0.5f);
ItemContainer replaceList;
@@
-795,7
+792,7
@@
int UtcDaliItemViewReplaceItemsP(void)
{
Actor child = view.GetItem( i );
Actor newActor = Actor::New();
{
Actor child = view.GetItem( i );
Actor newActor = Actor::New();
- newActor.Set
Name(
"Replaced");
+ newActor.Set
Property( Dali::Actor::Property::NAME,
"Replaced");
replaceList.push_back( Item( i, newActor ) );
}
replaceList.push_back( Item( i, newActor ) );
}
@@
-805,8
+802,8
@@
int UtcDaliItemViewReplaceItemsP(void)
view.ReplaceItems( replaceList, 0.5f );
}
view.ReplaceItems( replaceList, 0.5f );
}
- DALI_TEST_CHECK(view.GetItem(0).Get
Name(
) == "Replaced");
- DALI_TEST_CHECK(view.GetItem(8).Get
Name(
) == "Replaced");
+ DALI_TEST_CHECK(view.GetItem(0).Get
Property< std::string >( Dali::Actor::Property::NAME
) == "Replaced");
+ DALI_TEST_CHECK(view.GetItem(8).Get
Property< std::string >( Dali::Actor::Property::NAME
) == "Replaced");
END_TEST;
}
END_TEST;
}
@@
-824,7
+821,7
@@
int UtcDaliItemViewGetItemsRangeP(void)
view.AddLayout(*spiralLayout);
// Activate the grid layout so that the items will be created and added to ItemView
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);
view.ActivateLayout(0, stageSize, 0.5f);
ItemRange itemRange(0, 0);
@@
-849,7
+846,7
@@
int UtcDaliItemViewSetItemsAnchorPointP(void)
view.AddLayout(*spiralLayout);
// Activate the grid layout so that the items will be created and added to ItemView
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);
view.ActivateLayout(0, stageSize, 0.5f);
Vector3 anchorPoint(10.0f, 10.0f, 0.0f);
@@
-857,7
+854,7
@@
int UtcDaliItemViewSetItemsAnchorPointP(void)
view.SetItemsAnchorPoint(anchorPoint);
DALI_TEST_CHECK(view.GetItemsAnchorPoint() == anchorPoint);
view.SetItemsAnchorPoint(anchorPoint);
DALI_TEST_CHECK(view.GetItemsAnchorPoint() == anchorPoint);
- DALI_TEST_CHECK(view.GetItem(0).GetCurrent
AnchorPoint(
) == anchorPoint);
+ DALI_TEST_CHECK(view.GetItem(0).GetCurrent
Property< Vector3 >( Actor::Property::ANCHOR_POINT
) == anchorPoint);
END_TEST;
}
END_TEST;
}
@@
-874,7
+871,7
@@
int UtcDaliItemViewSetItemsParentOriginP(void)
view.AddLayout(*gridLayout);
// Activate the grid layout so that the items will be created and added to ItemView
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);
view.ActivateLayout(0, stageSize, 0.5f);
Vector3 parentOrigin(10.0f, 10.0f, 0.0f);
@@
-882,7
+879,7
@@
int UtcDaliItemViewSetItemsParentOriginP(void)
view.SetItemsParentOrigin(parentOrigin);
DALI_TEST_CHECK(view.GetItemsParentOrigin() == parentOrigin);
view.SetItemsParentOrigin(parentOrigin);
DALI_TEST_CHECK(view.GetItemsParentOrigin() == parentOrigin);
- DALI_TEST_CHECK(view.GetItem(0).GetCurrentP
arentOrigin(
) == parentOrigin);
+ DALI_TEST_CHECK(view.GetItem(0).GetCurrentP
roperty< Vector3 >( Actor::Property::PARENT_ORIGIN
) == parentOrigin);
END_TEST;
}
END_TEST;
}
@@
-906,7
+903,7
@@
int UtcDaliItemViewLayoutActivatedSignalP(void)
ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
view.AddLayout(*gridLayout);
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 );
// Connect the layout activated signal
view.LayoutActivatedSignal().Connect( &OnLayoutActivated );
@@
-918,7
+915,7
@@
int UtcDaliItemViewLayoutActivatedSignalP(void)
application.Render();
// Activate the grid layout so that the items will be created and added to ItemView
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
view.ActivateLayout(0, stageSize, 0.1f);
// Wait for 0.1 second
@@
-1092,7
+1089,7
@@
int UtcDaliItemViewSetGetProperty(void)
int UtcDaliItemViewOvershootVertical(void)
{
ToolkitTestApplication application;
int UtcDaliItemViewOvershootVertical(void)
{
ToolkitTestApplication application;
- Dali::
Stage stage = Dali::Stage::GetCurrent
();
+ Dali::
Integration::Scene stage = application.GetScene
();
// Create the ItemView actor
TestItemFactory factory;
// Create the ItemView actor
TestItemFactory factory;
@@
-1158,7
+1155,7
@@
int UtcDaliItemViewOvershootVertical(void)
int UtcDaliItemViewOvershootHorizontal(void)
{
ToolkitTestApplication application;
int UtcDaliItemViewOvershootHorizontal(void)
{
ToolkitTestApplication application;
- Dali::
Stage stage = Dali::Stage::GetCurrent
();
+ Dali::
Integration::Scene stage = application.GetScene
();
// Create the ItemView actor
TestItemFactory factory;
// Create the ItemView actor
TestItemFactory factory;
@@
-1220,7
+1217,7
@@
int UtcDaliItemViewOvershootHorizontal(void)
int UtcDaliItemEnableDisableRefresh(void)
{
ToolkitTestApplication application;
int UtcDaliItemEnableDisableRefresh(void)
{
ToolkitTestApplication application;
- Dali::
Stage stage = Dali::Stage::GetCurrent
();
+ Dali::
Integration::Scene stage = application.GetScene
();
// Create the ItemView actor
TestItemFactory factory;
// Create the ItemView actor
TestItemFactory factory;