/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
#include <stdlib.h>
-
+#include <iostream>
// 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-toolkit/devel-api/controls/alignment/alignment.h>
#include <dali/integration-api/events/key-event-integ.h>
#include <dali/integration-api/events/touch-event-integ.h>
-#include <dali-toolkit/devel-api/controls/alignment/alignment.h>
-#include <dali-toolkit/dali-toolkit.h>
using namespace Dali;
using namespace Dali::Toolkit;
namespace
{
/// Compare an int (Or'd Alignment::Type) with an Alignment::Type value
-void DALI_TEST_EQUALS( int value1, Alignment::Type value2, const char* location )
+void DALI_TEST_EQUALS(int value1, Alignment::Type value2, const char* location)
{
- ::DALI_TEST_EQUALS< Alignment::Type >( static_cast< Alignment::Type >( value1 ), value2, location );
+ ::DALI_TEST_EQUALS<Alignment::Type>(static_cast<Alignment::Type>(value1), value2, location);
}
static bool gObjectCreatedCallBackCalled;
}
} // namespace
-
int UtcDaliAlignmentConstructorNegative(void)
{
ToolkitTestApplication application;
alignment.SetPadding(padding);
tet_result(TET_FAIL);
}
- catch (DaliException& e)
+ catch(DaliException& e)
{
- DALI_TEST_ASSERT(e, "alignment", TEST_LOCATION );
+ DALI_TEST_ASSERT(e, "alignment", TEST_LOCATION);
}
END_TEST;
}
alignment.SetPadding(padding);
tet_result(TET_PASS);
}
- catch (DaliException& exception)
+ catch(DaliException& exception)
{
tet_result(TET_FAIL);
}
Actor actor = alignment;
- alignment = Alignment::DownCast( actor );
+ alignment = Alignment::DownCast(actor);
- DALI_TEST_CHECK( alignment );
+ DALI_TEST_CHECK(alignment);
END_TEST;
}
//To ensure the object is registered after creation
ObjectRegistry registry = application.GetCore().GetObjectRegistry();
- DALI_TEST_CHECK( registry );
+ DALI_TEST_CHECK(registry);
gObjectCreatedCallBackCalled = false;
registry.ObjectCreatedSignal().Connect(&TestCallback);
{
Alignment alignment = Alignment::New();
}
- DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
+ DALI_TEST_CHECK(gObjectCreatedCallBackCalled);
END_TEST;
}
// Setting HORIZONTAL_LEFT, HORIZONTAL_CENTER
{
- Alignment alignment = Alignment::New();
+ Alignment alignment = Alignment::New();
Alignment::Type type(Alignment::Type(Alignment::HORIZONTAL_LEFT | Alignment::HORIZONTAL_CENTER));
alignment.SetAlignmentType(type);
// center will prevail in conflict
- DALI_TEST_CHECK( Alignment::HORIZONTAL_CENTER & alignment.GetAlignmentType() );
- DALI_TEST_CHECK( !(Alignment::HORIZONTAL_LEFT & alignment.GetAlignmentType()) );
+ DALI_TEST_CHECK(Alignment::HORIZONTAL_CENTER & alignment.GetAlignmentType());
+ DALI_TEST_CHECK(!(Alignment::HORIZONTAL_LEFT & alignment.GetAlignmentType()));
}
// Setting HORIZONTAL_CENTER, HORIZONTAL_RIGHT
{
- Alignment alignment = Alignment::New();
+ Alignment alignment = Alignment::New();
Alignment::Type type(Alignment::Type(Alignment::HORIZONTAL_CENTER | Alignment::HORIZONTAL_RIGHT));
alignment.SetAlignmentType(type);
// center will prevail in conflict
- DALI_TEST_CHECK( Alignment::HORIZONTAL_CENTER & alignment.GetAlignmentType() );
- DALI_TEST_CHECK( !(Alignment::HORIZONTAL_RIGHT & alignment.GetAlignmentType()) );
+ DALI_TEST_CHECK(Alignment::HORIZONTAL_CENTER & alignment.GetAlignmentType());
+ DALI_TEST_CHECK(!(Alignment::HORIZONTAL_RIGHT & alignment.GetAlignmentType()));
}
// Setting VERTICAL_TOP, VERTICAL_CENTER
{
- Alignment alignment = Alignment::New();
+ Alignment alignment = Alignment::New();
Alignment::Type type(Alignment::Type(Alignment::VERTICAL_TOP | Alignment::VERTICAL_CENTER));
alignment.SetAlignmentType(type);
// center will prevail in conflict
- DALI_TEST_CHECK( Alignment::VERTICAL_CENTER & alignment.GetAlignmentType() );
- DALI_TEST_CHECK( !(Alignment::VERTICAL_TOP & alignment.GetAlignmentType()) );
+ DALI_TEST_CHECK(Alignment::VERTICAL_CENTER & alignment.GetAlignmentType());
+ DALI_TEST_CHECK(!(Alignment::VERTICAL_TOP & alignment.GetAlignmentType()));
}
// Setting VERTICAL_CENTER, VERTICAL_BOTTOM
{
- Alignment alignment = Alignment::New();
+ Alignment alignment = Alignment::New();
Alignment::Type type(Alignment::Type(Alignment::VERTICAL_TOP | Alignment::VERTICAL_BOTTOM));
alignment.SetAlignmentType(type);
// top will prevail in conflict
- DALI_TEST_CHECK( Alignment::VERTICAL_TOP & alignment.GetAlignmentType() );
- DALI_TEST_CHECK( !(Alignment::VERTICAL_BOTTOM & alignment.GetAlignmentType()) );
+ DALI_TEST_CHECK(Alignment::VERTICAL_TOP & alignment.GetAlignmentType());
+ DALI_TEST_CHECK(!(Alignment::VERTICAL_BOTTOM & alignment.GetAlignmentType()));
}
END_TEST;
}
Alignment alignment = Alignment::New();
Alignment::Padding padding(1.0f, 1.5f, 2.f, 0.5f);
- DALI_TEST_CHECK( fabs( padding.left - alignment.GetPadding().left ) > GetRangedEpsilon( padding.left, alignment.GetPadding().left ) );
- DALI_TEST_CHECK( fabs( padding.right - alignment.GetPadding().right ) > GetRangedEpsilon( padding.right, alignment.GetPadding().right ) );
- DALI_TEST_CHECK( fabs( padding.top - alignment.GetPadding().top ) > GetRangedEpsilon( padding.top, alignment.GetPadding().top ) );
- DALI_TEST_CHECK( fabs( padding.bottom - alignment.GetPadding().bottom ) > GetRangedEpsilon( padding.bottom, alignment.GetPadding().bottom ) );
+ DALI_TEST_CHECK(fabs(padding.left - alignment.GetPadding().left) > GetRangedEpsilon(padding.left, alignment.GetPadding().left));
+ DALI_TEST_CHECK(fabs(padding.right - alignment.GetPadding().right) > GetRangedEpsilon(padding.right, alignment.GetPadding().right));
+ DALI_TEST_CHECK(fabs(padding.top - alignment.GetPadding().top) > GetRangedEpsilon(padding.top, alignment.GetPadding().top));
+ DALI_TEST_CHECK(fabs(padding.bottom - alignment.GetPadding().bottom) > GetRangedEpsilon(padding.bottom, alignment.GetPadding().bottom));
alignment.SetPadding(padding);
- DALI_TEST_CHECK( fabs( padding.left - alignment.GetPadding().left ) < GetRangedEpsilon( padding.left, alignment.GetPadding().left ) );
- DALI_TEST_CHECK( fabs( padding.right - alignment.GetPadding().right ) < GetRangedEpsilon( padding.right, alignment.GetPadding().right ) );
- DALI_TEST_CHECK( fabs( padding.top - alignment.GetPadding().top ) < GetRangedEpsilon( padding.top, alignment.GetPadding().top ) );
- DALI_TEST_CHECK( fabs( padding.bottom - alignment.GetPadding().bottom ) < GetRangedEpsilon( padding.bottom, alignment.GetPadding().bottom ) );
+ DALI_TEST_CHECK(fabs(padding.left - alignment.GetPadding().left) < GetRangedEpsilon(padding.left, alignment.GetPadding().left));
+ DALI_TEST_CHECK(fabs(padding.right - alignment.GetPadding().right) < GetRangedEpsilon(padding.right, alignment.GetPadding().right));
+ DALI_TEST_CHECK(fabs(padding.top - alignment.GetPadding().top) < GetRangedEpsilon(padding.top, alignment.GetPadding().top));
+ DALI_TEST_CHECK(fabs(padding.bottom - alignment.GetPadding().bottom) < GetRangedEpsilon(padding.bottom, alignment.GetPadding().bottom));
END_TEST;
}
alignment.SetPadding(padding);
tet_result(TET_FAIL);
}
- catch (DaliException& e)
+ catch(DaliException& e)
{
- DALI_TEST_ASSERT(e, "(padding.left >= 0.f) && (padding.top >= 0.f) && (padding.right >= 0.f) && (padding.bottom >= 0.f)", TEST_LOCATION );
+ DALI_TEST_ASSERT(e, "(padding.left >= 0.f) && (padding.top >= 0.f) && (padding.right >= 0.f) && (padding.bottom >= 0.f)", TEST_LOCATION);
}
try
alignment.SetPadding(padding);
tet_result(TET_FAIL);
}
- catch (DaliException& e)
+ catch(DaliException& e)
{
- DALI_TEST_ASSERT(e, "(padding.left >= 0.f) && (padding.top >= 0.f) && (padding.right >= 0.f) && (padding.bottom >= 0.f)", TEST_LOCATION );
+ DALI_TEST_ASSERT(e, "(padding.left >= 0.f) && (padding.top >= 0.f) && (padding.right >= 0.f) && (padding.bottom >= 0.f)", TEST_LOCATION);
}
try
alignment.SetPadding(padding);
tet_result(TET_FAIL);
}
- catch (DaliException& e)
+ catch(DaliException& e)
{
- DALI_TEST_ASSERT(e, "(padding.left >= 0.f) && (padding.top >= 0.f) && (padding.right >= 0.f) && (padding.bottom >= 0.f)", TEST_LOCATION );
+ DALI_TEST_ASSERT(e, "(padding.left >= 0.f) && (padding.top >= 0.f) && (padding.right >= 0.f) && (padding.bottom >= 0.f)", TEST_LOCATION);
}
try
alignment.SetPadding(padding);
tet_result(TET_FAIL);
}
- catch (DaliException& e)
+ catch(DaliException& e)
{
- DALI_TEST_ASSERT(e, "(padding.left >= 0.f) && (padding.top >= 0.f) && (padding.right >= 0.f) && (padding.bottom >= 0.f)", TEST_LOCATION );
+ DALI_TEST_ASSERT(e, "(padding.left >= 0.f) && (padding.top >= 0.f) && (padding.right >= 0.f) && (padding.bottom >= 0.f)", TEST_LOCATION);
}
END_TEST;
}
ToolkitTestApplication application;
Alignment alignment = Alignment::New();
- DALI_TEST_CHECK( fabs( alignment.GetPadding().left ) < GetRangedEpsilon( 0.f, alignment.GetPadding().left ) );
- DALI_TEST_CHECK( fabs( alignment.GetPadding().right ) < GetRangedEpsilon( 0.f, alignment.GetPadding().right ) );
- DALI_TEST_CHECK( fabs( alignment.GetPadding().top ) < GetRangedEpsilon( 0.f, alignment.GetPadding().top ) );
- DALI_TEST_CHECK( fabs( alignment.GetPadding().bottom ) < GetRangedEpsilon( 0.f, alignment.GetPadding().bottom ) );
+ DALI_TEST_CHECK(fabs(alignment.GetPadding().left) < GetRangedEpsilon(0.f, alignment.GetPadding().left));
+ DALI_TEST_CHECK(fabs(alignment.GetPadding().right) < GetRangedEpsilon(0.f, alignment.GetPadding().right));
+ DALI_TEST_CHECK(fabs(alignment.GetPadding().top) < GetRangedEpsilon(0.f, alignment.GetPadding().top));
+ DALI_TEST_CHECK(fabs(alignment.GetPadding().bottom) < GetRangedEpsilon(0.f, alignment.GetPadding().bottom));
Alignment::Padding padding(1.0f, 1.5f, 2.f, 0.f);
alignment.SetPadding(padding);
- DALI_TEST_CHECK( fabs( padding.left - alignment.GetPadding().left ) < GetRangedEpsilon( padding.left, alignment.GetPadding().left ) );
- DALI_TEST_CHECK( fabs( padding.right - alignment.GetPadding().right ) < GetRangedEpsilon( padding.right, alignment.GetPadding().right ) );
- DALI_TEST_CHECK( fabs( padding.top - alignment.GetPadding().top ) < GetRangedEpsilon( padding.top, alignment.GetPadding().top ) );
- DALI_TEST_CHECK( fabs( padding.bottom - alignment.GetPadding().bottom ) < GetRangedEpsilon( padding.bottom, alignment.GetPadding().bottom ) );
+ DALI_TEST_CHECK(fabs(padding.left - alignment.GetPadding().left) < GetRangedEpsilon(padding.left, alignment.GetPadding().left));
+ DALI_TEST_CHECK(fabs(padding.right - alignment.GetPadding().right) < GetRangedEpsilon(padding.right, alignment.GetPadding().right));
+ DALI_TEST_CHECK(fabs(padding.top - alignment.GetPadding().top) < GetRangedEpsilon(padding.top, alignment.GetPadding().top));
+ DALI_TEST_CHECK(fabs(padding.bottom - alignment.GetPadding().bottom) < GetRangedEpsilon(padding.bottom, alignment.GetPadding().bottom));
END_TEST;
}
application.Render();
application.SendNotification();
- Vector2 size( 100.0f, 200.0f );
- alignment.SetProperty( Actor::Property::SIZE, size);
+ Vector2 size(100.0f, 200.0f);
+ alignment.SetProperty(Actor::Property::SIZE, size);
application.Render();
application.SendNotification();
ToolkitTestApplication application;
Alignment alignment = Alignment::New();
- alignment.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
- alignment.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+ alignment.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ alignment.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
application.GetScene().Add(alignment);
alignment.TouchedSignal().Connect(&TouchCallback);
application.SendNotification();
Integration::TouchEvent touchEvent(1);
- Integration::Point point;
- point.SetDeviceId( 1 );
- point.SetState( PointState::DOWN);
- point.SetScreenPosition( Vector2( 20.0f, 20.0f ) );
+ Integration::Point point;
+ point.SetDeviceId(1);
+ point.SetState(PointState::DOWN);
+ point.SetScreenPosition(Vector2(20.0f, 20.0f));
touchEvent.AddPoint(point);
application.ProcessEvent(touchEvent);
application.GetScene().Add(alignment);
Animation animation = Animation::New(100.0f);
- animation.AnimateTo( Property( alignment, Actor::Property::SIZE ), Vector3( 100.0f, 150.0f, 200.0f ) );
+ animation.AnimateTo(Property(alignment, Actor::Property::SIZE), Vector3(100.0f, 150.0f, 200.0f));
animation.Play();
application.Render();
alignment.SetPadding(padding);
Alignment alignmentCopy(alignment);
- DALI_TEST_CHECK( fabs( padding.left - alignmentCopy.GetPadding().left ) < GetRangedEpsilon( padding.left, alignmentCopy.GetPadding().left ) );
- DALI_TEST_CHECK( fabs( padding.right - alignmentCopy.GetPadding().right ) < GetRangedEpsilon( padding.right, alignmentCopy.GetPadding().right ) );
- DALI_TEST_CHECK( fabs( padding.top - alignmentCopy.GetPadding().top ) < GetRangedEpsilon( padding.top, alignmentCopy.GetPadding().top ) );
- DALI_TEST_CHECK( fabs( padding.bottom - alignmentCopy.GetPadding().bottom ) < GetRangedEpsilon( padding.bottom, alignmentCopy.GetPadding().bottom ) );
+ DALI_TEST_CHECK(fabs(padding.left - alignmentCopy.GetPadding().left) < GetRangedEpsilon(padding.left, alignmentCopy.GetPadding().left));
+ DALI_TEST_CHECK(fabs(padding.right - alignmentCopy.GetPadding().right) < GetRangedEpsilon(padding.right, alignmentCopy.GetPadding().right));
+ DALI_TEST_CHECK(fabs(padding.top - alignmentCopy.GetPadding().top) < GetRangedEpsilon(padding.top, alignmentCopy.GetPadding().top));
+ DALI_TEST_CHECK(fabs(padding.bottom - alignmentCopy.GetPadding().bottom) < GetRangedEpsilon(padding.bottom, alignmentCopy.GetPadding().bottom));
Alignment alignmentEmptyCopy(emptyAlignment);
DALI_TEST_CHECK(emptyAlignment == alignmentEmptyCopy);
Alignment alignmentEquals;
alignmentEquals = alignment;
- DALI_TEST_CHECK( fabs( padding.left - alignmentEquals.GetPadding().left ) < GetRangedEpsilon( padding.left, alignmentEquals.GetPadding().left ) );
- DALI_TEST_CHECK( fabs( padding.right - alignmentEquals.GetPadding().right ) < GetRangedEpsilon( padding.right, alignmentEquals.GetPadding().right ) );
- DALI_TEST_CHECK( fabs( padding.top - alignmentEquals.GetPadding().top ) < GetRangedEpsilon( padding.top, alignmentEquals.GetPadding().top ) );
- DALI_TEST_CHECK( fabs( padding.bottom - alignmentEquals.GetPadding().bottom ) < GetRangedEpsilon( padding.bottom, alignmentEquals.GetPadding().bottom ) );
+ DALI_TEST_CHECK(fabs(padding.left - alignmentEquals.GetPadding().left) < GetRangedEpsilon(padding.left, alignmentEquals.GetPadding().left));
+ DALI_TEST_CHECK(fabs(padding.right - alignmentEquals.GetPadding().right) < GetRangedEpsilon(padding.right, alignmentEquals.GetPadding().right));
+ DALI_TEST_CHECK(fabs(padding.top - alignmentEquals.GetPadding().top) < GetRangedEpsilon(padding.top, alignmentEquals.GetPadding().top));
+ DALI_TEST_CHECK(fabs(padding.bottom - alignmentEquals.GetPadding().bottom) < GetRangedEpsilon(padding.bottom, alignmentEquals.GetPadding().bottom));
Alignment alignmentEmptyEquals;
alignmentEmptyEquals = emptyAlignment;
-
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
* limitations under the License.
*/
-#include <iostream>
#include <stdlib.h>
+#include <iostream>
+
#include <dali-toolkit-test-suite-utils.h>
-#include <toolkit-timer.h>
+
#include <toolkit-event-thread-callback.h>
+#include <toolkit-timer.h>
+
#include <dali-toolkit/dali-toolkit.h>
-#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
#include <dali-toolkit/devel-api/controls/control-devel.h>
-#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
-#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
+#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
#include <dali-toolkit/devel-api/visuals/animated-image-visual-actions-devel.h>
+#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
+
#include "dummy-control.h"
using namespace Dali;
namespace
{
-const char* TEST_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/application-icon-%02d.png";
-const char* TEST_GIF_FILE_NAME = TEST_RESOURCE_DIR "/anim.gif";
-}
-
+const char* TEST_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/application-icon-%02d.png";
+const char* TEST_GIF_FILE_NAME = TEST_RESOURCE_DIR "/anim.gif";
+} // namespace
-void CopyUrlsIntoArray( Property::Array& urls, int startIndex=0 )
+void CopyUrlsIntoArray(Property::Array& urls, int startIndex = 0)
{
- for( int i=20+startIndex;i<=30;++i)
+ for(int i = 20 + startIndex; i <= 30; ++i)
{
char* url;
if(asprintf(&url, TEST_IMAGE_FILE_NAME, i) > 0)
int UtcDaliAnimatedImageVisualGetPropertyMap01(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliAnimatedImageVisualGetPropertyMap" );
+ tet_infoline("UtcDaliAnimatedImageVisualGetPropertyMap");
// request AnimatedImageVisual with a property map
- VisualFactory factory = VisualFactory::Get();
- Visual::Base animatedImageVisual = factory.CreateVisual(
+ VisualFactory factory = VisualFactory::Get();
+ Visual::Base animatedImageVisual = factory.CreateVisual(
Property::Map()
- .Add( Toolkit::Visual::Property::TYPE, Visual::ANIMATED_IMAGE )
- .Add( ImageVisual::Property::URL, TEST_GIF_FILE_NAME )
- .Add( ImageVisual::Property::PIXEL_AREA, Vector4() )
- .Add( ImageVisual::Property::WRAP_MODE_U, WrapMode::REPEAT )
- .Add( ImageVisual::Property::WRAP_MODE_V, WrapMode::DEFAULT )
- .Add( DevelVisual::Property::CORNER_RADIUS, 22.2f )
- .Add( DevelVisual::Property::CORNER_RADIUS_POLICY, Visual::Transform::Policy::ABSOLUTE )
- .Add( DevelVisual::Property::BORDERLINE_WIDTH, 33.3f )
- .Add( DevelVisual::Property::BORDERLINE_COLOR, Color::RED )
- .Add( DevelVisual::Property::BORDERLINE_OFFSET, 0.3f ));
+ .Add(Toolkit::Visual::Property::TYPE, Visual::ANIMATED_IMAGE)
+ .Add(ImageVisual::Property::URL, TEST_GIF_FILE_NAME)
+ .Add(ImageVisual::Property::PIXEL_AREA, Vector4())
+ .Add(ImageVisual::Property::WRAP_MODE_U, WrapMode::REPEAT)
+ .Add(ImageVisual::Property::WRAP_MODE_V, WrapMode::DEFAULT)
+ .Add(DevelVisual::Property::CORNER_RADIUS, 22.2f)
+ .Add(DevelVisual::Property::CORNER_RADIUS_POLICY, Visual::Transform::Policy::ABSOLUTE)
+ .Add(DevelVisual::Property::BORDERLINE_WIDTH, 33.3f)
+ .Add(DevelVisual::Property::BORDERLINE_COLOR, Color::RED)
+ .Add(DevelVisual::Property::BORDERLINE_OFFSET, 0.3f));
Property::Map resultMap;
- animatedImageVisual.CreatePropertyMap( resultMap );
+ animatedImageVisual.CreatePropertyMap(resultMap);
// check the property values from the returned map from a visual
- Property::Value* value = resultMap.Find( Toolkit::Visual::Property::TYPE, Property::INTEGER );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get<int>() == Visual::ANIMATED_IMAGE );
+ Property::Value* value = resultMap.Find(Toolkit::Visual::Property::TYPE, Property::INTEGER);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<int>() == Visual::ANIMATED_IMAGE);
- value = resultMap.Find( ImageVisual::Property::URL, Property::STRING );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get<std::string>() == TEST_GIF_FILE_NAME );
+ value = resultMap.Find(ImageVisual::Property::URL, Property::STRING);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<std::string>() == TEST_GIF_FILE_NAME);
- value = resultMap.Find( DevelVisual::Property::CORNER_RADIUS, Property::VECTOR4 );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<Vector4>(), Vector4(22.2f, 22.2f, 22.2f, 22.2f), TEST_LOCATION );
+ value = resultMap.Find(DevelVisual::Property::CORNER_RADIUS, Property::VECTOR4);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector4>(), Vector4(22.2f, 22.2f, 22.2f, 22.2f), TEST_LOCATION);
- value = resultMap.Find( Toolkit::DevelVisual::Property::CORNER_RADIUS_POLICY, Property::INTEGER );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get<int>() == Visual::Transform::Policy::ABSOLUTE );
+ value = resultMap.Find(Toolkit::DevelVisual::Property::CORNER_RADIUS_POLICY, Property::INTEGER);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<int>() == Visual::Transform::Policy::ABSOLUTE);
- value = resultMap.Find( DevelVisual::Property::BORDERLINE_WIDTH, Property::FLOAT );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<float>(), 33.3f, TEST_LOCATION );
+ value = resultMap.Find(DevelVisual::Property::BORDERLINE_WIDTH, Property::FLOAT);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<float>(), 33.3f, TEST_LOCATION);
- value = resultMap.Find( DevelVisual::Property::BORDERLINE_COLOR, Property::VECTOR4 );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<Vector4>(), Color::RED, TEST_LOCATION );
+ value = resultMap.Find(DevelVisual::Property::BORDERLINE_COLOR, Property::VECTOR4);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector4>(), Color::RED, TEST_LOCATION);
- value = resultMap.Find( DevelVisual::Property::BORDERLINE_OFFSET, Property::FLOAT );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<float>(), 0.3f, TEST_LOCATION );
+ value = resultMap.Find(DevelVisual::Property::BORDERLINE_OFFSET, Property::FLOAT);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<float>(), 0.3f, TEST_LOCATION);
// request AnimatedImageVisual with an URL
- Visual::Base animatedImageVisual2 = factory.CreateVisual( TEST_GIF_FILE_NAME, ImageDimensions() );
+ Visual::Base animatedImageVisual2 = factory.CreateVisual(TEST_GIF_FILE_NAME, ImageDimensions());
resultMap.Clear();
- animatedImageVisual2.CreatePropertyMap( resultMap );
+ animatedImageVisual2.CreatePropertyMap(resultMap);
// check the property values from the returned map from a visual
- value = resultMap.Find( Toolkit::Visual::Property::TYPE, Property::INTEGER );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get<int>() == Visual::ANIMATED_IMAGE );
+ value = resultMap.Find(Toolkit::Visual::Property::TYPE, Property::INTEGER);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<int>() == Visual::ANIMATED_IMAGE);
- value = resultMap.Find( ImageVisual::Property::URL, Property::STRING );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get<std::string>() == TEST_GIF_FILE_NAME );
+ value = resultMap.Find(ImageVisual::Property::URL, Property::STRING);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<std::string>() == TEST_GIF_FILE_NAME);
END_TEST;
}
-
int UtcDaliAnimatedImageVisualGetPropertyMap02(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliAnimatedImageVisualGetPropertyMap for multi image with fixed cache" );
+ tet_infoline("UtcDaliAnimatedImageVisualGetPropertyMap for multi image with fixed cache");
// request AnimatedImageVisual with a property map
- VisualFactory factory = VisualFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
Property::Array urls;
- CopyUrlsIntoArray( urls );
+ CopyUrlsIntoArray(urls);
Visual::Base animatedImageVisual = factory.CreateVisual(
Property::Map()
- .Add( Toolkit::Visual::Property::TYPE, Visual::ANIMATED_IMAGE )
- .Add( "url", urls )
- .Add( "batchSize", 4 )
- .Add( "cacheSize", 20 )
- .Add( "loopCount", 10 )
- .Add( "frameDelay", 200 )
- .Add( "pixelArea", Vector4() )
- .Add( "wrapModeU", WrapMode::REPEAT )
- .Add( "wrapModeV", WrapMode::DEFAULT )
- .Add( "cornerRadius", Vector4(50.0f, 25.0f, 12.5f, 33.0f) )
- .Add( "cornerRadiusPolicy", Visual::Transform::Policy::RELATIVE )
- .Add( "borderlineWidth", 20.0f )
- .Add( "borderlineColor", Vector4() )
- .Add( "borderlineOffset", -1.0f));
+ .Add(Toolkit::Visual::Property::TYPE, Visual::ANIMATED_IMAGE)
+ .Add("url", urls)
+ .Add("batchSize", 4)
+ .Add("cacheSize", 20)
+ .Add("loopCount", 10)
+ .Add("frameDelay", 200)
+ .Add("pixelArea", Vector4())
+ .Add("wrapModeU", WrapMode::REPEAT)
+ .Add("wrapModeV", WrapMode::DEFAULT)
+ .Add("cornerRadius", Vector4(50.0f, 25.0f, 12.5f, 33.0f))
+ .Add("cornerRadiusPolicy", Visual::Transform::Policy::RELATIVE)
+ .Add("borderlineWidth", 20.0f)
+ .Add("borderlineColor", Vector4())
+ .Add("borderlineOffset", -1.0f));
Property::Map resultMap;
- animatedImageVisual.CreatePropertyMap( resultMap );
+ animatedImageVisual.CreatePropertyMap(resultMap);
// check the property values from the returned map from a visual
- Property::Value* value = resultMap.Find( Toolkit::Visual::Property::TYPE, Property::INTEGER );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get<int>() == Visual::ANIMATED_IMAGE );
+ Property::Value* value = resultMap.Find(Toolkit::Visual::Property::TYPE, Property::INTEGER);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<int>() == Visual::ANIMATED_IMAGE);
- value = resultMap.Find( ImageVisual::Property::URL, "url" );
- DALI_TEST_CHECK( value );
+ value = resultMap.Find(ImageVisual::Property::URL, "url");
+ DALI_TEST_CHECK(value);
Property::Array* resultUrls = value->GetArray();
- DALI_TEST_CHECK( resultUrls );
- DALI_TEST_EQUALS( resultUrls->Count(), urls.Count(), TEST_LOCATION );
+ DALI_TEST_CHECK(resultUrls);
+ DALI_TEST_EQUALS(resultUrls->Count(), urls.Count(), TEST_LOCATION);
- value = resultMap.Find( ImageVisual::Property::BATCH_SIZE, "batchSize" );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<int>(), 4, TEST_LOCATION );
+ value = resultMap.Find(ImageVisual::Property::BATCH_SIZE, "batchSize");
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<int>(), 4, TEST_LOCATION);
- value = resultMap.Find( ImageVisual::Property::CACHE_SIZE, "cacheSize" );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<int>(), 20, TEST_LOCATION );
+ value = resultMap.Find(ImageVisual::Property::CACHE_SIZE, "cacheSize");
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<int>(), 20, TEST_LOCATION);
- value = resultMap.Find( Toolkit::DevelImageVisual::Property::LOOP_COUNT, "loopCount" );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<int>(), 10, TEST_LOCATION );
+ value = resultMap.Find(Toolkit::DevelImageVisual::Property::LOOP_COUNT, "loopCount");
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<int>(), 10, TEST_LOCATION);
- value = resultMap.Find( ImageVisual::Property::FRAME_DELAY, "frameDelay" );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<int>(), 200, TEST_LOCATION );
+ value = resultMap.Find(ImageVisual::Property::FRAME_DELAY, "frameDelay");
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<int>(), 200, TEST_LOCATION);
- value = resultMap.Find( Toolkit::DevelImageVisual::Property::TOTAL_FRAME_NUMBER, "totalFrameNumber" );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<int>(), 11, TEST_LOCATION );
+ value = resultMap.Find(Toolkit::DevelImageVisual::Property::TOTAL_FRAME_NUMBER, "totalFrameNumber");
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<int>(), 11, TEST_LOCATION);
- value = resultMap.Find( Toolkit::DevelVisual::Property::CORNER_RADIUS, "cornerRadius" );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<Vector4>(), Vector4(50.0f, 25.0f, 12.5f, 33.0f), TEST_LOCATION );
+ value = resultMap.Find(Toolkit::DevelVisual::Property::CORNER_RADIUS, "cornerRadius");
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector4>(), Vector4(50.0f, 25.0f, 12.5f, 33.0f), TEST_LOCATION);
- value = resultMap.Find( Toolkit::DevelVisual::Property::CORNER_RADIUS_POLICY, "cornerRadiusPolicy" );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get<int>() == Visual::Transform::Policy::RELATIVE );
+ value = resultMap.Find(Toolkit::DevelVisual::Property::CORNER_RADIUS_POLICY, "cornerRadiusPolicy");
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<int>() == Visual::Transform::Policy::RELATIVE);
- value = resultMap.Find( Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, "borderlineWidth" );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<float>(), 20.0f, TEST_LOCATION );
+ value = resultMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, "borderlineWidth");
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<float>(), 20.0f, TEST_LOCATION);
- value = resultMap.Find( Toolkit::DevelVisual::Property::BORDERLINE_COLOR, "borderlineColor" );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<Vector4>(), Vector4::ZERO, TEST_LOCATION );
+ value = resultMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_COLOR, "borderlineColor");
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector4>(), Vector4::ZERO, TEST_LOCATION);
- value = resultMap.Find( Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, "borderlineOffset" );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<float>(), -1.0f, TEST_LOCATION );
+ value = resultMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, "borderlineOffset");
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<float>(), -1.0f, TEST_LOCATION);
END_TEST;
}
-
int UtcDaliAnimatedImageVisualGetPropertyMap03(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliAnimatedImageVisualGetPropertyMap for multi image rolling cache" );
+ tet_infoline("UtcDaliAnimatedImageVisualGetPropertyMap for multi image rolling cache");
// request AnimatedImageVisual with a property map
- VisualFactory factory = VisualFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
Property::Array urls;
- CopyUrlsIntoArray( urls );
+ CopyUrlsIntoArray(urls);
Visual::Base animatedImageVisual = factory.CreateVisual(
Property::Map()
- .Add( Toolkit::Visual::Property::TYPE, Visual::ANIMATED_IMAGE )
- .Add( "url", urls )
- .Add( "batchSize", 4 )
- .Add( "cacheSize", 8 )
- .Add( "loopCount", 10 )
- .Add( "frameDelay", 200 )
- .Add( "pixelArea", Vector4() )
- .Add( "wrapModeU", WrapMode::REPEAT )
- .Add( "wrapModeV", WrapMode::DEFAULT )
- .Add( "cornerRadius", 50.5f ));
+ .Add(Toolkit::Visual::Property::TYPE, Visual::ANIMATED_IMAGE)
+ .Add("url", urls)
+ .Add("batchSize", 4)
+ .Add("cacheSize", 8)
+ .Add("loopCount", 10)
+ .Add("frameDelay", 200)
+ .Add("pixelArea", Vector4())
+ .Add("wrapModeU", WrapMode::REPEAT)
+ .Add("wrapModeV", WrapMode::DEFAULT)
+ .Add("cornerRadius", 50.5f));
Property::Map resultMap;
- animatedImageVisual.CreatePropertyMap( resultMap );
+ animatedImageVisual.CreatePropertyMap(resultMap);
// check the property values from the returned map from a visual
- Property::Value* value = resultMap.Find( Toolkit::Visual::Property::TYPE, Property::INTEGER );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get<int>() == Visual::ANIMATED_IMAGE );
+ Property::Value* value = resultMap.Find(Toolkit::Visual::Property::TYPE, Property::INTEGER);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<int>() == Visual::ANIMATED_IMAGE);
- value = resultMap.Find( ImageVisual::Property::URL, "url" );
- DALI_TEST_CHECK( value );
+ value = resultMap.Find(ImageVisual::Property::URL, "url");
+ DALI_TEST_CHECK(value);
Property::Array* resultUrls = value->GetArray();
- DALI_TEST_CHECK( resultUrls );
- DALI_TEST_EQUALS( resultUrls->Count(), urls.Count(), TEST_LOCATION );
+ DALI_TEST_CHECK(resultUrls);
+ DALI_TEST_EQUALS(resultUrls->Count(), urls.Count(), TEST_LOCATION);
- value = resultMap.Find( ImageVisual::Property::BATCH_SIZE, "batchSize" );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<int>(), 4, TEST_LOCATION );
+ value = resultMap.Find(ImageVisual::Property::BATCH_SIZE, "batchSize");
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<int>(), 4, TEST_LOCATION);
- value = resultMap.Find( ImageVisual::Property::CACHE_SIZE, "cacheSize" );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<int>(), 8, TEST_LOCATION );
+ value = resultMap.Find(ImageVisual::Property::CACHE_SIZE, "cacheSize");
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<int>(), 8, TEST_LOCATION);
- value = resultMap.Find( Toolkit::DevelImageVisual::Property::LOOP_COUNT, "loopCount" );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<int>(), 10, TEST_LOCATION );
+ value = resultMap.Find(Toolkit::DevelImageVisual::Property::LOOP_COUNT, "loopCount");
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<int>(), 10, TEST_LOCATION);
- value = resultMap.Find( ImageVisual::Property::FRAME_DELAY, "frameDelay" );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<int>(), 200, TEST_LOCATION );
+ value = resultMap.Find(ImageVisual::Property::FRAME_DELAY, "frameDelay");
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<int>(), 200, TEST_LOCATION);
- value = resultMap.Find( Toolkit::DevelImageVisual::Property::TOTAL_FRAME_NUMBER, "totalFrameNumber" );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<int>(), 11, TEST_LOCATION );
+ value = resultMap.Find(Toolkit::DevelImageVisual::Property::TOTAL_FRAME_NUMBER, "totalFrameNumber");
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<int>(), 11, TEST_LOCATION);
- value = resultMap.Find( Toolkit::DevelVisual::Property::CORNER_RADIUS, "cornerRadius" );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<Vector4>(), Vector4(50.5f, 50.5f, 50.5f, 50.5f), TEST_LOCATION );
+ value = resultMap.Find(Toolkit::DevelVisual::Property::CORNER_RADIUS, "cornerRadius");
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector4>(), Vector4(50.5f, 50.5f, 50.5f, 50.5f), TEST_LOCATION);
- value = resultMap.Find( Toolkit::DevelVisual::Property::CORNER_RADIUS_POLICY, "cornerRadiusPolicy" );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get<int>() == Visual::Transform::Policy::ABSOLUTE );
+ value = resultMap.Find(Toolkit::DevelVisual::Property::CORNER_RADIUS_POLICY, "cornerRadiusPolicy");
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<int>() == Visual::Transform::Policy::ABSOLUTE);
- value = resultMap.Find( Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, "borderlineWidth" );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<float>(), 0.0f, TEST_LOCATION );
+ value = resultMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, "borderlineWidth");
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<float>(), 0.0f, TEST_LOCATION);
- value = resultMap.Find( Toolkit::DevelVisual::Property::BORDERLINE_COLOR, "borderlineColor" );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<Vector4>(), Color::BLACK, TEST_LOCATION );
+ value = resultMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_COLOR, "borderlineColor");
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector4>(), Color::BLACK, TEST_LOCATION);
- value = resultMap.Find( Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, "borderlineOffset" );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<float>(), 0.0f, TEST_LOCATION );
+ value = resultMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, "borderlineOffset");
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<float>(), 0.0f, TEST_LOCATION);
END_TEST;
}
int UtcDaliAnimatedImageVisualGetPropertyMap04(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliAnimatedImageVisualGetPropertyMap" );
+ tet_infoline("UtcDaliAnimatedImageVisualGetPropertyMap");
// request AnimatedImageVisual with a property map
- VisualFactory factory = VisualFactory::Get();
- Visual::Base animatedImageVisual = factory.CreateVisual(
+ VisualFactory factory = VisualFactory::Get();
+ Visual::Base animatedImageVisual = factory.CreateVisual(
Property::Map()
- .Add( Toolkit::Visual::Property::TYPE, Visual::ANIMATED_IMAGE )
- .Add( ImageVisual::Property::URL, TEST_GIF_FILE_NAME )
- .Add( ImageVisual::Property::BATCH_SIZE, 1 )
- .Add( ImageVisual::Property::CACHE_SIZE, 1 )
- .Add( ImageVisual::Property::SYNCHRONOUS_LOADING, false )
- .Add( DevelVisual::Property::BORDERLINE_WIDTH, 0.4f ));
+ .Add(Toolkit::Visual::Property::TYPE, Visual::ANIMATED_IMAGE)
+ .Add(ImageVisual::Property::URL, TEST_GIF_FILE_NAME)
+ .Add(ImageVisual::Property::BATCH_SIZE, 1)
+ .Add(ImageVisual::Property::CACHE_SIZE, 1)
+ .Add(ImageVisual::Property::SYNCHRONOUS_LOADING, false)
+ .Add(DevelVisual::Property::BORDERLINE_WIDTH, 0.4f));
Property::Map resultMap;
- animatedImageVisual.CreatePropertyMap( resultMap );
+ animatedImageVisual.CreatePropertyMap(resultMap);
// check the property values from the returned map from a visual
- Property::Value* value = resultMap.Find( Toolkit::Visual::Property::TYPE, Property::INTEGER );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get<int>() == Visual::ANIMATED_IMAGE );
+ Property::Value* value = resultMap.Find(Toolkit::Visual::Property::TYPE, Property::INTEGER);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<int>() == Visual::ANIMATED_IMAGE);
- value = resultMap.Find( ImageVisual::Property::URL, Property::STRING );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get<std::string>() == TEST_GIF_FILE_NAME );
+ value = resultMap.Find(ImageVisual::Property::URL, Property::STRING);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<std::string>() == TEST_GIF_FILE_NAME);
- value = resultMap.Find( ImageVisual::Property::BATCH_SIZE, Property::INTEGER );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get<int>() == 2 );
+ value = resultMap.Find(ImageVisual::Property::BATCH_SIZE, Property::INTEGER);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<int>() == 2);
- value = resultMap.Find( ImageVisual::Property::CACHE_SIZE, Property::INTEGER );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get<int>() == 2 );
+ value = resultMap.Find(ImageVisual::Property::CACHE_SIZE, Property::INTEGER);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<int>() == 2);
- value = resultMap.Find( Toolkit::DevelImageVisual::Property::TOTAL_FRAME_NUMBER, "totalFrameNumber" );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<int>(), 4, TEST_LOCATION );
+ value = resultMap.Find(Toolkit::DevelImageVisual::Property::TOTAL_FRAME_NUMBER, "totalFrameNumber");
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<int>(), 4, TEST_LOCATION);
- value = resultMap.Find( Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, "borderlineWidth" );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<float>(), 0.4f, TEST_LOCATION );
+ value = resultMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, "borderlineWidth");
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<float>(), 0.4f, TEST_LOCATION);
- value = resultMap.Find( Toolkit::DevelVisual::Property::BORDERLINE_COLOR, "borderlineColor" );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<Vector4>(), Vector4(0.0f, 0.0f, 0.0f, 1.0f), TEST_LOCATION );
+ value = resultMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_COLOR, "borderlineColor");
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector4>(), Vector4(0.0f, 0.0f, 0.0f, 1.0f), TEST_LOCATION);
- value = resultMap.Find( Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, "borderlineOffset" );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<float>(), 0.0f, TEST_LOCATION );
+ value = resultMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, "borderlineOffset");
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<float>(), 0.0f, TEST_LOCATION);
END_TEST;
}
int UtcDaliAnimatedImageVisualImageLoadingFail01(void)
{
ToolkitTestApplication application;
- TestGlAbstraction& gl = application.GetGlAbstraction();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
{
Property::Map propertyMap;
- propertyMap.Insert( Visual::Property::TYPE, Visual::ANIMATED_IMAGE );
- propertyMap.Insert( ImageVisual::Property::URL, "dummy.gif" );
- propertyMap.Insert( ImageVisual::Property::BATCH_SIZE, 2 );
- propertyMap.Insert( ImageVisual::Property::CACHE_SIZE, 2 );
- propertyMap.Insert( ImageVisual::Property::FRAME_DELAY, 20 );
- propertyMap.Insert( ImageVisual::Property::SYNCHRONOUS_LOADING, true );
- propertyMap.Insert( DevelVisual::Property::CORNER_RADIUS, 0.23f );
- propertyMap.Insert( DevelVisual::Property::CORNER_RADIUS_POLICY, Visual::Transform::Policy::ABSOLUTE );
+ propertyMap.Insert(Visual::Property::TYPE, Visual::ANIMATED_IMAGE);
+ propertyMap.Insert(ImageVisual::Property::URL, "dummy.gif");
+ propertyMap.Insert(ImageVisual::Property::BATCH_SIZE, 2);
+ propertyMap.Insert(ImageVisual::Property::CACHE_SIZE, 2);
+ propertyMap.Insert(ImageVisual::Property::FRAME_DELAY, 20);
+ propertyMap.Insert(ImageVisual::Property::SYNCHRONOUS_LOADING, true);
+ propertyMap.Insert(DevelVisual::Property::CORNER_RADIUS, 0.23f);
+ propertyMap.Insert(DevelVisual::Property::CORNER_RADIUS_POLICY, Visual::Transform::Policy::ABSOLUTE);
VisualFactory factory = VisualFactory::Get();
- Visual::Base visual = factory.CreateVisual( propertyMap );
+ Visual::Base visual = factory.CreateVisual(propertyMap);
- DummyControl dummyControl = DummyControl::New(true);
- Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ DummyControl dummyControl = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- application.GetScene().Add( dummyControl );
+ dummyControl.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ application.GetScene().Add(dummyControl);
TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
application.SendNotification();
application.Render(20);
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 1, TEST_LOCATION);
- DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::JUMP_TO, 6 );
+ DevelControl::DoAction(dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::JUMP_TO, 6);
application.SendNotification();
application.Render(20);
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 1, TEST_LOCATION);
dummyControl.Unparent();
}
int UtcDaliAnimatedImageVisualSynchronousLoading(void)
{
ToolkitTestApplication application;
- TestGlAbstraction& gl = application.GetGlAbstraction();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
{
Property::Map propertyMap;
- propertyMap.Insert( Visual::Property::TYPE, Visual::ANIMATED_IMAGE );
- propertyMap.Insert( ImageVisual::Property::URL, TEST_GIF_FILE_NAME );
- propertyMap.Insert( ImageVisual::Property::BATCH_SIZE, 2 );
- propertyMap.Insert( ImageVisual::Property::CACHE_SIZE, 2 );
- propertyMap.Insert( ImageVisual::Property::FRAME_DELAY, 20 );
- propertyMap.Insert( ImageVisual::Property::SYNCHRONOUS_LOADING, true );
- propertyMap.Insert( DevelVisual::Property::CORNER_RADIUS, 0.23f );
- propertyMap.Insert( DevelVisual::Property::CORNER_RADIUS_POLICY, Visual::Transform::Policy::ABSOLUTE );
+ propertyMap.Insert(Visual::Property::TYPE, Visual::ANIMATED_IMAGE);
+ propertyMap.Insert(ImageVisual::Property::URL, TEST_GIF_FILE_NAME);
+ propertyMap.Insert(ImageVisual::Property::BATCH_SIZE, 2);
+ propertyMap.Insert(ImageVisual::Property::CACHE_SIZE, 2);
+ propertyMap.Insert(ImageVisual::Property::FRAME_DELAY, 20);
+ propertyMap.Insert(ImageVisual::Property::SYNCHRONOUS_LOADING, true);
+ propertyMap.Insert(DevelVisual::Property::CORNER_RADIUS, 0.23f);
+ propertyMap.Insert(DevelVisual::Property::CORNER_RADIUS_POLICY, Visual::Transform::Policy::ABSOLUTE);
VisualFactory factory = VisualFactory::Get();
- Visual::Base visual = factory.CreateVisual( propertyMap );
+ Visual::Base visual = factory.CreateVisual(propertyMap);
- DummyControl dummyControl = DummyControl::New(true);
- Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ DummyControl dummyControl = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- application.GetScene().Add( dummyControl );
+ dummyControl.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ application.GetScene().Add(dummyControl);
TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
application.SendNotification();
application.Render(20);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( Test::GetTimerCount(), 1, TEST_LOCATION );
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 2, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::GetTimerCount(), 1, TEST_LOCATION);
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 2, TEST_LOCATION);
- DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::JUMP_TO, 3 );
+ DevelControl::DoAction(dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::JUMP_TO, 3);
application.SendNotification();
application.Render(20);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 3, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 3, TEST_LOCATION);
dummyControl.Unparent();
}
tet_infoline("Test that removing the visual from stage deletes all textures");
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 0, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 0, TEST_LOCATION);
END_TEST;
}
-
int UtcDaliAnimatedImageVisualJumpToAction(void)
{
ToolkitTestApplication application;
- TestGlAbstraction& gl = application.GetGlAbstraction();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
Property::Array urls;
- CopyUrlsIntoArray( urls );
+ CopyUrlsIntoArray(urls);
{
Property::Map propertyMap;
- propertyMap.Insert(Visual::Property::TYPE, Visual::IMAGE );
- propertyMap.Insert( ImageVisual::Property::URL, Property::Value(urls) );
- propertyMap.Insert( ImageVisual::Property::BATCH_SIZE, 4);
- propertyMap.Insert( ImageVisual::Property::CACHE_SIZE, 12);
- propertyMap.Insert( ImageVisual::Property::FRAME_DELAY, 20);
+ propertyMap.Insert(Visual::Property::TYPE, Visual::IMAGE);
+ propertyMap.Insert(ImageVisual::Property::URL, Property::Value(urls));
+ propertyMap.Insert(ImageVisual::Property::BATCH_SIZE, 4);
+ propertyMap.Insert(ImageVisual::Property::CACHE_SIZE, 12);
+ propertyMap.Insert(ImageVisual::Property::FRAME_DELAY, 20);
VisualFactory factory = VisualFactory::Get();
- Visual::Base visual = factory.CreateVisual( propertyMap );
+ Visual::Base visual = factory.CreateVisual(propertyMap);
- DummyControl dummyControl = DummyControl::New(true);
- Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ DummyControl dummyControl = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- application.GetScene().Add( dummyControl );
+ dummyControl.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ application.GetScene().Add(dummyControl);
application.SendNotification();
application.Render(20);
- tet_infoline( "Ready the visual after the visual is on stage" );
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 4 ), true, TEST_LOCATION );
+ tet_infoline("Ready the visual after the visual is on stage");
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(4), true, TEST_LOCATION);
- tet_infoline( "Test that a timer has been started" );
- DALI_TEST_EQUALS( Test::GetTimerCount(), 1, TEST_LOCATION );
+ tet_infoline("Test that a timer has been started");
+ DALI_TEST_EQUALS(Test::GetTimerCount(), 1, TEST_LOCATION);
TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
application.SendNotification();
application.Render(20);
- DALI_TEST_EQUALS( gl.GetLastGenTextureId(), 4, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetLastGenTextureId(), 4, TEST_LOCATION);
- DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::STOP, Property::Map() );
+ DevelControl::DoAction(dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::STOP, Property::Map());
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 4, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 4, TEST_LOCATION);
- DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::JUMP_TO, 20 );
+ DevelControl::DoAction(dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::JUMP_TO, 20);
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 4, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 4, TEST_LOCATION);
- DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::JUMP_TO, 6 );
+ DevelControl::DoAction(dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::JUMP_TO, 6);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 6 ), true, TEST_LOCATION );
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 4, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(6), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 4, TEST_LOCATION);
dummyControl.Unparent();
}
tet_infoline("Test that removing the visual from stage deletes all textures");
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 0, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 0, TEST_LOCATION);
END_TEST;
}
-
int UtcDaliAnimatedImageVisualStopBehavior(void)
{
ToolkitTestApplication application;
- TestGlAbstraction& gl = application.GetGlAbstraction();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
Property::Array urls;
- CopyUrlsIntoArray( urls );
+ CopyUrlsIntoArray(urls);
{
Property::Map propertyMap;
- propertyMap.Insert( Visual::Property::TYPE, Visual::IMAGE );
- propertyMap.Insert( ImageVisual::Property::URL, Property::Value(urls) );
- propertyMap.Insert( DevelImageVisual::Property::STOP_BEHAVIOR, DevelImageVisual::StopBehavior::FIRST_FRAME);
- propertyMap.Insert( ImageVisual::Property::BATCH_SIZE, 4);
- propertyMap.Insert( ImageVisual::Property::CACHE_SIZE, 8);
- propertyMap.Insert( ImageVisual::Property::FRAME_DELAY, 20);
+ propertyMap.Insert(Visual::Property::TYPE, Visual::IMAGE);
+ propertyMap.Insert(ImageVisual::Property::URL, Property::Value(urls));
+ propertyMap.Insert(DevelImageVisual::Property::STOP_BEHAVIOR, DevelImageVisual::StopBehavior::FIRST_FRAME);
+ propertyMap.Insert(ImageVisual::Property::BATCH_SIZE, 4);
+ propertyMap.Insert(ImageVisual::Property::CACHE_SIZE, 8);
+ propertyMap.Insert(ImageVisual::Property::FRAME_DELAY, 20);
VisualFactory factory = VisualFactory::Get();
- Visual::Base visual = factory.CreateVisual( propertyMap );
+ Visual::Base visual = factory.CreateVisual(propertyMap);
// Expect that a batch of 4 textures has been requested. These will be serially loaded
// below.
- DummyControl dummyControl = DummyControl::New(true);
- Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ DummyControl dummyControl = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- application.GetScene().Add( dummyControl );
+ dummyControl.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ application.GetScene().Add(dummyControl);
application.SendNotification();
application.Render(20);
- tet_infoline( "Ready the visual after the visual is on stage" );
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 4 ), true, TEST_LOCATION );
+ tet_infoline("Ready the visual after the visual is on stage");
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(4), true, TEST_LOCATION);
- tet_infoline( "Test that a timer has been started" );
- DALI_TEST_EQUALS( Test::GetTimerCount(), 1, TEST_LOCATION );
+ tet_infoline("Test that a timer has been started");
+ DALI_TEST_EQUALS(Test::GetTimerCount(), 1, TEST_LOCATION);
TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
application.SendNotification();
application.Render(20);
- DALI_TEST_EQUALS( gl.GetLastGenTextureId(), 4, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetLastGenTextureId(), 4, TEST_LOCATION);
- DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::STOP, Property::Map() );
+ DevelControl::DoAction(dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::STOP, Property::Map());
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 4, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 4, TEST_LOCATION);
- DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::JUMP_TO, 1 );
+ DevelControl::DoAction(dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::JUMP_TO, 1);
// Expect the second batch has been requested
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 4 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(4), true, TEST_LOCATION);
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 4, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 4, TEST_LOCATION);
dummyControl.Unparent();
}
tet_infoline("Test that removing the visual from stage deletes all textures");
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 0, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 0, TEST_LOCATION);
END_TEST;
}
-
int UtcDaliAnimatedImageVisualStopBehavior02(void)
{
ToolkitTestApplication application;
- TestGlAbstraction& gl = application.GetGlAbstraction();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
Property::Array urls;
- CopyUrlsIntoArray( urls );
+ CopyUrlsIntoArray(urls);
{
Property::Map propertyMap;
- propertyMap.Insert( Visual::Property::TYPE, Visual::IMAGE );
- propertyMap.Insert( ImageVisual::Property::URL, Property::Value(urls) );
- propertyMap.Insert( DevelImageVisual::Property::STOP_BEHAVIOR, DevelImageVisual::StopBehavior::LAST_FRAME);
- propertyMap.Insert( ImageVisual::Property::BATCH_SIZE, 2);
- propertyMap.Insert( ImageVisual::Property::CACHE_SIZE, 2);
- propertyMap.Insert( ImageVisual::Property::FRAME_DELAY, 20);
+ propertyMap.Insert(Visual::Property::TYPE, Visual::IMAGE);
+ propertyMap.Insert(ImageVisual::Property::URL, Property::Value(urls));
+ propertyMap.Insert(DevelImageVisual::Property::STOP_BEHAVIOR, DevelImageVisual::StopBehavior::LAST_FRAME);
+ propertyMap.Insert(ImageVisual::Property::BATCH_SIZE, 2);
+ propertyMap.Insert(ImageVisual::Property::CACHE_SIZE, 2);
+ propertyMap.Insert(ImageVisual::Property::FRAME_DELAY, 20);
VisualFactory factory = VisualFactory::Get();
- Visual::Base visual = factory.CreateVisual( propertyMap );
+ Visual::Base visual = factory.CreateVisual(propertyMap);
// Expect that a batch of 4 textures has been requested. These will be serially loaded
// below.
- DummyControl dummyControl = DummyControl::New(true);
- Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ DummyControl dummyControl = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- application.GetScene().Add( dummyControl );
+ dummyControl.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ application.GetScene().Add(dummyControl);
- tet_infoline( "Ready the visual after the visual is on stage" );
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION );
+ tet_infoline("Ready the visual after the visual is on stage");
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
application.SendNotification();
application.Render(20);
- DALI_TEST_EQUALS( gl.GetLastGenTextureId(), 2, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetLastGenTextureId(), 2, TEST_LOCATION);
Test::EmitGlobalTimerSignal();
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render(20);
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 2, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 2, TEST_LOCATION);
- DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::STOP, Property::Map() );
+ DevelControl::DoAction(dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::STOP, Property::Map());
- tet_infoline( "Ready the visual after the visual is on stage" );
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION );
+ tet_infoline("Ready the visual after the visual is on stage");
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
application.SendNotification();
application.Render(20);
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 2, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 2, TEST_LOCATION);
dummyControl.Unparent();
}
tet_infoline("Test that removing the visual from stage deletes all textures");
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 0, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 0, TEST_LOCATION);
END_TEST;
}
-
int UtcDaliAnimatedImageVisualAnimatedImage01(void)
{
ToolkitTestApplication application;
- TestGlAbstraction& gl = application.GetGlAbstraction();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
{
Property::Map propertyMap;
- propertyMap.Insert(Visual::Property::TYPE, Visual::ANIMATED_IMAGE );
- propertyMap.Insert( ImageVisual::Property::URL, TEST_GIF_FILE_NAME );
- propertyMap.Insert( ImageVisual::Property::BATCH_SIZE, 2);
- propertyMap.Insert( ImageVisual::Property::CACHE_SIZE, 4);
- propertyMap.Insert( ImageVisual::Property::FRAME_DELAY, 20);
+ propertyMap.Insert(Visual::Property::TYPE, Visual::ANIMATED_IMAGE);
+ propertyMap.Insert(ImageVisual::Property::URL, TEST_GIF_FILE_NAME);
+ propertyMap.Insert(ImageVisual::Property::BATCH_SIZE, 2);
+ propertyMap.Insert(ImageVisual::Property::CACHE_SIZE, 4);
+ propertyMap.Insert(ImageVisual::Property::FRAME_DELAY, 20);
VisualFactory factory = VisualFactory::Get();
- Visual::Base visual = factory.CreateVisual( propertyMap );
+ Visual::Base visual = factory.CreateVisual(propertyMap);
// Expect that a batch of 4 textures has been requested. These will be serially loaded
// below.
- DummyControl dummyControl = DummyControl::New(true);
- Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ DummyControl dummyControl = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- application.GetScene().Add( dummyControl );
+ dummyControl.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ application.GetScene().Add(dummyControl);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
application.SendNotification();
application.Render(20);
- DALI_TEST_EQUALS( gl.GetLastGenTextureId(), 2, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetLastGenTextureId(), 2, TEST_LOCATION);
- tet_infoline( "Test that a timer has been started" );
+ tet_infoline("Test that a timer has been started");
TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
application.SendNotification();
application.Render(20);
- DALI_TEST_EQUALS( gl.GetLastGenTextureId(), 4, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetLastGenTextureId(), 4, TEST_LOCATION);
dummyControl.Unparent();
}
tet_infoline("Test that removing the visual from stage deletes all textures");
application.SendNotification();
application.Render(20);
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 0, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 0, TEST_LOCATION);
END_TEST;
}
-
int UtcDaliAnimatedImageVisualMultiImage01(void)
{
ToolkitTestApplication application;
- TestGlAbstraction& gl = application.GetGlAbstraction();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
Property::Array urls;
- CopyUrlsIntoArray( urls );
+ CopyUrlsIntoArray(urls);
{
Property::Map propertyMap;
- propertyMap.Insert(Visual::Property::TYPE, Visual::IMAGE );
- propertyMap.Insert( ImageVisual::Property::URL, Property::Value(urls) );
- propertyMap.Insert( ImageVisual::Property::BATCH_SIZE, 4);
- propertyMap.Insert( ImageVisual::Property::CACHE_SIZE, 8);
- propertyMap.Insert( ImageVisual::Property::FRAME_DELAY, 100);
+ propertyMap.Insert(Visual::Property::TYPE, Visual::IMAGE);
+ propertyMap.Insert(ImageVisual::Property::URL, Property::Value(urls));
+ propertyMap.Insert(ImageVisual::Property::BATCH_SIZE, 4);
+ propertyMap.Insert(ImageVisual::Property::CACHE_SIZE, 8);
+ propertyMap.Insert(ImageVisual::Property::FRAME_DELAY, 100);
VisualFactory factory = VisualFactory::Get();
- Visual::Base visual = factory.CreateVisual( propertyMap );
+ Visual::Base visual = factory.CreateVisual(propertyMap);
// Expect that a batch of 4 textures has been requested. These will be serially loaded
// below.
- DummyControl dummyControl = DummyControl::New(true);
- Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ DummyControl dummyControl = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- application.GetScene().Add( dummyControl );
+ dummyControl.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ application.GetScene().Add(dummyControl);
application.SendNotification();
application.Render(16);
- tet_infoline( "Ready the visual after the visual is on stage" );
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 4 ), true, TEST_LOCATION );
+ tet_infoline("Ready the visual after the visual is on stage");
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(4), true, TEST_LOCATION);
- tet_infoline( "Test that a timer has been started" );
- DALI_TEST_EQUALS( Test::GetTimerCount(), 1, TEST_LOCATION );
+ tet_infoline("Test that a timer has been started");
+ DALI_TEST_EQUALS(Test::GetTimerCount(), 1, TEST_LOCATION);
TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( gl.GetLastGenTextureId(), 4, TEST_LOCATION );
- DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetLastGenTextureId(), 4, TEST_LOCATION);
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
- tet_infoline( "Test that after 1 tick, and file loads completed, that we have 7 textures" );
+ tet_infoline("Test that after 1 tick, and file loads completed, that we have 7 textures");
Test::EmitGlobalTimerSignal();
// Expect the second batch has been requested
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 4 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(4), true, TEST_LOCATION);
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 7, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 7, TEST_LOCATION);
-
- tet_infoline( "Test that after 2 ticks that we have 6 textures" );
+ tet_infoline("Test that after 2 ticks that we have 6 textures");
Test::EmitGlobalTimerSignal();
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 6, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 6, TEST_LOCATION);
tet_infoline("And that at least 2 textures were requested");
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 8, TEST_LOCATION );
-
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 8, TEST_LOCATION);
- tet_infoline( "Test that after 3rd tick that we have 7 textures and 1 request" );
+ tet_infoline("Test that after 3rd tick that we have 7 textures and 1 request");
Test::EmitGlobalTimerSignal();
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 7, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 7, TEST_LOCATION);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 8, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 8, TEST_LOCATION);
dummyControl.Unparent();
}
tet_infoline("Test that removing the visual from stage deletes all textures");
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 0, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 0, TEST_LOCATION);
END_TEST;
}
int UtcDaliAnimatedImageVisualMultiImage02(void)
{
ToolkitTestApplication application;
- TestGlAbstraction& gl = application.GetGlAbstraction();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
- tet_infoline( "Test that the animated visual has different batch and cache size." );
+ tet_infoline("Test that the animated visual has different batch and cache size.");
{
Property::Array urls;
- CopyUrlsIntoArray( urls );
+ CopyUrlsIntoArray(urls);
Property::Map propertyMap;
- propertyMap.Insert(Visual::Property::TYPE, Visual::IMAGE );
- propertyMap.Insert( ImageVisual::Property::URL, Property::Value(urls) );
- propertyMap.Insert( ImageVisual::Property::BATCH_SIZE, 0);
- propertyMap.Insert( ImageVisual::Property::CACHE_SIZE, 0);
- propertyMap.Insert( ImageVisual::Property::FRAME_DELAY, 100);
+ propertyMap.Insert(Visual::Property::TYPE, Visual::IMAGE);
+ propertyMap.Insert(ImageVisual::Property::URL, Property::Value(urls));
+ propertyMap.Insert(ImageVisual::Property::BATCH_SIZE, 0);
+ propertyMap.Insert(ImageVisual::Property::CACHE_SIZE, 0);
+ propertyMap.Insert(ImageVisual::Property::FRAME_DELAY, 100);
VisualFactory factory = VisualFactory::Get();
- Visual::Base visual = factory.CreateVisual( propertyMap ); // TexMgr::Request load tId:0
+ Visual::Base visual = factory.CreateVisual(propertyMap); // TexMgr::Request load tId:0
// Check the batch size and cache size need to have minimum 2.
Property::Map resultMap;
- visual.CreatePropertyMap( resultMap );
- Property::Value* value = resultMap.Find( ImageVisual::Property::BATCH_SIZE, "batchSize" );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<int>(), 2, TEST_LOCATION );
- value = resultMap.Find( ImageVisual::Property::CACHE_SIZE, "cacheSize" );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<int>(), 2, TEST_LOCATION );
+ visual.CreatePropertyMap(resultMap);
+ Property::Value* value = resultMap.Find(ImageVisual::Property::BATCH_SIZE, "batchSize");
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<int>(), 2, TEST_LOCATION);
+ value = resultMap.Find(ImageVisual::Property::CACHE_SIZE, "cacheSize");
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<int>(), 2, TEST_LOCATION);
visual.Reset();
// Batch size is 2 and cache size is 3
propertyMap.Clear();
- propertyMap.Insert(Visual::Property::TYPE, Visual::IMAGE );
- propertyMap.Insert( ImageVisual::Property::URL, Property::Value(urls) );
- propertyMap.Insert( ImageVisual::Property::BATCH_SIZE, 2);
- propertyMap.Insert( ImageVisual::Property::CACHE_SIZE, 3);
- propertyMap.Insert( ImageVisual::Property::FRAME_DELAY, 100);
+ propertyMap.Insert(Visual::Property::TYPE, Visual::IMAGE);
+ propertyMap.Insert(ImageVisual::Property::URL, Property::Value(urls));
+ propertyMap.Insert(ImageVisual::Property::BATCH_SIZE, 2);
+ propertyMap.Insert(ImageVisual::Property::CACHE_SIZE, 3);
+ propertyMap.Insert(ImageVisual::Property::FRAME_DELAY, 100);
- visual = factory.CreateVisual( propertyMap ); // TexMgr::Request load tId:0
+ visual = factory.CreateVisual(propertyMap); // TexMgr::Request load tId:0
// Expect that each image is loaded each tick
- DummyControl dummyControl = DummyControl::New(true);
- Impl::DummyControl& dummyImpl1 = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
- dummyImpl1.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ DummyControl dummyControl = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl1 = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+ dummyImpl1.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
visual.Reset();
- dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- application.GetScene().Add( dummyControl );
+ dummyControl.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ application.GetScene().Add(dummyControl);
application.SendNotification();
application.Render(16);
- tet_infoline( "Ready the visual after the visual is on window" );
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION );
+ tet_infoline("Ready the visual after the visual is on window");
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
application.SendNotification();
- application.Render(16);//glGenTextures 1 and 2
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 2, TEST_LOCATION );
+ application.Render(16); //glGenTextures 1 and 2
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 2, TEST_LOCATION);
- tet_infoline( "Test that each tick, a new image is requested" );
+ tet_infoline("Test that each tick, a new image is requested");
Test::EmitGlobalTimerSignal(); // TexMgr::Remove tId:0
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
application.SendNotification();
- application.Render(16);//glGenTextures 3
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 3, TEST_LOCATION );
+ application.Render(16); //glGenTextures 3
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 3, TEST_LOCATION);
- tet_infoline( "Test that each tick, a new image is requested" );
+ tet_infoline("Test that each tick, a new image is requested");
Test::EmitGlobalTimerSignal(); // TexMgr::Remove tId:1
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
- application.Render(16);//glGenTextures 4
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 3, TEST_LOCATION );
+ application.Render(16); //glGenTextures 4
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 3, TEST_LOCATION);
- dummyImpl1.UnregisterVisual( DummyControl::Property::TEST_VISUAL );
+ dummyImpl1.UnregisterVisual(DummyControl::Property::TEST_VISUAL);
dummyControl.Unparent();
-
// Batch size is 9 and cache size is 4
propertyMap.Clear();
- propertyMap.Insert(Visual::Property::TYPE, Visual::IMAGE );
- propertyMap.Insert( ImageVisual::Property::URL, Property::Value(urls) );
- propertyMap.Insert( ImageVisual::Property::BATCH_SIZE, 3);
- propertyMap.Insert( ImageVisual::Property::CACHE_SIZE, 7);
- propertyMap.Insert( ImageVisual::Property::FRAME_DELAY, 100);
+ propertyMap.Insert(Visual::Property::TYPE, Visual::IMAGE);
+ propertyMap.Insert(ImageVisual::Property::URL, Property::Value(urls));
+ propertyMap.Insert(ImageVisual::Property::BATCH_SIZE, 3);
+ propertyMap.Insert(ImageVisual::Property::CACHE_SIZE, 7);
+ propertyMap.Insert(ImageVisual::Property::FRAME_DELAY, 100);
- visual = factory.CreateVisual( propertyMap ); // TexMgr::Request load tId:0
+ visual = factory.CreateVisual(propertyMap); // TexMgr::Request load tId:0
// Expect that each image is loaded each tick
- dummyControl = DummyControl::New(true);
+ dummyControl = DummyControl::New(true);
Impl::DummyControl& dummyImpl2 = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
- dummyImpl2.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ dummyImpl2.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
visual.Reset();
- dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- application.GetScene().Add( dummyControl );
+ dummyControl.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ application.GetScene().Add(dummyControl);
application.SendNotification();
application.Render(16);
- tet_infoline( "Ready the visual after the visual is on window" );
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 3 ), true, TEST_LOCATION );
+ tet_infoline("Ready the visual after the visual is on window");
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(3), true, TEST_LOCATION);
application.SendNotification();
- application.Render(16);//glGenTextures 1, 2, and 3
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 3, TEST_LOCATION );
+ application.Render(16); //glGenTextures 1, 2, and 3
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 3, TEST_LOCATION);
- tet_infoline( "Test that each tick, a new image is requested" );
+ tet_infoline("Test that each tick, a new image is requested");
Test::EmitGlobalTimerSignal(); // TexMgr::Remove tId:0
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 3 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(3), true, TEST_LOCATION);
application.SendNotification();
- application.Render(16);//glGenTextures 4, 5, and 6
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 5, TEST_LOCATION );
+ application.Render(16); //glGenTextures 4, 5, and 6
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 5, TEST_LOCATION);
- tet_infoline( "Test that each tick, a new image is requested" );
+ tet_infoline("Test that each tick, a new image is requested");
Test::EmitGlobalTimerSignal(); // TexMgr::Remove tId:1
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 3 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(3), true, TEST_LOCATION);
application.SendNotification();
- application.Render(16);//glGenTextures 7, 1, and 2
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 7, TEST_LOCATION );
+ application.Render(16); //glGenTextures 7, 1, and 2
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 7, TEST_LOCATION);
- tet_infoline( "Test that each tick, a new image is requested" );
+ tet_infoline("Test that each tick, a new image is requested");
Test::EmitGlobalTimerSignal(); // TexMgr::Remove tId:2
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
- application.Render(16);//glGenTextures 3
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 7, TEST_LOCATION );
+ application.Render(16); //glGenTextures 3
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 7, TEST_LOCATION);
dummyControl.Unparent();
}
tet_infoline("Test that removing the visual from window deletes all textures");
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 0, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 0, TEST_LOCATION);
END_TEST;
}
int UtcDaliAnimatedImageVisualMultiImage03(void)
{
ToolkitTestApplication application;
- TestGlAbstraction& gl = application.GetGlAbstraction();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
{
Property::Array urls1, urls2;
- CopyUrlsIntoArray( urls1 );
- CopyUrlsIntoArray( urls2 );
+ CopyUrlsIntoArray(urls1);
+ CopyUrlsIntoArray(urls2);
Property::Map animatedImageMap1;
- animatedImageMap1.Insert(Visual::Property::TYPE, Visual::IMAGE );
- animatedImageMap1.Insert( ImageVisual::Property::URL, Property::Value(urls1) );
- animatedImageMap1.Insert( ImageVisual::Property::BATCH_SIZE, 3);
- animatedImageMap1.Insert( ImageVisual::Property::CACHE_SIZE, 3);
- animatedImageMap1.Insert( ImageVisual::Property::FRAME_DELAY, 100);
+ animatedImageMap1.Insert(Visual::Property::TYPE, Visual::IMAGE);
+ animatedImageMap1.Insert(ImageVisual::Property::URL, Property::Value(urls1));
+ animatedImageMap1.Insert(ImageVisual::Property::BATCH_SIZE, 3);
+ animatedImageMap1.Insert(ImageVisual::Property::CACHE_SIZE, 3);
+ animatedImageMap1.Insert(ImageVisual::Property::FRAME_DELAY, 100);
Property::Map animatedImageMap2;
- animatedImageMap2.Insert(Visual::Property::TYPE, Visual::IMAGE );
- animatedImageMap2.Insert( ImageVisual::Property::URL, Property::Value(urls2) );
- animatedImageMap2.Insert( ImageVisual::Property::BATCH_SIZE, 2);
- animatedImageMap2.Insert( ImageVisual::Property::CACHE_SIZE, 2);
- animatedImageMap2.Insert( ImageVisual::Property::FRAME_DELAY, 100);
+ animatedImageMap2.Insert(Visual::Property::TYPE, Visual::IMAGE);
+ animatedImageMap2.Insert(ImageVisual::Property::URL, Property::Value(urls2));
+ animatedImageMap2.Insert(ImageVisual::Property::BATCH_SIZE, 2);
+ animatedImageMap2.Insert(ImageVisual::Property::CACHE_SIZE, 2);
+ animatedImageMap2.Insert(ImageVisual::Property::FRAME_DELAY, 100);
- VisualFactory factory = VisualFactory::Get();
- Visual::Base animatedImageVisual1 = factory.CreateVisual( animatedImageMap1 );
+ VisualFactory factory = VisualFactory::Get();
+ Visual::Base animatedImageVisual1 = factory.CreateVisual(animatedImageMap1);
- tet_infoline( "Create two image views with the same URLs, offset by 1 frame.");
+ tet_infoline("Create two image views with the same URLs, offset by 1 frame.");
- DummyControl dummyControl1 = DummyControl::New(true);
- Impl::DummyControl& dummyImpl1 = static_cast<Impl::DummyControl&>(dummyControl1.GetImplementation());
- dummyImpl1.RegisterVisual( DummyControl::Property::TEST_VISUAL, animatedImageVisual1 );
- dummyControl1.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- application.GetScene().Add( dummyControl1 );
+ DummyControl dummyControl1 = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl1 = static_cast<Impl::DummyControl&>(dummyControl1.GetImplementation());
+ dummyImpl1.RegisterVisual(DummyControl::Property::TEST_VISUAL, animatedImageVisual1);
+ dummyControl1.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ application.GetScene().Add(dummyControl1);
application.SendNotification();
application.Render(16);
- tet_infoline( "Ready the requested image after the first visual is on stage" );
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 3 ), true, TEST_LOCATION );
+ tet_infoline("Ready the requested image after the first visual is on stage");
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(3), true, TEST_LOCATION);
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 3, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 3, TEST_LOCATION);
- Visual::Base animatedImageVisual2 = factory.CreateVisual( animatedImageMap2 );
- DummyControl dummyControl2 = DummyControl::New(true);
- Impl::DummyControl& dummyImpl2 = static_cast<Impl::DummyControl&>(dummyControl2.GetImplementation());
- dummyImpl2.RegisterVisual( DummyControl::Property::TEST_VISUAL, animatedImageVisual2 );
- dummyControl2.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- application.GetScene().Add( dummyControl2 );
+ Visual::Base animatedImageVisual2 = factory.CreateVisual(animatedImageMap2);
+ DummyControl dummyControl2 = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl2 = static_cast<Impl::DummyControl&>(dummyControl2.GetImplementation());
+ dummyImpl2.RegisterVisual(DummyControl::Property::TEST_VISUAL, animatedImageVisual2);
+ dummyControl2.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ application.GetScene().Add(dummyControl2);
application.SendNotification();
application.Render(16);
- tet_infoline( "The texture cache should be holding the requested images; check that the renderer has a texture" );
+ tet_infoline("The texture cache should be holding the requested images; check that the renderer has a texture");
TextureSet ts = dummyControl2.GetRendererAt(0).GetTextures();
- Texture t1 = ts.GetTexture( 0 );
- DALI_TEST_EQUALS( ts.GetTextureCount(), 1, TEST_LOCATION );
+ Texture t1 = ts.GetTexture(0);
+ DALI_TEST_EQUALS(ts.GetTextureCount(), 1, TEST_LOCATION);
- tet_infoline( "Test that on the first tick, 1 new image is requested" );
+ tet_infoline("Test that on the first tick, 1 new image is requested");
Test::EmitGlobalTimerSignal(); // Both visuals should tick
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 3, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 3, TEST_LOCATION);
- ts = dummyControl2.GetRendererAt(0).GetTextures();
- Texture t2 = ts.GetTexture( 0 );
- DALI_TEST_CHECK( t1 != t2 );
+ ts = dummyControl2.GetRendererAt(0).GetTextures();
+ Texture t2 = ts.GetTexture(0);
+ DALI_TEST_CHECK(t1 != t2);
dummyControl1.Unparent();
dummyControl2.Unparent();
tet_infoline("Test that removing the visual from stage deletes all textures");
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 0, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 0, TEST_LOCATION);
END_TEST;
}
-
int UtcDaliAnimatedImageVisualMultiImage04(void)
{
ToolkitTestApplication application;
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
- tet_infoline( "Test that if the cache size is the same as the number of urls, that once the cache is full, no new images are loaded" );
+ tet_infoline("Test that if the cache size is the same as the number of urls, that once the cache is full, no new images are loaded");
Property::Array urls;
- CopyUrlsIntoArray( urls );
+ CopyUrlsIntoArray(urls);
{
Property::Map propertyMap;
- propertyMap.Insert(Visual::Property::TYPE, Visual::IMAGE );
- propertyMap.Insert( ImageVisual::Property::URL, Property::Value(urls) );
- propertyMap.Insert( ImageVisual::Property::BATCH_SIZE, 6);
- propertyMap.Insert( ImageVisual::Property::CACHE_SIZE, 11);
- propertyMap.Insert( ImageVisual::Property::FRAME_DELAY, 100);
+ propertyMap.Insert(Visual::Property::TYPE, Visual::IMAGE);
+ propertyMap.Insert(ImageVisual::Property::URL, Property::Value(urls));
+ propertyMap.Insert(ImageVisual::Property::BATCH_SIZE, 6);
+ propertyMap.Insert(ImageVisual::Property::CACHE_SIZE, 11);
+ propertyMap.Insert(ImageVisual::Property::FRAME_DELAY, 100);
VisualFactory factory = VisualFactory::Get();
- Visual::Base visual = factory.CreateVisual( propertyMap );
+ Visual::Base visual = factory.CreateVisual(propertyMap);
- tet_infoline( "Expect that a batch of 7 textures has been requested." );
+ tet_infoline("Expect that a batch of 7 textures has been requested.");
- DummyControl dummyControl = DummyControl::New(true);
- Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ DummyControl dummyControl = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- application.GetScene().Add( dummyControl );
+ dummyControl.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ application.GetScene().Add(dummyControl);
application.SendNotification();
application.Render(16);
- tet_infoline( "Wait for the first batch to complete" );
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 6 ), true, TEST_LOCATION );
+ tet_infoline("Wait for the first batch to complete");
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(6), true, TEST_LOCATION);
- tet_infoline( "Test that a timer has been started" );
- DALI_TEST_EQUALS( Test::GetTimerCount(), 1, TEST_LOCATION );
+ tet_infoline("Test that a timer has been started");
+ DALI_TEST_EQUALS(Test::GetTimerCount(), 1, TEST_LOCATION);
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( gl.GetLastGenTextureId(), 6, TEST_LOCATION );
- tet_infoline( "Test that after 1 tick, and 5 file loads completed, that we have 11 textures" );
+ DALI_TEST_EQUALS(gl.GetLastGenTextureId(), 6, TEST_LOCATION);
+ tet_infoline("Test that after 1 tick, and 5 file loads completed, that we have 11 textures");
Test::EmitGlobalTimerSignal();
application.SendNotification();
application.Render(16);
// Expect the second batch has been requested
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 5 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(5), true, TEST_LOCATION);
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 11, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 11, TEST_LOCATION);
- tet_infoline( "Test that after 2 ticks that we have 11 textures and no requests" );
+ tet_infoline("Test that after 2 ticks that we have 11 textures and no requests");
Test::EmitGlobalTimerSignal();
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1, 5 ), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1, 5), false, TEST_LOCATION);
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 11, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 11, TEST_LOCATION);
- tet_infoline( "Test that after 3rd tick that we have 11 textures and no requests" );
+ tet_infoline("Test that after 3rd tick that we have 11 textures and no requests");
Test::EmitGlobalTimerSignal();
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1, 5 ), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1, 5), false, TEST_LOCATION);
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 11, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 11, TEST_LOCATION);
dummyControl.Unparent();
}
tet_infoline("Test that removing the visual from stage deletes all textures");
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 0, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 0, TEST_LOCATION);
END_TEST;
}
-
int UtcDaliAnimatedImageVisualMultiImage05(void)
{
ToolkitTestApplication application;
- TestGlAbstraction& gl = application.GetGlAbstraction();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
- tet_infoline( "Test that if the cache size is the same as the number of urls, that removing a partially loaded visual removes all textures" );
+ tet_infoline("Test that if the cache size is the same as the number of urls, that removing a partially loaded visual removes all textures");
Property::Array urls;
- CopyUrlsIntoArray( urls );
+ CopyUrlsIntoArray(urls);
{
Property::Map propertyMap;
- propertyMap.Insert(Visual::Property::TYPE, Visual::IMAGE );
- propertyMap.Insert( ImageVisual::Property::URL, Property::Value(urls) );
- propertyMap.Insert( ImageVisual::Property::BATCH_SIZE, 4);
- propertyMap.Insert( ImageVisual::Property::CACHE_SIZE, 11);
- propertyMap.Insert( ImageVisual::Property::FRAME_DELAY, 100);
+ propertyMap.Insert(Visual::Property::TYPE, Visual::IMAGE);
+ propertyMap.Insert(ImageVisual::Property::URL, Property::Value(urls));
+ propertyMap.Insert(ImageVisual::Property::BATCH_SIZE, 4);
+ propertyMap.Insert(ImageVisual::Property::CACHE_SIZE, 11);
+ propertyMap.Insert(ImageVisual::Property::FRAME_DELAY, 100);
VisualFactory factory = VisualFactory::Get();
- Visual::Base visual = factory.CreateVisual( propertyMap );
+ Visual::Base visual = factory.CreateVisual(propertyMap);
- tet_infoline( "Expect that a batch of 4 textures has been requested." );
+ tet_infoline("Expect that a batch of 4 textures has been requested.");
- DummyControl dummyControl = DummyControl::New(true);
- Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ DummyControl dummyControl = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- application.GetScene().Add( dummyControl );
+ dummyControl.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ application.GetScene().Add(dummyControl);
application.SendNotification();
application.Render(16);
- tet_infoline( "Wait for the first batch to complete" );
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 4 ), true, TEST_LOCATION );
+ tet_infoline("Wait for the first batch to complete");
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(4), true, TEST_LOCATION);
- tet_infoline( "Test that a timer has been started" );
- DALI_TEST_EQUALS( Test::GetTimerCount(), 1, TEST_LOCATION );
+ tet_infoline("Test that a timer has been started");
+ DALI_TEST_EQUALS(Test::GetTimerCount(), 1, TEST_LOCATION);
application.SendNotification();
application.Render(16);
- tet_infoline( "Test that a timer has been started" );
+ tet_infoline("Test that a timer has been started");
Test::EmitGlobalTimerSignal();
application.SendNotification();
application.Render(16);
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 0, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 0, TEST_LOCATION);
- tet_infoline( "Test that pending batch of image loads are cancelled instead of uploaded");
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 4 ), true, TEST_LOCATION );
+ tet_infoline("Test that pending batch of image loads are cancelled instead of uploaded");
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(4), true, TEST_LOCATION);
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 0, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 0, TEST_LOCATION);
END_TEST;
}
-void TestLoopCount( ToolkitTestApplication &application, DummyControl &dummyControl, uint16_t frameCount, uint16_t loopCount, const char * location )
+void TestLoopCount(ToolkitTestApplication& application, DummyControl& dummyControl, uint16_t frameCount, uint16_t loopCount, const char* location)
{
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
- application.GetScene().Add( dummyControl );
+ application.GetScene().Add(dummyControl);
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_INNER_LOCATION( location ) );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_INNER_LOCATION(location));
application.SendNotification();
application.Render();
- tet_infoline( "Test that a timer has been created" );
- DALI_TEST_EQUALS( Test::GetTimerCount(), 1, TEST_INNER_LOCATION( location ) );
+ tet_infoline("Test that a timer has been created");
+ DALI_TEST_EQUALS(Test::GetTimerCount(), 1, TEST_INNER_LOCATION(location));
- for ( uint16_t i = 0; i < loopCount; i++ )
+ for(uint16_t i = 0; i < loopCount; i++)
{
- for ( uint16_t j = 0; j < frameCount; j++ )
+ for(uint16_t j = 0; j < frameCount; j++)
{
- if( i == 0 && j == 0 )
+ if(i == 0 && j == 0)
{
continue; // Because first frame is already showed and we call 2nd frame at the first time of timer animation.
}
- tet_printf( "Test that after %u ticks, and we have %u frame \n", j + 1u, j + 1u );
+ tet_printf("Test that after %u ticks, and we have %u frame \n", j + 1u, j + 1u);
Test::EmitGlobalTimerSignal();
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_INNER_LOCATION( location ) );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_INNER_LOCATION(location));
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( gl.GetNumGeneratedTextures(), 2, TEST_INNER_LOCATION( location ) );
- DALI_TEST_EQUALS( Test::AreTimersRunning(), true, TEST_INNER_LOCATION( location ) );
+ DALI_TEST_EQUALS(gl.GetNumGeneratedTextures(), 2, TEST_INNER_LOCATION(location));
+ DALI_TEST_EQUALS(Test::AreTimersRunning(), true, TEST_INNER_LOCATION(location));
}
- tet_printf( "Test Loop %u \n\n", i + 1u );
+ tet_printf("Test Loop %u \n\n", i + 1u);
}
- tet_printf( "Test that after %u loops, and we have no frame. Timer should stop \n", loopCount );
+ tet_printf("Test that after %u loops, and we have no frame. Timer should stop \n", loopCount);
Test::EmitGlobalTimerSignal();
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( Test::AreTimersRunning(), false, TEST_INNER_LOCATION( location ) );
+ DALI_TEST_EQUALS(Test::AreTimersRunning(), false, TEST_INNER_LOCATION(location));
dummyControl.Unparent();
}
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliAnimatedImageVisualLoopCount" );
+ tet_infoline("UtcDaliAnimatedImageVisualLoopCount");
{
// request AnimatedImageVisual with a property map
// Test with no (0) loop count
- VisualFactory factory = VisualFactory::Get();
- Visual::Base animatedImageVisual = factory.CreateVisual(
+ VisualFactory factory = VisualFactory::Get();
+ Visual::Base animatedImageVisual = factory.CreateVisual(
Property::Map()
- .Add( Toolkit::Visual::Property::TYPE, Visual::ANIMATED_IMAGE )
- .Add( ImageVisual::Property::URL, TEST_GIF_FILE_NAME )
- .Add( ImageVisual::Property::PIXEL_AREA, Vector4() )
- .Add( ImageVisual::Property::WRAP_MODE_U, WrapMode::REPEAT )
- .Add( ImageVisual::Property::WRAP_MODE_V, WrapMode::DEFAULT )
- .Add( DevelImageVisual::Property::LOOP_COUNT, 0 ));
+ .Add(Toolkit::Visual::Property::TYPE, Visual::ANIMATED_IMAGE)
+ .Add(ImageVisual::Property::URL, TEST_GIF_FILE_NAME)
+ .Add(ImageVisual::Property::PIXEL_AREA, Vector4())
+ .Add(ImageVisual::Property::WRAP_MODE_U, WrapMode::REPEAT)
+ .Add(ImageVisual::Property::WRAP_MODE_V, WrapMode::DEFAULT)
+ .Add(DevelImageVisual::Property::LOOP_COUNT, 0));
- DummyControl dummyControl = DummyControl::New(true);
- Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, animatedImageVisual );
- dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ DummyControl dummyControl = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, animatedImageVisual);
+ dummyControl.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
- TestLoopCount( application, dummyControl, 4, 0, TEST_LOCATION );
+ TestLoopCount(application, dummyControl, 4, 0, TEST_LOCATION);
- dummyImpl.UnregisterVisual( DummyControl::Property::TEST_VISUAL );
+ dummyImpl.UnregisterVisual(DummyControl::Property::TEST_VISUAL);
animatedImageVisual.Reset();
application.SendNotification();
// Test with no (1) loop count. Request AnimatedImageVisual with a property map
animatedImageVisual = factory.CreateVisual(
Property::Map()
- .Add( Toolkit::Visual::Property::TYPE, Visual::ANIMATED_IMAGE )
- .Add( ImageVisual::Property::URL, TEST_GIF_FILE_NAME )
- .Add( ImageVisual::Property::PIXEL_AREA, Vector4() )
- .Add( ImageVisual::Property::WRAP_MODE_U, WrapMode::REPEAT )
- .Add( ImageVisual::Property::WRAP_MODE_V, WrapMode::DEFAULT )
- .Add( DevelImageVisual::Property::LOOP_COUNT, 1 ));
+ .Add(Toolkit::Visual::Property::TYPE, Visual::ANIMATED_IMAGE)
+ .Add(ImageVisual::Property::URL, TEST_GIF_FILE_NAME)
+ .Add(ImageVisual::Property::PIXEL_AREA, Vector4())
+ .Add(ImageVisual::Property::WRAP_MODE_U, WrapMode::REPEAT)
+ .Add(ImageVisual::Property::WRAP_MODE_V, WrapMode::DEFAULT)
+ .Add(DevelImageVisual::Property::LOOP_COUNT, 1));
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, animatedImageVisual );
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, animatedImageVisual);
- TestLoopCount( application, dummyControl, 4, 1, TEST_LOCATION );
+ TestLoopCount(application, dummyControl, 4, 1, TEST_LOCATION);
- dummyImpl.UnregisterVisual( DummyControl::Property::TEST_VISUAL );
+ dummyImpl.UnregisterVisual(DummyControl::Property::TEST_VISUAL);
animatedImageVisual.Reset();
application.SendNotification();
// Test with no (100) loop count. Request AnimatedImageVisual with a property map
animatedImageVisual = factory.CreateVisual(
Property::Map()
- .Add( Toolkit::Visual::Property::TYPE, Visual::ANIMATED_IMAGE )
- .Add( ImageVisual::Property::URL, TEST_GIF_FILE_NAME )
- .Add( ImageVisual::Property::PIXEL_AREA, Vector4() )
- .Add( ImageVisual::Property::WRAP_MODE_U, WrapMode::REPEAT )
- .Add( ImageVisual::Property::WRAP_MODE_V, WrapMode::DEFAULT )
- .Add( DevelImageVisual::Property::LOOP_COUNT, 100 ));
+ .Add(Toolkit::Visual::Property::TYPE, Visual::ANIMATED_IMAGE)
+ .Add(ImageVisual::Property::URL, TEST_GIF_FILE_NAME)
+ .Add(ImageVisual::Property::PIXEL_AREA, Vector4())
+ .Add(ImageVisual::Property::WRAP_MODE_U, WrapMode::REPEAT)
+ .Add(ImageVisual::Property::WRAP_MODE_V, WrapMode::DEFAULT)
+ .Add(DevelImageVisual::Property::LOOP_COUNT, 100));
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, animatedImageVisual );
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, animatedImageVisual);
- TestLoopCount( application, dummyControl, 4, 100, TEST_LOCATION );
+ TestLoopCount(application, dummyControl, 4, 100, TEST_LOCATION);
}
END_TEST;
}
int UtcDaliAnimatedImageVisualPlayback(void)
{
ToolkitTestApplication application;
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
- tet_infoline( "UtcDaliAnimatedImageVisualPlayback" );
+ tet_infoline("UtcDaliAnimatedImageVisualPlayback");
{
// request AnimatedImageVisual with a property map
// Test with forever (-1) loop count
- VisualFactory factory = VisualFactory::Get();
- Visual::Base animatedImageVisual = factory.CreateVisual(
+ VisualFactory factory = VisualFactory::Get();
+ Visual::Base animatedImageVisual = factory.CreateVisual(
Property::Map()
- .Add( Toolkit::Visual::Property::TYPE, Visual::ANIMATED_IMAGE )
- .Add( ImageVisual::Property::URL, TEST_GIF_FILE_NAME )
- .Add( ImageVisual::Property::PIXEL_AREA, Vector4() )
- .Add( ImageVisual::Property::WRAP_MODE_U, WrapMode::REPEAT )
- .Add( ImageVisual::Property::WRAP_MODE_V, WrapMode::DEFAULT )
- .Add( DevelImageVisual::Property::LOOP_COUNT, -1 ));
-
- DummyControl dummyControl = DummyControl::New(true);
- Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, animatedImageVisual );
- dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ .Add(Toolkit::Visual::Property::TYPE, Visual::ANIMATED_IMAGE)
+ .Add(ImageVisual::Property::URL, TEST_GIF_FILE_NAME)
+ .Add(ImageVisual::Property::PIXEL_AREA, Vector4())
+ .Add(ImageVisual::Property::WRAP_MODE_U, WrapMode::REPEAT)
+ .Add(ImageVisual::Property::WRAP_MODE_V, WrapMode::DEFAULT)
+ .Add(DevelImageVisual::Property::LOOP_COUNT, -1));
+
+ DummyControl dummyControl = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, animatedImageVisual);
+ dummyControl.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
textureTrace.Enable(true);
- application.GetScene().Add( dummyControl );
+ application.GetScene().Add(dummyControl);
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- tet_infoline( "Test that a timer has been created" );
- DALI_TEST_EQUALS( Test::GetTimerCount(), 1, TEST_LOCATION );
+ tet_infoline("Test that a timer has been created");
+ DALI_TEST_EQUALS(Test::GetTimerCount(), 1, TEST_LOCATION);
Test::EmitGlobalTimerSignal();
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( Test::AreTimersRunning(), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::AreTimersRunning(), true, TEST_LOCATION);
Property::Map attributes;
- tet_infoline( "Test Pause action. Timer should stop after Pause action" );
- DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::PAUSE, attributes );
+ tet_infoline("Test Pause action. Timer should stop after Pause action");
+ DevelControl::DoAction(dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::PAUSE, attributes);
Test::EmitGlobalTimerSignal();
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( Test::AreTimersRunning(), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::AreTimersRunning(), false, TEST_LOCATION);
- tet_infoline( "Test Play action. Timer should Restart after Play action" );
- DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::PLAY, attributes );
+ tet_infoline("Test Play action. Timer should Restart after Play action");
+ DevelControl::DoAction(dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::PLAY, attributes);
Test::EmitGlobalTimerSignal();
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( Test::AreTimersRunning(), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::AreTimersRunning(), true, TEST_LOCATION);
- tet_infoline( "Test Stop action. Timer should stop after Stop action" );
- DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::STOP, attributes );
+ tet_infoline("Test Stop action. Timer should stop after Stop action");
+ DevelControl::DoAction(dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::STOP, attributes);
Test::EmitGlobalTimerSignal();
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( Test::AreTimersRunning(), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::AreTimersRunning(), false, TEST_LOCATION);
- tet_infoline( "Test Play action. Timer should Restart after Play action" );
- DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::PLAY, attributes );
+ tet_infoline("Test Play action. Timer should Restart after Play action");
+ DevelControl::DoAction(dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedImageVisual::Action::PLAY, attributes);
Test::EmitGlobalTimerSignal();
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( Test::AreTimersRunning(), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::AreTimersRunning(), true, TEST_LOCATION);
dummyControl.Unparent();
}
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
* limitations under the License.
*/
-#include <iostream>
#include <stdlib.h>
#include <chrono>
+#include <iostream>
#include <thread>
+
#include <dali-toolkit-test-suite-utils.h>
-#include <toolkit-timer.h>
#include <toolkit-event-thread-callback.h>
+#include <toolkit-timer.h>
#include <toolkit-vector-animation-renderer.h>
+#include "dummy-control.h"
+
#include <dali-toolkit/dali-toolkit.h>
-#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
+
#include <dali-toolkit/devel-api/controls/control-devel.h>
-#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
-#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
-#include <dali-toolkit/devel-api/visuals/visual-actions-devel.h>
+#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
#include <dali-toolkit/devel-api/visuals/animated-vector-image-visual-actions-devel.h>
#include <dali-toolkit/devel-api/visuals/animated-vector-image-visual-signals-devel.h>
-#include <dali/devel-api/rendering/renderer-devel.h>
+#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
+#include <dali-toolkit/devel-api/visuals/visual-actions-devel.h>
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
#include <dali/devel-api/adaptor-framework/window-devel.h>
-#include "dummy-control.h"
+#include <dali/devel-api/rendering/renderer-devel.h>
using namespace Dali;
using namespace Dali::Toolkit;
namespace
{
-
-const char* TEST_VECTOR_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/insta_camera.json";
+const char* TEST_VECTOR_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/insta_camera.json";
const char* TEST_VECTOR_IMAGE_FILE_NAME_FRAME_DROP = "framedrop.json";
-const char* TEST_VECTOR_IMAGE_INVALID_FILE_NAME = "invalid.json";
+const char* TEST_VECTOR_IMAGE_INVALID_FILE_NAME = "invalid.json";
bool gAnimationFinishedSignalFired = false;
-void VisualEventSignal( Control control, Dali::Property::Index visualIndex, Dali::Property::Index signalId )
+void VisualEventSignal(Control control, Dali::Property::Index visualIndex, Dali::Property::Index signalId)
{
- if( visualIndex == DummyControl::Property::TEST_VISUAL && signalId == DevelAnimatedVectorImageVisual::Signal::ANIMATION_FINISHED )
+ if(visualIndex == DummyControl::Property::TEST_VISUAL && signalId == DevelAnimatedVectorImageVisual::Signal::ANIMATION_FINISHED)
{
gAnimationFinishedSignalFired = true;
}
}
-}
+} // namespace
int UtcDaliVisualFactoryGetAnimatedVectorImageVisual01(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetAnimatedVectorImageVisual01: Request animated vector image visual with a json url" );
+ tet_infoline("UtcDaliVisualFactoryGetAnimatedVectorImageVisual01: Request animated vector image visual with a json url");
VisualFactory factory = VisualFactory::Get();
- Visual::Base visual = factory.CreateVisual( TEST_VECTOR_IMAGE_FILE_NAME, ImageDimensions() );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = factory.CreateVisual(TEST_VECTOR_IMAGE_FILE_NAME, ImageDimensions());
+ DALI_TEST_CHECK(visual);
- DummyControl actor = DummyControl::New( true );
- DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- actor.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 200.0f ) );
- application.GetScene().Add( actor );
+ DummyControl actor = DummyControl::New(true);
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
+ actor.SetProperty(Actor::Property::SIZE, Vector2(200.0f, 200.0f));
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render();
// renderer is added to actor
- DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
- Renderer renderer = actor.GetRendererAt( 0u );
- DALI_TEST_CHECK( renderer );
+ DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
+ Renderer renderer = actor.GetRendererAt(0u);
+ DALI_TEST_CHECK(renderer);
// Test SetOffScene().
actor.Unparent();
- DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
+ DALI_TEST_CHECK(actor.GetRendererCount() == 0u);
END_TEST;
}
int UtcDaliVisualFactoryGetAnimatedVectorImageVisual02(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetAnimatedVectorImageVisual02: Request animated vector image visual with a Property::Map" );
+ tet_infoline("UtcDaliVisualFactoryGetAnimatedVectorImageVisual02: Request animated vector image visual with a Property::Map");
Property::Map propertyMap;
- propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE )
- .Add( ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME );
+ propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME);
- Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- DummyControl actor = DummyControl::New( true );
- DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- actor.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 200.0f ) );
- application.GetScene().Add( actor );
+ DummyControl actor = DummyControl::New(true);
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
+ actor.SetProperty(Actor::Property::SIZE, Vector2(200.0f, 200.0f));
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render();
// renderer is added to actor
- DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
- Renderer renderer = actor.GetRendererAt( 0u );
- DALI_TEST_CHECK( renderer );
+ DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
+ Renderer renderer = actor.GetRendererAt(0u);
+ DALI_TEST_CHECK(renderer);
- actor.Unparent( );
- DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
+ actor.Unparent();
+ DALI_TEST_CHECK(actor.GetRendererCount() == 0u);
END_TEST;
}
int UtcDaliVisualFactoryGetAnimatedVectorImageVisual03(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetAnimatedVectorImageVisual03: Request animated vector image visual with a Property::Map" );
+ tet_infoline("UtcDaliVisualFactoryGetAnimatedVectorImageVisual03: Request animated vector image visual with a Property::Map");
- int startFrame = 1, endFrame = 3;
+ int startFrame = 1, endFrame = 3;
Property::Array playRange;
- playRange.PushBack( startFrame );
- playRange.PushBack( endFrame );
+ playRange.PushBack(startFrame);
+ playRange.PushBack(endFrame);
Property::Map propertyMap;
- propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE )
- .Add( ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME )
- .Add( DevelImageVisual::Property::LOOP_COUNT, 3 )
- .Add( DevelImageVisual::Property::PLAY_RANGE, playRange )
- .Add( DevelVisual::Property::CORNER_RADIUS, 50.0f )
- .Add( DevelVisual::Property::BORDERLINE_WIDTH, 20.0f );
-
- Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
-
- DummyControl actor = DummyControl::New( true );
- DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- actor.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 200.0f ) );
- application.GetScene().Add( actor );
+ propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME)
+ .Add(DevelImageVisual::Property::LOOP_COUNT, 3)
+ .Add(DevelImageVisual::Property::PLAY_RANGE, playRange)
+ .Add(DevelVisual::Property::CORNER_RADIUS, 50.0f)
+ .Add(DevelVisual::Property::BORDERLINE_WIDTH, 20.0f);
+
+ Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
+
+ DummyControl actor = DummyControl::New(true);
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
+ actor.SetProperty(Actor::Property::SIZE, Vector2(200.0f, 200.0f));
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render();
// renderer is added to actor
- DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
- Renderer renderer = actor.GetRendererAt( 0u );
- DALI_TEST_CHECK( renderer );
+ DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
+ Renderer renderer = actor.GetRendererAt(0u);
+ DALI_TEST_CHECK(renderer);
- actor.Unparent( );
- DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
+ actor.Unparent();
+ DALI_TEST_CHECK(actor.GetRendererCount() == 0u);
END_TEST;
}
int UtcDaliVisualFactoryGetAnimatedVectorImageVisual04(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetAnimatedVectorImageVisual04: Request animated vector image visual with a Property::Map" );
+ tet_infoline("UtcDaliVisualFactoryGetAnimatedVectorImageVisual04: Request animated vector image visual with a Property::Map");
- int startFrame = 1, endFrame = 3;
- float cornerRadius = 22.0f;
- float borderlineWidth = 2.0f;
- Vector4 borderlineColor = Vector4(1.0f, 1.0f, 1.0f, 1.0f);
- float borderlineOffset = 0.1f;
+ int startFrame = 1, endFrame = 3;
+ float cornerRadius = 22.0f;
+ float borderlineWidth = 2.0f;
+ Vector4 borderlineColor = Vector4(1.0f, 1.0f, 1.0f, 1.0f);
+ float borderlineOffset = 0.1f;
Property::Array playRange;
- playRange.PushBack( startFrame );
- playRange.PushBack( endFrame );
+ playRange.PushBack(startFrame);
+ playRange.PushBack(endFrame);
Property::Map propertyMap;
- propertyMap.Add( "visualType", DevelVisual::ANIMATED_VECTOR_IMAGE )
- .Add( "url", TEST_VECTOR_IMAGE_FILE_NAME )
- .Add( "loopCount", 3 )
- .Add( "playRange", playRange )
- .Add( "stopBehavior", DevelImageVisual::StopBehavior::FIRST_FRAME )
- .Add( "loopingMode", DevelImageVisual::LoopingMode::AUTO_REVERSE )
- .Add( "redrawInScalingDown", false )
- .Add( "cornerRadius", cornerRadius )
- .Add( "borderlineWidth", borderlineWidth )
- .Add( "borderlineColor", borderlineColor )
- .Add( "borderlineOffset", borderlineOffset );
-
- Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
-
- DummyControl actor = DummyControl::New( true );
- DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- actor.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 200.0f ) );
- application.GetScene().Add( actor );
+ propertyMap.Add("visualType", DevelVisual::ANIMATED_VECTOR_IMAGE)
+ .Add("url", TEST_VECTOR_IMAGE_FILE_NAME)
+ .Add("loopCount", 3)
+ .Add("playRange", playRange)
+ .Add("stopBehavior", DevelImageVisual::StopBehavior::FIRST_FRAME)
+ .Add("loopingMode", DevelImageVisual::LoopingMode::AUTO_REVERSE)
+ .Add("redrawInScalingDown", false)
+ .Add("cornerRadius", cornerRadius)
+ .Add("borderlineWidth", borderlineWidth)
+ .Add("borderlineColor", borderlineColor)
+ .Add("borderlineOffset", borderlineOffset);
+
+ Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
+
+ DummyControl actor = DummyControl::New(true);
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
+ actor.SetProperty(Actor::Property::SIZE, Vector2(200.0f, 200.0f));
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render();
// Trigger count is 1 - render a frame
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
// renderer is added to actor
- DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
+ DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
- Renderer renderer = actor.GetRendererAt( 0u );
- DALI_TEST_CHECK( renderer );
+ Renderer renderer = actor.GetRendererAt(0u);
+ DALI_TEST_CHECK(renderer);
Property::Map resultMap;
- visual.CreatePropertyMap( resultMap );
+ visual.CreatePropertyMap(resultMap);
// check the property values from the returned map from a visual
- Property::Value* value = resultMap.Find( ImageVisual::Property::URL, Property::STRING );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get< std::string >() == TEST_VECTOR_IMAGE_FILE_NAME );
+ Property::Value* value = resultMap.Find(ImageVisual::Property::URL, Property::STRING);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<std::string>() == TEST_VECTOR_IMAGE_FILE_NAME);
- value = resultMap.Find( DevelImageVisual::Property::LOOP_COUNT, Property::INTEGER );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get< int >() == 3 );
+ value = resultMap.Find(DevelImageVisual::Property::LOOP_COUNT, Property::INTEGER);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<int>() == 3);
- value = resultMap.Find( DevelImageVisual::Property::PLAY_RANGE, Property::ARRAY );
- DALI_TEST_CHECK( value );
+ value = resultMap.Find(DevelImageVisual::Property::PLAY_RANGE, Property::ARRAY);
+ DALI_TEST_CHECK(value);
Property::Array* result = value->GetArray();
- DALI_TEST_CHECK( result );
+ DALI_TEST_CHECK(result);
- DALI_TEST_CHECK( result->GetElementAt( 0 ).Get< int >() == startFrame );
- DALI_TEST_CHECK( result->GetElementAt( 1 ).Get< int >() == endFrame );
+ DALI_TEST_CHECK(result->GetElementAt(0).Get<int>() == startFrame);
+ DALI_TEST_CHECK(result->GetElementAt(1).Get<int>() == endFrame);
- value = resultMap.Find( DevelImageVisual::Property::STOP_BEHAVIOR, Property::INTEGER );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get< int >() == DevelImageVisual::StopBehavior::FIRST_FRAME );
+ value = resultMap.Find(DevelImageVisual::Property::STOP_BEHAVIOR, Property::INTEGER);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<int>() == DevelImageVisual::StopBehavior::FIRST_FRAME);
- value = resultMap.Find( DevelImageVisual::Property::LOOPING_MODE, Property::INTEGER );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get< int >() == DevelImageVisual::LoopingMode::AUTO_REVERSE );
+ value = resultMap.Find(DevelImageVisual::Property::LOOPING_MODE, Property::INTEGER);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<int>() == DevelImageVisual::LoopingMode::AUTO_REVERSE);
- value = resultMap.Find( DevelImageVisual::Property::REDRAW_IN_SCALING_DOWN, Property::BOOLEAN );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get< bool >() == false );
+ value = resultMap.Find(DevelImageVisual::Property::REDRAW_IN_SCALING_DOWN, Property::BOOLEAN);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<bool>() == false);
- value = resultMap.Find( DevelVisual::Property::CORNER_RADIUS, Property::VECTOR4 );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector4 >(), Vector4(cornerRadius, cornerRadius, cornerRadius, cornerRadius), TEST_LOCATION );
+ value = resultMap.Find(DevelVisual::Property::CORNER_RADIUS, Property::VECTOR4);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector4>(), Vector4(cornerRadius, cornerRadius, cornerRadius, cornerRadius), TEST_LOCATION);
- value = resultMap.Find( DevelVisual::Property::CORNER_RADIUS_POLICY, "cornerRadiusPolicy" );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get< int >() == Visual::Transform::Policy::ABSOLUTE );
+ value = resultMap.Find(DevelVisual::Property::CORNER_RADIUS_POLICY, "cornerRadiusPolicy");
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<int>() == Visual::Transform::Policy::ABSOLUTE);
- value = resultMap.Find( DevelVisual::Property::BORDERLINE_WIDTH, Property::FLOAT );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< float >(), borderlineWidth, TEST_LOCATION );
+ value = resultMap.Find(DevelVisual::Property::BORDERLINE_WIDTH, Property::FLOAT);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<float>(), borderlineWidth, TEST_LOCATION);
- value = resultMap.Find( DevelVisual::Property::BORDERLINE_COLOR, Property::VECTOR4 );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector4 >(), borderlineColor, TEST_LOCATION );
+ value = resultMap.Find(DevelVisual::Property::BORDERLINE_COLOR, Property::VECTOR4);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector4>(), borderlineColor, TEST_LOCATION);
- value = resultMap.Find( DevelVisual::Property::BORDERLINE_OFFSET, Property::FLOAT );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< float >(), borderlineOffset, TEST_LOCATION );
+ value = resultMap.Find(DevelVisual::Property::BORDERLINE_OFFSET, Property::FLOAT);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<float>(), borderlineOffset, TEST_LOCATION);
- actor.Unparent( );
- DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
+ actor.Unparent();
+ DALI_TEST_CHECK(actor.GetRendererCount() == 0u);
END_TEST;
}
int UtcDaliAnimatedVectorImageVisualGetPropertyMap01(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliAnimatedVectorImageVisualGetPropertyMap01" );
+ tet_infoline("UtcDaliAnimatedVectorImageVisualGetPropertyMap01");
- int startFrame = 1, endFrame = 3;
- Vector4 cornerRadius(50.0f, 22.0f, 0.0f, 3.0f);
- float borderlineWidth = 2.3f;
- Vector4 borderlineColor = Vector4(0.3f, 0.3f, 1.0f, 1.0f);
- float borderlineOffset = 0.3f;
+ int startFrame = 1, endFrame = 3;
+ Vector4 cornerRadius(50.0f, 22.0f, 0.0f, 3.0f);
+ float borderlineWidth = 2.3f;
+ Vector4 borderlineColor = Vector4(0.3f, 0.3f, 1.0f, 1.0f);
+ float borderlineOffset = 0.3f;
Property::Array playRange;
- playRange.PushBack( startFrame );
- playRange.PushBack( endFrame );
+ playRange.PushBack(startFrame);
+ playRange.PushBack(endFrame);
Property::Map propertyMap;
- propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE )
- .Add( ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME )
- .Add( DevelImageVisual::Property::LOOP_COUNT, 3 )
- .Add( DevelImageVisual::Property::PLAY_RANGE, playRange )
- .Add( DevelVisual::Property::CORNER_RADIUS, cornerRadius )
- .Add( DevelVisual::Property::CORNER_RADIUS_POLICY, Visual::Transform::Policy::RELATIVE)
- .Add( DevelVisual::Property::BORDERLINE_WIDTH, borderlineWidth )
- .Add( DevelVisual::Property::BORDERLINE_COLOR, borderlineColor )
- .Add( DevelVisual::Property::BORDERLINE_OFFSET, borderlineOffset );
+ propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME)
+ .Add(DevelImageVisual::Property::LOOP_COUNT, 3)
+ .Add(DevelImageVisual::Property::PLAY_RANGE, playRange)
+ .Add(DevelVisual::Property::CORNER_RADIUS, cornerRadius)
+ .Add(DevelVisual::Property::CORNER_RADIUS_POLICY, Visual::Transform::Policy::RELATIVE)
+ .Add(DevelVisual::Property::BORDERLINE_WIDTH, borderlineWidth)
+ .Add(DevelVisual::Property::BORDERLINE_COLOR, borderlineColor)
+ .Add(DevelVisual::Property::BORDERLINE_OFFSET, borderlineOffset);
// request AnimatedVectorImageVisual with a property map
VisualFactory factory = VisualFactory::Get();
- Visual::Base visual = factory.CreateVisual( propertyMap );
+ Visual::Base visual = factory.CreateVisual(propertyMap);
- DummyControl actor = DummyControl::New( true );
- DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ DummyControl actor = DummyControl::New(true);
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- Vector2 controlSize( 20.f, 30.f );
- actor.SetProperty( Actor::Property::SIZE, controlSize );
+ Vector2 controlSize(20.f, 30.f);
+ actor.SetProperty(Actor::Property::SIZE, controlSize);
- application.GetScene().Add( actor );
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render();
- std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) ); // wait for next rasterize thread run
+ std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
Property::Map resultMap;
- resultMap = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
+ resultMap = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
// check the property values from the returned map from a visual
- Property::Value* value = resultMap.Find( Toolkit::Visual::Property::TYPE, Property::INTEGER );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get< int >() == DevelVisual::ANIMATED_VECTOR_IMAGE );
+ Property::Value* value = resultMap.Find(Toolkit::Visual::Property::TYPE, Property::INTEGER);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<int>() == DevelVisual::ANIMATED_VECTOR_IMAGE);
- value = resultMap.Find( ImageVisual::Property::URL, Property::STRING );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get< std::string >() == TEST_VECTOR_IMAGE_FILE_NAME );
+ value = resultMap.Find(ImageVisual::Property::URL, Property::STRING);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<std::string>() == TEST_VECTOR_IMAGE_FILE_NAME);
- value = resultMap.Find( DevelImageVisual::Property::LOOP_COUNT, Property::INTEGER );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get< int >() == 3 );
+ value = resultMap.Find(DevelImageVisual::Property::LOOP_COUNT, Property::INTEGER);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<int>() == 3);
- value = resultMap.Find( DevelImageVisual::Property::PLAY_RANGE, Property::ARRAY );
- DALI_TEST_CHECK( value );
+ value = resultMap.Find(DevelImageVisual::Property::PLAY_RANGE, Property::ARRAY);
+ DALI_TEST_CHECK(value);
Property::Array* result = value->GetArray();
- DALI_TEST_CHECK( result );
+ DALI_TEST_CHECK(result);
- DALI_TEST_CHECK( result->GetElementAt( 0 ).Get< int >() == startFrame );
- DALI_TEST_CHECK( result->GetElementAt( 1 ).Get< int >() == endFrame );
+ DALI_TEST_CHECK(result->GetElementAt(0).Get<int>() == startFrame);
+ DALI_TEST_CHECK(result->GetElementAt(1).Get<int>() == endFrame);
- value = resultMap.Find( DevelImageVisual::Property::STOP_BEHAVIOR, Property::INTEGER );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get< int >() == DevelImageVisual::StopBehavior::CURRENT_FRAME );
+ value = resultMap.Find(DevelImageVisual::Property::STOP_BEHAVIOR, Property::INTEGER);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<int>() == DevelImageVisual::StopBehavior::CURRENT_FRAME);
- value = resultMap.Find( DevelImageVisual::Property::LOOPING_MODE, Property::INTEGER );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get< int >() == DevelImageVisual::LoopingMode::RESTART );
+ value = resultMap.Find(DevelImageVisual::Property::LOOPING_MODE, Property::INTEGER);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<int>() == DevelImageVisual::LoopingMode::RESTART);
- value = resultMap.Find( DevelImageVisual::Property::CONTENT_INFO, Property::MAP );
- DALI_TEST_CHECK( value );
+ value = resultMap.Find(DevelImageVisual::Property::CONTENT_INFO, Property::MAP);
+ DALI_TEST_CHECK(value);
- value = resultMap.Find( DevelImageVisual::Property::REDRAW_IN_SCALING_DOWN, Property::BOOLEAN );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get< bool >() == true ); // Check default value
+ value = resultMap.Find(DevelImageVisual::Property::REDRAW_IN_SCALING_DOWN, Property::BOOLEAN);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<bool>() == true); // Check default value
- value = resultMap.Find( DevelVisual::Property::CORNER_RADIUS, Property::VECTOR4 );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector4 >(), cornerRadius, TEST_LOCATION );
+ value = resultMap.Find(DevelVisual::Property::CORNER_RADIUS, Property::VECTOR4);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector4>(), cornerRadius, TEST_LOCATION);
- value = resultMap.Find( DevelVisual::Property::CORNER_RADIUS_POLICY, "cornerRadiusPolicy" );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get< int >() == Visual::Transform::Policy::RELATIVE );
+ value = resultMap.Find(DevelVisual::Property::CORNER_RADIUS_POLICY, "cornerRadiusPolicy");
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<int>() == Visual::Transform::Policy::RELATIVE);
- value = resultMap.Find( DevelVisual::Property::BORDERLINE_WIDTH, "borderlineWidth" );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< float >(), borderlineWidth, TEST_LOCATION );
+ value = resultMap.Find(DevelVisual::Property::BORDERLINE_WIDTH, "borderlineWidth");
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<float>(), borderlineWidth, TEST_LOCATION);
- value = resultMap.Find( DevelVisual::Property::BORDERLINE_COLOR, Property::VECTOR4 );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector4 >(), borderlineColor, TEST_LOCATION );
+ value = resultMap.Find(DevelVisual::Property::BORDERLINE_COLOR, Property::VECTOR4);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector4>(), borderlineColor, TEST_LOCATION);
- value = resultMap.Find( DevelVisual::Property::BORDERLINE_OFFSET, Property::FLOAT );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< float >(), borderlineOffset, TEST_LOCATION );
+ value = resultMap.Find(DevelVisual::Property::BORDERLINE_OFFSET, Property::FLOAT);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<float>(), borderlineOffset, TEST_LOCATION);
// request AnimatedVectorImageVisual with an URL
- Visual::Base visual2 = factory.CreateVisual( TEST_VECTOR_IMAGE_FILE_NAME, ImageDimensions() );
+ Visual::Base visual2 = factory.CreateVisual(TEST_VECTOR_IMAGE_FILE_NAME, ImageDimensions());
resultMap.Clear();
- visual2.CreatePropertyMap( resultMap );
+ visual2.CreatePropertyMap(resultMap);
// check the property values from the returned map from a visual
- value = resultMap.Find( Toolkit::Visual::Property::TYPE, Property::INTEGER );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get< int >() == DevelVisual::ANIMATED_VECTOR_IMAGE );
+ value = resultMap.Find(Toolkit::Visual::Property::TYPE, Property::INTEGER);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<int>() == DevelVisual::ANIMATED_VECTOR_IMAGE);
- value = resultMap.Find( ImageVisual::Property::URL, Property::STRING );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get< std::string >() == TEST_VECTOR_IMAGE_FILE_NAME );
+ value = resultMap.Find(ImageVisual::Property::URL, Property::STRING);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<std::string>() == TEST_VECTOR_IMAGE_FILE_NAME);
END_TEST;
}
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliAnimatedVectorImageVisualPlayback" );
+ tet_infoline("UtcDaliAnimatedVectorImageVisualPlayback");
{
// request AnimatedVectorImageVisual with a property map
VisualFactory factory = VisualFactory::Get();
- Visual::Base visual = factory.CreateVisual(
+ Visual::Base visual = factory.CreateVisual(
Property::Map()
- .Add( Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE )
- .Add( ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME ) );
+ .Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME));
- DummyControl dummyControl = DummyControl::New( true );
- Impl::DummyControl& dummyImpl = static_cast< Impl::DummyControl& >( dummyControl.GetImplementation() );
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- dummyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ DummyControl dummyControl = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
+ dummyControl.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
Property::Map attributes;
- tet_infoline( "Test Play action" );
- DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
+ tet_infoline("Test Play action");
+ DevelControl::DoAction(dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes);
- application.GetScene().Add( dummyControl );
+ application.GetScene().Add(dummyControl);
application.SendNotification();
- application.Render( 16 );
+ application.Render(16);
- Property::Map map = dummyControl.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- Property::Value* value = map.Find( DevelImageVisual::Property::PLAY_STATE );
- DALI_TEST_CHECK( value->Get< int >() == DevelImageVisual::PlayState::PLAYING );
+ Property::Map map = dummyControl.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ Property::Value* value = map.Find(DevelImageVisual::Property::PLAY_STATE);
+ DALI_TEST_CHECK(value->Get<int>() == DevelImageVisual::PlayState::PLAYING);
- tet_infoline( "Test Pause action" );
- DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PAUSE, attributes );
+ tet_infoline("Test Pause action");
+ DevelControl::DoAction(dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PAUSE, attributes);
application.SendNotification();
application.Render(16);
- map = dummyControl.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- value = map.Find( DevelImageVisual::Property::PLAY_STATE );
- DALI_TEST_CHECK( value->Get< int >() == DevelImageVisual::PlayState::PAUSED );
+ map = dummyControl.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ value = map.Find(DevelImageVisual::Property::PLAY_STATE);
+ DALI_TEST_CHECK(value->Get<int>() == DevelImageVisual::PlayState::PAUSED);
- tet_infoline( "Test Play action" );
- DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
+ tet_infoline("Test Play action");
+ DevelControl::DoAction(dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes);
application.SendNotification();
application.Render(16);
- map = dummyControl.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- value = map.Find( DevelImageVisual::Property::PLAY_STATE );
- DALI_TEST_CHECK( value->Get< int >() == DevelImageVisual::PlayState::PLAYING );
+ map = dummyControl.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ value = map.Find(DevelImageVisual::Property::PLAY_STATE);
+ DALI_TEST_CHECK(value->Get<int>() == DevelImageVisual::PlayState::PLAYING);
- tet_infoline( "Test Stop action" );
- DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::STOP, attributes );
+ tet_infoline("Test Stop action");
+ DevelControl::DoAction(dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::STOP, attributes);
application.SendNotification();
application.Render(16);
- map = dummyControl.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- value = map.Find( DevelImageVisual::Property::PLAY_STATE );
- DALI_TEST_CHECK( value->Get< int >() == DevelImageVisual::PlayState::STOPPED );
+ map = dummyControl.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ value = map.Find(DevelImageVisual::Property::PLAY_STATE);
+ DALI_TEST_CHECK(value->Get<int>() == DevelImageVisual::PlayState::STOPPED);
- tet_infoline( "Test Stop action again" );
- DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::STOP, attributes );
+ tet_infoline("Test Stop action again");
+ DevelControl::DoAction(dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::STOP, attributes);
application.SendNotification();
application.Render(16);
- map = dummyControl.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- value = map.Find( DevelImageVisual::Property::PLAY_STATE );
- DALI_TEST_CHECK( value->Get< int >() == DevelImageVisual::PlayState::STOPPED );
+ map = dummyControl.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ value = map.Find(DevelImageVisual::Property::PLAY_STATE);
+ DALI_TEST_CHECK(value->Get<int>() == DevelImageVisual::PlayState::STOPPED);
- tet_infoline( "Test Play action" );
- DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
+ tet_infoline("Test Play action");
+ DevelControl::DoAction(dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes);
application.SendNotification();
application.Render(16);
- map = dummyControl.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- value = map.Find( DevelImageVisual::Property::PLAY_STATE );
- DALI_TEST_CHECK( value->Get< int >() == DevelImageVisual::PlayState::PLAYING );
+ map = dummyControl.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ value = map.Find(DevelImageVisual::Property::PLAY_STATE);
+ DALI_TEST_CHECK(value->Get<int>() == DevelImageVisual::PlayState::PLAYING);
- tet_infoline( "Off stage" );
+ tet_infoline("Off stage");
dummyControl.Unparent();
application.SendNotification();
application.Render(16);
- map = dummyControl.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- value = map.Find( DevelImageVisual::Property::PLAY_STATE );
- DALI_TEST_CHECK( value->Get< int >() == DevelImageVisual::PlayState::STOPPED );
+ map = dummyControl.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ value = map.Find(DevelImageVisual::Property::PLAY_STATE);
+ DALI_TEST_CHECK(value->Get<int>() == DevelImageVisual::PlayState::STOPPED);
- tet_infoline( "On stage again" );
- application.GetScene().Add( dummyControl );
+ tet_infoline("On stage again");
+ application.GetScene().Add(dummyControl);
application.SendNotification();
application.Render(16);
- map = dummyControl.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- value = map.Find( DevelImageVisual::Property::PLAY_STATE );
- DALI_TEST_CHECK( value->Get< int >() == DevelImageVisual::PlayState::STOPPED );
+ map = dummyControl.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ value = map.Find(DevelImageVisual::Property::PLAY_STATE);
+ DALI_TEST_CHECK(value->Get<int>() == DevelImageVisual::PlayState::STOPPED);
- tet_infoline( "Test Play action" );
- DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
+ tet_infoline("Test Play action");
+ DevelControl::DoAction(dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes);
application.SendNotification();
application.Render(16);
- map = dummyControl.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- value = map.Find( DevelImageVisual::Property::PLAY_STATE );
- DALI_TEST_CHECK( value->Get< int >() == DevelImageVisual::PlayState::PLAYING );
+ map = dummyControl.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ value = map.Find(DevelImageVisual::Property::PLAY_STATE);
+ DALI_TEST_CHECK(value->Get<int>() == DevelImageVisual::PlayState::PLAYING);
// Change Size
- Vector3 newSize( 100.0f, 100.0f, 0.0f );
- dummyControl.SetProperty( Actor::Property::SIZE, newSize );
+ Vector3 newSize(100.0f, 100.0f, 0.0f);
+ dummyControl.SetProperty(Actor::Property::SIZE, newSize);
application.SendNotification();
application.Render(16);
// Size should be changed
Vector3 naturalSize = dummyControl.GetNaturalSize();
- DALI_TEST_CHECK( naturalSize == newSize );
+ DALI_TEST_CHECK(naturalSize == newSize);
dummyControl.Unparent();
}
int UtcDaliAnimatedVectorImageVisualCustomShader(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliAnimatedVectorImageVisualCustomShader Test custom shader" );
+ tet_infoline("UtcDaliAnimatedVectorImageVisualCustomShader Test custom shader");
- VisualFactory factory = VisualFactory::Get();
- Property::Map properties;
- Property::Map shader;
- const std::string vertexShader = "Foobar";
- const std::string fragmentShader = "Foobar sampler2D Foobar";
+ VisualFactory factory = VisualFactory::Get();
+ Property::Map properties;
+ Property::Map shader;
+ const std::string vertexShader = "Foobar";
+ const std::string fragmentShader = "Foobar sampler2D Foobar";
shader[Visual::Shader::Property::FRAGMENT_SHADER] = fragmentShader;
- shader[Visual::Shader::Property::VERTEX_SHADER] = vertexShader;
+ shader[Visual::Shader::Property::VERTEX_SHADER] = vertexShader;
- properties[Visual::Property::TYPE] = Visual::IMAGE;
- properties[Visual::Property::SHADER] = shader;
+ properties[Visual::Property::TYPE] = Visual::IMAGE;
+ properties[Visual::Property::SHADER] = shader;
properties[ImageVisual::Property::URL] = TEST_VECTOR_IMAGE_FILE_NAME;
- Visual::Base visual = factory.CreateVisual( properties );
+ Visual::Base visual = factory.CreateVisual(properties);
// trigger creation through setting on stage
- DummyControl dummy = DummyControl::New( true );
- Impl::DummyControl& dummyImpl = static_cast< Impl::DummyControl& >( dummy.GetImplementation() );
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ DummyControl dummy = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- dummy.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- dummy.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- application.GetScene().Add( dummy );
+ dummy.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+ dummy.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ application.GetScene().Add(dummy);
application.SendNotification();
application.Render();
- Renderer renderer = dummy.GetRendererAt( 0 );
- Shader shader2 = renderer.GetShader();
- Property::Value value = shader2.GetProperty( Shader::Property::PROGRAM );
- Property::Map* map = value.GetMap();
- DALI_TEST_CHECK( map );
+ Renderer renderer = dummy.GetRendererAt(0);
+ Shader shader2 = renderer.GetShader();
+ Property::Value value = shader2.GetProperty(Shader::Property::PROGRAM);
+ Property::Map* map = value.GetMap();
+ DALI_TEST_CHECK(map);
- std::string resultFragmentShader, resultVertexShader;
- Property::Value* fragment = map->Find( "fragment" ); // fragment key name from shader-impl.cpp
- fragment->Get( resultFragmentShader );
- DALI_TEST_CHECK( resultFragmentShader.find( fragmentShader ) != std::string::npos );
+ std::string resultFragmentShader, resultVertexShader;
+ Property::Value* fragment = map->Find("fragment"); // fragment key name from shader-impl.cpp
+ fragment->Get(resultFragmentShader);
+ DALI_TEST_CHECK(resultFragmentShader.find(fragmentShader) != std::string::npos);
- Property::Value* vertex = map->Find( "vertex" ); // vertex key name from shader-impl.cpp
- vertex->Get( resultVertexShader );
- DALI_TEST_CHECK( resultVertexShader.find( vertexShader ) != std::string::npos );
+ Property::Value* vertex = map->Find("vertex"); // vertex key name from shader-impl.cpp
+ vertex->Get(resultVertexShader);
+ DALI_TEST_CHECK(resultVertexShader.find(vertexShader) != std::string::npos);
END_TEST;
}
int UtcDaliAnimatedVectorImageVisualNaturalSize(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliAnimatedVectorImageVisualNaturalSize" );
+ tet_infoline("UtcDaliAnimatedVectorImageVisualNaturalSize");
VisualFactory factory = VisualFactory::Get();
- Visual::Base visual = factory.CreateVisual( TEST_VECTOR_IMAGE_FILE_NAME, ImageDimensions() );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = factory.CreateVisual(TEST_VECTOR_IMAGE_FILE_NAME, ImageDimensions());
+ DALI_TEST_CHECK(visual);
- DummyControl actor = DummyControl::New( true );
- DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ DummyControl actor = DummyControl::New(true);
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- Vector2 controlSize( 20.f, 30.f );
+ Vector2 controlSize(20.f, 30.f);
Vector2 naturalSize;
- application.GetScene().Add( actor );
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render();
- visual.GetNaturalSize( naturalSize );
+ visual.GetNaturalSize(naturalSize);
- DALI_TEST_EQUALS( naturalSize, Vector2( 100.0f, 100.0f ), TEST_LOCATION ); // 100x100 is the content default size.
+ DALI_TEST_EQUALS(naturalSize, Vector2(100.0f, 100.0f), TEST_LOCATION); // 100x100 is the content default size.
- actor.SetProperty( Actor::Property::SIZE, controlSize );
+ actor.SetProperty(Actor::Property::SIZE, controlSize);
application.SendNotification();
application.Render();
- visual.GetNaturalSize( naturalSize );
+ visual.GetNaturalSize(naturalSize);
- DALI_TEST_EQUALS( naturalSize, controlSize, TEST_LOCATION );
+ DALI_TEST_EQUALS(naturalSize, controlSize, TEST_LOCATION);
END_TEST;
}
int UtcDaliAnimatedVectorImageVisualLoopCount(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliAnimatedVectorImageVisualLoopCount" );
+ tet_infoline("UtcDaliAnimatedVectorImageVisualLoopCount");
Property::Map propertyMap;
- propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE )
- .Add( ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME )
- .Add( DevelImageVisual::Property::LOOP_COUNT, 3 );
+ propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME)
+ .Add(DevelImageVisual::Property::LOOP_COUNT, 3);
- Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- DummyControl actor = DummyControl::New( true );
- DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ DummyControl actor = DummyControl::New(true);
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- Vector2 controlSize( 20.f, 30.f );
- actor.SetProperty( Actor::Property::SIZE, controlSize );
+ Vector2 controlSize(20.f, 30.f);
+ actor.SetProperty(Actor::Property::SIZE, controlSize);
- application.GetScene().Add( actor );
+ application.GetScene().Add(actor);
Property::Map attributes;
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes);
application.SendNotification();
application.Render();
// Trigger count is 1 - render a frame
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
// renderer is added to actor
- DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
- Renderer renderer = actor.GetRendererAt( 0u );
- DALI_TEST_CHECK( renderer );
+ DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
+ Renderer renderer = actor.GetRendererAt(0u);
+ DALI_TEST_CHECK(renderer);
END_TEST;
}
int UtcDaliAnimatedVectorImageVisualPlayRange(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliAnimatedVectorImageVisualPlayRange" );
+ tet_infoline("UtcDaliAnimatedVectorImageVisualPlayRange");
- int startFrame = 1, endFrame = 3;
+ int startFrame = 1, endFrame = 3;
Property::Array array;
- array.PushBack( endFrame );
- array.PushBack( startFrame );
+ array.PushBack(endFrame);
+ array.PushBack(startFrame);
Property::Map propertyMap;
- propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE )
- .Add( ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME )
- .Add( DevelImageVisual::Property::PLAY_RANGE, array );
+ propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME)
+ .Add(DevelImageVisual::Property::PLAY_RANGE, array);
- Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- DummyControl actor = DummyControl::New( true );
- DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ DummyControl actor = DummyControl::New(true);
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- Vector2 controlSize( 20.f, 30.f );
- actor.SetProperty( Actor::Property::SIZE, controlSize );
+ Vector2 controlSize(20.f, 30.f);
+ actor.SetProperty(Actor::Property::SIZE, controlSize);
- application.GetScene().Add( actor );
+ application.GetScene().Add(actor);
Property::Map attributes;
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes);
application.SendNotification();
application.Render();
- std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) ); // wait for next rasterize thread run
+ std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
// renderer is added to actor
- DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
- Renderer renderer = actor.GetRendererAt( 0u );
- DALI_TEST_CHECK( renderer );
+ DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
+ Renderer renderer = actor.GetRendererAt(0u);
+ DALI_TEST_CHECK(renderer);
- Property::Map map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- Property::Value* value = map.Find( DevelImageVisual::Property::PLAY_RANGE );
+ Property::Map map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ Property::Value* value = map.Find(DevelImageVisual::Property::PLAY_RANGE);
- int resultStartFrame, resultEndFrame;
+ int resultStartFrame, resultEndFrame;
Property::Array* result = value->GetArray();
- result->GetElementAt( 0 ).Get( resultStartFrame );
- result->GetElementAt( 1 ).Get( resultEndFrame );
+ result->GetElementAt(0).Get(resultStartFrame);
+ result->GetElementAt(1).Get(resultEndFrame);
- DALI_TEST_EQUALS( startFrame, resultStartFrame, TEST_LOCATION );
- DALI_TEST_EQUALS( endFrame, resultEndFrame, TEST_LOCATION );
+ DALI_TEST_EQUALS(startFrame, resultStartFrame, TEST_LOCATION);
+ DALI_TEST_EQUALS(endFrame, resultEndFrame, TEST_LOCATION);
// Set invalid play range
array.Clear();
- array.PushBack( 1 );
- array.PushBack( 100 );
+ array.PushBack(1);
+ array.PushBack(100);
attributes.Clear();
- attributes.Add( DevelImageVisual::Property::PLAY_RANGE, array );
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes );
+ attributes.Add(DevelImageVisual::Property::PLAY_RANGE, array);
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes);
application.SendNotification();
application.Render();
- std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) ); // wait for next rasterize thread run
+ std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
- map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- value = map.Find( DevelImageVisual::Property::PLAY_RANGE );
+ map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ value = map.Find(DevelImageVisual::Property::PLAY_RANGE);
result = value->GetArray();
- result->GetElementAt( 0 ).Get( resultStartFrame );
- result->GetElementAt( 1 ).Get( resultEndFrame );
+ result->GetElementAt(0).Get(resultStartFrame);
+ result->GetElementAt(1).Get(resultEndFrame);
- DALI_TEST_EQUALS( startFrame, resultStartFrame, TEST_LOCATION ); // Should not be changed
- DALI_TEST_EQUALS( endFrame, resultEndFrame, TEST_LOCATION );
+ DALI_TEST_EQUALS(startFrame, resultStartFrame, TEST_LOCATION); // Should not be changed
+ DALI_TEST_EQUALS(endFrame, resultEndFrame, TEST_LOCATION);
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PAUSE, Property::Map() );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PAUSE, Property::Map());
application.SendNotification();
application.Render();
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::JUMP_TO, 3 );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::JUMP_TO, 3);
application.SendNotification();
application.Render();
- std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) ); // wait for next rasterize thread run
+ std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
- map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- value = map.Find( DevelImageVisual::Property::CURRENT_FRAME_NUMBER );
- DALI_TEST_EQUALS( value->Get< int >(), 3, TEST_LOCATION );
+ map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ value = map.Find(DevelImageVisual::Property::CURRENT_FRAME_NUMBER);
+ DALI_TEST_EQUALS(value->Get<int>(), 3, TEST_LOCATION);
array.Clear();
- array.PushBack( 0 );
- array.PushBack( 2 );
+ array.PushBack(0);
+ array.PushBack(2);
attributes.Clear();
- attributes.Add( DevelImageVisual::Property::PLAY_RANGE, array );
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes );
+ attributes.Add(DevelImageVisual::Property::PLAY_RANGE, array);
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes);
application.SendNotification();
application.Render();
- std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) ); // wait for next rasterize thread run
+ std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
- map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- value = map.Find( DevelImageVisual::Property::PLAY_RANGE );
+ map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ value = map.Find(DevelImageVisual::Property::PLAY_RANGE);
result = value->GetArray();
- result->GetElementAt( 0 ).Get( resultStartFrame );
- result->GetElementAt( 1 ).Get( resultEndFrame );
+ result->GetElementAt(0).Get(resultStartFrame);
+ result->GetElementAt(1).Get(resultEndFrame);
- DALI_TEST_EQUALS( 0, resultStartFrame, TEST_LOCATION );
- DALI_TEST_EQUALS( 2, resultEndFrame, TEST_LOCATION );
+ DALI_TEST_EQUALS(0, resultStartFrame, TEST_LOCATION);
+ DALI_TEST_EQUALS(2, resultEndFrame, TEST_LOCATION);
- value = map.Find( DevelImageVisual::Property::CURRENT_FRAME_NUMBER );
- DALI_TEST_EQUALS( value->Get< int >(), 2, TEST_LOCATION ); // CURRENT_FRAME_NUMBER should be changed also.
+ value = map.Find(DevelImageVisual::Property::CURRENT_FRAME_NUMBER);
+ DALI_TEST_EQUALS(value->Get<int>(), 2, TEST_LOCATION); // CURRENT_FRAME_NUMBER should be changed also.
END_TEST;
}
int UtcDaliAnimatedVectorImageVisualPlayRangeMarker(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliAnimatedVectorImageVisualPlayRangeMarker" );
+ tet_infoline("UtcDaliAnimatedVectorImageVisualPlayRangeMarker");
Property::Array array;
- array.PushBack( VECTOR_ANIMATION_MARKER_NAME_1 );
+ array.PushBack(VECTOR_ANIMATION_MARKER_NAME_1);
Property::Map propertyMap;
- propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE )
- .Add( ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME )
- .Add( DevelImageVisual::Property::PLAY_RANGE, array );
+ propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME)
+ .Add(DevelImageVisual::Property::PLAY_RANGE, array);
- Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- DummyControl actor = DummyControl::New( true );
- DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ DummyControl actor = DummyControl::New(true);
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- Vector2 controlSize( 20.f, 30.f );
- actor.SetProperty( Actor::Property::SIZE, controlSize );
+ Vector2 controlSize(20.f, 30.f);
+ actor.SetProperty(Actor::Property::SIZE, controlSize);
- application.GetScene().Add( actor );
+ application.GetScene().Add(actor);
Property::Map attributes;
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes);
application.SendNotification();
application.Render();
- std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) ); // wait for next rasterize thread run
+ std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
// renderer is added to actor
- DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
- Renderer renderer = actor.GetRendererAt( 0u );
- DALI_TEST_CHECK( renderer );
+ DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
+ Renderer renderer = actor.GetRendererAt(0u);
+ DALI_TEST_CHECK(renderer);
- Property::Map map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- Property::Value* value = map.Find( DevelImageVisual::Property::PLAY_RANGE );
+ Property::Map map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ Property::Value* value = map.Find(DevelImageVisual::Property::PLAY_RANGE);
- int resultStartFrame, resultEndFrame;
+ int resultStartFrame, resultEndFrame;
Property::Array* result = value->GetArray();
- result->GetElementAt( 0 ).Get( resultStartFrame );
- result->GetElementAt( 1 ).Get( resultEndFrame );
+ result->GetElementAt(0).Get(resultStartFrame);
+ result->GetElementAt(1).Get(resultEndFrame);
- DALI_TEST_EQUALS( VECTOR_ANIMATION_MARKER_START_FRAME_1, resultStartFrame, TEST_LOCATION );
- DALI_TEST_EQUALS( VECTOR_ANIMATION_MARKER_END_FRAME_1, resultEndFrame, TEST_LOCATION );
+ DALI_TEST_EQUALS(VECTOR_ANIMATION_MARKER_START_FRAME_1, resultStartFrame, TEST_LOCATION);
+ DALI_TEST_EQUALS(VECTOR_ANIMATION_MARKER_END_FRAME_1, resultEndFrame, TEST_LOCATION);
// Set 2 markers
array.Clear();
- array.PushBack( VECTOR_ANIMATION_MARKER_NAME_1 );
- array.PushBack( VECTOR_ANIMATION_MARKER_NAME_2 );
+ array.PushBack(VECTOR_ANIMATION_MARKER_NAME_1);
+ array.PushBack(VECTOR_ANIMATION_MARKER_NAME_2);
attributes.Clear();
- attributes.Add( DevelImageVisual::Property::PLAY_RANGE, array );
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes );
+ attributes.Add(DevelImageVisual::Property::PLAY_RANGE, array);
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes);
application.SendNotification();
application.Render();
- std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) ); // wait for next rasterize thread run
+ std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
- map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- value = map.Find( DevelImageVisual::Property::PLAY_RANGE );
+ map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ value = map.Find(DevelImageVisual::Property::PLAY_RANGE);
result = value->GetArray();
- result->GetElementAt( 0 ).Get( resultStartFrame );
- result->GetElementAt( 1 ).Get( resultEndFrame );
+ result->GetElementAt(0).Get(resultStartFrame);
+ result->GetElementAt(1).Get(resultEndFrame);
- DALI_TEST_EQUALS( VECTOR_ANIMATION_MARKER_START_FRAME_1, resultStartFrame, TEST_LOCATION );
- DALI_TEST_EQUALS( VECTOR_ANIMATION_MARKER_END_FRAME_2, resultEndFrame, TEST_LOCATION );
+ DALI_TEST_EQUALS(VECTOR_ANIMATION_MARKER_START_FRAME_1, resultStartFrame, TEST_LOCATION);
+ DALI_TEST_EQUALS(VECTOR_ANIMATION_MARKER_END_FRAME_2, resultEndFrame, TEST_LOCATION);
// Set invalid play range
array.Clear();
- array.PushBack( 1 );
- array.PushBack( VECTOR_ANIMATION_MARKER_NAME_1 );
+ array.PushBack(1);
+ array.PushBack(VECTOR_ANIMATION_MARKER_NAME_1);
attributes.Clear();
- attributes.Add( DevelImageVisual::Property::PLAY_RANGE, array );
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes );
+ attributes.Add(DevelImageVisual::Property::PLAY_RANGE, array);
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes);
application.SendNotification();
application.Render();
- std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) ); // wait for next rasterize thread run
+ std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
- map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- value = map.Find( DevelImageVisual::Property::PLAY_RANGE );
+ map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ value = map.Find(DevelImageVisual::Property::PLAY_RANGE);
result = value->GetArray();
- result->GetElementAt( 0 ).Get( resultStartFrame );
- result->GetElementAt( 1 ).Get( resultEndFrame );
+ result->GetElementAt(0).Get(resultStartFrame);
+ result->GetElementAt(1).Get(resultEndFrame);
- DALI_TEST_EQUALS( VECTOR_ANIMATION_MARKER_START_FRAME_1, resultStartFrame, TEST_LOCATION ); // Should not be changed
- DALI_TEST_EQUALS( VECTOR_ANIMATION_MARKER_END_FRAME_2, resultEndFrame, TEST_LOCATION );
+ DALI_TEST_EQUALS(VECTOR_ANIMATION_MARKER_START_FRAME_1, resultStartFrame, TEST_LOCATION); // Should not be changed
+ DALI_TEST_EQUALS(VECTOR_ANIMATION_MARKER_END_FRAME_2, resultEndFrame, TEST_LOCATION);
END_TEST;
}
int UtcDaliAnimatedVectorImageVisualAnimationFinishedSignal(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliAnimatedVectorImageVisualAnimationFinishedSignal" );
+ tet_infoline("UtcDaliAnimatedVectorImageVisualAnimationFinishedSignal");
Property::Map propertyMap;
- propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE )
- .Add( ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME )
- .Add( DevelImageVisual::Property::LOOP_COUNT, 3 );
+ propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME)
+ .Add(DevelImageVisual::Property::LOOP_COUNT, 3);
- Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- DummyControl actor = DummyControl::New( true );
- DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ DummyControl actor = DummyControl::New(true);
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- DevelControl::VisualEventSignal( actor ).Connect( &VisualEventSignal );
+ DevelControl::VisualEventSignal(actor).Connect(&VisualEventSignal);
- Vector2 controlSize( 20.f, 30.f );
- actor.SetProperty( Actor::Property::SIZE, controlSize );
+ Vector2 controlSize(20.f, 30.f);
+ actor.SetProperty(Actor::Property::SIZE, controlSize);
- application.GetScene().Add( actor );
+ application.GetScene().Add(actor);
Property::Map attributes;
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes);
application.SendNotification();
application.Render();
// Wait for animation finish
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
- Property::Map map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- Property::Value* value = map.Find( DevelImageVisual::Property::PLAY_STATE );
- DALI_TEST_CHECK( value->Get< int >() == DevelImageVisual::PlayState::STOPPED );
+ Property::Map map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ Property::Value* value = map.Find(DevelImageVisual::Property::PLAY_STATE);
+ DALI_TEST_CHECK(value->Get<int>() == DevelImageVisual::PlayState::STOPPED);
- DALI_TEST_EQUALS( gAnimationFinishedSignalFired, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gAnimationFinishedSignalFired, true, TEST_LOCATION);
END_TEST;
}
int UtcDaliAnimatedVectorImageVisualJumpTo(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliAnimatedVectorImageVisualJumpTo" );
+ tet_infoline("UtcDaliAnimatedVectorImageVisualJumpTo");
Property::Map propertyMap;
- propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE )
- .Add( ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME );
+ propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME);
- Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- tet_printf( "1. Visual is created.\n" );
+ tet_printf("1. Visual is created.\n");
- DummyControl actor = DummyControl::New( true );
- DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ DummyControl actor = DummyControl::New(true);
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- Vector2 controlSize( 20.f, 30.f );
- actor.SetProperty( Actor::Property::SIZE, controlSize );
+ Vector2 controlSize(20.f, 30.f);
+ actor.SetProperty(Actor::Property::SIZE, controlSize);
- application.GetScene().Add( actor );
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render();
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::JUMP_TO, 2 );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::JUMP_TO, 2);
application.SendNotification();
application.Render();
- std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) ); // wait for next rasterize thread run
+ std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
- Property::Map map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- Property::Value* value = map.Find( DevelImageVisual::Property::CURRENT_FRAME_NUMBER );
- DALI_TEST_EQUALS( value->Get< int >(), 2, TEST_LOCATION );
+ Property::Map map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ Property::Value* value = map.Find(DevelImageVisual::Property::CURRENT_FRAME_NUMBER);
+ DALI_TEST_EQUALS(value->Get<int>(), 2, TEST_LOCATION);
- tet_printf( "2. The current frame number is [%d].\n", value->Get< int >() );
+ tet_printf("2. The current frame number is [%d].\n", value->Get<int>());
Property::Array array;
- array.PushBack( 0 );
- array.PushBack( 2 );
+ array.PushBack(0);
+ array.PushBack(2);
Property::Map attributes;
- attributes.Add( DevelImageVisual::Property::PLAY_RANGE, array );
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes );
+ attributes.Add(DevelImageVisual::Property::PLAY_RANGE, array);
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes);
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::JUMP_TO, 3 );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::JUMP_TO, 3);
application.SendNotification();
application.Render();
- std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) ); // wait for next rasterize thread run
+ std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
- map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- value = map.Find( DevelImageVisual::Property::CURRENT_FRAME_NUMBER );
- DALI_TEST_EQUALS( value->Get< int >(), 2, TEST_LOCATION );
+ map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ value = map.Find(DevelImageVisual::Property::CURRENT_FRAME_NUMBER);
+ DALI_TEST_EQUALS(value->Get<int>(), 2, TEST_LOCATION);
- tet_printf( "3. The current frame number is [%d].\n", value->Get< int >() );
+ tet_printf("3. The current frame number is [%d].\n", value->Get<int>());
// Change play range
attributes.Clear();
array.Clear();
- array.PushBack( 0 );
- array.PushBack( 4 );
+ array.PushBack(0);
+ array.PushBack(4);
- attributes.Add( DevelImageVisual::Property::PLAY_RANGE, array );
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes );
+ attributes.Add(DevelImageVisual::Property::PLAY_RANGE, array);
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes);
attributes.Clear();
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes);
application.SendNotification();
application.Render();
// Stop and jump to 3
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::STOP, attributes );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::STOP, attributes);
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::JUMP_TO, 3 );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::JUMP_TO, 3);
application.SendNotification();
application.Render();
- std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) ); // wait for next rasterize thread run
+ std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
- map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- value = map.Find( DevelImageVisual::Property::CURRENT_FRAME_NUMBER );
- DALI_TEST_EQUALS( value->Get< int >(), 3, TEST_LOCATION );
+ map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ value = map.Find(DevelImageVisual::Property::CURRENT_FRAME_NUMBER);
+ DALI_TEST_EQUALS(value->Get<int>(), 3, TEST_LOCATION);
- tet_printf( "4. The current frame number is [%d].\n", value->Get< int >() );
+ tet_printf("4. The current frame number is [%d].\n", value->Get<int>());
// Jump to the same position
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::JUMP_TO, 3 );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::JUMP_TO, 3);
application.SendNotification();
application.Render();
- std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) ); // wait for next rasterize thread run
+ std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
- map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- value = map.Find( DevelImageVisual::Property::CURRENT_FRAME_NUMBER );
- DALI_TEST_EQUALS( value->Get< int >(), 3, TEST_LOCATION );
+ map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ value = map.Find(DevelImageVisual::Property::CURRENT_FRAME_NUMBER);
+ DALI_TEST_EQUALS(value->Get<int>(), 3, TEST_LOCATION);
- tet_printf( "5. The current frame number is [%d].\n", value->Get< int >() );
+ tet_printf("5. The current frame number is [%d].\n", value->Get<int>());
END_TEST;
}
int UtcDaliAnimatedVectorImageVisualUpdateProperty(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliAnimatedVectorImageVisualUpdateProperty" );
+ tet_infoline("UtcDaliAnimatedVectorImageVisualUpdateProperty");
- int startFrame = 1, endFrame = 3;
+ int startFrame = 1, endFrame = 3;
Property::Array playRange;
- playRange.PushBack( startFrame );
- playRange.PushBack( endFrame );
+ playRange.PushBack(startFrame);
+ playRange.PushBack(endFrame);
Property::Map propertyMap;
- propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE )
- .Add( ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME )
- .Add( DevelImageVisual::Property::LOOP_COUNT, 3 )
- .Add( DevelImageVisual::Property::PLAY_RANGE, playRange );
+ propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME)
+ .Add(DevelImageVisual::Property::LOOP_COUNT, 3)
+ .Add(DevelImageVisual::Property::PLAY_RANGE, playRange);
- Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- DummyControl actor = DummyControl::New( true );
- DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ DummyControl actor = DummyControl::New(true);
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- Vector2 controlSize( 20.f, 30.f );
- actor.SetProperty( Actor::Property::SIZE, controlSize );
+ Vector2 controlSize(20.f, 30.f);
+ actor.SetProperty(Actor::Property::SIZE, controlSize);
- application.GetScene().Add( actor );
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render();
- std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) ); // wait for next rasterize thread run
+ std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
- Property::Map map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- Property::Value* value = map.Find( DevelImageVisual::Property::LOOP_COUNT );
- DALI_TEST_EQUALS( value->Get< int >(), 3, TEST_LOCATION );
+ Property::Map map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ Property::Value* value = map.Find(DevelImageVisual::Property::LOOP_COUNT);
+ DALI_TEST_EQUALS(value->Get<int>(), 3, TEST_LOCATION);
- value = map.Find( DevelImageVisual::Property::PLAY_RANGE, Property::ARRAY );
- DALI_TEST_CHECK( value );
+ value = map.Find(DevelImageVisual::Property::PLAY_RANGE, Property::ARRAY);
+ DALI_TEST_CHECK(value);
Property::Array* result = value->GetArray();
- DALI_TEST_CHECK( result );
+ DALI_TEST_CHECK(result);
- DALI_TEST_CHECK( result->GetElementAt( 0 ).Get< int >() == startFrame );
- DALI_TEST_CHECK( result->GetElementAt( 1 ).Get< int >() == endFrame );
+ DALI_TEST_CHECK(result->GetElementAt(0).Get<int>() == startFrame);
+ DALI_TEST_CHECK(result->GetElementAt(1).Get<int>() == endFrame);
playRange.Clear();
- playRange.PushBack( 0 );
- playRange.PushBack( 2 );
+ playRange.PushBack(0);
+ playRange.PushBack(2);
Property::Map attributes;
- attributes.Add( DevelImageVisual::Property::PLAY_RANGE, playRange );
- attributes.Add( DevelImageVisual::Property::LOOP_COUNT, 5 );
+ attributes.Add(DevelImageVisual::Property::PLAY_RANGE, playRange);
+ attributes.Add(DevelImageVisual::Property::LOOP_COUNT, 5);
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes);
application.SendNotification();
application.Render();
- std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) ); // wait for next rasterize thread run
+ std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
- map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- value = map.Find( DevelImageVisual::Property::LOOP_COUNT );
- DALI_TEST_EQUALS( value->Get< int >(), 5, TEST_LOCATION );
+ map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ value = map.Find(DevelImageVisual::Property::LOOP_COUNT);
+ DALI_TEST_EQUALS(value->Get<int>(), 5, TEST_LOCATION);
- value = map.Find( DevelImageVisual::Property::PLAY_RANGE );
+ value = map.Find(DevelImageVisual::Property::PLAY_RANGE);
result = value->GetArray();
- DALI_TEST_CHECK( result );
+ DALI_TEST_CHECK(result);
- DALI_TEST_CHECK( result->GetElementAt( 0 ).Get< int >() == 0 );
- DALI_TEST_CHECK( result->GetElementAt( 1 ).Get< int >() == 2 );
+ DALI_TEST_CHECK(result->GetElementAt(0).Get<int>() == 0);
+ DALI_TEST_CHECK(result->GetElementAt(1).Get<int>() == 2);
attributes.Clear();
playRange.Clear();
- playRange.PushBack( startFrame );
- playRange.PushBack( endFrame );
+ playRange.PushBack(startFrame);
+ playRange.PushBack(endFrame);
- attributes.Add( DevelImageVisual::Property::PLAY_RANGE, playRange );
+ attributes.Add(DevelImageVisual::Property::PLAY_RANGE, playRange);
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes);
application.SendNotification();
application.Render();
- std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) ); // wait for next rasterize thread run
+ std::this_thread::sleep_for(std::chrono::milliseconds(20)); // wait for next rasterize thread run
- map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- value = map.Find( DevelImageVisual::Property::PLAY_RANGE );
+ map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ value = map.Find(DevelImageVisual::Property::PLAY_RANGE);
result = value->GetArray();
- DALI_TEST_CHECK( result );
+ DALI_TEST_CHECK(result);
- DALI_TEST_CHECK( result->GetElementAt( 0 ).Get< int >() == startFrame );
- DALI_TEST_CHECK( result->GetElementAt( 1 ).Get< int >() == endFrame );
+ DALI_TEST_CHECK(result->GetElementAt(0).Get<int>() == startFrame);
+ DALI_TEST_CHECK(result->GetElementAt(1).Get<int>() == endFrame);
// Play and update property
attributes.Clear();
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes);
application.SendNotification();
application.Render();
- attributes.Add( DevelImageVisual::Property::LOOP_COUNT, 10 );
+ attributes.Add(DevelImageVisual::Property::LOOP_COUNT, 10);
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes);
application.SendNotification();
application.Render();
- map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- value = map.Find( DevelImageVisual::Property::LOOP_COUNT );
- DALI_TEST_EQUALS( value->Get< int >(), 10, TEST_LOCATION );
+ map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ value = map.Find(DevelImageVisual::Property::LOOP_COUNT);
+ DALI_TEST_EQUALS(value->Get<int>(), 10, TEST_LOCATION);
END_TEST;
}
int UtcDaliAnimatedVectorImageVisualStopBehavior(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliAnimatedVectorImageVisualStopBehavior" );
+ tet_infoline("UtcDaliAnimatedVectorImageVisualStopBehavior");
Property::Map propertyMap;
- propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE )
- .Add( ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME )
- .Add( DevelImageVisual::Property::LOOP_COUNT, 3 )
- .Add( DevelImageVisual::Property::STOP_BEHAVIOR, DevelImageVisual::StopBehavior::FIRST_FRAME );
+ propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME)
+ .Add(DevelImageVisual::Property::LOOP_COUNT, 3)
+ .Add(DevelImageVisual::Property::STOP_BEHAVIOR, DevelImageVisual::StopBehavior::FIRST_FRAME);
- Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- DummyControl actor = DummyControl::New( true );
- DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ DummyControl actor = DummyControl::New(true);
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- Vector2 controlSize( 20.f, 30.f );
- actor.SetProperty( Actor::Property::SIZE, controlSize );
+ Vector2 controlSize(20.f, 30.f);
+ actor.SetProperty(Actor::Property::SIZE, controlSize);
- application.GetScene().Add( actor );
+ application.GetScene().Add(actor);
Property::Map attributes;
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes);
application.SendNotification();
application.Render();
// Trigger count is 1 - animation finished
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
- Property::Map map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- Property::Value* value = map.Find( DevelImageVisual::Property::CURRENT_FRAME_NUMBER );
- DALI_TEST_EQUALS( value->Get< int >(), 0, TEST_LOCATION ); // Should be the first frame
+ Property::Map map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ Property::Value* value = map.Find(DevelImageVisual::Property::CURRENT_FRAME_NUMBER);
+ DALI_TEST_EQUALS(value->Get<int>(), 0, TEST_LOCATION); // Should be the first frame
// Change stop behavior
- attributes.Add( DevelImageVisual::Property::STOP_BEHAVIOR, DevelImageVisual::StopBehavior::LAST_FRAME );
+ attributes.Add(DevelImageVisual::Property::STOP_BEHAVIOR, DevelImageVisual::StopBehavior::LAST_FRAME);
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes);
attributes.Clear();
// Play again
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes);
application.SendNotification();
application.Render();
// Trigger count is 1 - animation finished
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
- map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
+ map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
- Property::Value* value1 = map.Find( DevelImageVisual::Property::TOTAL_FRAME_NUMBER );
- int totalFrameNumber = value1->Get< int >();
+ Property::Value* value1 = map.Find(DevelImageVisual::Property::TOTAL_FRAME_NUMBER);
+ int totalFrameNumber = value1->Get<int>();
- value = map.Find( DevelImageVisual::Property::CURRENT_FRAME_NUMBER );
- DALI_TEST_EQUALS( value->Get< int >(), totalFrameNumber - 1, TEST_LOCATION ); // Should be the last frame
+ value = map.Find(DevelImageVisual::Property::CURRENT_FRAME_NUMBER);
+ DALI_TEST_EQUALS(value->Get<int>(), totalFrameNumber - 1, TEST_LOCATION); // Should be the last frame
// Change stop behavior
- attributes.Add( DevelImageVisual::Property::STOP_BEHAVIOR, DevelImageVisual::StopBehavior::CURRENT_FRAME );
- attributes.Add( DevelImageVisual::Property::LOOP_COUNT, -1 );
+ attributes.Add(DevelImageVisual::Property::STOP_BEHAVIOR, DevelImageVisual::StopBehavior::CURRENT_FRAME);
+ attributes.Add(DevelImageVisual::Property::LOOP_COUNT, -1);
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes);
attributes.Clear();
// Play again
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes);
application.SendNotification();
application.Render();
// Pause
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PAUSE, attributes );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PAUSE, attributes);
- map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- value = map.Find( DevelImageVisual::Property::CURRENT_FRAME_NUMBER );
- int currentFrameNumber = value->Get< int >();
+ map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ value = map.Find(DevelImageVisual::Property::CURRENT_FRAME_NUMBER);
+ int currentFrameNumber = value->Get<int>();
// Stop
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::STOP, attributes );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::STOP, attributes);
application.SendNotification();
- application.Render( 16 );
+ application.Render(16);
- map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- value = map.Find( DevelImageVisual::Property::CURRENT_FRAME_NUMBER );
- DALI_TEST_EQUALS( value->Get< int >(), currentFrameNumber, TEST_LOCATION ); // Should be same with currentFrameNumber
+ map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ value = map.Find(DevelImageVisual::Property::CURRENT_FRAME_NUMBER);
+ DALI_TEST_EQUALS(value->Get<int>(), currentFrameNumber, TEST_LOCATION); // Should be same with currentFrameNumber
END_TEST;
}
int UtcDaliAnimatedVectorImageVisualLoopingMode(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliAnimatedVectorImageVisualLoopingMode" );
+ tet_infoline("UtcDaliAnimatedVectorImageVisualLoopingMode");
Property::Map propertyMap;
- propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE )
- .Add( ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME )
- .Add( DevelImageVisual::Property::LOOP_COUNT, 3 )
- .Add( DevelImageVisual::Property::STOP_BEHAVIOR, DevelImageVisual::StopBehavior::LAST_FRAME )
- .Add( DevelImageVisual::Property::LOOPING_MODE, DevelImageVisual::LoopingMode::AUTO_REVERSE );
+ propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME)
+ .Add(DevelImageVisual::Property::LOOP_COUNT, 3)
+ .Add(DevelImageVisual::Property::STOP_BEHAVIOR, DevelImageVisual::StopBehavior::LAST_FRAME)
+ .Add(DevelImageVisual::Property::LOOPING_MODE, DevelImageVisual::LoopingMode::AUTO_REVERSE);
- Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- DummyControl actor = DummyControl::New( true );
- DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ DummyControl actor = DummyControl::New(true);
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- Vector2 controlSize( 20.f, 30.f );
- actor.SetProperty( Actor::Property::SIZE, controlSize );
+ Vector2 controlSize(20.f, 30.f);
+ actor.SetProperty(Actor::Property::SIZE, controlSize);
- application.GetScene().Add( actor );
+ application.GetScene().Add(actor);
Property::Map attributes;
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes);
application.SendNotification();
application.Render();
// Trigger count is 1 - animation finished
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
- Property::Map map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- Property::Value* value = map.Find( DevelImageVisual::Property::CURRENT_FRAME_NUMBER );
- DALI_TEST_EQUALS( value->Get< int >(), 0, TEST_LOCATION ); // Should be the first frame because of auto reverse
+ Property::Map map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ Property::Value* value = map.Find(DevelImageVisual::Property::CURRENT_FRAME_NUMBER);
+ DALI_TEST_EQUALS(value->Get<int>(), 0, TEST_LOCATION); // Should be the first frame because of auto reverse
// Change stop behavior
- attributes.Add( DevelImageVisual::Property::STOP_BEHAVIOR, DevelImageVisual::StopBehavior::CURRENT_FRAME );
+ attributes.Add(DevelImageVisual::Property::STOP_BEHAVIOR, DevelImageVisual::StopBehavior::CURRENT_FRAME);
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes);
// Play again
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes);
application.SendNotification();
application.Render();
// Trigger count is 1 - animation finished
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
- map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- value = map.Find( DevelImageVisual::Property::CURRENT_FRAME_NUMBER );
- DALI_TEST_EQUALS( value->Get< int >(), 0, TEST_LOCATION ); // Should be the first frame
+ map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ value = map.Find(DevelImageVisual::Property::CURRENT_FRAME_NUMBER);
+ DALI_TEST_EQUALS(value->Get<int>(), 0, TEST_LOCATION); // Should be the first frame
// Change looping mode
- attributes.Add( DevelImageVisual::Property::LOOPING_MODE, DevelImageVisual::LoopingMode::RESTART );
+ attributes.Add(DevelImageVisual::Property::LOOPING_MODE, DevelImageVisual::LoopingMode::RESTART);
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes);
// Play again
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes);
application.SendNotification();
application.Render();
// Trigger count is 1 - animation finished
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
- Property::Value* value1 = map.Find( DevelImageVisual::Property::TOTAL_FRAME_NUMBER );
- int totalFrameNumber = value1->Get< int >();
+ Property::Value* value1 = map.Find(DevelImageVisual::Property::TOTAL_FRAME_NUMBER);
+ int totalFrameNumber = value1->Get<int>();
- map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- value = map.Find( DevelImageVisual::Property::CURRENT_FRAME_NUMBER );
- DALI_TEST_EQUALS( value->Get< int >(), totalFrameNumber - 1, TEST_LOCATION ); // Should be the last frame
+ map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ value = map.Find(DevelImageVisual::Property::CURRENT_FRAME_NUMBER);
+ DALI_TEST_EQUALS(value->Get<int>(), totalFrameNumber - 1, TEST_LOCATION); // Should be the last frame
END_TEST;
}
int UtcDaliAnimatedVectorImageVisualPropertyNotification(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliAnimatedVectorImageVisualPropertyNotification" );
+ tet_infoline("UtcDaliAnimatedVectorImageVisualPropertyNotification");
Property::Map propertyMap;
- propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE )
- .Add( ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME );
+ propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME);
- Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- DummyControl actor = DummyControl::New( true );
- DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ DummyControl actor = DummyControl::New(true);
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- Vector2 controlSize( 20.f, 30.f );
- Vector3 controlScale( 2.0f, 2.0f, 1.0f );
- actor.SetProperty( Actor::Property::SIZE, controlSize );
- actor.SetProperty( Actor::Property::SCALE, controlScale );
+ Vector2 controlSize(20.f, 30.f);
+ Vector3 controlScale(2.0f, 2.0f, 1.0f);
+ actor.SetProperty(Actor::Property::SIZE, controlSize);
+ actor.SetProperty(Actor::Property::SCALE, controlScale);
- application.GetScene().Add( actor );
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render();
application.SendNotification();
application.Render();
- Renderer renderer = actor.GetRendererAt( 0u );
- DALI_TEST_CHECK( renderer );
+ Renderer renderer = actor.GetRendererAt(0u);
+ DALI_TEST_CHECK(renderer);
auto textureSet = renderer.GetTextures();
- auto texture = textureSet.GetTexture(0);
+ auto texture = textureSet.GetTexture(0);
- DALI_TEST_EQUALS( controlSize.width * controlScale.width, texture.GetWidth(), TEST_LOCATION );
- DALI_TEST_EQUALS( controlSize.height * controlScale.height, texture.GetHeight(), TEST_LOCATION );
+ DALI_TEST_EQUALS(controlSize.width * controlScale.width, texture.GetWidth(), TEST_LOCATION);
+ DALI_TEST_EQUALS(controlSize.height * controlScale.height, texture.GetHeight(), TEST_LOCATION);
// Change scale and size
- controlSize = Vector2( 50.f, 40.f );
- controlScale= Vector3( 0.5f, 0.5f, 1.0f );
- actor.SetProperty( Actor::Property::SIZE, controlSize );
- actor.SetProperty( Actor::Property::SCALE, controlScale );
+ controlSize = Vector2(50.f, 40.f);
+ controlScale = Vector3(0.5f, 0.5f, 1.0f);
+ actor.SetProperty(Actor::Property::SIZE, controlSize);
+ actor.SetProperty(Actor::Property::SCALE, controlScale);
application.SendNotification();
application.Render();
application.SendNotification();
application.Render();
- renderer = actor.GetRendererAt( 0u );
- DALI_TEST_CHECK( renderer );
+ renderer = actor.GetRendererAt(0u);
+ DALI_TEST_CHECK(renderer);
textureSet = renderer.GetTextures();
- texture = textureSet.GetTexture(0);
+ texture = textureSet.GetTexture(0);
- DALI_TEST_EQUALS( controlSize.width * controlScale.width, texture.GetWidth(), TEST_LOCATION );
- DALI_TEST_EQUALS( controlSize.height * controlScale.height, texture.GetHeight(), TEST_LOCATION );
+ DALI_TEST_EQUALS(controlSize.width * controlScale.width, texture.GetWidth(), TEST_LOCATION);
+ DALI_TEST_EQUALS(controlSize.height * controlScale.height, texture.GetHeight(), TEST_LOCATION);
END_TEST;
}
int UtcDaliAnimatedVectorImageVisualMultipleInstances(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliAnimatedVectorImageVisualMultipleInstances" );
+ tet_infoline("UtcDaliAnimatedVectorImageVisualMultipleInstances");
Property::Map propertyMap;
- propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE )
- .Add( ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME );
+ propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME);
- Visual::Base visual1 = VisualFactory::Get().CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual1 );
+ Visual::Base visual1 = VisualFactory::Get().CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual1);
- DummyControl actor1 = DummyControl::New( true );
- DummyControlImpl& dummyImpl1 = static_cast< DummyControlImpl& >( actor1.GetImplementation() );
- dummyImpl1.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual1 );
+ DummyControl actor1 = DummyControl::New(true);
+ DummyControlImpl& dummyImpl1 = static_cast<DummyControlImpl&>(actor1.GetImplementation());
+ dummyImpl1.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual1);
- Vector2 controlSize( 20.f, 30.f );
- actor1.SetProperty( Actor::Property::SIZE, controlSize );
+ Vector2 controlSize(20.f, 30.f);
+ actor1.SetProperty(Actor::Property::SIZE, controlSize);
- application.GetScene().Add( actor1 );
+ application.GetScene().Add(actor1);
propertyMap.Clear();
- propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE )
- .Add( ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME );
+ propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME);
- Visual::Base visual2 = VisualFactory::Get().CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual2 );
+ Visual::Base visual2 = VisualFactory::Get().CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual2);
- DummyControl actor2 = DummyControl::New( true );
- DummyControlImpl& dummyImpl2 = static_cast< DummyControlImpl& >( actor2.GetImplementation() );
- dummyImpl2.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual2 );
+ DummyControl actor2 = DummyControl::New(true);
+ DummyControlImpl& dummyImpl2 = static_cast<DummyControlImpl&>(actor2.GetImplementation());
+ dummyImpl2.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual2);
- actor2.SetProperty( Actor::Property::SIZE, controlSize );
+ actor2.SetProperty(Actor::Property::SIZE, controlSize);
- application.GetScene().Add( actor2 );
+ application.GetScene().Add(actor2);
- DevelControl::DoAction( actor2, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, Property::Map() );
+ DevelControl::DoAction(actor2, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, Property::Map());
application.SendNotification();
application.Render();
- std::this_thread::sleep_for( std::chrono::milliseconds( 200 ) );
+ std::this_thread::sleep_for(std::chrono::milliseconds(200));
Property::Map attributes;
- attributes.Add( DevelImageVisual::Property::STOP_BEHAVIOR, DevelImageVisual::StopBehavior::LAST_FRAME );
+ attributes.Add(DevelImageVisual::Property::STOP_BEHAVIOR, DevelImageVisual::StopBehavior::LAST_FRAME);
- DevelControl::DoAction( actor1, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes );
- DevelControl::DoAction( actor2, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes );
+ DevelControl::DoAction(actor1, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes);
+ DevelControl::DoAction(actor2, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes);
- DevelControl::DoAction( actor1, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, Property::Map() );
+ DevelControl::DoAction(actor1, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, Property::Map());
// renderer is added to actor
- DALI_TEST_CHECK( actor1.GetRendererCount() == 1u );
- Renderer renderer1 = actor1.GetRendererAt( 0u );
- DALI_TEST_CHECK( renderer1 );
+ DALI_TEST_CHECK(actor1.GetRendererCount() == 1u);
+ Renderer renderer1 = actor1.GetRendererAt(0u);
+ DALI_TEST_CHECK(renderer1);
// renderer is added to actor
- DALI_TEST_CHECK( actor2.GetRendererCount() == 1u );
- Renderer renderer2 = actor2.GetRendererAt( 0u );
- DALI_TEST_CHECK( renderer2 );
+ DALI_TEST_CHECK(actor2.GetRendererCount() == 1u);
+ Renderer renderer2 = actor2.GetRendererAt(0u);
+ DALI_TEST_CHECK(renderer2);
END_TEST;
}
int UtcDaliAnimatedVectorImageVisualControlVisibilityChanged(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliAnimatedVectorImageVisualControlVisibilityChanged" );
+ tet_infoline("UtcDaliAnimatedVectorImageVisualControlVisibilityChanged");
Property::Map propertyMap;
- propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE )
- .Add( ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME );
+ propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME);
- Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- DummyControl actor = DummyControl::New( true );
- DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ DummyControl actor = DummyControl::New(true);
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- Vector2 controlSize( 20.f, 30.f );
- actor.SetProperty( Actor::Property::SIZE, controlSize );
+ Vector2 controlSize(20.f, 30.f);
+ actor.SetProperty(Actor::Property::SIZE, controlSize);
- application.GetScene().Add( actor );
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render();
Property::Map attributes;
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes);
application.SendNotification();
application.Render();
// Check rendering behavior
- DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
- Renderer renderer = actor.GetRendererAt( 0u );
- DALI_TEST_CHECK( renderer );
- DALI_TEST_CHECK( renderer.GetProperty< int >( DevelRenderer::Property::RENDERING_BEHAVIOR ) == DevelRenderer::Rendering::CONTINUOUSLY );
+ DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
+ Renderer renderer = actor.GetRendererAt(0u);
+ DALI_TEST_CHECK(renderer);
+ DALI_TEST_CHECK(renderer.GetProperty<int>(DevelRenderer::Property::RENDERING_BEHAVIOR) == DevelRenderer::Rendering::CONTINUOUSLY);
- actor.SetProperty( Actor::Property::VISIBLE, false );
+ actor.SetProperty(Actor::Property::VISIBLE, false);
application.SendNotification();
application.Render();
// Check rendering behavior again
- DALI_TEST_CHECK( renderer.GetProperty< int >( DevelRenderer::Property::RENDERING_BEHAVIOR ) == DevelRenderer::Rendering::IF_REQUIRED );
+ DALI_TEST_CHECK(renderer.GetProperty<int>(DevelRenderer::Property::RENDERING_BEHAVIOR) == DevelRenderer::Rendering::IF_REQUIRED);
END_TEST;
}
int UtcDaliAnimatedVectorImageVisualWindowVisibilityChanged(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliAnimatedVectorImageVisualWindowVisibilityChanged" );
+ tet_infoline("UtcDaliAnimatedVectorImageVisualWindowVisibilityChanged");
Property::Map propertyMap;
- propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE )
- .Add( ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME );
+ propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME);
- Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- DummyControl actor = DummyControl::New( true );
- DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ DummyControl actor = DummyControl::New(true);
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- Vector2 controlSize( 20.f, 30.f );
- actor.SetProperty( Actor::Property::SIZE, controlSize );
+ Vector2 controlSize(20.f, 30.f);
+ actor.SetProperty(Actor::Property::SIZE, controlSize);
- application.GetScene().Add( actor );
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render();
Property::Map attributes;
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes);
application.SendNotification();
application.Render();
// Check rendering behavior
- DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
- Renderer renderer = actor.GetRendererAt( 0u );
- DALI_TEST_CHECK( renderer );
- DALI_TEST_CHECK( renderer.GetProperty< int >( DevelRenderer::Property::RENDERING_BEHAVIOR ) == DevelRenderer::Rendering::CONTINUOUSLY );
+ DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
+ Renderer renderer = actor.GetRendererAt(0u);
+ DALI_TEST_CHECK(renderer);
+ DALI_TEST_CHECK(renderer.GetProperty<int>(DevelRenderer::Property::RENDERING_BEHAVIOR) == DevelRenderer::Rendering::CONTINUOUSLY);
- Window window = DevelWindow::Get( actor );
+ Window window = DevelWindow::Get(actor);
window.Hide();
application.SendNotification();
application.Render();
// Check rendering behavior again
- DALI_TEST_CHECK( renderer.GetProperty< int >( DevelRenderer::Property::RENDERING_BEHAVIOR ) == DevelRenderer::Rendering::IF_REQUIRED );
+ DALI_TEST_CHECK(renderer.GetProperty<int>(DevelRenderer::Property::RENDERING_BEHAVIOR) == DevelRenderer::Rendering::IF_REQUIRED);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline("Request loading with invalid file - should draw broken image");
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
Property::Map propertyMap;
propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
- .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_INVALID_FILE_NAME);
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_INVALID_FILE_NAME);
Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
DALI_TEST_CHECK(visual);
- DummyControl actor = DummyControl::New(true);
- DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >(actor.GetImplementation());
+ DummyControl actor = DummyControl::New(true);
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
actor.SetProperty(Actor::Property::SIZE, Vector2(20.0f, 20.0f));
Property::Map propertyMap;
propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE)
- .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME_FRAME_DROP);
+ .Add(ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME_FRAME_DROP);
Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
DALI_TEST_CHECK(visual);
- DummyControl actor = DummyControl::New(true);
+ DummyControl actor = DummyControl::New(true);
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
application.GetScene().Add(actor);
- Property::Map map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- Property::Value* value = map.Find( DevelImageVisual::Property::TOTAL_FRAME_NUMBER );
- int totalFrameNumber = value->Get< int >();
+ Property::Map map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ Property::Value* value = map.Find(DevelImageVisual::Property::TOTAL_FRAME_NUMBER);
+ int totalFrameNumber = value->Get<int>();
Property::Map attributes;
DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes);
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
* limitations under the License.
*/
-#include <iostream>
-#include <stdlib.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
-#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
#include <dali-toolkit/devel-api/controls/control-devel.h>
-#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
+#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
#include <dali-toolkit/devel-api/visuals/arc-visual-properties-devel.h>
#include <dali-toolkit/devel-api/visuals/visual-actions-devel.h>
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
#include <dali/devel-api/rendering/renderer-devel.h>
+#include <stdlib.h>
+#include <iostream>
#include "dummy-control.h"
using namespace Dali;
int UtcDaliVisualFactoryGetArcVisual01(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetArcVisual01: Request arc visual with a Property::Map" );
+ tet_infoline("UtcDaliVisualFactoryGetArcVisual01: Request arc visual with a Property::Map");
Property::Map propertyMap;
- propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ARC )
- .Add( Visual::Property::MIX_COLOR, Color::RED )
- .Add( DevelArcVisual::Property::THICKNESS, 20.0f );
+ propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ARC)
+ .Add(Visual::Property::MIX_COLOR, Color::RED)
+ .Add(DevelArcVisual::Property::THICKNESS, 20.0f);
- Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- DummyControl actor = DummyControl::New( true );
- DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- actor.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 200.0f ) );
- application.GetScene().Add( actor );
+ DummyControl actor = DummyControl::New(true);
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
+ actor.SetProperty(Actor::Property::SIZE, Vector2(200.0f, 200.0f));
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render();
// renderer is added to actor
- DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
- Renderer renderer = actor.GetRendererAt( 0u );
- DALI_TEST_CHECK( renderer );
+ DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
+ Renderer renderer = actor.GetRendererAt(0u);
+ DALI_TEST_CHECK(renderer);
- actor.Unparent( );
- DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
+ actor.Unparent();
+ DALI_TEST_CHECK(actor.GetRendererCount() == 0u);
END_TEST;
}
int UtcDaliVisualFactoryGetArcVisual02(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetArcVisual02: Request arc visual with a Property::Map" );
+ tet_infoline("UtcDaliVisualFactoryGetArcVisual02: Request arc visual with a Property::Map");
Property::Map propertyMap;
- propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ARC )
- .Add( Visual::Property::MIX_COLOR, Color::RED )
- .Add( DevelArcVisual::Property::THICKNESS, 20.0f )
- .Add( DevelArcVisual::Property::START_ANGLE, 0.0f )
- .Add( DevelArcVisual::Property::SWEEP_ANGLE, 90.0f )
- .Add( DevelArcVisual::Property::CAP, DevelArcVisual::Cap::ROUND );
-
- Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
-
- DummyControl actor = DummyControl::New( true );
- DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- actor.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 200.0f ) );
- application.GetScene().Add( actor );
+ propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ARC)
+ .Add(Visual::Property::MIX_COLOR, Color::RED)
+ .Add(DevelArcVisual::Property::THICKNESS, 20.0f)
+ .Add(DevelArcVisual::Property::START_ANGLE, 0.0f)
+ .Add(DevelArcVisual::Property::SWEEP_ANGLE, 90.0f)
+ .Add(DevelArcVisual::Property::CAP, DevelArcVisual::Cap::ROUND);
+
+ Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
+
+ DummyControl actor = DummyControl::New(true);
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
+ actor.SetProperty(Actor::Property::SIZE, Vector2(200.0f, 200.0f));
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render();
// renderer is added to actor
- DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
- Renderer renderer = actor.GetRendererAt( 0u );
- DALI_TEST_CHECK( renderer );
+ DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
+ Renderer renderer = actor.GetRendererAt(0u);
+ DALI_TEST_CHECK(renderer);
- actor.Unparent( );
- DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
+ actor.Unparent();
+ DALI_TEST_CHECK(actor.GetRendererCount() == 0u);
END_TEST;
}
int UtcDaliArcVisualGetPropertyMap01(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliArcVisualGetPropertyMap01" );
+ tet_infoline("UtcDaliArcVisualGetPropertyMap01");
- float thickness = 20.0f;
+ float thickness = 20.0f;
float startAngle = 0.0f, sweepAngle = 90.0f;
Property::Map propertyMap;
- propertyMap.Add( "visualType", DevelVisual::ARC )
- .Add( "mixColor", Color::RED )
- .Add( "thickness", thickness )
- .Add( "startAngle", startAngle )
- .Add( "sweepAngle", sweepAngle )
- .Add( "cap", DevelArcVisual::Cap::ROUND );
-
- Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
-
- DummyControl actor = DummyControl::New( true );
- DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- actor.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 200.0f ) );
- application.GetScene().Add( actor );
+ propertyMap.Add("visualType", DevelVisual::ARC)
+ .Add("mixColor", Color::RED)
+ .Add("thickness", thickness)
+ .Add("startAngle", startAngle)
+ .Add("sweepAngle", sweepAngle)
+ .Add("cap", DevelArcVisual::Cap::ROUND);
+
+ Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
+
+ DummyControl actor = DummyControl::New(true);
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
+ actor.SetProperty(Actor::Property::SIZE, Vector2(200.0f, 200.0f));
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render();
// renderer is added to actor
- DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
- Renderer renderer = actor.GetRendererAt( 0u );
- DALI_TEST_CHECK( renderer );
+ DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
+ Renderer renderer = actor.GetRendererAt(0u);
+ DALI_TEST_CHECK(renderer);
Property::Map resultMap;
- visual.CreatePropertyMap( resultMap );
+ visual.CreatePropertyMap(resultMap);
// check the property values from the returned map from a visual
- Property::Value* value = resultMap.Find( Visual::Property::MIX_COLOR, Property::VECTOR4 );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector4 >(), Color::RED, TEST_LOCATION );
+ Property::Value* value = resultMap.Find(Visual::Property::MIX_COLOR, Property::VECTOR4);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector4>(), Color::RED, TEST_LOCATION);
- value = resultMap.Find( DevelArcVisual::Property::THICKNESS, Property::FLOAT );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< float >(), thickness, TEST_LOCATION );
+ value = resultMap.Find(DevelArcVisual::Property::THICKNESS, Property::FLOAT);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<float>(), thickness, TEST_LOCATION);
- value = resultMap.Find( DevelArcVisual::Property::START_ANGLE, Property::FLOAT );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< float >(), startAngle, TEST_LOCATION );
+ value = resultMap.Find(DevelArcVisual::Property::START_ANGLE, Property::FLOAT);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<float>(), startAngle, TEST_LOCATION);
- value = resultMap.Find( DevelArcVisual::Property::SWEEP_ANGLE, Property::FLOAT );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< float >(), sweepAngle, TEST_LOCATION );
+ value = resultMap.Find(DevelArcVisual::Property::SWEEP_ANGLE, Property::FLOAT);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<float>(), sweepAngle, TEST_LOCATION);
- value = resultMap.Find( DevelArcVisual::Property::CAP, Property::INTEGER );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get< int >() == DevelArcVisual::Cap::ROUND );
+ value = resultMap.Find(DevelArcVisual::Property::CAP, Property::INTEGER);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<int>() == DevelArcVisual::Cap::ROUND);
// Test wrong values
- propertyMap[DevelArcVisual::Property::THICKNESS] = "3.0f";
+ propertyMap[DevelArcVisual::Property::THICKNESS] = "3.0f";
propertyMap[DevelArcVisual::Property::START_ANGLE] = "0.0f";
propertyMap[DevelArcVisual::Property::SWEEP_ANGLE] = "90.0f";
- propertyMap[DevelArcVisual::Property::CAP] = "1";
+ propertyMap[DevelArcVisual::Property::CAP] = "1";
- visual = VisualFactory::Get().CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ visual = VisualFactory::Get().CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- visual.CreatePropertyMap( resultMap );
+ visual.CreatePropertyMap(resultMap);
- value = resultMap.Find( DevelArcVisual::Property::THICKNESS, Property::FLOAT );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< float >(), 0.0f, TEST_LOCATION );
+ value = resultMap.Find(DevelArcVisual::Property::THICKNESS, Property::FLOAT);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<float>(), 0.0f, TEST_LOCATION);
- value = resultMap.Find( DevelArcVisual::Property::START_ANGLE, Property::FLOAT );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< float >(), 0.0f, TEST_LOCATION );
+ value = resultMap.Find(DevelArcVisual::Property::START_ANGLE, Property::FLOAT);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<float>(), 0.0f, TEST_LOCATION);
- value = resultMap.Find( DevelArcVisual::Property::SWEEP_ANGLE, Property::FLOAT );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< float >(), 360.0f, TEST_LOCATION );
+ value = resultMap.Find(DevelArcVisual::Property::SWEEP_ANGLE, Property::FLOAT);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<float>(), 360.0f, TEST_LOCATION);
- value = resultMap.Find( DevelArcVisual::Property::CAP, Property::INTEGER );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get< int >() == DevelArcVisual::Cap::BUTT );
+ value = resultMap.Find(DevelArcVisual::Property::CAP, Property::INTEGER);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<int>() == DevelArcVisual::Cap::BUTT);
- actor.Unparent( );
- DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
+ actor.Unparent();
+ DALI_TEST_CHECK(actor.GetRendererCount() == 0u);
END_TEST;
}
int UtcDaliArcVisualGetPropertyMap02(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliArcVisualGetPropertyMap02" );
+ tet_infoline("UtcDaliArcVisualGetPropertyMap02");
- float thickness = 20.0f;
+ float thickness = 20.0f;
float startAngle = 0.0f, sweepAngle = 90.0f;
Property::Map propertyMap;
propertyMap.Add(Visual::Property::TYPE, DevelVisual::ARC)
- .Add(Visual::Property::MIX_COLOR, Color::RED)
- .Add(DevelArcVisual::Property::THICKNESS, thickness )
- .Add(DevelArcVisual::Property::START_ANGLE, startAngle )
- .Add(DevelArcVisual::Property::SWEEP_ANGLE, sweepAngle )
- .Add(DevelArcVisual::Property::CAP, DevelArcVisual::Cap::ROUND );
+ .Add(Visual::Property::MIX_COLOR, Color::RED)
+ .Add(DevelArcVisual::Property::THICKNESS, thickness)
+ .Add(DevelArcVisual::Property::START_ANGLE, startAngle)
+ .Add(DevelArcVisual::Property::SWEEP_ANGLE, sweepAngle)
+ .Add(DevelArcVisual::Property::CAP, DevelArcVisual::Cap::ROUND);
- Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
Property::Map resultMap;
- visual.CreatePropertyMap( resultMap );
+ visual.CreatePropertyMap(resultMap);
// check the property values from the returned map from a visual
- Property::Value* value = resultMap.Find( Visual::Property::MIX_COLOR, Property::VECTOR4 );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector4 >(), Color::RED, TEST_LOCATION );
+ Property::Value* value = resultMap.Find(Visual::Property::MIX_COLOR, Property::VECTOR4);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector4>(), Color::RED, TEST_LOCATION);
- value = resultMap.Find( DevelArcVisual::Property::THICKNESS, Property::FLOAT );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< float >(), thickness, TEST_LOCATION );
+ value = resultMap.Find(DevelArcVisual::Property::THICKNESS, Property::FLOAT);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<float>(), thickness, TEST_LOCATION);
- value = resultMap.Find( DevelArcVisual::Property::START_ANGLE, Property::FLOAT );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< float >(), startAngle, TEST_LOCATION );
+ value = resultMap.Find(DevelArcVisual::Property::START_ANGLE, Property::FLOAT);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<float>(), startAngle, TEST_LOCATION);
- value = resultMap.Find( DevelArcVisual::Property::SWEEP_ANGLE, Property::FLOAT );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< float >(), sweepAngle, TEST_LOCATION );
+ value = resultMap.Find(DevelArcVisual::Property::SWEEP_ANGLE, Property::FLOAT);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<float>(), sweepAngle, TEST_LOCATION);
- value = resultMap.Find( DevelArcVisual::Property::CAP, Property::INTEGER );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get< int >() == DevelArcVisual::Cap::ROUND );
+ value = resultMap.Find(DevelArcVisual::Property::CAP, Property::INTEGER);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<int>() == DevelArcVisual::Cap::ROUND);
END_TEST;
}
int UtcDaliArcVisualUpdateProperty(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliArcVisualUpdateProperty" );
+ tet_infoline("UtcDaliArcVisualUpdateProperty");
static std::vector<UniformData> customUniforms =
- {
- UniformData("thickness", Property::Type::FLOAT),
- UniformData("startAngle", Property::Type::FLOAT),
- UniformData("sweepAngle", Property::Type::FLOAT),
- };
+ {
+ UniformData("thickness", Property::Type::FLOAT),
+ UniformData("startAngle", Property::Type::FLOAT),
+ UniformData("sweepAngle", Property::Type::FLOAT),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
TestGlAbstraction& gl = application.GetGlAbstraction();
- float thickness = 20.0f;
+ float thickness = 20.0f;
float startAngle = 0.0f;
float sweepAngle = 90.0f;
Property::Map propertyMap;
- propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ARC )
- .Add( Visual::Property::MIX_COLOR, Color::RED )
- .Add( DevelArcVisual::Property::THICKNESS, thickness )
- .Add( DevelArcVisual::Property::START_ANGLE, startAngle )
- .Add( DevelArcVisual::Property::SWEEP_ANGLE, sweepAngle );
+ propertyMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ARC)
+ .Add(Visual::Property::MIX_COLOR, Color::RED)
+ .Add(DevelArcVisual::Property::THICKNESS, thickness)
+ .Add(DevelArcVisual::Property::START_ANGLE, startAngle)
+ .Add(DevelArcVisual::Property::SWEEP_ANGLE, sweepAngle);
- Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- DummyControl actor = DummyControl::New( true );
- DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ DummyControl actor = DummyControl::New(true);
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- actor.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 200.0f ) );
- application.GetScene().Add( actor );
+ actor.SetProperty(Actor::Property::SIZE, Vector2(200.0f, 200.0f));
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render();
- Property::Map map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- Property::Value* value = map.Find( DevelArcVisual::Property::THICKNESS, Property::FLOAT );
- DALI_TEST_EQUALS( value->Get< float >(), thickness, TEST_LOCATION );
- DALI_TEST_EQUALS( gl.CheckUniformValue< float >( "thickness", thickness ), true, TEST_LOCATION );
+ Property::Map map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ Property::Value* value = map.Find(DevelArcVisual::Property::THICKNESS, Property::FLOAT);
+ DALI_TEST_EQUALS(value->Get<float>(), thickness, TEST_LOCATION);
+ DALI_TEST_EQUALS(gl.CheckUniformValue<float>("thickness", thickness), true, TEST_LOCATION);
- value = map.Find( DevelArcVisual::Property::START_ANGLE, Property::FLOAT );
- DALI_TEST_EQUALS( value->Get< float >(), startAngle, TEST_LOCATION );
- DALI_TEST_EQUALS( gl.CheckUniformValue< float >( "startAngle", startAngle ), true, TEST_LOCATION );
+ value = map.Find(DevelArcVisual::Property::START_ANGLE, Property::FLOAT);
+ DALI_TEST_EQUALS(value->Get<float>(), startAngle, TEST_LOCATION);
+ DALI_TEST_EQUALS(gl.CheckUniformValue<float>("startAngle", startAngle), true, TEST_LOCATION);
- value = map.Find( DevelArcVisual::Property::SWEEP_ANGLE, Property::FLOAT );
- DALI_TEST_EQUALS( value->Get< float >(), sweepAngle, TEST_LOCATION );
- DALI_TEST_EQUALS( gl.CheckUniformValue< float >( "sweepAngle", sweepAngle ), true, TEST_LOCATION );
+ value = map.Find(DevelArcVisual::Property::SWEEP_ANGLE, Property::FLOAT);
+ DALI_TEST_EQUALS(value->Get<float>(), sweepAngle, TEST_LOCATION);
+ DALI_TEST_EQUALS(gl.CheckUniformValue<float>("sweepAngle", sweepAngle), true, TEST_LOCATION);
- thickness = 10.0f;
+ thickness = 10.0f;
startAngle = 90.0f;
sweepAngle = 180.0f;
Property::Map attributes;
- attributes.Add( DevelArcVisual::Property::THICKNESS, thickness )
- .Add( DevelArcVisual::Property::START_ANGLE, startAngle )
- .Add( DevelArcVisual::Property::SWEEP_ANGLE, sweepAngle );
+ attributes.Add(DevelArcVisual::Property::THICKNESS, thickness)
+ .Add(DevelArcVisual::Property::START_ANGLE, startAngle)
+ .Add(DevelArcVisual::Property::SWEEP_ANGLE, sweepAngle);
- DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes );
+ DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelVisual::Action::UPDATE_PROPERTY, attributes);
application.SendNotification();
application.Render();
- map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
- value = map.Find( DevelArcVisual::Property::THICKNESS, Property::FLOAT );
- DALI_TEST_EQUALS( value->Get< float >(), thickness, TEST_LOCATION );
- DALI_TEST_EQUALS( gl.CheckUniformValue< float >( "thickness", thickness ), true, TEST_LOCATION );
+ map = actor.GetProperty<Property::Map>(DummyControl::Property::TEST_VISUAL);
+ value = map.Find(DevelArcVisual::Property::THICKNESS, Property::FLOAT);
+ DALI_TEST_EQUALS(value->Get<float>(), thickness, TEST_LOCATION);
+ DALI_TEST_EQUALS(gl.CheckUniformValue<float>("thickness", thickness), true, TEST_LOCATION);
- value = map.Find( DevelArcVisual::Property::START_ANGLE, Property::FLOAT );
- DALI_TEST_EQUALS( value->Get< float >(), startAngle, TEST_LOCATION );
- DALI_TEST_EQUALS( gl.CheckUniformValue< float >( "startAngle", startAngle ), true, TEST_LOCATION );
+ value = map.Find(DevelArcVisual::Property::START_ANGLE, Property::FLOAT);
+ DALI_TEST_EQUALS(value->Get<float>(), startAngle, TEST_LOCATION);
+ DALI_TEST_EQUALS(gl.CheckUniformValue<float>("startAngle", startAngle), true, TEST_LOCATION);
- value = map.Find( DevelArcVisual::Property::SWEEP_ANGLE, Property::FLOAT );
- DALI_TEST_EQUALS( value->Get< float >(), sweepAngle, TEST_LOCATION );
- DALI_TEST_EQUALS( gl.CheckUniformValue< float >( "sweepAngle", sweepAngle ), true, TEST_LOCATION );
+ value = map.Find(DevelArcVisual::Property::SWEEP_ANGLE, Property::FLOAT);
+ DALI_TEST_EQUALS(value->Get<float>(), sweepAngle, TEST_LOCATION);
+ DALI_TEST_EQUALS(gl.CheckUniformValue<float>("sweepAngle", sweepAngle), true, TEST_LOCATION);
END_TEST;
}
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
* limitations under the License.
*
*/
-#include <stdlib.h>
-#include <unistd.h>
+#include <dali-toolkit-test-suite-utils.h>
+#include <dali-toolkit/dali-toolkit.h>
#include <dali/dali.h>
#include <dali/devel-api/actors/actor-devel.h>
-#include <dali-toolkit-test-suite-utils.h>
+#include <stdlib.h>
#include <toolkit-event-thread-callback.h>
-#include <dali-toolkit/dali-toolkit.h>
+#include <unistd.h>
using namespace Dali;
using namespace Dali::Toolkit;
class ImageLoadedSignalVerifier : public ConnectionTracker
{
public:
-
ImageLoadedSignalVerifier()
- : mCount( 0 )
- {}
+ : mCount(0)
+ {
+ }
virtual ~ImageLoadedSignalVerifier()
- {}
+ {
+ }
- void ImageLoaded( uint32_t id, PixelData pixelData )
+ void ImageLoaded(uint32_t id, PixelData pixelData)
{
- mIDs.push_back( id );
- mPixelDataList.push_back( pixelData );
+ mIDs.push_back(id);
+ mPixelDataList.push_back(pixelData);
mCount++;
}
return mCount;
}
- bool Verify( uint32_t id, uint32_t width, uint32_t height )
+ bool Verify(uint32_t id, uint32_t width, uint32_t height)
{
int size = mIDs.size();
- for( int i = 0; i<size; i++ )
+ for(int i = 0; i < size; i++)
{
- if( mIDs[i] == id )
+ if(mIDs[i] == id)
{
- return mPixelDataList[i].GetWidth() == width
- && mPixelDataList[i].GetHeight() == height;
+ return mPixelDataList[i].GetWidth() == width && mPixelDataList[i].GetHeight() == height;
}
}
}
private:
-
int mCount;
- std::vector<uint32_t> mIDs;
+ std::vector<uint32_t> mIDs;
std::vector<PixelData> mPixelDataList;
};
-
} // anonymous namespace
void dali_async_image_loader_startup(void)
//invoke default handle constructor
AsyncImageLoader loader;
- DALI_TEST_CHECK( !loader );
+ DALI_TEST_CHECK(!loader);
// initialise handle
loader = AsyncImageLoader::New();
- DALI_TEST_CHECK( loader );
+ DALI_TEST_CHECK(loader);
END_TEST;
}
{
ToolkitTestApplication application;
- AsyncImageLoader loader = AsyncImageLoader::New( );
- DALI_TEST_CHECK( loader );
+ AsyncImageLoader loader = AsyncImageLoader::New();
+ DALI_TEST_CHECK(loader);
AsyncImageLoader loaderCopy(loader);
- DALI_TEST_CHECK( loaderCopy );
+ DALI_TEST_CHECK(loaderCopy);
END_TEST;
}
{
ToolkitTestApplication application;
- AsyncImageLoader loader = AsyncImageLoader::New( );
- DALI_TEST_CHECK( loader );
- DALI_TEST_EQUALS( 1, loader.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ AsyncImageLoader loader = AsyncImageLoader::New();
+ DALI_TEST_CHECK(loader);
+ DALI_TEST_EQUALS(1, loader.GetBaseObject().ReferenceCount(), TEST_LOCATION);
- AsyncImageLoader moved = std::move( loader );
- DALI_TEST_CHECK( moved );
- DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_CHECK( !loader );
+ AsyncImageLoader moved = std::move(loader);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_CHECK(!loader);
END_TEST;
}
ToolkitTestApplication application;
AsyncImageLoader loader = AsyncImageLoader::New();
- DALI_TEST_CHECK( loader );
+ DALI_TEST_CHECK(loader);
AsyncImageLoader loader2;
- DALI_TEST_CHECK( !loader2 );
+ DALI_TEST_CHECK(!loader2);
loader2 = loader;
- DALI_TEST_CHECK( loader2 );
- DALI_TEST_CHECK( loader == loader2 ); // the two handles are pointing to the same object.
+ DALI_TEST_CHECK(loader2);
+ DALI_TEST_CHECK(loader == loader2); // the two handles are pointing to the same object.
END_TEST;
}
{
ToolkitTestApplication application;
- AsyncImageLoader loader = AsyncImageLoader::New( );
- DALI_TEST_CHECK( loader );
- DALI_TEST_EQUALS( 1, loader.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ AsyncImageLoader loader = AsyncImageLoader::New();
+ DALI_TEST_CHECK(loader);
+ DALI_TEST_EQUALS(1, loader.GetBaseObject().ReferenceCount(), TEST_LOCATION);
AsyncImageLoader moved;
- moved = std::move( loader );
- DALI_TEST_CHECK( moved );
- DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_CHECK( !loader );
+ moved = std::move(loader);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_CHECK(!loader);
END_TEST;
}
ToolkitTestApplication application;
AsyncImageLoader asyncImageLoader = AsyncImageLoader::New();
- BaseHandle object(asyncImageLoader);
+ BaseHandle object(asyncImageLoader);
- AsyncImageLoader asyncImageLoader2 = AsyncImageLoader::DownCast( object );
+ AsyncImageLoader asyncImageLoader2 = AsyncImageLoader::DownCast(object);
- DALI_TEST_CHECK( asyncImageLoader2 );
+ DALI_TEST_CHECK(asyncImageLoader2);
END_TEST;
}
{
ToolkitTestApplication application;
- BaseHandle unInitializedObject;
- AsyncImageLoader asyncImageLoader = AsyncImageLoader::DownCast( unInitializedObject );
+ BaseHandle unInitializedObject;
+ AsyncImageLoader asyncImageLoader = AsyncImageLoader::DownCast(unInitializedObject);
- DALI_TEST_CHECK( !asyncImageLoader );
+ DALI_TEST_CHECK(!asyncImageLoader);
END_TEST;
}
{
ToolkitTestApplication application;
- AsyncImageLoader loader = AsyncImageLoader::New();
+ AsyncImageLoader loader = AsyncImageLoader::New();
ImageLoadedSignalVerifier loadedSignalVerifier;
- loader.ImageLoadedSignal().Connect( &loadedSignalVerifier, &ImageLoadedSignalVerifier::ImageLoaded );
+ loader.ImageLoadedSignal().Connect(&loadedSignalVerifier, &ImageLoadedSignalVerifier::ImageLoaded);
- loader.Load( gImage_34_RGBA );
- uint32_t id02 = loader.Load( gImage_50_RGBA, ImageDimensions( 25, 25 ) );
- uint32_t id03 = loader.Load( gImage_128_RGB, ImageDimensions( 100, 100 ), FittingMode::SCALE_TO_FILL, SamplingMode::BOX_THEN_LINEAR, true );
+ loader.Load(gImage_34_RGBA);
+ uint32_t id02 = loader.Load(gImage_50_RGBA, ImageDimensions(25, 25));
+ uint32_t id03 = loader.Load(gImage_128_RGB, ImageDimensions(100, 100), FittingMode::SCALE_TO_FILL, SamplingMode::BOX_THEN_LINEAR, true);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 3 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(3), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( loadedSignalVerifier.LoadedImageCount() == 3 );
- DALI_TEST_CHECK( loadedSignalVerifier.Verify( id02, 25, 25 ) );
- DALI_TEST_CHECK( loadedSignalVerifier.Verify( id03, 100, 100 ) );
+ DALI_TEST_CHECK(loadedSignalVerifier.LoadedImageCount() == 3);
+ DALI_TEST_CHECK(loadedSignalVerifier.Verify(id02, 25, 25));
+ DALI_TEST_CHECK(loadedSignalVerifier.Verify(id03, 100, 100));
END_TEST;
}
{
ToolkitTestApplication application;
- AsyncImageLoader loader = AsyncImageLoader::New();
+ AsyncImageLoader loader = AsyncImageLoader::New();
ImageLoadedSignalVerifier loadedSignalVerifier;
- loader.ImageLoadedSignal().Connect( &loadedSignalVerifier, &ImageLoadedSignalVerifier::ImageLoaded );
+ loader.ImageLoadedSignal().Connect(&loadedSignalVerifier, &ImageLoadedSignalVerifier::ImageLoaded);
- uint32_t id01 = loader.Load( gImage_34_RGBA, ImageDimensions( 34, 34 ) );
- uint32_t id02 = loader.Load( gImage_50_RGBA, ImageDimensions( 25, 25 ) );
- uint32_t id03 = loader.Load( gImage_128_RGB, ImageDimensions( 100, 100 ), FittingMode::SCALE_TO_FILL, SamplingMode::BOX_THEN_LINEAR, true );
+ uint32_t id01 = loader.Load(gImage_34_RGBA, ImageDimensions(34, 34));
+ uint32_t id02 = loader.Load(gImage_50_RGBA, ImageDimensions(25, 25));
+ uint32_t id03 = loader.Load(gImage_128_RGB, ImageDimensions(100, 100), FittingMode::SCALE_TO_FILL, SamplingMode::BOX_THEN_LINEAR, true);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 3 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(3), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( loadedSignalVerifier.LoadedImageCount() == 3 );
+ DALI_TEST_CHECK(loadedSignalVerifier.LoadedImageCount() == 3);
- DALI_TEST_CHECK( !loader.Cancel( id03 ) ); // Cannot cancel a task that is already implemeted
+ DALI_TEST_CHECK(!loader.Cancel(id03)); // Cannot cancel a task that is already implemeted
- DALI_TEST_CHECK( loadedSignalVerifier.Verify( id01, 34, 34 ) ); // first image is loaded
- DALI_TEST_CHECK( loadedSignalVerifier.Verify( id02, 25, 25 ) ); // second image is loaded
- DALI_TEST_CHECK( loadedSignalVerifier.Verify( id03, 100, 100 ) ); // third image is loaded
+ DALI_TEST_CHECK(loadedSignalVerifier.Verify(id01, 34, 34)); // first image is loaded
+ DALI_TEST_CHECK(loadedSignalVerifier.Verify(id02, 25, 25)); // second image is loaded
+ DALI_TEST_CHECK(loadedSignalVerifier.Verify(id03, 100, 100)); // third image is loaded
END_TEST;
}
// Test that cancelling a non-existing loading task will return false
uint32_t id = 1;
- DALI_TEST_CHECK( !(loader.Cancel( id )) );
+ DALI_TEST_CHECK(!(loader.Cancel(id)));
END_TEST;
}
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
-#include <stdlib.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/controls/bloom-view/bloom-view.h>
-
+#include <stdlib.h>
+#include <iostream>
using namespace Dali;
using namespace Dali::Toolkit;
-
void bloom_view_startup(void)
{
test_return_value = TET_UNDEF;
{
// New() must be called to create a BloomView or it wont be valid.
Actor a = Actor::New();
- view.Add( a );
- DALI_TEST_CHECK( false );
+ view.Add(a);
+ DALI_TEST_CHECK(false);
}
- catch (Dali::DaliException& e)
+ catch(Dali::DaliException& e)
{
// Tests that a negative test of an assertion succeeds
- DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_PRINT_ASSERT(e);
DALI_TEST_CHECK(!view);
}
END_TEST;
tet_infoline(" UtcDaliBloomViewNew");
Toolkit::BloomView view = Toolkit::BloomView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Toolkit::BloomView view2 = Toolkit::BloomView::New(10, 1.0f, Pixel::RGB888, 0.5f, 0.5f);
- DALI_TEST_CHECK( view2 );
+ DALI_TEST_CHECK(view2);
END_TEST;
}
tet_infoline(" UtcDaliBloomViewDownCast");
Toolkit::BloomView view = Toolkit::BloomView::New();
- BaseHandle handle(view);
+ BaseHandle handle(view);
- Toolkit::BloomView bloomView = Toolkit::BloomView::DownCast( handle );
- DALI_TEST_CHECK( view );
- DALI_TEST_CHECK( bloomView );
- DALI_TEST_CHECK( bloomView == view );
+ Toolkit::BloomView bloomView = Toolkit::BloomView::DownCast(handle);
+ DALI_TEST_CHECK(view);
+ DALI_TEST_CHECK(bloomView);
+ DALI_TEST_CHECK(bloomView == view);
END_TEST;
}
-
// Positive test case for a method
int UtcDaliBloomViewPropertyNames(void)
{
tet_infoline(" UtcDaliBloomViewPropertyNames");
Toolkit::BloomView view = Toolkit::BloomView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
// Check the names, this names are used in the shader code,
// if they change in the shader code, then it has to be updated here.
- DALI_TEST_EQUALS( view.GetBloomThresholdPropertyIndex(), view.GetPropertyIndex("uBloomThreshold"), TEST_LOCATION );
- DALI_TEST_EQUALS( view.GetBlurStrengthPropertyIndex(), view.GetPropertyIndex("BlurStrengthProperty"), TEST_LOCATION );
- DALI_TEST_EQUALS( view.GetBloomIntensityPropertyIndex(), view.GetPropertyIndex("uBloomIntensity"), TEST_LOCATION );
- DALI_TEST_EQUALS( view.GetBloomSaturationPropertyIndex(), view.GetPropertyIndex("uBloomSaturation"), TEST_LOCATION );
- DALI_TEST_EQUALS( view.GetImageIntensityPropertyIndex(), view.GetPropertyIndex("uImageIntensity"), TEST_LOCATION );
- DALI_TEST_EQUALS( view.GetImageSaturationPropertyIndex(), view.GetPropertyIndex("uImageSaturation"), TEST_LOCATION );
+ DALI_TEST_EQUALS(view.GetBloomThresholdPropertyIndex(), view.GetPropertyIndex("uBloomThreshold"), TEST_LOCATION);
+ DALI_TEST_EQUALS(view.GetBlurStrengthPropertyIndex(), view.GetPropertyIndex("BlurStrengthProperty"), TEST_LOCATION);
+ DALI_TEST_EQUALS(view.GetBloomIntensityPropertyIndex(), view.GetPropertyIndex("uBloomIntensity"), TEST_LOCATION);
+ DALI_TEST_EQUALS(view.GetBloomSaturationPropertyIndex(), view.GetPropertyIndex("uBloomSaturation"), TEST_LOCATION);
+ DALI_TEST_EQUALS(view.GetImageIntensityPropertyIndex(), view.GetPropertyIndex("uImageIntensity"), TEST_LOCATION);
+ DALI_TEST_EQUALS(view.GetImageSaturationPropertyIndex(), view.GetPropertyIndex("uImageSaturation"), TEST_LOCATION);
END_TEST;
}
tet_infoline(" UtcDaliBloomViewAddRemove");
Toolkit::BloomView view = Toolkit::BloomView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Actor actor = Actor::New();
- DALI_TEST_CHECK( !actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
+ DALI_TEST_CHECK(!actor.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE));
-
- view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- view.SetProperty( Actor::Property::SIZE, application.GetScene().GetSize());
+ view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ view.SetProperty(Actor::Property::SIZE, application.GetScene().GetSize());
view.Add(actor);
application.GetScene().Add(view);
- DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
+ DALI_TEST_CHECK(actor.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE));
view.Remove(actor);
- DALI_TEST_CHECK( !actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
+ DALI_TEST_CHECK(!actor.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE));
END_TEST;
}
tet_infoline(" UtcDaliBloomActivateDeactivate");
Toolkit::BloomView view = Toolkit::BloomView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
RenderTaskList taskList = application.GetScene().GetRenderTaskList();
- DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
+ DALI_TEST_CHECK(1u == taskList.GetTaskCount());
- view.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- view.SetProperty( Actor::Property::SIZE, application.GetScene().GetSize());
+ view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ view.SetProperty(Actor::Property::SIZE, application.GetScene().GetSize());
view.Add(Actor::New());
application.GetScene().Add(view);
view.Activate();
RenderTaskList taskList2 = application.GetScene().GetRenderTaskList();
- DALI_TEST_CHECK( 1u != taskList2.GetTaskCount() );
+ DALI_TEST_CHECK(1u != taskList2.GetTaskCount());
view.Deactivate();
RenderTaskList taskList3 = application.GetScene().GetRenderTaskList();
- DALI_TEST_CHECK( 1u == taskList3.GetTaskCount() );
+ DALI_TEST_CHECK(1u == taskList3.GetTaskCount());
END_TEST;
}
ToolkitTestApplication application;
BloomView view = Toolkit::BloomView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- BloomView copy( view );
- DALI_TEST_CHECK( view == copy );
+ BloomView copy(view);
+ DALI_TEST_CHECK(view == copy);
BloomView assign;
- DALI_TEST_CHECK( ! assign );
+ DALI_TEST_CHECK(!assign);
assign = copy;
- DALI_TEST_CHECK( assign == view );
+ DALI_TEST_CHECK(assign == view);
END_TEST;
}
ToolkitTestApplication application;
TypeRegistry typeRegistry = TypeRegistry::Get();
- DALI_TEST_CHECK( typeRegistry );
+ DALI_TEST_CHECK(typeRegistry);
- TypeInfo typeInfo = typeRegistry.GetTypeInfo( "BloomView" );
- DALI_TEST_CHECK( typeInfo );
+ TypeInfo typeInfo = typeRegistry.GetTypeInfo("BloomView");
+ DALI_TEST_CHECK(typeInfo);
BaseHandle handle = typeInfo.CreateInstance();
- DALI_TEST_CHECK( handle );
+ DALI_TEST_CHECK(handle);
- BloomView view = BloomView::DownCast( handle );
- DALI_TEST_CHECK( view );
+ BloomView view = BloomView::DownCast(handle);
+ DALI_TEST_CHECK(view);
END_TEST;
}
BloomView view = Toolkit::BloomView::New();
- application.GetScene().Add( view );
+ application.GetScene().Add(view);
application.SendNotification();
application.Render();
- Vector3 size( 200.0f, 300.0f, 0.0f );
- view.SetProperty( Actor::Property::SIZE, size );
+ Vector3 size(200.0f, 300.0f, 0.0f);
+ view.SetProperty(Actor::Property::SIZE, size);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( view.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), size, TEST_LOCATION );
+ DALI_TEST_EQUALS(view.GetCurrentProperty<Vector3>(Actor::Property::SIZE), size, TEST_LOCATION);
END_TEST;
}
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
#include <stdlib.h>
+#include <iostream>
// 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.h>
-#include <dali/public-api/rendering/renderer.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/controls/bubble-effect/bubble-emitter.h>
+#include <dali.h>
+#include <dali/public-api/rendering/renderer.h>
using namespace Dali;
using namespace Dali::Toolkit;
test_return_value = TET_PASS;
}
-
namespace
{
-
const int RENDER_FRAME_INTERVAL = 16;
static bool gObjectCreatedCallBackCalled;
{
int time = 0;
- for(int i = 0; i <= ( duration / RENDER_FRAME_INTERVAL); i++)
+ for(int i = 0; i <= (duration / RENDER_FRAME_INTERVAL); i++)
{
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
return time;
}
-static Texture CreateSolidColorTexture( ToolkitTestApplication& application, const Vector4& color, unsigned int width, unsigned int height )
+static Texture CreateSolidColorTexture(ToolkitTestApplication& application, const Vector4& color, unsigned int width, unsigned int height)
{
- Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height );
+ Texture texture = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height);
return texture;
}
-}//namespace
-
+} //namespace
int UtcDaliBubbleEmitterNew(void)
{
// Test default constructor
BubbleEmitter emitter;
- DALI_TEST_CHECK( !emitter );
+ DALI_TEST_CHECK(!emitter);
// Test object creation
- Texture shapeImage = CreateSolidColorTexture( application, Color::GREEN, 5, 5 );
- emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 200, Vector2( 5.f, 10.f ));
- DALI_TEST_CHECK( emitter );
+ Texture shapeImage = CreateSolidColorTexture(application, Color::GREEN, 5, 5);
+ emitter = BubbleEmitter::New(Vector2(50.f, 50.f), shapeImage, 200, Vector2(5.f, 10.f));
+ DALI_TEST_CHECK(emitter);
// Additional check to ensure object is created by checking if it's registered
ObjectRegistry registry = application.GetCore().GetObjectRegistry();
- DALI_TEST_CHECK( registry );
+ DALI_TEST_CHECK(registry);
gObjectCreatedCallBackCalled = false;
- registry.ObjectCreatedSignal().Connect( &TestCallback );
+ registry.ObjectCreatedSignal().Connect(&TestCallback);
{
- BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 200, Vector2( 5.f, 10.f ));
+ BubbleEmitter emitter = BubbleEmitter::New(Vector2(50.f, 50.f), shapeImage, 200, Vector2(5.f, 10.f));
}
- DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
+ DALI_TEST_CHECK(gObjectCreatedCallBackCalled);
// Test copy constructor
- BubbleEmitter emitterCopy( emitter );
- DALI_TEST_CHECK( emitterCopy );
+ BubbleEmitter emitterCopy(emitter);
+ DALI_TEST_CHECK(emitterCopy);
// Test down cast
Handle handleEmitter;
- handleEmitter = emitter;
- BubbleEmitter downCastEmitter = BubbleEmitter::DownCast( handleEmitter );
- DALI_TEST_CHECK( downCastEmitter );
+ handleEmitter = emitter;
+ BubbleEmitter downCastEmitter = BubbleEmitter::DownCast(handleEmitter);
+ DALI_TEST_CHECK(downCastEmitter);
END_TEST;
}
tet_infoline(" UtcDaliBubbleEmitterDownCast01 ");
- Texture shapeImage = CreateSolidColorTexture( application, Color::GREEN, 5, 5 );
- BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 200, Vector2( 5.f, 10.f ));
+ Texture shapeImage = CreateSolidColorTexture(application, Color::GREEN, 5, 5);
+ BubbleEmitter emitter = BubbleEmitter::New(Vector2(50.f, 50.f), shapeImage, 200, Vector2(5.f, 10.f));
- BaseHandle handle(emitter);
+ BaseHandle handle(emitter);
BubbleEmitter emitter2 = BubbleEmitter::DownCast(handle);
- DALI_TEST_EQUALS( (bool)emitter2, true, TEST_LOCATION );
+ DALI_TEST_EQUALS((bool)emitter2, true, TEST_LOCATION);
END_TEST;
}
tet_infoline(" UtcDaliBubbleEmitterDownCast02 ");
- Handle handle = Handle::New(); // Create a custom object
+ Handle handle = Handle::New(); // Create a custom object
BubbleEmitter emitter = BubbleEmitter::DownCast(handle);
- DALI_TEST_EQUALS( (bool)emitter, false, TEST_LOCATION );
+ DALI_TEST_EQUALS((bool)emitter, false, TEST_LOCATION);
END_TEST;
}
int UtcDaliBubbleEmitterGetRootActor(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliBubbleEmitterGetRootActor " );
+ tet_infoline(" UtcDaliBubbleEmitterGetRootActor ");
- Texture shapeImage = CreateSolidColorTexture( application, Color::GREEN, 5, 5 );
- BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 270, Vector2( 5.f, 10.f ));
+ Texture shapeImage = CreateSolidColorTexture(application, Color::GREEN, 5, 5);
+ BubbleEmitter emitter = BubbleEmitter::New(Vector2(50.f, 50.f), shapeImage, 270, Vector2(5.f, 10.f));
Actor root = emitter.GetRootActor();
- DALI_TEST_CHECK( root );
- DALI_TEST_CHECK( root.GetChildCount() == 0 );
+ DALI_TEST_CHECK(root);
+ DALI_TEST_CHECK(root.GetChildCount() == 0);
END_TEST;
}
int UtcDaliBubbleEmitterSetBackground(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliBubbleEmitterSetBackground " );
+ tet_infoline(" UtcDaliBubbleEmitterSetBackground ");
- Texture shapeImage = CreateSolidColorTexture( application, Color::GREEN, 5, 5 );
- BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 200, Vector2( 5.f, 10.f ));
+ Texture shapeImage = CreateSolidColorTexture(application, Color::GREEN, 5, 5);
+ BubbleEmitter emitter = BubbleEmitter::New(Vector2(50.f, 50.f), shapeImage, 200, Vector2(5.f, 10.f));
- RenderTaskList taskList = application.GetScene().GetRenderTaskList();
- unsigned int taskCount = taskList.GetTaskCount();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
+ unsigned int taskCount = taskList.GetTaskCount();
- Texture bgImage = CreateSolidColorTexture( application, Color::RED, 50, 50 );
- emitter.SetBackground( bgImage, Vector3(0.f, 0.f, 0.5f) );
+ Texture bgImage = CreateSolidColorTexture(application, Color::RED, 50, 50);
+ emitter.SetBackground(bgImage, Vector3(0.f, 0.f, 0.5f));
- DALI_TEST_CHECK( taskList.GetTaskCount() == taskCount+1 );
+ DALI_TEST_CHECK(taskList.GetTaskCount() == taskCount + 1);
Wait(application, 500);
- DALI_TEST_CHECK( taskList.GetTaskCount() == taskCount );
+ DALI_TEST_CHECK(taskList.GetTaskCount() == taskCount);
END_TEST;
}
int UtcDaliBubbleEmitterSetBubbleScale(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliBubbleEmitterSetBubbleScale " );
+ tet_infoline(" UtcDaliBubbleEmitterSetBubbleScale ");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uDynamicScale", Property::Type::FLOAT),
- };
+ {
+ UniformData("uDynamicScale", Property::Type::FLOAT),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
- Texture shapeImage = CreateSolidColorTexture( application, Color::GREEN, 5, 5 );
- BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 150, Vector2( 5.f, 10.f ));
+ Texture shapeImage = CreateSolidColorTexture(application, Color::GREEN, 5, 5);
+ BubbleEmitter emitter = BubbleEmitter::New(Vector2(50.f, 50.f), shapeImage, 150, Vector2(5.f, 10.f));
DALI_TEST_CHECK(emitter);
Actor root = emitter.GetRootActor();
- application.GetScene().Add( root );
- root.SetProperty( Actor::Property::POSITION, Vector3::ZERO );
- root.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- root.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ application.GetScene().Add(root);
+ root.SetProperty(Actor::Property::POSITION, Vector3::ZERO);
+ root.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ root.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
TestGlAbstraction& gl = application.GetGlAbstraction();
Wait(application);
float scaleValue;
- DALI_TEST_CHECK( gl.GetUniformValue<float>( "uDynamicScale", scaleValue ) );
- DALI_TEST_EQUALS( scaleValue, 1.f, TEST_LOCATION );
+ DALI_TEST_CHECK(gl.GetUniformValue<float>("uDynamicScale", scaleValue));
+ DALI_TEST_EQUALS(scaleValue, 1.f, TEST_LOCATION);
- emitter.SetBubbleScale( 2.f );
+ emitter.SetBubbleScale(2.f);
Wait(application);
- DALI_TEST_CHECK( gl.GetUniformValue<float>( "uDynamicScale", scaleValue ) );
- DALI_TEST_EQUALS( scaleValue, 2.f, TEST_LOCATION );
+ DALI_TEST_CHECK(gl.GetUniformValue<float>("uDynamicScale", scaleValue));
+ DALI_TEST_EQUALS(scaleValue, 2.f, TEST_LOCATION);
- emitter.SetBubbleScale( 0.5f );
+ emitter.SetBubbleScale(0.5f);
Wait(application);
- DALI_TEST_CHECK( gl.GetUniformValue<float>( "uDynamicScale", scaleValue ) );
- DALI_TEST_EQUALS( scaleValue, 0.5f, TEST_LOCATION );
+ DALI_TEST_CHECK(gl.GetUniformValue<float>("uDynamicScale", scaleValue));
+ DALI_TEST_EQUALS(scaleValue, 0.5f, TEST_LOCATION);
END_TEST;
}
int UtcDaliBubbleEmitterSetBubbleDensity01(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliBubbleEmitterSetBubbleDensity " );
+ tet_infoline(" UtcDaliBubbleEmitterSetBubbleDensity ");
- Texture shapeImage = CreateSolidColorTexture( application, Color::GREEN, 5, 5 );
- BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 200, Vector2( 5.f, 10.f ));
+ Texture shapeImage = CreateSolidColorTexture(application, Color::GREEN, 5, 5);
+ BubbleEmitter emitter = BubbleEmitter::New(Vector2(50.f, 50.f), shapeImage, 200, Vector2(5.f, 10.f));
try
{
- emitter.SetBubbleDensity( 3.f );
+ emitter.SetBubbleDensity(3.f);
DALI_TEST_CHECK(true);
}
catch(Dali::DaliException& e)
{
- DALI_TEST_PRINT_ASSERT( e );
- DALI_TEST_ASSERT(e, "density>0 && density<=9", TEST_LOCATION );
+ DALI_TEST_PRINT_ASSERT(e);
+ DALI_TEST_ASSERT(e, "density>0 && density<=9", TEST_LOCATION);
}
END_TEST;
}
int UtcDaliBubbleEmitterSetBubbleDensity02(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliBubbleEmitterSetBubbleDensity " );
+ tet_infoline(" UtcDaliBubbleEmitterSetBubbleDensity ");
- Texture shapeImage = CreateSolidColorTexture( application, Color::GREEN, 5, 5 );
- BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 200, Vector2( 5.f, 10.f ));
+ Texture shapeImage = CreateSolidColorTexture(application, Color::GREEN, 5, 5);
+ BubbleEmitter emitter = BubbleEmitter::New(Vector2(50.f, 50.f), shapeImage, 200, Vector2(5.f, 10.f));
try
{
- emitter.SetBubbleDensity( 10.f );
+ emitter.SetBubbleDensity(10.f);
}
catch(Dali::DaliException& e)
{
- DALI_TEST_PRINT_ASSERT( e );
- DALI_TEST_ASSERT(e, "density > 0 && density <= 9", TEST_LOCATION );
+ DALI_TEST_PRINT_ASSERT(e);
+ DALI_TEST_ASSERT(e, "density > 0 && density <= 9", TEST_LOCATION);
}
END_TEST;
}
int UtcDaliBubbleEmitterEmitBubble(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliBubbleEmitterEmitBubble " );
-
- Texture shapeImage1 = CreateSolidColorTexture( application, Color::GREEN, 5, 5 );
- BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage1, 200, Vector2( 5.f, 10.f ));
-
- Actor root = emitter.GetRootActor();
- Renderer bubbleRenderer = root.GetRendererAt( 0 );
- application.GetScene().Add( root );
- DALI_TEST_CHECK( bubbleRenderer );
-
- Property::Index propertyIndex0 = bubbleRenderer.GetPropertyIndex( "uPercentage[0]" );
- Property::Index propertyIndex1 = bubbleRenderer.GetPropertyIndex( "uPercentage[1]" );
- float value0, value1;
-
- Animation animation = Animation::New( 0.5f );
- emitter.EmitBubble( animation, Vector2(40.f,40.f), Vector2(-5.f,-5.f), Vector2(30.f,30.f) );
- emitter.EmitBubble( animation, Vector2(10.f,10.f), Vector2(5.f,5.f), Vector2(30.f,30.f) );
- (bubbleRenderer.GetProperty(propertyIndex0)).Get( value0 );
- (bubbleRenderer.GetProperty(propertyIndex1)).Get( value1 );
- DALI_TEST_EQUALS(value0, 0.f, TEST_LOCATION );
- DALI_TEST_EQUALS(value1, 0.f, TEST_LOCATION );
- ( bubbleRenderer.GetCurrentProperty( propertyIndex0 ) ).Get( value0 );
- ( bubbleRenderer.GetCurrentProperty( propertyIndex0 ) ).Get( value1 );
- DALI_TEST_EQUALS(value0, 0.f, TEST_LOCATION );
- DALI_TEST_EQUALS(value1, 0.f, TEST_LOCATION );
+ tet_infoline(" UtcDaliBubbleEmitterEmitBubble ");
+
+ Texture shapeImage1 = CreateSolidColorTexture(application, Color::GREEN, 5, 5);
+ BubbleEmitter emitter = BubbleEmitter::New(Vector2(50.f, 50.f), shapeImage1, 200, Vector2(5.f, 10.f));
+
+ Actor root = emitter.GetRootActor();
+ Renderer bubbleRenderer = root.GetRendererAt(0);
+ application.GetScene().Add(root);
+ DALI_TEST_CHECK(bubbleRenderer);
+
+ Property::Index propertyIndex0 = bubbleRenderer.GetPropertyIndex("uPercentage[0]");
+ Property::Index propertyIndex1 = bubbleRenderer.GetPropertyIndex("uPercentage[1]");
+ float value0, value1;
+
+ Animation animation = Animation::New(0.5f);
+ emitter.EmitBubble(animation, Vector2(40.f, 40.f), Vector2(-5.f, -5.f), Vector2(30.f, 30.f));
+ emitter.EmitBubble(animation, Vector2(10.f, 10.f), Vector2(5.f, 5.f), Vector2(30.f, 30.f));
+ (bubbleRenderer.GetProperty(propertyIndex0)).Get(value0);
+ (bubbleRenderer.GetProperty(propertyIndex1)).Get(value1);
+ DALI_TEST_EQUALS(value0, 0.f, TEST_LOCATION);
+ DALI_TEST_EQUALS(value1, 0.f, TEST_LOCATION);
+ (bubbleRenderer.GetCurrentProperty(propertyIndex0)).Get(value0);
+ (bubbleRenderer.GetCurrentProperty(propertyIndex0)).Get(value1);
+ DALI_TEST_EQUALS(value0, 0.f, TEST_LOCATION);
+ DALI_TEST_EQUALS(value1, 0.f, TEST_LOCATION);
animation.Play();
Wait(application, 300);
- propertyIndex0 = bubbleRenderer.GetPropertyIndex( "uPercentage[0]" );
- propertyIndex1 = bubbleRenderer.GetPropertyIndex( "uPercentage[1]" );
- ( bubbleRenderer.GetCurrentProperty( propertyIndex0 ) ).Get( value0 );
- ( bubbleRenderer.GetCurrentProperty( propertyIndex0 ) ).Get( value1 );
- DALI_TEST_CHECK( value0 >= 0.6f );
- DALI_TEST_CHECK( value1 >= 0.6f );
-
- Wait(application,500);
- ( bubbleRenderer.GetCurrentProperty( propertyIndex0 ) ).Get( value0 );
- ( bubbleRenderer.GetCurrentProperty( propertyIndex0 ) ).Get( value1 );
- DALI_TEST_EQUALS(value0, 1.f, TEST_LOCATION );
- DALI_TEST_EQUALS(value1, 1.f, TEST_LOCATION );
+ propertyIndex0 = bubbleRenderer.GetPropertyIndex("uPercentage[0]");
+ propertyIndex1 = bubbleRenderer.GetPropertyIndex("uPercentage[1]");
+ (bubbleRenderer.GetCurrentProperty(propertyIndex0)).Get(value0);
+ (bubbleRenderer.GetCurrentProperty(propertyIndex0)).Get(value1);
+ DALI_TEST_CHECK(value0 >= 0.6f);
+ DALI_TEST_CHECK(value1 >= 0.6f);
+
+ Wait(application, 500);
+ (bubbleRenderer.GetCurrentProperty(propertyIndex0)).Get(value0);
+ (bubbleRenderer.GetCurrentProperty(propertyIndex0)).Get(value1);
+ DALI_TEST_EQUALS(value0, 1.f, TEST_LOCATION);
+ DALI_TEST_EQUALS(value1, 1.f, TEST_LOCATION);
END_TEST;
}
{
#ifdef OLD_GRAPHICS_TEST
ToolkitTestApplication application;
- tet_infoline( " UtcDaliBubbleEmitterRestore " );
+ tet_infoline(" UtcDaliBubbleEmitterRestore ");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uPercentage[0]", Property::Type::FLOAT),
- UniformData("uStartEndPosition[0]", Property::Type::VECTOR4),
- };
+ {
+ UniformData("uPercentage[0]", Property::Type::FLOAT),
+ UniformData("uStartEndPosition[0]", Property::Type::VECTOR4),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
- Vector2 movementArea(50.f,50.f);
- Texture shapeImage = CreateSolidColorTexture( application, Color::GREEN, 5, 5 );
- BubbleEmitter emitter = BubbleEmitter::New( movementArea,shapeImage, 90, Vector2( 5.f, 10.f ));
- Actor root = emitter.GetRootActor();
- application.GetScene().Add( root );
- root.SetProperty( Actor::Property::POSITION, Vector3::ZERO );
- root.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- root.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ Vector2 movementArea(50.f, 50.f);
+ Texture shapeImage = CreateSolidColorTexture(application, Color::GREEN, 5, 5);
+ BubbleEmitter emitter = BubbleEmitter::New(movementArea, shapeImage, 90, Vector2(5.f, 10.f));
+ Actor root = emitter.GetRootActor();
+ application.GetScene().Add(root);
+ root.SetProperty(Actor::Property::POSITION, Vector3::ZERO);
+ root.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ root.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
- Renderer renderer = root.GetRendererAt( 0 );
- DALI_TEST_CHECK( renderer );
+ Renderer renderer = root.GetRendererAt(0);
+ DALI_TEST_CHECK(renderer);
TestGlAbstraction& gl = application.GetGlAbstraction();
- float percentageValue;
+ float percentageValue;
Vector4 startEndPosValue;
- Animation animation = Animation::New( 0.5f );
- emitter.EmitBubble( animation, Vector2(40.f,40.f), Vector2(-5.f,-5.f), Vector2(30.f,30.f) );
+ Animation animation = Animation::New(0.5f);
+ emitter.EmitBubble(animation, Vector2(40.f, 40.f), Vector2(-5.f, -5.f), Vector2(30.f, 30.f));
Wait(application);
- DALI_TEST_CHECK( gl.GetUniformValue<float>( "uPercentage[0]", percentageValue ) );
- DALI_TEST_EQUALS( percentageValue, 0.f, TEST_LOCATION );
+ DALI_TEST_CHECK(gl.GetUniformValue<float>("uPercentage[0]", percentageValue));
+ DALI_TEST_EQUALS(percentageValue, 0.f, TEST_LOCATION);
- DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uStartEndPosition[0]", startEndPosValue ) );
- DALI_TEST_EQUALS( startEndPosValue.x, 40.f - movementArea.x*0.5f, TEST_LOCATION );
- DALI_TEST_EQUALS( startEndPosValue.y, 40.f- movementArea.x*0.5f, TEST_LOCATION );
+ DALI_TEST_CHECK(gl.GetUniformValue<Vector4>("uStartEndPosition[0]", startEndPosValue));
+ DALI_TEST_EQUALS(startEndPosValue.x, 40.f - movementArea.x * 0.5f, TEST_LOCATION);
+ DALI_TEST_EQUALS(startEndPosValue.y, 40.f - movementArea.x * 0.5f, TEST_LOCATION);
animation.Play();
Wait(application, 200);
animation.Clear();
- DALI_TEST_CHECK( gl.GetUniformValue<float>( "uPercentage[0]", percentageValue ) );
- DALI_TEST_CHECK( percentageValue < 0.5f && percentageValue >= 0.4);
+ DALI_TEST_CHECK(gl.GetUniformValue<float>("uPercentage[0]", percentageValue));
+ DALI_TEST_CHECK(percentageValue < 0.5f && percentageValue >= 0.4);
- DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uStartEndPosition[0]", startEndPosValue ) );
- DALI_TEST_EQUALS( startEndPosValue.x, 40.f- movementArea.x*0.5f, TEST_LOCATION );
- DALI_TEST_EQUALS( startEndPosValue.y, 40.f- movementArea.x*0.5f, TEST_LOCATION );
+ DALI_TEST_CHECK(gl.GetUniformValue<Vector4>("uStartEndPosition[0]", startEndPosValue));
+ DALI_TEST_EQUALS(startEndPosValue.x, 40.f - movementArea.x * 0.5f, TEST_LOCATION);
+ DALI_TEST_EQUALS(startEndPosValue.y, 40.f - movementArea.x * 0.5f, TEST_LOCATION);
emitter.Restore();
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( gl.GetUniformValue<float>( "uPercentage[0]", percentageValue ) );
- DALI_TEST_EQUALS( percentageValue, 0.f, TEST_LOCATION );
+ DALI_TEST_CHECK(gl.GetUniformValue<float>("uPercentage[0]", percentageValue));
+ DALI_TEST_EQUALS(percentageValue, 0.f, TEST_LOCATION);
- DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uStartEndPosition[0]", startEndPosValue ) );
- DALI_TEST_EQUALS( startEndPosValue, Vector4::ZERO, TEST_LOCATION );
+ DALI_TEST_CHECK(gl.GetUniformValue<Vector4>("uStartEndPosition[0]", startEndPosValue));
+ DALI_TEST_EQUALS(startEndPosValue, Vector4::ZERO, TEST_LOCATION);
#else
tet_result(TET_PASS);
#endif
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <algorithm>
+#include <cstdlib>
#include <iostream>
#include <iterator>
#include <vector>
-#include <algorithm>
-#include <cstdlib>
#include <dali-toolkit-test-suite-utils.h>
-#include <dali-toolkit/devel-api/builder/builder.h>
+#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/builder/base64-encoding.h>
+#include <dali-toolkit/devel-api/builder/builder.h>
#include <dali/integration-api/events/touch-event-integ.h>
-#include <dali-toolkit/dali-toolkit.h>
-#include <test-button.h>
-#include <test-animation-data.h>
#include <dummy-control.h>
+#include <test-animation-data.h>
+#include <test-button.h>
-
-#define STRINGIFY(A)#A
+#define STRINGIFY(A) #A
using namespace Dali;
using namespace Toolkit;
namespace BuilderControlProperty
{
-
enum
{
INTEGER_PROPERTY = Toolkit::Control::CONTROL_PROPERTY_END_INDEX + 1,
namespace
{
-
BaseHandle Create()
{
return Toolkit::Control::New();
int gSetPropertyCalledCount = 0;
-void SetProperty( BaseObject* object, Property::Index propertyIndex, const Property::Value& value )
+void SetProperty(BaseObject* object, Property::Index propertyIndex, const Property::Value& value)
{
++gSetPropertyCalledCount;
}
-Property::Value GetProperty( BaseObject* object, Property::Index propertyIndex )
+Property::Value GetProperty(BaseObject* object, Property::Index propertyIndex)
{
return Property::Value();
}
} // unnamed namespace
// Properties
-Dali::TypeRegistration typeRegistration( "BuilderControl", typeid( Toolkit::Control ), Create );
+Dali::TypeRegistration typeRegistration("BuilderControl", typeid(Toolkit::Control), Create);
-Dali::PropertyRegistration propertyInteger( typeRegistration, "integerProperty", INTEGER_PROPERTY, Property::INTEGER, &SetProperty, &GetProperty );
-Dali::PropertyRegistration propertyMatrix3( typeRegistration, "matrix3Property", MATRIX3_PROPERTY, Property::MATRIX3, &SetProperty, &GetProperty );
-Dali::PropertyRegistration propertyMatrix( typeRegistration, "matrixProperty", MATRIX_PROPERTY, Property::MATRIX, &SetProperty, &GetProperty );
-Dali::PropertyRegistration propertyNone( typeRegistration, "noneProperty", NONE_PROPERTY, Property::NONE, &SetProperty, &GetProperty );
+Dali::PropertyRegistration propertyInteger(typeRegistration, "integerProperty", INTEGER_PROPERTY, Property::INTEGER, &SetProperty, &GetProperty);
+Dali::PropertyRegistration propertyMatrix3(typeRegistration, "matrix3Property", MATRIX3_PROPERTY, Property::MATRIX3, &SetProperty, &GetProperty);
+Dali::PropertyRegistration propertyMatrix(typeRegistration, "matrixProperty", MATRIX_PROPERTY, Property::MATRIX, &SetProperty, &GetProperty);
+Dali::PropertyRegistration propertyNone(typeRegistration, "noneProperty", NONE_PROPERTY, Property::NONE, &SetProperty, &GetProperty);
-}
+} // namespace BuilderControlProperty
namespace
{
-
struct BuilderFunctor
{
- BuilderFunctor( bool& called ) : mCalled( called )
+ BuilderFunctor(bool& called)
+ : mCalled(called)
{
mCalled = false;
}
} // namespace
-
-
void builder_startup(void)
{
test_return_value = TET_UNDEF;
// JSON with a quit event when the actor is touched
std::string json(
- "{"
- "\"stage\":"
- "[{"
- "\"type\": \"Layer\","
- "\"size\": [100,100,1],"
- "\"parentOrigin\": \"TOP_LEFT\","
- "\"anchorPoint\": \"TOP_LEFT\","
- "\"maximumSize\": [100,100],"
- "\"orientation\": [10,10,10,10],"
- "\"clippingBox\": [10,10,10,10],"
- "\"signals\": [{"
- "\"name\": \"touched\","
- "\"action\": \"quit\""
- "}]"
- "}]"
- "}"
- );
+ "{"
+ "\"stage\":"
+ "[{"
+ "\"type\": \"Layer\","
+ "\"size\": [100,100,1],"
+ "\"parentOrigin\": \"TOP_LEFT\","
+ "\"anchorPoint\": \"TOP_LEFT\","
+ "\"maximumSize\": [100,100],"
+ "\"orientation\": [10,10,10,10],"
+ "\"clippingBox\": [10,10,10,10],"
+ "\"signals\": [{"
+ "\"name\": \"touched\","
+ "\"action\": \"quit\""
+ "}]"
+ "}]"
+ "}");
Builder builder = Builder::New();
- builder.LoadFromString( json );
- builder.AddActors ( application.GetScene().GetRootLayer() );
+ builder.LoadFromString(json);
+ builder.AddActors(application.GetScene().GetRootLayer());
// Connect to builder's quit signal
- bool functorCalled( false );
- builder.QuitSignal().Connect( &application, BuilderFunctor( functorCalled ) );
+ bool functorCalled(false);
+ builder.QuitSignal().Connect(&application, BuilderFunctor(functorCalled));
// Render and notify
application.SendNotification();
// Emit touch event and check that our quit method is called
Integration::TouchEvent touchEvent;
- Integration::Point point;
- point.SetState( PointState::DOWN );
- point.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
- touchEvent.points.push_back( point );
- application.ProcessEvent( touchEvent );
- DALI_TEST_CHECK( functorCalled );
+ Integration::Point point;
+ point.SetState(PointState::DOWN);
+ point.SetScreenPosition(Vector2(10.0f, 10.0f));
+ touchEvent.points.push_back(point);
+ application.ProcessEvent(touchEvent);
+ DALI_TEST_CHECK(functorCalled);
END_TEST;
}
-
int UtcDaliBuilderAnimationP(void)
{
ToolkitTestApplication application;
// JSON with a quit event when the actor is touched
std::string json(
- "{"
- " \"constants\":"
- " {"
- " \"ALPHA_FUNCTION\":\"EASE_IN_OUT\""
- " },"
- " \"paths\":"
- " {"
- " \"path0\":"
- " {"
- " \"points\":[ [-150, -50, 0], [0.0,70.0,0.0], [190.0,-150.0,0.0] ],"
- " \"curvature\":0.35"
- " }"
- " },"
- " \"animations\": {"
- " \"animate\": {"
- " \"loop\": true,"
- " \"endAction\": \"BAKE\","
- " \"disconnectAction\": \"BAKE\","
- " \"properties\":"
- " [{"
- " \"actor\": \"greeting\","
- " \"property\": \"position\","
- " \"value\": [300, 300, -1000],"
- " \"alphaFunction\": \"{ALPHA_FUNCTION}\","
- " \"relative\": true,"
- " \"timePeriod\": {"
- " \"delay\": 0,"
- " \"duration\": 3"
- " }"
- " },"
- " {"
- " \"actor\": \"greeting\","
- " \"property\": \"visible\","
- " \"alphaFunction\": \"LINEAR\","
- " \"value\": true"
- " },"
- " {"
- " \"actor\": \"greeting\","
- " \"property\": \"sizeWidth\","
- " \"alphaFunction\": \"REVERSE\","
- " \"value\": 10.0"
- " },"
- " {"
- " \"actor\": \"greeting\","
- " \"property\": \"orientation\","
- " \"alphaFunction\": \"EASE_IN\","
- " \"value\": [10.0,20.0,30.0]"
- " },"
- " {"
- " \"actor\": \"greeting\","
- " \"property\": \"orientation\","
- " \"alphaFunction\": \"EASE_OUT\","
- " \"value\": [0.0, 0.0, 0.0, 1.0]"
- " },"
- " {"
- " \"actor\": \"greeting\","
- " \"property\": \"orientation\","
- " \"alphaFunction\": \"EASE_IN_OUT\","
- " \"value\": [0.0, 0.0, 0.0, 1.0]"
- " },"
- " {"
- " \"actor\": \"greeting\","
- " \"property\": \"orientation\","
- " \"alphaFunction\": \"EASE_IN_SINE\","
- " \"value\": [0.0, 0.0, 0.0, 1.0]"
- " },"
- " {"
- " \"actor\": \"greeting\","
- " \"property\": \"orientation\","
- " \"alphaFunction\": \"EASE_OUT_SINE\","
- " \"value\": [0.0, 0.0, 0.0, 1.0]"
- " },"
- " {"
- " \"actor\": \"greeting\","
- " \"property\": \"orientation\","
- " \"alphaFunction\": \"EASE_IN_OUT_SINE\","
- " \"value\": [0.0, 0.0, 0.0, 1.0]"
- " },"
- " {"
- " \"actor\": \"greeting\","
- " \"property\": \"orientation\","
- " \"alphaFunction\": \"BOUNCE\","
- " \"value\": [0.0, 0.0, 0.0, 1.0]"
- " },"
- " {"
- " \"actor\": \"greeting\","
- " \"property\": \"orientation\","
- " \"alphaFunction\": \"SIN\","
- " \"value\": [0.0, 0.0, 0.0, 1.0]"
- " },"
- " {"
- " \"actor\": \"greeting\","
- " \"property\": \"orientation\","
- " \"alphaFunction\": \"EASE_OUT_BACK\","
- " \"value\": [0.0, 0.0, 0.0, 1.0]"
- " }"
- " ]"
- " },"
- " \"pathAnimation\": {"
- " \"duration\": 3.0,"
- " \"endAction\": \"DISCARD\","
- " \"disconnectAction\": \"BAKE_FINAL\","
- " \"properties\": [{"
- " \"actor\": \"greeting\","
- " \"path\":\"path0\","
- " \"forward\":[1,0,0],"
- " \"alphaFunction\": \"EASE_IN_OUT\","
- " \"timePeriod\": {"
- " \"delay\": 0,"
- " \"duration\": 3"
- " }"
- " }]"
- " },"
- " \"pathAnimation2\": {"
- " \"duration\": 3.0,"
- " \"endAction\": \"BAKE_FINAL\","
- " \"disconnectAction\": \"DISCARD\","
- " \"properties\": [{"
- " \"actor\": \"greeting\","
- " \"path\":\"path0\","
- " \"forward\":[1,0,0],"
- " \"alphaFunction\": \"EASE_IN_OUT\","
- " \"timePeriod\": {"
- " \"delay\": 0,"
- " \"duration\": 3"
- " }"
- " }]"
- " }"
- " },"
- " \"stage\": [{"
- " \"name\": \"greeting\","
- " \"type\": \"TextLabel\","
- " \"text\": \"Touch me\","
- " \"inherit\": [\"basicText\"],"
- " \"position\": [0, -120, 0],"
- " \"size\": [200, 200, 1],"
- " \"orientation\": [0, 0, 30],"
- " \"signals\": [{"
- " \"name\": \"touched\","
- " \"action\": \"play\","
- " \"animation\": \"animate\""
- " }]"
- " }]"
- "}");
+ "{"
+ " \"constants\":"
+ " {"
+ " \"ALPHA_FUNCTION\":\"EASE_IN_OUT\""
+ " },"
+ " \"paths\":"
+ " {"
+ " \"path0\":"
+ " {"
+ " \"points\":[ [-150, -50, 0], [0.0,70.0,0.0], [190.0,-150.0,0.0] ],"
+ " \"curvature\":0.35"
+ " }"
+ " },"
+ " \"animations\": {"
+ " \"animate\": {"
+ " \"loop\": true,"
+ " \"endAction\": \"BAKE\","
+ " \"disconnectAction\": \"BAKE\","
+ " \"properties\":"
+ " [{"
+ " \"actor\": \"greeting\","
+ " \"property\": \"position\","
+ " \"value\": [300, 300, -1000],"
+ " \"alphaFunction\": \"{ALPHA_FUNCTION}\","
+ " \"relative\": true,"
+ " \"timePeriod\": {"
+ " \"delay\": 0,"
+ " \"duration\": 3"
+ " }"
+ " },"
+ " {"
+ " \"actor\": \"greeting\","
+ " \"property\": \"visible\","
+ " \"alphaFunction\": \"LINEAR\","
+ " \"value\": true"
+ " },"
+ " {"
+ " \"actor\": \"greeting\","
+ " \"property\": \"sizeWidth\","
+ " \"alphaFunction\": \"REVERSE\","
+ " \"value\": 10.0"
+ " },"
+ " {"
+ " \"actor\": \"greeting\","
+ " \"property\": \"orientation\","
+ " \"alphaFunction\": \"EASE_IN\","
+ " \"value\": [10.0,20.0,30.0]"
+ " },"
+ " {"
+ " \"actor\": \"greeting\","
+ " \"property\": \"orientation\","
+ " \"alphaFunction\": \"EASE_OUT\","
+ " \"value\": [0.0, 0.0, 0.0, 1.0]"
+ " },"
+ " {"
+ " \"actor\": \"greeting\","
+ " \"property\": \"orientation\","
+ " \"alphaFunction\": \"EASE_IN_OUT\","
+ " \"value\": [0.0, 0.0, 0.0, 1.0]"
+ " },"
+ " {"
+ " \"actor\": \"greeting\","
+ " \"property\": \"orientation\","
+ " \"alphaFunction\": \"EASE_IN_SINE\","
+ " \"value\": [0.0, 0.0, 0.0, 1.0]"
+ " },"
+ " {"
+ " \"actor\": \"greeting\","
+ " \"property\": \"orientation\","
+ " \"alphaFunction\": \"EASE_OUT_SINE\","
+ " \"value\": [0.0, 0.0, 0.0, 1.0]"
+ " },"
+ " {"
+ " \"actor\": \"greeting\","
+ " \"property\": \"orientation\","
+ " \"alphaFunction\": \"EASE_IN_OUT_SINE\","
+ " \"value\": [0.0, 0.0, 0.0, 1.0]"
+ " },"
+ " {"
+ " \"actor\": \"greeting\","
+ " \"property\": \"orientation\","
+ " \"alphaFunction\": \"BOUNCE\","
+ " \"value\": [0.0, 0.0, 0.0, 1.0]"
+ " },"
+ " {"
+ " \"actor\": \"greeting\","
+ " \"property\": \"orientation\","
+ " \"alphaFunction\": \"SIN\","
+ " \"value\": [0.0, 0.0, 0.0, 1.0]"
+ " },"
+ " {"
+ " \"actor\": \"greeting\","
+ " \"property\": \"orientation\","
+ " \"alphaFunction\": \"EASE_OUT_BACK\","
+ " \"value\": [0.0, 0.0, 0.0, 1.0]"
+ " }"
+ " ]"
+ " },"
+ " \"pathAnimation\": {"
+ " \"duration\": 3.0,"
+ " \"endAction\": \"DISCARD\","
+ " \"disconnectAction\": \"BAKE_FINAL\","
+ " \"properties\": [{"
+ " \"actor\": \"greeting\","
+ " \"path\":\"path0\","
+ " \"forward\":[1,0,0],"
+ " \"alphaFunction\": \"EASE_IN_OUT\","
+ " \"timePeriod\": {"
+ " \"delay\": 0,"
+ " \"duration\": 3"
+ " }"
+ " }]"
+ " },"
+ " \"pathAnimation2\": {"
+ " \"duration\": 3.0,"
+ " \"endAction\": \"BAKE_FINAL\","
+ " \"disconnectAction\": \"DISCARD\","
+ " \"properties\": [{"
+ " \"actor\": \"greeting\","
+ " \"path\":\"path0\","
+ " \"forward\":[1,0,0],"
+ " \"alphaFunction\": \"EASE_IN_OUT\","
+ " \"timePeriod\": {"
+ " \"delay\": 0,"
+ " \"duration\": 3"
+ " }"
+ " }]"
+ " }"
+ " },"
+ " \"stage\": [{"
+ " \"name\": \"greeting\","
+ " \"type\": \"TextLabel\","
+ " \"text\": \"Touch me\","
+ " \"inherit\": [\"basicText\"],"
+ " \"position\": [0, -120, 0],"
+ " \"size\": [200, 200, 1],"
+ " \"orientation\": [0, 0, 30],"
+ " \"signals\": [{"
+ " \"name\": \"touched\","
+ " \"action\": \"play\","
+ " \"animation\": \"animate\""
+ " }]"
+ " }]"
+ "}");
Builder builder = Builder::New();
- builder.LoadFromString( json );
- builder.AddActors( application.GetScene().GetRootLayer() );
+ builder.LoadFromString(json);
+ builder.AddActors(application.GetScene().GetRootLayer());
Animation anim = builder.CreateAnimation("animate");
- DALI_TEST_CHECK( anim );
+ DALI_TEST_CHECK(anim);
Property::Map map;
map["ALPHA_FUNCTION"] = "EASE_IN_SQUARE";
- anim = builder.CreateAnimation("animate", map);
+ anim = builder.CreateAnimation("animate", map);
- DALI_TEST_CHECK( anim );
+ DALI_TEST_CHECK(anim);
anim = builder.CreateAnimation("pathAnimation");
- DALI_TEST_CHECK( anim );
+ DALI_TEST_CHECK(anim);
anim = builder.CreateAnimation("pathAnimation2");
- DALI_TEST_CHECK( anim );
+ DALI_TEST_CHECK(anim);
// trigger play
// Emit touch event and check that our quit method is called
Integration::TouchEvent touchEvent;
- Integration::Point point;
- point.SetState( PointState::DOWN );
- point.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
- touchEvent.points.push_back( point );
- application.ProcessEvent( touchEvent );
+ Integration::Point point;
+ point.SetState(PointState::DOWN);
+ point.SetScreenPosition(Vector2(10.0f, 10.0f));
+ touchEvent.points.push_back(point);
+ application.ProcessEvent(touchEvent);
// Render and notify
application.SendNotification();
application.Render();
-
END_TEST;
}
// JSON with a quit event when the actor is touched
std::string json(
- "{"
- " \"constants\":"
- " {"
- " \"TEXT\": \"Touch Me\","
- " \"NAME\": \"greeting\" "
- " },"
- " \"paths\":"
- " {"
- " \"path0\":"
- " {"
- " \"points\":[ [-150, -50, 0], [0.0,70.0,0.0], [190.0,-150.0,0.0] ],"
- " \"curvature\":0.35"
- " }"
- " },"
- " \"animations\": {"
- " \"animate\": {"
- " \"loop\": true,"
- " \"endAction\": \"BAKE\","
- " \"disconnectAction\": \"BAKE\","
- " \"properties\":"
- " [{"
- " \"actor\": \"{NAME}\","
- " \"property\": \"positioninvalid\","
- " \"value\": [300, 300, -1000],"
- " \"alphaFunction\": \"EASE_IN_OUT\","
- " \"relative\": true,"
- " \"timePeriod\": {"
- " \"delay\": 0,"
- " \"duration\": 3"
- " }"
- " }"
- " ]"
- " },"
- " \"animate2\": {"
- " \"loop\": true,"
- " \"endAction\": \"BAKE\","
- " \"disconnectAction\": \"BAKE\","
- " \"properties\":"
- " [{"
- " \"actor\": \"{NAME}\","
- " \"property\": \"positioninvalid\","
- " \"value\": [300, 300, -1000],"
- " \"alphaFunction\": \"EGGS_OVER_EASY\","
- " \"relative\": true,"
- " \"timePeriod\": {"
- " \"delay\": 0,"
- " \"duration\": 3"
- " }"
- " }"
- " ]"
- " },"
- " \"pathAnimation\": {"
- " \"duration\": 3.0,"
- " \"endAction\": \"DISCARD\","
- " \"disconnectAction\": \"BAKE_FINAL\","
- " \"properties\": [{"
- " \"actor\": \"greeting\","
- " \"path\":\"pathDoesntExist\","
- " \"forward\":[1,0,0],"
- " \"alphaFunction\": \"EASE_IN_OUT\","
- " \"timePeriod\": {"
- " \"delay\": 0,"
- " \"duration\": 3"
- " }"
- " }]"
- " }"
- " },"
- " \"stage\": [{"
- " \"name\": \"greeting\","
- " \"type\": \"TextLabel\","
- " \"text\": \"Touch me\","
- " \"inherit\": [\"basicText\"],"
- " \"position\": [0, -120, 0],"
- " \"size\": [200, 200, 1],"
- " \"orientation\": [0, 0, 30],"
- " \"signals\": [{"
- " \"name\": \"touched\","
- " \"action\": \"play\","
- " \"animation\": \"animate\""
- " }]"
- " },"
- " {"
- " \"name\": \"greeting2\","
- " \"type\": \"TextLabel\","
- " \"text\": \"Touch me\""
- " }]"
- "}");
-
+ "{"
+ " \"constants\":"
+ " {"
+ " \"TEXT\": \"Touch Me\","
+ " \"NAME\": \"greeting\" "
+ " },"
+ " \"paths\":"
+ " {"
+ " \"path0\":"
+ " {"
+ " \"points\":[ [-150, -50, 0], [0.0,70.0,0.0], [190.0,-150.0,0.0] ],"
+ " \"curvature\":0.35"
+ " }"
+ " },"
+ " \"animations\": {"
+ " \"animate\": {"
+ " \"loop\": true,"
+ " \"endAction\": \"BAKE\","
+ " \"disconnectAction\": \"BAKE\","
+ " \"properties\":"
+ " [{"
+ " \"actor\": \"{NAME}\","
+ " \"property\": \"positioninvalid\","
+ " \"value\": [300, 300, -1000],"
+ " \"alphaFunction\": \"EASE_IN_OUT\","
+ " \"relative\": true,"
+ " \"timePeriod\": {"
+ " \"delay\": 0,"
+ " \"duration\": 3"
+ " }"
+ " }"
+ " ]"
+ " },"
+ " \"animate2\": {"
+ " \"loop\": true,"
+ " \"endAction\": \"BAKE\","
+ " \"disconnectAction\": \"BAKE\","
+ " \"properties\":"
+ " [{"
+ " \"actor\": \"{NAME}\","
+ " \"property\": \"positioninvalid\","
+ " \"value\": [300, 300, -1000],"
+ " \"alphaFunction\": \"EGGS_OVER_EASY\","
+ " \"relative\": true,"
+ " \"timePeriod\": {"
+ " \"delay\": 0,"
+ " \"duration\": 3"
+ " }"
+ " }"
+ " ]"
+ " },"
+ " \"pathAnimation\": {"
+ " \"duration\": 3.0,"
+ " \"endAction\": \"DISCARD\","
+ " \"disconnectAction\": \"BAKE_FINAL\","
+ " \"properties\": [{"
+ " \"actor\": \"greeting\","
+ " \"path\":\"pathDoesntExist\","
+ " \"forward\":[1,0,0],"
+ " \"alphaFunction\": \"EASE_IN_OUT\","
+ " \"timePeriod\": {"
+ " \"delay\": 0,"
+ " \"duration\": 3"
+ " }"
+ " }]"
+ " }"
+ " },"
+ " \"stage\": [{"
+ " \"name\": \"greeting\","
+ " \"type\": \"TextLabel\","
+ " \"text\": \"Touch me\","
+ " \"inherit\": [\"basicText\"],"
+ " \"position\": [0, -120, 0],"
+ " \"size\": [200, 200, 1],"
+ " \"orientation\": [0, 0, 30],"
+ " \"signals\": [{"
+ " \"name\": \"touched\","
+ " \"action\": \"play\","
+ " \"animation\": \"animate\""
+ " }]"
+ " },"
+ " {"
+ " \"name\": \"greeting2\","
+ " \"type\": \"TextLabel\","
+ " \"text\": \"Touch me\""
+ " }]"
+ "}");
Builder builder = Builder::New();
- builder.LoadFromString( json );
- builder.AddActors( application.GetScene().GetRootLayer() );
+ builder.LoadFromString(json);
+ builder.AddActors(application.GetScene().GetRootLayer());
Animation anim = builder.CreateAnimation("animate");
// create referencing a different actor aka animation templates
Property::Map map;
map["NAME"] = "greeting2";
- anim = builder.CreateAnimation("animate2", map);
+ anim = builder.CreateAnimation("animate2", map);
DALI_TEST_CHECK(anim);
// alternative actor to use for FindChildByName
anim = builder.CreateAnimation("animate2", map, application.GetScene().GetRootLayer());
DALI_TEST_CHECK(anim);
-
END_TEST;
-
}
int UtcDaliBuilderConstantsP(void)
// JSON with a quit event when the actor is touched
std::string json(
- "{"
- "\"constants\":"
- "{"
- " \"IMAGE_PATH\": \"apath\","
- " \"WIDTH\": 22.3,"
- " \"ANCHOR\": \"TOP_LEFT\","
- " \"PADDING\": [1,2,3,4]"
- "},"
- "\"stage\":"
- "[{"
- " \"type\": \"ImageView\","
- " \"name\": \"{NAME}\","
- " \"size\": [100,100,1],"
- " \"parentOrigin\": \"TOP_LEFT\","
- " \"anchorPoint\": \"{ANCHOR}\","
- " \"padding\": \"{PADDING}\","
- " \"image\": { \"url\": \"dir/{IMAGE_PATH}\" },"
- " \"sizeWidth\": \"{WIDTH}\","
- " \"signals\": [{"
- " \"name\": \"touched\","
- " \"action\": \"quit\""
- " }]"
- "}]"
- "}"
- );
+ "{"
+ "\"constants\":"
+ "{"
+ " \"IMAGE_PATH\": \"apath\","
+ " \"WIDTH\": 22.3,"
+ " \"ANCHOR\": \"TOP_LEFT\","
+ " \"PADDING\": [1,2,3,4]"
+ "},"
+ "\"stage\":"
+ "[{"
+ " \"type\": \"ImageView\","
+ " \"name\": \"{NAME}\","
+ " \"size\": [100,100,1],"
+ " \"parentOrigin\": \"TOP_LEFT\","
+ " \"anchorPoint\": \"{ANCHOR}\","
+ " \"padding\": \"{PADDING}\","
+ " \"image\": { \"url\": \"dir/{IMAGE_PATH}\" },"
+ " \"sizeWidth\": \"{WIDTH}\","
+ " \"signals\": [{"
+ " \"name\": \"touched\","
+ " \"action\": \"quit\""
+ " }]"
+ "}]"
+ "}");
Builder builder = Builder::New();
- builder.LoadFromString( json );
+ builder.LoadFromString(json);
- builder.AddConstant( "NAME", "image" );
+ builder.AddConstant("NAME", "image");
Property::Map map = builder.GetConstants();
- Dali::Property::Value* pValue = map.Find( "NAME" );
+ Dali::Property::Value* pValue = map.Find("NAME");
- DALI_TEST_CHECK( pValue );
+ DALI_TEST_CHECK(pValue);
- pValue = map.Find( "IMAGE_PATH" );
+ pValue = map.Find("IMAGE_PATH");
- DALI_TEST_CHECK( pValue );
+ DALI_TEST_CHECK(pValue);
- Dali::Property::Value value = builder.GetConstant( "WIDTH" );
+ Dali::Property::Value value = builder.GetConstant("WIDTH");
- DALI_TEST_CHECK( value.GetType() != Property::NONE );
+ DALI_TEST_CHECK(value.GetType() != Property::NONE);
- builder.AddActors ( application.GetScene().GetRootLayer() );
- DALI_TEST_CHECK( builder );
+ builder.AddActors(application.GetScene().GetRootLayer());
+ DALI_TEST_CHECK(builder);
Actor actor = application.GetScene().GetRootLayer().FindChildByName("image");
- DALI_TEST_CHECK( actor );
+ DALI_TEST_CHECK(actor);
END_TEST;
}
// JSON with a quit event when the actor is touched
std::string json(
- "{\n"
- "\"constants\":"
- "{"
- " \"SIZE\": [10,20,30]"
- "},"
- "\"styles\":\n"
- "{\n"
- " \"imageStyle\": \n"
- " {\n"
- " \"color\": [1,0,0,1],\n"
- " \"actors\": {\n"
- " \"childImage\": {\n"
- " \"color\": \"34\"\n"
- " }\n"
- " }\n"
- " }\n"
- "},\n"
- "\"templates\":\n"
- "{\n"
- " \"imageViewTemplate\": { \n"
- " \"type\": \"ImageView\",\n"
- " \"styles\": [\"imageStyle\"]\n"
- " },\n"
- " \"imageTree\": { \n"
- " \"type\": \"ImageView\",\n"
- " \"styles\": [\"imageStyle\"],\n"
- " \"name\": \"image\",\n"
- " \"size\": \"{SIZE}\",\n"
- " \"signals\": [{\n"
- " \"name\": \"touched\",\n"
- " \"action\": \"quit\"\n"
- " }],\n"
- " \"actors\": [\n"
- " {\n"
- " \"type\":\"ImageView\",\n"
- " \"name\":\"childImage\", \n"
- " \"color\": \n"
- " {\n"
- " \"r\": 10,\n"
- " \"g\": 10,\n"
- " \"b\": 10,\n"
- " \"a\": 100\n"
- " }\n"
- " },\n"
- " {\n"
- " \"type\":\"imageViewTemplate\",\n"
- " \"name\":\"childImage2\"\n"
- " }\n"
- " ]\n"
- " }\n"
- "},\n"
- "\"stage\":"
- "[{"
- " \"type\": \"imageTree\","
- " \"size\": [100,100,1]"
- "}]"
- "}\n"
- );
+ "{\n"
+ "\"constants\":"
+ "{"
+ " \"SIZE\": [10,20,30]"
+ "},"
+ "\"styles\":\n"
+ "{\n"
+ " \"imageStyle\": \n"
+ " {\n"
+ " \"color\": [1,0,0,1],\n"
+ " \"actors\": {\n"
+ " \"childImage\": {\n"
+ " \"color\": \"34\"\n"
+ " }\n"
+ " }\n"
+ " }\n"
+ "},\n"
+ "\"templates\":\n"
+ "{\n"
+ " \"imageViewTemplate\": { \n"
+ " \"type\": \"ImageView\",\n"
+ " \"styles\": [\"imageStyle\"]\n"
+ " },\n"
+ " \"imageTree\": { \n"
+ " \"type\": \"ImageView\",\n"
+ " \"styles\": [\"imageStyle\"],\n"
+ " \"name\": \"image\",\n"
+ " \"size\": \"{SIZE}\",\n"
+ " \"signals\": [{\n"
+ " \"name\": \"touched\",\n"
+ " \"action\": \"quit\"\n"
+ " }],\n"
+ " \"actors\": [\n"
+ " {\n"
+ " \"type\":\"ImageView\",\n"
+ " \"name\":\"childImage\", \n"
+ " \"color\": \n"
+ " {\n"
+ " \"r\": 10,\n"
+ " \"g\": 10,\n"
+ " \"b\": 10,\n"
+ " \"a\": 100\n"
+ " }\n"
+ " },\n"
+ " {\n"
+ " \"type\":\"imageViewTemplate\",\n"
+ " \"name\":\"childImage2\"\n"
+ " }\n"
+ " ]\n"
+ " }\n"
+ "},\n"
+ "\"stage\":"
+ "[{"
+ " \"type\": \"imageTree\","
+ " \"size\": [100,100,1]"
+ "}]"
+ "}\n");
std::string stylejson(
"{\n"
" \"color\": \"#344353\"\n"
" }\n"
" }\n"
- "}\n"
- );
+ "}\n");
std::string templatejson(
"{ \n"
" \"name\":\"childImage\" \n"
" }\n"
" ]\n"
- "}\n"
- );
+ "}\n");
Builder builder = Builder::New();
- builder.LoadFromString( json );
+ builder.LoadFromString(json);
- ImageView actor = ImageView::DownCast( builder.Create( "imageTree" ) );
- DALI_TEST_CHECK( actor );
+ ImageView actor = ImageView::DownCast(builder.Create("imageTree"));
+ DALI_TEST_CHECK(actor);
Dali::Property::Map map;
- map["SIZE"] = Vector3(100,100,1);
- actor = ImageView::DownCast( builder.Create( "imageTree", map ) );
- DALI_TEST_CHECK( actor );
+ map["SIZE"] = Vector3(100, 100, 1);
+ actor = ImageView::DownCast(builder.Create("imageTree", map));
+ DALI_TEST_CHECK(actor);
// create from json snippet
- actor = ImageView::DownCast( builder.CreateFromJson( templatejson ) );
- DALI_TEST_CHECK( actor );
-
+ actor = ImageView::DownCast(builder.CreateFromJson(templatejson));
+ DALI_TEST_CHECK(actor);
// NB: already applied in create
- DALI_TEST_CHECK( builder.ApplyStyle( "imageStyle", actor ) );
+ DALI_TEST_CHECK(builder.ApplyStyle("imageStyle", actor));
// apply from json snippet
- DALI_TEST_CHECK( builder.ApplyFromJson( actor, stylejson ) );
+ DALI_TEST_CHECK(builder.ApplyFromJson(actor, stylejson));
END_TEST;
}
// JSON with a quit event when the actor is touched
std::string json(
- "{\n"
- "\"renderTasks\":\n"
- "{\n"
- " \"task0\": {\n"
- " \"sourceActor\": \"image\",\n"
- " \"cameraActor\": \"camera\" \n"
- " }\n"
- "},\n"
- "\"stage\":\n"
- "[\n"
- " { \n"
- " \"type\": \"CameraActor\",\n"
- " \"name\": \"camera\"\n"
- " }, \n"
- " { \n"
- " \"type\": \"ImageView\",\n"
- " \"name\": \"image\",\n"
- " \"size\": [100,100,1],\n"
- " \"signals\": [{\n"
- " \"name\": \"touched\",\n"
- " \"action\": \"quit\"\n"
- " }],\n"
- " \"actors\": [\n"
- " {\n"
- " \"type\":\"ImageView\",\n"
- " \"name\":\"childImage\" \n"
- " }\n"
- " ]\n"
- " }\n"
- "]\n"
- "}\n"
- );
+ "{\n"
+ "\"renderTasks\":\n"
+ "{\n"
+ " \"task0\": {\n"
+ " \"sourceActor\": \"image\",\n"
+ " \"cameraActor\": \"camera\" \n"
+ " }\n"
+ "},\n"
+ "\"stage\":\n"
+ "[\n"
+ " { \n"
+ " \"type\": \"CameraActor\",\n"
+ " \"name\": \"camera\"\n"
+ " }, \n"
+ " { \n"
+ " \"type\": \"ImageView\",\n"
+ " \"name\": \"image\",\n"
+ " \"size\": [100,100,1],\n"
+ " \"signals\": [{\n"
+ " \"name\": \"touched\",\n"
+ " \"action\": \"quit\"\n"
+ " }],\n"
+ " \"actors\": [\n"
+ " {\n"
+ " \"type\":\"ImageView\",\n"
+ " \"name\":\"childImage\" \n"
+ " }\n"
+ " ]\n"
+ " }\n"
+ "]\n"
+ "}\n");
Builder builder = Builder::New();
- builder.LoadFromString( json );
+ builder.LoadFromString(json);
unsigned int count = application.GetScene().GetRenderTaskList().GetTaskCount();
// coverage
- builder.CreateRenderTask( "task0" );
+ builder.CreateRenderTask("task0");
- DALI_TEST_CHECK( count <
- application.GetScene().GetRenderTaskList().GetTaskCount() );
+ DALI_TEST_CHECK(count <
+ application.GetScene().GetRenderTaskList().GetTaskCount());
END_TEST;
}
// JSON with a quit event when the actor is touched
std::string json(
- "{\n"
- " \"stage\":\n"
- " [{\n"
- " \"type\": \"Actor\",\n"
- " \"name\": \"actor\",\n"
- " \"size\": [100,100,1],\n"
- " \"parentOrigin\": \"TOP_LEFT\",\n"
- " \"anchorPoint\": \"TOP_LEFT\",\n"
- " \"actors\": [{\n"
- " \"type\": \"Actor\",\n"
- " \"name\": \"subActor\"\n"
- " }],\n"
- " \"signals\": [{\n"
- " \"name\": \"touched\",\n"
- " \"action\": \"hide\",\n"
- " \"actor\": \"actor\",\n"
- " \"childActor\": \"subActor\"\n"
- " }]\n"
- " }]\n"
- "}\n"
- );
+ "{\n"
+ " \"stage\":\n"
+ " [{\n"
+ " \"type\": \"Actor\",\n"
+ " \"name\": \"actor\",\n"
+ " \"size\": [100,100,1],\n"
+ " \"parentOrigin\": \"TOP_LEFT\",\n"
+ " \"anchorPoint\": \"TOP_LEFT\",\n"
+ " \"actors\": [{\n"
+ " \"type\": \"Actor\",\n"
+ " \"name\": \"subActor\"\n"
+ " }],\n"
+ " \"signals\": [{\n"
+ " \"name\": \"touched\",\n"
+ " \"action\": \"hide\",\n"
+ " \"actor\": \"actor\",\n"
+ " \"childActor\": \"subActor\"\n"
+ " }]\n"
+ " }]\n"
+ "}\n");
Builder builder = Builder::New();
- builder.LoadFromString( json );
- builder.AddActors ( application.GetScene().GetRootLayer() );
+ builder.LoadFromString(json);
+ builder.AddActors(application.GetScene().GetRootLayer());
// Render and notify
application.SendNotification();
// Emit touch event and check that our quit method is called
Integration::TouchEvent touchEvent;
- Integration::Point point;
- point.SetState( PointState::DOWN );
- point.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
- touchEvent.points.push_back( point );
- application.ProcessEvent( touchEvent );
+ Integration::Point point;
+ point.SetState(PointState::DOWN);
+ point.SetScreenPosition(Vector2(10.0f, 10.0f));
+ touchEvent.points.push_back(point);
+ application.ProcessEvent(touchEvent);
// Render and notify
application.SendNotification();
application.Render();
Actor actor = application.GetScene().GetRootLayer().FindChildByName("subActor");
- DALI_TEST_CHECK( actor );
+ DALI_TEST_CHECK(actor);
- DALI_TEST_CHECK( !actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) );
+ DALI_TEST_CHECK(!actor.GetCurrentProperty<bool>(Actor::Property::VISIBLE));
END_TEST;
}
// JSON with a quit event when the actor is touched
std::string json(
- "{\n"
- " \"stage\":\n"
- " [{\n"
- " \"type\": \"Actor\",\n"
- " \"name\": \"actor\",\n"
- " \"size\": [100,100,1],\n"
- " \"parentOrigin\": \"TOP_LEFT\",\n"
- " \"anchorPoint\": \"TOP_LEFT\",\n"
- " \"actors\": [{\n"
- " \"type\": \"Actor\",\n"
- " \"name\": \"subActor\"\n"
- " }],\n"
- " \"signals\": [{\n"
- " \"name\": \"touched\",\n"
- " \"action\": \"set\",\n"
- " \"actor\": \"subActor\",\n"
- " \"property\": \"visible\",\n"
- " \"value\": false\n"
- " }]\n"
- " }]\n"
- "}\n"
- );
+ "{\n"
+ " \"stage\":\n"
+ " [{\n"
+ " \"type\": \"Actor\",\n"
+ " \"name\": \"actor\",\n"
+ " \"size\": [100,100,1],\n"
+ " \"parentOrigin\": \"TOP_LEFT\",\n"
+ " \"anchorPoint\": \"TOP_LEFT\",\n"
+ " \"actors\": [{\n"
+ " \"type\": \"Actor\",\n"
+ " \"name\": \"subActor\"\n"
+ " }],\n"
+ " \"signals\": [{\n"
+ " \"name\": \"touched\",\n"
+ " \"action\": \"set\",\n"
+ " \"actor\": \"subActor\",\n"
+ " \"property\": \"visible\",\n"
+ " \"value\": false\n"
+ " }]\n"
+ " }]\n"
+ "}\n");
Builder builder = Builder::New();
- builder.LoadFromString( json );
- builder.AddActors ( application.GetScene().GetRootLayer() );
+ builder.LoadFromString(json);
+ builder.AddActors(application.GetScene().GetRootLayer());
// Render and notify
application.SendNotification();
// Emit touch event and check that our quit method is called
Integration::TouchEvent touchEvent;
- Integration::Point point;
- point.SetState( PointState::DOWN );
- point.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
- touchEvent.points.push_back( point );
- application.ProcessEvent( touchEvent );
+ Integration::Point point;
+ point.SetState(PointState::DOWN);
+ point.SetScreenPosition(Vector2(10.0f, 10.0f));
+ touchEvent.points.push_back(point);
+ application.ProcessEvent(touchEvent);
// Render and notify
application.SendNotification();
application.Render();
Actor actor = application.GetScene().GetRootLayer().FindChildByName("subActor");
- DALI_TEST_CHECK( actor );
+ DALI_TEST_CHECK(actor);
- DALI_TEST_CHECK( !actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) );
+ DALI_TEST_CHECK(!actor.GetCurrentProperty<bool>(Actor::Property::VISIBLE));
END_TEST;
}
// JSON with a quit event when the actor is touched
std::string json(
- "{\n"
- " \"stage\":\n"
- " [{\n"
- " \"type\": \"Actor\",\n"
- " \"name\": \"actor\",\n"
- " \"size\": [100,100,1],\n"
- " \"parentOrigin\": \"TOP_LEFT\",\n"
- " \"anchorPoint\": \"TOP_LEFT\",\n"
- " \"actors\": [{\n"
- " \"type\": \"Actor\",\n"
- " \"name\": \"subActor\"\n"
- " }],\n"
- " \"signals\": [{\n"
- " \"name\": \"touched\",\n"
- " \"action\": \"hide\"\n"
- " }]\n"
- " }]\n"
- "}\n"
- );
+ "{\n"
+ " \"stage\":\n"
+ " [{\n"
+ " \"type\": \"Actor\",\n"
+ " \"name\": \"actor\",\n"
+ " \"size\": [100,100,1],\n"
+ " \"parentOrigin\": \"TOP_LEFT\",\n"
+ " \"anchorPoint\": \"TOP_LEFT\",\n"
+ " \"actors\": [{\n"
+ " \"type\": \"Actor\",\n"
+ " \"name\": \"subActor\"\n"
+ " }],\n"
+ " \"signals\": [{\n"
+ " \"name\": \"touched\",\n"
+ " \"action\": \"hide\"\n"
+ " }]\n"
+ " }]\n"
+ "}\n");
Builder builder = Builder::New();
- builder.LoadFromString( json );
- builder.AddActors ( application.GetScene().GetRootLayer() );
+ builder.LoadFromString(json);
+ builder.AddActors(application.GetScene().GetRootLayer());
// Render and notify
application.SendNotification();
// Emit touch event and check that our quit method is called
Integration::TouchEvent touchEvent;
- Integration::Point point;
- point.SetState( PointState::DOWN );
- point.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
- touchEvent.points.push_back( point );
- application.ProcessEvent( touchEvent );
+ Integration::Point point;
+ point.SetState(PointState::DOWN);
+ point.SetScreenPosition(Vector2(10.0f, 10.0f));
+ touchEvent.points.push_back(point);
+ application.ProcessEvent(touchEvent);
// Render and notify
application.SendNotification();
application.Render();
Actor actor = application.GetScene().GetRootLayer().FindChildByName("actor");
- DALI_TEST_CHECK( actor );
+ DALI_TEST_CHECK(actor);
- DALI_TEST_CHECK( !actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) );
+ DALI_TEST_CHECK(!actor.GetCurrentProperty<bool>(Actor::Property::VISIBLE));
END_TEST;
}
// JSON with a quit event when the actor is touched
std::string json(
- "{\n"
- " \"stage\":\n"
- " [{\n"
- " \"type\": \"Actor\",\n"
- " \"name\": \"actor\",\n"
- " \"size\": [100,100,1],\n"
- " \"parentOrigin\": \"TOP_LEFT\",\n"
- " \"anchorPoint\": \"TOP_LEFT\",\n"
- " \"actors\": [{\n"
- " \"type\": \"Actor\",\n"
- " \"name\": \"subActor\"\n"
- " }],\n"
- " \"signals\": [{\n"
- " \"name\": \"touched\",\n"
- " \"action\": \"hide\"\n"
- " }],\n"
- " \"notifications\": [{\n"
- " \"property\": \"visible\",\n"
- " \"condition\": \"False\",\n"
- " \"action\": \"show\"\n"
- " },\n"
- " {\n"
- " \"property\": \"positionX\",\n"
- " \"condition\": \"LessThan\",\n"
- " \"arg0\": 0.0,\n"
- " \"action\": \"show\"\n"
- " },\n"
- " {\n"
- " \"property\": \"positionY\",\n"
- " \"condition\": \"GreaterThan\",\n"
- " \"arg0\": 200.0,\n"
- " \"action\": \"show\"\n"
- " },\n"
- " {\n"
- " \"property\": \"positionZ\",\n"
- " \"condition\": \"Inside\",\n"
- " \"arg0\": 0.0,\n"
- " \"arg1\": 10.0,\n"
- " \"action\": \"show\"\n"
- " },\n"
- " {\n"
- " \"property\": \"positionZ\",\n"
- " \"condition\": \"Outside\",\n"
- " \"arg0\": 40.0,\n"
- " \"arg1\": 50.0,\n"
- " \"action\": \"show\"\n"
- " }]\n"
- " }]\n"
- "}\n"
- );
+ "{\n"
+ " \"stage\":\n"
+ " [{\n"
+ " \"type\": \"Actor\",\n"
+ " \"name\": \"actor\",\n"
+ " \"size\": [100,100,1],\n"
+ " \"parentOrigin\": \"TOP_LEFT\",\n"
+ " \"anchorPoint\": \"TOP_LEFT\",\n"
+ " \"actors\": [{\n"
+ " \"type\": \"Actor\",\n"
+ " \"name\": \"subActor\"\n"
+ " }],\n"
+ " \"signals\": [{\n"
+ " \"name\": \"touched\",\n"
+ " \"action\": \"hide\"\n"
+ " }],\n"
+ " \"notifications\": [{\n"
+ " \"property\": \"visible\",\n"
+ " \"condition\": \"False\",\n"
+ " \"action\": \"show\"\n"
+ " },\n"
+ " {\n"
+ " \"property\": \"positionX\",\n"
+ " \"condition\": \"LessThan\",\n"
+ " \"arg0\": 0.0,\n"
+ " \"action\": \"show\"\n"
+ " },\n"
+ " {\n"
+ " \"property\": \"positionY\",\n"
+ " \"condition\": \"GreaterThan\",\n"
+ " \"arg0\": 200.0,\n"
+ " \"action\": \"show\"\n"
+ " },\n"
+ " {\n"
+ " \"property\": \"positionZ\",\n"
+ " \"condition\": \"Inside\",\n"
+ " \"arg0\": 0.0,\n"
+ " \"arg1\": 10.0,\n"
+ " \"action\": \"show\"\n"
+ " },\n"
+ " {\n"
+ " \"property\": \"positionZ\",\n"
+ " \"condition\": \"Outside\",\n"
+ " \"arg0\": 40.0,\n"
+ " \"arg1\": 50.0,\n"
+ " \"action\": \"show\"\n"
+ " }]\n"
+ " }]\n"
+ "}\n");
Builder builder = Builder::New();
- builder.LoadFromString( json );
- builder.AddActors ( application.GetScene().GetRootLayer() );
+ builder.LoadFromString(json);
+ builder.AddActors(application.GetScene().GetRootLayer());
// Render and notify
application.SendNotification();
// Emit touch event and check that our quit method is called
Integration::TouchEvent touchEvent;
- Integration::Point point;
- point.SetState( PointState::DOWN );
- point.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
- touchEvent.points.push_back( point );
- application.ProcessEvent( touchEvent );
+ Integration::Point point;
+ point.SetState(PointState::DOWN);
+ point.SetScreenPosition(Vector2(10.0f, 10.0f));
+ touchEvent.points.push_back(point);
+ application.ProcessEvent(touchEvent);
// Render and notify
application.SendNotification();
application.Render();
Actor actor = application.GetScene().GetRootLayer().FindChildByName("actor");
- DALI_TEST_CHECK( actor );
+ DALI_TEST_CHECK(actor);
- DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) );
+ DALI_TEST_CHECK(actor.GetCurrentProperty<bool>(Actor::Property::VISIBLE));
END_TEST;
}
// JSON with a quit event when the actor is touched
std::string json(
- "{\n"
- " \"stage\":\n"
- " [{\n"
- " \"type\": \"Actor\",\n"
- " \"notifications\": [{\n"
- " \"property\": \"visible\",\n"
- " \"condition\": \"ErrorCondition\",\n"
- " \"action\": \"show\"\n"
- " }]\n"
- " }]\n"
- "}\n"
- );
+ "{\n"
+ " \"stage\":\n"
+ " [{\n"
+ " \"type\": \"Actor\",\n"
+ " \"notifications\": [{\n"
+ " \"property\": \"visible\",\n"
+ " \"condition\": \"ErrorCondition\",\n"
+ " \"action\": \"show\"\n"
+ " }]\n"
+ " }]\n"
+ "}\n");
try
{
Builder builder = Builder::New();
- builder.LoadFromString( json );
- builder.AddActors ( application.GetScene().GetRootLayer() );
- DALI_TEST_CHECK( false );
+ builder.LoadFromString(json);
+ builder.AddActors(application.GetScene().GetRootLayer());
+ DALI_TEST_CHECK(false);
}
catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
}
-
-
int UtcDaliBuilderCustomPropertyP(void)
{
ToolkitTestApplication application;
// JSON with a quit event when the actor is touched
std::string json(
- "{\n"
- "\"templates\":\n"
- "{\n"
- " \"imageTree\": { \n"
- " \"type\": \"ImageView\",\n"
- " \"name\": \"image\",\n"
- " \"size\": [100,100,1],\n"
- " \"signals\": [{\n"
- " \"name\": \"touched\",\n"
- " \"action\": \"quit\"\n"
- " }],\n"
- " \"properties\": {\n"
- " \"newproperty\": true\n"
- " },\n"
- " \"animatableProperties\": {\n"
- " \"newAnimatableproperty\": 3\n"
- " },\n"
- " \"actors\": [\n"
- " {\n"
- " \"type\":\"ImageView\",\n"
- " \"name\":\"childImage\" \n"
- " }\n"
- " ]\n"
- " }\n"
- "}\n"
- "}\n"
- );
+ "{\n"
+ "\"templates\":\n"
+ "{\n"
+ " \"imageTree\": { \n"
+ " \"type\": \"ImageView\",\n"
+ " \"name\": \"image\",\n"
+ " \"size\": [100,100,1],\n"
+ " \"signals\": [{\n"
+ " \"name\": \"touched\",\n"
+ " \"action\": \"quit\"\n"
+ " }],\n"
+ " \"properties\": {\n"
+ " \"newproperty\": true\n"
+ " },\n"
+ " \"animatableProperties\": {\n"
+ " \"newAnimatableproperty\": 3\n"
+ " },\n"
+ " \"actors\": [\n"
+ " {\n"
+ " \"type\":\"ImageView\",\n"
+ " \"name\":\"childImage\" \n"
+ " }\n"
+ " ]\n"
+ " }\n"
+ "}\n"
+ "}\n");
Builder builder = Builder::New();
- builder.LoadFromString( json );
+ builder.LoadFromString(json);
- ImageView actor = ImageView::DownCast( builder.Create( "imageTree" ) );
- DALI_TEST_CHECK( actor );
+ ImageView actor = ImageView::DownCast(builder.Create("imageTree"));
+ DALI_TEST_CHECK(actor);
// NB: already applied in create
Property::Index index = actor.GetPropertyIndex("newproperty");
- DALI_TEST_CHECK( Property::INVALID_INDEX != index );
+ DALI_TEST_CHECK(Property::INVALID_INDEX != index);
Property::Value value = actor.GetProperty(index);
- DALI_TEST_CHECK( value.Get<bool>() == true );
+ DALI_TEST_CHECK(value.Get<bool>() == true);
index = actor.GetPropertyIndex("newAnimatableproperty");
- DALI_TEST_CHECK( Property::INVALID_INDEX != index );
+ DALI_TEST_CHECK(Property::INVALID_INDEX != index);
value = actor.GetProperty(index);
- DALI_TEST_CHECK( value.Get<int>() == 3 );
+ DALI_TEST_CHECK(value.Get<int>() == 3);
END_TEST;
}
);
Builder builder = Builder::New();
- builder.LoadFromString( json );
+ builder.LoadFromString(json);
- builder.AddActors ( "stage", application.GetScene().GetRootLayer() );
+ builder.AddActors("stage", application.GetScene().GetRootLayer());
// Render and notify
application.SendNotification();
Actor actor = application.GetScene().GetRootLayer().FindChildByName("Image1");
// coverage
- DALI_TEST_CHECK( actor );
+ DALI_TEST_CHECK(actor);
END_TEST;
}
-
int UtcDaliBuilderLoadFromStringN(void)
{
ToolkitTestApplication application;
// JSON with a quit event when the actor is touched
std::string json(
- "asdfsadf dsf asdf asdf {"
- "\"stage\":"
- "[{"
- "\"type\": \"Actor\","
- "\"size\": [100,100,1],"
- "\"parentOrigin\": \"TOP_LEFT\","
- "\"anchorPoint\": \"TOP_LEFT\","
- "\"signals\": [{"
- "\"name\": \"touched\","
- "\"action\": \"quit\""
- "}]"
- "}]"
- "}"
- );
+ "asdfsadf dsf asdf asdf {"
+ "\"stage\":"
+ "[{"
+ "\"type\": \"Actor\","
+ "\"size\": [100,100,1],"
+ "\"parentOrigin\": \"TOP_LEFT\","
+ "\"anchorPoint\": \"TOP_LEFT\","
+ "\"signals\": [{"
+ "\"name\": \"touched\","
+ "\"action\": \"quit\""
+ "}]"
+ "}]"
+ "}");
Builder builder = Builder::New();
bool assert1 = false;
try
{
- builder.LoadFromString( json );
+ builder.LoadFromString(json);
}
- catch( Dali::DaliException& e )
+ catch(Dali::DaliException& e)
{
- DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_PRINT_ASSERT(e);
DALI_TEST_EQUALS(e.condition, "!\"Cannot parse JSON\"", TEST_LOCATION);
assert1 = true;
}
- DALI_TEST_CHECK( assert1 );
+ DALI_TEST_CHECK(assert1);
END_TEST;
}
-
int UtcDaliBuilderAddActorsP(void)
{
ToolkitTestApplication application;
// JSON with a quit event when the actor is touched
std::string json(
- "{\n"
- " \"arbitarysection\":\n"
- " [{\n"
- " \"type\": \"Actor\",\n"
- " \"name\": \"actor\",\n"
- " \"size\": [100,100,1],\n"
- " \"parentOrigin\": \"TOP_LEFT\",\n"
- " \"anchorPoint\": \"TOP_LEFT\",\n"
- " \"actors\": [{\n"
- " \"type\": \"Actor\",\n"
- " \"name\": \"subActor\",\n"
- " \"visible\": false\n"
- " }],\n"
- " \"signals\": [{\n"
- " \"name\": \"touched\",\n"
- " \"action\": \"hide\",\n"
- " \"actor\": \"actor\",\n"
- " \"childActor\": \"subActor\"\n"
- " }]\n"
- " }]\n"
- "}\n"
- );
+ "{\n"
+ " \"arbitarysection\":\n"
+ " [{\n"
+ " \"type\": \"Actor\",\n"
+ " \"name\": \"actor\",\n"
+ " \"size\": [100,100,1],\n"
+ " \"parentOrigin\": \"TOP_LEFT\",\n"
+ " \"anchorPoint\": \"TOP_LEFT\",\n"
+ " \"actors\": [{\n"
+ " \"type\": \"Actor\",\n"
+ " \"name\": \"subActor\",\n"
+ " \"visible\": false\n"
+ " }],\n"
+ " \"signals\": [{\n"
+ " \"name\": \"touched\",\n"
+ " \"action\": \"hide\",\n"
+ " \"actor\": \"actor\",\n"
+ " \"childActor\": \"subActor\"\n"
+ " }]\n"
+ " }]\n"
+ "}\n");
Builder builder = Builder::New();
- builder.LoadFromString( json );
- builder.AddActors ( "arbitarysection", application.GetScene().GetRootLayer() );
+ builder.LoadFromString(json);
+ builder.AddActors("arbitarysection", application.GetScene().GetRootLayer());
// Render and notify
application.SendNotification();
application.Render();
Actor actor = application.GetScene().GetRootLayer().FindChildByName("subActor");
- DALI_TEST_CHECK( actor );
+ DALI_TEST_CHECK(actor);
- DALI_TEST_CHECK( !actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) );
+ DALI_TEST_CHECK(!actor.GetCurrentProperty<bool>(Actor::Property::VISIBLE));
END_TEST;
}
Builder builder = Builder::New();
// frame buffer coverage
- builder.LoadFromString( json );
+ builder.LoadFromString(json);
// Render and notify
application.SendNotification();
application.Render();
- Dali::Path path = builder.GetPath( "path0" );
- DALI_TEST_CHECK( path );
+ Dali::Path path = builder.GetPath("path0");
+ DALI_TEST_CHECK(path);
- Dali::Path path2 = builder.GetPath( "path0" );
- DALI_TEST_CHECK( path2 );
- DALI_TEST_CHECK( path == path2 );
+ Dali::Path path2 = builder.GetPath("path0");
+ DALI_TEST_CHECK(path2);
+ DALI_TEST_CHECK(path == path2);
- Dali::PathConstrainer constrainer0 = builder.GetPathConstrainer( "constrainer0" );
- DALI_TEST_CHECK( constrainer0 );
+ Dali::PathConstrainer constrainer0 = builder.GetPathConstrainer("constrainer0");
+ DALI_TEST_CHECK(constrainer0);
- Dali::PathConstrainer constrainer0_2 = builder.GetPathConstrainer( "constrainer0" );
- DALI_TEST_CHECK( constrainer0_2 );
- DALI_TEST_CHECK( constrainer0 == constrainer0_2 );
+ Dali::PathConstrainer constrainer0_2 = builder.GetPathConstrainer("constrainer0");
+ DALI_TEST_CHECK(constrainer0_2);
+ DALI_TEST_CHECK(constrainer0 == constrainer0_2);
- Dali::LinearConstrainer constrainer1 = builder.GetLinearConstrainer( "constrainer1" );
- DALI_TEST_CHECK( constrainer1 );
+ Dali::LinearConstrainer constrainer1 = builder.GetLinearConstrainer("constrainer1");
+ DALI_TEST_CHECK(constrainer1);
- Dali::LinearConstrainer constrainer1_2 = builder.GetLinearConstrainer( "constrainer1" );
- DALI_TEST_CHECK( constrainer1 == constrainer1_2 );
+ Dali::LinearConstrainer constrainer1_2 = builder.GetLinearConstrainer("constrainer1");
+ DALI_TEST_CHECK(constrainer1 == constrainer1_2);
// For coverage
Actor actor = Actor::New();
- application.GetScene().Add( actor );
- builder.AddActors( actor );
+ application.GetScene().Add(actor);
+ builder.AddActors(actor);
// Render and notify
application.SendNotification();
application.Render();
- actor.GetChildAt( 0 ).Unparent();
+ actor.GetChildAt(0).Unparent();
END_TEST;
}
-#define CHECK_MAP_ELEMENT( xMap, xKey, xType, xPropType, xExpected, xLocation ) \
- { \
- Property::Value* value = xMap->Find( xKey ); \
- DALI_TEST_EQUALS( value==NULL, false, xLocation); \
- if( value != NULL ) \
- { \
- DALI_TEST_EQUALS( value->GetType(), xPropType, xLocation ); \
- xType result; \
- value->Get(result); \
- DALI_TEST_EQUALS( result, xExpected, TEST_LOCATION ); \
- std::ostringstream oss; \
- oss << "Animation element " << xKey << "= " << result << std::endl; \
- tet_printf( oss.str().c_str() ); \
- } \
- else \
- { \
- tet_printf("Can't find map element " xKey "\n"); \
- } \
+#define CHECK_MAP_ELEMENT(xMap, xKey, xType, xPropType, xExpected, xLocation) \
+ { \
+ Property::Value* value = xMap->Find(xKey); \
+ DALI_TEST_EQUALS(value == NULL, false, xLocation); \
+ if(value != NULL) \
+ { \
+ DALI_TEST_EQUALS(value->GetType(), xPropType, xLocation); \
+ xType result; \
+ value->Get(result); \
+ DALI_TEST_EQUALS(result, xExpected, TEST_LOCATION); \
+ std::ostringstream oss; \
+ oss << "Animation element " << xKey << "= " << result << std::endl; \
+ tet_printf(oss.str().c_str()); \
+ } \
+ else \
+ { \
+ tet_printf("Can't find map element " xKey "\n"); \
+ } \
}
-
int UtcDaliBuilderMapping01(void)
{
ToolkitTestApplication application;
"}\n";
Builder builder = Builder::New();
- builder.LoadFromString( json );
+ builder.LoadFromString(json);
Test::TestButton testButton = Test::TestButton::New();
- application.GetScene().Add( testButton );
+ application.GetScene().Add(testButton);
// Render and notify
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( builder.ApplyStyle( "testbutton", testButton ) );
+ DALI_TEST_CHECK(builder.ApplyStyle("testbutton", testButton));
// Now check that it has loaded the transition correctly:
Property::Value transition = testButton.GetProperty(Test::TestButton::Property::PRESS_TRANSITION);
- DALI_TEST_EQUALS( transition.GetType(), Property::ARRAY, TEST_LOCATION );
+ DALI_TEST_EQUALS(transition.GetType(), Property::ARRAY, TEST_LOCATION);
Property::Array* array = transition.GetArray();
- DALI_TEST_EQUALS( array->Size(), 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(array->Size(), 1, TEST_LOCATION);
Property::Value element = array->GetElementAt(0);
- DALI_TEST_CHECK( element.GetType() == Property::MAP );
+ DALI_TEST_CHECK(element.GetType() == Property::MAP);
Property::Map* map = element.GetMap();
CHECK_MAP_ELEMENT(map, "target", std::string, Property::STRING, "unselectedBackgroundRenderer", TEST_LOCATION);
END_TEST;
}
-
int UtcDaliBuilderMappingCycleCheck(void)
{
ToolkitTestApplication application;
"}\n");
Builder builder = Builder::New();
- builder.LoadFromString( json );
+ builder.LoadFromString(json);
Test::TestButton testButton = Test::TestButton::New();
- application.GetScene().Add( testButton );
+ application.GetScene().Add(testButton);
// Render and notify
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( builder.ApplyStyle( "testbutton", testButton ) );
+ DALI_TEST_CHECK(builder.ApplyStyle("testbutton", testButton));
// Now check that it has loaded the transition correctly:
Property::Value transition = testButton.GetProperty(Test::TestButton::Property::PRESS_TRANSITION);
- DALI_TEST_EQUALS( transition.GetType(), Property::ARRAY, TEST_LOCATION );
+ DALI_TEST_EQUALS(transition.GetType(), Property::ARRAY, TEST_LOCATION);
Property::Array* array = transition.GetArray();
- DALI_TEST_EQUALS( array->Size(), 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(array->Size(), 1, TEST_LOCATION);
Property::Value element = array->GetElementAt(0);
- DALI_TEST_CHECK( element.GetType() == Property::MAP );
+ DALI_TEST_CHECK(element.GetType() == Property::MAP);
Property::Map* map = element.GetMap();
CHECK_MAP_ELEMENT(map, "target", std::string, Property::STRING, "", TEST_LOCATION);
std::string json(
"{"
- "\"stage\":"
- "[{"
- "\"type\": \"Layer\","
- "\"maximumSize\": { \"typeCast\":\"vector2\", \"value\":[100,15] },"
- "\"position\": { \"typeCast\":\"vector3\", \"value\":[100,10,1] },"
- "\"color\": { \"typeCast\":\"vector4\", \"value\":[0.5,0.5,0.5,1] },"
- "\"sensitive\": { \"typeCast\":\"boolean\", \"value\":false },"
- "\"orientation\": { \"typeCast\":\"rotation\", \"value\":[10,10,10,10] },"
- "\"colorMode\": { \"typeCast\":\"string\", \"value\":\"USE_OWN_MULTIPLY_PARENT_COLOR\" },"
- "\"clippingBox\": { \"typeCast\":\"rect\", \"value\":[10,10,10,10] },"
- "\"padding\": { \"typeCast\":\"extents\", \"value\":[10,10,10,10] }"
- "}]"
- "}"
- );
+ "\"stage\":"
+ "[{"
+ "\"type\": \"Layer\","
+ "\"maximumSize\": { \"typeCast\":\"vector2\", \"value\":[100,15] },"
+ "\"position\": { \"typeCast\":\"vector3\", \"value\":[100,10,1] },"
+ "\"color\": { \"typeCast\":\"vector4\", \"value\":[0.5,0.5,0.5,1] },"
+ "\"sensitive\": { \"typeCast\":\"boolean\", \"value\":false },"
+ "\"orientation\": { \"typeCast\":\"rotation\", \"value\":[10,10,10,10] },"
+ "\"colorMode\": { \"typeCast\":\"string\", \"value\":\"USE_OWN_MULTIPLY_PARENT_COLOR\" },"
+ "\"clippingBox\": { \"typeCast\":\"rect\", \"value\":[10,10,10,10] },"
+ "\"padding\": { \"typeCast\":\"extents\", \"value\":[10,10,10,10] }"
+ "}]"
+ "}");
Actor rootActor = Actor::New();
- application.GetScene().Add( rootActor );
+ application.GetScene().Add(rootActor);
Builder builder = Builder::New();
- builder.LoadFromString( json );
- builder.AddActors( rootActor );
+ builder.LoadFromString(json);
+ builder.AddActors(rootActor);
application.SendNotification();
application.Render();
- Actor createdActor = rootActor.GetChildAt( 0 );
- DALI_TEST_EQUALS( createdActor.GetProperty< Vector2 >( Actor::Property::MAXIMUM_SIZE ), Vector2(100.0f,15.0f), TEST_LOCATION );
- DALI_TEST_EQUALS( createdActor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(100.0f,10.0f,1.0f), TEST_LOCATION );
- DALI_TEST_EQUALS( createdActor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), Vector4(0.5f,0.5f,0.5f,1.0f), TEST_LOCATION );
- DALI_TEST_EQUALS( createdActor.GetProperty< bool >( Actor::Property::SENSITIVE ), false, TEST_LOCATION );
- DALI_TEST_EQUALS( createdActor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_OWN_MULTIPLY_PARENT_COLOR, TEST_LOCATION );
+ Actor createdActor = rootActor.GetChildAt(0);
+ DALI_TEST_EQUALS(createdActor.GetProperty<Vector2>(Actor::Property::MAXIMUM_SIZE), Vector2(100.0f, 15.0f), TEST_LOCATION);
+ DALI_TEST_EQUALS(createdActor.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(100.0f, 10.0f, 1.0f), TEST_LOCATION);
+ DALI_TEST_EQUALS(createdActor.GetCurrentProperty<Vector4>(Actor::Property::COLOR), Vector4(0.5f, 0.5f, 0.5f, 1.0f), TEST_LOCATION);
+ DALI_TEST_EQUALS(createdActor.GetProperty<bool>(Actor::Property::SENSITIVE), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(createdActor.GetProperty<ColorMode>(Actor::Property::COLOR_MODE), USE_OWN_MULTIPLY_PARENT_COLOR, TEST_LOCATION);
END_TEST;
}
std::string json(
"{"
- "\"stage\":"
- "[{"
- "\"type\": \"BuilderControl\","
- "\"integerProperty\": 10,"
- "\"matrix3Property\": [ 1,2,3,4,5,6,7,8,9 ],"
- "\"matrixProperty\": [ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 ],"
- "\"noneProperty\": 10"
- "}]"
- "}"
- );
+ "\"stage\":"
+ "[{"
+ "\"type\": \"BuilderControl\","
+ "\"integerProperty\": 10,"
+ "\"matrix3Property\": [ 1,2,3,4,5,6,7,8,9 ],"
+ "\"matrixProperty\": [ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 ],"
+ "\"noneProperty\": 10"
+ "}]"
+ "}");
Actor rootActor = Actor::New();
- application.GetScene().Add( rootActor );
+ application.GetScene().Add(rootActor);
Builder builder = Builder::New();
- builder.LoadFromString( json );
- builder.AddActors( rootActor );
+ builder.LoadFromString(json);
+ builder.AddActors(rootActor);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( BuilderControlProperty::gSetPropertyCalledCount, 4, TEST_LOCATION );
+ DALI_TEST_EQUALS(BuilderControlProperty::gSetPropertyCalledCount, 4, TEST_LOCATION);
END_TEST;
}
std::string json(
"{"
- "\"stage\":"
- "[{"
- "\"type\": \"DummyControl\","
- "\"name\": \"I can haz custom Control\""
- "}]"
- "}"
- );
+ "\"stage\":"
+ "[{"
+ "\"type\": \"DummyControl\","
+ "\"name\": \"I can haz custom Control\""
+ "}]"
+ "}");
Actor rootActor = Actor::New();
- application.GetScene().Add( rootActor );
+ application.GetScene().Add(rootActor);
Builder builder = Builder::New();
- builder.LoadFromString( json );
- builder.AddActors( rootActor );
+ builder.LoadFromString(json);
+ builder.AddActors(rootActor);
application.SendNotification();
application.Render();
- Actor customControl = rootActor.FindChildByName( "I can haz custom Control" );
+ Actor customControl = rootActor.FindChildByName("I can haz custom Control");
// Test that we have the correct type of custom control
- DummyControl dummyControl = DummyControl::DownCast( customControl );
- DALI_TEST_CHECK( dummyControl );
- if( dummyControl )
+ DummyControl dummyControl = DummyControl::DownCast(customControl);
+ DALI_TEST_CHECK(dummyControl);
+ if(dummyControl)
{
- DALI_TEST_CHECK( typeid(dummyControl.GetImplementation()) == typeid(DummyControlImpl) );
+ DALI_TEST_CHECK(typeid(dummyControl.GetImplementation()) == typeid(DummyControlImpl));
}
END_TEST;
// JSON with a quit event when the actor is touched
std::string json(
- "{\n"
- "\"stage\":\n"
- "[\n"
- " { \n"
- " \"type\": \"ImageView\",\n"
- " \"name\": \"image\",\n"
- " \"size\": [100,100,1],\n"
- " \"signals\": [{\n"
- " \"name\": \"touched\",\n"
- " \"action\": \"show\",\n"
- " \"parameters\": {\n"
- " \"property1\" : 10,\n"
- " \"property2\" : [1,2],\n"
- " \"property3\" : [1,2,3],\n"
- " \"property4\" : [1,2,3,4]\n"
- " }\n"
- " }]\n"
- " }\n"
- "]\n"
- "}\n"
- );
+ "{\n"
+ "\"stage\":\n"
+ "[\n"
+ " { \n"
+ " \"type\": \"ImageView\",\n"
+ " \"name\": \"image\",\n"
+ " \"size\": [100,100,1],\n"
+ " \"signals\": [{\n"
+ " \"name\": \"touched\",\n"
+ " \"action\": \"show\",\n"
+ " \"parameters\": {\n"
+ " \"property1\" : 10,\n"
+ " \"property2\" : [1,2],\n"
+ " \"property3\" : [1,2,3],\n"
+ " \"property4\" : [1,2,3,4]\n"
+ " }\n"
+ " }]\n"
+ " }\n"
+ "]\n"
+ "}\n");
Builder builder = Builder::New();
- builder.LoadFromString( json );
- builder.AddActors( application.GetScene().GetRootLayer() );
+ builder.LoadFromString(json);
+ builder.AddActors(application.GetScene().GetRootLayer());
- DALI_TEST_CHECK( true ); // For Coverage
+ DALI_TEST_CHECK(true); // For Coverage
END_TEST;
}
// JSON with a quit event when the actor is touched
std::string json(
- "{\n"
- " \"config\":\n"
- " {\n"
- " \"alwaysShowFocus\":true\n"
- " }\n"
- "}\n"
- );
+ "{\n"
+ " \"config\":\n"
+ " {\n"
+ " \"alwaysShowFocus\":true\n"
+ " }\n"
+ "}\n");
Builder builder = Builder::New();
- builder.LoadFromString( json );
+ builder.LoadFromString(json);
Property::Map map = builder.GetConfigurations();
- Dali::Property::Value* pValue = map.Find( "alwaysShowFocus" );
+ Dali::Property::Value* pValue = map.Find("alwaysShowFocus");
- DALI_TEST_CHECK( pValue );
+ DALI_TEST_CHECK(pValue);
bool value = pValue->Get<bool>();
- DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK(value);
END_TEST;
}
-
int UtcDaliBase64EncodingP(void)
{
- std::vector<uint32_t> data = { 0, 1, 2, 3, 4, 5, std::numeric_limits<uint32_t>::min(), std::numeric_limits<uint32_t>::max() };
+ std::vector<uint32_t> data = {0, 1, 2, 3, 4, 5, std::numeric_limits<uint32_t>::min(), std::numeric_limits<uint32_t>::max()};
Property::Value value;
- EncodeBase64PropertyData( value, data );
+ EncodeBase64PropertyData(value, data);
std::cout << "Max uint32_t:" << std::numeric_limits<uint32_t>::max() << std::endl;
std::cout << "Input data: ";
- std::ostream_iterator<uint32_t> out_it (std::cout,", ");
- std::copy ( data.begin(), data.end(), out_it );
+ std::ostream_iterator<uint32_t> out_it(std::cout, ", ");
+ std::copy(data.begin(), data.end(), out_it);
std::cout << std::endl;
std::string output;
- DALI_TEST_CHECK( value.Get( output ) );
- DALI_TEST_EQUALS( output, "AAAAAAEAAAACAAAAAwAAAAQAAAAFAAAAAAAAAP////8", TEST_LOCATION );
+ DALI_TEST_CHECK(value.Get(output));
+ DALI_TEST_EQUALS(output, "AAAAAAEAAAACAAAAAwAAAAQAAAAFAAAAAAAAAP////8", TEST_LOCATION);
std::cout << "Output data: " << output << std::endl;
int UtcDaliBase64EncodingN(void)
{
- tet_infoline( "Test encoding an empty vector returns empty string" );
+ tet_infoline("Test encoding an empty vector returns empty string");
std::vector<uint32_t> data;
Property::Value value;
- EncodeBase64PropertyData( value, data );
+ EncodeBase64PropertyData(value, data);
std::string output;
- DALI_TEST_CHECK( value.Get( output ) );
- DALI_TEST_EQUALS( output.empty(), true, TEST_LOCATION );
+ DALI_TEST_CHECK(value.Get(output));
+ DALI_TEST_EQUALS(output.empty(), true, TEST_LOCATION);
END_TEST;
}
-template <typename T>
-int b64l(std::vector<T>&data)
+template<typename T>
+int b64l(std::vector<T>& data)
{
- auto lengthInBytes = 4*data.size();
- return ceil( lengthInBytes * 1.33333f );
+ auto lengthInBytes = 4 * data.size();
+ return ceil(lengthInBytes * 1.33333f);
}
int UtcDaliBase64EncodingP02(void)
{
- tet_infoline( "Test encoding vectors of lengths m .. m+4 encode and decode back to the same length vectors" );
+ tet_infoline("Test encoding vectors of lengths m .. m+4 encode and decode back to the same length vectors");
std::vector<uint32_t> testData;
- for(int i=0; i<8; ++i ) // 8 chosen to stay within single string output
+ for(int i = 0; i < 8; ++i) // 8 chosen to stay within single string output
{
testData.push_back(i);
}
Property::Value value;
- EncodeBase64PropertyData( value, testData );
+ EncodeBase64PropertyData(value, testData);
std::string output;
- DALI_TEST_CHECK( value.Get( output ) );
- DALI_TEST_EQUALS( output.empty(), false, TEST_LOCATION);
- DALI_TEST_EQUALS( output.length(), b64l(testData), TEST_LOCATION );
+ DALI_TEST_CHECK(value.Get(output));
+ DALI_TEST_EQUALS(output.empty(), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(output.length(), b64l(testData), TEST_LOCATION);
std::vector<uint32_t> outData;
- DecodeBase64PropertyData( value, outData );
- DALI_TEST_EQUALS( testData.size(), outData.size(), TEST_LOCATION );
- DALI_TEST_EQUALS( std::equal( testData.begin(), testData.end(), outData.begin()), true, TEST_LOCATION );
+ DecodeBase64PropertyData(value, outData);
+ DALI_TEST_EQUALS(testData.size(), outData.size(), TEST_LOCATION);
+ DALI_TEST_EQUALS(std::equal(testData.begin(), testData.end(), outData.begin()), true, TEST_LOCATION);
// n+1
- testData.push_back( 12345 );
- EncodeBase64PropertyData( value, testData );
+ testData.push_back(12345);
+ EncodeBase64PropertyData(value, testData);
- DALI_TEST_CHECK( value.Get( output ) );
- DALI_TEST_EQUALS( output.empty(), false, TEST_LOCATION);
- DALI_TEST_EQUALS( output.length(), b64l(testData), TEST_LOCATION );
+ DALI_TEST_CHECK(value.Get(output));
+ DALI_TEST_EQUALS(output.empty(), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(output.length(), b64l(testData), TEST_LOCATION);
outData.clear();
- DecodeBase64PropertyData( value, outData );
- DALI_TEST_EQUALS( testData.size(), outData.size(), TEST_LOCATION );
- DALI_TEST_EQUALS( std::equal( testData.begin(), testData.end(), outData.begin()), true, TEST_LOCATION );
+ DecodeBase64PropertyData(value, outData);
+ DALI_TEST_EQUALS(testData.size(), outData.size(), TEST_LOCATION);
+ DALI_TEST_EQUALS(std::equal(testData.begin(), testData.end(), outData.begin()), true, TEST_LOCATION);
// n+2
- testData.push_back( 67890 );
- EncodeBase64PropertyData( value, testData );
+ testData.push_back(67890);
+ EncodeBase64PropertyData(value, testData);
- DALI_TEST_CHECK( value.Get( output ) );
- DALI_TEST_EQUALS( output.empty(), false, TEST_LOCATION);
- DALI_TEST_EQUALS( output.length(), b64l(testData), TEST_LOCATION );
+ DALI_TEST_CHECK(value.Get(output));
+ DALI_TEST_EQUALS(output.empty(), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(output.length(), b64l(testData), TEST_LOCATION);
outData.clear();
- DecodeBase64PropertyData( value, outData );
- DALI_TEST_EQUALS( testData.size(), outData.size(), TEST_LOCATION );
- DALI_TEST_EQUALS( std::equal( testData.begin(), testData.end(), outData.begin()), true, TEST_LOCATION );
+ DecodeBase64PropertyData(value, outData);
+ DALI_TEST_EQUALS(testData.size(), outData.size(), TEST_LOCATION);
+ DALI_TEST_EQUALS(std::equal(testData.begin(), testData.end(), outData.begin()), true, TEST_LOCATION);
// n+3
- testData.push_back( -1 );
- EncodeBase64PropertyData( value, testData );
+ testData.push_back(-1);
+ EncodeBase64PropertyData(value, testData);
- DALI_TEST_CHECK( value.Get( output ) );
- DALI_TEST_EQUALS( output.empty(), false, TEST_LOCATION);
- DALI_TEST_EQUALS( output.length(), b64l(testData), TEST_LOCATION );
+ DALI_TEST_CHECK(value.Get(output));
+ DALI_TEST_EQUALS(output.empty(), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(output.length(), b64l(testData), TEST_LOCATION);
outData.clear();
- DecodeBase64PropertyData( value, outData );
- DALI_TEST_EQUALS( testData.size(), outData.size(), TEST_LOCATION );
- DALI_TEST_EQUALS( std::equal( testData.begin(), testData.end(), outData.begin()), true, TEST_LOCATION );
-
+ DecodeBase64PropertyData(value, outData);
+ DALI_TEST_EQUALS(testData.size(), outData.size(), TEST_LOCATION);
+ DALI_TEST_EQUALS(std::equal(testData.begin(), testData.end(), outData.begin()), true, TEST_LOCATION);
END_TEST;
}
-
int UtcDaliBase64EncodingP03(void)
{
- tet_infoline( "Test encoding a vector of length 12 has output within single string" );
+ tet_infoline("Test encoding a vector of length 12 has output within single string");
std::vector<uint32_t> testData;
- for(int i=0; i<12; ++i )
+ for(int i = 0; i < 12; ++i)
{
testData.push_back(i);
}
Property::Value value;
- EncodeBase64PropertyData( value, testData );
+ EncodeBase64PropertyData(value, testData);
std::string output;
- DALI_TEST_CHECK( value.Get( output ) );
- DALI_TEST_EQUALS( output.empty(), false, TEST_LOCATION);
- DALI_TEST_EQUALS( output.length(), b64l(testData), TEST_LOCATION );
+ DALI_TEST_CHECK(value.Get(output));
+ DALI_TEST_EQUALS(output.empty(), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(output.length(), b64l(testData), TEST_LOCATION);
std::vector<uint32_t> outData;
- DecodeBase64PropertyData( value, outData );
- DALI_TEST_EQUALS( testData.size(), outData.size(), TEST_LOCATION );
+ DecodeBase64PropertyData(value, outData);
+ DALI_TEST_EQUALS(testData.size(), outData.size(), TEST_LOCATION);
END_TEST;
}
-
int UtcDaliBase64EncodingP04(void)
{
- tet_infoline( "Test encoding a vector of length 13 has output split over 2 strings" );
+ tet_infoline("Test encoding a vector of length 13 has output split over 2 strings");
std::vector<uint32_t> testData;
- for(int i=0; i<13; ++i )
+ for(int i = 0; i < 13; ++i)
{
testData.push_back(i);
}
Property::Value value;
- EncodeBase64PropertyData( value, testData );
+ EncodeBase64PropertyData(value, testData);
auto array = value.GetArray();
- DALI_TEST_CHECK( array );
+ DALI_TEST_CHECK(array);
- DALI_TEST_EQUALS( array->Count(), 2, TEST_LOCATION );
+ DALI_TEST_EQUALS(array->Count(), 2, TEST_LOCATION);
std::vector<uint32_t> outData;
- DecodeBase64PropertyData( value, outData );
- DALI_TEST_EQUALS( testData.size(), outData.size(), TEST_LOCATION );
+ DecodeBase64PropertyData(value, outData);
+ DALI_TEST_EQUALS(testData.size(), outData.size(), TEST_LOCATION);
END_TEST;
}
-
int UtcDaliBase64EncodingP05(void)
{
- tet_infoline( "Test encoding a vector of length 24 has output split over 2 strings" );
+ tet_infoline("Test encoding a vector of length 24 has output split over 2 strings");
std::vector<uint32_t> testData;
- for(int i=0; i<24; ++i )
+ for(int i = 0; i < 24; ++i)
{
testData.push_back(i);
}
Property::Value value;
- EncodeBase64PropertyData( value, testData );
+ EncodeBase64PropertyData(value, testData);
auto array = value.GetArray();
- DALI_TEST_CHECK( array );
+ DALI_TEST_CHECK(array);
- DALI_TEST_EQUALS( array->Count(), 2, TEST_LOCATION );
+ DALI_TEST_EQUALS(array->Count(), 2, TEST_LOCATION);
std::vector<uint32_t> outData;
- DecodeBase64PropertyData( value, outData );
- DALI_TEST_EQUALS( testData.size(), outData.size(), TEST_LOCATION );
+ DecodeBase64PropertyData(value, outData);
+ DALI_TEST_EQUALS(testData.size(), outData.size(), TEST_LOCATION);
END_TEST;
}
-
int UtcDaliBase64EncodingP06(void)
{
- tet_infoline( "Test encoding a vector of arbitrary length decodes OK." );
+ tet_infoline("Test encoding a vector of arbitrary length decodes OK.");
std::vector<uint32_t> testData;
- for(int i=0; i<97; ++i )
+ for(int i = 0; i < 97; ++i)
{
testData.push_back(i);
}
Property::Value value;
- EncodeBase64PropertyData( value, testData );
+ EncodeBase64PropertyData(value, testData);
auto array = value.GetArray();
- DALI_TEST_CHECK( array );
+ DALI_TEST_CHECK(array);
std::vector<uint32_t> outData;
- DecodeBase64PropertyData( value, outData );
- DALI_TEST_EQUALS( testData.size(), outData.size(), TEST_LOCATION );
+ DecodeBase64PropertyData(value, outData);
+ DALI_TEST_EQUALS(testData.size(), outData.size(), TEST_LOCATION);
END_TEST;
}
-
int UtcDaliBase64DecodingN01(void)
{
- tet_infoline( "Test decoding empty string results in empty data" );
+ tet_infoline("Test decoding empty string results in empty data");
- Property::Value value("");
+ Property::Value value("");
std::vector<uint32_t> outputData;
- DecodeBase64PropertyData( value, outputData);
- DALI_TEST_EQUALS( outputData.size(), 0, TEST_LOCATION );
+ DecodeBase64PropertyData(value, outputData);
+ DALI_TEST_EQUALS(outputData.size(), 0, TEST_LOCATION);
END_TEST;
}
-
int UtcDaliBase64DecodingN02(void)
{
- tet_infoline( "Test decoding array with non-string values results in empty data" );
+ tet_infoline("Test decoding array with non-string values results in empty data");
Property::Array array;
array.Resize(2);
Property::Value value(array);
std::vector<uint32_t> outputData;
- DecodeBase64PropertyData( value, outputData);
- DALI_TEST_EQUALS( outputData.size(), 0, TEST_LOCATION );
+ DecodeBase64PropertyData(value, outputData);
+ DALI_TEST_EQUALS(outputData.size(), 0, TEST_LOCATION);
END_TEST;
}
int UtcDaliBase64DecodingP01(void)
{
- tet_infoline( "Test decoding string of known data gives expected result");
+ tet_infoline("Test decoding string of known data gives expected result");
- std::string testInput("//////7+/v4DAgEA");
- std::vector<uint32_t> expectedResults = { 0xffffffff, 0xfefefefe, 0x00010203 };
+ std::string testInput("//////7+/v4DAgEA");
+ std::vector<uint32_t> expectedResults = {0xffffffff, 0xfefefefe, 0x00010203};
std::vector<uint32_t> outputData;
DecodeBase64PropertyData(Property::Value(testInput), outputData);
- DALI_TEST_EQUALS( std::equal( expectedResults.begin(), expectedResults.end(), outputData.begin() ), true,
- TEST_LOCATION );
+ DALI_TEST_EQUALS(std::equal(expectedResults.begin(), expectedResults.end(), outputData.begin()), true, TEST_LOCATION);
END_TEST;
}
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
#include <stdlib.h>
+#include <iostream>
// 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-test-utils/toolkit-timer.h"
-#include <dali.h>
#include <dali-toolkit/dali-toolkit.h>
+#include <dali.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
using namespace Dali;
using namespace Toolkit;
-
void utc_dali_toolkit_button_startup(void)
{
test_return_value = TET_UNDEF;
namespace
{
-static bool gIsCalledButtonCallback = false;
+static bool gIsCalledButtonCallback = false;
static bool gIsCalledChildButtonCallback = false;
-static bool ButtonCallback( Button button )
+static bool ButtonCallback(Button button)
{
gIsCalledButtonCallback = true;
return false;
}
-static bool ChildButtonCallback( Button button )
+static bool ChildButtonCallback(Button button)
{
gIsCalledChildButtonCallback = true;
return false;
}
-static std::string GetButtonText( Button button )
+static std::string GetButtonText(Button button)
{
- Property::Value value = button.GetProperty( Toolkit::Button::Property::LABEL );
+ Property::Value value = button.GetProperty(Toolkit::Button::Property::LABEL);
- Property::Map *labelProperty = value.GetMap();
+ Property::Map* labelProperty = value.GetMap();
std::string textLabel;
- if ( labelProperty )
+ if(labelProperty)
{
- Property::Value* value = labelProperty->Find( Toolkit::TextVisual::Property::TEXT );
- value->Get( textLabel );
+ Property::Value* value = labelProperty->Find(Toolkit::TextVisual::Property::TEXT);
+ value->Get(textLabel);
}
return textLabel;
struct CallbackFunctor
{
CallbackFunctor(bool* callbackFlag)
- : mCallbackFlag( callbackFlag )
+ : mCallbackFlag(callbackFlag)
{
}
Dali::Integration::Point GetPointDownInside()
{
Dali::Integration::Point point;
- point.SetState( PointState::DOWN );
- point.SetScreenPosition( Vector2( 240, 400 ) );
+ point.SetState(PointState::DOWN);
+ point.SetScreenPosition(Vector2(240, 400));
return point;
}
Dali::Integration::Point GetPointUpInside()
{
Dali::Integration::Point point;
- point.SetState( PointState::UP );
- point.SetScreenPosition( Vector2( 240, 400 ) );
+ point.SetState(PointState::UP);
+ point.SetScreenPosition(Vector2(240, 400));
return point;
}
Dali::Integration::Point GetPointLeave()
{
Dali::Integration::Point point;
- point.SetState( PointState::LEAVE );
- point.SetScreenPosition( Vector2( 240, 400 ) );
+ point.SetState(PointState::LEAVE);
+ point.SetScreenPosition(Vector2(240, 400));
return point;
}
Dali::Integration::Point GetPointEnter()
{
Dali::Integration::Point point;
- point.SetState( PointState::MOTION );
- point.SetScreenPosition( Vector2( 240, 400 ) );
+ point.SetState(PointState::MOTION);
+ point.SetScreenPosition(Vector2(240, 400));
return point;
}
Dali::Integration::Point GetPointDownOutside()
{
Dali::Integration::Point point;
- point.SetState( PointState::DOWN );
- point.SetScreenPosition( Vector2( 10, 10 ) );
+ point.SetState(PointState::DOWN);
+ point.SetScreenPosition(Vector2(10, 10));
return point;
}
Dali::Integration::Point GetPointUpOutside()
{
Dali::Integration::Point point;
- point.SetState( PointState::UP );
- point.SetScreenPosition( Vector2( 10, 10 ) );
+ point.SetState(PointState::UP);
+ point.SetScreenPosition(Vector2(10, 10));
return point;
}
Button button;
- DALI_TEST_CHECK( !button );
+ DALI_TEST_CHECK(!button);
END_TEST;
}
// Initialize an object, ref count == 1
Button button = PushButton::New();
- Button copy( button );
- DALI_TEST_CHECK( copy );
+ Button copy(button);
+ DALI_TEST_CHECK(copy);
END_TEST;
}
ToolkitTestApplication application;
Button button = PushButton::New();
- DALI_TEST_EQUALS( 1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), false , TEST_LOCATION );
- button.SetProperty( Button::Property::TOGGLABLE, true );
- DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), true , TEST_LOCATION );
+ DALI_TEST_EQUALS(1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_EQUALS(button.GetProperty<bool>(Button::Property::TOGGLABLE), false, TEST_LOCATION);
+ button.SetProperty(Button::Property::TOGGLABLE, true);
+ DALI_TEST_EQUALS(button.GetProperty<bool>(Button::Property::TOGGLABLE), true, TEST_LOCATION);
- Button moved = std::move( button );
- DALI_TEST_CHECK( moved );
- DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_EQUALS( moved.GetProperty<bool>( Button::Property::TOGGLABLE ), true , TEST_LOCATION );
- DALI_TEST_CHECK( !button );
+ Button moved = std::move(button);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_EQUALS(moved.GetProperty<bool>(Button::Property::TOGGLABLE), true, TEST_LOCATION);
+ DALI_TEST_CHECK(!button);
END_TEST;
}
Button button = PushButton::New();
- Button copy( button );
- DALI_TEST_CHECK( copy );
+ Button copy(button);
+ DALI_TEST_CHECK(copy);
- DALI_TEST_CHECK( button == copy );
+ DALI_TEST_CHECK(button == copy);
END_TEST;
}
ToolkitTestApplication application;
Button button = PushButton::New();
- DALI_TEST_EQUALS( 1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), false , TEST_LOCATION );
- button.SetProperty( Button::Property::TOGGLABLE, true );
- DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), true , TEST_LOCATION );
+ DALI_TEST_EQUALS(1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_EQUALS(button.GetProperty<bool>(Button::Property::TOGGLABLE), false, TEST_LOCATION);
+ button.SetProperty(Button::Property::TOGGLABLE, true);
+ DALI_TEST_EQUALS(button.GetProperty<bool>(Button::Property::TOGGLABLE), true, TEST_LOCATION);
Button moved;
- moved = std::move( button );
- DALI_TEST_CHECK( moved );
- DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_EQUALS( moved.GetProperty<bool>( Button::Property::TOGGLABLE ), true , TEST_LOCATION );
- DALI_TEST_CHECK( !button );
+ moved = std::move(button);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_EQUALS(moved.GetProperty<bool>(Button::Property::TOGGLABLE), true, TEST_LOCATION);
+ DALI_TEST_CHECK(!button);
END_TEST;
}
BaseHandle object(button);
- Button button2 = Button::DownCast( object );
+ Button button2 = Button::DownCast(object);
DALI_TEST_CHECK(button2);
- Button button3 = DownCast< Button >(object);
+ Button button3 = DownCast<Button>(object);
DALI_TEST_CHECK(button3);
END_TEST;
}
BaseHandle unInitializedObject;
- Button button1 = Button::DownCast( unInitializedObject );
- DALI_TEST_CHECK( !button1 );
+ Button button1 = Button::DownCast(unInitializedObject);
+ DALI_TEST_CHECK(!button1);
- Button button2 = DownCast< Button >( unInitializedObject );
- DALI_TEST_CHECK( !button2 );
+ Button button2 = DownCast<Button>(unInitializedObject);
+ DALI_TEST_CHECK(!button2);
END_TEST;
}
Button button = PushButton::New();
+ button.SetProperty(button.GetPropertyIndex("disabled"), true);
- button.SetProperty( button.GetPropertyIndex("disabled"), true );
-
- DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("disabled")), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(button.GetProperty<bool>(button.GetPropertyIndex("disabled")), true, TEST_LOCATION);
- button.SetProperty( button.GetPropertyIndex("disabled"), false );
+ button.SetProperty(button.GetPropertyIndex("disabled"), false);
- DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("disabled")), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(button.GetProperty<bool>(button.GetPropertyIndex("disabled")), false, TEST_LOCATION);
- button.SetProperty( button.GetPropertyIndex("disabled"), true );
+ button.SetProperty(button.GetPropertyIndex("disabled"), true);
- DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("disabled")), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(button.GetProperty<bool>(button.GetPropertyIndex("disabled")), true, TEST_LOCATION);
- button.SetProperty( button.GetPropertyIndex("disabled"), false );
+ button.SetProperty(button.GetPropertyIndex("disabled"), false);
- DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("disabled")), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(button.GetProperty<bool>(button.GetPropertyIndex("disabled")), false, TEST_LOCATION);
END_TEST;
}
bool SELECTED = true;
- button.SetProperty( Button::Property::TOGGLABLE, true);
- button.SetProperty( Button::Property::SELECTED, SELECTED );
+ button.SetProperty(Button::Property::TOGGLABLE, true);
+ button.SetProperty(Button::Property::SELECTED, SELECTED);
- button.SetProperty( Button::Property::DISABLED, true);
+ button.SetProperty(Button::Property::DISABLED, true);
tet_infoline("Set button to SELECTED = false whilst disabled, should not change to false\n");
- button.SetProperty( Button::Property::SELECTED, !SELECTED );
+ button.SetProperty(Button::Property::SELECTED, !SELECTED);
- bool isSelected = button.GetProperty<bool>( Button::Property::SELECTED ) ;
+ bool isSelected = button.GetProperty<bool>(Button::Property::SELECTED);
- DALI_TEST_EQUALS( isSelected, SELECTED , TEST_LOCATION );
+ DALI_TEST_EQUALS(isSelected, SELECTED, TEST_LOCATION);
END_TEST;
}
bool SELECTED = true;
- button.SetProperty( Button::Property::TOGGLABLE, true );
- button.SetProperty( Button::Property::SELECTED, SELECTED );
- button.SetProperty( Button::Property::DISABLED, true );
+ button.SetProperty(Button::Property::TOGGLABLE, true);
+ button.SetProperty(Button::Property::SELECTED, SELECTED);
+ button.SetProperty(Button::Property::DISABLED, true);
- bool isSelected = button.GetProperty<bool>( Button::Property::SELECTED );
- DALI_TEST_EQUALS( isSelected, SELECTED , TEST_LOCATION );
+ bool isSelected = button.GetProperty<bool>(Button::Property::SELECTED);
+ DALI_TEST_EQUALS(isSelected, SELECTED, TEST_LOCATION);
tet_infoline("Set button to DISABLED = false whilst disabled and then set to unselected\n");
- button.SetProperty( Button::Property::DISABLED, false);
- button.SetProperty( Button::Property::SELECTED, !SELECTED );
+ button.SetProperty(Button::Property::DISABLED, false);
+ button.SetProperty(Button::Property::SELECTED, !SELECTED);
- isSelected = button.GetProperty<bool>( Button::Property::SELECTED );
- DALI_TEST_EQUALS( isSelected, !SELECTED , TEST_LOCATION );
+ isSelected = button.GetProperty<bool>(Button::Property::SELECTED);
+ DALI_TEST_EQUALS(isSelected, !SELECTED, TEST_LOCATION);
END_TEST;
}
tet_infoline(" UtcDaliPushButtonPropertyGetLabelAlignment\n");
Button button = PushButton::New();
- button.SetProperty( Toolkit::DevelButton::Property::LABEL_RELATIVE_ALIGNMENT, "END" );
- DALI_TEST_EQUALS( button.GetProperty<std::string>( Toolkit::DevelButton::Property::LABEL_RELATIVE_ALIGNMENT ), "END", TEST_LOCATION );
+ button.SetProperty(Toolkit::DevelButton::Property::LABEL_RELATIVE_ALIGNMENT, "END");
+ DALI_TEST_EQUALS(button.GetProperty<std::string>(Toolkit::DevelButton::Property::LABEL_RELATIVE_ALIGNMENT), "END", TEST_LOCATION);
END_TEST;
}
Button button = PushButton::New();
- button.SetProperty( Button::Property::DISABLED, true);
+ button.SetProperty(Button::Property::DISABLED, true);
- DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::DISABLED ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(button.GetProperty<bool>(Button::Property::DISABLED), true, TEST_LOCATION);
- button.SetProperty( Button::Property::DISABLED, false);
+ button.SetProperty(Button::Property::DISABLED, false);
- DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::DISABLED ), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(button.GetProperty<bool>(Button::Property::DISABLED), false, TEST_LOCATION);
END_TEST;
}
Button button = PushButton::New();
- button.SetProperty( button.GetPropertyIndex("autoRepeating"), true );
+ button.SetProperty(button.GetPropertyIndex("autoRepeating"), true);
- DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("autoRepeating")), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(button.GetProperty<bool>(button.GetPropertyIndex("autoRepeating")), true, TEST_LOCATION);
- button.SetProperty( button.GetPropertyIndex("autoRepeating"), false );
+ button.SetProperty(button.GetPropertyIndex("autoRepeating"), false);
- DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("autoRepeating")), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(button.GetProperty<bool>(button.GetPropertyIndex("autoRepeating")), false, TEST_LOCATION);
- button.SetProperty( button.GetPropertyIndex("autoRepeating"), true );
+ button.SetProperty(button.GetPropertyIndex("autoRepeating"), true);
- DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("autoRepeating")), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(button.GetProperty<bool>(button.GetPropertyIndex("autoRepeating")), true, TEST_LOCATION);
END_TEST;
}
Button button = PushButton::New();
- button.SetProperty( Button::Property::AUTO_REPEATING, true);
+ button.SetProperty(Button::Property::AUTO_REPEATING, true);
- DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::AUTO_REPEATING ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(button.GetProperty<bool>(Button::Property::AUTO_REPEATING), true, TEST_LOCATION);
- button.SetProperty( Button::Property::AUTO_REPEATING, false);
+ button.SetProperty(Button::Property::AUTO_REPEATING, false);
- DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::AUTO_REPEATING ), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(button.GetProperty<bool>(Button::Property::AUTO_REPEATING), false, TEST_LOCATION);
END_TEST;
}
const float AUTO_REPEATING_DELAY = 0.15f;
Button button = PushButton::New();
- button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- button.SetProperty( Actor::Property::POSITION, Vector2( 240, 400 ));
- button.SetProperty( Actor::Property::SIZE, Vector2( 100, 100 ) );
- application.GetScene().Add( button );
+ button.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ button.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ button.SetProperty(Actor::Property::POSITION, Vector2(240, 400));
+ button.SetProperty(Actor::Property::SIZE, Vector2(100, 100));
+ application.GetScene().Add(button);
application.SendNotification();
application.Render();
- button.SetProperty( Toolkit::Button::Property::AUTO_REPEATING, true );
- button.SetProperty( Toolkit::Button::Property::INITIAL_AUTO_REPEATING_DELAY, AUTO_REPEATING_DELAY );
+ button.SetProperty(Toolkit::Button::Property::AUTO_REPEATING, true);
+ button.SetProperty(Toolkit::Button::Property::INITIAL_AUTO_REPEATING_DELAY, AUTO_REPEATING_DELAY);
// connect to its touch signal
ConnectionTracker* testTracker = new ConnectionTracker();
- button.PressedSignal().Connect( &ButtonCallback );
- button.ClickedSignal().Connect( &ButtonCallback );
+ button.PressedSignal().Connect(&ButtonCallback);
+ button.ClickedSignal().Connect(&ButtonCallback);
bool clickedSignal = false;
bool pressedSignal = false;
- button.ConnectSignal( testTracker, "pressed", CallbackFunctor(&pressedSignal) );
- button.ConnectSignal( testTracker, "clicked", CallbackFunctor(&clickedSignal) );
+ button.ConnectSignal(testTracker, "pressed", CallbackFunctor(&pressedSignal));
+ button.ConnectSignal(testTracker, "clicked", CallbackFunctor(&clickedSignal));
Dali::Integration::TouchEvent event;
// Touch point down and up inside the button.
gIsCalledButtonCallback = false;
- event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointDownInside() );
- application.ProcessEvent( event );
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint(GetPointDownInside());
+ application.ProcessEvent(event);
- DALI_TEST_EQUALS( gIsCalledButtonCallback, true, TEST_LOCATION );
- DALI_TEST_EQUALS( pressedSignal, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gIsCalledButtonCallback, true, TEST_LOCATION);
+ DALI_TEST_EQUALS(pressedSignal, true, TEST_LOCATION);
tet_infoline("Consume first clicked signal then wait\n");
gIsCalledButtonCallback = false;
- Dali::Timer timer = Timer::New( AUTO_REPEATING_DELAY );
+ Dali::Timer timer = Timer::New(AUTO_REPEATING_DELAY);
timer.MockEmitSignal();
- application.Wait( AUTO_REPEATING_DELAY*2 );
- DALI_TEST_EQUALS( clickedSignal, true, TEST_LOCATION );
+ application.Wait(AUTO_REPEATING_DELAY * 2);
+ DALI_TEST_EQUALS(clickedSignal, true, TEST_LOCATION);
tet_infoline("Check gIsCalledButtonCallback was called again after last consumption of it.\n");
- DALI_TEST_EQUALS( gIsCalledButtonCallback, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gIsCalledButtonCallback, true, TEST_LOCATION);
gIsCalledButtonCallback = false;
- event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointUpInside() );
- application.ProcessEvent( event );
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint(GetPointUpInside());
+ application.ProcessEvent(event);
- DALI_TEST_EQUALS( gIsCalledButtonCallback, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gIsCalledButtonCallback, true, TEST_LOCATION);
END_TEST;
}
Button button = PushButton::New();
- button.SetProperty( button.GetPropertyIndex("initialAutoRepeatingDelay"), 0.5f );
+ button.SetProperty(button.GetPropertyIndex("initialAutoRepeatingDelay"), 0.5f);
- DALI_TEST_EQUALS( button.GetProperty<float>( button.GetPropertyIndex("initialAutoRepeatingDelay")), 0.5f, TEST_LOCATION );
+ DALI_TEST_EQUALS(button.GetProperty<float>(button.GetPropertyIndex("initialAutoRepeatingDelay")), 0.5f, TEST_LOCATION);
- button.SetProperty( button.GetPropertyIndex("initialAutoRepeatingDelay"), 0.2f );
+ button.SetProperty(button.GetPropertyIndex("initialAutoRepeatingDelay"), 0.2f);
- DALI_TEST_EQUALS( button.GetProperty<float>( button.GetPropertyIndex("initialAutoRepeatingDelay")), 0.2f, TEST_LOCATION );
+ DALI_TEST_EQUALS(button.GetProperty<float>(button.GetPropertyIndex("initialAutoRepeatingDelay")), 0.2f, TEST_LOCATION);
END_TEST;
}
Button button = PushButton::New();
- button.SetProperty( button.GetPropertyIndex("nextAutoRepeatingDelay"), 0.5f );
+ button.SetProperty(button.GetPropertyIndex("nextAutoRepeatingDelay"), 0.5f);
- DALI_TEST_EQUALS( button.GetProperty<float>( button.GetPropertyIndex("nextAutoRepeatingDelay")), 0.5f, TEST_LOCATION );
+ DALI_TEST_EQUALS(button.GetProperty<float>(button.GetPropertyIndex("nextAutoRepeatingDelay")), 0.5f, TEST_LOCATION);
- button.SetProperty( button.GetPropertyIndex("nextAutoRepeatingDelay"), 0.2f );
+ button.SetProperty(button.GetPropertyIndex("nextAutoRepeatingDelay"), 0.2f);
- DALI_TEST_EQUALS( button.GetProperty<float>( button.GetPropertyIndex("nextAutoRepeatingDelay")), 0.2f, TEST_LOCATION );
+ DALI_TEST_EQUALS(button.GetProperty<float>(button.GetPropertyIndex("nextAutoRepeatingDelay")), 0.2f, TEST_LOCATION);
END_TEST;
}
Button button = PushButton::New();
- button.SetProperty( button.GetPropertyIndex("togglable"), true );
+ button.SetProperty(button.GetPropertyIndex("togglable"), true);
- DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("togglable")), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(button.GetProperty<bool>(button.GetPropertyIndex("togglable")), true, TEST_LOCATION);
- button.SetProperty( button.GetPropertyIndex("togglable"), false );
+ button.SetProperty(button.GetPropertyIndex("togglable"), false);
- DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("togglable")), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(button.GetProperty<bool>(button.GetPropertyIndex("togglable")), false, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
Button button = PushButton::New();
- button.SetProperty( button.GetPropertyIndex("togglable"), true );
+ button.SetProperty(button.GetPropertyIndex("togglable"), true);
- button.SetProperty( button.GetPropertyIndex("selected"), true );
+ button.SetProperty(button.GetPropertyIndex("selected"), true);
- DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("selected")), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(button.GetProperty<bool>(button.GetPropertyIndex("selected")), true, TEST_LOCATION);
- button.SetProperty( button.GetPropertyIndex("selected"), false );
+ button.SetProperty(button.GetPropertyIndex("selected"), false);
- DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("selected")), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(button.GetProperty<bool>(button.GetPropertyIndex("selected")), false, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
Button button = PushButton::New();
- button.SetProperty( Toolkit::Button::Property::LABEL,
- Property::Map().Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT )
- .Add( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f )
- .Add( Toolkit::TextVisual::Property::TEXT, "Button Label")
- );
+ button.SetProperty(Toolkit::Button::Property::LABEL,
+ Property::Map().Add(Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT).Add(Toolkit::TextVisual::Property::POINT_SIZE, 15.0f).Add(Toolkit::TextVisual::Property::TEXT, "Button Label"));
- DALI_TEST_EQUALS( GetButtonText( button ), "Button Label", TEST_LOCATION );
+ DALI_TEST_EQUALS(GetButtonText(button), "Button Label", TEST_LOCATION);
END_TEST;
}
Property::Map textVisualMapInitial;
textVisualMapInitial["visualType"] = "TEXT";
- textVisualMapInitial["pointSize"] = 15.0f;
- textVisualMapInitial["text"] = "button label initial";
+ textVisualMapInitial["pointSize"] = 15.0f;
+ textVisualMapInitial["text"] = "button label initial";
- button.SetProperty( Button::Property::LABEL, textVisualMapInitial );
+ button.SetProperty(Button::Property::LABEL, textVisualMapInitial);
- DALI_TEST_EQUALS( GetButtonText( button ), "button label initial", TEST_LOCATION );
+ DALI_TEST_EQUALS(GetButtonText(button), "button label initial", TEST_LOCATION);
tet_infoline(" UtcDaliButtonSetLabelStringWithPropertyMapStringsP Intermediate part of test");
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT );
- propertyMap.Insert( Toolkit::TextVisual::Property::TEXT, "error if this is the final text" );
- propertyMap.Insert( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT);
+ propertyMap.Insert(Toolkit::TextVisual::Property::TEXT, "error if this is the final text");
+ propertyMap.Insert(Toolkit::TextVisual::Property::POINT_SIZE, 15.0f);
- button.SetProperty( Button::Property::LABEL, propertyMap );
+ button.SetProperty(Button::Property::LABEL, propertyMap);
- DALI_TEST_EQUALS( GetButtonText( button ), "error if this is the final text", TEST_LOCATION );
+ DALI_TEST_EQUALS(GetButtonText(button), "error if this is the final text", TEST_LOCATION);
tet_infoline(" UtcDaliButtonSetLabelStringWithPropertyMapStringsP Final part of test");
Property::Map textVisualMap;
textVisualMap["visualType"] = "TEXT";
- textVisualMap["pointSize"] = 15.0f;
- textVisualMap["text"] = "Button Label";
+ textVisualMap["pointSize"] = 15.0f;
+ textVisualMap["text"] = "Button Label";
- button.SetProperty( Toolkit::Button::Property::LABEL, textVisualMap );
+ button.SetProperty(Toolkit::Button::Property::LABEL, textVisualMap);
- DALI_TEST_EQUALS( GetButtonText( button ), "Button Label", TEST_LOCATION );
+ DALI_TEST_EQUALS(GetButtonText(button), "Button Label", TEST_LOCATION);
END_TEST;
}
Button button = PushButton::New();
// Set default point size for text visual as style sheet not available.
- button.SetProperty( Toolkit::Button::Property::LABEL,
- Property::Map().Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT )
- .Add( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f )
- );
+ button.SetProperty(Toolkit::Button::Property::LABEL,
+ Property::Map().Add(Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT).Add(Toolkit::TextVisual::Property::POINT_SIZE, 15.0f));
- button.SetProperty( Toolkit::Button::Property::LABEL, "Button Label" );
+ button.SetProperty(Toolkit::Button::Property::LABEL, "Button Label");
- DALI_TEST_EQUALS( GetButtonText( button ), "Button Label", TEST_LOCATION );
+ DALI_TEST_EQUALS(GetButtonText(button), "Button Label", TEST_LOCATION);
END_TEST;
}
tet_infoline(" UtcDaliButtonSetLabelPropertyP Set text label and then set again with new text");
-
const std::string TEST_LABEL1 = "test label one";
const std::string TEST_LABEL2 = "test label two";
Button button = PushButton::New();
- button.SetProperty( Toolkit::Button::Property::LABEL,
- Property::Map().Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT )
- .Add( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f )
- .Add( Toolkit::TextVisual::Property::TEXT, TEST_LABEL1 )
- );
+ button.SetProperty(Toolkit::Button::Property::LABEL,
+ Property::Map().Add(Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT).Add(Toolkit::TextVisual::Property::POINT_SIZE, 15.0f).Add(Toolkit::TextVisual::Property::TEXT, TEST_LABEL1));
- DALI_TEST_EQUALS( GetButtonText( button ), TEST_LABEL1, TEST_LOCATION );
+ DALI_TEST_EQUALS(GetButtonText(button), TEST_LABEL1, TEST_LOCATION);
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT );
- propertyMap.Insert( Toolkit::TextVisual::Property::TEXT, TEST_LABEL2 );
- propertyMap.Insert( Toolkit::TextVisual::Property::TEXT_COLOR, Color::BLUE );
- propertyMap.Insert( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f );
- button.SetProperty( Button::Property::LABEL, propertyMap );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT);
+ propertyMap.Insert(Toolkit::TextVisual::Property::TEXT, TEST_LABEL2);
+ propertyMap.Insert(Toolkit::TextVisual::Property::TEXT_COLOR, Color::BLUE);
+ propertyMap.Insert(Toolkit::TextVisual::Property::POINT_SIZE, 15.0f);
+ button.SetProperty(Button::Property::LABEL, propertyMap);
- DALI_TEST_EQUALS( GetButtonText( button ), TEST_LABEL2, TEST_LOCATION );
+ DALI_TEST_EQUALS(GetButtonText(button), TEST_LABEL2, TEST_LOCATION);
END_TEST;
}
tet_infoline(" UtcDaliButtonPressedSignalP");
Button button = PushButton::New();
- button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- button.SetProperty( Actor::Property::POSITION, Vector2( 240, 400 ));
- button.SetProperty( Actor::Property::SIZE, Vector2( 100, 100 ) );
+ button.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ button.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ button.SetProperty(Actor::Property::POSITION, Vector2(240, 400));
+ button.SetProperty(Actor::Property::SIZE, Vector2(100, 100));
- application.GetScene().Add( button );
+ application.GetScene().Add(button);
application.SendNotification();
application.Render();
// connect to its touch signal
ConnectionTracker* testTracker = new ConnectionTracker();
- button.PressedSignal().Connect( &ButtonCallback );
- button.ReleasedSignal().Connect( &ButtonCallback );
- bool pressedSignal = false;
+ button.PressedSignal().Connect(&ButtonCallback);
+ button.ReleasedSignal().Connect(&ButtonCallback);
+ bool pressedSignal = false;
bool releasedSignal = false;
- button.ConnectSignal( testTracker, "pressed", CallbackFunctor(&pressedSignal) );
- button.ConnectSignal( testTracker, "released", CallbackFunctor(&releasedSignal) );
+ button.ConnectSignal(testTracker, "pressed", CallbackFunctor(&pressedSignal));
+ button.ConnectSignal(testTracker, "released", CallbackFunctor(&releasedSignal));
Dali::Integration::TouchEvent event;
// Test1. Touch point down and up inside the button.
gIsCalledButtonCallback = false;
- event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointDownInside() );
- application.ProcessEvent( event );
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint(GetPointDownInside());
+ application.ProcessEvent(event);
- DALI_TEST_CHECK( gIsCalledButtonCallback );
- DALI_TEST_CHECK( pressedSignal );
+ DALI_TEST_CHECK(gIsCalledButtonCallback);
+ DALI_TEST_CHECK(pressedSignal);
gIsCalledButtonCallback = false;
- event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointUpInside() );
- application.ProcessEvent( event );
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint(GetPointUpInside());
+ application.ProcessEvent(event);
- DALI_TEST_CHECK( gIsCalledButtonCallback );
- DALI_TEST_CHECK( releasedSignal );
+ DALI_TEST_CHECK(gIsCalledButtonCallback);
+ DALI_TEST_CHECK(releasedSignal);
// Test2. Touch point down and up outside the button.
- pressedSignal = false;
- releasedSignal = false;
+ pressedSignal = false;
+ releasedSignal = false;
gIsCalledButtonCallback = false;
- event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointDownOutside() );
- application.ProcessEvent( event );
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint(GetPointDownOutside());
+ application.ProcessEvent(event);
- DALI_TEST_CHECK( !gIsCalledButtonCallback );
- DALI_TEST_CHECK( !pressedSignal );
+ DALI_TEST_CHECK(!gIsCalledButtonCallback);
+ DALI_TEST_CHECK(!pressedSignal);
gIsCalledButtonCallback = false;
- event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointUpOutside() );
- application.ProcessEvent( event );
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint(GetPointUpOutside());
+ application.ProcessEvent(event);
- DALI_TEST_CHECK( !gIsCalledButtonCallback );
- DALI_TEST_CHECK( !releasedSignal );
+ DALI_TEST_CHECK(!gIsCalledButtonCallback);
+ DALI_TEST_CHECK(!releasedSignal);
// Test3. Touch point down inside and up outside the button.
gIsCalledButtonCallback = false;
- event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointDownInside() );
- application.ProcessEvent( event );
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint(GetPointDownInside());
+ application.ProcessEvent(event);
- DALI_TEST_CHECK( gIsCalledButtonCallback );
+ DALI_TEST_CHECK(gIsCalledButtonCallback);
gIsCalledButtonCallback = false;
- event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointLeave() );
- application.ProcessEvent( event );
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint(GetPointLeave());
+ application.ProcessEvent(event);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointUpOutside() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointUpOutside());
+ application.ProcessEvent(event);
- DALI_TEST_CHECK( gIsCalledButtonCallback );
+ DALI_TEST_CHECK(gIsCalledButtonCallback);
// Test4. Touch point down outside and up inside the button.
gIsCalledButtonCallback = false;
- event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointDownOutside() );
- application.ProcessEvent( event );
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint(GetPointDownOutside());
+ application.ProcessEvent(event);
- DALI_TEST_CHECK( !gIsCalledButtonCallback );
+ DALI_TEST_CHECK(!gIsCalledButtonCallback);
gIsCalledButtonCallback = false;
- event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointEnter() );
- application.ProcessEvent( event );
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint(GetPointEnter());
+ application.ProcessEvent(event);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointUpInside() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointUpInside());
+ application.ProcessEvent(event);
- DALI_TEST_CHECK( !gIsCalledButtonCallback );
+ DALI_TEST_CHECK(!gIsCalledButtonCallback);
END_TEST;
}
tet_infoline(" UtcDaliButtonClickedSignalP");
Button button = PushButton::New();
- button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- button.SetProperty( Actor::Property::POSITION, Vector2( 240, 400 ));
- button.SetProperty( Actor::Property::SIZE, Vector2( 100, 100 ) );
+ button.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ button.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ button.SetProperty(Actor::Property::POSITION, Vector2(240, 400));
+ button.SetProperty(Actor::Property::SIZE, Vector2(100, 100));
- application.GetScene().Add( button );
+ application.GetScene().Add(button);
application.SendNotification();
application.Render();
// connect to its touch signal
- button.ClickedSignal().Connect( &ButtonCallback );
- bool clickedSignal = false;
- ConnectionTracker* testTracker = new ConnectionTracker();
- button.ConnectSignal( testTracker, "clicked", CallbackFunctor(&clickedSignal) );
+ button.ClickedSignal().Connect(&ButtonCallback);
+ bool clickedSignal = false;
+ ConnectionTracker* testTracker = new ConnectionTracker();
+ button.ConnectSignal(testTracker, "clicked", CallbackFunctor(&clickedSignal));
Dali::Integration::TouchEvent event;
// Test1. Touch point down and up inside the button.
gIsCalledButtonCallback = false;
- event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointDownInside() );
- application.ProcessEvent( event );
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint(GetPointDownInside());
+ application.ProcessEvent(event);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointUpInside() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointUpInside());
+ application.ProcessEvent(event);
- DALI_TEST_CHECK( gIsCalledButtonCallback );
- DALI_TEST_CHECK( clickedSignal );
+ DALI_TEST_CHECK(gIsCalledButtonCallback);
+ DALI_TEST_CHECK(clickedSignal);
// Test2. Touch point down and up outside the button.
gIsCalledButtonCallback = false;
- clickedSignal = false;
- event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointDownOutside() );
- application.ProcessEvent( event );
+ clickedSignal = false;
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint(GetPointDownOutside());
+ application.ProcessEvent(event);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointUpOutside() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointUpOutside());
+ application.ProcessEvent(event);
- DALI_TEST_CHECK( !gIsCalledButtonCallback );
- DALI_TEST_CHECK( !clickedSignal );
+ DALI_TEST_CHECK(!gIsCalledButtonCallback);
+ DALI_TEST_CHECK(!clickedSignal);
// Test3. Touch point down inside and up outside the button.
gIsCalledButtonCallback = false;
- clickedSignal = false;
- event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointDownInside() );
- application.ProcessEvent( event );
+ clickedSignal = false;
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint(GetPointDownInside());
+ application.ProcessEvent(event);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointLeave() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointLeave());
+ application.ProcessEvent(event);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointUpOutside() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointUpOutside());
+ application.ProcessEvent(event);
- DALI_TEST_CHECK( !gIsCalledButtonCallback );
- DALI_TEST_CHECK( !clickedSignal );
+ DALI_TEST_CHECK(!gIsCalledButtonCallback);
+ DALI_TEST_CHECK(!clickedSignal);
// Test4. Touch point down outside and up inside the button.
gIsCalledButtonCallback = false;
- clickedSignal = false;
- event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointDownOutside() );
- application.ProcessEvent( event );
+ clickedSignal = false;
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint(GetPointDownOutside());
+ application.ProcessEvent(event);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointEnter() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointEnter());
+ application.ProcessEvent(event);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointUpInside() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointUpInside());
+ application.ProcessEvent(event);
- DALI_TEST_CHECK( !gIsCalledButtonCallback );
- DALI_TEST_CHECK( !clickedSignal );
+ DALI_TEST_CHECK(!gIsCalledButtonCallback);
+ DALI_TEST_CHECK(!clickedSignal);
END_TEST;
}
Button button = PushButton::New();
- button.SetProperty( Button::Property::TOGGLABLE, true);
+ button.SetProperty(Button::Property::TOGGLABLE, true);
- application.GetScene().Add( button );
+ application.GetScene().Add(button);
application.SendNotification();
application.Render();
// connect to its signal
- button.StateChangedSignal().Connect( &ButtonCallback );
- bool stateChangedSignal = false;
- ConnectionTracker* testTracker = new ConnectionTracker();
- button.ConnectSignal( testTracker, "stateChanged", CallbackFunctor(&stateChangedSignal) );
+ button.StateChangedSignal().Connect(&ButtonCallback);
+ bool stateChangedSignal = false;
+ ConnectionTracker* testTracker = new ConnectionTracker();
+ button.ConnectSignal(testTracker, "stateChanged", CallbackFunctor(&stateChangedSignal));
gIsCalledButtonCallback = false;
- button.SetProperty( Button::Property::SELECTED, true);
+ button.SetProperty(Button::Property::SELECTED, true);
- DALI_TEST_CHECK( gIsCalledButtonCallback );
- DALI_TEST_CHECK( stateChangedSignal );
+ DALI_TEST_CHECK(gIsCalledButtonCallback);
+ DALI_TEST_CHECK(stateChangedSignal);
gIsCalledButtonCallback = false;
- stateChangedSignal = false;
+ stateChangedSignal = false;
- button.SetProperty( Button::Property::SELECTED, false);
- DALI_TEST_CHECK( gIsCalledButtonCallback );
- DALI_TEST_CHECK( stateChangedSignal );
+ button.SetProperty(Button::Property::SELECTED, false);
+ DALI_TEST_CHECK(gIsCalledButtonCallback);
+ DALI_TEST_CHECK(stateChangedSignal);
END_TEST;
}
pushButton.SetProperty(pushButton.GetPropertyIndex("disabled"), false);
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>( pushButton.GetPropertyIndex("disabled")), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("disabled")), false, TEST_LOCATION);
pushButton.SetProperty(pushButton.GetPropertyIndex("disabled"), true);
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>( pushButton.GetPropertyIndex("disabled")), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("disabled")), true, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
Button parentButton = PushButton::New();
- parentButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- parentButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- parentButton.SetProperty( Actor::Property::SIZE, Vector2( 20, 20 ) );
- application.GetScene().Add( parentButton );
+ parentButton.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ parentButton.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ parentButton.SetProperty(Actor::Property::SIZE, Vector2(20, 20));
+ application.GetScene().Add(parentButton);
Button childButton = PushButton::New();
- childButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- childButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT );
- childButton.SetProperty( Actor::Property::SIZE, Vector2( 20, 20 ) );
- parentButton.Add( childButton );
+ childButton.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ childButton.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT);
+ childButton.SetProperty(Actor::Property::SIZE, Vector2(20, 20));
+ parentButton.Add(childButton);
// Reset signal flags
gIsCalledChildButtonCallback = false;
- gIsCalledButtonCallback = false;
+ gIsCalledButtonCallback = false;
- parentButton.ClickedSignal().Connect( &ButtonCallback );
- childButton.ClickedSignal().Connect( &ChildButtonCallback );
+ parentButton.ClickedSignal().Connect(&ButtonCallback);
+ childButton.ClickedSignal().Connect(&ChildButtonCallback);
// Peform a button click at coordinates (10,30) which is the child.
Dali::Integration::TouchEvent event;
event = Dali::Integration::TouchEvent();
Dali::Integration::Point point;
- point.SetState( PointState::DOWN );
- point.SetScreenPosition( Vector2( 10, 30 ) );
- event.AddPoint( point );
+ point.SetState(PointState::DOWN);
+ point.SetScreenPosition(Vector2(10, 30));
+ event.AddPoint(point);
// flush the queue and render once
application.SendNotification();
application.Render();
- application.ProcessEvent( event );
+ application.ProcessEvent(event);
event = Dali::Integration::TouchEvent();
- point.SetState( PointState::UP );
- point.SetScreenPosition( Vector2( 10, 30 ) );
- event.AddPoint( point );
+ point.SetState(PointState::UP);
+ point.SetScreenPosition(Vector2(10, 30));
+ event.AddPoint(point);
// flush the queue and render once
application.SendNotification();
application.Render();
- application.ProcessEvent( event );
+ application.ProcessEvent(event);
- DALI_TEST_EQUALS( gIsCalledChildButtonCallback, true, TEST_LOCATION );
- DALI_TEST_EQUALS( ! gIsCalledButtonCallback, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gIsCalledChildButtonCallback, true, TEST_LOCATION);
+ DALI_TEST_EQUALS(!gIsCalledButtonCallback, true, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
Button parentButton = PushButton::New();
- parentButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- parentButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- parentButton.SetProperty( Actor::Property::SIZE, Vector2( 20, 20 ) );
- application.GetScene().Add( parentButton );
- parentButton.ReleasedSignal().Connect( &ButtonCallback );
+ parentButton.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ parentButton.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ parentButton.SetProperty(Actor::Property::SIZE, Vector2(20, 20));
+ application.GetScene().Add(parentButton);
+ parentButton.ReleasedSignal().Connect(&ButtonCallback);
// Reset signal flags
gIsCalledButtonCallback = false;
Dali::Integration::TouchEvent event;
event = Dali::Integration::TouchEvent();
Dali::Integration::Point point;
- point.SetState( PointState::DOWN );
- point.SetScreenPosition( Vector2( 10, 10 ) );
- event.AddPoint( point );
+ point.SetState(PointState::DOWN);
+ point.SetScreenPosition(Vector2(10, 10));
+ event.AddPoint(point);
// flush the queue and render once
application.SendNotification();
application.Render();
- application.ProcessEvent( event );
+ application.ProcessEvent(event);
event = Dali::Integration::TouchEvent();
- point.SetState( PointState::INTERRUPTED );
- event.AddPoint( point );
+ point.SetState(PointState::INTERRUPTED);
+ event.AddPoint(point);
// flush the queue and render once
application.SendNotification();
application.Render();
- application.ProcessEvent( event );
+ application.ProcessEvent(event);
- DALI_TEST_EQUALS( gIsCalledButtonCallback, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gIsCalledButtonCallback, true, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
Button button = PushButton::New();
- button.SetProperty( Button::Property::TOGGLABLE, true);
+ button.SetProperty(Button::Property::TOGGLABLE, true);
- button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- button.SetProperty( Actor::Property::SIZE, Vector2( 20, 20 ) );
- application.GetScene().Add( button );
- button.ReleasedSignal().Connect( &ButtonCallback );
+ button.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ button.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ button.SetProperty(Actor::Property::SIZE, Vector2(20, 20));
+ application.GetScene().Add(button);
+ button.ReleasedSignal().Connect(&ButtonCallback);
// Reset signal flags
gIsCalledButtonCallback = false;
Dali::Integration::Point point;
// Add Press button
- point.SetState( PointState::DOWN );
- point.SetScreenPosition( Vector2( 15, 15 ) );
- downEvent.AddPoint( point );
+ point.SetState(PointState::DOWN);
+ point.SetScreenPosition(Vector2(15, 15));
+ downEvent.AddPoint(point);
// flush the queue and render once
application.SendNotification();
application.Render();
- application.ProcessEvent( downEvent );
+ application.ProcessEvent(downEvent);
// Release button
Dali::Integration::TouchEvent upEvent;
upEvent = Dali::Integration::TouchEvent();
- point.SetState( PointState::UP );
- point.SetScreenPosition( Vector2( 15, 15 ) );
- upEvent.AddPoint( point );
+ point.SetState(PointState::UP);
+ point.SetScreenPosition(Vector2(15, 15));
+ upEvent.AddPoint(point);
// flush the queue and render once
application.SendNotification();
application.Render();
- application.ProcessEvent( upEvent );
+ application.ProcessEvent(upEvent);
tet_infoline("Button should now be selected\n");
- bool isSelected = button.GetProperty<bool>( Button::Property::SELECTED ) ;
- DALI_TEST_EQUALS( isSelected, true, TEST_LOCATION );
+ bool isSelected = button.GetProperty<bool>(Button::Property::SELECTED);
+ DALI_TEST_EQUALS(isSelected, true, TEST_LOCATION);
// Add first point
Dali::Integration::TouchEvent multiEvent;
multiEvent = Dali::Integration::TouchEvent();
- point.SetState( PointState::DOWN );
- point.SetScreenPosition( Vector2( 10, 10 ) );
- multiEvent.AddPoint( point );
+ point.SetState(PointState::DOWN);
+ point.SetScreenPosition(Vector2(10, 10));
+ multiEvent.AddPoint(point);
// Add second point
- point.SetState( PointState::DOWN );
- point.SetScreenPosition( Vector2( 15, 15 ) );
- multiEvent.AddPoint( point );
+ point.SetState(PointState::DOWN);
+ point.SetScreenPosition(Vector2(15, 15));
+ multiEvent.AddPoint(point);
tet_infoline("Before a multi touch event\n");
// flush the queue and render once
application.SendNotification();
application.Render();
- application.ProcessEvent( multiEvent );
+ application.ProcessEvent(multiEvent);
- DALI_TEST_EQUALS( gIsCalledButtonCallback, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gIsCalledButtonCallback, true, TEST_LOCATION);
END_TEST;
}
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
-#include <stdlib.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/public-api/controls/camera-view/camera-view.h>
+#include <stdlib.h>
+#include <iostream>
using namespace Dali;
using namespace Dali::Toolkit;
{
// New() must be called to create a CameraView or it wont be valid.
Actor a = Actor::New();
- view.Add( a );
- DALI_TEST_CHECK( false );
+ view.Add(a);
+ DALI_TEST_CHECK(false);
}
- catch (Dali::DaliException& e)
+ catch(Dali::DaliException& e)
{
// Tests that a negative test of an assertion succeeds
- DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_PRINT_ASSERT(e);
DALI_TEST_CHECK(!view);
}
END_TEST;
{
ToolkitTestApplication application;
tet_infoline(" UtcDaliCameraViewNew");
- Any dummy( 0 );
+ Any dummy(0);
Toolkit::CameraView view = Toolkit::CameraView::New(dummy);
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliCameraViewDownCast");
- Any dummy( 0 );
+ Any dummy(0);
Toolkit::CameraView view = Toolkit::CameraView::New(dummy);
- BaseHandle handle(view);
+ BaseHandle handle(view);
- Toolkit::CameraView view2 = Toolkit::CameraView::DownCast( handle );
- DALI_TEST_CHECK( view );
- DALI_TEST_CHECK( view2 );
- DALI_TEST_CHECK( view == view2 );
+ Toolkit::CameraView view2 = Toolkit::CameraView::DownCast(handle);
+ DALI_TEST_CHECK(view);
+ DALI_TEST_CHECK(view2);
+ DALI_TEST_CHECK(view == view2);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline("UtcDaliCameraViewCopyAndAssignment");
- Any dummy( 0 );
+ Any dummy(0);
CameraView view = Toolkit::CameraView::New(dummy);
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- CameraView copy( view );
- DALI_TEST_CHECK( view == copy );
+ CameraView copy(view);
+ DALI_TEST_CHECK(view == copy);
CameraView assign;
- DALI_TEST_CHECK( !assign );
+ DALI_TEST_CHECK(!assign);
assign = copy;
- DALI_TEST_CHECK( assign == view );
+ DALI_TEST_CHECK(assign == view);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline("UtcDaliCameraViewMoveAssignment");
- Any dummy( 0 );
+ Any dummy(0);
CameraView view = Toolkit::CameraView::New(dummy);
- DALI_TEST_EQUALS( 1, view.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS(1, view.GetBaseObject().ReferenceCount(), TEST_LOCATION);
CameraView moved;
- moved = std::move( view );
- DALI_TEST_CHECK( moved );
- DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_CHECK( !view );
+ moved = std::move(view);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_CHECK(!view);
END_TEST;
}
tet_infoline("UtcDaliCameraViewTypeRegistry");
TypeRegistry typeRegistry = TypeRegistry::Get();
- DALI_TEST_CHECK( typeRegistry );
+ DALI_TEST_CHECK(typeRegistry);
- TypeInfo typeInfo = typeRegistry.GetTypeInfo( "CameraView" );
- DALI_TEST_CHECK( typeInfo );
+ TypeInfo typeInfo = typeRegistry.GetTypeInfo("CameraView");
+ DALI_TEST_CHECK(typeInfo);
BaseHandle handle = typeInfo.CreateInstance();
- DALI_TEST_CHECK( handle );
+ DALI_TEST_CHECK(handle);
- CameraView view = CameraView::DownCast( handle );
- DALI_TEST_CHECK( view );
+ CameraView view = CameraView::DownCast(handle);
+ DALI_TEST_CHECK(view);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline("UtcDaliCameraViewWindowDisplayType");
- Any dummy( 0 );
+ Any dummy(0);
CameraView cameraView = CameraView::New(dummy, Dali::Toolkit::CameraView::DisplayType::WINDOW);
- DALI_TEST_CHECK( cameraView );
+ DALI_TEST_CHECK(cameraView);
- application.GetScene().Add( cameraView );
+ application.GetScene().Add(cameraView);
try
{
cameraView.Update();
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
- catch (Dali::DaliException& e)
+ catch(Dali::DaliException& e)
{
- DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_PRINT_ASSERT(e);
DALI_TEST_CHECK(false);
}
ToolkitTestApplication application;
tet_infoline("UtcDaliCameraViewImageDisplayType");
- Any dummy( 0 );
+ Any dummy(0);
CameraView cameraView = CameraView::New(dummy, Dali::Toolkit::CameraView::DisplayType::IMAGE);
- DALI_TEST_CHECK( cameraView );
+ DALI_TEST_CHECK(cameraView);
- application.GetScene().Add( cameraView );
+ application.GetScene().Add(cameraView);
try
{
cameraView.Update();
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
- catch (Dali::DaliException& e)
+ catch(Dali::DaliException& e)
{
- DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_PRINT_ASSERT(e);
DALI_TEST_CHECK(false);
}
ToolkitTestApplication application;
tet_infoline("UtcDaliCameraViewUpdateDisplayArea1");
- Any dummy( 0 );
+ Any dummy(0);
CameraView view = CameraView::New(dummy, Dali::Toolkit::CameraView::DisplayType::WINDOW);
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- application.GetScene().Add( view );
+ application.GetScene().Add(view);
application.SendNotification();
application.Render();
Vector3 vector(100.0f, 100.0f, 0.0f);
- view.SetProperty( Actor::Property::SIZE, vector );
+ view.SetProperty(Actor::Property::SIZE, vector);
application.SendNotification();
application.Render();
// Check the size in the new frame
- DALI_TEST_CHECK(vector == view.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ));
+ DALI_TEST_CHECK(vector == view.GetCurrentProperty<Vector3>(Actor::Property::SIZE));
application.GetScene().Remove(view);
ToolkitTestApplication application;
tet_infoline("UtcDaliCameraViewUpdateDisplayArea2");
- Any dummy( 0 );
+ Any dummy(0);
CameraView view = CameraView::New(dummy, Dali::Toolkit::CameraView::DisplayType::WINDOW);
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- application.GetScene().Add( view );
+ application.GetScene().Add(view);
application.SendNotification();
application.Render();
Vector3 vector(100.0f, 100.0f, 0.0f);
- view.SetProperty( Actor::Property::SIZE, vector );
+ view.SetProperty(Actor::Property::SIZE, vector);
application.SendNotification();
application.Render();
// Check the size in the new frame
- DALI_TEST_CHECK(vector == view.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ));
+ DALI_TEST_CHECK(vector == view.GetCurrentProperty<Vector3>(Actor::Property::SIZE));
application.GetScene().Remove(view);
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
#include <stdlib.h>
+#include <iostream>
+
+#include <toolkit-event-thread-callback.h>
+#include <toolkit-timer.h>
+
#include <dali-toolkit-test-suite-utils.h>
+
+#include <dali-toolkit/dali-toolkit.h>
+
#include <dali-toolkit/dali-toolkit.h>
-#include <test-application.h>
-#include <dali/public-api/images/pixel-data.h>
-#include <toolkit-event-thread-callback.h>
#include <dali-toolkit/devel-api/controls/canvas-view/canvas-view.h>
-#include <dali/devel-api/adaptor-framework/canvas-renderer.h>
-#include <dali/devel-api/adaptor-framework/canvas-renderer-shape.h>
#include <dali-toolkit/internal/controls/canvas-view/canvas-view-rasterize-thread.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer-shape.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer.h>
+#include <dali/public-api/images/pixel-data.h>
using namespace Dali;
using namespace Toolkit;
namespace
{
-
-
} // namespace
void utc_dali_toolkit_canvasview_startup(void)
int UtcDaliCanvasViewConstructorP(void)
{
ToolkitTestApplication application;
- CanvasView canvasView;
+ CanvasView canvasView;
- DALI_TEST_CHECK( !canvasView );
+ DALI_TEST_CHECK(!canvasView);
END_TEST;
}
int UtcDaliCanvasViewMoveAssignment(void)
{
ToolkitTestApplication application;
- CanvasView canvasView = CanvasView::New(Vector2(100, 100));
+ CanvasView canvasView = CanvasView::New(Vector2(100, 100));
- CanvasView moved = std::move( canvasView );
- DALI_TEST_CHECK( moved );
- DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_CHECK( !canvasView );
+ CanvasView moved = std::move(canvasView);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_CHECK(!canvasView);
END_TEST;
}
int UtcDaliCanvasViewAssignmentConstructorP(void)
{
ToolkitTestApplication application;
- CanvasView canvasView = CanvasView::New(Vector2(100, 100));
+ CanvasView canvasView = CanvasView::New(Vector2(100, 100));
- CanvasView copy( canvasView );
- DALI_TEST_CHECK( copy );
+ CanvasView copy(canvasView);
+ DALI_TEST_CHECK(copy);
- DALI_TEST_CHECK( canvasView == copy );
+ DALI_TEST_CHECK(canvasView == copy);
END_TEST;
}
int UtcDaliCanvasViewAssignmentOperatorP(void)
{
ToolkitTestApplication application;
- const CanvasView canvasView = CanvasView::New(Vector2(100, 100));
+ const CanvasView canvasView = CanvasView::New(Vector2(100, 100));
CanvasView assign;
- DALI_TEST_CHECK( !assign );
+ DALI_TEST_CHECK(!assign);
- assign = canvasView ;
- DALI_TEST_CHECK( assign == canvasView);
+ assign = canvasView;
+ DALI_TEST_CHECK(assign == canvasView);
END_TEST;
}
int UtcDaliCanvasViewNewP(void)
{
ToolkitTestApplication application;
- CanvasView canvasView = CanvasView::New(Vector2(100, 100));
+ CanvasView canvasView = CanvasView::New(Vector2(100, 100));
- DALI_TEST_CHECK( canvasView );
+ DALI_TEST_CHECK(canvasView);
END_TEST;
}
int UtcDaliCanvasViewNewWithoutViewboxP(void)
{
ToolkitTestApplication application;
- CanvasView canvasView = CanvasView::New();
+ CanvasView canvasView = CanvasView::New();
- DALI_TEST_CHECK( canvasView );
+ DALI_TEST_CHECK(canvasView);
END_TEST;
}
int UtcDaliCanvasViewDownCastP(void)
{
ToolkitTestApplication application;
- CanvasView canvasView = CanvasView::New(Vector2(100,100));
+ CanvasView canvasView = CanvasView::New(Vector2(100, 100));
BaseHandle object(canvasView);
- CanvasView canvasView2 = CanvasView::DownCast( object );
+ CanvasView canvasView2 = CanvasView::DownCast(object);
DALI_TEST_CHECK(canvasView2);
- CanvasView canvasView3 = DownCast< CanvasView >(object);
+ CanvasView canvasView3 = DownCast<CanvasView>(object);
DALI_TEST_CHECK(canvasView3);
END_TEST;
}
int UtcDaliCanvasViewDownCastN(void)
{
ToolkitTestApplication application;
- BaseHandle unInitializedObject;
+ BaseHandle unInitializedObject;
- CanvasView canvasView1 = CanvasView::DownCast( unInitializedObject );
- DALI_TEST_CHECK( !canvasView1 );
+ CanvasView canvasView1 = CanvasView::DownCast(unInitializedObject);
+ DALI_TEST_CHECK(!canvasView1);
- CanvasView canvasView2 = DownCast< CanvasView >( unInitializedObject );
- DALI_TEST_CHECK( !canvasView2 );
+ CanvasView canvasView2 = DownCast<CanvasView>(unInitializedObject);
+ DALI_TEST_CHECK(!canvasView2);
END_TEST;
}
int UtcDaliCanvasViewAddP(void)
{
ToolkitTestApplication application;
- CanvasView canvasView = CanvasView::New(Vector2(100,100));
- DALI_TEST_CHECK( canvasView );
+ CanvasView canvasView = CanvasView::New(Vector2(100, 100));
+ DALI_TEST_CHECK(canvasView);
Dali::CanvasRenderer::Shape shape = Dali::CanvasRenderer::Shape::New();
int UtcDaliCanvasViewAddN(void)
{
ToolkitTestApplication application;
- CanvasView canvasView = CanvasView::New(Vector2(100,100));
- DALI_TEST_CHECK( canvasView );
+ CanvasView canvasView = CanvasView::New(Vector2(100, 100));
+ DALI_TEST_CHECK(canvasView);
Dali::CanvasRenderer::Shape shape;
int UtcDaliCanvasViewRemoveP(void)
{
ToolkitTestApplication application;
- CanvasView canvasView = CanvasView::New(Vector2(100,100));
- DALI_TEST_CHECK( canvasView );
+ CanvasView canvasView = CanvasView::New(Vector2(100, 100));
+ DALI_TEST_CHECK(canvasView);
Dali::CanvasRenderer::Shape shape = Dali::CanvasRenderer::Shape::New();
canvasView.AddDrawable(shape);
- DALI_TEST_CHECK( canvasView.RemoveDrawable(shape) );
+ DALI_TEST_CHECK(canvasView.RemoveDrawable(shape));
END_TEST;
}
{
ToolkitTestApplication application;
- CanvasView canvasView = CanvasView::New(Vector2(100,100));
- DALI_TEST_CHECK( canvasView );
+ CanvasView canvasView = CanvasView::New(Vector2(100, 100));
+ DALI_TEST_CHECK(canvasView);
Dali::CanvasRenderer::Shape shape = Dali::CanvasRenderer::Shape::New();
- DALI_TEST_CHECK( !canvasView.RemoveDrawable(shape) );
+ DALI_TEST_CHECK(!canvasView.RemoveDrawable(shape));
END_TEST;
}
int UtcDaliCanvasViewRemoveAllP(void)
{
ToolkitTestApplication application;
- CanvasView canvasView = CanvasView::New(Vector2(100,100));
- DALI_TEST_CHECK( canvasView );
+ CanvasView canvasView = CanvasView::New(Vector2(100, 100));
+ DALI_TEST_CHECK(canvasView);
Dali::CanvasRenderer::Shape shape = Dali::CanvasRenderer::Shape::New();
{
ToolkitTestApplication application;
- CanvasView canvasView = CanvasView::New(Vector2(100,100));
- DALI_TEST_CHECK( canvasView );
+ CanvasView canvasView = CanvasView::New(Vector2(100, 100));
+ DALI_TEST_CHECK(canvasView);
canvasView.RemoveAllDrawables();
END_TEST;
}
-
int UtcDaliCanvasViewChangeSizeP(void)
{
ToolkitTestApplication application;
- CanvasView canvasView = CanvasView::New(Vector2(100,100));
- DALI_TEST_CHECK( canvasView );
+ CanvasView canvasView = CanvasView::New(Vector2(100, 100));
+ DALI_TEST_CHECK(canvasView);
application.GetScene().Add(canvasView);
application.Render();
Property::Value pv = canvasView.GetProperty(Actor::Property::SIZE);
- Vector3 v3;
+ Vector3 v3;
pv.Get(v3);
- DALI_TEST_EQUALS( v3, Vector3(300, 300, 0), TEST_LOCATION );
+ DALI_TEST_EQUALS(v3, Vector3(300, 300, 0), TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- CanvasView canvasView = CanvasView::New(Vector2(100,100));
- DALI_TEST_CHECK( canvasView );
+ CanvasView canvasView = CanvasView::New(Vector2(100, 100));
+ DALI_TEST_CHECK(canvasView);
application.GetScene().Add(canvasView);
application.Render();
Property::Value pv = canvasView.GetProperty(Actor::Property::SIZE);
- Vector3 v3;
+ Vector3 v3;
pv.Get(v3);
- DALI_TEST_EQUALS( v3, Vector3(-999, -999, 0), TEST_LOCATION );
+ DALI_TEST_EQUALS(v3, Vector3(-999, -999, 0), TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- Dali::Toolkit::Internal::CanvasView* dummyInternalCanvasView = new Dali::Toolkit::Internal::CanvasView(Vector2(100,100));
- DALI_TEST_CHECK( dummyInternalCanvasView );
+ Dali::Toolkit::Internal::CanvasView* dummyInternalCanvasView = new Dali::Toolkit::Internal::CanvasView(Vector2(100, 100));
+ DALI_TEST_CHECK(dummyInternalCanvasView);
Dali::CanvasRenderer dummyCanvasRenderer = Dali::CanvasRenderer::New(Vector2(100, 100));
- DALI_TEST_CHECK( dummyCanvasRenderer );
+ DALI_TEST_CHECK(dummyCanvasRenderer);
IntrusivePtr<Dali::Toolkit::Internal::CanvasRendererRasterizingTask> task = new Dali::Toolkit::Internal::CanvasRendererRasterizingTask(dummyInternalCanvasView, dummyCanvasRenderer);
- DALI_TEST_CHECK( task );
+ DALI_TEST_CHECK(task);
END_TEST;
}
{
ToolkitTestApplication application;
- Dali::Toolkit::Internal::CanvasView* dummyInternalCanvasView = new Dali::Toolkit::Internal::CanvasView(Vector2(100,100));
- DALI_TEST_CHECK( dummyInternalCanvasView );
+ Dali::Toolkit::Internal::CanvasView* dummyInternalCanvasView = new Dali::Toolkit::Internal::CanvasView(Vector2(100, 100));
+ DALI_TEST_CHECK(dummyInternalCanvasView);
Dali::CanvasRenderer dummyCanvasRenderer = Dali::CanvasRenderer::New(Vector2(100, 100));
- DALI_TEST_CHECK( dummyCanvasRenderer );
+ DALI_TEST_CHECK(dummyCanvasRenderer);
IntrusivePtr<Dali::Toolkit::Internal::CanvasRendererRasterizingTask> task = new Dali::Toolkit::Internal::CanvasRendererRasterizingTask(dummyInternalCanvasView, dummyCanvasRenderer);
- DALI_TEST_CHECK( task );
+ DALI_TEST_CHECK(task);
- DALI_TEST_EQUALS( task->GetCanvasView(), dummyInternalCanvasView, TEST_LOCATION );
+ DALI_TEST_EQUALS(task->GetCanvasView(), dummyInternalCanvasView, TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- Dali::Toolkit::Internal::CanvasView* dummyInternalCanvasView = new Dali::Toolkit::Internal::CanvasView(Vector2(100,100));
- DALI_TEST_CHECK( dummyInternalCanvasView );
+ Dali::Toolkit::Internal::CanvasView* dummyInternalCanvasView = new Dali::Toolkit::Internal::CanvasView(Vector2(100, 100));
+ DALI_TEST_CHECK(dummyInternalCanvasView);
Dali::CanvasRenderer dummyCanvasRenderer = Dali::CanvasRenderer::New(Vector2(100, 100));
- DALI_TEST_CHECK( dummyCanvasRenderer );
+ DALI_TEST_CHECK(dummyCanvasRenderer);
IntrusivePtr<Dali::Toolkit::Internal::CanvasRendererRasterizingTask> task = new Dali::Toolkit::Internal::CanvasRendererRasterizingTask(dummyInternalCanvasView, dummyCanvasRenderer);
- DALI_TEST_CHECK( task );
+ DALI_TEST_CHECK(task);
- Dali::Toolkit::Internal::CanvasViewRasterizeThread *dummyThread = new Dali::Toolkit::Internal::CanvasViewRasterizeThread();
- DALI_TEST_CHECK( dummyThread );
+ Dali::Toolkit::Internal::CanvasViewRasterizeThread* dummyThread = new Dali::Toolkit::Internal::CanvasViewRasterizeThread();
+ DALI_TEST_CHECK(dummyThread);
END_TEST;
}
{
ToolkitTestApplication application;
- Dali::Toolkit::Internal::CanvasView* dummyInternalCanvasView = new Dali::Toolkit::Internal::CanvasView(Vector2(100,100));
- DALI_TEST_CHECK( dummyInternalCanvasView );
+ Dali::Toolkit::Internal::CanvasView* dummyInternalCanvasView = new Dali::Toolkit::Internal::CanvasView(Vector2(100, 100));
+ DALI_TEST_CHECK(dummyInternalCanvasView);
Dali::CanvasRenderer dummyCanvasRenderer = Dali::CanvasRenderer::New(Vector2(100, 100));
- DALI_TEST_CHECK( dummyCanvasRenderer );
+ DALI_TEST_CHECK(dummyCanvasRenderer);
IntrusivePtr<Dali::Toolkit::Internal::CanvasRendererRasterizingTask> task = new Dali::Toolkit::Internal::CanvasRendererRasterizingTask(dummyInternalCanvasView, dummyCanvasRenderer);
- DALI_TEST_CHECK( task );
+ DALI_TEST_CHECK(task);
IntrusivePtr<Dali::Toolkit::Internal::CanvasRendererRasterizingTask> task2 = new Dali::Toolkit::Internal::CanvasRendererRasterizingTask(dummyInternalCanvasView, dummyCanvasRenderer);
- DALI_TEST_CHECK( task2 );
+ DALI_TEST_CHECK(task2);
- Dali::Toolkit::Internal::CanvasViewRasterizeThread *dummyThread = new Dali::Toolkit::Internal::CanvasViewRasterizeThread();
- DALI_TEST_CHECK( dummyThread );
+ Dali::Toolkit::Internal::CanvasViewRasterizeThread* dummyThread = new Dali::Toolkit::Internal::CanvasViewRasterizeThread();
+ DALI_TEST_CHECK(dummyThread);
dummyThread->AddTask(task);
dummyThread->AddTask(task2);
{
ToolkitTestApplication application;
- Dali::Toolkit::Internal::CanvasView* dummyInternalCanvasView = new Dali::Toolkit::Internal::CanvasView(Vector2(100,100));
- DALI_TEST_CHECK( dummyInternalCanvasView );
+ Dali::Toolkit::Internal::CanvasView* dummyInternalCanvasView = new Dali::Toolkit::Internal::CanvasView(Vector2(100, 100));
+ DALI_TEST_CHECK(dummyInternalCanvasView);
Dali::CanvasRenderer dummyCanvasRenderer = Dali::CanvasRenderer::New(Vector2(100, 100));
- DALI_TEST_CHECK( dummyCanvasRenderer );
+ DALI_TEST_CHECK(dummyCanvasRenderer);
IntrusivePtr<Dali::Toolkit::Internal::CanvasRendererRasterizingTask> task = new Dali::Toolkit::Internal::CanvasRendererRasterizingTask(dummyInternalCanvasView, dummyCanvasRenderer);
- DALI_TEST_CHECK( task );
+ DALI_TEST_CHECK(task);
- Dali::Toolkit::Internal::CanvasViewRasterizeThread *dummyThread = new Dali::Toolkit::Internal::CanvasViewRasterizeThread();
- DALI_TEST_CHECK( dummyThread );
+ Dali::Toolkit::Internal::CanvasViewRasterizeThread* dummyThread = new Dali::Toolkit::Internal::CanvasViewRasterizeThread();
+ DALI_TEST_CHECK(dummyThread);
dummyThread->AddTask(task);
{
ToolkitTestApplication application;
- Dali::Toolkit::Internal::CanvasView* dummyInternalCanvasView = new Dali::Toolkit::Internal::CanvasView(Vector2(100,100));
- DALI_TEST_CHECK( dummyInternalCanvasView );
+ Dali::Toolkit::Internal::CanvasView* dummyInternalCanvasView = new Dali::Toolkit::Internal::CanvasView(Vector2(100, 100));
+ DALI_TEST_CHECK(dummyInternalCanvasView);
Dali::CanvasRenderer dummyCanvasRenderer = Dali::CanvasRenderer::New(Vector2(100, 100));
- DALI_TEST_CHECK( dummyCanvasRenderer );
+ DALI_TEST_CHECK(dummyCanvasRenderer);
IntrusivePtr<Dali::Toolkit::Internal::CanvasRendererRasterizingTask> task = new Dali::Toolkit::Internal::CanvasRendererRasterizingTask(dummyInternalCanvasView, dummyCanvasRenderer);
- DALI_TEST_CHECK( task );
+ DALI_TEST_CHECK(task);
- Dali::Toolkit::Internal::CanvasViewRasterizeThread *dummyThread = new Dali::Toolkit::Internal::CanvasViewRasterizeThread();
- DALI_TEST_CHECK( dummyThread );
+ Dali::Toolkit::Internal::CanvasViewRasterizeThread* dummyThread = new Dali::Toolkit::Internal::CanvasViewRasterizeThread();
+ DALI_TEST_CHECK(dummyThread);
dummyThread->AddTask(task);
{
ToolkitTestApplication application;
- Dali::Toolkit::Internal::CanvasView* dummyInternalCanvasView = new Dali::Toolkit::Internal::CanvasView(Vector2(100,100));
- DALI_TEST_CHECK( dummyInternalCanvasView );
+ Dali::Toolkit::Internal::CanvasView* dummyInternalCanvasView = new Dali::Toolkit::Internal::CanvasView(Vector2(100, 100));
+ DALI_TEST_CHECK(dummyInternalCanvasView);
Dali::CanvasRenderer dummyCanvasRenderer = Dali::CanvasRenderer::New(Vector2(100, 100));
- DALI_TEST_CHECK( dummyCanvasRenderer );
+ DALI_TEST_CHECK(dummyCanvasRenderer);
IntrusivePtr<Dali::Toolkit::Internal::CanvasRendererRasterizingTask> task = new Dali::Toolkit::Internal::CanvasRendererRasterizingTask(dummyInternalCanvasView, dummyCanvasRenderer);
- DALI_TEST_CHECK( task );
+ DALI_TEST_CHECK(task);
- Dali::Toolkit::Internal::CanvasViewRasterizeThread *dummyThread = new Dali::Toolkit::Internal::CanvasViewRasterizeThread();
- DALI_TEST_CHECK( dummyThread );
+ Dali::Toolkit::Internal::CanvasViewRasterizeThread* dummyThread = new Dali::Toolkit::Internal::CanvasViewRasterizeThread();
+ DALI_TEST_CHECK(dummyThread);
dummyThread->AddTask(task);
END_TEST;
}
-PixelData CreatePixelData( unsigned int width, unsigned int height )
+PixelData CreatePixelData(unsigned int width, unsigned int height)
{
- unsigned int bufferSize = width*height*Pixel::GetBytesPerPixel( Pixel::RGBA8888 );
+ unsigned int bufferSize = width * height * Pixel::GetBytesPerPixel(Pixel::RGBA8888);
- unsigned char* buffer= reinterpret_cast<unsigned char*>( malloc( bufferSize ) );
- PixelData pixelData = PixelData::New( buffer, bufferSize, width, height, Pixel::RGBA8888, PixelData::FREE );
+ unsigned char* buffer = reinterpret_cast<unsigned char*>(malloc(bufferSize));
+ PixelData pixelData = PixelData::New(buffer, bufferSize, width, height, Pixel::RGBA8888, PixelData::FREE);
return pixelData;
}
{
ToolkitTestApplication application;
- Dali::Toolkit::Internal::CanvasView* dummyInternalCanvasView = new Dali::Toolkit::Internal::CanvasView(Vector2(100,100));
- DALI_TEST_CHECK( dummyInternalCanvasView );
+ Dali::Toolkit::Internal::CanvasView* dummyInternalCanvasView = new Dali::Toolkit::Internal::CanvasView(Vector2(100, 100));
+ DALI_TEST_CHECK(dummyInternalCanvasView);
Dali::CanvasRenderer dummyCanvasRenderer = Dali::CanvasRenderer::New(Vector2(100, 100));
- DALI_TEST_CHECK( dummyCanvasRenderer );
+ DALI_TEST_CHECK(dummyCanvasRenderer);
IntrusivePtr<Dali::Toolkit::Internal::CanvasRendererRasterizingTask> task = new Dali::Toolkit::Internal::CanvasRendererRasterizingTask(dummyInternalCanvasView, dummyCanvasRenderer);
- DALI_TEST_CHECK( task );
+ DALI_TEST_CHECK(task);
- Dali::Toolkit::Internal::CanvasViewRasterizeThread *dummyThread = new Dali::Toolkit::Internal::CanvasViewRasterizeThread();
- DALI_TEST_CHECK( dummyThread );
+ Dali::Toolkit::Internal::CanvasViewRasterizeThread* dummyThread = new Dali::Toolkit::Internal::CanvasViewRasterizeThread();
+ DALI_TEST_CHECK(dummyThread);
dummyThread->AddTask(task);
{
ToolkitTestApplication application;
- Dali::Toolkit::CanvasView canvasView = Dali::Toolkit::CanvasView::New(Vector2(100, 100));
+ Dali::Toolkit::CanvasView canvasView = Dali::Toolkit::CanvasView::New(Vector2(100, 100));
Dali::Toolkit::Internal::CanvasView& dummyInternalCanvasView = GetImpl(canvasView);
Dali::CanvasRenderer dummyCanvasRenderer = Dali::CanvasRenderer::New(Vector2(100, 100));
- DALI_TEST_CHECK( dummyCanvasRenderer );
+ DALI_TEST_CHECK(dummyCanvasRenderer);
IntrusivePtr<Dali::Toolkit::Internal::CanvasRendererRasterizingTask> task = new Dali::Toolkit::Internal::CanvasRendererRasterizingTask(&dummyInternalCanvasView, dummyCanvasRenderer);
- DALI_TEST_CHECK( task );
+ DALI_TEST_CHECK(task);
- Dali::Toolkit::Internal::CanvasViewRasterizeThread *dummyThread = new Dali::Toolkit::Internal::CanvasViewRasterizeThread();
- DALI_TEST_CHECK( dummyThread );
+ Dali::Toolkit::Internal::CanvasViewRasterizeThread* dummyThread = new Dali::Toolkit::Internal::CanvasViewRasterizeThread();
+ DALI_TEST_CHECK(dummyThread);
dummyThread->AddTask(task);
dummyThread->Process(false);
- auto texture = Texture::New( Dali::TextureType::TEXTURE_2D, Pixel::RGBA8888, 100, 100 );
+ auto texture = Texture::New(Dali::TextureType::TEXTURE_2D, Pixel::RGBA8888, 100, 100);
dummyThread->RasterizationCompletedSignal().Connect(&dummyInternalCanvasView, &Dali::Toolkit::Internal::CanvasView::ApplyRasterizedImage);
dummyThread->RasterizationCompletedSignal().Emit(texture);
{
ToolkitTestApplication application;
- CanvasView canvasView = CanvasView::New(Vector2(100,100));
- DALI_TEST_CHECK( canvasView );
+ CanvasView canvasView = CanvasView::New(Vector2(100, 100));
+ DALI_TEST_CHECK(canvasView);
application.GetScene().Add(canvasView);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render();
ToolkitTestApplication application;
CanvasView canvasView = CanvasView::New(Vector2(300, 300));
- DALI_TEST_CHECK( canvasView );
+ DALI_TEST_CHECK(canvasView);
application.GetScene().Add(canvasView);
ToolkitTestApplication application;
CanvasView canvasView = CanvasView::New(Vector2(300, 300));
- DALI_TEST_CHECK( canvasView );
+ DALI_TEST_CHECK(canvasView);
application.GetScene().Add(canvasView);
application.Render();
Vector2 viewBox = canvasView.GetProperty(Toolkit::CanvasView::Property::VIEW_BOX).Get<Vector2>();
- DALI_TEST_EQUALS( viewBox, Vector2(-999, -999), TEST_LOCATION );
+ DALI_TEST_EQUALS(viewBox, Vector2(-999, -999), TEST_LOCATION);
END_TEST;
}
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
#include <stdlib.h>
+#include <iostream>
+
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
-#include <test-application.h>
-#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
+#include <test-application.h>
using namespace Dali;
using namespace Toolkit;
namespace
{
-
static bool gCheckBoxButtonState = false;
-bool CheckBoxButtonClicked( Button button )
+bool CheckBoxButtonClicked(Button button)
{
- gCheckBoxButtonState = button.GetProperty<bool>(button.GetPropertyIndex("selected")) ;
+ gCheckBoxButtonState = button.GetProperty<bool>(button.GetPropertyIndex("selected"));
return true;
}
-static const char* TEST_IMAGE_ONE = TEST_RESOURCE_DIR "/gallery-small-1.jpg";
-const Vector2 TEST_IMAGE_SIZE = Vector2( 66.0f, 66.0f );
+static const char* TEST_IMAGE_ONE = TEST_RESOURCE_DIR "/gallery-small-1.jpg";
+const Vector2 TEST_IMAGE_SIZE = Vector2(66.0f, 66.0f);
-static std::string GetButtonText( Button button )
+static std::string GetButtonText(Button button)
{
- Property::Value value = button.GetProperty( Toolkit::Button::Property::LABEL );
+ Property::Value value = button.GetProperty(Toolkit::Button::Property::LABEL);
- Property::Map *labelProperty = value.GetMap();
+ Property::Map* labelProperty = value.GetMap();
std::string textLabel;
- if ( labelProperty )
+ if(labelProperty)
{
- Property::Value* value = labelProperty->Find( Toolkit::TextVisual::Property::TEXT );
- value->Get( textLabel );
+ Property::Value* value = labelProperty->Find(Toolkit::TextVisual::Property::TEXT);
+ value->Get(textLabel);
}
return textLabel;
CheckBoxButton checkBox;
- DALI_TEST_CHECK( !checkBox );
+ DALI_TEST_CHECK(!checkBox);
END_TEST;
}
// Initialize an object, ref count == 1
CheckBoxButton checkBox = CheckBoxButton::New();
- CheckBoxButton copy( checkBox );
- DALI_TEST_CHECK( copy );
+ CheckBoxButton copy(checkBox);
+ DALI_TEST_CHECK(copy);
END_TEST;
}
ToolkitTestApplication application;
CheckBoxButton button = CheckBoxButton::New();
- DALI_TEST_EQUALS( 1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), true , TEST_LOCATION );
- button.SetProperty( Button::Property::TOGGLABLE, false );
- DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), false , TEST_LOCATION );
+ DALI_TEST_EQUALS(1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_EQUALS(button.GetProperty<bool>(Button::Property::TOGGLABLE), true, TEST_LOCATION);
+ button.SetProperty(Button::Property::TOGGLABLE, false);
+ DALI_TEST_EQUALS(button.GetProperty<bool>(Button::Property::TOGGLABLE), false, TEST_LOCATION);
- CheckBoxButton moved = std::move( button );
- DALI_TEST_CHECK( moved );
- DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_EQUALS( moved.GetProperty<bool>( Button::Property::TOGGLABLE ), false , TEST_LOCATION );
- DALI_TEST_CHECK( !button );
+ CheckBoxButton moved = std::move(button);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_EQUALS(moved.GetProperty<bool>(Button::Property::TOGGLABLE), false, TEST_LOCATION);
+ DALI_TEST_CHECK(!button);
END_TEST;
}
CheckBoxButton checkBox = CheckBoxButton::New();
- CheckBoxButton copy( checkBox );
- DALI_TEST_CHECK( copy );
+ CheckBoxButton copy(checkBox);
+ DALI_TEST_CHECK(copy);
- DALI_TEST_CHECK( checkBox == copy );
+ DALI_TEST_CHECK(checkBox == copy);
END_TEST;
}
ToolkitTestApplication application;
CheckBoxButton button = CheckBoxButton::New();
- DALI_TEST_EQUALS( 1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), true , TEST_LOCATION );
- button.SetProperty( Button::Property::TOGGLABLE, false );
- DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), false , TEST_LOCATION );
+ DALI_TEST_EQUALS(1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_EQUALS(button.GetProperty<bool>(Button::Property::TOGGLABLE), true, TEST_LOCATION);
+ button.SetProperty(Button::Property::TOGGLABLE, false);
+ DALI_TEST_EQUALS(button.GetProperty<bool>(Button::Property::TOGGLABLE), false, TEST_LOCATION);
CheckBoxButton moved;
- moved = std::move( button );
- DALI_TEST_CHECK( moved );
- DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_EQUALS( moved.GetProperty<bool>( Button::Property::TOGGLABLE ), false , TEST_LOCATION );
- DALI_TEST_CHECK( !button );
+ moved = std::move(button);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_EQUALS(moved.GetProperty<bool>(Button::Property::TOGGLABLE), false, TEST_LOCATION);
+ DALI_TEST_CHECK(!button);
END_TEST;
}
CheckBoxButton checkBox = CheckBoxButton::New();
- DALI_TEST_CHECK( checkBox );
+ DALI_TEST_CHECK(checkBox);
END_TEST;
}
BaseHandle object(checkBox);
- CheckBoxButton checkBox2 = CheckBoxButton::DownCast( object );
+ CheckBoxButton checkBox2 = CheckBoxButton::DownCast(object);
DALI_TEST_CHECK(checkBox2);
- CheckBoxButton checkBox3 = DownCast< CheckBoxButton >(object);
+ CheckBoxButton checkBox3 = DownCast<CheckBoxButton>(object);
DALI_TEST_CHECK(checkBox3);
END_TEST;
}
BaseHandle unInitializedObject;
- CheckBoxButton checkBox1 = CheckBoxButton::DownCast( unInitializedObject );
- DALI_TEST_CHECK( !checkBox1 );
+ CheckBoxButton checkBox1 = CheckBoxButton::DownCast(unInitializedObject);
+ DALI_TEST_CHECK(!checkBox1);
- CheckBoxButton checkBox2 = DownCast< CheckBoxButton >( unInitializedObject );
- DALI_TEST_CHECK( !checkBox2 );
+ CheckBoxButton checkBox2 = DownCast<CheckBoxButton>(unInitializedObject);
+ DALI_TEST_CHECK(!checkBox2);
END_TEST;
}
tet_infoline(" UtcDaliCheckBoxButtonSetGetSelected");
CheckBoxButton checkBoxButton = CheckBoxButton::New();
- checkBoxButton.StateChangedSignal().Connect( &CheckBoxButtonClicked );
+ checkBoxButton.StateChangedSignal().Connect(&CheckBoxButtonClicked);
// global var used to check if CheckBoxButtonClicked is called;
gCheckBoxButtonState = false;
- checkBoxButton.SetProperty( checkBoxButton.GetPropertyIndex("selected"), true );
+ checkBoxButton.SetProperty(checkBoxButton.GetPropertyIndex("selected"), true);
- DALI_TEST_EQUALS( checkBoxButton.GetProperty<bool>(checkBoxButton.GetPropertyIndex("selected")), true, TEST_LOCATION );
- DALI_TEST_CHECK( gCheckBoxButtonState );
+ DALI_TEST_EQUALS(checkBoxButton.GetProperty<bool>(checkBoxButton.GetPropertyIndex("selected")), true, TEST_LOCATION);
+ DALI_TEST_CHECK(gCheckBoxButtonState);
- checkBoxButton.SetProperty( checkBoxButton.GetPropertyIndex("selected"), false );
+ checkBoxButton.SetProperty(checkBoxButton.GetPropertyIndex("selected"), false);
- DALI_TEST_EQUALS( checkBoxButton.GetProperty<bool>(checkBoxButton.GetPropertyIndex("selected")), false, TEST_LOCATION );
- DALI_TEST_CHECK( !gCheckBoxButtonState );
+ DALI_TEST_EQUALS(checkBoxButton.GetProperty<bool>(checkBoxButton.GetPropertyIndex("selected")), false, TEST_LOCATION);
+ DALI_TEST_CHECK(!gCheckBoxButtonState);
- checkBoxButton.SetProperty( checkBoxButton.GetPropertyIndex("selected"), true );
+ checkBoxButton.SetProperty(checkBoxButton.GetPropertyIndex("selected"), true);
- DALI_TEST_EQUALS( checkBoxButton.GetProperty<bool>(checkBoxButton.GetPropertyIndex("selected")), true, TEST_LOCATION );
- DALI_TEST_CHECK( gCheckBoxButtonState );
+ DALI_TEST_EQUALS(checkBoxButton.GetProperty<bool>(checkBoxButton.GetPropertyIndex("selected")), true, TEST_LOCATION);
+ DALI_TEST_CHECK(gCheckBoxButtonState);
END_TEST;
}
Property::Map propertyMap;
- propertyMap.Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT )
- .Add( Toolkit::TextVisual::Property::TEXT, "activate" )
- .Add( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f );
+ propertyMap.Add(Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT)
+ .Add(Toolkit::TextVisual::Property::TEXT, "activate")
+ .Add(Toolkit::TextVisual::Property::POINT_SIZE, 15.0f);
- checkBox.SetProperty( checkBox.GetPropertyIndex("label"), propertyMap );
+ checkBox.SetProperty(checkBox.GetPropertyIndex("label"), propertyMap);
- DALI_TEST_EQUALS( GetButtonText( checkBox ) , "activate", TEST_LOCATION );
+ DALI_TEST_EQUALS(GetButtonText(checkBox), "activate", TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
CheckBoxButton checkBox = CheckBoxButton::New();
- application.GetScene().Add( checkBox );
+ application.GetScene().Add(checkBox);
- checkBox.SetProperty( Actor::Property::SIZE, Vector2( 20.0f, 20.0f ) );
- checkBox.SetProperty(checkBox.GetPropertyIndex("disabledUnselectedBackgroundVisual"), "Image.jpg" );
+ checkBox.SetProperty(Actor::Property::SIZE, Vector2(20.0f, 20.0f));
+ checkBox.SetProperty(checkBox.GetPropertyIndex("disabledUnselectedBackgroundVisual"), "Image.jpg");
application.SendNotification();
application.Render();
Property::Map propertyMap;
- propertyMap.Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT )
- .Add( Toolkit::TextVisual::Property::TEXT, "activate" )
- .Add( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f );
+ propertyMap.Add(Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT)
+ .Add(Toolkit::TextVisual::Property::TEXT, "activate")
+ .Add(Toolkit::TextVisual::Property::POINT_SIZE, 15.0f);
checkBox.SetProperty(checkBox.GetPropertyIndex("disabled"), true);
- checkBox.SetProperty( checkBox.GetPropertyIndex("label"), propertyMap );
+ checkBox.SetProperty(checkBox.GetPropertyIndex("label"), propertyMap);
- DALI_TEST_EQUALS( checkBox.GetProperty<bool>(checkBox.GetPropertyIndex("disabled")), true, TEST_LOCATION );
- DALI_TEST_EQUALS( GetButtonText( checkBox ) , "activate", TEST_LOCATION );
+ DALI_TEST_EQUALS(checkBox.GetProperty<bool>(checkBox.GetPropertyIndex("disabled")), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetButtonText(checkBox), "activate", TEST_LOCATION);
END_TEST;
}
CheckBoxButton checkBox = CheckBoxButton::New();
checkBox.SetProperty(checkBox.GetPropertyIndex("disabled"), true);
- DALI_TEST_CHECK( checkBox.GetProperty<bool>(checkBox.GetPropertyIndex("disabled")) );
+ DALI_TEST_CHECK(checkBox.GetProperty<bool>(checkBox.GetPropertyIndex("disabled")));
checkBox.SetProperty(checkBox.GetPropertyIndex("disabled"), false);
- DALI_TEST_CHECK( !checkBox.GetProperty<bool>(checkBox.GetPropertyIndex("disabled")) );
+ DALI_TEST_CHECK(!checkBox.GetProperty<bool>(checkBox.GetPropertyIndex("disabled")));
END_TEST;
}
Property::Map propertyMap;
- propertyMap.Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT )
- .Add( Toolkit::TextVisual::Property::TEXT, "activate" )
- .Add( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f );
+ propertyMap.Add(Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT)
+ .Add(Toolkit::TextVisual::Property::TEXT, "activate")
+ .Add(Toolkit::TextVisual::Property::POINT_SIZE, 15.0f);
- checkBox.SetProperty( Toolkit::Button::Property::LABEL, propertyMap );
+ checkBox.SetProperty(Toolkit::Button::Property::LABEL, propertyMap);
application.SendNotification();
application.Render();
Vector3 orginalSize = checkBox.GetNaturalSize();
- checkBox.SetProperty( Toolkit::DevelButton::Property::LABEL_PADDING, Vector4( 10.0f, 10.0f, 10.0f, 10.0f ) );
+ checkBox.SetProperty(Toolkit::DevelButton::Property::LABEL_PADDING, Vector4(10.0f, 10.0f, 10.0f, 10.0f));
application.SendNotification();
application.Render();
Vector3 paddingAddedSize = checkBox.GetNaturalSize();
- DALI_TEST_EQUALS( checkBox.GetProperty<Vector4>( Toolkit::DevelButton::Property::LABEL_PADDING ), Vector4( 10.0f, 10.0f, 10.0f, 10.0f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+ DALI_TEST_EQUALS(checkBox.GetProperty<Vector4>(Toolkit::DevelButton::Property::LABEL_PADDING), Vector4(10.0f, 10.0f, 10.0f, 10.0f), Math::MACHINE_EPSILON_1000, TEST_LOCATION);
tet_infoline("Comparing original size of button with just text and button size with text and padding\n");
- DALI_TEST_EQUALS( orginalSize.width +10.0f + 10.0f , paddingAddedSize.width, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+ DALI_TEST_EQUALS(orginalSize.width + 10.0f + 10.0f, paddingAddedSize.width, Math::MACHINE_EPSILON_1000, TEST_LOCATION);
- DALI_TEST_EQUALS( orginalSize.height +10.0f + 10.0f , paddingAddedSize.height, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+ DALI_TEST_EQUALS(orginalSize.height + 10.0f + 10.0f, paddingAddedSize.height, Math::MACHINE_EPSILON_1000, TEST_LOCATION);
END_TEST;
}
Property::Map propertyMap;
- propertyMap.Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT )
- .Add( Toolkit::TextVisual::Property::TEXT, "activate" )
- .Add( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f );
+ propertyMap.Add(Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT)
+ .Add(Toolkit::TextVisual::Property::TEXT, "activate")
+ .Add(Toolkit::TextVisual::Property::POINT_SIZE, 15.0f);
- checkBox.SetProperty( Toolkit::Button::Property::LABEL, propertyMap );
- checkBox.SetProperty( Toolkit::DevelButton::Property::LABEL_PADDING, Vector4( 5.0f, 5.0f, 5.0f, 5.0f ) );
+ checkBox.SetProperty(Toolkit::Button::Property::LABEL, propertyMap);
+ checkBox.SetProperty(Toolkit::DevelButton::Property::LABEL_PADDING, Vector4(5.0f, 5.0f, 5.0f, 5.0f));
application.SendNotification();
application.Render();
- tet_printf( "Button RelayoutSize with text(%f,%f)\n", checkBox.GetNaturalSize().width, checkBox.GetNaturalSize().height );
+ tet_printf("Button RelayoutSize with text(%f,%f)\n", checkBox.GetNaturalSize().width, checkBox.GetNaturalSize().height);
TestPlatformAbstraction& platform = application.GetPlatform();
- platform.SetClosestImageSize( TEST_IMAGE_SIZE );
-
- checkBox.SetProperty( Toolkit::Button::Property::UNSELECTED_VISUAL, TEST_IMAGE_ONE );
- checkBox.SetProperty( Toolkit::Button::Property::SELECTED_VISUAL, TEST_IMAGE_ONE );
+ platform.SetClosestImageSize(TEST_IMAGE_SIZE);
+ checkBox.SetProperty(Toolkit::Button::Property::UNSELECTED_VISUAL, TEST_IMAGE_ONE);
+ checkBox.SetProperty(Toolkit::Button::Property::SELECTED_VISUAL, TEST_IMAGE_ONE);
application.SendNotification();
application.Render();
Vector3 preVisualPaddingSize = checkBox.GetNaturalSize();
- tet_printf( "Button RelayoutSize with text and icon (%f,%f)\n", checkBox.GetNaturalSize().width, checkBox.GetNaturalSize().height );
+ tet_printf("Button RelayoutSize with text and icon (%f,%f)\n", checkBox.GetNaturalSize().width, checkBox.GetNaturalSize().height);
- checkBox.SetProperty( Toolkit::DevelButton::Property::VISUAL_PADDING, Vector4( 25.0f, 25.0f, 25.0f, 25.0f ) );
+ checkBox.SetProperty(Toolkit::DevelButton::Property::VISUAL_PADDING, Vector4(25.0f, 25.0f, 25.0f, 25.0f));
application.SendNotification();
application.Render();
Vector3 paddingAddedSize = checkBox.GetNaturalSize();
- tet_printf( "Button RelayoutSize with text, icon and padding (%f,%f)\n", checkBox.GetNaturalSize().width, checkBox.GetNaturalSize().height );
+ tet_printf("Button RelayoutSize with text, icon and padding (%f,%f)\n", checkBox.GetNaturalSize().width, checkBox.GetNaturalSize().height);
- DALI_TEST_EQUALS( checkBox.GetProperty<Vector4>( Toolkit::DevelButton::Property::VISUAL_PADDING ), Vector4( 25.0f, 25.0f, 25.0f, 25.0f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+ DALI_TEST_EQUALS(checkBox.GetProperty<Vector4>(Toolkit::DevelButton::Property::VISUAL_PADDING), Vector4(25.0f, 25.0f, 25.0f, 25.0f), Math::MACHINE_EPSILON_1000, TEST_LOCATION);
tet_infoline("Comparing original size of button before adding padding to visual foreground\n");
- DALI_TEST_GREATER( paddingAddedSize.width, preVisualPaddingSize.width , TEST_LOCATION );
+ DALI_TEST_GREATER(paddingAddedSize.width, preVisualPaddingSize.width, TEST_LOCATION);
tet_infoline("Text and Visual are side by side, visual height and padding must be greater than text height and padding for this test\n");
- DALI_TEST_GREATER( paddingAddedSize.height, preVisualPaddingSize.height , TEST_LOCATION );
+ DALI_TEST_GREATER(paddingAddedSize.height, preVisualPaddingSize.height, TEST_LOCATION);
END_TEST;
}
tet_infoline(" UtcDaliCheckBoxButtonSetGetSelected");
CheckBoxButton checkBoxButton = CheckBoxButton::New();
- checkBoxButton.StateChangedSignal().Connect( &CheckBoxButtonClicked );
+ checkBoxButton.StateChangedSignal().Connect(&CheckBoxButtonClicked);
// global var used to check if CheckBoxButtonClicked is called;
gCheckBoxButtonState = false;
- checkBoxButton.SetProperty( Button::Property::SELECTED, true );
+ checkBoxButton.SetProperty(Button::Property::SELECTED, true);
- DALI_TEST_EQUALS( checkBoxButton.GetProperty( Button::Property::SELECTED ).Get<bool>(), true, TEST_LOCATION );
- DALI_TEST_CHECK( gCheckBoxButtonState );
+ DALI_TEST_EQUALS(checkBoxButton.GetProperty(Button::Property::SELECTED).Get<bool>(), true, TEST_LOCATION);
+ DALI_TEST_CHECK(gCheckBoxButtonState);
- checkBoxButton.SetProperty( Button::Property::SELECTED, false );
+ checkBoxButton.SetProperty(Button::Property::SELECTED, false);
- DALI_TEST_EQUALS( checkBoxButton.GetProperty( Button::Property::SELECTED ).Get<bool>(), false, TEST_LOCATION );
- DALI_TEST_CHECK( !gCheckBoxButtonState );
+ DALI_TEST_EQUALS(checkBoxButton.GetProperty(Button::Property::SELECTED).Get<bool>(), false, TEST_LOCATION);
+ DALI_TEST_CHECK(!gCheckBoxButtonState);
- checkBoxButton.SetProperty( Button::Property::SELECTED, true );
+ checkBoxButton.SetProperty(Button::Property::SELECTED, true);
- DALI_TEST_EQUALS( checkBoxButton.GetProperty( Button::Property::SELECTED ).Get<bool>(), true, TEST_LOCATION );
- DALI_TEST_CHECK( gCheckBoxButtonState );
+ DALI_TEST_EQUALS(checkBoxButton.GetProperty(Button::Property::SELECTED).Get<bool>(), true, TEST_LOCATION);
+ DALI_TEST_CHECK(gCheckBoxButtonState);
END_TEST;
}
ToolkitTestApplication application;
CheckBoxButton checkBox = CheckBoxButton::New();
- application.GetScene().Add( checkBox );
+ application.GetScene().Add(checkBox);
- checkBox.SetProperty( Actor::Property::SIZE, Vector2( 20.0f, 20.0f ) );
- checkBox.SetProperty(Button::Property::DISABLED_UNSELECTED_VISUAL, "Image.jpg" );
+ checkBox.SetProperty(Actor::Property::SIZE, Vector2(20.0f, 20.0f));
+ checkBox.SetProperty(Button::Property::DISABLED_UNSELECTED_VISUAL, "Image.jpg");
application.SendNotification();
application.Render();
Property::Map propertyMap;
- propertyMap.Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT )
- .Add( Toolkit::TextVisual::Property::TEXT, "activate" )
- .Add( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f );
+ propertyMap.Add(Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT)
+ .Add(Toolkit::TextVisual::Property::TEXT, "activate")
+ .Add(Toolkit::TextVisual::Property::POINT_SIZE, 15.0f);
checkBox.SetProperty(checkBox.GetPropertyIndex("disabled"), true);
- checkBox.SetProperty( checkBox.GetPropertyIndex("label"), propertyMap );
+ checkBox.SetProperty(checkBox.GetPropertyIndex("label"), propertyMap);
- DALI_TEST_CHECK( checkBox.GetProperty<bool>(checkBox.GetPropertyIndex("disabled")) );
- DALI_TEST_EQUALS( GetButtonText(checkBox), "activate", TEST_LOCATION );
+ DALI_TEST_CHECK(checkBox.GetProperty<bool>(checkBox.GetPropertyIndex("disabled")));
+ DALI_TEST_EQUALS(GetButtonText(checkBox), "activate", TEST_LOCATION);
END_TEST;
}
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
// 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-toolkit/devel-api/controls/popup/confirmation-popup.h>
namespace
{
-
static bool gObjectCreatedCallBackCalled;
static void TestCallback(BaseHandle handle)
} // unnamed namespace.
-
-int UtcDaliConfirmationPopupNewP( void )
+int UtcDaliConfirmationPopupNewP(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliConfirmationPopupNewP" );
+ tet_infoline(" UtcDaliConfirmationPopupNewP");
// Create the ConfirmationPopup.
ConfirmationPopup popup;
- DALI_TEST_CHECK( !popup );
+ DALI_TEST_CHECK(!popup);
popup = ConfirmationPopup::New();
- DALI_TEST_CHECK( popup );
+ DALI_TEST_CHECK(popup);
- ConfirmationPopup popup2( popup );
+ ConfirmationPopup popup2(popup);
- DALI_TEST_CHECK( popup2 == popup );
+ DALI_TEST_CHECK(popup2 == popup);
// Additional check to ensure object is created by checking if it's registered.
ObjectRegistry registry = application.GetCore().GetObjectRegistry();
- DALI_TEST_CHECK( registry );
+ DALI_TEST_CHECK(registry);
gObjectCreatedCallBackCalled = false;
- registry.ObjectCreatedSignal().Connect( &TestCallback );
+ registry.ObjectCreatedSignal().Connect(&TestCallback);
{
ConfirmationPopup popup = ConfirmationPopup::New();
}
- DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
+ DALI_TEST_CHECK(gObjectCreatedCallBackCalled);
END_TEST;
}
-int UtcDaliConfirmationPopupDestructorP( void )
+int UtcDaliConfirmationPopupDestructorP(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliConfirmationPopupDestructorP" );
+ tet_infoline(" UtcDaliConfirmationPopupDestructorP");
ConfirmationPopup* popup = new ConfirmationPopup();
delete popup;
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
END_TEST;
}
int UtcDaliConfirmationPopupDownCastP(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliConfirmationPopupDownCastP" );
+ tet_infoline(" UtcDaliConfirmationPopupDownCastP");
Handle handle = ConfirmationPopup::New();
- ConfirmationPopup popup = ConfirmationPopup::DownCast( handle );
+ ConfirmationPopup popup = ConfirmationPopup::DownCast(handle);
- DALI_TEST_CHECK( popup == handle );
+ DALI_TEST_CHECK(popup == handle);
END_TEST;
}
int UtcDaliConfirmationPopupDynamicSignalGenerationP(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliConfirmationPopupDynamicSignalGenerationP" );
+ tet_infoline(" UtcDaliConfirmationPopupDynamicSignalGenerationP");
ConfirmationPopup popup = ConfirmationPopup::New();
- TextLabel titleActor = TextLabel::New( "Title" );
- popup.SetTitle( titleActor );
+ TextLabel titleActor = TextLabel::New("Title");
+ popup.SetTitle(titleActor);
- TextLabel contentActor = TextLabel::New( "Content" );
- popup.SetContent( contentActor );
+ TextLabel contentActor = TextLabel::New("Content");
+ popup.SetContent(contentActor);
Actor footerActor = Actor::New();
// The confirmation popup can use any control type for the ok or cancel buttons.
// It requires that the name is "controlOk" to provide the "controlSignalOk" signal.
PushButton buttonOK = PushButton::New();
- buttonOK.SetProperty( Dali::Actor::Property::NAME, "controlOk" );
- footerActor.Add( buttonOK );
+ buttonOK.SetProperty(Dali::Actor::Property::NAME, "controlOk");
+ footerActor.Add(buttonOK);
PushButton buttonCancel = PushButton::New();
- buttonCancel.SetProperty( Dali::Actor::Property::NAME, "controlCancel" );
- footerActor.Add( buttonCancel );
+ buttonCancel.SetProperty(Dali::Actor::Property::NAME, "controlCancel");
+ footerActor.Add(buttonCancel);
- popup.SetFooter( footerActor );
+ popup.SetFooter(footerActor);
// Tell the confirmation popup to connect to the signal in our button called "onScene".
- popup.SetProperty( Toolkit::ConfirmationPopup::Property::CONNECT_SIGNAL_OK_SELECTED, "onScene" );
+ popup.SetProperty(Toolkit::ConfirmationPopup::Property::CONNECT_SIGNAL_OK_SELECTED, "onScene");
std::string resultProperty;
- DALI_TEST_CHECK( popup.GetProperty( Toolkit::ConfirmationPopup::Property::CONNECT_SIGNAL_OK_SELECTED ).Get( resultProperty ) );
- DALI_TEST_EQUALS( resultProperty, "onScene", TEST_LOCATION );
+ DALI_TEST_CHECK(popup.GetProperty(Toolkit::ConfirmationPopup::Property::CONNECT_SIGNAL_OK_SELECTED).Get(resultProperty));
+ DALI_TEST_EQUALS(resultProperty, "onScene", TEST_LOCATION);
// Connect to the confirmation popup's OK signal. This signal is dynamically created upon connection.
- gSignalReceivedOK = false;
- gSignalReceivedCancel = false;
+ gSignalReceivedOK = false;
+ gSignalReceivedCancel = false;
TestConnectionTrackerObject* testTracker = new TestConnectionTrackerObject();
- popup.ConnectSignal( testTracker, "controlSignalOk", ConfirmationPopupOKTestFunctor() );
+ popup.ConnectSignal(testTracker, "controlSignalOk", ConfirmationPopupOKTestFunctor());
// Check no signal has occurred yet.
- DALI_TEST_CHECK( !gSignalReceivedOK );
- DALI_TEST_CHECK( !gSignalReceivedCancel );
+ DALI_TEST_CHECK(!gSignalReceivedOK);
+ DALI_TEST_CHECK(!gSignalReceivedCancel);
// Provoke the signal.
- application.GetScene().Add( popup );
+ application.GetScene().Add(popup);
// Check the signal has occurred.
- DALI_TEST_CHECK( gSignalReceivedOK );
- DALI_TEST_CHECK( !gSignalReceivedCancel );
+ DALI_TEST_CHECK(gSignalReceivedOK);
+ DALI_TEST_CHECK(!gSignalReceivedCancel);
// Remove the popup from the stage, and connect the cancel signal.
popup.Unparent();
- popup.SetProperty( Toolkit::ConfirmationPopup::Property::CONNECT_SIGNAL_CANCEL_SELECTED, "onScene" );
- DALI_TEST_CHECK( popup.GetProperty( Toolkit::ConfirmationPopup::Property::CONNECT_SIGNAL_CANCEL_SELECTED ).Get( resultProperty ) );
- DALI_TEST_EQUALS( resultProperty, "onScene", TEST_LOCATION );
+ popup.SetProperty(Toolkit::ConfirmationPopup::Property::CONNECT_SIGNAL_CANCEL_SELECTED, "onScene");
+ DALI_TEST_CHECK(popup.GetProperty(Toolkit::ConfirmationPopup::Property::CONNECT_SIGNAL_CANCEL_SELECTED).Get(resultProperty));
+ DALI_TEST_EQUALS(resultProperty, "onScene", TEST_LOCATION);
- popup.ConnectSignal( testTracker, "controlSignalCancel", ConfirmationPopupCancelTestFunctor() );
+ popup.ConnectSignal(testTracker, "controlSignalCancel", ConfirmationPopupCancelTestFunctor());
// Check the cancel signal has not occurred yet.
- DALI_TEST_CHECK( gSignalReceivedOK );
- DALI_TEST_CHECK( !gSignalReceivedCancel );
+ DALI_TEST_CHECK(gSignalReceivedOK);
+ DALI_TEST_CHECK(!gSignalReceivedCancel);
// Provoke the signal.
- application.GetScene().Add( popup );
+ application.GetScene().Add(popup);
// Check the cancel signal has occurred.
- DALI_TEST_CHECK( gSignalReceivedOK );
- DALI_TEST_CHECK( gSignalReceivedCancel );
+ DALI_TEST_CHECK(gSignalReceivedOK);
+ DALI_TEST_CHECK(gSignalReceivedCancel);
END_TEST;
}
int UtcDaliConfirmationPopupDynamicSignalGenerationN(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliConfirmationPopupDynamicSignalGenerationN" );
+ tet_infoline(" UtcDaliConfirmationPopupDynamicSignalGenerationN");
- ConfirmationPopup popup = ConfirmationPopup::New();
+ ConfirmationPopup popup = ConfirmationPopup::New();
- TextLabel titleActor = TextLabel::New( "Title" );
- popup.SetTitle( titleActor );
+ TextLabel titleActor = TextLabel::New("Title");
+ popup.SetTitle(titleActor);
- TextLabel contentActor = TextLabel::New( "Content" );
- popup.SetContent( contentActor );
+ TextLabel contentActor = TextLabel::New("Content");
+ popup.SetContent(contentActor);
- Actor footerActor = Actor::New();
+ Actor footerActor = Actor::New();
- PushButton buttonOK = PushButton::New();
- buttonOK.SetProperty( Dali::Actor::Property::NAME, "controlOkMisnamed" );
- popup.SetFooter( buttonOK );
+ PushButton buttonOK = PushButton::New();
+ buttonOK.SetProperty(Dali::Actor::Property::NAME, "controlOkMisnamed");
+ popup.SetFooter(buttonOK);
- // Tell the confirmation popup to connect to the signal in our button called "onScene".
- popup.SetProperty( Toolkit::ConfirmationPopup::Property::CONNECT_SIGNAL_OK_SELECTED, "onScene" );
+ // Tell the confirmation popup to connect to the signal in our button called "onScene".
+ popup.SetProperty(Toolkit::ConfirmationPopup::Property::CONNECT_SIGNAL_OK_SELECTED, "onScene");
- // Connect to the confirmation popup's OK signal.
- gSignalReceivedOK = false;
+ // Connect to the confirmation popup's OK signal.
+ gSignalReceivedOK = false;
- // The connection will fail at this point as no actor with the name "controlOk" will be located.
- TestConnectionTrackerObject* testTracker = new TestConnectionTrackerObject();
- popup.ConnectSignal( testTracker, "controlSignalOk", ConfirmationPopupOKTestFunctor() );
+ // The connection will fail at this point as no actor with the name "controlOk" will be located.
+ TestConnectionTrackerObject* testTracker = new TestConnectionTrackerObject();
+ popup.ConnectSignal(testTracker, "controlSignalOk", ConfirmationPopupOKTestFunctor());
- // Check no signal has occurred yet.
- DALI_TEST_CHECK( !gSignalReceivedOK );
+ // Check no signal has occurred yet.
+ DALI_TEST_CHECK(!gSignalReceivedOK);
- // Provoke the signal.
- application.GetScene().Add( popup );
+ // Provoke the signal.
+ application.GetScene().Add(popup);
- // Check the signal has still not occurred, as our button was incorrectly named.
- DALI_TEST_CHECK( !gSignalReceivedOK );
+ // Check the signal has still not occurred, as our button was incorrectly named.
+ DALI_TEST_CHECK(!gSignalReceivedOK);
- END_TEST;
+ END_TEST;
}
int UtcDaliConfirmationPopupTypeRegistryCreation(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliConfirmationPopupTypeRegistryCreation" );
+ tet_infoline(" UtcDaliConfirmationPopupTypeRegistryCreation");
- TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo( "ConfirmationPopup" );
- DALI_TEST_CHECK( typeInfo )
+ TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo("ConfirmationPopup");
+ DALI_TEST_CHECK(typeInfo)
BaseHandle baseHandle = typeInfo.CreateInstance();
- DALI_TEST_CHECK( baseHandle )
+ DALI_TEST_CHECK(baseHandle)
- Toolkit::Popup popup = Toolkit::Popup::DownCast( baseHandle );
- popup.SetProperty( Popup::Property::ANIMATION_DURATION, 0.0f );
+ Toolkit::Popup popup = Toolkit::Popup::DownCast(baseHandle);
+ popup.SetProperty(Popup::Property::ANIMATION_DURATION, 0.0f);
- application.GetScene().Add( popup );
- popup.SetDisplayState( Toolkit::Popup::SHOWN );
+ application.GetScene().Add(popup);
+ popup.SetDisplayState(Toolkit::Popup::SHOWN);
application.SendNotification();
application.Render();
// Check the popup is shown.
- DALI_TEST_EQUALS( popup.GetDisplayState(), Popup::SHOWN, TEST_LOCATION );
+ DALI_TEST_EQUALS(popup.GetDisplayState(), Popup::SHOWN, TEST_LOCATION);
END_TEST;
}
-
-
-
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
#include <stdlib.h>
+#include <iostream>
// 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.h>
#include <dali-toolkit/dali-toolkit.h>
-#include <dali-toolkit/public-api/align-enumerations.h>
-#include <dali-toolkit/devel-api/controls/control-devel.h>
#include <dali-toolkit/devel-api/controls/alignment/alignment.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
#include <dali-toolkit/devel-api/visuals/image-visual-actions-devel.h>
-
+#include <dali-toolkit/public-api/align-enumerations.h>
+#include <dali.h>
#include <toolkit-event-thread-callback.h>
namespace
{
-
bool gObjectCreatedCallBackCalled;
void TestCallback(BaseHandle handle)
static bool gKeyInputFocusCallBackCalled;
-static void TestKeyInputFocusCallback( Control control )
+static void TestKeyInputFocusCallback(Control control)
{
tet_infoline(" TestKeyInputFocusCallback");
gKeyInputFocusCallBackCalled = true;
}
-const char* TEST_LARGE_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/tbcol.png";
-const char* TEST_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/gallery-small-1.jpg";
-const char* TEST_SVG_FILE_NAME = TEST_RESOURCE_DIR "/Kid1.svg";
+const char* TEST_LARGE_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/tbcol.png";
+const char* TEST_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/gallery-small-1.jpg";
+const char* TEST_SVG_FILE_NAME = TEST_RESOURCE_DIR "/Kid1.svg";
-Vector4 GetControlBackgroundColor( Control& control )
+Vector4 GetControlBackgroundColor(Control& control)
{
- Property::Value propValue = control.GetProperty( Control::Property::BACKGROUND );
- Property::Map* resultMap = propValue.GetMap();
- DALI_TEST_CHECK( resultMap->Find( ColorVisual::Property::MIX_COLOR ) );
+ Property::Value propValue = control.GetProperty(Control::Property::BACKGROUND);
+ Property::Map* resultMap = propValue.GetMap();
+ DALI_TEST_CHECK(resultMap->Find(ColorVisual::Property::MIX_COLOR));
Vector4 color;
- resultMap->Find( ColorVisual::Property::MIX_COLOR )->Get( color );
+ resultMap->Find(ColorVisual::Property::MIX_COLOR)->Get(color);
return color;
}
bool gResourceReadySignalFired = false;
-void ResourceReadySignal( Control control )
+void ResourceReadySignal(Control control)
{
- if( control.GetVisualResourceStatus( Control::Property::BACKGROUND ) == Visual::ResourceStatus::FAILED )
+ if(control.GetVisualResourceStatus(Control::Property::BACKGROUND) == Visual::ResourceStatus::FAILED)
{
Property::Map propertyMap;
- propertyMap.Insert( ImageVisual::Property::URL, TEST_SVG_FILE_NAME );
- control.SetProperty( Control::Property::BACKGROUND, propertyMap );
+ propertyMap.Insert(ImageVisual::Property::URL, TEST_SVG_FILE_NAME);
+ control.SetProperty(Control::Property::BACKGROUND, propertyMap);
}
gResourceReadySignalFired = true;
///////////////////////////////////////////////////////////////////////////////////////////////////
-
int UtcDaliControlConstructor(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
DummyControl dummy;
- DALI_TEST_CHECK( !Control::DownCast(dummy) );
+ DALI_TEST_CHECK(!Control::DownCast(dummy));
dummy = DummyControl::New();
- DALI_TEST_CHECK( Control::DownCast(dummy) );
+ DALI_TEST_CHECK(Control::DownCast(dummy));
END_TEST;
}
int UtcDaliControlNew(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
Control control;
- DALI_TEST_CHECK( !Control::DownCast(control) );
+ DALI_TEST_CHECK(!Control::DownCast(control));
control = Control::New();
- DALI_TEST_CHECK( Control::DownCast(control) );
+ DALI_TEST_CHECK(Control::DownCast(control));
END_TEST;
}
-
int UtcDaliControlRegister(void)
{
ToolkitTestApplication application;
// Ensure the object is registered after creation
ObjectRegistry registry = application.GetCore().GetObjectRegistry();
- DALI_TEST_CHECK( registry );
+ DALI_TEST_CHECK(registry);
gObjectCreatedCallBackCalled = false;
- registry.ObjectCreatedSignal().Connect( &TestCallback );
+ registry.ObjectCreatedSignal().Connect(&TestCallback);
{
Alignment alignment = Alignment::New();
}
- DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
+ DALI_TEST_CHECK(gObjectCreatedCallBackCalled);
END_TEST;
}
ToolkitTestApplication application;
DummyControl control = DummyControl::New();
- Control emptyControl;
+ Control emptyControl;
- Control controlCopy( control );
- DALI_TEST_CHECK( control == controlCopy );
+ Control controlCopy(control);
+ DALI_TEST_CHECK(control == controlCopy);
- Control emptyControlCopy( emptyControl );
- DALI_TEST_CHECK( emptyControl == emptyControlCopy );
+ Control emptyControlCopy(emptyControl);
+ DALI_TEST_CHECK(emptyControl == emptyControlCopy);
Control controlEquals;
controlEquals = control;
- DALI_TEST_CHECK( control == controlEquals );
+ DALI_TEST_CHECK(control == controlEquals);
Control emptyControlEquals;
emptyControlEquals = emptyControl;
- DALI_TEST_CHECK( emptyControl == emptyControlEquals );
+ DALI_TEST_CHECK(emptyControl == emptyControlEquals);
// Self assignment
control = control;
- DALI_TEST_CHECK( control == controlCopy );
+ DALI_TEST_CHECK(control == controlCopy);
END_TEST;
}
ToolkitTestApplication application;
Control control = Control::New();
- DALI_TEST_EQUALS( 1, control.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- control.SetProperty( Actor::Property::SENSITIVE, false );
- DALI_TEST_CHECK( false == control.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+ DALI_TEST_EQUALS(1, control.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ control.SetProperty(Actor::Property::SENSITIVE, false);
+ DALI_TEST_CHECK(false == control.GetProperty<bool>(Actor::Property::SENSITIVE));
- Control moved = std::move( control );
- 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( !control );
+ Control moved = std::move(control);
+ 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(!control);
END_TEST;
}
ToolkitTestApplication application;
Control control = Control::New();
- DALI_TEST_EQUALS( 1, control.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- control.SetProperty( Actor::Property::SENSITIVE, false );
- DALI_TEST_CHECK( false == control.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+ DALI_TEST_EQUALS(1, control.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ control.SetProperty(Actor::Property::SENSITIVE, false);
+ DALI_TEST_CHECK(false == control.GetProperty<bool>(Actor::Property::SENSITIVE));
Control moved;
- moved = std::move( control );
- 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( !control );
+ moved = std::move(control);
+ 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(!control);
END_TEST;
}
DummyControl control;
- DALI_TEST_CHECK( !Control::DownCast( control ) );
+ DALI_TEST_CHECK(!Control::DownCast(control));
control = DummyControl::New();
- DALI_TEST_CHECK( Control::DownCast( control ) );
+ DALI_TEST_CHECK(Control::DownCast(control));
Actor actor;
- DALI_TEST_CHECK( !Control::DownCast( actor ) );
+ DALI_TEST_CHECK(!Control::DownCast(actor));
actor = Actor::New();
- DALI_TEST_CHECK( !Control::DownCast( actor ) );
+ DALI_TEST_CHECK(!Control::DownCast(actor));
END_TEST;
}
DummyControl control;
- DALI_TEST_CHECK( !DummyControl::DownCast( control ));
+ DALI_TEST_CHECK(!DummyControl::DownCast(control));
control = DummyControl::New();
- DALI_TEST_CHECK( DummyControl::DownCast( control ) );
+ DALI_TEST_CHECK(DummyControl::DownCast(control));
Actor actor;
- DALI_TEST_CHECK( !DummyControl::DownCast( actor ) );
+ DALI_TEST_CHECK(!DummyControl::DownCast(actor));
actor = Actor::New();
- DALI_TEST_CHECK( !DummyControl::DownCast( actor ) );
+ DALI_TEST_CHECK(!DummyControl::DownCast(actor));
END_TEST;
}
ToolkitTestApplication application;
Control control = Control::New();
- application.GetScene().Add( control );
-
- DALI_TEST_EQUALS( -1, control.GetProperty( DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID ).Get< int >(), TEST_LOCATION );
- DALI_TEST_EQUALS( -1, control.GetProperty( DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID ).Get< int >(), TEST_LOCATION );
- DALI_TEST_EQUALS( -1, control.GetProperty( DevelControl::Property::UP_FOCUSABLE_ACTOR_ID ).Get< int >(), TEST_LOCATION );
- DALI_TEST_EQUALS( -1, control.GetProperty( DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID ).Get< int >(), TEST_LOCATION );
-
- control.SetProperty( DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID, 1 );
- DALI_TEST_EQUALS( 1, control.GetProperty( DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID ).Get< int >(), TEST_LOCATION );
- control.SetProperty( DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID, 2 );
- DALI_TEST_EQUALS( 2, control.GetProperty( DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID ).Get< int >(), TEST_LOCATION );
- control.SetProperty( DevelControl::Property::UP_FOCUSABLE_ACTOR_ID, 3 );
- DALI_TEST_EQUALS( 3, control.GetProperty( DevelControl::Property::UP_FOCUSABLE_ACTOR_ID ).Get< int >(), TEST_LOCATION );
- control.SetProperty( DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID, 4 );
- DALI_TEST_EQUALS( 4, control.GetProperty( DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID ).Get< int >(), TEST_LOCATION );
-
- control.SetProperty( DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID, 15 );
- DALI_TEST_EQUALS( 15, control.GetProperty( DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID ).Get< int >(), TEST_LOCATION );
- control.SetProperty( DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID, 16 );
- DALI_TEST_EQUALS( 16, control.GetProperty( DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID ).Get< int >(), TEST_LOCATION );
- control.SetProperty( DevelControl::Property::UP_FOCUSABLE_ACTOR_ID, 17 );
- DALI_TEST_EQUALS( 17, control.GetProperty( DevelControl::Property::UP_FOCUSABLE_ACTOR_ID ).Get< int >(), TEST_LOCATION );
- control.SetProperty( DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID, 18 );
- DALI_TEST_EQUALS( 18, control.GetProperty( DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID ).Get< int >(), TEST_LOCATION );
+ application.GetScene().Add(control);
+
+ DALI_TEST_EQUALS(-1, control.GetProperty(DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID).Get<int>(), TEST_LOCATION);
+ DALI_TEST_EQUALS(-1, control.GetProperty(DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID).Get<int>(), TEST_LOCATION);
+ DALI_TEST_EQUALS(-1, control.GetProperty(DevelControl::Property::UP_FOCUSABLE_ACTOR_ID).Get<int>(), TEST_LOCATION);
+ DALI_TEST_EQUALS(-1, control.GetProperty(DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID).Get<int>(), TEST_LOCATION);
+
+ control.SetProperty(DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID, 1);
+ DALI_TEST_EQUALS(1, control.GetProperty(DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID).Get<int>(), TEST_LOCATION);
+ control.SetProperty(DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID, 2);
+ DALI_TEST_EQUALS(2, control.GetProperty(DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID).Get<int>(), TEST_LOCATION);
+ control.SetProperty(DevelControl::Property::UP_FOCUSABLE_ACTOR_ID, 3);
+ DALI_TEST_EQUALS(3, control.GetProperty(DevelControl::Property::UP_FOCUSABLE_ACTOR_ID).Get<int>(), TEST_LOCATION);
+ control.SetProperty(DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID, 4);
+ DALI_TEST_EQUALS(4, control.GetProperty(DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID).Get<int>(), TEST_LOCATION);
+
+ control.SetProperty(DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID, 15);
+ DALI_TEST_EQUALS(15, control.GetProperty(DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID).Get<int>(), TEST_LOCATION);
+ control.SetProperty(DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID, 16);
+ DALI_TEST_EQUALS(16, control.GetProperty(DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID).Get<int>(), TEST_LOCATION);
+ control.SetProperty(DevelControl::Property::UP_FOCUSABLE_ACTOR_ID, 17);
+ DALI_TEST_EQUALS(17, control.GetProperty(DevelControl::Property::UP_FOCUSABLE_ACTOR_ID).Get<int>(), TEST_LOCATION);
+ control.SetProperty(DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID, 18);
+ DALI_TEST_EQUALS(18, control.GetProperty(DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID).Get<int>(), TEST_LOCATION);
END_TEST;
}
int UtcDaliControlKeyInputFocus(void)
{
ToolkitTestApplication application;
- Integration::Scene stage = application.GetScene();
+ Integration::Scene stage = application.GetScene();
DummyControl control;
PushButton pushButton1 = PushButton::New();
- stage.Add( pushButton1 );
+ stage.Add(pushButton1);
pushButton1.SetKeyInputFocus();
- DALI_TEST_CHECK( pushButton1.HasKeyInputFocus() );
+ DALI_TEST_CHECK(pushButton1.HasKeyInputFocus());
pushButton1.ClearKeyInputFocus();
- DALI_TEST_CHECK( !pushButton1.HasKeyInputFocus() );
+ DALI_TEST_CHECK(!pushButton1.HasKeyInputFocus());
END_TEST;
}
int UtcDaliControlGetImplementationN(void)
{
ToolkitTestApplication application;
- DummyControl control;
+ DummyControl control;
// Get Empty
{
try
{
- Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( control );
+ Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation(control);
(void)controlImpl; // Avoid unused warning
tet_result(TET_FAIL);
}
- catch (DaliException &exception)
+ catch(DaliException& exception)
{
tet_result(TET_PASS);
}
int UtcDaliControlGetImplementationConstN(void)
{
ToolkitTestApplication application;
- DummyControl control;
+ DummyControl control;
// Get Const Empty
{
try
{
- const DummyControl constControl(control);
- const Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( constControl );
+ const DummyControl constControl(control);
+ const Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation(constControl);
(void)controlImpl; // Avoid unused warning
tet_result(TET_FAIL);
}
- catch (DaliException &exception)
+ catch(DaliException& exception)
{
tet_result(TET_PASS);
}
int UtcDaliControlGetImplementationP(void)
{
ToolkitTestApplication application;
- DummyControl control = DummyControl::New();
+ DummyControl control = DummyControl::New();
// Get
{
try
{
- Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( control );
+ Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation(control);
(void)controlImpl; // Avoid unused warning
tet_result(TET_PASS);
}
- catch (DaliException &exception)
+ catch(DaliException& exception)
{
tet_result(TET_FAIL);
}
int UtcDaliControlGetImplementationConstP(void)
{
ToolkitTestApplication application;
- DummyControl control = DummyControl::New();
+ DummyControl control = DummyControl::New();
// Get Const
{
try
{
- const DummyControl constControl(control);
- const Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( constControl );
+ const DummyControl constControl(control);
+ const Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation(constControl);
(void)controlImpl; // Avoid unused warning
tet_result(TET_PASS);
}
- catch (DaliException &exception)
+ catch(DaliException& exception)
{
tet_result(TET_FAIL);
}
DummyControl dummy = DummyControlImpl::New();
Actor actor = Actor::New();
- DALI_TEST_EQUALS( actor.OnSceneSignal().GetConnectionCount(), 0u, TEST_LOCATION );
- Toolkit::Internal::Control& control = Toolkit::Internal::GetImplementation( dummy );
- DummyControlImpl* dummyImpl = dynamic_cast<DummyControlImpl*>(&control);
+ DALI_TEST_EQUALS(actor.OnSceneSignal().GetConnectionCount(), 0u, TEST_LOCATION);
+ Toolkit::Internal::Control& control = Toolkit::Internal::GetImplementation(dummy);
+ DummyControlImpl* dummyImpl = dynamic_cast<DummyControlImpl*>(&control);
- if( dummyImpl == NULL )
+ if(dummyImpl == NULL)
{
- tet_result( TET_FAIL );
+ tet_result(TET_FAIL);
END_TEST;
}
- actor.OnSceneSignal().Connect( dummyImpl, &DummyControlImpl::CustomSlot1 );
- DALI_TEST_EQUALS( actor.OnSceneSignal().GetConnectionCount(), 1u, TEST_LOCATION );
- DALI_TEST_EQUALS( dummyImpl->mCustomSlot1Called, false, TEST_LOCATION );
+ actor.OnSceneSignal().Connect(dummyImpl, &DummyControlImpl::CustomSlot1);
+ DALI_TEST_EQUALS(actor.OnSceneSignal().GetConnectionCount(), 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(dummyImpl->mCustomSlot1Called, false, TEST_LOCATION);
- application.GetScene().Add( actor );
- DALI_TEST_EQUALS( dummyImpl->mCustomSlot1Called, true, TEST_LOCATION );
+ application.GetScene().Add(actor);
+ DALI_TEST_EQUALS(dummyImpl->mCustomSlot1Called, true, TEST_LOCATION);
dummyImpl->mCustomSlot1Called = false;
- actor.OnSceneSignal().Disconnect( dummyImpl, &DummyControlImpl::CustomSlot1 );
- DALI_TEST_EQUALS( actor.OnSceneSignal().GetConnectionCount(), 0u, TEST_LOCATION );
- application.GetScene().Remove( actor );
- application.GetScene().Add( actor );
- DALI_TEST_EQUALS( dummyImpl->mCustomSlot1Called, false, TEST_LOCATION );
+ actor.OnSceneSignal().Disconnect(dummyImpl, &DummyControlImpl::CustomSlot1);
+ DALI_TEST_EQUALS(actor.OnSceneSignal().GetConnectionCount(), 0u, TEST_LOCATION);
+ application.GetScene().Remove(actor);
+ application.GetScene().Add(actor);
+ DALI_TEST_EQUALS(dummyImpl->mCustomSlot1Called, false, TEST_LOCATION);
}
END_TEST;
}
Actor actor = Actor::New();
{
- DummyControl dummy = DummyControlImpl::New();
- Toolkit::Internal::Control& control = Toolkit::Internal::GetImplementation( dummy );
- DummyControlImpl* dummyImpl = dynamic_cast<DummyControlImpl*>(&control);
+ DummyControl dummy = DummyControlImpl::New();
+ Toolkit::Internal::Control& control = Toolkit::Internal::GetImplementation(dummy);
+ DummyControlImpl* dummyImpl = dynamic_cast<DummyControlImpl*>(&control);
- if( dummyImpl == NULL )
+ if(dummyImpl == NULL)
{
- tet_result( TET_FAIL );
+ tet_result(TET_FAIL);
END_TEST;
}
- actor.OnSceneSignal().Connect( dummyImpl, &DummyControlImpl::CustomSlot1 );
- DALI_TEST_EQUALS( actor.OnSceneSignal().GetConnectionCount(), 1u, TEST_LOCATION );
- DALI_TEST_EQUALS( dummyImpl->mCustomSlot1Called, false, TEST_LOCATION );
+ actor.OnSceneSignal().Connect(dummyImpl, &DummyControlImpl::CustomSlot1);
+ DALI_TEST_EQUALS(actor.OnSceneSignal().GetConnectionCount(), 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(dummyImpl->mCustomSlot1Called, false, TEST_LOCATION);
- application.GetScene().Add( actor );
- DALI_TEST_EQUALS( dummyImpl->mCustomSlot1Called, true, TEST_LOCATION );
- application.GetScene().Remove( actor );
+ application.GetScene().Add(actor);
+ DALI_TEST_EQUALS(dummyImpl->mCustomSlot1Called, true, TEST_LOCATION);
+ application.GetScene().Remove(actor);
}
// dummyControl automatically disconnects
- DALI_TEST_EQUALS( actor.OnSceneSignal().GetConnectionCount(), 0u, TEST_LOCATION );
+ DALI_TEST_EQUALS(actor.OnSceneSignal().GetConnectionCount(), 0u, TEST_LOCATION);
- const Vector3 ignoredSize( 20, 20, 0 );
- actor.SetProperty( Actor::Property::SIZE, ignoredSize );
+ const Vector3 ignoredSize(20, 20, 0);
+ actor.SetProperty(Actor::Property::SIZE, ignoredSize);
END_TEST;
}
int UtcDaliControlTestParameters(void)
{
ToolkitTestApplication application;
- DummyControl test = DummyControl::New();
+ DummyControl test = DummyControl::New();
- test.SetProperty( Actor::Property::SIZE, Vector3( 0.7f, 0.7f, 0.7f ) );
+ test.SetProperty(Actor::Property::SIZE, Vector3(0.7f, 0.7f, 0.7f));
- application.GetScene().Add( test );
+ application.GetScene().Add(test);
application.SendNotification();
application.Render();
- float width = 640.0f;
- float height = test.GetHeightForWidth( width );
- DALI_TEST_EQUALS( 640.0f, height, TEST_LOCATION );
- DALI_TEST_EQUALS( 640.0f, test.GetWidthForHeight( height ), TEST_LOCATION );
+ float width = 640.0f;
+ float height = test.GetHeightForWidth(width);
+ DALI_TEST_EQUALS(640.0f, height, TEST_LOCATION);
+ DALI_TEST_EQUALS(640.0f, test.GetWidthForHeight(height), TEST_LOCATION);
test.KeyEventSignal();
// Provide coverage for pointer destructor
Control* testControlPtr = new Control;
- DALI_TEST_CHECK( testControlPtr );
+ DALI_TEST_CHECK(testControlPtr);
delete testControlPtr;
END_TEST;
}
int UtcDaliControlBackgroundColor(void)
{
ToolkitTestApplication application;
- Control control = Control::New();
+ Control control = Control::New();
- DALI_TEST_CHECK( control.GetProperty( Control::Property::BACKGROUND ).Get< Property::Map >().Empty() );
+ DALI_TEST_CHECK(control.GetProperty(Control::Property::BACKGROUND).Get<Property::Map>().Empty());
- control.SetProperty( Control::Property::BACKGROUND, Color::RED );
+ control.SetProperty(Control::Property::BACKGROUND, Color::RED);
- Property::Value propValue = control.GetProperty( Control::Property::BACKGROUND );
- Property::Map* resultMap = propValue.GetMap();
- DALI_TEST_CHECK( resultMap->Find( Toolkit::Visual::Property::TYPE ) );
- DALI_TEST_CHECK( resultMap->Find( Toolkit::Visual::Property::TYPE )->Get<int>() == Visual::COLOR );
- DALI_TEST_CHECK( resultMap->Find( ColorVisual::Property::MIX_COLOR ) );
- DALI_TEST_CHECK( resultMap->Find( ColorVisual::Property::MIX_COLOR )->Get<Vector4>() == Color::RED );
+ Property::Value propValue = control.GetProperty(Control::Property::BACKGROUND);
+ Property::Map* resultMap = propValue.GetMap();
+ DALI_TEST_CHECK(resultMap->Find(Toolkit::Visual::Property::TYPE));
+ DALI_TEST_CHECK(resultMap->Find(Toolkit::Visual::Property::TYPE)->Get<int>() == Visual::COLOR);
+ DALI_TEST_CHECK(resultMap->Find(ColorVisual::Property::MIX_COLOR));
+ DALI_TEST_CHECK(resultMap->Find(ColorVisual::Property::MIX_COLOR)->Get<Vector4>() == Color::RED);
- control.SetProperty( Control::Property::BACKGROUND, Color::YELLOW );
+ control.SetProperty(Control::Property::BACKGROUND, Color::YELLOW);
- propValue = control.GetProperty( Control::Property::BACKGROUND );
+ propValue = control.GetProperty(Control::Property::BACKGROUND);
resultMap = propValue.GetMap();
- DALI_TEST_CHECK( resultMap->Find( ColorVisual::Property::MIX_COLOR ) );
- DALI_TEST_CHECK( resultMap->Find( ColorVisual::Property::MIX_COLOR )->Get<Vector4>() == Color::YELLOW );
+ DALI_TEST_CHECK(resultMap->Find(ColorVisual::Property::MIX_COLOR));
+ DALI_TEST_CHECK(resultMap->Find(ColorVisual::Property::MIX_COLOR)->Get<Vector4>() == Color::YELLOW);
END_TEST;
}
int UtcDaliControlBackgroundColorRendererCount(void)
{
- tet_infoline( "Test ensures we only create renderers when non-transparent color is requested or if we our clipping-mode is set to CLIP_CHILDREN" );
+ tet_infoline("Test ensures we only create renderers when non-transparent color is requested or if we our clipping-mode is set to CLIP_CHILDREN");
ToolkitTestApplication application;
- Control control = Control::New();
+ Control control = Control::New();
control[Actor::Property::SIZE] = Vector2(100.0f, 100.0f);
- application.GetScene().Add( control );
+ application.GetScene().Add(control);
- tet_infoline( "Set semi transparent alpha with positive RGB values, 1 renderer should be created, but returned color should reflect what we set" );
- const Vector4 semiTransparent( 1.0f, 0.75f, 0.5f, 0.5f );
- control.SetBackgroundColor( semiTransparent );
+ tet_infoline("Set semi transparent alpha with positive RGB values, 1 renderer should be created, but returned color should reflect what we set");
+ const Vector4 semiTransparent(1.0f, 0.75f, 0.5f, 0.5f);
+ control.SetBackgroundColor(semiTransparent);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( control.GetRendererCount(), 1u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetControlBackgroundColor( control ), semiTransparent, TEST_LOCATION );
+ DALI_TEST_EQUALS(control.GetRendererCount(), 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetControlBackgroundColor(control), semiTransparent, TEST_LOCATION);
- Renderer renderer = control.GetRendererAt( 0 );
- DALI_TEST_CHECK( renderer );
+ Renderer renderer = control.GetRendererAt(0);
+ DALI_TEST_CHECK(renderer);
- tet_infoline( "Set semi transparent alpha with positive RGB values, renderer should not be changed" );
- const Vector4 newColor( 1.0f, 1.0f, 0.5f, 0.5f );
- control.SetBackgroundColor( newColor );
+ tet_infoline("Set semi transparent alpha with positive RGB values, renderer should not be changed");
+ const Vector4 newColor(1.0f, 1.0f, 0.5f, 0.5f);
+ control.SetBackgroundColor(newColor);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( control.GetRendererCount(), 1u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetControlBackgroundColor( control ), newColor, TEST_LOCATION );
- DALI_TEST_EQUALS( renderer, control.GetRendererAt( 0 ), TEST_LOCATION );
+ DALI_TEST_EQUALS(control.GetRendererCount(), 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetControlBackgroundColor(control), newColor, TEST_LOCATION);
+ DALI_TEST_EQUALS(renderer, control.GetRendererAt(0), TEST_LOCATION);
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& drawTrace = gl.GetDrawTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& drawTrace = gl.GetDrawTrace();
drawTrace.Enable(true);
- tet_infoline( "Set transparent, 1 renderer should be created, but ensure nothing is drawn" );
- control.SetBackgroundColor( Color::TRANSPARENT );
+ tet_infoline("Set transparent, 1 renderer should be created, but ensure nothing is drawn");
+ control.SetBackgroundColor(Color::TRANSPARENT);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( control.GetRendererCount(), 1u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetControlBackgroundColor( control ), Color::TRANSPARENT, TEST_LOCATION );
+ DALI_TEST_EQUALS(control.GetRendererCount(), 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetControlBackgroundColor(control), Color::TRANSPARENT, TEST_LOCATION);
DALI_TEST_EQUALS(drawTrace.FindMethod("DrawArrays"), false, TEST_LOCATION);
drawTrace.Reset();
- tet_infoline( "Set control to clip its children, a renderer should be created which will be transparent" );
- control.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
+ tet_infoline("Set control to clip its children, a renderer should be created which will be transparent");
+ control.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( control.GetRendererCount(), 1u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetControlBackgroundColor( control ), Color::TRANSPARENT, TEST_LOCATION );
+ DALI_TEST_EQUALS(control.GetRendererCount(), 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetControlBackgroundColor(control), Color::TRANSPARENT, TEST_LOCATION);
DALI_TEST_EQUALS(drawTrace.FindMethod("DrawArrays"), true, TEST_LOCATION);
- tet_infoline( "Set a color, only 1 renderer should exist" );
- control.SetBackgroundColor( Color::RED );
+ tet_infoline("Set a color, only 1 renderer should exist");
+ control.SetBackgroundColor(Color::RED);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( control.GetRendererCount(), 1u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetControlBackgroundColor( control ), Color::RED, TEST_LOCATION );
+ DALI_TEST_EQUALS(control.GetRendererCount(), 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetControlBackgroundColor(control), Color::RED, TEST_LOCATION);
- tet_infoline( "Clear the background, no renderers" );
+ tet_infoline("Clear the background, no renderers");
control.ClearBackground();
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( control.GetRendererCount(), 0u, TEST_LOCATION );
+ DALI_TEST_EQUALS(control.GetRendererCount(), 0u, TEST_LOCATION);
- tet_infoline( "Set control to clip its children again, a renderer should be created which will be transparent" );
- control.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
+ tet_infoline("Set control to clip its children again, a renderer should be created which will be transparent");
+ control.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( control.GetRendererCount(), 1u, TEST_LOCATION );
- DALI_TEST_EQUALS( GetControlBackgroundColor( control ), Color::TRANSPARENT, TEST_LOCATION );
+ DALI_TEST_EQUALS(control.GetRendererCount(), 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetControlBackgroundColor(control), Color::TRANSPARENT, TEST_LOCATION);
drawTrace.Reset();
- tet_infoline( "Disable clipping, render nothing" );
- control.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::DISABLED );
+ tet_infoline("Disable clipping, render nothing");
+ control.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::DISABLED);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( GetControlBackgroundColor( control ), Color::TRANSPARENT, TEST_LOCATION );
+ DALI_TEST_EQUALS(GetControlBackgroundColor(control), Color::TRANSPARENT, TEST_LOCATION);
DALI_TEST_EQUALS(drawTrace.FindMethod("DrawArrays"), false, TEST_LOCATION);
END_TEST;
int UtcDaliControlBackgroundImage(void)
{
ToolkitTestApplication application;
- Control control = Control::New();
+ Control control = Control::New();
- tet_infoline( "Set first background image" );
- control.SetProperty( Control::Property::BACKGROUND, "TestImage" );
+ tet_infoline("Set first background image");
+ control.SetProperty(Control::Property::BACKGROUND, "TestImage");
- Property::Value propValue = control.GetProperty( Control::Property::BACKGROUND );
- Property::Map* resultMap = propValue.GetMap();
- DALI_TEST_CHECK( resultMap->Find( Toolkit::Visual::Property::TYPE ) );
- DALI_TEST_CHECK( resultMap->Find( Toolkit::Visual::Property::TYPE )->Get<int>() == Visual::IMAGE );
- DALI_TEST_CHECK( resultMap->Find( ImageVisual::Property::URL ) );
- DALI_TEST_CHECK( resultMap->Find( ImageVisual::Property::URL )->Get<std::string>() == "TestImage" );
+ Property::Value propValue = control.GetProperty(Control::Property::BACKGROUND);
+ Property::Map* resultMap = propValue.GetMap();
+ DALI_TEST_CHECK(resultMap->Find(Toolkit::Visual::Property::TYPE));
+ DALI_TEST_CHECK(resultMap->Find(Toolkit::Visual::Property::TYPE)->Get<int>() == Visual::IMAGE);
+ DALI_TEST_CHECK(resultMap->Find(ImageVisual::Property::URL));
+ DALI_TEST_CHECK(resultMap->Find(ImageVisual::Property::URL)->Get<std::string>() == "TestImage");
- tet_infoline( "Set replacement background image" );
- control.SetProperty( Control::Property::BACKGROUND, "TestImage2" );
+ tet_infoline("Set replacement background image");
+ control.SetProperty(Control::Property::BACKGROUND, "TestImage2");
- propValue = control.GetProperty( Control::Property::BACKGROUND );
+ propValue = control.GetProperty(Control::Property::BACKGROUND);
resultMap = propValue.GetMap();
- DALI_TEST_CHECK( resultMap->Find( ImageVisual::Property::URL ) );
- DALI_TEST_CHECK( resultMap->Find( ImageVisual::Property::URL )->Get<std::string>() == "TestImage2" );
+ DALI_TEST_CHECK(resultMap->Find(ImageVisual::Property::URL));
+ DALI_TEST_CHECK(resultMap->Find(ImageVisual::Property::URL)->Get<std::string>() == "TestImage2");
END_TEST;
}
int UtcDaliControlBackgroundProperties(void)
{
ToolkitTestApplication application;
- Control control = Control::New();
+ Control control = Control::New();
- DALI_TEST_CHECK( control.GetProperty( Control::Property::BACKGROUND ).Get< Property::Map >().Empty() );
+ DALI_TEST_CHECK(control.GetProperty(Control::Property::BACKGROUND).Get<Property::Map>().Empty());
Property::Map imageMap;
- imageMap[ Toolkit::Visual::Property::TYPE ] = Visual::IMAGE;
- imageMap[ ImageVisual::Property::URL ] = "TestImage";
- control.SetProperty( Control::Property::BACKGROUND, imageMap );
- Property::Value propValue = control.GetProperty( Control::Property::BACKGROUND );
- Property::Map* resultMap = propValue.GetMap();
- DALI_TEST_CHECK( resultMap->Find( Toolkit::Visual::Property::TYPE ) );
- DALI_TEST_EQUALS( resultMap->Find( Toolkit::Visual::Property::TYPE )->Get<int>(),(int)Visual::IMAGE, TEST_LOCATION );
- DALI_TEST_CHECK( resultMap->Find( ImageVisual::Property::URL ) );
- DALI_TEST_EQUALS( resultMap->Find( ImageVisual::Property::URL )->Get<std::string>(), "TestImage", TEST_LOCATION );
+ imageMap[Toolkit::Visual::Property::TYPE] = Visual::IMAGE;
+ imageMap[ImageVisual::Property::URL] = "TestImage";
+ control.SetProperty(Control::Property::BACKGROUND, imageMap);
+ Property::Value propValue = control.GetProperty(Control::Property::BACKGROUND);
+ Property::Map* resultMap = propValue.GetMap();
+ DALI_TEST_CHECK(resultMap->Find(Toolkit::Visual::Property::TYPE));
+ DALI_TEST_EQUALS(resultMap->Find(Toolkit::Visual::Property::TYPE)->Get<int>(), (int)Visual::IMAGE, TEST_LOCATION);
+ DALI_TEST_CHECK(resultMap->Find(ImageVisual::Property::URL));
+ DALI_TEST_EQUALS(resultMap->Find(ImageVisual::Property::URL)->Get<std::string>(), "TestImage", TEST_LOCATION);
Property::Map rendererMap;
- rendererMap[Visual::Property::TYPE] = Visual::COLOR;
+ rendererMap[Visual::Property::TYPE] = Visual::COLOR;
rendererMap[ColorVisual::Property::MIX_COLOR] = Color::CYAN;
- control.SetProperty( Control::Property::BACKGROUND, rendererMap );
- propValue = control.GetProperty( Control::Property::BACKGROUND );
+ control.SetProperty(Control::Property::BACKGROUND, rendererMap);
+ propValue = control.GetProperty(Control::Property::BACKGROUND);
resultMap = propValue.GetMap();
- DALI_TEST_CHECK( resultMap->Find( Toolkit::Visual::Property::TYPE ) );
- DALI_TEST_EQUALS( resultMap->Find( Toolkit::Visual::Property::TYPE )->Get<int>(), (int)Visual::COLOR, TEST_LOCATION );
- DALI_TEST_CHECK( resultMap->Find( ColorVisual::Property::MIX_COLOR ) );
- DALI_TEST_EQUALS( resultMap->Find( ColorVisual::Property::MIX_COLOR )->Get<Vector4>(), Color::CYAN, TEST_LOCATION );
+ DALI_TEST_CHECK(resultMap->Find(Toolkit::Visual::Property::TYPE));
+ DALI_TEST_EQUALS(resultMap->Find(Toolkit::Visual::Property::TYPE)->Get<int>(), (int)Visual::COLOR, TEST_LOCATION);
+ DALI_TEST_CHECK(resultMap->Find(ColorVisual::Property::MIX_COLOR));
+ DALI_TEST_EQUALS(resultMap->Find(ColorVisual::Property::MIX_COLOR)->Get<Vector4>(), Color::CYAN, TEST_LOCATION);
Property::Map emptyMap;
- control.SetProperty( Control::Property::BACKGROUND, emptyMap );
- DALI_TEST_CHECK( control.GetProperty( Control::Property::BACKGROUND ).Get< Property::Map >().Empty() );
+ control.SetProperty(Control::Property::BACKGROUND, emptyMap);
+ DALI_TEST_CHECK(control.GetProperty(Control::Property::BACKGROUND).Get<Property::Map>().Empty());
// set as URL
- control.SetProperty( Control::Property::BACKGROUND, "Foobar.png" );
- propValue = control.GetProperty( Control::Property::BACKGROUND );
+ control.SetProperty(Control::Property::BACKGROUND, "Foobar.png");
+ propValue = control.GetProperty(Control::Property::BACKGROUND);
resultMap = propValue.GetMap();
- DALI_TEST_EQUALS( resultMap->Find( Toolkit::Visual::Property::TYPE )->Get<int>(), (int)Visual::IMAGE, TEST_LOCATION );
- DALI_TEST_EQUALS( resultMap->Find( ImageVisual::Property::URL )->Get<std::string>(), "Foobar.png", TEST_LOCATION );
+ DALI_TEST_EQUALS(resultMap->Find(Toolkit::Visual::Property::TYPE)->Get<int>(), (int)Visual::IMAGE, TEST_LOCATION);
+ DALI_TEST_EQUALS(resultMap->Find(ImageVisual::Property::URL)->Get<std::string>(), "Foobar.png", TEST_LOCATION);
// set as Color
- control.SetProperty( Control::Property::BACKGROUND, Color::RED );
- propValue = control.GetProperty( Control::Property::BACKGROUND );
+ control.SetProperty(Control::Property::BACKGROUND, Color::RED);
+ propValue = control.GetProperty(Control::Property::BACKGROUND);
resultMap = propValue.GetMap();
- DALI_TEST_EQUALS( resultMap->Find( Toolkit::Visual::Property::TYPE )->Get<int>(), (int)Visual::COLOR, TEST_LOCATION );
- DALI_TEST_EQUALS( resultMap->Find( ColorVisual::Property::MIX_COLOR )->Get<Vector4>(), Color::RED, TEST_LOCATION );
+ DALI_TEST_EQUALS(resultMap->Find(Toolkit::Visual::Property::TYPE)->Get<int>(), (int)Visual::COLOR, TEST_LOCATION);
+ DALI_TEST_EQUALS(resultMap->Find(ColorVisual::Property::MIX_COLOR)->Get<Vector4>(), Color::RED, TEST_LOCATION);
END_TEST;
}
int UtcDaliControlShadowProperties(void)
{
ToolkitTestApplication application;
- Control control = Control::New();
+ Control control = Control::New();
- DALI_TEST_CHECK( control.GetProperty( DevelControl::Property::SHADOW ).Get< Property::Map >().Empty() );
+ DALI_TEST_CHECK(control.GetProperty(DevelControl::Property::SHADOW).Get<Property::Map>().Empty());
Property::Map imageMap;
- imageMap[ Toolkit::Visual::Property::TYPE ] = Visual::IMAGE;
- imageMap[ ImageVisual::Property::URL ] = "TestImage";
- control.SetProperty( DevelControl::Property::SHADOW, imageMap );
- Property::Value propValue = control.GetProperty( DevelControl::Property::SHADOW );
- Property::Map* resultMap = propValue.GetMap();
- DALI_TEST_CHECK( resultMap->Find( Toolkit::Visual::Property::TYPE ) );
- DALI_TEST_EQUALS( resultMap->Find( Toolkit::Visual::Property::TYPE )->Get<int>(),(int)Visual::IMAGE, TEST_LOCATION );
- DALI_TEST_CHECK( resultMap->Find( ImageVisual::Property::URL ) );
- DALI_TEST_EQUALS( resultMap->Find( ImageVisual::Property::URL )->Get<std::string>(), "TestImage", TEST_LOCATION );
+ imageMap[Toolkit::Visual::Property::TYPE] = Visual::IMAGE;
+ imageMap[ImageVisual::Property::URL] = "TestImage";
+ control.SetProperty(DevelControl::Property::SHADOW, imageMap);
+ Property::Value propValue = control.GetProperty(DevelControl::Property::SHADOW);
+ Property::Map* resultMap = propValue.GetMap();
+ DALI_TEST_CHECK(resultMap->Find(Toolkit::Visual::Property::TYPE));
+ DALI_TEST_EQUALS(resultMap->Find(Toolkit::Visual::Property::TYPE)->Get<int>(), (int)Visual::IMAGE, TEST_LOCATION);
+ DALI_TEST_CHECK(resultMap->Find(ImageVisual::Property::URL));
+ DALI_TEST_EQUALS(resultMap->Find(ImageVisual::Property::URL)->Get<std::string>(), "TestImage", TEST_LOCATION);
Property::Map colorMap;
- colorMap[Visual::Property::TYPE] = Visual::COLOR;
+ colorMap[Visual::Property::TYPE] = Visual::COLOR;
colorMap[ColorVisual::Property::MIX_COLOR] = Color::CYAN;
- control.SetProperty( DevelControl::Property::SHADOW, colorMap );
- propValue = control.GetProperty( DevelControl::Property::SHADOW );
+ control.SetProperty(DevelControl::Property::SHADOW, colorMap);
+ propValue = control.GetProperty(DevelControl::Property::SHADOW);
resultMap = propValue.GetMap();
- DALI_TEST_CHECK( resultMap->Find( Toolkit::Visual::Property::TYPE ) );
- DALI_TEST_EQUALS( resultMap->Find( Toolkit::Visual::Property::TYPE )->Get<int>(), (int)Visual::COLOR, TEST_LOCATION );
- DALI_TEST_CHECK( resultMap->Find( ColorVisual::Property::MIX_COLOR ) );
- DALI_TEST_EQUALS( resultMap->Find( ColorVisual::Property::MIX_COLOR )->Get<Vector4>(), Color::CYAN, TEST_LOCATION );
+ DALI_TEST_CHECK(resultMap->Find(Toolkit::Visual::Property::TYPE));
+ DALI_TEST_EQUALS(resultMap->Find(Toolkit::Visual::Property::TYPE)->Get<int>(), (int)Visual::COLOR, TEST_LOCATION);
+ DALI_TEST_CHECK(resultMap->Find(ColorVisual::Property::MIX_COLOR));
+ DALI_TEST_EQUALS(resultMap->Find(ColorVisual::Property::MIX_COLOR)->Get<Vector4>(), Color::CYAN, TEST_LOCATION);
Property::Map emptyMap;
- control.SetProperty( DevelControl::Property::SHADOW, emptyMap );
- DALI_TEST_CHECK( control.GetProperty( DevelControl::Property::SHADOW ).Get< Property::Map >().Empty() );
+ control.SetProperty(DevelControl::Property::SHADOW, emptyMap);
+ DALI_TEST_CHECK(control.GetProperty(DevelControl::Property::SHADOW).Get<Property::Map>().Empty());
END_TEST;
}
ToolkitTestApplication application;
Control control = Control::New();
- application.GetScene().Add( control );
+ application.GetScene().Add(control);
- DALI_TEST_EQUALS( control.HasKeyInputFocus(), control.GetProperty( Control::Property::KEY_INPUT_FOCUS ).Get< bool >(), TEST_LOCATION );
+ DALI_TEST_EQUALS(control.HasKeyInputFocus(), control.GetProperty(Control::Property::KEY_INPUT_FOCUS).Get<bool>(), TEST_LOCATION);
control.SetKeyInputFocus();
- DALI_TEST_EQUALS( true, control.GetProperty( Control::Property::KEY_INPUT_FOCUS ).Get< bool >(), TEST_LOCATION );
+ DALI_TEST_EQUALS(true, control.GetProperty(Control::Property::KEY_INPUT_FOCUS).Get<bool>(), TEST_LOCATION);
control.ClearKeyInputFocus();
- DALI_TEST_EQUALS( false, control.GetProperty( Control::Property::KEY_INPUT_FOCUS ).Get< bool >(), TEST_LOCATION );
+ DALI_TEST_EQUALS(false, control.GetProperty(Control::Property::KEY_INPUT_FOCUS).Get<bool>(), TEST_LOCATION);
- control.SetProperty( Control::Property::KEY_INPUT_FOCUS, true );
- DALI_TEST_EQUALS( true, control.HasKeyInputFocus(), TEST_LOCATION );
+ control.SetProperty(Control::Property::KEY_INPUT_FOCUS, true);
+ DALI_TEST_EQUALS(true, control.HasKeyInputFocus(), TEST_LOCATION);
END_TEST;
}
int UtcDaliControlGestureSignals(void)
{
ToolkitTestApplication application;
- ConnectionTracker connectionTracker;
- Control control = Control::New();
+ ConnectionTracker connectionTracker;
+ Control control = Control::New();
// Each gesture detector gets created when connecting to the gesture signals
- DALI_TEST_CHECK( !control.GetTapGestureDetector() );
- control.ConnectSignal( &connectionTracker, "tapped", &TestVoidCallback );
- DALI_TEST_CHECK( control.GetTapGestureDetector() );
+ DALI_TEST_CHECK(!control.GetTapGestureDetector());
+ control.ConnectSignal(&connectionTracker, "tapped", &TestVoidCallback);
+ DALI_TEST_CHECK(control.GetTapGestureDetector());
- DALI_TEST_CHECK( !control.GetPanGestureDetector() );
- control.ConnectSignal( &connectionTracker, "panned", &TestVoidCallback );
- DALI_TEST_CHECK( control.GetPanGestureDetector() );
+ DALI_TEST_CHECK(!control.GetPanGestureDetector());
+ control.ConnectSignal(&connectionTracker, "panned", &TestVoidCallback);
+ DALI_TEST_CHECK(control.GetPanGestureDetector());
- DALI_TEST_CHECK( !control.GetPinchGestureDetector() );
- control.ConnectSignal( &connectionTracker, "pinched", &TestVoidCallback );
- DALI_TEST_CHECK( control.GetPinchGestureDetector() );
+ DALI_TEST_CHECK(!control.GetPinchGestureDetector());
+ control.ConnectSignal(&connectionTracker, "pinched", &TestVoidCallback);
+ DALI_TEST_CHECK(control.GetPinchGestureDetector());
- DALI_TEST_CHECK( !control.GetLongPressGestureDetector() );
- control.ConnectSignal( &connectionTracker, "longPressed", &TestVoidCallback );
- DALI_TEST_CHECK( control.GetLongPressGestureDetector() );
+ DALI_TEST_CHECK(!control.GetLongPressGestureDetector());
+ control.ConnectSignal(&connectionTracker, "longPressed", &TestVoidCallback);
+ DALI_TEST_CHECK(control.GetLongPressGestureDetector());
END_TEST;
}
ToolkitTestApplication application;
Control control = Control::New();
- application.GetScene().Add( control );
+ application.GetScene().Add(control);
gKeyInputFocusCallBackCalled = false;
control.KeyInputFocusGainedSignal().Connect(&TestKeyInputFocusCallback);
control.SetKeyInputFocus();
- DALI_TEST_CHECK( control.HasKeyInputFocus() );
+ DALI_TEST_CHECK(control.HasKeyInputFocus());
- DALI_TEST_CHECK( gKeyInputFocusCallBackCalled );
+ DALI_TEST_CHECK(gKeyInputFocusCallBackCalled);
END_TEST;
}
ToolkitTestApplication application;
Control control = Control::New();
- application.GetScene().Add( control );
+ application.GetScene().Add(control);
gKeyInputFocusCallBackCalled = false;
control.KeyInputFocusLostSignal().Connect(&TestKeyInputFocusCallback);
control.SetKeyInputFocus();
- DALI_TEST_CHECK( control.HasKeyInputFocus() );
+ DALI_TEST_CHECK(control.HasKeyInputFocus());
control.ClearKeyInputFocus();
- DALI_TEST_CHECK( gKeyInputFocusCallBackCalled );
+ DALI_TEST_CHECK(gKeyInputFocusCallBackCalled);
END_TEST;
}
int UtcDaliControlImplGetControlExtensionP(void)
{
ToolkitTestApplication application;
- Control control = Control::New();
+ Control control = Control::New();
- Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( control );
+ Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation(control);
- DALI_TEST_CHECK( NULL == controlImpl.GetControlExtension() );
+ DALI_TEST_CHECK(NULL == controlImpl.GetControlExtension());
END_TEST;
}
int UtcDaliControlAutoClipping(void)
{
ToolkitTestApplication application;
- Control control = Control::New();
+ Control control = Control::New();
- tet_infoline( "Test to see if a renderer gets added when we are clipping children" );
+ tet_infoline("Test to see if a renderer gets added when we are clipping children");
- DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS(0, control.GetRendererCount(), TEST_LOCATION);
- control.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
+ control.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN);
- application.GetScene().Add( control );
+ application.GetScene().Add(control);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( 1, control.GetRendererCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS(1, control.GetRendererCount(), TEST_LOCATION);
END_TEST;
}
int UtcDaliControlAutoClippingN(void)
{
ToolkitTestApplication application;
- Control control = Control::New();
- control.SetProperty( Control::Property::BACKGROUND, Property::Map().Add( Toolkit::Visual::Property::TYPE, Visual::COLOR )
- .Add( ColorVisual::Property::MIX_COLOR, Color::RED ) );
+ Control control = Control::New();
+ control.SetProperty(Control::Property::BACKGROUND, Property::Map().Add(Toolkit::Visual::Property::TYPE, Visual::COLOR).Add(ColorVisual::Property::MIX_COLOR, Color::RED));
- tet_infoline( "Test to ensure that a renderer does NOT get added when we are clipping children and already have renderers/visuals" );
+ tet_infoline("Test to ensure that a renderer does NOT get added when we are clipping children and already have renderers/visuals");
- DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS(0, control.GetRendererCount(), TEST_LOCATION);
- control.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
+ control.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN);
- application.GetScene().Add( control );
+ application.GetScene().Add(control);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( 1, control.GetRendererCount(), TEST_LOCATION ); // Only 1, not 2
+ DALI_TEST_EQUALS(1, control.GetRendererCount(), TEST_LOCATION); // Only 1, not 2
// Ensure the background color is still RED rather than what's set by the automatic clipping
- Property::Value value = control.GetProperty( Control::Property::BACKGROUND );
- Property::Map* map = value.GetMap();
- DALI_TEST_CHECK( map );
- Property::Value* colorValue = map->Find(ColorVisual::Property::MIX_COLOR );
- DALI_TEST_CHECK( colorValue );
- DALI_TEST_EQUALS( colorValue->Get< Vector4 >(), Color::RED, TEST_LOCATION );
+ Property::Value value = control.GetProperty(Control::Property::BACKGROUND);
+ Property::Map* map = value.GetMap();
+ DALI_TEST_CHECK(map);
+ Property::Value* colorValue = map->Find(ColorVisual::Property::MIX_COLOR);
+ DALI_TEST_CHECK(colorValue);
+ DALI_TEST_EQUALS(colorValue->Get<Vector4>(), Color::RED, TEST_LOCATION);
END_TEST;
}
int UtcDaliControlAutoClippingWhenAlreadyOnStage(void)
{
ToolkitTestApplication application;
- Control control = Control::New();
+ Control control = Control::New();
- tet_infoline( "Test to see if a renderer gets added when we are clipping children and when already on stage" );
+ tet_infoline("Test to see if a renderer gets added when we are clipping children and when already on stage");
- DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS(0, control.GetRendererCount(), TEST_LOCATION);
- application.GetScene().Add( control );
+ application.GetScene().Add(control);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS(0, control.GetRendererCount(), TEST_LOCATION);
- control.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
+ control.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( 1, control.GetRendererCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS(1, control.GetRendererCount(), TEST_LOCATION);
END_TEST;
}
int UtcDaliControlAutoClippingWhenAlreadyOnStageN(void)
{
ToolkitTestApplication application;
- Control control = Control::New();
- control.SetProperty( Control::Property::BACKGROUND, Property::Map().Add( Toolkit::Visual::Property::TYPE, Visual::COLOR )
- .Add( ColorVisual::Property::MIX_COLOR, Color::RED ) );
+ Control control = Control::New();
+ control.SetProperty(Control::Property::BACKGROUND, Property::Map().Add(Toolkit::Visual::Property::TYPE, Visual::COLOR).Add(ColorVisual::Property::MIX_COLOR, Color::RED));
- tet_infoline( "Test to ensure that a renderer does NOT get added when we are clipping children and already have renderers/visuals and when already on stage" );
+ tet_infoline("Test to ensure that a renderer does NOT get added when we are clipping children and already have renderers/visuals and when already on stage");
- DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS(0, control.GetRendererCount(), TEST_LOCATION);
- application.GetScene().Add( control );
+ application.GetScene().Add(control);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( 1, control.GetRendererCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS(1, control.GetRendererCount(), TEST_LOCATION);
- control.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
+ control.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( 1, control.GetRendererCount(), TEST_LOCATION ); // Still should be 1
+ DALI_TEST_EQUALS(1, control.GetRendererCount(), TEST_LOCATION); // Still should be 1
// Ensure the background color is still RED rather than what's set by the automatic clipping
- Property::Value value = control.GetProperty( Control::Property::BACKGROUND );
- Property::Map* map = value.GetMap();
- DALI_TEST_CHECK( map );
- Property::Value* colorValue = map->Find(ColorVisual::Property::MIX_COLOR );
- DALI_TEST_CHECK( colorValue );
- DALI_TEST_EQUALS( colorValue->Get< Vector4 >(), Color::RED, TEST_LOCATION );
+ Property::Value value = control.GetProperty(Control::Property::BACKGROUND);
+ Property::Map* map = value.GetMap();
+ DALI_TEST_CHECK(map);
+ Property::Value* colorValue = map->Find(ColorVisual::Property::MIX_COLOR);
+ DALI_TEST_CHECK(colorValue);
+ DALI_TEST_EQUALS(colorValue->Get<Vector4>(), Color::RED, TEST_LOCATION);
END_TEST;
}
int UtcDaliControlSetTransformSize(void)
{
ToolkitTestApplication application;
- Control control = Control::New();
+ Control control = Control::New();
Property::Map transformMap;
- transformMap.Add( Visual::Transform::Property::OFFSET, Vector2( 10, 10 ) )
- .Add( Visual::Transform::Property::ANCHOR_POINT, Align::BOTTOM_END )
- .Add( Visual::Transform::Property::ORIGIN, Align::BOTTOM_END )
- .Add( Visual::Transform::Property::SIZE, Vector2( 10, 20 ) );
+ transformMap.Add(Visual::Transform::Property::OFFSET, Vector2(10, 10))
+ .Add(Visual::Transform::Property::ANCHOR_POINT, Align::BOTTOM_END)
+ .Add(Visual::Transform::Property::ORIGIN, Align::BOTTOM_END)
+ .Add(Visual::Transform::Property::SIZE, Vector2(10, 20));
- control.SetProperty( Control::Property::BACKGROUND, Property::Map().Add( Toolkit::Visual::Property::TYPE, Visual::COLOR )
- .Add( Visual::Property::TRANSFORM, transformMap ) );
+ control.SetProperty(Control::Property::BACKGROUND, Property::Map().Add(Toolkit::Visual::Property::TYPE, Visual::COLOR).Add(Visual::Property::TRANSFORM, transformMap));
- tet_infoline( "Test to ensure that the control background transform does not get overwritten when adding to the stage" );
+ tet_infoline("Test to ensure that the control background transform does not get overwritten when adding to the stage");
- application.GetScene().Add( control );
+ application.GetScene().Add(control);
application.SendNotification();
application.Render();
// Ensure the transform property still matches what we set
- Property::Value value = control.GetProperty( Control::Property::BACKGROUND );
- Property::Map* map = value.GetMap();
- DALI_TEST_CHECK( map );
- Property::Value* transformValue = map->Find( Visual::Property::TRANSFORM );
- DALI_TEST_CHECK( transformValue );
+ Property::Value value = control.GetProperty(Control::Property::BACKGROUND);
+ Property::Map* map = value.GetMap();
+ DALI_TEST_CHECK(map);
+ Property::Value* transformValue = map->Find(Visual::Property::TRANSFORM);
+ DALI_TEST_CHECK(transformValue);
Property::Map* retMap = transformValue->GetMap();
- DALI_TEST_CHECK( retMap );
- DALI_TEST_EQUALS( retMap->Find( Visual::Transform::Property::OFFSET )->Get< Vector2 >(), Vector2( 10, 10 ), TEST_LOCATION );
- DALI_TEST_EQUALS( retMap->Find( Visual::Transform::Property::ANCHOR_POINT )->Get< int >(), (int)Align::BOTTOM_END, TEST_LOCATION );
- DALI_TEST_EQUALS( retMap->Find( Visual::Transform::Property::ORIGIN )->Get< int >(), (int)Align::BOTTOM_END, TEST_LOCATION );
- DALI_TEST_EQUALS( retMap->Find( Visual::Transform::Property::SIZE )->Get< Vector2 >(), Vector2( 10, 20 ), TEST_LOCATION );
+ DALI_TEST_CHECK(retMap);
+ DALI_TEST_EQUALS(retMap->Find(Visual::Transform::Property::OFFSET)->Get<Vector2>(), Vector2(10, 10), TEST_LOCATION);
+ DALI_TEST_EQUALS(retMap->Find(Visual::Transform::Property::ANCHOR_POINT)->Get<int>(), (int)Align::BOTTOM_END, TEST_LOCATION);
+ DALI_TEST_EQUALS(retMap->Find(Visual::Transform::Property::ORIGIN)->Get<int>(), (int)Align::BOTTOM_END, TEST_LOCATION);
+ DALI_TEST_EQUALS(retMap->Find(Visual::Transform::Property::SIZE)->Get<Vector2>(), Vector2(10, 20), TEST_LOCATION);
END_TEST;
}
-
int UtcDaliControlResourcesReady(void)
{
ToolkitTestApplication application;
- tet_infoline( "Register 2 visuals and check ResourceReady when a visual is disabled" );
+ tet_infoline("Register 2 visuals and check ResourceReady when a visual is disabled");
VisualFactory factory = VisualFactory::Get();
- DALI_TEST_CHECK( factory );
+ DALI_TEST_CHECK(factory);
Property::Map propertyMapLarge;
- propertyMapLarge.Insert( Toolkit::Visual::Property::TYPE, Visual::IMAGE );
- propertyMapLarge.Insert( ImageVisual::Property::URL, TEST_LARGE_IMAGE_FILE_NAME );
+ propertyMapLarge.Insert(Toolkit::Visual::Property::TYPE, Visual::IMAGE);
+ propertyMapLarge.Insert(ImageVisual::Property::URL, TEST_LARGE_IMAGE_FILE_NAME);
Property::Map propertyMapSmall;
- propertyMapSmall.Insert( Toolkit::Visual::Property::TYPE, Visual::IMAGE );
- propertyMapSmall.Insert( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME );
+ propertyMapSmall.Insert(Toolkit::Visual::Property::TYPE, Visual::IMAGE);
+ propertyMapSmall.Insert(ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME);
- Visual::Base smallVisual = factory.CreateVisual( propertyMapSmall );
+ Visual::Base smallVisual = factory.CreateVisual(propertyMapSmall);
smallVisual.SetName("smallVisual");
- DALI_TEST_CHECK( smallVisual );
+ DALI_TEST_CHECK(smallVisual);
- DummyControl actor = DummyControl::New();
+ DummyControl actor = DummyControl::New();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, smallVisual );
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, smallVisual);
- actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
+ actor.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
Toolkit::Visual::ResourceStatus resourceStatus = actor.GetVisualResourceStatus(DummyControl::Property::TEST_VISUAL);
- DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.IsResourceReady(), false, TEST_LOCATION );
- DALI_TEST_EQUALS( static_cast<int>(resourceStatus), static_cast<int>(Toolkit::Visual::ResourceStatus::PREPARING), TEST_LOCATION );
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(actor.IsResourceReady(), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(static_cast<int>(resourceStatus), static_cast<int>(Toolkit::Visual::ResourceStatus::PREPARING), TEST_LOCATION);
- application.GetScene().Add( actor );
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render();
resourceStatus = actor.GetVisualResourceStatus(DummyControl::Property::TEST_VISUAL);
- DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.IsResourceReady(), true, TEST_LOCATION );
- DALI_TEST_EQUALS( static_cast<int>(resourceStatus), static_cast<int>(Toolkit::Visual::ResourceStatus::READY), TEST_LOCATION );
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(actor.IsResourceReady(), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(static_cast<int>(resourceStatus), static_cast<int>(Toolkit::Visual::ResourceStatus::READY), TEST_LOCATION);
- Visual::Base largeVisual = factory.CreateVisual( propertyMapLarge );
+ Visual::Base largeVisual = factory.CreateVisual(propertyMapLarge);
largeVisual.SetName("largeVisual");
- DALI_TEST_CHECK( largeVisual );
+ DALI_TEST_CHECK(largeVisual);
- tet_infoline( "Register Visual but set disabled, IsResourceReady should be true" );
+ tet_infoline("Register Visual but set disabled, IsResourceReady should be true");
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL2, largeVisual, false );
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL2, largeVisual, false);
resourceStatus = actor.GetVisualResourceStatus(DummyControl::Property::TEST_VISUAL2);
- DALI_TEST_EQUALS( static_cast<int>(resourceStatus), static_cast<int>(Toolkit::Visual::ResourceStatus::PREPARING), TEST_LOCATION );
+ DALI_TEST_EQUALS(static_cast<int>(resourceStatus), static_cast<int>(Toolkit::Visual::ResourceStatus::PREPARING), TEST_LOCATION);
application.SendNotification();
resourceStatus = actor.GetVisualResourceStatus(DummyControl::Property::TEST_VISUAL2);
- DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.IsResourceReady(), true, TEST_LOCATION );
- DALI_TEST_EQUALS( static_cast<int>(resourceStatus), static_cast<int>(Toolkit::Visual::ResourceStatus::PREPARING), TEST_LOCATION );
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(actor.IsResourceReady(), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(static_cast<int>(resourceStatus), static_cast<int>(Toolkit::Visual::ResourceStatus::PREPARING), TEST_LOCATION);
- dummyImpl.EnableVisual( DummyControl::Property::TEST_VISUAL2, true );
+ dummyImpl.EnableVisual(DummyControl::Property::TEST_VISUAL2, true);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
resourceStatus = actor.GetVisualResourceStatus(DummyControl::Property::TEST_VISUAL2);
- DALI_TEST_EQUALS( static_cast<int>(resourceStatus), static_cast<int>(Toolkit::Visual::ResourceStatus::READY), TEST_LOCATION );
+ DALI_TEST_EQUALS(static_cast<int>(resourceStatus), static_cast<int>(Toolkit::Visual::ResourceStatus::READY), TEST_LOCATION);
END_TEST;
}
int UtcDaliControlResourcesReady02(void)
{
ToolkitTestApplication application;
- tet_infoline( "Change a resource during ResourceReady callback" );
+ tet_infoline("Change a resource during ResourceReady callback");
gResourceReadySignalFired = false;
Control control = Control::New();
- control.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- control.ResourceReadySignal().Connect( &ResourceReadySignal );
+ control.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+ control.ResourceReadySignal().Connect(&ResourceReadySignal);
Property::Map propertyMap;
- propertyMap.Insert( ImageVisual::Property::URL, "invalid.jpg" );
- control.SetProperty( Control::Property::BACKGROUND, propertyMap );
+ propertyMap.Insert(ImageVisual::Property::URL, "invalid.jpg");
+ control.SetProperty(Control::Property::BACKGROUND, propertyMap);
- application.GetScene().Add( control );
+ application.GetScene().Add(control);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( control.IsResourceReady(), true, TEST_LOCATION );
- DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(control.IsResourceReady(), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(gResourceReadySignalFired, true, TEST_LOCATION);
gResourceReadySignalFired = false;
END_TEST;
ToolkitTestApplication application;
Control control = Control::New();
- control.SetBackgroundColor( Color::BLUE );
+ control.SetBackgroundColor(Color::BLUE);
- control.SetProperty( Control::Property::MARGIN, Extents( 20, 10, 0, 0 ) );
+ control.SetProperty(Control::Property::MARGIN, Extents(20, 10, 0, 0));
- application.GetScene().Add( control );
+ application.GetScene().Add(control);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( control.GetProperty<Extents>( Control::Property::MARGIN ), Extents( 20, 10, 0, 0 ), TEST_LOCATION );
+ DALI_TEST_EQUALS(control.GetProperty<Extents>(Control::Property::MARGIN), Extents(20, 10, 0, 0), TEST_LOCATION);
// Parent control has one ImageView as a Child.
ImageView image = ImageView::New();
- image.SetBackgroundColor( Color::RED );
- image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- image.SetProperty( Control::Property::PADDING, Extents( 10, 10, 10, 10 ) );
- control.Add( image );
+ image.SetBackgroundColor(Color::RED);
+ image.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ image.SetProperty(Control::Property::PADDING, Extents(10, 10, 10, 10));
+ control.Add(image);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( image.GetProperty<Extents>( Control::Property::PADDING ), Extents( 10, 10, 10, 10 ), TEST_LOCATION );
+ DALI_TEST_EQUALS(image.GetProperty<Extents>(Control::Property::PADDING), Extents(10, 10, 10, 10), TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
Control control = Control::New();
- control.SetBackgroundColor( Color::BLUE );
+ control.SetBackgroundColor(Color::BLUE);
- control.SetProperty( Control::Property::PADDING, Extents( 15, 10, 5, 10 ) );
+ control.SetProperty(Control::Property::PADDING, Extents(15, 10, 5, 10));
- application.GetScene().Add( control );
+ application.GetScene().Add(control);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( control.GetProperty<Extents>( Control::Property::PADDING ), Extents( 15, 10, 5, 10 ), TEST_LOCATION );
+ DALI_TEST_EQUALS(control.GetProperty<Extents>(Control::Property::PADDING), Extents(15, 10, 5, 10), TEST_LOCATION);
Control child = Control::New();
control.Add(child);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( child.GetProperty<Vector3>( Dali::Actor::Property::POSITION ), Vector3( 15, 5, 0 ), TEST_LOCATION );
+ DALI_TEST_EQUALS(child.GetProperty<Vector3>(Dali::Actor::Property::POSITION), Vector3(15, 5, 0), TEST_LOCATION);
- control.SetProperty( Dali::Actor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::RIGHT_TO_LEFT);
+ control.SetProperty(Dali::Actor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::RIGHT_TO_LEFT);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( child.GetProperty<Vector3>( Dali::Actor::Property::POSITION ), Vector3( 10, 5, 0 ), TEST_LOCATION );
+ DALI_TEST_EQUALS(child.GetProperty<Vector3>(Dali::Actor::Property::POSITION), Vector3(10, 5, 0), TEST_LOCATION);
- control.SetProperty( Dali::Actor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::LEFT_TO_RIGHT);
+ control.SetProperty(Dali::Actor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::LEFT_TO_RIGHT);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( child.GetProperty<Vector3>( Dali::Actor::Property::POSITION ), Vector3( 15, 5, 0 ), TEST_LOCATION );
+ DALI_TEST_EQUALS(child.GetProperty<Vector3>(Dali::Actor::Property::POSITION), Vector3(15, 5, 0), TEST_LOCATION);
END_TEST;
}
int UtcDaliControlDoAction(void)
{
ToolkitTestApplication application;
- tet_infoline( "DoAction on a visual registered with a control" );
+ tet_infoline("DoAction on a visual registered with a control");
// Set up trace debug
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
- textureTrace.Enable( true );
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
+ textureTrace.Enable(true);
//Created AnimatedImageVisual
- VisualFactory factory = VisualFactory::Get();
- Visual::Base imageVisual = factory.CreateVisual( TEST_IMAGE_FILE_NAME, ImageDimensions() );
+ VisualFactory factory = VisualFactory::Get();
+ Visual::Base imageVisual = factory.CreateVisual(TEST_IMAGE_FILE_NAME, ImageDimensions());
- DummyControl dummyControl = DummyControl::New(true);
- Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+ DummyControl dummyControl = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual );
- dummyControl.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- application.GetScene().Add( dummyControl );
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, imageVisual);
+ dummyControl.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+ application.GetScene().Add(dummyControl);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( textureTrace.CountMethod("DeleteTextures"), 0, TEST_LOCATION );
- DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.CountMethod("DeleteTextures"), 0, TEST_LOCATION);
+ DALI_TEST_EQUALS(textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION);
textureTrace.Reset();
Property::Map attributes;
- DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, DevelImageVisual::Action::RELOAD, attributes );
+ DevelControl::DoAction(dummyControl, DummyControl::Property::TEST_VISUAL, DevelImageVisual::Action::RELOAD, attributes);
- tet_infoline( "Perform RELOAD action. should reload Image and generate a texture" );
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ tet_infoline("Perform RELOAD action. should reload Image and generate a texture");
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( textureTrace.CountMethod("DeleteTextures"), 1, TEST_LOCATION );
- DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.CountMethod("DeleteTextures"), 1, TEST_LOCATION);
+ DALI_TEST_EQUALS(textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION);
END_TEST;
}
int UtcDaliControlDoActionWhenNotStage(void)
{
ToolkitTestApplication application;
- tet_infoline( "DoAction on a visual registered with a control but not staged" );
+ tet_infoline("DoAction on a visual registered with a control but not staged");
// Set up trace debug
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
- textureTrace.Enable( true );
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
+ textureTrace.Enable(true);
//Created AnimatedImageVisual
- VisualFactory factory = VisualFactory::Get();
- Visual::Base imageVisual = factory.CreateVisual( TEST_IMAGE_FILE_NAME, ImageDimensions() );
+ VisualFactory factory = VisualFactory::Get();
+ Visual::Base imageVisual = factory.CreateVisual(TEST_IMAGE_FILE_NAME, ImageDimensions());
- DummyControl dummyControl = DummyControl::New(true);
- Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+ DummyControl dummyControl = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual );
- dummyControl.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, imageVisual);
+ dummyControl.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( textureTrace.CountMethod("DeleteTextures"), 0, TEST_LOCATION );
- DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.CountMethod("DeleteTextures"), 0, TEST_LOCATION);
+ DALI_TEST_EQUALS(textureTrace.FindMethod("GenTextures"), false, TEST_LOCATION);
textureTrace.Reset();
Property::Map attributes;
- DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, DevelImageVisual::Action::RELOAD, attributes );
+ DevelControl::DoAction(dummyControl, DummyControl::Property::TEST_VISUAL, DevelImageVisual::Action::RELOAD, attributes);
- tet_infoline( "Perform RELOAD action. should reload Image and generate a texture" );
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ tet_infoline("Perform RELOAD action. should reload Image and generate a texture");
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION);
textureTrace.Reset();
- tet_infoline( "Adding control to stage will in turn add the visual to the stage" );
+ tet_infoline("Adding control to stage will in turn add the visual to the stage");
- application.GetScene().Add( dummyControl );
+ application.GetScene().Add(dummyControl);
application.SendNotification();
application.Render();
- tet_infoline( "No change in textures could occurs as already loaded and cached texture will be used" );
+ tet_infoline("No change in textures could occurs as already loaded and cached texture will be used");
- DALI_TEST_EQUALS( textureTrace.CountMethod("DeleteTextures"), 0, TEST_LOCATION );
- DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.CountMethod("DeleteTextures"), 0, TEST_LOCATION);
+ DALI_TEST_EQUALS(textureTrace.FindMethod("GenTextures"), false, TEST_LOCATION);
textureTrace.Reset();
END_TEST;
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
#include <stdlib.h>
+#include <iostream>
// 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 "toolkit-style-monitor.h"
-#include <dali.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
+#include <dali.h>
+#include <dali/integration-api/events/hover-event-integ.h>
#include <dali/integration-api/events/key-event-integ.h>
-#include <dali/integration-api/events/wheel-event-integ.h>
#include <dali/integration-api/events/touch-event-integ.h>
-#include <dali/integration-api/events/hover-event-integ.h>
-
+#include <dali/integration-api/events/wheel-event-integ.h>
#include "dummy-control.h"
int UtcDaliControlImplNew(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
Control control;
- DALI_TEST_CHECK( !Control::DownCast(control) );
+ DALI_TEST_CHECK(!Control::DownCast(control));
control = Toolkit::Internal::Control::New();
- DALI_TEST_CHECK( Control::DownCast(control) );
+ DALI_TEST_CHECK(Control::DownCast(control));
END_TEST;
}
-
int UtcDaliControlImplEnableGestureDetector(void)
{
ToolkitTestApplication application;
// Enable individually
{
- DummyControl dummy = DummyControl::New();
+ DummyControl dummy = DummyControl::New();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
- DALI_TEST_CHECK( !dummyImpl.GetPinchGestureDetector() );
+ DALI_TEST_CHECK(!dummyImpl.GetPinchGestureDetector());
dummyImpl.EnableGestureDetection(GestureType::PINCH);
- DALI_TEST_CHECK( dummyImpl.GetPinchGestureDetector() );
+ DALI_TEST_CHECK(dummyImpl.GetPinchGestureDetector());
- DALI_TEST_CHECK( !dummyImpl.GetPanGestureDetector() );
+ DALI_TEST_CHECK(!dummyImpl.GetPanGestureDetector());
dummyImpl.EnableGestureDetection(GestureType::PAN);
- DALI_TEST_CHECK( dummyImpl.GetPanGestureDetector() );
+ DALI_TEST_CHECK(dummyImpl.GetPanGestureDetector());
- DALI_TEST_CHECK( !dummyImpl.GetTapGestureDetector() );
+ DALI_TEST_CHECK(!dummyImpl.GetTapGestureDetector());
dummyImpl.EnableGestureDetection(GestureType::TAP);
- DALI_TEST_CHECK( dummyImpl.GetTapGestureDetector() );
+ DALI_TEST_CHECK(dummyImpl.GetTapGestureDetector());
- DALI_TEST_CHECK( !dummyImpl.GetLongPressGestureDetector() );
+ DALI_TEST_CHECK(!dummyImpl.GetLongPressGestureDetector());
dummyImpl.EnableGestureDetection(GestureType::LONG_PRESS);
- DALI_TEST_CHECK( dummyImpl.GetLongPressGestureDetector() );
+ DALI_TEST_CHECK(dummyImpl.GetLongPressGestureDetector());
}
// Enable All
{
- DummyControl dummy = DummyControl::New();
+ DummyControl dummy = DummyControl::New();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
- DALI_TEST_CHECK( !dummyImpl.GetPinchGestureDetector() );
- DALI_TEST_CHECK( !dummyImpl.GetPanGestureDetector() );
- DALI_TEST_CHECK( !dummyImpl.GetTapGestureDetector() );
- DALI_TEST_CHECK( !dummyImpl.GetLongPressGestureDetector() );
+ DALI_TEST_CHECK(!dummyImpl.GetPinchGestureDetector());
+ DALI_TEST_CHECK(!dummyImpl.GetPanGestureDetector());
+ DALI_TEST_CHECK(!dummyImpl.GetTapGestureDetector());
+ DALI_TEST_CHECK(!dummyImpl.GetLongPressGestureDetector());
- dummyImpl.EnableGestureDetection( GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS) );
+ dummyImpl.EnableGestureDetection(GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS));
- DALI_TEST_CHECK( dummyImpl.GetPinchGestureDetector() );
- DALI_TEST_CHECK( dummyImpl.GetPanGestureDetector() );
- DALI_TEST_CHECK( dummyImpl.GetTapGestureDetector() );
- DALI_TEST_CHECK( dummyImpl.GetLongPressGestureDetector() );
+ DALI_TEST_CHECK(dummyImpl.GetPinchGestureDetector());
+ DALI_TEST_CHECK(dummyImpl.GetPanGestureDetector());
+ DALI_TEST_CHECK(dummyImpl.GetTapGestureDetector());
+ DALI_TEST_CHECK(dummyImpl.GetLongPressGestureDetector());
// Enable when already enabled
- dummyImpl.EnableGestureDetection( GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS) );
+ dummyImpl.EnableGestureDetection(GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS));
- DALI_TEST_CHECK( dummyImpl.GetPinchGestureDetector() );
- DALI_TEST_CHECK( dummyImpl.GetPanGestureDetector() );
- DALI_TEST_CHECK( dummyImpl.GetTapGestureDetector() );
- DALI_TEST_CHECK( dummyImpl.GetLongPressGestureDetector() );
+ DALI_TEST_CHECK(dummyImpl.GetPinchGestureDetector());
+ DALI_TEST_CHECK(dummyImpl.GetPanGestureDetector());
+ DALI_TEST_CHECK(dummyImpl.GetTapGestureDetector());
+ DALI_TEST_CHECK(dummyImpl.GetLongPressGestureDetector());
}
END_TEST;
}
// Disable individually
{
- DummyControl dummy = DummyControl::New();
+ DummyControl dummy = DummyControl::New();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
- dummyImpl.EnableGestureDetection( GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS) );
+ dummyImpl.EnableGestureDetection(GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS));
- DALI_TEST_CHECK( dummyImpl.GetPinchGestureDetector() );
+ DALI_TEST_CHECK(dummyImpl.GetPinchGestureDetector());
dummyImpl.DisableGestureDetection(GestureType::PINCH);
- DALI_TEST_CHECK( !dummyImpl.GetPinchGestureDetector() );
+ DALI_TEST_CHECK(!dummyImpl.GetPinchGestureDetector());
- DALI_TEST_CHECK( dummyImpl.GetPanGestureDetector() );
+ DALI_TEST_CHECK(dummyImpl.GetPanGestureDetector());
dummyImpl.DisableGestureDetection(GestureType::PAN);
- DALI_TEST_CHECK( !dummyImpl.GetPanGestureDetector() );
+ DALI_TEST_CHECK(!dummyImpl.GetPanGestureDetector());
- DALI_TEST_CHECK( dummyImpl.GetTapGestureDetector() );
+ DALI_TEST_CHECK(dummyImpl.GetTapGestureDetector());
dummyImpl.DisableGestureDetection(GestureType::TAP);
- DALI_TEST_CHECK( !dummyImpl.GetTapGestureDetector() );
+ DALI_TEST_CHECK(!dummyImpl.GetTapGestureDetector());
- DALI_TEST_CHECK( dummyImpl.GetLongPressGestureDetector() );
+ DALI_TEST_CHECK(dummyImpl.GetLongPressGestureDetector());
dummyImpl.DisableGestureDetection(GestureType::LONG_PRESS);
- DALI_TEST_CHECK( !dummyImpl.GetLongPressGestureDetector() );
+ DALI_TEST_CHECK(!dummyImpl.GetLongPressGestureDetector());
}
// Disable All
{
- DummyControl dummy = DummyControl::New();
+ DummyControl dummy = DummyControl::New();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
- dummyImpl.EnableGestureDetection( GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS) );
+ dummyImpl.EnableGestureDetection(GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS));
- DALI_TEST_CHECK( dummyImpl.GetPinchGestureDetector() );
- DALI_TEST_CHECK( dummyImpl.GetPanGestureDetector() );
- DALI_TEST_CHECK( dummyImpl.GetTapGestureDetector() );
- DALI_TEST_CHECK( dummyImpl.GetLongPressGestureDetector() );
+ DALI_TEST_CHECK(dummyImpl.GetPinchGestureDetector());
+ DALI_TEST_CHECK(dummyImpl.GetPanGestureDetector());
+ DALI_TEST_CHECK(dummyImpl.GetTapGestureDetector());
+ DALI_TEST_CHECK(dummyImpl.GetLongPressGestureDetector());
- dummyImpl.DisableGestureDetection( GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS) );
+ dummyImpl.DisableGestureDetection(GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS));
- DALI_TEST_CHECK( !dummyImpl.GetPinchGestureDetector() );
- DALI_TEST_CHECK( !dummyImpl.GetPanGestureDetector() );
- DALI_TEST_CHECK( !dummyImpl.GetTapGestureDetector() );
- DALI_TEST_CHECK( !dummyImpl.GetLongPressGestureDetector() );
+ DALI_TEST_CHECK(!dummyImpl.GetPinchGestureDetector());
+ DALI_TEST_CHECK(!dummyImpl.GetPanGestureDetector());
+ DALI_TEST_CHECK(!dummyImpl.GetTapGestureDetector());
+ DALI_TEST_CHECK(!dummyImpl.GetLongPressGestureDetector());
}
// Disable When not enabled
{
- DummyControl dummy = DummyControl::New();
+ DummyControl dummy = DummyControl::New();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
- DALI_TEST_CHECK( !dummyImpl.GetPinchGestureDetector() );
- DALI_TEST_CHECK( !dummyImpl.GetPanGestureDetector() );
- DALI_TEST_CHECK( !dummyImpl.GetTapGestureDetector() );
- DALI_TEST_CHECK( !dummyImpl.GetLongPressGestureDetector() );
+ DALI_TEST_CHECK(!dummyImpl.GetPinchGestureDetector());
+ DALI_TEST_CHECK(!dummyImpl.GetPanGestureDetector());
+ DALI_TEST_CHECK(!dummyImpl.GetTapGestureDetector());
+ DALI_TEST_CHECK(!dummyImpl.GetLongPressGestureDetector());
- dummyImpl.DisableGestureDetection( GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS) );
+ dummyImpl.DisableGestureDetection(GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS));
- DALI_TEST_CHECK( !dummyImpl.GetPinchGestureDetector() );
- DALI_TEST_CHECK( !dummyImpl.GetPanGestureDetector() );
- DALI_TEST_CHECK( !dummyImpl.GetTapGestureDetector() );
- DALI_TEST_CHECK( !dummyImpl.GetLongPressGestureDetector() );
+ DALI_TEST_CHECK(!dummyImpl.GetPinchGestureDetector());
+ DALI_TEST_CHECK(!dummyImpl.GetPanGestureDetector());
+ DALI_TEST_CHECK(!dummyImpl.GetTapGestureDetector());
+ DALI_TEST_CHECK(!dummyImpl.GetLongPressGestureDetector());
}
// Ensure control is detached if gesture detector is not deleted
{
- DummyControl dummy = DummyControl::New();
+ DummyControl dummy = DummyControl::New();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
- dummyImpl.EnableGestureDetection( GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS) );
+ dummyImpl.EnableGestureDetection(GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS));
- PinchGestureDetector pinch = dummyImpl.GetPinchGestureDetector();
- PanGestureDetector pan = dummyImpl.GetPanGestureDetector();
- TapGestureDetector tap = dummyImpl.GetTapGestureDetector();
+ PinchGestureDetector pinch = dummyImpl.GetPinchGestureDetector();
+ PanGestureDetector pan = dummyImpl.GetPanGestureDetector();
+ TapGestureDetector tap = dummyImpl.GetTapGestureDetector();
LongPressGestureDetector longPress = dummyImpl.GetLongPressGestureDetector();
- DALI_TEST_EQUALS( 0 == pinch.GetAttachedActorCount(), false, TEST_LOCATION );
- DALI_TEST_EQUALS( 0 == pan.GetAttachedActorCount(), false, TEST_LOCATION );
- DALI_TEST_EQUALS( 0 == tap.GetAttachedActorCount(), false, TEST_LOCATION );
- DALI_TEST_EQUALS( 0 == longPress.GetAttachedActorCount(), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(0 == pinch.GetAttachedActorCount(), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(0 == pan.GetAttachedActorCount(), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(0 == tap.GetAttachedActorCount(), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(0 == longPress.GetAttachedActorCount(), false, TEST_LOCATION);
- dummyImpl.DisableGestureDetection( GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS) );
+ dummyImpl.DisableGestureDetection(GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS));
- DALI_TEST_EQUALS( 0 == pinch.GetAttachedActorCount(), true, TEST_LOCATION );
- DALI_TEST_EQUALS( 0 == pan.GetAttachedActorCount(), true, TEST_LOCATION );
- DALI_TEST_EQUALS( 0 == tap.GetAttachedActorCount(), true, TEST_LOCATION );
- DALI_TEST_EQUALS( 0 == longPress.GetAttachedActorCount(), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(0 == pinch.GetAttachedActorCount(), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(0 == pan.GetAttachedActorCount(), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(0 == tap.GetAttachedActorCount(), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(0 == longPress.GetAttachedActorCount(), true, TEST_LOCATION);
}
END_TEST;
}
// Check gesture actually happens
{
DummyControl dummy = DummyControl::New(true);
- dummy.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f ) );
+ dummy.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
- dummy.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+ dummy.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
application.GetScene().Add(dummy);
// Render and notify a couple of times
application.Render();
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
- dummyImpl.EnableGestureDetection( GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS) );
+ dummyImpl.EnableGestureDetection(GestureType::Value(GestureType::PINCH | GestureType::PAN | GestureType::TAP | GestureType::LONG_PRESS));
- DALI_TEST_CHECK( dummyImpl.pinchCalled == false );
+ DALI_TEST_CHECK(dummyImpl.pinchCalled == false);
TestGeneratePinch(application);
- DALI_TEST_CHECK( dummyImpl.pinchCalled == true );
+ DALI_TEST_CHECK(dummyImpl.pinchCalled == true);
- DALI_TEST_CHECK( dummyImpl.panCalled == false );
+ DALI_TEST_CHECK(dummyImpl.panCalled == false);
TestGenerateMiniPan(application);
- DALI_TEST_CHECK( dummyImpl.panCalled == true );
+ DALI_TEST_CHECK(dummyImpl.panCalled == true);
- DALI_TEST_CHECK( dummyImpl.tapCalled == false );
+ DALI_TEST_CHECK(dummyImpl.tapCalled == false);
TestGenerateTap(application);
- DALI_TEST_CHECK( dummyImpl.tapCalled == true );
+ DALI_TEST_CHECK(dummyImpl.tapCalled == true);
- DALI_TEST_CHECK( dummyImpl.longPressCalled == false );
+ DALI_TEST_CHECK(dummyImpl.longPressCalled == false);
TestGenerateLongPress(application);
- DALI_TEST_CHECK( dummyImpl.longPressCalled == true );
+ DALI_TEST_CHECK(dummyImpl.longPressCalled == true);
application.GetScene().Remove(dummy);
}
ToolkitTestApplication application;
{
- DummyControl dummy = DummyControl::New( true );
+ DummyControl dummy = DummyControl::New(true);
application.GetScene().Add(dummy);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
application.Render();
application.SendNotification();
- DALI_TEST_EQUALS( dummyImpl.childAddCalled, false, TEST_LOCATION );
- DALI_TEST_EQUALS( dummy.GetChildCount(), 0u, TEST_LOCATION );
+ DALI_TEST_EQUALS(dummyImpl.childAddCalled, false, TEST_LOCATION);
+ DALI_TEST_EQUALS(dummy.GetChildCount(), 0u, TEST_LOCATION);
Actor actor = Actor::New();
dummy.Add(actor);
- DALI_TEST_EQUALS( dummyImpl.childAddCalled, true, TEST_LOCATION );
- DALI_TEST_EQUALS( dummy.GetChildCount(), 1u, TEST_LOCATION );
+ DALI_TEST_EQUALS(dummyImpl.childAddCalled, true, TEST_LOCATION);
+ DALI_TEST_EQUALS(dummy.GetChildCount(), 1u, TEST_LOCATION);
application.Render();
application.SendNotification();
- DALI_TEST_EQUALS( dummyImpl.childRemoveCalled, false, TEST_LOCATION );
- dummy.Remove( actor );
- DALI_TEST_EQUALS( dummyImpl.childRemoveCalled, true, TEST_LOCATION );
- DALI_TEST_EQUALS( dummy.GetChildCount(), 0u, TEST_LOCATION );
+ DALI_TEST_EQUALS(dummyImpl.childRemoveCalled, false, TEST_LOCATION);
+ dummy.Remove(actor);
+ DALI_TEST_EQUALS(dummyImpl.childRemoveCalled, true, TEST_LOCATION);
+ DALI_TEST_EQUALS(dummy.GetChildCount(), 0u, TEST_LOCATION);
application.Render();
application.SendNotification();
application.Render();
application.SendNotification();
- DALI_TEST_EQUALS( dummy.GetChildCount(), 0u, TEST_LOCATION );
+ DALI_TEST_EQUALS(dummy.GetChildCount(), 0u, TEST_LOCATION);
Actor actor = Actor::New();
dummy.Add(actor);
- DALI_TEST_EQUALS( dummy.GetChildCount(), 1u, TEST_LOCATION );
+ DALI_TEST_EQUALS(dummy.GetChildCount(), 1u, TEST_LOCATION);
application.Render();
application.SendNotification();
- dummy.Remove( actor );
- DALI_TEST_EQUALS( dummy.GetChildCount(), 0u, TEST_LOCATION );
+ dummy.Remove(actor);
+ DALI_TEST_EQUALS(dummy.GetChildCount(), 0u, TEST_LOCATION);
application.Render();
application.SendNotification();
ToolkitTestApplication application;
{
- DummyControl dummy = DummyControl::New( true );
+ DummyControl dummy = DummyControl::New(true);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
- DALI_TEST_EQUALS( dummyImpl.stageConnectionCalled, false, TEST_LOCATION );
+ DALI_TEST_EQUALS(dummyImpl.stageConnectionCalled, false, TEST_LOCATION);
application.GetScene().Add(dummy);
application.Render();
application.SendNotification();
- DALI_TEST_EQUALS( dummyImpl.stageConnectionCalled, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(dummyImpl.stageConnectionCalled, true, TEST_LOCATION);
- DALI_TEST_EQUALS( dummyImpl.stageDisconnectionCalled, false, TEST_LOCATION );
+ DALI_TEST_EQUALS(dummyImpl.stageDisconnectionCalled, false, TEST_LOCATION);
application.GetScene().Remove(dummy);
application.Render();
application.SendNotification();
- DALI_TEST_EQUALS( dummyImpl.stageDisconnectionCalled, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(dummyImpl.stageDisconnectionCalled, true, TEST_LOCATION);
}
// Ensure full code coverage
{
unsigned int stageChildren = application.GetScene().GetLayer(0).GetChildCount();
- DummyControl dummy = DummyControl::New();
+ DummyControl dummy = DummyControl::New();
- DALI_TEST_EQUALS( application.GetScene().GetLayer(0).GetChildCount(), stageChildren, TEST_LOCATION );
+ DALI_TEST_EQUALS(application.GetScene().GetLayer(0).GetChildCount(), stageChildren, TEST_LOCATION);
application.GetScene().Add(dummy);
application.Render();
application.SendNotification();
- DALI_TEST_EQUALS( application.GetScene().GetLayer(0).GetChildCount(), stageChildren + 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(application.GetScene().GetLayer(0).GetChildCount(), stageChildren + 1, TEST_LOCATION);
application.GetScene().Remove(dummy);
application.Render();
application.SendNotification();
- DALI_TEST_EQUALS( application.GetScene().GetLayer(0).GetChildCount(), stageChildren, TEST_LOCATION );
+ DALI_TEST_EQUALS(application.GetScene().GetLayer(0).GetChildCount(), stageChildren, TEST_LOCATION);
}
END_TEST;
}
ToolkitTestApplication application;
{
- DummyControl dummy = DummyControl::New( true );
+ DummyControl dummy = DummyControl::New(true);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
application.GetScene().Add(dummy);
application.Render();
application.SendNotification();
- DALI_TEST_EQUALS( dummyImpl.sizeSetCalled, false, TEST_LOCATION ); // Size not set, no onSizeSet called
+ DALI_TEST_EQUALS(dummyImpl.sizeSetCalled, false, TEST_LOCATION); // Size not set, no onSizeSet called
Vector2 size(100.0f, 200.0f);
- dummy.SetProperty( Actor::Property::SIZE, size );
+ dummy.SetProperty(Actor::Property::SIZE, size);
- DALI_TEST_EQUALS( dummyImpl.sizeSetCalled, false, TEST_LOCATION ); // Size is going to get negotiated, no onSizeSet called
+ DALI_TEST_EQUALS(dummyImpl.sizeSetCalled, false, TEST_LOCATION); // Size is going to get negotiated, no onSizeSet called
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( size, dummy.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).GetVectorXY(), TEST_LOCATION );
- DALI_TEST_EQUALS( dummyImpl.sizeSetCalled, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(size, dummy.GetCurrentProperty<Vector3>(Actor::Property::SIZE).GetVectorXY(), TEST_LOCATION);
+ DALI_TEST_EQUALS(dummyImpl.sizeSetCalled, true, TEST_LOCATION);
application.GetScene().Remove(dummy);
}
application.GetScene().Add(dummy);
Vector2 size(100.0f, 200.0f);
- DALI_TEST_CHECK( size != dummy.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).GetVectorXY() );
+ DALI_TEST_CHECK(size != dummy.GetCurrentProperty<Vector3>(Actor::Property::SIZE).GetVectorXY());
application.SendNotification();
application.Render();
- dummy.SetProperty( Actor::Property::SIZE, size);
+ dummy.SetProperty(Actor::Property::SIZE, size);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS(size, dummy.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).GetVectorXY(), TEST_LOCATION);
+ DALI_TEST_EQUALS(size, dummy.GetCurrentProperty<Vector3>(Actor::Property::SIZE).GetVectorXY(), TEST_LOCATION);
application.GetScene().Remove(dummy);
}
END_TEST;
}
-
int UtcDaliControlImplSizeAnimation(void)
{
ToolkitTestApplication application;
{
- DummyControl dummy = DummyControl::New( true );
+ DummyControl dummy = DummyControl::New(true);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
application.GetScene().Add(dummy);
- DALI_TEST_EQUALS( dummyImpl.sizeAnimationCalled, false, TEST_LOCATION );
+ DALI_TEST_EQUALS(dummyImpl.sizeAnimationCalled, false, TEST_LOCATION);
Animation animation = Animation::New(1.0f);
- animation.AnimateTo( Property( dummy, Actor::Property::SIZE ), Vector3( 100.0f, 150.0f, 200.0f ) );
+ animation.AnimateTo(Property(dummy, Actor::Property::SIZE), Vector3(100.0f, 150.0f, 200.0f));
animation.Play();
application.Render();
application.Render();
application.SendNotification();
- DALI_TEST_EQUALS( dummyImpl.sizeAnimationCalled, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(dummyImpl.sizeAnimationCalled, true, TEST_LOCATION);
application.GetScene().Remove(dummy);
}
application.GetScene().Add(dummy);
Animation animation = Animation::New(1.0f);
- animation.AnimateTo( Property( dummy, Actor::Property::SIZE ), Vector3( 100.0f, 150.0f, 200.0f ) );
+ animation.AnimateTo(Property(dummy, Actor::Property::SIZE), Vector3(100.0f, 150.0f, 200.0f));
animation.Play();
application.Render();
ToolkitTestApplication application;
{
- DummyControl dummy = DummyControl::New( true );
+ DummyControl dummy = DummyControl::New(true);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
application.GetScene().Add(dummy);
application.Render();
application.SendNotification();
- DALI_TEST_EQUALS( dummyImpl.keyEventCalled, false, TEST_LOCATION );
+ DALI_TEST_EQUALS(dummyImpl.keyEventCalled, false, TEST_LOCATION);
Integration::KeyEvent keyEvent;
application.ProcessEvent(keyEvent);
- DALI_TEST_EQUALS( dummyImpl.keyEventCalled, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(dummyImpl.keyEventCalled, true, TEST_LOCATION);
application.GetScene().Remove(dummy);
}
ToolkitTestApplication application;
{
- DummyControl dummy = DummyControl::New( true );
+ DummyControl dummy = DummyControl::New(true);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
application.GetScene().Add(dummy);
- DALI_TEST_EQUALS( dummyImpl.keyInputFocusGained, false, TEST_LOCATION );
+ DALI_TEST_EQUALS(dummyImpl.keyInputFocusGained, false, TEST_LOCATION);
dummy.SetKeyInputFocus();
- DALI_TEST_EQUALS( dummyImpl.keyInputFocusGained, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(dummyImpl.keyInputFocusGained, true, TEST_LOCATION);
application.GetScene().Remove(dummy);
}
ToolkitTestApplication application;
{
- DummyControl dummy = DummyControl::New( true );
+ DummyControl dummy = DummyControl::New(true);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
application.GetScene().Add(dummy);
- DALI_TEST_EQUALS( dummyImpl.keyInputFocusLost, false, TEST_LOCATION );
+ DALI_TEST_EQUALS(dummyImpl.keyInputFocusLost, false, TEST_LOCATION);
dummy.SetKeyInputFocus();
dummy.ClearKeyInputFocus();
- DALI_TEST_EQUALS( dummyImpl.keyInputFocusLost, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(dummyImpl.keyInputFocusLost, true, TEST_LOCATION);
application.GetScene().Remove(dummy);
}
// Register Type
TypeInfo type;
- type = TypeRegistry::Get().GetTypeInfo( "Control" );
- DALI_TEST_CHECK( type );
+ type = TypeRegistry::Get().GetTypeInfo("Control");
+ DALI_TEST_CHECK(type);
BaseHandle handle = type.CreateInstance();
- DALI_TEST_CHECK( handle );
+ DALI_TEST_CHECK(handle);
// Check if it's a control
- DALI_TEST_CHECK( Control::DownCast(handle) );
+ DALI_TEST_CHECK(Control::DownCast(handle));
END_TEST;
}
-
///////////////////////////////////////////////////////////////////////////////////////////////////
int UtcDaliControlImplSetStyleName(void)
ToolkitTestApplication application;
{
- DummyControl dummy = DummyControl::New( true );
+ DummyControl dummy = DummyControl::New(true);
- dummy.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
- dummy.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+ dummy.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ dummy.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
application.GetScene().Add(dummy);
dummy.SetStyleName("TestStyle");
- DALI_TEST_CHECK( dummy.GetStyleName() == "TestStyle" );
+ DALI_TEST_CHECK(dummy.GetStyleName() == "TestStyle");
application.GetScene().Remove(dummy);
}
int UtcDaliControlImplOnStyleChangeN(void)
{
- ToolkitTestApplication application;
- Control dummy = Control::New();
- Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( dummy );
+ ToolkitTestApplication application;
+ Control dummy = Control::New();
+ Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation(dummy);
// test that style manager is being used, passing an empty handle does nothing but does not crash either
Dali::Toolkit::StyleManager styleManager;
- controlImpl.OnStyleChange( styleManager, StyleChange::THEME_CHANGE );
+ controlImpl.OnStyleChange(styleManager, StyleChange::THEME_CHANGE);
// no crash so test passes
tet_result(TET_PASS);
END_TEST;
}
-
int UtcDaliControlImplOnAccessibilityPanP(void)
{
- ToolkitTestApplication application;
- Control dummy = Control::New();
- Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( dummy );
+ ToolkitTestApplication application;
+ Control dummy = Control::New();
+ Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation(dummy);
PanGesture pan;
- DALI_TEST_EQUALS( false, controlImpl.OnAccessibilityPan( pan ), TEST_LOCATION );
+ DALI_TEST_EQUALS(false, controlImpl.OnAccessibilityPan(pan), TEST_LOCATION);
END_TEST;
}
-
int UtcDaliControlImplOnAccessibilityActivatedP(void)
{
ToolkitTestApplication application;
- Control dummy = Control::New();
- Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( dummy );
- DALI_TEST_EQUALS( false, controlImpl.OnAccessibilityActivated(), TEST_LOCATION );
+ Control dummy = Control::New();
+ Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation(dummy);
+ DALI_TEST_EQUALS(false, controlImpl.OnAccessibilityActivated(), TEST_LOCATION);
// Invoke the control's activate action
- TypeInfo type = TypeRegistry::Get().GetTypeInfo( "Control" );
- DALI_TEST_CHECK( type );
+ TypeInfo type = TypeRegistry::Get().GetTypeInfo("Control");
+ DALI_TEST_CHECK(type);
BaseHandle handle = type.CreateInstance();
- DALI_TEST_CHECK( handle );
+ DALI_TEST_CHECK(handle);
Property::Map attributes;
- DALI_TEST_EQUALS( false, handle.DoAction("accessibilityActivated", attributes), TEST_LOCATION );
+ DALI_TEST_EQUALS(false, handle.DoAction("accessibilityActivated", attributes), TEST_LOCATION);
END_TEST;
}
int UtcDaliControlImplGetNextKeyboardFocusableActorP(void)
{
- ToolkitTestApplication application;
- Control dummy = Control::New();
- Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( dummy );
+ ToolkitTestApplication application;
+ Control dummy = Control::New();
+ Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation(dummy);
Actor currentFocusedActor;
- Actor result = controlImpl.GetNextKeyboardFocusableActor( currentFocusedActor, Control::KeyboardFocus::LEFT, false );
+ Actor result = controlImpl.GetNextKeyboardFocusableActor(currentFocusedActor, Control::KeyboardFocus::LEFT, false);
- DALI_TEST_EQUALS( result, currentFocusedActor, TEST_LOCATION );
+ DALI_TEST_EQUALS(result, currentFocusedActor, TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- DummyControl dummy = DummyControl::New();
+ DummyControl dummy = DummyControl::New();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
- Property::Index index =1;
+ Property::Index index = 1;
- DALI_TEST_CHECK( !dummyImpl.GetVisual( index ) );
+ DALI_TEST_CHECK(!dummyImpl.GetVisual(index));
Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
- Toolkit::Visual::Base visual;
+ Toolkit::Visual::Base visual;
Property::Map map;
- map[Visual::Property::TYPE] = Visual::COLOR;
+ map[Visual::Property::TYPE] = Visual::COLOR;
map[ColorVisual::Property::MIX_COLOR] = Color::RED;
- visual = visualFactory.CreateVisual( map );
+ visual = visualFactory.CreateVisual(map);
DALI_TEST_CHECK(visual);
// Register index with a color visual
- dummyImpl.RegisterVisual( index, visual );
+ dummyImpl.RegisterVisual(index, visual);
- DALI_TEST_CHECK( dummyImpl.GetVisual( index ) == visual );
+ DALI_TEST_CHECK(dummyImpl.GetVisual(index) == visual);
Property::Map newMap;
- newMap[Visual::Property::TYPE] = Visual::COLOR;
+ newMap[Visual::Property::TYPE] = Visual::COLOR;
newMap[ColorVisual::Property::MIX_COLOR] = Color::BLUE;
- visual = visualFactory.CreateVisual( newMap );
+ visual = visualFactory.CreateVisual(newMap);
DALI_TEST_CHECK(visual);
// ReRegister with altered color visual
- dummyImpl.RegisterVisual( index, visual );
+ dummyImpl.RegisterVisual(index, visual);
- DALI_TEST_CHECK( dummyImpl.GetVisual( index ) == visual );
+ DALI_TEST_CHECK(dummyImpl.GetVisual(index) == visual);
tet_result(TET_PASS);
{
ToolkitTestApplication application;
- DummyControl dummy = DummyControl::New();
+ DummyControl dummy = DummyControl::New();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
- Property::Index index =1;
+ Property::Index index = 1;
Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
- Toolkit::Visual::Base visual;
+ Toolkit::Visual::Base visual;
Property::Map map;
- map[Visual::Property::TYPE] = Visual::COLOR;
+ map[Visual::Property::TYPE] = Visual::COLOR;
map[ColorVisual::Property::MIX_COLOR] = Color::RED;
- visual = visualFactory.CreateVisual( map );
+ visual = visualFactory.CreateVisual(map);
DALI_TEST_CHECK(visual);
// Register index with a color visual
- dummyImpl.RegisterVisual( index, visual );
+ dummyImpl.RegisterVisual(index, visual);
- DALI_TEST_CHECK( dummyImpl.GetVisual( index ) == visual );
+ DALI_TEST_CHECK(dummyImpl.GetVisual(index) == visual);
// ReRegister to self
- dummyImpl.RegisterVisual( index, visual );
+ dummyImpl.RegisterVisual(index, visual);
- DALI_TEST_CHECK( dummyImpl.GetVisual( index ) == visual );
+ DALI_TEST_CHECK(dummyImpl.GetVisual(index) == visual);
END_TEST;
}
{
ToolkitTestApplication application;
- Test::ObjectDestructionTracker objectDestructionTracker( application.GetCore().GetObjectRegistry() );
+ Test::ObjectDestructionTracker objectDestructionTracker(application.GetCore().GetObjectRegistry());
{
- DummyControl dummy = DummyControl::New();
+ DummyControl dummy = DummyControl::New();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
- objectDestructionTracker.Start( dummy );
+ objectDestructionTracker.Start(dummy);
Property::Index index = 1;
Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
- Toolkit::Visual::Base visual;
+ Toolkit::Visual::Base visual;
Property::Map map;
- map[Visual::Property::TYPE] = Visual::COLOR;
+ map[Visual::Property::TYPE] = Visual::COLOR;
map[ColorVisual::Property::MIX_COLOR] = Color::RED;
- visual = visualFactory.CreateVisual( map );
+ visual = visualFactory.CreateVisual(map);
DALI_TEST_CHECK(visual);
// Register to self
- dummyImpl.RegisterVisual( index, visual );
+ dummyImpl.RegisterVisual(index, visual);
- DALI_TEST_EQUALS( objectDestructionTracker.IsDestroyed(), false, TEST_LOCATION ); // Control not destroyed yet
- DALI_TEST_CHECK( dummyImpl.GetVisual( index ) == visual );
+ DALI_TEST_EQUALS(objectDestructionTracker.IsDestroyed(), false, TEST_LOCATION); // Control not destroyed yet
+ DALI_TEST_CHECK(dummyImpl.GetVisual(index) == visual);
}
- DALI_TEST_EQUALS( objectDestructionTracker.IsDestroyed(), true, TEST_LOCATION ); // Should be destroyed
+ DALI_TEST_EQUALS(objectDestructionTracker.IsDestroyed(), true, TEST_LOCATION); // Should be destroyed
END_TEST;
}
{
ToolkitTestApplication application;
- DummyControl dummy = DummyControl::New();
+ DummyControl dummy = DummyControl::New();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
- Property::Index index =1;
- Property::Index index2 =2;
+ Property::Index index = 1;
+ Property::Index index2 = 2;
Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
- Toolkit::Visual::Base visual;
- Toolkit::Visual::Base secondVisual;
+ Toolkit::Visual::Base visual;
+ Toolkit::Visual::Base secondVisual;
Property::Map map;
- map[Visual::Property::TYPE] = Visual::COLOR;
+ map[Visual::Property::TYPE] = Visual::COLOR;
map[ColorVisual::Property::MIX_COLOR] = Color::RED;
- visual = visualFactory.CreateVisual( map );
+ visual = visualFactory.CreateVisual(map);
DALI_TEST_CHECK(visual);
// Register index with a color visual
- dummyImpl.RegisterVisual( index, visual );
+ dummyImpl.RegisterVisual(index, visual);
Property::Map newMap;
- newMap[Visual::Property::TYPE] = Visual::COLOR;
+ newMap[Visual::Property::TYPE] = Visual::COLOR;
newMap[ColorVisual::Property::MIX_COLOR] = Color::BLUE;
- secondVisual = visualFactory.CreateVisual( newMap );
- DALI_TEST_CHECK( secondVisual );
+ secondVisual = visualFactory.CreateVisual(newMap);
+ DALI_TEST_CHECK(secondVisual);
// ReRegister with altered color visual
- dummyImpl.RegisterVisual( index2, secondVisual );
+ dummyImpl.RegisterVisual(index2, secondVisual);
- DALI_TEST_CHECK( dummyImpl.GetVisual( index ) == visual );
- DALI_TEST_CHECK( dummyImpl.GetVisual( index2 ) == secondVisual );
+ DALI_TEST_CHECK(dummyImpl.GetVisual(index) == visual);
+ DALI_TEST_CHECK(dummyImpl.GetVisual(index2) == secondVisual);
END_TEST;
}
{
ToolkitTestApplication application;
- DummyControl dummy = DummyControl::New();
+ DummyControl dummy = DummyControl::New();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
- Property::Index index =1;
+ Property::Index index = 1;
Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
- Toolkit::Visual::Base visual;
+ Toolkit::Visual::Base visual;
Property::Map map;
- map[Visual::Property::TYPE] = Visual::COLOR;
+ map[Visual::Property::TYPE] = Visual::COLOR;
map[ColorVisual::Property::MIX_COLOR] = Color::RED;
- visual = visualFactory.CreateVisual( map );
+ visual = visualFactory.CreateVisual(map);
DALI_TEST_CHECK(visual);
// Register index with a color visual
- dummyImpl.RegisterVisual( index, visual );
+ dummyImpl.RegisterVisual(index, visual);
- tet_infoline( "Add control with visual to stage and check renderer count is 1" );
- application.GetScene().Add( dummy );
+ tet_infoline("Add control with visual to stage and check renderer count is 1");
+ application.GetScene().Add(dummy);
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( dummyImpl.GetVisual( index ) == visual );
- DALI_TEST_EQUALS( dummy.GetRendererCount(), 1, TEST_LOCATION );
+ DALI_TEST_CHECK(dummyImpl.GetVisual(index) == visual);
+ DALI_TEST_EQUALS(dummy.GetRendererCount(), 1, TEST_LOCATION);
// Unregister visual
- dummyImpl.UnregisterVisual( index );
+ dummyImpl.UnregisterVisual(index);
- tet_infoline( "Remove control with visual from stage and check renderer count is 0" );
- application.GetScene().Remove( dummy );
+ tet_infoline("Remove control with visual from stage and check renderer count is 0");
+ application.GetScene().Remove(dummy);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( dummy.GetRendererCount(), 0, TEST_LOCATION );
- DALI_TEST_CHECK( !dummyImpl.GetVisual( index ) );
+ DALI_TEST_EQUALS(dummy.GetRendererCount(), 0, TEST_LOCATION);
+ DALI_TEST_CHECK(!dummyImpl.GetVisual(index));
END_TEST;
}
{
ToolkitTestApplication application;
- DummyControl dummy = DummyControl::New();
+ DummyControl dummy = DummyControl::New();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
- Property::Index TEST_PROPERTY =1;
+ Property::Index TEST_PROPERTY = 1;
Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
- Toolkit::Visual::Base visual;
+ Toolkit::Visual::Base visual;
Property::Map map;
- map[Visual::Property::TYPE] = Visual::COLOR;
+ map[Visual::Property::TYPE] = Visual::COLOR;
map[ColorVisual::Property::MIX_COLOR] = Color::RED;
- visual = visualFactory.CreateVisual( map );
+ visual = visualFactory.CreateVisual(map);
DALI_TEST_CHECK(visual);
// Register index with a color visual
- dummyImpl.RegisterVisual( TEST_PROPERTY, visual, false );
+ dummyImpl.RegisterVisual(TEST_PROPERTY, visual, false);
- DALI_TEST_CHECK( dummyImpl.GetVisual( TEST_PROPERTY ) == visual );
- DALI_TEST_CHECK( dummyImpl.IsVisualEnabled( TEST_PROPERTY ) == false );
+ DALI_TEST_CHECK(dummyImpl.GetVisual(TEST_PROPERTY) == visual);
+ DALI_TEST_CHECK(dummyImpl.IsVisualEnabled(TEST_PROPERTY) == false);
application.GetScene().Add(dummy);
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( dummyImpl.IsVisualEnabled( TEST_PROPERTY ) == false );
+ DALI_TEST_CHECK(dummyImpl.IsVisualEnabled(TEST_PROPERTY) == false);
- DALI_TEST_CHECK( dummy.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) == true );
+ DALI_TEST_CHECK(dummy.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE) == true);
- dummyImpl.EnableVisual( TEST_PROPERTY, true );
+ dummyImpl.EnableVisual(TEST_PROPERTY, true);
- DALI_TEST_CHECK( dummyImpl.IsVisualEnabled( TEST_PROPERTY ) == true );
+ DALI_TEST_CHECK(dummyImpl.IsVisualEnabled(TEST_PROPERTY) == true);
END_TEST;
}
{
ToolkitTestApplication application;
- DummyControl dummy = DummyControl::New();
+ DummyControl dummy = DummyControl::New();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
- Property::Index TEST_PROPERTY =1;
+ Property::Index TEST_PROPERTY = 1;
Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
- Toolkit::Visual::Base visual;
+ Toolkit::Visual::Base visual;
Property::Map map;
- map[Visual::Property::TYPE] = Visual::COLOR;
+ map[Visual::Property::TYPE] = Visual::COLOR;
map[ColorVisual::Property::MIX_COLOR] = Color::RED;
- visual = visualFactory.CreateVisual( map );
+ visual = visualFactory.CreateVisual(map);
DALI_TEST_CHECK(visual);
// Register index with a color visual
- dummyImpl.RegisterVisual( TEST_PROPERTY, visual );
+ dummyImpl.RegisterVisual(TEST_PROPERTY, visual);
application.GetScene().Add(dummy);
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( dummyImpl.IsVisualEnabled( TEST_PROPERTY ) == true);
+ DALI_TEST_CHECK(dummyImpl.IsVisualEnabled(TEST_PROPERTY) == true);
- DALI_TEST_CHECK( dummy.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) == true );
+ DALI_TEST_CHECK(dummy.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE) == true);
- dummyImpl.EnableVisual( TEST_PROPERTY, false );
+ dummyImpl.EnableVisual(TEST_PROPERTY, false);
- DALI_TEST_CHECK( dummyImpl.IsVisualEnabled( TEST_PROPERTY ) == false );
+ DALI_TEST_CHECK(dummyImpl.IsVisualEnabled(TEST_PROPERTY) == false);
END_TEST;
}
ToolkitTestApplication application;
- DummyControl dummy = DummyControl::New();
+ DummyControl dummy = DummyControl::New();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
- Property::Index TEST_PROPERTY =1;
+ Property::Index TEST_PROPERTY = 1;
Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
- Toolkit::Visual::Base visual;
+ Toolkit::Visual::Base visual;
Property::Map map;
- map[Visual::Property::TYPE] = Visual::COLOR;
+ map[Visual::Property::TYPE] = Visual::COLOR;
map[ColorVisual::Property::MIX_COLOR] = Color::RED;
- visual = visualFactory.CreateVisual( map );
+ visual = visualFactory.CreateVisual(map);
DALI_TEST_CHECK(visual);
// Register index with a color visual
- dummyImpl.RegisterVisual( TEST_PROPERTY, visual, false );
+ dummyImpl.RegisterVisual(TEST_PROPERTY, visual, false);
application.GetScene().Add(dummy);
// Render and notify
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( dummyImpl.IsVisualEnabled( TEST_PROPERTY ) == false );
- DALI_TEST_CHECK( dummy.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) == true );
- dummyImpl.EnableVisual( TEST_PROPERTY, true );
+ DALI_TEST_CHECK(dummyImpl.IsVisualEnabled(TEST_PROPERTY) == false);
+ DALI_TEST_CHECK(dummy.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE) == true);
+ dummyImpl.EnableVisual(TEST_PROPERTY, true);
// Render and notify
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( dummy.GetRendererCount() == 1u );
+ DALI_TEST_CHECK(dummy.GetRendererCount() == 1u);
// Remove control from stage, visual should be removed from stage too
application.GetScene().Remove(dummy);
// Render and notify
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( dummy.GetRendererCount() == 0u );
+ DALI_TEST_CHECK(dummy.GetRendererCount() == 0u);
application.GetScene().Add(dummy);
// Render and notify
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( dummy.GetRendererCount() == 1u );
+ DALI_TEST_CHECK(dummy.GetRendererCount() == 1u);
- DALI_TEST_CHECK( dummyImpl.IsVisualEnabled( TEST_PROPERTY ) == true );
+ DALI_TEST_CHECK(dummyImpl.IsVisualEnabled(TEST_PROPERTY) == true);
END_TEST;
}
ToolkitTestApplication application;
- DummyControl dummy = DummyControl::New();
+ DummyControl dummy = DummyControl::New();
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(dummy.GetImplementation());
- Property::Index TEST_PROPERTY1 =1;
- Property::Index TEST_PROPERTY2 =2;
+ Property::Index TEST_PROPERTY1 = 1;
+ Property::Index TEST_PROPERTY2 = 2;
Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
- Toolkit::Visual::Base visual1;
- Toolkit::Visual::Base visual2;
+ Toolkit::Visual::Base visual1;
+ Toolkit::Visual::Base visual2;
Property::Map map;
- map[Visual::Property::TYPE] = Visual::COLOR;
+ map[Visual::Property::TYPE] = Visual::COLOR;
map[ColorVisual::Property::MIX_COLOR] = Color::RED;
Property::Map map2;
- map[Visual::Property::TYPE] = Visual::COLOR;
+ map[Visual::Property::TYPE] = Visual::COLOR;
map[ColorVisual::Property::MIX_COLOR] = Color::BLUE;
- visual1 = visualFactory.CreateVisual( map );
+ visual1 = visualFactory.CreateVisual(map);
DALI_TEST_CHECK(visual1);
- visual2 = visualFactory.CreateVisual( map );
+ visual2 = visualFactory.CreateVisual(map);
DALI_TEST_CHECK(visual2);
// Register index with a color visual
- dummyImpl.RegisterVisual( TEST_PROPERTY1, visual1 );
+ dummyImpl.RegisterVisual(TEST_PROPERTY1, visual1);
// Register second index with a color visual
- dummyImpl.RegisterVisual( TEST_PROPERTY2, visual2 );
+ dummyImpl.RegisterVisual(TEST_PROPERTY2, visual2);
application.GetScene().Add(dummy);
// Render and notify
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( dummy.GetRendererCount() == 2u );
- DALI_TEST_CHECK( dummyImpl.IsVisualEnabled( TEST_PROPERTY1 ) == true );
- DALI_TEST_CHECK( dummyImpl.IsVisualEnabled( TEST_PROPERTY1 ) == true);
- DALI_TEST_CHECK( dummy.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) == true );
- dummyImpl.EnableVisual( TEST_PROPERTY2, false );
+ DALI_TEST_CHECK(dummy.GetRendererCount() == 2u);
+ DALI_TEST_CHECK(dummyImpl.IsVisualEnabled(TEST_PROPERTY1) == true);
+ DALI_TEST_CHECK(dummyImpl.IsVisualEnabled(TEST_PROPERTY1) == true);
+ DALI_TEST_CHECK(dummy.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE) == true);
+ dummyImpl.EnableVisual(TEST_PROPERTY2, false);
// Render and notify
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( dummy.GetRendererCount() == 1u );
+ DALI_TEST_CHECK(dummy.GetRendererCount() == 1u);
// Remove control from stage, visual should be removed from stage too
application.GetScene().Remove(dummy);
// Render and notify
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( dummy.GetRendererCount() == 0u );
+ DALI_TEST_CHECK(dummy.GetRendererCount() == 0u);
application.GetScene().Add(dummy);
// Render and notify
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( dummy.GetRendererCount() == 1u );
+ DALI_TEST_CHECK(dummy.GetRendererCount() == 1u);
- DALI_TEST_CHECK( dummyImpl.IsVisualEnabled( TEST_PROPERTY1 ) == true );
- DALI_TEST_CHECK( dummyImpl.IsVisualEnabled( TEST_PROPERTY2 ) == false );
+ DALI_TEST_CHECK(dummyImpl.IsVisualEnabled(TEST_PROPERTY1) == true);
+ DALI_TEST_CHECK(dummyImpl.IsVisualEnabled(TEST_PROPERTY2) == false);
END_TEST;
}
{
ToolkitTestApplication application;
- tet_infoline( "Test to ensure a renderer does NOT get added when we've already registered a visual which we haven't enabled" );
+ tet_infoline("Test to ensure a renderer does NOT get added when we've already registered a visual which we haven't enabled");
- DummyControl control = DummyControl::New();
- DummyControlImpl& controlImpl = static_cast<DummyControlImpl&>( control.GetImplementation() );
+ DummyControl control = DummyControl::New();
+ DummyControlImpl& controlImpl = static_cast<DummyControlImpl&>(control.GetImplementation());
Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
- Toolkit::Visual::Base visual;
- Property::Map map;
- map[Visual::Property::TYPE] = Visual::COLOR;
+ Toolkit::Visual::Base visual;
+ Property::Map map;
+ map[Visual::Property::TYPE] = Visual::COLOR;
map[ColorVisual::Property::MIX_COLOR] = Color::RED;
- visual = visualFactory.CreateVisual( map );
+ visual = visualFactory.CreateVisual(map);
DALI_TEST_CHECK(visual);
- controlImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual, false );
+ controlImpl.RegisterVisual(Control::CONTROL_PROPERTY_END_INDEX + 1, visual, false);
- DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS(0, control.GetRendererCount(), TEST_LOCATION);
- control.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
+ control.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN);
- application.GetScene().Add( control );
+ application.GetScene().Add(control);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS(0, control.GetRendererCount(), TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- tet_infoline( "Test to ensure a renderer does NOT get added when we've already registered a visual which we haven't enabled and we're already on the stage" );
+ tet_infoline("Test to ensure a renderer does NOT get added when we've already registered a visual which we haven't enabled and we're already on the stage");
- DummyControl control = DummyControl::New();
- DummyControlImpl& controlImpl = static_cast<DummyControlImpl&>( control.GetImplementation() );
+ DummyControl control = DummyControl::New();
+ DummyControlImpl& controlImpl = static_cast<DummyControlImpl&>(control.GetImplementation());
Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
- Toolkit::Visual::Base visual;
- Property::Map map;
- map[Visual::Property::TYPE] = Visual::COLOR;
+ Toolkit::Visual::Base visual;
+ Property::Map map;
+ map[Visual::Property::TYPE] = Visual::COLOR;
map[ColorVisual::Property::MIX_COLOR] = Color::RED;
- visual = visualFactory.CreateVisual( map );
+ visual = visualFactory.CreateVisual(map);
DALI_TEST_CHECK(visual);
- controlImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual, false );
+ controlImpl.RegisterVisual(Control::CONTROL_PROPERTY_END_INDEX + 1, visual, false);
- DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS(0, control.GetRendererCount(), TEST_LOCATION);
- application.GetScene().Add( control );
+ application.GetScene().Add(control);
application.SendNotification();
application.Render();
- control.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
+ control.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS(0, control.GetRendererCount(), TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
Control control = Control::New();
- control.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
- control.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+ control.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ control.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
application.GetScene().Add(control);
application.SendNotification();
impl.EnableGestureDetection(GestureType::PINCH);
// Scale becomes 0.6666666
- TestStartPinch( application, Vector2( 5.0f, 20.0f ), Vector2( 35.0f, 20.0f ),
- Vector2( 10.0f, 20.0f ), Vector2( 30.0f, 20.0f ), 100 );
+ TestStartPinch(application, Vector2(5.0f, 20.0f), Vector2(35.0f, 20.0f), Vector2(10.0f, 20.0f), Vector2(30.0f, 20.0f), 100);
- DALI_TEST_EQUALS(0.666f, control.GetProperty( Actor::Property::SCALE_X).Get<float>(), 0.01f, TEST_LOCATION);
+ DALI_TEST_EQUALS(0.666f, control.GetProperty(Actor::Property::SCALE_X).Get<float>(), 0.01f, TEST_LOCATION);
END_TEST;
-
}
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
#include <stdlib.h>
+#include <iostream>
// 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.h>
-#include <dali/public-api/dali-core.h>
-#include <dali/devel-api/actors/custom-actor-devel.h>
-#include <dali/devel-api/object/csharp-type-registry.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/controls/control-devel.h>
-#include <dali-toolkit/devel-api/controls/control-wrapper.h>
#include <dali-toolkit/devel-api/controls/control-wrapper-impl.h>
-#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
+#include <dali-toolkit/devel-api/controls/control-wrapper.h>
#include <dali-toolkit/devel-api/visual-factory/transition-data.h>
+#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
+#include <dali.h>
+#include <dali/devel-api/actors/custom-actor-devel.h>
+#include <dali/devel-api/object/csharp-type-registry.h>
+#include <dali/public-api/dali-core.h>
using namespace Dali;
using namespace Dali::Toolkit;
static bool gKeyInputFocusCallBackCalled;
-static void TestKeyInputFocusCallback( Control control )
+static void TestKeyInputFocusCallback(Control control)
{
tet_infoline(" TestKeyInputFocusCallback");
///////////////////////////////////////////////////////////////////////////////////////////////////
-
namespace Impl
{
struct TestCustomControl : public Toolkit::Internal::ControlWrapper
/**
* Constructor
*/
- TestCustomControl() : Toolkit::Internal::ControlWrapper( CustomControlBehaviour( Toolkit::Internal::ControlWrapper::DISABLE_STYLE_CHANGE_SIGNALS |
- Toolkit::Internal::ControlWrapper::REQUIRES_KEYBOARD_NAVIGATION_SUPPORT )) ,
- mDaliProperty( Property::INVALID_INDEX ),
- mSizeSet( Vector3::ZERO ),
- mTargetSize( Vector3::ZERO ),
- mNego( false ),
- mDepth( 0u )
+ TestCustomControl()
+ : Toolkit::Internal::ControlWrapper(CustomControlBehaviour(Toolkit::Internal::ControlWrapper::DISABLE_STYLE_CHANGE_SIGNALS |
+ Toolkit::Internal::ControlWrapper::REQUIRES_KEYBOARD_NAVIGATION_SUPPORT)),
+ mDaliProperty(Property::INVALID_INDEX),
+ mSizeSet(Vector3::ZERO),
+ mTargetSize(Vector3::ZERO),
+ mNego(false),
+ mDepth(0u)
{
}
- TestCustomControl(bool nego) : Toolkit::Internal::ControlWrapper( CustomControlBehaviour( Toolkit::Internal::ControlWrapper::DISABLE_STYLE_CHANGE_SIGNALS |
- Toolkit::Internal::ControlWrapper::REQUIRES_KEYBOARD_NAVIGATION_SUPPORT ) ),
- mDaliProperty( Property::INVALID_INDEX ),
- mSizeSet( Vector3::ZERO ),
- mTargetSize( Vector3::ZERO ),
- mNego( nego ),
- mDepth( 0u )
+ TestCustomControl(bool nego)
+ : Toolkit::Internal::ControlWrapper(CustomControlBehaviour(Toolkit::Internal::ControlWrapper::DISABLE_STYLE_CHANGE_SIGNALS |
+ Toolkit::Internal::ControlWrapper::REQUIRES_KEYBOARD_NAVIGATION_SUPPORT)),
+ mDaliProperty(Property::INVALID_INDEX),
+ mSizeSet(Vector3::ZERO),
+ mTargetSize(Vector3::ZERO),
+ mNego(nego),
+ mDepth(0u)
{
}
{
}
- void Initialize( const char* name = NULL )
+ void Initialize(const char* name = NULL)
{
- mDaliProperty = Self().RegisterProperty( "Dali", std::string("no"), Property::READ_WRITE );
+ mDaliProperty = Self().RegisterProperty("Dali", std::string("no"), Property::READ_WRITE);
- OnInitialize( name );
+ OnInitialize(name);
}
using Control::OnInitialize; ///< To tell the compiler that we really do want to overload OnInitialize in this class & were not trying to override it
- virtual void OnInitialize( const char* name ) {}
+ virtual void OnInitialize(const char* name)
+ {
+ }
// From Toolkit::Internal::ControlWrapper
- virtual void OnSceneConnection( int depth )
+ virtual void OnSceneConnection(int depth)
{
mDepth = depth;
Control::OnSceneConnection(depth);
{
Control::OnSceneDisconnection();
}
- virtual void OnChildAdd( Actor& child )
+ virtual void OnChildAdd(Actor& child)
{
Control::OnChildAdd(child);
}
- virtual void OnChildRemove( Actor& child )
+ virtual void OnChildRemove(Actor& child)
{
Control::OnChildRemove(child);
}
- virtual void OnPropertySet( Property::Index index, const Property::Value& propertyValue )
+ virtual void OnPropertySet(Property::Index index, const Property::Value& propertyValue)
{
Control::OnPropertySet(index, propertyValue);
}
- virtual void OnSizeSet( const Vector3& targetSize )
+ virtual void OnSizeSet(const Vector3& targetSize)
{
mSizeSet = targetSize;
- Control::OnSizeSet( targetSize );
+ Control::OnSizeSet(targetSize);
}
- virtual void OnSizeAnimation( Animation& animation, const Vector3& targetSize )
+ virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize)
{
mTargetSize = targetSize;
- Control::OnSizeAnimation( animation, targetSize );
+ Control::OnSizeAnimation(animation, targetSize);
}
- virtual bool OnHoverEvent( const HoverEvent& event )
+ virtual bool OnHoverEvent(const HoverEvent& event)
{
return true;
}
- virtual bool OnWheelEvent( const WheelEvent& event )
+ virtual bool OnWheelEvent(const WheelEvent& event)
{
return true;
}
- virtual bool OnKeyEvent( const KeyEvent& event )
+ virtual bool OnKeyEvent(const KeyEvent& event)
{
return true;
}
}
virtual Vector3 GetNaturalSize()
{
- return Vector3( 0.0f, 0.0f, 0.0f );
+ return Vector3(0.0f, 0.0f, 0.0f);
}
- virtual float GetHeightForWidth( float width )
+ virtual float GetHeightForWidth(float width)
{
return 0.0f;
}
- virtual float GetWidthForHeight( float height )
+ virtual float GetWidthForHeight(float height)
{
return 0.0f;
}
- void TestRegisterVisual( Property::Index index, Toolkit::Visual::Base visual )
+ void TestRegisterVisual(Property::Index index, Toolkit::Visual::Base visual)
{
- ControlWrapper::RegisterVisual( index, visual );
+ ControlWrapper::RegisterVisual(index, visual);
- VisualIndices::iterator iter = std::find( mRegisteredVisualIndices.begin(), mRegisteredVisualIndices.end(), index );
- if( iter == mRegisteredVisualIndices.end() )
+ VisualIndices::iterator iter = std::find(mRegisteredVisualIndices.begin(), mRegisteredVisualIndices.end(), index);
+ if(iter == mRegisteredVisualIndices.end())
{
mRegisteredVisualIndices.push_back(index);
}
}
- virtual void OnRelayout( const Vector2& size, RelayoutContainer& container )
+ virtual void OnRelayout(const Vector2& size, RelayoutContainer& container)
{
gOnRelayout = true;
- for( VisualIndices::iterator iter = mRegisteredVisualIndices.begin(); iter != mRegisteredVisualIndices.end() ; ++iter )
+ for(VisualIndices::iterator iter = mRegisteredVisualIndices.begin(); iter != mRegisteredVisualIndices.end(); ++iter)
{
- Visual::Base visual = GetVisual(*iter);
+ Visual::Base visual = GetVisual(*iter);
Property::Map map; // empty map enforces defaults
- visual.SetTransformAndSize( map, size );
+ visual.SetTransformAndSize(map, size);
}
}
- virtual void OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension )
+ virtual void OnSetResizePolicy(ResizePolicy::Type policy, Dimension::Type dimension)
{
}
- virtual void OnCalculateRelayoutSize( Dimension::Type dimension )
+ virtual void OnCalculateRelayoutSize(Dimension::Type dimension)
{
}
- virtual float CalculateChildSize( const Dali::Actor& child, Dimension::Type dimension )
+ virtual float CalculateChildSize(const Dali::Actor& child, Dimension::Type dimension)
{
return 0.0f;
}
- virtual void OnLayoutNegotiated( float size, Dimension::Type dimension )
+ virtual void OnLayoutNegotiated(float size, Dimension::Type dimension)
{
}
- virtual bool RelayoutDependentOnChildren( Dimension::Type dimension = Dimension::ALL_DIMENSIONS )
+ virtual bool RelayoutDependentOnChildren(Dimension::Type dimension = Dimension::ALL_DIMENSIONS)
{
return false;
}
RelayoutRequest();
}
- float TestGetHeightForWidthBase( float width )
+ float TestGetHeightForWidthBase(float width)
{
- return GetHeightForWidthBase( width );
+ return GetHeightForWidthBase(width);
}
- float TestGetWidthForHeightBase( float height )
+ float TestGetWidthForHeightBase(float height)
{
- return GetWidthForHeightBase( height );
+ return GetWidthForHeightBase(height);
}
- float TestCalculateChildSizeBase( const Dali::Actor& child, Dimension::Type dimension )
+ float TestCalculateChildSizeBase(const Dali::Actor& child, Dimension::Type dimension)
{
- return CalculateChildSizeBase( child, dimension );
+ return CalculateChildSizeBase(child, dimension);
}
- bool TestRelayoutDependentOnChildrenBase( Dimension::Type dimension )
+ bool TestRelayoutDependentOnChildrenBase(Dimension::Type dimension)
{
- return RelayoutDependentOnChildrenBase( dimension );
+ return RelayoutDependentOnChildrenBase(dimension);
}
Property::Index mDaliProperty;
- Vector3 mSizeSet;
- Vector3 mTargetSize;
- bool mNego;
- unsigned int mDepth;
+ Vector3 mSizeSet;
+ Vector3 mTargetSize;
+ bool mNego;
+ unsigned int mDepth;
typedef std::vector<Property::Index> VisualIndices;
- VisualIndices mRegisteredVisualIndices;
+ VisualIndices mRegisteredVisualIndices;
};
+} // namespace Impl
-
-}
-
-static std::string customControlTypeName = "MyTestCustomControl";
-static TypeRegistration customControl( customControlTypeName, typeid(Dali::Toolkit::Control), NULL );
-
+static std::string customControlTypeName = "MyTestCustomControl";
+static TypeRegistration customControl(customControlTypeName, typeid(Dali::Toolkit::Control), NULL);
int UtcDaliControlWrapperConstructor(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
- Toolkit::Internal::ControlWrapper* controlWrapperImpl = new Toolkit::Internal::ControlWrapper( Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT );
- ControlWrapper controlWrapper;
+ Toolkit::Internal::ControlWrapper* controlWrapperImpl = new Toolkit::Internal::ControlWrapper(Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT);
+ ControlWrapper controlWrapper;
- DALI_TEST_CHECK( !ControlWrapper::DownCast( controlWrapper ) );
+ DALI_TEST_CHECK(!ControlWrapper::DownCast(controlWrapper));
- controlWrapper = ControlWrapper::New( customControlTypeName, *controlWrapperImpl );
+ controlWrapper = ControlWrapper::New(customControlTypeName, *controlWrapperImpl);
- DALI_TEST_CHECK( ControlWrapper::DownCast( controlWrapper ) );
+ DALI_TEST_CHECK(ControlWrapper::DownCast(controlWrapper));
- Dali::TypeInfo typeInfo = DevelCustomActor::GetTypeInfo( controlWrapper );
-
- DALI_TEST_EQUALS( typeInfo.GetName(), customControlTypeName, TEST_LOCATION);
+ Dali::TypeInfo typeInfo = DevelCustomActor::GetTypeInfo(controlWrapper);
+ DALI_TEST_EQUALS(typeInfo.GetName(), customControlTypeName, TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- ControlWrapper control = ControlWrapper::New( customControlTypeName, *( new Toolkit::Internal::ControlWrapper( Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT ) ) );
+ ControlWrapper control = ControlWrapper::New(customControlTypeName, *(new Toolkit::Internal::ControlWrapper(Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT)));
- ControlWrapper control2( control );
+ ControlWrapper control2(control);
- DALI_TEST_CHECK( control );
+ DALI_TEST_CHECK(control);
control.Reset();
- DALI_TEST_CHECK( !control );
+ DALI_TEST_CHECK(!control);
- DALI_TEST_CHECK( control2 );
+ DALI_TEST_CHECK(control2);
control2.Reset();
- DALI_TEST_CHECK( !control2 );
+ DALI_TEST_CHECK(!control2);
END_TEST;
}
{
ToolkitTestApplication application;
- DALI_TEST_EQUALS( gOnRelayout, false, TEST_LOCATION );
+ DALI_TEST_EQUALS(gOnRelayout, false, TEST_LOCATION);
- Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl( Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT );
- ControlWrapper controlWrapper = ControlWrapper::New( customControlTypeName, *controlWrapperImpl );
+ Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl(Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT);
+ ControlWrapper controlWrapper = ControlWrapper::New(customControlTypeName, *controlWrapperImpl);
- application.GetScene().Add( controlWrapper );
+ application.GetScene().Add(controlWrapper);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( gOnRelayout, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gOnRelayout, true, TEST_LOCATION);
gOnRelayout = false;
controlWrapperImpl->TestRelayoutRequest();
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( gOnRelayout, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gOnRelayout, true, TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl( Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT );
- ControlWrapper controlWrapper = ControlWrapper::New( customControlTypeName, *controlWrapperImpl );
+ Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl(Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT);
+ ControlWrapper controlWrapper = ControlWrapper::New(customControlTypeName, *controlWrapperImpl);
float width = 300.0f;
- float v = 0.0f;
+ float v = 0.0f;
application.SendNotification();
application.Render();
- v = controlWrapperImpl->TestGetHeightForWidthBase( width );
+ v = controlWrapperImpl->TestGetHeightForWidthBase(width);
- DALI_TEST_EQUALS( width, v, TEST_LOCATION );
+ DALI_TEST_EQUALS(width, v, TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl( Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT );
- ControlWrapper controlWrapper = ControlWrapper::New( customControlTypeName, *controlWrapperImpl );
+ Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl(Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT);
+ ControlWrapper controlWrapper = ControlWrapper::New(customControlTypeName, *controlWrapperImpl);
float height = 300.0f;
- float v = 0.0f;
+ float v = 0.0f;
application.SendNotification();
application.Render();
- v = controlWrapperImpl->TestGetWidthForHeightBase( height );
+ v = controlWrapperImpl->TestGetWidthForHeightBase(height);
- DALI_TEST_EQUALS( height, v, TEST_LOCATION );
+ DALI_TEST_EQUALS(height, v, TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl( Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT );
- ControlWrapper controlWrapper = ControlWrapper::New( customControlTypeName, *controlWrapperImpl );
+ Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl(Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT);
+ ControlWrapper controlWrapper = ControlWrapper::New(customControlTypeName, *controlWrapperImpl);
Actor child = Actor::New();
- child.SetResizePolicy( Dali::ResizePolicy::FIXED, Dali::Dimension::ALL_DIMENSIONS );
- child.SetProperty( Actor::Property::SIZE, Vector2(150, 150) );
+ child.SetResizePolicy(Dali::ResizePolicy::FIXED, Dali::Dimension::ALL_DIMENSIONS);
+ child.SetProperty(Actor::Property::SIZE, Vector2(150, 150));
application.SendNotification();
application.Render();
float v = 9.99f;
- v = controlWrapperImpl->TestCalculateChildSizeBase( child, Dali::Dimension::ALL_DIMENSIONS );
- DALI_TEST_EQUALS( v, 0.0f, TEST_LOCATION );
+ v = controlWrapperImpl->TestCalculateChildSizeBase(child, Dali::Dimension::ALL_DIMENSIONS);
+ DALI_TEST_EQUALS(v, 0.0f, TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl( Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT );
- ControlWrapper controlWrapper = ControlWrapper::New( customControlTypeName, *controlWrapperImpl );
+ Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl(Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT);
+ ControlWrapper controlWrapper = ControlWrapper::New(customControlTypeName, *controlWrapperImpl);
bool v = false;
- v = controlWrapperImpl->TestRelayoutDependentOnChildrenBase( Dali::Dimension::ALL_DIMENSIONS );
+ v = controlWrapperImpl->TestRelayoutDependentOnChildrenBase(Dali::Dimension::ALL_DIMENSIONS);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( v, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(v, true, TEST_LOCATION);
- controlWrapper.SetResizePolicy( Dali::ResizePolicy::FIXED, Dali::Dimension::ALL_DIMENSIONS );
- v = controlWrapperImpl->TestRelayoutDependentOnChildrenBase( Dali::Dimension::WIDTH );
+ controlWrapper.SetResizePolicy(Dali::ResizePolicy::FIXED, Dali::Dimension::ALL_DIMENSIONS);
+ v = controlWrapperImpl->TestRelayoutDependentOnChildrenBase(Dali::Dimension::WIDTH);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( v, false, TEST_LOCATION );
+ DALI_TEST_EQUALS(v, false, TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- Test::ObjectDestructionTracker objectDestructionTracker( application.GetCore().GetObjectRegistry() );
+ Test::ObjectDestructionTracker objectDestructionTracker(application.GetCore().GetObjectRegistry());
{
- Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl( Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT );
- ControlWrapper controlWrapper = ControlWrapper::New( customControlTypeName, *controlWrapperImpl );
+ Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl(Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT);
+ ControlWrapper controlWrapper = ControlWrapper::New(customControlTypeName, *controlWrapperImpl);
- objectDestructionTracker.Start( controlWrapper );
+ objectDestructionTracker.Start(controlWrapper);
Property::Index index = 1;
Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
- Toolkit::Visual::Base visual;
+ Toolkit::Visual::Base visual;
Property::Map map;
- map[Visual::Property::TYPE] = Visual::COLOR;
+ map[Visual::Property::TYPE] = Visual::COLOR;
map[ColorVisual::Property::MIX_COLOR] = Color::RED;
- visual = visualFactory.CreateVisual( map );
- DALI_TEST_CHECK( visual );
+ visual = visualFactory.CreateVisual(map);
+ DALI_TEST_CHECK(visual);
// Register to self
- controlWrapperImpl->RegisterVisual( index, visual );
+ controlWrapperImpl->RegisterVisual(index, visual);
- DALI_TEST_EQUALS( objectDestructionTracker.IsDestroyed(), false, TEST_LOCATION ); // Control not destroyed yet
- DALI_TEST_EQUALS( controlWrapperImpl->GetVisual( index ), visual, TEST_LOCATION );
+ DALI_TEST_EQUALS(objectDestructionTracker.IsDestroyed(), false, TEST_LOCATION); // Control not destroyed yet
+ DALI_TEST_EQUALS(controlWrapperImpl->GetVisual(index), visual, TEST_LOCATION);
}
- DALI_TEST_EQUALS( objectDestructionTracker.IsDestroyed(), true, TEST_LOCATION ); // Should be destroyed
+ DALI_TEST_EQUALS(objectDestructionTracker.IsDestroyed(), true, TEST_LOCATION); // Should be destroyed
END_TEST;
}
{
ToolkitTestApplication application;
- Test::ObjectDestructionTracker objectDestructionTracker( application.GetCore().GetObjectRegistry() );
+ Test::ObjectDestructionTracker objectDestructionTracker(application.GetCore().GetObjectRegistry());
{
- Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl( Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT );
- ControlWrapper controlWrapper = ControlWrapper::New( customControlTypeName, *controlWrapperImpl );
+ Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl(Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT);
+ ControlWrapper controlWrapper = ControlWrapper::New(customControlTypeName, *controlWrapperImpl);
- objectDestructionTracker.Start( controlWrapper );
+ objectDestructionTracker.Start(controlWrapper);
Property::Index index = 1;
Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
- Toolkit::Visual::Base visual;
+ Toolkit::Visual::Base visual;
Property::Map map;
- map[Visual::Property::TYPE] = Visual::COLOR;
+ map[Visual::Property::TYPE] = Visual::COLOR;
map[ColorVisual::Property::MIX_COLOR] = Color::RED;
- visual = visualFactory.CreateVisual( map );
- DALI_TEST_CHECK( visual );
+ visual = visualFactory.CreateVisual(map);
+ DALI_TEST_CHECK(visual);
// Register to self
- controlWrapperImpl->RegisterVisual( index, visual, 4 );
+ controlWrapperImpl->RegisterVisual(index, visual, 4);
- DALI_TEST_EQUALS( objectDestructionTracker.IsDestroyed(), false, TEST_LOCATION ); // Control not destroyed yet
- DALI_TEST_EQUALS( controlWrapperImpl->GetVisual( index ), visual, TEST_LOCATION );
- DALI_TEST_EQUALS( visual.GetDepthIndex(), 4, TEST_LOCATION );
+ DALI_TEST_EQUALS(objectDestructionTracker.IsDestroyed(), false, TEST_LOCATION); // Control not destroyed yet
+ DALI_TEST_EQUALS(controlWrapperImpl->GetVisual(index), visual, TEST_LOCATION);
+ DALI_TEST_EQUALS(visual.GetDepthIndex(), 4, TEST_LOCATION);
}
- DALI_TEST_EQUALS( objectDestructionTracker.IsDestroyed(), true, TEST_LOCATION ); // Should be destroyed
+ DALI_TEST_EQUALS(objectDestructionTracker.IsDestroyed(), true, TEST_LOCATION); // Should be destroyed
END_TEST;
}
{
ToolkitTestApplication application;
- Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl( Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT );
- ControlWrapper controlWrapper = ControlWrapper::New( customControlTypeName, *controlWrapperImpl );
+ Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl(Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT);
+ ControlWrapper controlWrapper = ControlWrapper::New(customControlTypeName, *controlWrapperImpl);
Property::Index TEST_PROPERTY = 1;
Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
- Toolkit::Visual::Base visual;
+ Toolkit::Visual::Base visual;
Property::Map map;
- map[Visual::Property::TYPE] = Visual::COLOR;
+ map[Visual::Property::TYPE] = Visual::COLOR;
map[ColorVisual::Property::MIX_COLOR] = Color::RED;
- visual = visualFactory.CreateVisual( map );
+ visual = visualFactory.CreateVisual(map);
DALI_TEST_CHECK(visual);
// Register index with a color visual
- controlWrapperImpl->RegisterVisual( TEST_PROPERTY, visual, false );
+ controlWrapperImpl->RegisterVisual(TEST_PROPERTY, visual, false);
- DALI_TEST_EQUALS( controlWrapperImpl->GetVisual( TEST_PROPERTY ), visual, TEST_LOCATION );
- DALI_TEST_EQUALS( controlWrapperImpl->IsVisualEnabled( TEST_PROPERTY ), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(controlWrapperImpl->GetVisual(TEST_PROPERTY), visual, TEST_LOCATION);
+ DALI_TEST_EQUALS(controlWrapperImpl->IsVisualEnabled(TEST_PROPERTY), false, TEST_LOCATION);
- application.GetScene().Add( controlWrapper );
+ application.GetScene().Add(controlWrapper);
// Render and notify
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( controlWrapperImpl->IsVisualEnabled( TEST_PROPERTY ), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(controlWrapperImpl->IsVisualEnabled(TEST_PROPERTY), false, TEST_LOCATION);
- DALI_TEST_EQUALS( controlWrapper.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(controlWrapper.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE), true, TEST_LOCATION);
- controlWrapperImpl->EnableVisual( TEST_PROPERTY, true );
+ controlWrapperImpl->EnableVisual(TEST_PROPERTY, true);
- DALI_TEST_EQUALS( controlWrapperImpl->IsVisualEnabled( TEST_PROPERTY ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(controlWrapperImpl->IsVisualEnabled(TEST_PROPERTY), true, TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl( Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT );
- ControlWrapper controlWrapper = ControlWrapper::New( customControlTypeName, *controlWrapperImpl );
+ Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl(Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT);
+ ControlWrapper controlWrapper = ControlWrapper::New(customControlTypeName, *controlWrapperImpl);
Property::Index TEST_PROPERTY = 1;
Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
- Toolkit::Visual::Base visual;
+ Toolkit::Visual::Base visual;
Property::Map map;
- map[Visual::Property::TYPE] = Visual::COLOR;
+ map[Visual::Property::TYPE] = Visual::COLOR;
map[ColorVisual::Property::MIX_COLOR] = Color::RED;
- visual = visualFactory.CreateVisual( map );
+ visual = visualFactory.CreateVisual(map);
DALI_TEST_CHECK(visual);
// Register index with a color visual
- controlWrapperImpl->RegisterVisual( TEST_PROPERTY, visual, false, 10 );
+ controlWrapperImpl->RegisterVisual(TEST_PROPERTY, visual, false, 10);
- DALI_TEST_EQUALS( controlWrapperImpl->GetVisual( TEST_PROPERTY ), visual, TEST_LOCATION );
- DALI_TEST_EQUALS( controlWrapperImpl->IsVisualEnabled( TEST_PROPERTY ), false, TEST_LOCATION );
- DALI_TEST_EQUALS( visual.GetDepthIndex(), 10, TEST_LOCATION );
+ DALI_TEST_EQUALS(controlWrapperImpl->GetVisual(TEST_PROPERTY), visual, TEST_LOCATION);
+ DALI_TEST_EQUALS(controlWrapperImpl->IsVisualEnabled(TEST_PROPERTY), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(visual.GetDepthIndex(), 10, TEST_LOCATION);
- application.GetScene().Add( controlWrapper );
+ application.GetScene().Add(controlWrapper);
// Render and notify
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( controlWrapperImpl->IsVisualEnabled( TEST_PROPERTY ), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(controlWrapperImpl->IsVisualEnabled(TEST_PROPERTY), false, TEST_LOCATION);
- DALI_TEST_EQUALS( controlWrapper.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(controlWrapper.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE), true, TEST_LOCATION);
- controlWrapperImpl->EnableVisual( TEST_PROPERTY, true );
+ controlWrapperImpl->EnableVisual(TEST_PROPERTY, true);
- DALI_TEST_EQUALS( controlWrapperImpl->IsVisualEnabled( TEST_PROPERTY ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(controlWrapperImpl->IsVisualEnabled(TEST_PROPERTY), true, TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl( Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT );
- ControlWrapper controlWrapper = ControlWrapper::New( customControlTypeName, *controlWrapperImpl );
+ Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl(Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT);
+ ControlWrapper controlWrapper = ControlWrapper::New(customControlTypeName, *controlWrapperImpl);
Property::Index index = 1;
Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
- Toolkit::Visual::Base visual;
+ Toolkit::Visual::Base visual;
Property::Map map;
- map[Visual::Property::TYPE] = Visual::COLOR;
+ map[Visual::Property::TYPE] = Visual::COLOR;
map[ColorVisual::Property::MIX_COLOR] = Color::RED;
- visual = visualFactory.CreateVisual( map );
+ visual = visualFactory.CreateVisual(map);
DALI_TEST_CHECK(visual);
// Register index with a color visual
- controlWrapperImpl->RegisterVisual( index, visual );
+ controlWrapperImpl->RegisterVisual(index, visual);
- DALI_TEST_EQUALS( controlWrapperImpl->GetVisual( index ), visual, TEST_LOCATION );
+ DALI_TEST_EQUALS(controlWrapperImpl->GetVisual(index), visual, TEST_LOCATION);
// Unregister visual
- controlWrapperImpl->UnregisterVisual( index );
+ controlWrapperImpl->UnregisterVisual(index);
- DALI_TEST_CHECK( !controlWrapperImpl->GetVisual( index ) );
+ DALI_TEST_CHECK(!controlWrapperImpl->GetVisual(index));
END_TEST;
}
ToolkitTestApplication application;
Property::Map map;
- map["target"] = "Actor1";
- map["property"] = "randomProperty";
+ map["target"] = "Actor1";
+ map["property"] = "randomProperty";
map["initialValue"] = Color::MAGENTA;
- map["targetValue"] = Color::RED;
- map["animator"] = Property::Map()
- .Add("alphaFunction", "EASE_OUT")
- .Add("timePeriod", Property::Map()
- .Add("delay", 0.5f)
- .Add("duration", 1.0f));
+ map["targetValue"] = Color::RED;
+ map["animator"] = Property::Map()
+ .Add("alphaFunction", "EASE_OUT")
+ .Add("timePeriod", Property::Map().Add("delay", 0.5f).Add("duration", 1.0f));
- Dali::Toolkit::TransitionData transition = TransitionData::New( map );
+ Dali::Toolkit::TransitionData transition = TransitionData::New(map);
- Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl( Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT );
- ControlWrapper controlWrapper = ControlWrapper::New( customControlTypeName, *controlWrapperImpl );
+ Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl(Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT);
+ ControlWrapper controlWrapper = ControlWrapper::New(customControlTypeName, *controlWrapperImpl);
//DummyControl actor = DummyControl::New();
controlWrapper.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
- controlWrapper.SetProperty( Dali::Actor::Property::NAME,"Actor1");
- controlWrapper.SetProperty( Actor::Property::COLOR,Color::CYAN);
+ controlWrapper.SetProperty(Dali::Actor::Property::NAME, "Actor1");
+ controlWrapper.SetProperty(Actor::Property::COLOR, Color::CYAN);
application.GetScene().Add(controlWrapper);
- Animation anim = controlWrapperImpl->CreateTransition( transition );
- DALI_TEST_CHECK( ! anim );
+ Animation anim = controlWrapperImpl->CreateTransition(transition);
+ DALI_TEST_CHECK(!anim);
Property::Map returnedMap = transition.GetAnimatorAt(0);
Property::Value* value = returnedMap.Find("property");
- DALI_TEST_CHECK( value != NULL);
- DALI_TEST_EQUALS( "randomProperty", value->Get<std::string>(), TEST_LOCATION );
+ DALI_TEST_CHECK(value != NULL);
+ DALI_TEST_EQUALS("randomProperty", value->Get<std::string>(), TEST_LOCATION);
value = returnedMap.Find("initialValue");
- DALI_TEST_CHECK( value != NULL);
- DALI_TEST_EQUALS( Color::MAGENTA, value->Get<Vector4>(), TEST_LOCATION );
+ DALI_TEST_CHECK(value != NULL);
+ DALI_TEST_EQUALS(Color::MAGENTA, value->Get<Vector4>(), TEST_LOCATION);
value = returnedMap.Find("targetValue");
- DALI_TEST_CHECK( value != NULL);
- DALI_TEST_EQUALS( Color::RED, value->Get<Vector4>(), TEST_LOCATION );
+ DALI_TEST_CHECK(value != NULL);
+ DALI_TEST_EQUALS(Color::RED, value->Get<Vector4>(), TEST_LOCATION);
value = returnedMap.Find("animator");
- DALI_TEST_CHECK( value != NULL);
+ DALI_TEST_CHECK(value != NULL);
Property::Map returnedAnimatorMap = value->Get<Property::Map>();
value = returnedAnimatorMap.Find("alphaFunction");
- DALI_TEST_CHECK( value != NULL);
- DALI_TEST_EQUALS( "EASE_OUT", value->Get<std::string>(), TEST_LOCATION );
+ DALI_TEST_CHECK(value != NULL);
+ DALI_TEST_EQUALS("EASE_OUT", value->Get<std::string>(), TEST_LOCATION);
value = returnedAnimatorMap.Find("timePeriod");
- DALI_TEST_CHECK( value != NULL);
+ DALI_TEST_CHECK(value != NULL);
Property::Map returnedTimePeriodMap = value->Get<Property::Map>();
value = returnedTimePeriodMap.Find("delay");
- DALI_TEST_CHECK( value != NULL);
- DALI_TEST_EQUALS( 0.5f, value->Get<float>(), TEST_LOCATION );
+ DALI_TEST_CHECK(value != NULL);
+ DALI_TEST_EQUALS(0.5f, value->Get<float>(), TEST_LOCATION);
value = returnedTimePeriodMap.Find("duration");
- DALI_TEST_CHECK( value != NULL);
- DALI_TEST_EQUALS( 1.0f, value->Get<float>(), TEST_LOCATION );
+ DALI_TEST_CHECK(value != NULL);
+ DALI_TEST_EQUALS(1.0f, value->Get<float>(), TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl( Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT );
- ControlWrapper controlWrapper = ControlWrapper::New( customControlTypeName, *controlWrapperImpl );
+ Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl(Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT);
+ ControlWrapper controlWrapper = ControlWrapper::New(customControlTypeName, *controlWrapperImpl);
controlWrapperImpl->ApplyThemeStyle();
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
END_TEST;
}
{
ToolkitTestApplication application;
- Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl( Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT );
- ControlWrapper controlWrapper = ControlWrapper::New( customControlTypeName, *controlWrapperImpl );
+ Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl(Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT);
+ ControlWrapper controlWrapper = ControlWrapper::New(customControlTypeName, *controlWrapperImpl);
- application.GetScene().Add( controlWrapper );
+ application.GetScene().Add(controlWrapper);
// "background" property
Property::Map rendererMap;
- rendererMap[Visual::Property::TYPE] = Visual::COLOR;
+ rendererMap[Visual::Property::TYPE] = Visual::COLOR;
rendererMap[ColorVisual::Property::MIX_COLOR] = Color::RED;
- controlWrapper.SetProperty( Control::Property::BACKGROUND, rendererMap );
- Property::Value propertyValue = controlWrapper.GetProperty( Control::Property::BACKGROUND );
- Property::Map* resultMap = propertyValue.GetMap();
- DALI_TEST_CHECK( resultMap->Find( Toolkit::Visual::Property::TYPE ) );
- DALI_TEST_EQUALS( resultMap->Find( Toolkit::Visual::Property::TYPE )->Get<int>(), (int)Visual::COLOR, TEST_LOCATION );
- DALI_TEST_CHECK( resultMap->Find( ColorVisual::Property::MIX_COLOR ) );
- DALI_TEST_EQUALS( resultMap->Find( ColorVisual::Property::MIX_COLOR )->Get<Vector4>(), Color::RED, TEST_LOCATION );
+ controlWrapper.SetProperty(Control::Property::BACKGROUND, rendererMap);
+ Property::Value propertyValue = controlWrapper.GetProperty(Control::Property::BACKGROUND);
+ Property::Map* resultMap = propertyValue.GetMap();
+ DALI_TEST_CHECK(resultMap->Find(Toolkit::Visual::Property::TYPE));
+ DALI_TEST_EQUALS(resultMap->Find(Toolkit::Visual::Property::TYPE)->Get<int>(), (int)Visual::COLOR, TEST_LOCATION);
+ DALI_TEST_CHECK(resultMap->Find(ColorVisual::Property::MIX_COLOR));
+ DALI_TEST_EQUALS(resultMap->Find(ColorVisual::Property::MIX_COLOR)->Get<Vector4>(), Color::RED, TEST_LOCATION);
// "keyInputFocus" property
- controlWrapper.SetProperty( Control::Property::KEY_INPUT_FOCUS, true );
- DALI_TEST_EQUALS( true, controlWrapper.GetProperty( Control::Property::KEY_INPUT_FOCUS ).Get< bool >(), TEST_LOCATION );
+ controlWrapper.SetProperty(Control::Property::KEY_INPUT_FOCUS, true);
+ DALI_TEST_EQUALS(true, controlWrapper.GetProperty(Control::Property::KEY_INPUT_FOCUS).Get<bool>(), TEST_LOCATION);
// "styleName" property
- controlWrapper.SetProperty( Control::Property::STYLE_NAME, "MyCustomStyle" );
- DALI_TEST_EQUALS( "MyCustomStyle", controlWrapper.GetProperty( Control::Property::STYLE_NAME ).Get< std::string >(), TEST_LOCATION );
+ controlWrapper.SetProperty(Control::Property::STYLE_NAME, "MyCustomStyle");
+ DALI_TEST_EQUALS("MyCustomStyle", controlWrapper.GetProperty(Control::Property::STYLE_NAME).Get<std::string>(), TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo( "ControlWrapper" );
- DALI_TEST_CHECK( typeInfo )
+ TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo("ControlWrapper");
+ DALI_TEST_CHECK(typeInfo)
// Check that we can't create a ControlWrapper instance
BaseHandle baseHandle = typeInfo.CreateInstance();
- DALI_TEST_CHECK( !baseHandle )
+ DALI_TEST_CHECK(!baseHandle)
END_TEST;
}
void SetProperty(BaseObject* object, const char* const name, Property::Value* value)
{
}
-Property::Value* GetProperty(BaseObject* object, const char* const name )
+Property::Value* GetProperty(BaseObject* object, const char* const name)
{
return NULL;
}
{
tet_infoline("Test that the control wrapper's visuals can be animated by name when registered");
- ToolkitTestApplication application;
- Test::ObjectDestructionTracker objectDestructionTracker( application.GetCore().GetObjectRegistry() );
+ ToolkitTestApplication application;
+ Test::ObjectDestructionTracker objectDestructionTracker(application.GetCore().GetObjectRegistry());
{
- Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl( Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT );
- ControlWrapper controlWrapper = ControlWrapper::New( customControlTypeName, *controlWrapperImpl );
+ Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl(Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT);
+ ControlWrapper controlWrapper = ControlWrapper::New(customControlTypeName, *controlWrapperImpl);
- Property::Index index = Control::CONTROL_PROPERTY_END_INDEX+1;
- std::string visualName("colorVisual");
- CSharpTypeRegistry::RegisterProperty( customControlTypeName, visualName, index, Property::VECTOR4, SetProperty, GetProperty );
+ Property::Index index = Control::CONTROL_PROPERTY_END_INDEX + 1;
+ std::string visualName("colorVisual");
+ CSharpTypeRegistry::RegisterProperty(customControlTypeName, visualName, index, Property::VECTOR4, SetProperty, GetProperty);
- objectDestructionTracker.Start( controlWrapper );
+ objectDestructionTracker.Start(controlWrapper);
Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
- Toolkit::Visual::Base visual;
+ Toolkit::Visual::Base visual;
Property::Map map;
- map[Visual::Property::TYPE] = Visual::COLOR;
+ map[Visual::Property::TYPE] = Visual::COLOR;
map[ColorVisual::Property::MIX_COLOR] = Color::RED;
- visual = visualFactory.CreateVisual( map );
- DALI_TEST_CHECK( visual );
+ visual = visualFactory.CreateVisual(map);
+ DALI_TEST_CHECK(visual);
// Register to self
- controlWrapperImpl->TestRegisterVisual( index, visual );
+ controlWrapperImpl->TestRegisterVisual(index, visual);
- application.GetScene().Add( controlWrapper );
- controlWrapper.SetProperty( Actor::Property::SIZE, Vector2( 100, 100 ) );
+ application.GetScene().Add(controlWrapper);
+ controlWrapper.SetProperty(Actor::Property::SIZE, Vector2(100, 100));
application.SendNotification();
application.Render(0); // Trigger animation start
Property::Map transition;
- transition["target"] = visualName;
- transition["property"] = "mixColor";
+ transition["target"] = visualName;
+ transition["property"] = "mixColor";
transition["targetValue"] = Color::GREEN;
Property::Map animator;
animator["alphaFunction"] = "LINEAR";
- animator["duration"] = 1.0f;
- animator["delay"] = 0.0f;
- transition["animator"] = animator;
+ animator["duration"] = 1.0f;
+ animator["delay"] = 0.0f;
+ transition["animator"] = animator;
TransitionData transitionData = TransitionData::New(transition);
- Animation anim = DevelControl::CreateTransition( *controlWrapperImpl, transitionData );
+ Animation anim = DevelControl::CreateTransition(*controlWrapperImpl, transitionData);
anim.Play();
application.SendNotification();
application.Render(0); // Trigger animation start
application.Render(1000); // animation end
- application.Render( 10);
+ application.Render(10);
Property::Map visualMap;
- visual.CreatePropertyMap( visualMap );
+ visual.CreatePropertyMap(visualMap);
Property::Value* value = visualMap.Find(ColorVisual::Property::MIX_COLOR, "mixColor");
- DALI_TEST_CHECK( value != NULL );
- if( value )
+ DALI_TEST_CHECK(value != NULL);
+ if(value)
{
Vector4 testColor = value->Get<Vector4>();
- DALI_TEST_EQUALS( testColor, Color::GREEN, 0.001f, TEST_LOCATION );
+ DALI_TEST_EQUALS(testColor, Color::GREEN, 0.001f, TEST_LOCATION);
}
- DALI_TEST_EQUALS( objectDestructionTracker.IsDestroyed(), false, TEST_LOCATION ); // Control not destroyed yet
- DALI_TEST_EQUALS( controlWrapperImpl->GetVisual( index ), visual, TEST_LOCATION );
+ DALI_TEST_EQUALS(objectDestructionTracker.IsDestroyed(), false, TEST_LOCATION); // Control not destroyed yet
+ DALI_TEST_EQUALS(controlWrapperImpl->GetVisual(index), visual, TEST_LOCATION);
- application.GetScene().Remove( controlWrapper );
+ application.GetScene().Remove(controlWrapper);
}
- DALI_TEST_EQUALS( objectDestructionTracker.IsDestroyed(), true, TEST_LOCATION ); // Should be destroyed
+ DALI_TEST_EQUALS(objectDestructionTracker.IsDestroyed(), true, TEST_LOCATION); // Should be destroyed
END_TEST;
}
{
ToolkitTestApplication application;
- Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl( Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT );
- ControlWrapper controlWrapper = ControlWrapper::New( customControlTypeName, *controlWrapperImpl );
+ Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl(Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT);
+ ControlWrapper controlWrapper = ControlWrapper::New(customControlTypeName, *controlWrapperImpl);
gKeyInputFocusCallBackCalled = false;
controlWrapper.KeyInputFocusGainedSignal().Connect(&TestKeyInputFocusCallback);
application.SendNotification();
application.Render();
- controlWrapperImpl->EmitKeyInputFocusSignal( true );
+ controlWrapperImpl->EmitKeyInputFocusSignal(true);
- DALI_TEST_CHECK( gKeyInputFocusCallBackCalled );
+ DALI_TEST_CHECK(gKeyInputFocusCallBackCalled);
END_TEST;
}
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
#include <stdlib.h>
+#include <iostream>
+
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
-#include <dali-toolkit/devel-api/transition-effects/cube-transition-effect.h>
+
#include <dali-toolkit/devel-api/transition-effects/cube-transition-cross-effect.h>
+#include <dali-toolkit/devel-api/transition-effects/cube-transition-effect.h>
#include <dali-toolkit/devel-api/transition-effects/cube-transition-fold-effect.h>
#include <dali-toolkit/devel-api/transition-effects/cube-transition-wave-effect.h>
#include <dali/devel-api/adaptor-framework/image-loading.h>
#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
-
using namespace Dali;
using namespace Dali::Toolkit;
-
namespace
{
-const unsigned int NUM_ROWS = 16;
+const unsigned int NUM_ROWS = 16;
const unsigned int NUM_COLUMNS = 10;
-const Vector2 VIEW_AREA_SIZE( 480.0f, 800.0f );
-const float TRANSITION_DURATION = 0.5f;
-const float CUBE_DISPLACEMENT = 55.f;
-const Vector2 PAN_POSITION1( VIEW_AREA_SIZE.x * 0.75f, VIEW_AREA_SIZE.y * 0.25f );
-const Vector2 PAN_DISPLACEMENT1( -5.f, 5.f );
-const Vector2 PAN_POSITION2( VIEW_AREA_SIZE.x * 0.25f, VIEW_AREA_SIZE.y * 0.75f );
-const Vector2 PAN_DISPLACEMENT2( 5.f, 5.f );
-const Vector4 FULL_BRIGHTNESS(1.f,1.f,1.f,1.f);
-const Vector4 HALF_BRIGHTNESS(0.5f, 0.5f, 0.5f, 1.f);
-const int RENDER_FRAME_INTERVAL = 16;
-static const float FLT_EPISILON = 0.0001f;
-static const float EPISILON = 0.05f;
-const float TRANSITION_BEFORE_END_DURATION = TRANSITION_DURATION - 0.05f;
+const Vector2 VIEW_AREA_SIZE(480.0f, 800.0f);
+const float TRANSITION_DURATION = 0.5f;
+const float CUBE_DISPLACEMENT = 55.f;
+const Vector2 PAN_POSITION1(VIEW_AREA_SIZE.x * 0.75f, VIEW_AREA_SIZE.y * 0.25f);
+const Vector2 PAN_DISPLACEMENT1(-5.f, 5.f);
+const Vector2 PAN_POSITION2(VIEW_AREA_SIZE.x * 0.25f, VIEW_AREA_SIZE.y * 0.75f);
+const Vector2 PAN_DISPLACEMENT2(5.f, 5.f);
+const Vector4 FULL_BRIGHTNESS(1.f, 1.f, 1.f, 1.f);
+const Vector4 HALF_BRIGHTNESS(0.5f, 0.5f, 0.5f, 1.f);
+const int RENDER_FRAME_INTERVAL = 16;
+static const float FLT_EPISILON = 0.0001f;
+static const float EPISILON = 0.05f;
+const float TRANSITION_BEFORE_END_DURATION = TRANSITION_DURATION - 0.05f;
static bool gObjectCreatedCallBackCalled;
static void TestCallback(BaseHandle handle)
*/
void Wait(ToolkitTestApplication& application, float durationToPass)
{
- int duration = static_cast<int>(durationToPass*1000.f);
+ int duration = static_cast<int>(durationToPass * 1000.f);
// wait 2 more frames to compensate the two frames used by the image waiting for the loading succeeded signal
- for(int i = 0; i <= duration/RENDER_FRAME_INTERVAL+2 ; i++)
+ for(int i = 0; i <= duration / RENDER_FRAME_INTERVAL + 2; i++)
{
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
}
}
-
-
//Callback class to test whether transition completed signal is emitted when the transition animation is finished
class TransitionCompletedCallback : public Dali::ConnectionTracker
{
public:
- TransitionCompletedCallback( bool& signalReceived, CubeTransitionEffect& effect, Texture& image )
- : mSignalVerified( signalReceived ),
- mCurrentEffect( effect ),
- mActorTransitTo( image )
+ TransitionCompletedCallback(bool& signalReceived, CubeTransitionEffect& effect, Texture& image)
+ : mSignalVerified(signalReceived),
+ mCurrentEffect(effect),
+ mActorTransitTo(image)
{
}
- void Callback( CubeTransitionEffect effect, Texture image )
+ void Callback(CubeTransitionEffect effect, Texture image)
{
- tet_infoline( "Verifying TransitionCompletedSignal" );
+ tet_infoline("Verifying TransitionCompletedSignal");
- if( mCurrentEffect == effect && mActorTransitTo == image )
+ if(mCurrentEffect == effect && mActorTransitTo == image)
{
mSignalVerified = true;
}
mSignalVerified = false;
}
- bool& mSignalVerified;
- CubeTransitionEffect& mCurrentEffect;
- Texture& mActorTransitTo;
+ bool& mSignalVerified;
+ CubeTransitionEffect& mCurrentEffect;
+ Texture& mActorTransitTo;
};
} // namespace
-
-
void cube_transition_effect_startup(void)
{
test_return_value = TET_UNDEF;
CubeTransitionEffect waveEffect;
- DALI_TEST_CHECK( !waveEffect );
+ DALI_TEST_CHECK(!waveEffect);
- waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS );
- waveEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
+ waveEffect = CubeTransitionWaveEffect::New(NUM_ROWS, NUM_COLUMNS);
+ waveEffect.SetProperty(Actor::Property::SIZE, Vector2(VIEW_AREA_SIZE));
- DALI_TEST_CHECK( waveEffect );
+ DALI_TEST_CHECK(waveEffect);
waveEffect.Reset();
//Additional check to ensure object is created by checking if it's registered
ObjectRegistry registry = application.GetCore().GetObjectRegistry();
- DALI_TEST_CHECK( registry );
+ DALI_TEST_CHECK(registry);
gObjectCreatedCallBackCalled = false;
- registry.ObjectCreatedSignal().Connect( &TestCallback );
+ registry.ObjectCreatedSignal().Connect(&TestCallback);
{
- CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS );
- waveEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
+ CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New(NUM_ROWS, NUM_COLUMNS);
+ waveEffect.SetProperty(Actor::Property::SIZE, Vector2(VIEW_AREA_SIZE));
}
- DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
+ DALI_TEST_CHECK(gObjectCreatedCallBackCalled);
END_TEST;
}
CubeTransitionEffect crossEffect;
- DALI_TEST_CHECK( !crossEffect );
+ DALI_TEST_CHECK(!crossEffect);
- crossEffect = CubeTransitionCrossEffect::New( NUM_ROWS, NUM_COLUMNS );
- crossEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
+ crossEffect = CubeTransitionCrossEffect::New(NUM_ROWS, NUM_COLUMNS);
+ crossEffect.SetProperty(Actor::Property::SIZE, Vector2(VIEW_AREA_SIZE));
- DALI_TEST_CHECK( crossEffect );
+ DALI_TEST_CHECK(crossEffect);
crossEffect.Reset();
//Additional check to ensure object is created by checking if it's registered
ObjectRegistry registry = application.GetCore().GetObjectRegistry();
- DALI_TEST_CHECK( registry );
+ DALI_TEST_CHECK(registry);
gObjectCreatedCallBackCalled = false;
- registry.ObjectCreatedSignal().Connect( &TestCallback );
+ registry.ObjectCreatedSignal().Connect(&TestCallback);
{
- CubeTransitionEffect crossEffect = CubeTransitionCrossEffect::New( NUM_ROWS, NUM_COLUMNS );
- crossEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
+ CubeTransitionEffect crossEffect = CubeTransitionCrossEffect::New(NUM_ROWS, NUM_COLUMNS);
+ crossEffect.SetProperty(Actor::Property::SIZE, Vector2(VIEW_AREA_SIZE));
}
- DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
+ DALI_TEST_CHECK(gObjectCreatedCallBackCalled);
END_TEST;
}
int UtcDaliCubeTransitionFoldEffectNew(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliCubeTransitionFoldEffectNew " );
+ tet_infoline(" UtcDaliCubeTransitionFoldEffectNew ");
CubeTransitionEffect foldEffect;
- DALI_TEST_CHECK( !foldEffect );
+ DALI_TEST_CHECK(!foldEffect);
- foldEffect = CubeTransitionFoldEffect::New( NUM_ROWS, NUM_COLUMNS );
- foldEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
+ foldEffect = CubeTransitionFoldEffect::New(NUM_ROWS, NUM_COLUMNS);
+ foldEffect.SetProperty(Actor::Property::SIZE, Vector2(VIEW_AREA_SIZE));
- DALI_TEST_CHECK( foldEffect );
+ DALI_TEST_CHECK(foldEffect);
foldEffect.Reset();
//Additional check to ensure object is created by checking if it is registered
ObjectRegistry registry = application.GetCore().GetObjectRegistry();
- DALI_TEST_CHECK( registry );
+ DALI_TEST_CHECK(registry);
gObjectCreatedCallBackCalled = false;
- registry.ObjectCreatedSignal().Connect( &TestCallback );
+ registry.ObjectCreatedSignal().Connect(&TestCallback);
{
- CubeTransitionEffect foldEffect = CubeTransitionFoldEffect::New( NUM_ROWS, NUM_COLUMNS );
- foldEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
+ CubeTransitionEffect foldEffect = CubeTransitionFoldEffect::New(NUM_ROWS, NUM_COLUMNS);
+ foldEffect.SetProperty(Actor::Property::SIZE, Vector2(VIEW_AREA_SIZE));
}
- DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
+ DALI_TEST_CHECK(gObjectCreatedCallBackCalled);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliCubeTransitionEffectSetGetTransitionDuration ");
- CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS );
- waveEffect.SetTransitionDuration( TRANSITION_DURATION );
- waveEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
- DALI_TEST_EQUALS( TRANSITION_DURATION, waveEffect.GetTransitionDuration(), TEST_LOCATION );
+ CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New(NUM_ROWS, NUM_COLUMNS);
+ waveEffect.SetTransitionDuration(TRANSITION_DURATION);
+ waveEffect.SetProperty(Actor::Property::SIZE, Vector2(VIEW_AREA_SIZE));
+ DALI_TEST_EQUALS(TRANSITION_DURATION, waveEffect.GetTransitionDuration(), TEST_LOCATION);
- CubeTransitionEffect crossEffect = CubeTransitionCrossEffect::New( NUM_ROWS, NUM_COLUMNS );
- crossEffect.SetTransitionDuration( TRANSITION_DURATION );
- crossEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
- DALI_TEST_EQUALS( TRANSITION_DURATION, crossEffect.GetTransitionDuration(), TEST_LOCATION );
+ CubeTransitionEffect crossEffect = CubeTransitionCrossEffect::New(NUM_ROWS, NUM_COLUMNS);
+ crossEffect.SetTransitionDuration(TRANSITION_DURATION);
+ crossEffect.SetProperty(Actor::Property::SIZE, Vector2(VIEW_AREA_SIZE));
+ DALI_TEST_EQUALS(TRANSITION_DURATION, crossEffect.GetTransitionDuration(), TEST_LOCATION);
- CubeTransitionEffect foldEffect = CubeTransitionFoldEffect::New( NUM_ROWS, NUM_COLUMNS );
- foldEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
- foldEffect.SetTransitionDuration( TRANSITION_DURATION );
- DALI_TEST_EQUALS( TRANSITION_DURATION, foldEffect.GetTransitionDuration(), TEST_LOCATION );
+ CubeTransitionEffect foldEffect = CubeTransitionFoldEffect::New(NUM_ROWS, NUM_COLUMNS);
+ foldEffect.SetProperty(Actor::Property::SIZE, Vector2(VIEW_AREA_SIZE));
+ foldEffect.SetTransitionDuration(TRANSITION_DURATION);
+ DALI_TEST_EQUALS(TRANSITION_DURATION, foldEffect.GetTransitionDuration(), TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliCubeTransitionEffectSetGetTransitionDuration ");
- CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS);
- waveEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
- waveEffect.SetCubeDisplacement( CUBE_DISPLACEMENT );
- DALI_TEST_EQUALS( CUBE_DISPLACEMENT, waveEffect.GetCubeDisplacement(), TEST_LOCATION );
+ CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New(NUM_ROWS, NUM_COLUMNS);
+ waveEffect.SetProperty(Actor::Property::SIZE, Vector2(VIEW_AREA_SIZE));
+ waveEffect.SetCubeDisplacement(CUBE_DISPLACEMENT);
+ DALI_TEST_EQUALS(CUBE_DISPLACEMENT, waveEffect.GetCubeDisplacement(), TEST_LOCATION);
- CubeTransitionEffect crossEffect = CubeTransitionCrossEffect::New( NUM_ROWS, NUM_COLUMNS );
- crossEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
- crossEffect.SetCubeDisplacement( CUBE_DISPLACEMENT );
- DALI_TEST_EQUALS( CUBE_DISPLACEMENT, crossEffect.GetCubeDisplacement(), TEST_LOCATION );
+ CubeTransitionEffect crossEffect = CubeTransitionCrossEffect::New(NUM_ROWS, NUM_COLUMNS);
+ crossEffect.SetProperty(Actor::Property::SIZE, Vector2(VIEW_AREA_SIZE));
+ crossEffect.SetCubeDisplacement(CUBE_DISPLACEMENT);
+ DALI_TEST_EQUALS(CUBE_DISPLACEMENT, crossEffect.GetCubeDisplacement(), TEST_LOCATION);
//Cube displacement is not used in CubeTransitionFoldEffect
END_TEST;
ToolkitTestApplication application;
tet_infoline(" UtcDaliCubeTransitionEffectGetRoot ");
- unsigned int totalNum = NUM_ROWS*NUM_COLUMNS;
+ unsigned int totalNum = NUM_ROWS * NUM_COLUMNS;
- Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 40, 40 );
+ Texture texture = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 40, 40);
- CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS );
- waveEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
- application.GetScene().Add( waveEffect );
- waveEffect.SetCurrentTexture( texture );
- waveEffect.SetTargetTexture( texture );
+ CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New(NUM_ROWS, NUM_COLUMNS);
+ waveEffect.SetProperty(Actor::Property::SIZE, Vector2(VIEW_AREA_SIZE));
+ application.GetScene().Add(waveEffect);
+ waveEffect.SetCurrentTexture(texture);
+ waveEffect.SetTargetTexture(texture);
application.SendNotification();
application.Render();
waveEffect.StartTransition();
- Wait( application, TRANSITION_DURATION * 0.5f );
+ Wait(application, TRANSITION_DURATION * 0.5f);
// check that we have a total of NUM_ROWS*NUM_COLUMNS cubes;
Actor boxesRoot = waveEffect.GetChildAt(0);
- DALI_TEST_CHECK( totalNum == boxesRoot.GetChildCount() );
+ DALI_TEST_CHECK(totalNum == boxesRoot.GetChildCount());
// check that every cube has two children
- DALI_TEST_CHECK( 2 == boxesRoot.GetChildAt(0).GetChildCount() );
- DALI_TEST_CHECK( 2 == boxesRoot.GetChildAt(totalNum/2).GetChildCount() );
- DALI_TEST_CHECK( 2 == boxesRoot.GetChildAt(totalNum-1).GetChildCount() );
+ DALI_TEST_CHECK(2 == boxesRoot.GetChildAt(0).GetChildCount());
+ DALI_TEST_CHECK(2 == boxesRoot.GetChildAt(totalNum / 2).GetChildCount());
+ DALI_TEST_CHECK(2 == boxesRoot.GetChildAt(totalNum - 1).GetChildCount());
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliCubeTransitionEffectIsTransiting ");
- application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
- Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 40, 40 );
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
+ Texture texture = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 40, 40);
- CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS );
- waveEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
- application.GetScene().Add( waveEffect );
+ CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New(NUM_ROWS, NUM_COLUMNS);
+ waveEffect.SetProperty(Actor::Property::SIZE, Vector2(VIEW_AREA_SIZE));
+ application.GetScene().Add(waveEffect);
- waveEffect.SetTransitionDuration( TRANSITION_DURATION );
- waveEffect.SetCubeDisplacement( CUBE_DISPLACEMENT );
- DALI_TEST_CHECK( !waveEffect.IsTransitioning() );
+ waveEffect.SetTransitionDuration(TRANSITION_DURATION);
+ waveEffect.SetCubeDisplacement(CUBE_DISPLACEMENT);
+ DALI_TEST_CHECK(!waveEffect.IsTransitioning());
- waveEffect.SetCurrentTexture( texture );
- waveEffect.SetTargetTexture( texture );
+ waveEffect.SetCurrentTexture(texture);
+ waveEffect.SetTargetTexture(texture);
//transition is started
waveEffect.StartTransition();
- DALI_TEST_CHECK( waveEffect.IsTransitioning() );
+ DALI_TEST_CHECK(waveEffect.IsTransitioning());
//transition is finished
- Wait( application, TRANSITION_DURATION );
- DALI_TEST_CHECK( !waveEffect.IsTransitioning() );
+ Wait(application, TRANSITION_DURATION);
+ DALI_TEST_CHECK(!waveEffect.IsTransitioning());
- CubeTransitionEffect crossEffect = CubeTransitionCrossEffect::New( NUM_ROWS, NUM_COLUMNS );
- crossEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
- application.GetScene().Add( crossEffect );
+ CubeTransitionEffect crossEffect = CubeTransitionCrossEffect::New(NUM_ROWS, NUM_COLUMNS);
+ crossEffect.SetProperty(Actor::Property::SIZE, Vector2(VIEW_AREA_SIZE));
+ application.GetScene().Add(crossEffect);
- crossEffect.SetTransitionDuration( TRANSITION_DURATION );
- crossEffect.SetCubeDisplacement( CUBE_DISPLACEMENT );
- DALI_TEST_CHECK( !crossEffect.IsTransitioning() );
+ crossEffect.SetTransitionDuration(TRANSITION_DURATION);
+ crossEffect.SetCubeDisplacement(CUBE_DISPLACEMENT);
+ DALI_TEST_CHECK(!crossEffect.IsTransitioning());
- crossEffect.SetCurrentTexture( texture );
- crossEffect.SetTargetTexture( texture );
+ crossEffect.SetCurrentTexture(texture);
+ crossEffect.SetTargetTexture(texture);
//transition is started
crossEffect.StartTransition(false);
- DALI_TEST_CHECK( crossEffect.IsTransitioning() );
+ DALI_TEST_CHECK(crossEffect.IsTransitioning());
//transition is finished
- Wait( application, TRANSITION_DURATION );
- DALI_TEST_CHECK( !crossEffect.IsTransitioning() );
+ Wait(application, TRANSITION_DURATION);
+ DALI_TEST_CHECK(!crossEffect.IsTransitioning());
- CubeTransitionEffect foldEffect = CubeTransitionFoldEffect::New( NUM_ROWS, NUM_COLUMNS );
- foldEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
- application.GetScene().Add( foldEffect );
+ CubeTransitionEffect foldEffect = CubeTransitionFoldEffect::New(NUM_ROWS, NUM_COLUMNS);
+ foldEffect.SetProperty(Actor::Property::SIZE, Vector2(VIEW_AREA_SIZE));
+ application.GetScene().Add(foldEffect);
- foldEffect.SetTransitionDuration( TRANSITION_DURATION );
- DALI_TEST_CHECK( !foldEffect.IsTransitioning() );
+ foldEffect.SetTransitionDuration(TRANSITION_DURATION);
+ DALI_TEST_CHECK(!foldEffect.IsTransitioning());
- foldEffect.SetCurrentTexture( texture );
- foldEffect.SetTargetTexture( texture );
+ foldEffect.SetCurrentTexture(texture);
+ foldEffect.SetTargetTexture(texture);
//transition is started
foldEffect.StartTransition(true);
- DALI_TEST_CHECK(foldEffect.IsTransitioning() );
+ DALI_TEST_CHECK(foldEffect.IsTransitioning());
//transition is finished
- Wait( application, TRANSITION_DURATION );
- DALI_TEST_CHECK( !foldEffect.IsTransitioning() );
+ Wait(application, TRANSITION_DURATION);
+ DALI_TEST_CHECK(!foldEffect.IsTransitioning());
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliCubeTransitionEffectSetCurrentTexture ");
- application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
- Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 40, 40 );
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
+ Texture texture = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 40, 40);
- CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS );
- waveEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
- waveEffect.SetCurrentTexture( texture );
+ CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New(NUM_ROWS, NUM_COLUMNS);
+ waveEffect.SetProperty(Actor::Property::SIZE, Vector2(VIEW_AREA_SIZE));
+ waveEffect.SetCurrentTexture(texture);
- application.GetScene().Add( waveEffect );
+ application.GetScene().Add(waveEffect);
application.SendNotification();
application.Render();
// the current image content is set to the tiles facing the camera
Actor currentTile = waveEffect.GetChildAt(0).GetChildAt(0).GetChildAt(0);
- Actor targetTile = waveEffect.GetChildAt(0).GetChildAt(0).GetChildAt(1);
+ Actor targetTile = waveEffect.GetChildAt(0).GetChildAt(0).GetChildAt(1);
//check the pixel area set to the cube
- Vector4 pixelAreaDef( 0.f, 0.f, 1.f / NUM_COLUMNS, 1.f / NUM_ROWS);
+ Vector4 pixelAreaDef(0.f, 0.f, 1.f / NUM_COLUMNS, 1.f / NUM_ROWS);
- Property::Index textureRectIndex = currentTile.GetPropertyIndex( "uTextureRect" );
- DALI_TEST_CHECK( textureRectIndex != Property::INVALID_INDEX );
- Property::Value textureRectValue = currentTile.GetProperty( textureRectIndex );
- DALI_TEST_CHECK( textureRectValue.GetType() == Property::VECTOR4 );
+ Property::Index textureRectIndex = currentTile.GetPropertyIndex("uTextureRect");
+ DALI_TEST_CHECK(textureRectIndex != Property::INVALID_INDEX);
+ Property::Value textureRectValue = currentTile.GetProperty(textureRectIndex);
+ DALI_TEST_CHECK(textureRectValue.GetType() == Property::VECTOR4);
Vector4 pixelArea;
- DALI_TEST_CHECK( textureRectValue.Get( pixelArea ) );
+ DALI_TEST_CHECK(textureRectValue.Get(pixelArea));
- DALI_TEST_EQUALS( pixelAreaDef, pixelArea, FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS(pixelAreaDef, pixelArea, FLT_EPISILON, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliCubeTransitionEffectSetTargetTexture ");
- application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
- Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 40, 40 );
- CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS );
- waveEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
- application.GetScene().Add( waveEffect );
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
+ Texture texture = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 40, 40);
+ CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New(NUM_ROWS, NUM_COLUMNS);
+ waveEffect.SetProperty(Actor::Property::SIZE, Vector2(VIEW_AREA_SIZE));
+ application.GetScene().Add(waveEffect);
- waveEffect.SetCurrentTexture( texture );
- waveEffect.SetTargetTexture( texture );
+ waveEffect.SetCurrentTexture(texture);
+ waveEffect.SetTargetTexture(texture);
- application.GetScene().Add( waveEffect );
+ application.GetScene().Add(waveEffect);
application.SendNotification();
application.Render();
Actor tile = waveEffect.GetChildAt(0).GetChildAt(0).GetChildAt(1);
//check the pixel area set to the cube
- Vector4 pixelAreaDef( 0.f, 0.f, 1.f / NUM_COLUMNS, 1.f / NUM_ROWS);
+ Vector4 pixelAreaDef(0.f, 0.f, 1.f / NUM_COLUMNS, 1.f / NUM_ROWS);
- Property::Index textureRectIndex = tile.GetPropertyIndex( "uTextureRect" );
- DALI_TEST_CHECK( textureRectIndex != -1 );
- Property::Value textureRectValue = tile.GetProperty( textureRectIndex );
- DALI_TEST_CHECK( textureRectValue.GetType() == Property::VECTOR4 );
+ Property::Index textureRectIndex = tile.GetPropertyIndex("uTextureRect");
+ DALI_TEST_CHECK(textureRectIndex != -1);
+ Property::Value textureRectValue = tile.GetProperty(textureRectIndex);
+ DALI_TEST_CHECK(textureRectValue.GetType() == Property::VECTOR4);
Vector4 pixelArea;
- DALI_TEST_CHECK( textureRectValue.Get( pixelArea ) );
+ DALI_TEST_CHECK(textureRectValue.Get(pixelArea));
- DALI_TEST_EQUALS( pixelAreaDef, pixelArea, FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS(pixelAreaDef, pixelArea, FLT_EPISILON, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliCubeTransitionWaveEffectStartTransition ");
- application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
Devel::PixelBuffer pixelBuffer = LoadImageFromFile(TEST_RESOURCE_DIR "/gallery-small-1.jpg");
- PixelData pixelData = Devel::PixelBuffer::Convert( pixelBuffer );
- Texture texture = Texture::New( TextureType::TEXTURE_2D, pixelData.GetPixelFormat(), pixelData.GetWidth(), pixelData.GetHeight() );
- texture.Upload( pixelData );
+ PixelData pixelData = Devel::PixelBuffer::Convert(pixelBuffer);
+ Texture texture = Texture::New(TextureType::TEXTURE_2D, pixelData.GetPixelFormat(), pixelData.GetWidth(), pixelData.GetHeight());
+ texture.Upload(pixelData);
- CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS );
- waveEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
- waveEffect.SetTransitionDuration( TRANSITION_DURATION );
- waveEffect.SetCubeDisplacement( CUBE_DISPLACEMENT );
- waveEffect.SetCurrentTexture( texture );
+ CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New(NUM_ROWS, NUM_COLUMNS);
+ waveEffect.SetProperty(Actor::Property::SIZE, Vector2(VIEW_AREA_SIZE));
+ waveEffect.SetTransitionDuration(TRANSITION_DURATION);
+ waveEffect.SetCubeDisplacement(CUBE_DISPLACEMENT);
+ waveEffect.SetCurrentTexture(texture);
- application.GetScene().Add( waveEffect );
+ application.GetScene().Add(waveEffect);
application.SendNotification();
application.Render();
- waveEffect.StartTransition( true );
+ waveEffect.StartTransition(true);
Actor cube = waveEffect.GetChildAt(0).GetChildAt(0);
//check the cube rotation value and color values just before the end of different transitions
- waveEffect.SetTargetTexture( texture );
- Wait( application, TRANSITION_BEFORE_END_DURATION );
- DALI_TEST_EQUALS( cube.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( -Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION );
+ waveEffect.SetTargetTexture(texture);
+ Wait(application, TRANSITION_BEFORE_END_DURATION);
+ DALI_TEST_EQUALS(cube.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(-Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube.GetChildAt(0).GetCurrentProperty<Vector4>(Actor::Property::COLOR), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube.GetChildAt(1).GetCurrentProperty<Vector4>(Actor::Property::COLOR), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION);
- waveEffect.SetTargetTexture( texture );
+ waveEffect.SetTargetTexture(texture);
waveEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1);
- Wait( application, TRANSITION_BEFORE_END_DURATION );
- DALI_TEST_EQUALS( cube.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( -Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION );
+ Wait(application, TRANSITION_BEFORE_END_DURATION);
+ DALI_TEST_EQUALS(cube.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(-Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube.GetChildAt(0).GetCurrentProperty<Vector4>(Actor::Property::COLOR), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube.GetChildAt(1).GetCurrentProperty<Vector4>(Actor::Property::COLOR), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION);
- waveEffect.SetTargetTexture( texture );
+ waveEffect.SetTargetTexture(texture);
waveEffect.StartTransition(false);
- Wait( application, TRANSITION_BEFORE_END_DURATION );
- DALI_TEST_EQUALS( cube.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION );
+ Wait(application, TRANSITION_BEFORE_END_DURATION);
+ DALI_TEST_EQUALS(cube.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube.GetChildAt(0).GetCurrentProperty<Vector4>(Actor::Property::COLOR), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube.GetChildAt(1).GetCurrentProperty<Vector4>(Actor::Property::COLOR), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION);
- waveEffect.SetTargetTexture( texture );
+ waveEffect.SetTargetTexture(texture);
waveEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2);
- Wait( application, TRANSITION_BEFORE_END_DURATION );
- DALI_TEST_EQUALS( cube.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION );
+ Wait(application, TRANSITION_BEFORE_END_DURATION);
+ DALI_TEST_EQUALS(cube.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube.GetChildAt(0).GetCurrentProperty<Vector4>(Actor::Property::COLOR), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube.GetChildAt(1).GetCurrentProperty<Vector4>(Actor::Property::COLOR), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliCubeTransitionCrossEffectStartTransition ");
- application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
Devel::PixelBuffer pixelBuffer = LoadImageFromFile(TEST_RESOURCE_DIR "/gallery-small-1.jpg");
- PixelData pixelData = Devel::PixelBuffer::Convert( pixelBuffer );
- Texture texture = Texture::New( TextureType::TEXTURE_2D, pixelData.GetPixelFormat(), pixelData.GetWidth(), pixelData.GetHeight() );
- texture.Upload( pixelData );
+ PixelData pixelData = Devel::PixelBuffer::Convert(pixelBuffer);
+ Texture texture = Texture::New(TextureType::TEXTURE_2D, pixelData.GetPixelFormat(), pixelData.GetWidth(), pixelData.GetHeight());
+ texture.Upload(pixelData);
- CubeTransitionEffect crossEffect = CubeTransitionCrossEffect::New( NUM_ROWS, NUM_COLUMNS );
- crossEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
- crossEffect.SetTransitionDuration( TRANSITION_DURATION );
- crossEffect.SetCubeDisplacement( CUBE_DISPLACEMENT );
- crossEffect.SetCurrentTexture( texture );
- crossEffect.SetTargetTexture( texture );
+ CubeTransitionEffect crossEffect = CubeTransitionCrossEffect::New(NUM_ROWS, NUM_COLUMNS);
+ crossEffect.SetProperty(Actor::Property::SIZE, Vector2(VIEW_AREA_SIZE));
+ crossEffect.SetTransitionDuration(TRANSITION_DURATION);
+ crossEffect.SetCubeDisplacement(CUBE_DISPLACEMENT);
+ crossEffect.SetCurrentTexture(texture);
+ crossEffect.SetTargetTexture(texture);
- application.GetScene().Add( crossEffect );
+ application.GetScene().Add(crossEffect);
application.SendNotification();
application.Render();
Actor cube1 = crossEffect.GetChildAt(0).GetChildAt(1);
//check the cube rotation value and color values just before the end of different transitions
- Wait( application, TRANSITION_BEFORE_END_DURATION );
- DALI_TEST_EQUALS( cube1.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( -Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_90, Vector3::XAXIS), EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION );
+ Wait(application, TRANSITION_BEFORE_END_DURATION);
+ DALI_TEST_EQUALS(cube1.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(-Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_90, Vector3::XAXIS), EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(0).GetCurrentProperty<Vector4>(Actor::Property::COLOR), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(1).GetCurrentProperty<Vector4>(Actor::Property::COLOR), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION);
-
- crossEffect.SetTargetTexture( texture );
+ crossEffect.SetTargetTexture(texture);
crossEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1);
- Wait( application, TRANSITION_BEFORE_END_DURATION );
- DALI_TEST_EQUALS( cube1.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( -Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_90, Vector3::XAXIS), EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION );
-
+ Wait(application, TRANSITION_BEFORE_END_DURATION);
+ DALI_TEST_EQUALS(cube1.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(-Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_90, Vector3::XAXIS), EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(0).GetCurrentProperty<Vector4>(Actor::Property::COLOR), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(1).GetCurrentProperty<Vector4>(Actor::Property::COLOR), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION);
- crossEffect.SetTargetTexture( texture );
+ crossEffect.SetTargetTexture(texture);
crossEffect.StartTransition(false);
- Wait( application, TRANSITION_BEFORE_END_DURATION );
- DALI_TEST_EQUALS( cube1.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( -Dali::ANGLE_90, Vector3::XAXIS), EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION );
+ Wait(application, TRANSITION_BEFORE_END_DURATION);
+ DALI_TEST_EQUALS(cube1.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(-Dali::ANGLE_90, Vector3::XAXIS), EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(0).GetCurrentProperty<Vector4>(Actor::Property::COLOR), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(1).GetCurrentProperty<Vector4>(Actor::Property::COLOR), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION);
- crossEffect.SetTargetTexture( texture );
+ crossEffect.SetTargetTexture(texture);
crossEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2);
- Wait( application, TRANSITION_BEFORE_END_DURATION );
- DALI_TEST_EQUALS( cube1.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( -Dali::ANGLE_90, Vector3::XAXIS), EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION );
+ Wait(application, TRANSITION_BEFORE_END_DURATION);
+ DALI_TEST_EQUALS(cube1.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(-Dali::ANGLE_90, Vector3::XAXIS), EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(0).GetCurrentProperty<Vector4>(Actor::Property::COLOR), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(1).GetCurrentProperty<Vector4>(Actor::Property::COLOR), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliCubeTransitionFoldEffectStartTransition ");
- application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
- Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 40, 40 );
- CubeTransitionEffect foldEffect = CubeTransitionFoldEffect::New( NUM_ROWS, NUM_COLUMNS );
- foldEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
- foldEffect.SetTransitionDuration( TRANSITION_DURATION );
- foldEffect.SetCurrentTexture( texture );
- foldEffect.SetTargetTexture( texture );
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
+ Texture texture = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 40, 40);
+ CubeTransitionEffect foldEffect = CubeTransitionFoldEffect::New(NUM_ROWS, NUM_COLUMNS);
+ foldEffect.SetProperty(Actor::Property::SIZE, Vector2(VIEW_AREA_SIZE));
+ foldEffect.SetTransitionDuration(TRANSITION_DURATION);
+ foldEffect.SetCurrentTexture(texture);
+ foldEffect.SetTargetTexture(texture);
- application.GetScene().Add( foldEffect );
+ application.GetScene().Add(foldEffect);
application.SendNotification();
application.Render();
Actor cube1 = foldEffect.GetChildAt(0).GetChildAt(1);
//check the cube rotation value and color values just before the end of different transitions
- Wait( application, TRANSITION_BEFORE_END_DURATION );
- DALI_TEST_EQUALS( cube1.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( -Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION );
+ Wait(application, TRANSITION_BEFORE_END_DURATION);
+ DALI_TEST_EQUALS(cube1.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(-Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(0).GetCurrentProperty<Vector4>(Actor::Property::COLOR), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(1).GetCurrentProperty<Vector4>(Actor::Property::COLOR), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION);
- foldEffect.SetTargetTexture( texture );
+ foldEffect.SetTargetTexture(texture);
foldEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1);
- Wait( application, TRANSITION_BEFORE_END_DURATION );
- DALI_TEST_EQUALS( cube1.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( -Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION );
+ Wait(application, TRANSITION_BEFORE_END_DURATION);
+ DALI_TEST_EQUALS(cube1.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(-Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(0).GetCurrentProperty<Vector4>(Actor::Property::COLOR), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(1).GetCurrentProperty<Vector4>(Actor::Property::COLOR), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION);
-
- foldEffect.SetTargetTexture( texture );
+ foldEffect.SetTargetTexture(texture);
foldEffect.StartTransition(false);
- Wait( application, TRANSITION_BEFORE_END_DURATION );
- DALI_TEST_EQUALS( cube1.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( -Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ),FULL_BRIGHTNESS, EPISILON, TEST_LOCATION );
+ Wait(application, TRANSITION_BEFORE_END_DURATION);
+ DALI_TEST_EQUALS(cube1.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(-Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(0).GetCurrentProperty<Vector4>(Actor::Property::COLOR), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(1).GetCurrentProperty<Vector4>(Actor::Property::COLOR), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION);
- foldEffect.SetTargetTexture( texture );
+ foldEffect.SetTargetTexture(texture);
foldEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2);
- Wait( application, TRANSITION_BEFORE_END_DURATION );
- DALI_TEST_EQUALS( cube1.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( -Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION );
+ Wait(application, TRANSITION_BEFORE_END_DURATION);
+ DALI_TEST_EQUALS(cube1.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(-Dali::ANGLE_90, Vector3::YAXIS), EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(0).GetCurrentProperty<Vector4>(Actor::Property::COLOR), HALF_BRIGHTNESS, EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(1).GetCurrentProperty<Vector4>(Actor::Property::COLOR), FULL_BRIGHTNESS, EPISILON, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliCubeTransitionEffectSignalTransitionCompleted ");
- application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
- Texture firstTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 30, 30 );
- Texture secondTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 20, 20 );
- Texture thirdTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 40, 40 );
-
- CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS );
- waveEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
- waveEffect.SetTransitionDuration( TRANSITION_DURATION );
- waveEffect.SetCubeDisplacement( CUBE_DISPLACEMENT );
- application.GetScene().Add( waveEffect );
-
- CubeTransitionEffect crossEffect = CubeTransitionCrossEffect::New( NUM_ROWS, NUM_COLUMNS );
- crossEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
- crossEffect.SetTransitionDuration( TRANSITION_DURATION );
- crossEffect.SetCubeDisplacement( CUBE_DISPLACEMENT );
- application.GetScene().Add( crossEffect );
-
- CubeTransitionEffect foldEffect = CubeTransitionCrossEffect::New( NUM_ROWS, NUM_COLUMNS );
- foldEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
- foldEffect.SetTransitionDuration( TRANSITION_DURATION );
- application.GetScene().Add( foldEffect );
-
- bool signalVerified = false;
- CubeTransitionEffect currentEffect;
- Texture actorTransitTo;
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
+ Texture firstTexture = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 30, 30);
+ Texture secondTexture = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 20, 20);
+ Texture thirdTexture = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 40, 40);
+
+ CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New(NUM_ROWS, NUM_COLUMNS);
+ waveEffect.SetProperty(Actor::Property::SIZE, Vector2(VIEW_AREA_SIZE));
+ waveEffect.SetTransitionDuration(TRANSITION_DURATION);
+ waveEffect.SetCubeDisplacement(CUBE_DISPLACEMENT);
+ application.GetScene().Add(waveEffect);
+
+ CubeTransitionEffect crossEffect = CubeTransitionCrossEffect::New(NUM_ROWS, NUM_COLUMNS);
+ crossEffect.SetProperty(Actor::Property::SIZE, Vector2(VIEW_AREA_SIZE));
+ crossEffect.SetTransitionDuration(TRANSITION_DURATION);
+ crossEffect.SetCubeDisplacement(CUBE_DISPLACEMENT);
+ application.GetScene().Add(crossEffect);
+
+ CubeTransitionEffect foldEffect = CubeTransitionCrossEffect::New(NUM_ROWS, NUM_COLUMNS);
+ foldEffect.SetProperty(Actor::Property::SIZE, Vector2(VIEW_AREA_SIZE));
+ foldEffect.SetTransitionDuration(TRANSITION_DURATION);
+ application.GetScene().Add(foldEffect);
+
+ bool signalVerified = false;
+ CubeTransitionEffect currentEffect;
+ Texture actorTransitTo;
TransitionCompletedCallback callback(signalVerified, currentEffect, actorTransitTo);
- waveEffect.TransitionCompletedSignal().Connect( &callback, &TransitionCompletedCallback::Callback );
- crossEffect.TransitionCompletedSignal().Connect( &callback, &TransitionCompletedCallback::Callback );
- foldEffect.TransitionCompletedSignal().Connect( &callback, &TransitionCompletedCallback::Callback );
+ waveEffect.TransitionCompletedSignal().Connect(&callback, &TransitionCompletedCallback::Callback);
+ crossEffect.TransitionCompletedSignal().Connect(&callback, &TransitionCompletedCallback::Callback);
+ foldEffect.TransitionCompletedSignal().Connect(&callback, &TransitionCompletedCallback::Callback);
//check that the wave effect is used to transit to secondTexture
- currentEffect = waveEffect;
+ currentEffect = waveEffect;
actorTransitTo = secondTexture;
- waveEffect.SetCurrentTexture( firstTexture );
- waveEffect.SetTargetTexture( secondTexture );
+ waveEffect.SetCurrentTexture(firstTexture);
+ waveEffect.SetTargetTexture(secondTexture);
waveEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1);
- Wait( application, TRANSITION_DURATION );
+ Wait(application, TRANSITION_DURATION);
DALI_TEST_CHECK(callback.mSignalVerified);
callback.Reset();
//check that the wave effect is used to transit to thirdTexture
actorTransitTo = thirdTexture;
- waveEffect.SetTargetTexture( thirdTexture );
+ waveEffect.SetTargetTexture(thirdTexture);
waveEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2);
- Wait( application, TRANSITION_DURATION );
+ Wait(application, TRANSITION_DURATION);
DALI_TEST_CHECK(callback.mSignalVerified);
callback.Reset();
//check that the cross effect is used to transit to secondTexture
- currentEffect = crossEffect;
+ currentEffect = crossEffect;
actorTransitTo = secondTexture;
- crossEffect.SetCurrentTexture( thirdTexture );
- crossEffect.SetTargetTexture( secondTexture );
+ crossEffect.SetCurrentTexture(thirdTexture);
+ crossEffect.SetTargetTexture(secondTexture);
crossEffect.StartTransition(true);
- Wait( application, TRANSITION_DURATION );
+ Wait(application, TRANSITION_DURATION);
DALI_TEST_CHECK(callback.mSignalVerified);
callback.Reset();
//check that the cross effect is used to transit to firstTexture
actorTransitTo = firstTexture;
- crossEffect.SetTargetTexture( firstTexture );
+ crossEffect.SetTargetTexture(firstTexture);
crossEffect.StartTransition(false);
- Wait( application, TRANSITION_DURATION );
+ Wait(application, TRANSITION_DURATION);
DALI_TEST_CHECK(callback.mSignalVerified);
callback.Reset();
//check that the fold effect is used to transit to secondTexture
- currentEffect = foldEffect;
+ currentEffect = foldEffect;
actorTransitTo = secondTexture;
- foldEffect.SetCurrentTexture( firstTexture );
- foldEffect.SetTargetTexture( secondTexture );
+ foldEffect.SetCurrentTexture(firstTexture);
+ foldEffect.SetTargetTexture(secondTexture);
foldEffect.StartTransition();
- Wait( application, TRANSITION_DURATION );
- DALI_TEST_CHECK( callback.mSignalVerified );
+ Wait(application, TRANSITION_DURATION);
+ DALI_TEST_CHECK(callback.mSignalVerified);
callback.Reset();
//check that the fold effect is used to transit to thirdTexture
actorTransitTo = thirdTexture;
- foldEffect.SetTargetTexture( thirdTexture );
- foldEffect.StartTransition( false );
- Wait( application, TRANSITION_DURATION );
- DALI_TEST_CHECK( callback.mSignalVerified );
+ foldEffect.SetTargetTexture(thirdTexture);
+ foldEffect.StartTransition(false);
+ Wait(application, TRANSITION_DURATION);
+ DALI_TEST_CHECK(callback.mSignalVerified);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliCubeTransitionEffectPauseResumeTransition ");
- application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
- Texture firstTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 30, 30 );
- Texture secondTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 20, 20 );
-
- CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS );
- waveEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
- waveEffect.SetTransitionDuration( TRANSITION_DURATION );
- waveEffect.SetCubeDisplacement( CUBE_DISPLACEMENT );
- application.GetScene().Add( waveEffect );
-
- CubeTransitionEffect crossEffect = CubeTransitionCrossEffect::New( NUM_ROWS, NUM_COLUMNS );
- crossEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
- crossEffect.SetTransitionDuration( TRANSITION_DURATION );
- crossEffect.SetCubeDisplacement( CUBE_DISPLACEMENT );
- application.GetScene().Add( crossEffect );
-
- CubeTransitionEffect foldEffect = CubeTransitionFoldEffect::New( NUM_ROWS, NUM_COLUMNS );
- foldEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
- foldEffect.SetTransitionDuration( TRANSITION_DURATION );
- application.GetScene().Add( foldEffect );
-
- bool signalVerified = false;
- CubeTransitionEffect currentEffect;
- Texture actorTransitTo;
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
+ Texture firstTexture = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 30, 30);
+ Texture secondTexture = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 20, 20);
+
+ CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New(NUM_ROWS, NUM_COLUMNS);
+ waveEffect.SetProperty(Actor::Property::SIZE, Vector2(VIEW_AREA_SIZE));
+ waveEffect.SetTransitionDuration(TRANSITION_DURATION);
+ waveEffect.SetCubeDisplacement(CUBE_DISPLACEMENT);
+ application.GetScene().Add(waveEffect);
+
+ CubeTransitionEffect crossEffect = CubeTransitionCrossEffect::New(NUM_ROWS, NUM_COLUMNS);
+ crossEffect.SetProperty(Actor::Property::SIZE, Vector2(VIEW_AREA_SIZE));
+ crossEffect.SetTransitionDuration(TRANSITION_DURATION);
+ crossEffect.SetCubeDisplacement(CUBE_DISPLACEMENT);
+ application.GetScene().Add(crossEffect);
+
+ CubeTransitionEffect foldEffect = CubeTransitionFoldEffect::New(NUM_ROWS, NUM_COLUMNS);
+ foldEffect.SetProperty(Actor::Property::SIZE, Vector2(VIEW_AREA_SIZE));
+ foldEffect.SetTransitionDuration(TRANSITION_DURATION);
+ application.GetScene().Add(foldEffect);
+
+ bool signalVerified = false;
+ CubeTransitionEffect currentEffect;
+ Texture actorTransitTo;
TransitionCompletedCallback callback(signalVerified, currentEffect, actorTransitTo);
- waveEffect.TransitionCompletedSignal().Connect( &callback, &TransitionCompletedCallback::Callback );
- crossEffect.TransitionCompletedSignal().Connect( &callback, &TransitionCompletedCallback::Callback );
- foldEffect.TransitionCompletedSignal().Connect( &callback, &TransitionCompletedCallback::Callback );
+ waveEffect.TransitionCompletedSignal().Connect(&callback, &TransitionCompletedCallback::Callback);
+ crossEffect.TransitionCompletedSignal().Connect(&callback, &TransitionCompletedCallback::Callback);
+ foldEffect.TransitionCompletedSignal().Connect(&callback, &TransitionCompletedCallback::Callback);
- currentEffect = waveEffect;
+ currentEffect = waveEffect;
actorTransitTo = secondTexture;
- waveEffect.SetCurrentTexture( firstTexture );
- waveEffect.SetTargetTexture( secondTexture );
+ waveEffect.SetCurrentTexture(firstTexture);
+ waveEffect.SetTargetTexture(secondTexture);
// start transition; transit for 0.5*duration; pause for 0.5*duration;
// resume for 0.25*duration; pause for 0.25*duration; resume for another 0.25*duration;
// only until now the transition finished signal can be received
waveEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1);
- Wait( application, TRANSITION_DURATION*0.5f );
+ Wait(application, TRANSITION_DURATION * 0.5f);
DALI_TEST_CHECK(!callback.mSignalVerified);
waveEffect.PauseTransition();
- Wait( application, TRANSITION_DURATION*0.5f );
+ Wait(application, TRANSITION_DURATION * 0.5f);
DALI_TEST_CHECK(!callback.mSignalVerified);
waveEffect.ResumeTransition();
- Wait( application, TRANSITION_DURATION*0.25f );
+ Wait(application, TRANSITION_DURATION * 0.25f);
DALI_TEST_CHECK(!callback.mSignalVerified);
waveEffect.PauseTransition();
- Wait( application, TRANSITION_DURATION*0.25f );
+ Wait(application, TRANSITION_DURATION * 0.25f);
DALI_TEST_CHECK(!callback.mSignalVerified);
waveEffect.ResumeTransition();
- Wait( application, TRANSITION_DURATION*0.25f );
+ Wait(application, TRANSITION_DURATION * 0.25f);
DALI_TEST_CHECK(callback.mSignalVerified);
callback.Reset();
- currentEffect = crossEffect;
+ currentEffect = crossEffect;
actorTransitTo = firstTexture;
- crossEffect.SetCurrentTexture( secondTexture );
- crossEffect.SetTargetTexture( firstTexture );
+ crossEffect.SetCurrentTexture(secondTexture);
+ crossEffect.SetTargetTexture(firstTexture);
// start transition; transit for 0.25*duration; pause for 0.2*duration;
// resume for 0.5*duration; pause for 0.2*duration; resume for another 0.25*duration;
// only until now the transition finished signal can be received
crossEffect.StartTransition(false);
- Wait( application, TRANSITION_DURATION*0.25f );
+ Wait(application, TRANSITION_DURATION * 0.25f);
DALI_TEST_CHECK(!callback.mSignalVerified);
crossEffect.PauseTransition();
- Wait( application, TRANSITION_DURATION*0.2f );
+ Wait(application, TRANSITION_DURATION * 0.2f);
DALI_TEST_CHECK(!callback.mSignalVerified);
crossEffect.ResumeTransition();
- Wait( application, TRANSITION_DURATION*0.5f );
+ Wait(application, TRANSITION_DURATION * 0.5f);
DALI_TEST_CHECK(!callback.mSignalVerified);
crossEffect.PauseTransition();
- Wait( application, TRANSITION_DURATION*0.2f );
+ Wait(application, TRANSITION_DURATION * 0.2f);
DALI_TEST_CHECK(!callback.mSignalVerified);
crossEffect.ResumeTransition();
- Wait( application, TRANSITION_DURATION*0.25f );
+ Wait(application, TRANSITION_DURATION * 0.25f);
DALI_TEST_CHECK(callback.mSignalVerified);
callback.Reset();
- currentEffect = foldEffect;
+ currentEffect = foldEffect;
actorTransitTo = secondTexture;
- foldEffect.SetCurrentTexture( firstTexture );
- foldEffect.SetTargetTexture( secondTexture );
+ foldEffect.SetCurrentTexture(firstTexture);
+ foldEffect.SetTargetTexture(secondTexture);
// start transition; transit for 0.5*duration; pause for 0.5*duration;
// resume for 0.25*duration; pause for 0.25*duration; resume for another 0.25*duration;
// only until now the transition finished signal can be received
foldEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1);
- Wait( application, TRANSITION_DURATION*0.5f );
+ Wait(application, TRANSITION_DURATION * 0.5f);
DALI_TEST_CHECK(!callback.mSignalVerified);
foldEffect.PauseTransition();
- Wait( application, TRANSITION_DURATION*0.5f );
+ Wait(application, TRANSITION_DURATION * 0.5f);
DALI_TEST_CHECK(!callback.mSignalVerified);
foldEffect.ResumeTransition();
- Wait( application, TRANSITION_DURATION*0.25f );
+ Wait(application, TRANSITION_DURATION * 0.25f);
DALI_TEST_CHECK(!callback.mSignalVerified);
foldEffect.PauseTransition();
- Wait( application, TRANSITION_DURATION*0.25f );
+ Wait(application, TRANSITION_DURATION * 0.25f);
DALI_TEST_CHECK(!callback.mSignalVerified);
foldEffect.ResumeTransition();
- Wait( application, TRANSITION_DURATION*0.25f );
+ Wait(application, TRANSITION_DURATION * 0.25f);
DALI_TEST_CHECK(callback.mSignalVerified);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliCubeTransitionWaveEffectStopTransition ");
- application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
- Texture firstTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 30, 30 );
- Texture secondTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 20, 20 );
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
+ Texture firstTexture = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 30, 30);
+ Texture secondTexture = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 20, 20);
- CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New( NUM_ROWS, NUM_COLUMNS );
- waveEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
- waveEffect.SetTransitionDuration( TRANSITION_DURATION );
- waveEffect.SetCubeDisplacement( CUBE_DISPLACEMENT );
- waveEffect.SetCurrentTexture( firstTexture );
- waveEffect.SetTargetTexture( secondTexture );
+ CubeTransitionEffect waveEffect = CubeTransitionWaveEffect::New(NUM_ROWS, NUM_COLUMNS);
+ waveEffect.SetProperty(Actor::Property::SIZE, Vector2(VIEW_AREA_SIZE));
+ waveEffect.SetTransitionDuration(TRANSITION_DURATION);
+ waveEffect.SetCubeDisplacement(CUBE_DISPLACEMENT);
+ waveEffect.SetCurrentTexture(firstTexture);
+ waveEffect.SetTargetTexture(secondTexture);
- application.GetScene().Add( waveEffect );
+ application.GetScene().Add(waveEffect);
application.SendNotification();
application.Render();
Actor cube = waveEffect.GetChildAt(0).GetChildAt(0);
//check the cube rotation value and color values reset after stopping different transitions in the middle
- Wait( application, TRANSITION_DURATION*0.2f );
+ Wait(application, TRANSITION_DURATION * 0.2f);
waveEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- DALI_TEST_EQUALS( cube.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::ZERO), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS(cube.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_0, Vector3::ZERO), FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube.GetChildAt(0).GetCurrentProperty<Vector4>(Actor::Property::COLOR), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube.GetChildAt(1).GetCurrentProperty<Vector4>(Actor::Property::COLOR), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION);
- waveEffect.SetTargetTexture( firstTexture );
+ waveEffect.SetTargetTexture(firstTexture);
waveEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1);
- Wait( application, TRANSITION_DURATION*0.4f );
+ Wait(application, TRANSITION_DURATION * 0.4f);
waveEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- DALI_TEST_EQUALS( cube.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::ZERO), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS(cube.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_0, Vector3::ZERO), FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube.GetChildAt(0).GetCurrentProperty<Vector4>(Actor::Property::COLOR), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube.GetChildAt(1).GetCurrentProperty<Vector4>(Actor::Property::COLOR), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION);
- waveEffect.SetTargetTexture( secondTexture );
+ waveEffect.SetTargetTexture(secondTexture);
waveEffect.StartTransition(false);
- Wait( application, TRANSITION_DURATION*0.6f );
+ Wait(application, TRANSITION_DURATION * 0.6f);
waveEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- DALI_TEST_EQUALS( cube.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::ZERO), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS(cube.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_0, Vector3::ZERO), FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube.GetChildAt(0).GetCurrentProperty<Vector4>(Actor::Property::COLOR), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube.GetChildAt(1).GetCurrentProperty<Vector4>(Actor::Property::COLOR), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION);
- waveEffect.SetTargetTexture( firstTexture );
+ waveEffect.SetTargetTexture(firstTexture);
waveEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2);
- Wait( application, TRANSITION_DURATION*0.8f );
+ Wait(application, TRANSITION_DURATION * 0.8f);
waveEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- DALI_TEST_EQUALS( cube.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::ZERO), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS(cube.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_0, Vector3::ZERO), FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube.GetChildAt(0).GetCurrentProperty<Vector4>(Actor::Property::COLOR), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube.GetChildAt(1).GetCurrentProperty<Vector4>(Actor::Property::COLOR), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliCubeTransitionCrossEffectStopTransition ");
- application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
- Texture firstTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 30, 30 );
- Texture secondTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 20, 20 );
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
+ Texture firstTexture = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 30, 30);
+ Texture secondTexture = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 20, 20);
- CubeTransitionEffect crossEffect = CubeTransitionCrossEffect::New( NUM_ROWS, NUM_COLUMNS );
- crossEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
- crossEffect.SetTransitionDuration( TRANSITION_DURATION );
- crossEffect.SetCubeDisplacement( CUBE_DISPLACEMENT );
- crossEffect.SetCurrentTexture( firstTexture );
- crossEffect.SetTargetTexture( secondTexture );
+ CubeTransitionEffect crossEffect = CubeTransitionCrossEffect::New(NUM_ROWS, NUM_COLUMNS);
+ crossEffect.SetProperty(Actor::Property::SIZE, Vector2(VIEW_AREA_SIZE));
+ crossEffect.SetTransitionDuration(TRANSITION_DURATION);
+ crossEffect.SetCubeDisplacement(CUBE_DISPLACEMENT);
+ crossEffect.SetCurrentTexture(firstTexture);
+ crossEffect.SetTargetTexture(secondTexture);
- application.GetScene().Add( crossEffect );
+ application.GetScene().Add(crossEffect);
application.SendNotification();
application.Render();
Actor cube1 = crossEffect.GetChildAt(0).GetChildAt(1);
//check the cube rotation values and color values reset after stop the different transitions in the middle
- Wait( application, TRANSITION_DURATION*0.2f );
+ Wait(application, TRANSITION_DURATION * 0.2f);
crossEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- DALI_TEST_EQUALS( cube0.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::ZERO), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube1.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::ZERO), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS(cube0.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_0, Vector3::ZERO), FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube1.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_0, Vector3::ZERO), FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(0).GetCurrentProperty<Vector4>(Actor::Property::COLOR), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(1).GetCurrentProperty<Vector4>(Actor::Property::COLOR), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION);
- crossEffect.SetTargetTexture( firstTexture );
+ crossEffect.SetTargetTexture(firstTexture);
crossEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1);
- Wait( application, TRANSITION_DURATION*0.4f );
+ Wait(application, TRANSITION_DURATION * 0.4f);
crossEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- DALI_TEST_EQUALS( cube0.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::ZERO), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube1.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::ZERO), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS(cube0.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_0, Vector3::ZERO), FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube1.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_0, Vector3::ZERO), FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(0).GetCurrentProperty<Vector4>(Actor::Property::COLOR), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(1).GetCurrentProperty<Vector4>(Actor::Property::COLOR), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION);
- crossEffect.SetTargetTexture( secondTexture );
+ crossEffect.SetTargetTexture(secondTexture);
crossEffect.StartTransition(false);
- Wait( application, TRANSITION_DURATION*0.6f );
+ Wait(application, TRANSITION_DURATION * 0.6f);
crossEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- DALI_TEST_EQUALS( cube0.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::ZERO), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube1.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::ZERO), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS(cube0.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_0, Vector3::ZERO), FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube1.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_0, Vector3::ZERO), FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(0).GetCurrentProperty<Vector4>(Actor::Property::COLOR), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(1).GetCurrentProperty<Vector4>(Actor::Property::COLOR), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION);
- crossEffect.SetTargetTexture( firstTexture );
+ crossEffect.SetTargetTexture(firstTexture);
crossEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2);
- Wait( application, TRANSITION_DURATION*0.8f );
+ Wait(application, TRANSITION_DURATION * 0.8f);
crossEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- DALI_TEST_EQUALS( cube1.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS(cube1.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_0, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_0, Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(0).GetCurrentProperty<Vector4>(Actor::Property::COLOR), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(1).GetCurrentProperty<Vector4>(Actor::Property::COLOR), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliCubeTransitionFoldEffectStopTransition ");
- application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
- Texture firstTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 30, 30 );
- Texture secondTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 20, 20 );
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
+ Texture firstTexture = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 30, 30);
+ Texture secondTexture = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 20, 20);
- CubeTransitionEffect foldEffect = CubeTransitionFoldEffect::New( NUM_ROWS, NUM_COLUMNS );
- foldEffect.SetProperty( Actor::Property::SIZE, Vector2( VIEW_AREA_SIZE ) );
- foldEffect.SetTransitionDuration( TRANSITION_DURATION );
- foldEffect.SetCurrentTexture( firstTexture );
- foldEffect.SetTargetTexture( secondTexture );
+ CubeTransitionEffect foldEffect = CubeTransitionFoldEffect::New(NUM_ROWS, NUM_COLUMNS);
+ foldEffect.SetProperty(Actor::Property::SIZE, Vector2(VIEW_AREA_SIZE));
+ foldEffect.SetTransitionDuration(TRANSITION_DURATION);
+ foldEffect.SetCurrentTexture(firstTexture);
+ foldEffect.SetTargetTexture(secondTexture);
- application.GetScene().Add( foldEffect );
+ application.GetScene().Add(foldEffect);
application.SendNotification();
application.Render();
Actor cube1 = foldEffect.GetChildAt(0).GetChildAt(1);
//check the cube rotation values and color values after stop the different transitions in the middle
- Wait( application, TRANSITION_DURATION*0.2f );
+ Wait(application, TRANSITION_DURATION * 0.2f);
foldEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- DALI_TEST_EQUALS( cube1.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS(cube1.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_0, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_0, Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(0).GetCurrentProperty<Vector4>(Actor::Property::COLOR), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(1).GetCurrentProperty<Vector4>(Actor::Property::COLOR), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION);
- foldEffect.SetTargetTexture( firstTexture );
+ foldEffect.SetTargetTexture(firstTexture);
foldEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1);
- Wait( application, TRANSITION_DURATION*0.4f );
+ Wait(application, TRANSITION_DURATION * 0.4f);
foldEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- DALI_TEST_EQUALS( cube1.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS(cube1.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_0, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_0, Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(0).GetCurrentProperty<Vector4>(Actor::Property::COLOR), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(1).GetCurrentProperty<Vector4>(Actor::Property::COLOR), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION);
- foldEffect.SetTargetTexture( secondTexture );
+ foldEffect.SetTargetTexture(secondTexture);
foldEffect.StartTransition(false);
- Wait( application, TRANSITION_DURATION*0.6f );
+ Wait(application, TRANSITION_DURATION * 0.6f);
foldEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- DALI_TEST_EQUALS( cube1.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS(cube1.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_0, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_0, Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(0).GetCurrentProperty<Vector4>(Actor::Property::COLOR), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(1).GetCurrentProperty<Vector4>(Actor::Property::COLOR), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION);
- foldEffect.SetTargetTexture( firstTexture );
+ foldEffect.SetTargetTexture(firstTexture);
foldEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2);
- Wait( application, TRANSITION_DURATION*0.8f );
+ Wait(application, TRANSITION_DURATION * 0.8f);
foldEffect.StopTransition();
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- DALI_TEST_EQUALS( cube1.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
- DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION );
+ DALI_TEST_EQUALS(cube1.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_0, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetCurrentProperty<Quaternion>(Actor::Property::ORIENTATION), Quaternion(Dali::ANGLE_0, Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(0).GetCurrentProperty<Vector4>(Actor::Property::COLOR), FULL_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION);
+ DALI_TEST_EQUALS(cube0.GetChildAt(1).GetCurrentProperty<Vector4>(Actor::Property::COLOR), HALF_BRIGHTNESS, FLT_EPISILON, TEST_LOCATION);
END_TEST;
}
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
#include <stdlib.h>
+#include <iostream>
// Need to override adaptor classes for toolkit test harness, so include
// test harness headers before dali headers.
namespace
{
- const int RENDER_FRAME_INTERVAL = 16;
- struct SignalData
- {
- SignalData()
- :functorCalled(false),
+const int RENDER_FRAME_INTERVAL = 16;
+struct SignalData
+{
+ SignalData()
+ : functorCalled(false),
control(),
detector()
- {
- }
+ {
+ }
- void Reset()
- {
- functorCalled = false;
- control.Reset();
- }
+ void Reset()
+ {
+ functorCalled = false;
+ control.Reset();
+ }
- bool functorCalled;
- Control control;
- Dali::Toolkit::DragAndDropDetector detector;
- };
+ bool functorCalled;
+ Control control;
+ Dali::Toolkit::DragAndDropDetector detector;
+};
- struct DragSignalFunctor
- {
- DragSignalFunctor(SignalData& data, bool returnValue = true)
- :signalData(data),
+struct DragSignalFunctor
+{
+ DragSignalFunctor(SignalData& data, bool returnValue = true)
+ : signalData(data),
returnValue(returnValue)
- {
- }
-
- bool operator()(Control control, Dali::Toolkit::DragAndDropDetector detector)
- {
- signalData.functorCalled = true;
- signalData.control = control;
- signalData.detector = detector;
- return returnValue;
- }
-
- SignalData& signalData;
- bool returnValue;
- };
-
- Integration::TouchEvent GenerateSingleTouch(PointState::Type state, const Vector2& screenPosition)
{
- Integration::TouchEvent touchEvent;
- Integration::Point point;
- point.SetState(static_cast<PointState::Type>(state));
- point.SetScreenPosition(screenPosition);
- touchEvent.points.push_back(point);
- return touchEvent;
}
+
+ bool operator()(Control control, Dali::Toolkit::DragAndDropDetector detector)
+ {
+ signalData.functorCalled = true;
+ signalData.control = control;
+ signalData.detector = detector;
+ return returnValue;
+ }
+
+ SignalData& signalData;
+ bool returnValue;
+};
+
+Integration::TouchEvent GenerateSingleTouch(PointState::Type state, const Vector2& screenPosition)
+{
+ Integration::TouchEvent touchEvent;
+ Integration::Point point;
+ point.SetState(static_cast<PointState::Type>(state));
+ point.SetScreenPosition(screenPosition);
+ touchEvent.points.push_back(point);
+ return touchEvent;
}
+} // namespace
int UtcDaliDragAndDropDetectorConstructorN(void)
{
ToolkitTestApplication application;
Dali::Toolkit::DragAndDropDetector detector = Dali::Toolkit::DragAndDropDetector::New();
- Control control;
+ Control control;
detector.Attach(control);
DALI_TEST_EQUALS(0, detector.GetAttachedControlCount(), TEST_LOCATION);
ToolkitTestApplication application;
Dali::Toolkit::DragAndDropDetector detector = Dali::Toolkit::DragAndDropDetector::New();
- Control control = Control::New();
+ Control control = Control::New();
detector.Attach(control);
DALI_TEST_EQUALS(1, detector.GetAttachedControlCount(), TEST_LOCATION);
}
int UtcDaliDragAndDropDetectorDetachN(void)
- {
+{
ToolkitTestApplication application;
Dali::Toolkit::DragAndDropDetector detector = Dali::Toolkit::DragAndDropDetector::New();
- Control control1;
- Control control2 = Control::New();
+ Control control1;
+ Control control2 = Control::New();
detector.Attach(control1);
detector.Attach(control2);
DALI_TEST_EQUALS(0, detector.GetAttachedControlCount(), TEST_LOCATION);
END_TEST;
-
}
int UtcDaliDragAndDropDetectorDetachP(void)
ToolkitTestApplication application;
Dali::Toolkit::DragAndDropDetector detector = Dali::Toolkit::DragAndDropDetector::New();
- Control control1 = Control::New();
- Control control2 = Control::New();
- Control control3;
+ Control control1 = Control::New();
+ Control control2 = Control::New();
+ Control control3;
detector.Attach(control1);
detector.Attach(control2);
ToolkitTestApplication application;
Dali::Toolkit::DragAndDropDetector detector = Dali::Toolkit::DragAndDropDetector::New();
- Control control1 = Control::New();
- Control control2 = Control::New();
+ Control control1 = Control::New();
+ Control control2 = Control::New();
detector.Attach(control1);
detector.Attach(control2);
ToolkitTestApplication application;
Dali::Toolkit::DragAndDropDetector detector = Dali::Toolkit::DragAndDropDetector::New();
- Control control1 = Control::New();
- Control control2 = Control::New();
+ Control control1 = Control::New();
+ Control control2 = Control::New();
detector.Attach(control1);
detector.Attach(control2);
ToolkitTestApplication application;
Dali::Toolkit::DragAndDropDetector detector = Dali::Toolkit::DragAndDropDetector::New();
- Control control1 = Control::New();
- Control control2 = Control::New();
+ Control control1 = Control::New();
+ Control control2 = Control::New();
detector.Attach(control1);
ToolkitTestApplication application;
Dali::Toolkit::DragAndDropDetector detector = Dali::Toolkit::DragAndDropDetector::New();
- Control control1 = Control::New();
- Control control2 = Control::New();
+ Control control1 = Control::New();
+ Control control2 = Control::New();
detector.Attach(control1);
detector.Attach(control2);
ToolkitTestApplication application;
Dali::Toolkit::DragAndDropDetector detector = Dali::Toolkit::DragAndDropDetector::New();
- Control control = Control::New();
- control.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
- control.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+ Control control = Control::New();
+ control.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ control.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
application.GetScene().Add(control);
detector.Attach(control);
DALI_TEST_CHECK(detector);
DALI_TEST_CHECK(control);
- SignalData data;
+ SignalData data;
DragSignalFunctor functor(data);
detector.StartedSignal().Connect(&application, functor);
ToolkitTestApplication application;
Dali::Toolkit::DragAndDropDetector detector = Dali::Toolkit::DragAndDropDetector::New();
- Control control1 = Control::New();
- Control control2 = Control::New();
- control1.SetProperty( Actor::Property::SIZE, Vector2(100.0f,100.0f) );
- control2.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
- control1.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- control2.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- control1.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- control2.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- control1.SetProperty( Actor::Property::POSITION, Vector2(0.0f, 0.0f));
- control2.SetProperty( Actor::Property::POSITION, Vector2(0.0f, 100.0f));
+ Control control1 = Control::New();
+ Control control2 = Control::New();
+ control1.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ control2.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ control1.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ control2.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ control1.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ control2.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ control1.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 0.0f));
+ control2.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 100.0f));
application.GetScene().Add(control1);
application.GetScene().Add(control2);
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- SignalData data;
+ SignalData data;
DragSignalFunctor functor(data);
detector.EnteredSignal().Connect(&application, functor);
data.Reset();
END_TEST;
-
}
int UtcDaliDragAndDropDetectorMovedSignal(void)
ToolkitTestApplication application;
Dali::Toolkit::DragAndDropDetector detector = Dali::Toolkit::DragAndDropDetector::New();
- Control control1 = Control::New();
- Control control2 = Control::New();
- control1.SetProperty( Actor::Property::SIZE, Vector2(100.0f,100.0f) );
- control2.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
- control1.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- control2.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- control1.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- control2.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- control1.SetProperty( Actor::Property::POSITION, Vector2(0.0f, 0.0f));
- control2.SetProperty( Actor::Property::POSITION, Vector2(0.0f, 100.0f));
+ Control control1 = Control::New();
+ Control control2 = Control::New();
+ control1.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ control2.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ control1.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ control2.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ control1.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ control2.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ control1.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 0.0f));
+ control2.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 100.0f));
application.GetScene().Add(control1);
application.GetScene().Add(control2);
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- SignalData data;
+ SignalData data;
DragSignalFunctor functor(data);
detector.MovedSignal().Connect(&application, functor);
ToolkitTestApplication application;
Dali::Toolkit::DragAndDropDetector detector = Dali::Toolkit::DragAndDropDetector::New();
- Control control1 = Control::New();
- Control control2 = Control::New();
- control1.SetProperty( Actor::Property::SIZE, Vector2(100.0f,100.0f) );
- control2.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
- control1.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- control2.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- control1.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- control2.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- control1.SetProperty( Actor::Property::POSITION, Vector2(0.0f, 0.0f));
- control2.SetProperty( Actor::Property::POSITION, Vector2(0.0f, 100.0f));
-
- control1.SetProperty( Actor::Property::LEAVE_REQUIRED,true);
- control2.SetProperty( Actor::Property::LEAVE_REQUIRED,true);
+ Control control1 = Control::New();
+ Control control2 = Control::New();
+ control1.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ control2.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ control1.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ control2.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ control1.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ control2.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ control1.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 0.0f));
+ control2.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 100.0f));
+
+ control1.SetProperty(Actor::Property::LEAVE_REQUIRED, true);
+ control2.SetProperty(Actor::Property::LEAVE_REQUIRED, true);
application.GetScene().Add(control1);
application.GetScene().Add(control2);
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- SignalData data;
+ SignalData data;
DragSignalFunctor functor(data);
detector.ExitedSignal().Connect(&application, functor);
ToolkitTestApplication application;
Dali::Toolkit::DragAndDropDetector detector = Dali::Toolkit::DragAndDropDetector::New();
- Control control1 = Control::New();
- Control control2 = Control::New();
- control1.SetProperty( Actor::Property::SIZE, Vector2(100.0f,100.0f) );
- control2.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
- control1.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- control2.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- control1.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- control2.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- control1.SetProperty( Actor::Property::POSITION, Vector2(0.0f, 0.0f));
- control2.SetProperty( Actor::Property::POSITION, Vector2(0.0f, 100.0f));
+ Control control1 = Control::New();
+ Control control2 = Control::New();
+ control1.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ control2.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ control1.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ control2.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ control1.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ control2.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ control1.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 0.0f));
+ control2.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 100.0f));
application.GetScene().Add(control1);
application.GetScene().Add(control2);
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- SignalData data;
+ SignalData data;
DragSignalFunctor functor(data);
detector.DroppedSignal().Connect(&application, functor);
ToolkitTestApplication application;
Dali::Toolkit::DragAndDropDetector detector = Dali::Toolkit::DragAndDropDetector::New();
- Control control1 = Control::New();
- Control control2 = Control::New();
- control1.SetProperty( Actor::Property::SIZE, Vector2(100.0f,100.0f) );
- control2.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
- control1.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- control2.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- control1.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- control2.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- control1.SetProperty( Actor::Property::POSITION, Vector2(0.0f, 0.0f));
- control2.SetProperty( Actor::Property::POSITION, Vector2(0.0f, 100.0f));
+ Control control1 = Control::New();
+ Control control2 = Control::New();
+ control1.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ control2.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ control1.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ control2.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ control1.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ control2.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ control1.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 0.0f));
+ control2.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 100.0f));
application.GetScene().Add(control1);
application.GetScene().Add(control2);
detector.Attach(control1);
detector.Attach(control2);
- SignalData data;
+ SignalData data;
DragSignalFunctor functor(data);
detector.EndedSignal().Connect(&application, functor);
ToolkitTestApplication application;
Dali::Toolkit::DragAndDropDetector detector = Dali::Toolkit::DragAndDropDetector::New();
- Control control1 = Control::New();
- Control control2 = Control::New();
- control1.SetProperty( Dali::Actor::Property::NAME,"control1");
- control2.SetProperty( Dali::Actor::Property::NAME,"control2");
- control1.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
- control2.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
- control1.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- control2.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- control1.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- control2.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- control1.SetProperty( Actor::Property::POSITION, Vector2(0.0f, 0.0f));
- control2.SetProperty( Actor::Property::POSITION, Vector2(0.0f, 100.0f));
+ Control control1 = Control::New();
+ Control control2 = Control::New();
+ control1.SetProperty(Dali::Actor::Property::NAME, "control1");
+ control2.SetProperty(Dali::Actor::Property::NAME, "control2");
+ control1.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ control2.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ control1.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ control2.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ control1.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ control2.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ control1.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 0.0f));
+ control2.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 100.0f));
application.GetScene().Add(control1);
application.GetScene().Add(control2);
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
- SignalData data;
+ SignalData data;
DragSignalFunctor functor(data);
detector.DroppedSignal().Connect(&application, functor);
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
#include <stdlib.h>
+#include <iostream>
#include <sstream>
+
#include <dali-toolkit-test-suite-utils.h>
+
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/controls/effects-view/effects-view.h>
ToolkitTestApplication application;
EffectsView view;
- DALI_TEST_CHECK( !view );
+ DALI_TEST_CHECK(!view);
- view = EffectsView::New( EffectsView::DROP_SHADOW );
- DALI_TEST_CHECK( view );
+ view = EffectsView::New(EffectsView::DROP_SHADOW);
+ DALI_TEST_CHECK(view);
- application.GetScene().Add( view );
+ application.GetScene().Add(view);
view.Reset();
- view = EffectsView::New( EffectsView::EMBOSS );
- DALI_TEST_CHECK( view );
+ view = EffectsView::New(EffectsView::EMBOSS);
+ DALI_TEST_CHECK(view);
application.SendNotification();
application.Render();
{
ToolkitTestApplication application;
- EffectsView view = EffectsView::New( EffectsView::DROP_SHADOW );
- DALI_TEST_CHECK( view );
+ EffectsView view = EffectsView::New(EffectsView::DROP_SHADOW);
+ DALI_TEST_CHECK(view);
- EffectsView copy( view );
- DALI_TEST_CHECK( copy == view );
+ EffectsView copy(view);
+ DALI_TEST_CHECK(copy == view);
EffectsView assign;
- DALI_TEST_CHECK( !assign );
+ DALI_TEST_CHECK(!assign);
assign = view;
- DALI_TEST_CHECK( assign == view );
+ DALI_TEST_CHECK(assign == view);
// Self assignment
assign = assign;
- DALI_TEST_CHECK( assign );
- DALI_TEST_CHECK( assign == view );
+ DALI_TEST_CHECK(assign);
+ DALI_TEST_CHECK(assign == view);
END_TEST;
}
{
ToolkitTestApplication application;
- BaseHandle view = EffectsView::New( EffectsView::EMBOSS );
- DALI_TEST_CHECK( EffectsView::DownCast( view ) );
+ BaseHandle view = EffectsView::New(EffectsView::EMBOSS);
+ DALI_TEST_CHECK(EffectsView::DownCast(view));
BaseHandle empty;
- DALI_TEST_CHECK( ! EffectsView::DownCast( empty ) );
+ DALI_TEST_CHECK(!EffectsView::DownCast(empty));
BaseHandle another = Actor::New();
- DALI_TEST_CHECK( ! EffectsView::DownCast( another ) );
+ DALI_TEST_CHECK(!EffectsView::DownCast(another));
END_TEST;
}
ToolkitTestApplication application;
tet_infoline("UtcDaliEffectsViewAddRemoveDropShadow");
- EffectsView view = EffectsView::New( EffectsView::DROP_SHADOW );
- DALI_TEST_CHECK( view );
+ EffectsView view = EffectsView::New(EffectsView::DROP_SHADOW);
+ DALI_TEST_CHECK(view);
Actor actor = Actor::New();
- DALI_TEST_CHECK( !actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
-
+ DALI_TEST_CHECK(!actor.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE));
- view.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- view.SetProperty( Actor::Property::SIZE, application.GetScene().GetSize());
+ view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ view.SetProperty(Actor::Property::SIZE, application.GetScene().GetSize());
view.Add(actor);
application.GetScene().Add(view);
- DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
- DALI_TEST_CHECK( actor.GetParent() );
- DALI_TEST_CHECK( actor.GetParent() != view );
+ DALI_TEST_CHECK(actor.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE));
+ DALI_TEST_CHECK(actor.GetParent());
+ DALI_TEST_CHECK(actor.GetParent() != view);
view.Remove(actor);
- DALI_TEST_CHECK( !actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
+ DALI_TEST_CHECK(!actor.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE));
END_TEST;
}
-
int UtcDaliEffectsViewAddRemoveEmboss(void)
{
ToolkitTestApplication application;
application.SendNotification();
application.Render();
Integration::Scene stage = application.GetScene();
- DALI_TEST_EQUALS( stage.GetRenderTaskList().GetTaskCount(), 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(stage.GetRenderTaskList().GetTaskCount(), 1, TEST_LOCATION);
tet_infoline("Create effects view");
- EffectsView view = EffectsView::New( EffectsView::EMBOSS );
- Vector3 offsetSet( 2.f, 3.f, 4.f );
- Vector4 colorSet( 0.2f, 0.3f, 0.4f, 0.5f );
- view.SetProperty( EffectsView::Property::EFFECT_OFFSET, offsetSet);
- view.SetProperty( EffectsView::Property::EFFECT_COLOR, colorSet);
- Vector3 offsetAnimate( 4.f, 6.f, 8.f );
- float durationSeconds(0.05f);
- Animation animation = Animation::New( durationSeconds );
- animation.AnimateTo( Property(view,EffectsView::Property::EFFECT_OFFSET ), offsetAnimate );
+ EffectsView view = EffectsView::New(EffectsView::EMBOSS);
+ Vector3 offsetSet(2.f, 3.f, 4.f);
+ Vector4 colorSet(0.2f, 0.3f, 0.4f, 0.5f);
+ view.SetProperty(EffectsView::Property::EFFECT_OFFSET, offsetSet);
+ view.SetProperty(EffectsView::Property::EFFECT_COLOR, colorSet);
+ Vector3 offsetAnimate(4.f, 6.f, 8.f);
+ float durationSeconds(0.05f);
+ Animation animation = Animation::New(durationSeconds);
+ animation.AnimateTo(Property(view, EffectsView::Property::EFFECT_OFFSET), offsetAnimate);
animation.Play();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Actor actor = Actor::New();
- actor.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- DALI_TEST_CHECK( !actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
+ actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ DALI_TEST_CHECK(!actor.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE));
- view.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
+ view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
view.Add(actor);
- view.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ view.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
stage.Add(view);
- DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
+ DALI_TEST_CHECK(actor.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE));
application.SendNotification();
application.Render();
stage.Remove(view);
tet_infoline("Checking number of render tasks = 1");
- DALI_TEST_EQUALS( stage.GetRenderTaskList().GetTaskCount(), 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(stage.GetRenderTaskList().GetTaskCount(), 1, TEST_LOCATION);
tet_infoline("Adding view to stage again re-enables view");
stage.Add(view);
tet_infoline("Removing view from stage disables view");
- DALI_TEST_GREATER( stage.GetRenderTaskList().GetTaskCount(), 1u, TEST_LOCATION );
+ DALI_TEST_GREATER(stage.GetRenderTaskList().GetTaskCount(), 1u, TEST_LOCATION);
stage.Remove(view);
view.Reset();
tet_infoline("Checking number of render tasks = 1");
- DALI_TEST_EQUALS( stage.GetRenderTaskList().GetTaskCount(), 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(stage.GetRenderTaskList().GetTaskCount(), 1, TEST_LOCATION);
END_TEST;
}
-
int UtcDaliEffectsViewGetTypeP(void)
{
ToolkitTestApplication application;
- EffectsView view = EffectsView::New( EffectsView::DROP_SHADOW );
- DALI_TEST_CHECK( view.GetType() == EffectsView::DROP_SHADOW );
+ EffectsView view = EffectsView::New(EffectsView::DROP_SHADOW);
+ DALI_TEST_CHECK(view.GetType() == EffectsView::DROP_SHADOW);
view.Reset();
- view = EffectsView::New( EffectsView::EMBOSS );
- DALI_TEST_CHECK( view.GetType() == EffectsView::EMBOSS );
+ view = EffectsView::New(EffectsView::EMBOSS);
+ DALI_TEST_CHECK(view.GetType() == EffectsView::EMBOSS);
END_TEST;
}
ToolkitTestApplication application;
EffectsView view = EffectsView::New(EffectsView::EMBOSS);
- view.SetProperty( Actor::Property::SIZE, Vector2(100.f, 100.f) );
+ view.SetProperty(Actor::Property::SIZE, Vector2(100.f, 100.f));
Integration::Scene stage = application.GetScene();
- DALI_TEST_CHECK( stage.GetRenderTaskList().GetTaskCount() == 1 );
+ DALI_TEST_CHECK(stage.GetRenderTaskList().GetTaskCount() == 1);
- stage.Add( view );
+ stage.Add(view);
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( stage.GetRenderTaskList().GetTaskCount() > 1 );
+ DALI_TEST_CHECK(stage.GetRenderTaskList().GetTaskCount() > 1);
END_TEST;
}
ToolkitTestApplication application;
EffectsView view = EffectsView::New(EffectsView::DROP_SHADOW);
- view.SetProperty( Actor::Property::SIZE, Vector2(100.f, 100.f) );
+ view.SetProperty(Actor::Property::SIZE, Vector2(100.f, 100.f));
Integration::Scene stage = application.GetScene();
- DALI_TEST_CHECK( stage.GetRenderTaskList().GetTaskCount() == 1 );
+ DALI_TEST_CHECK(stage.GetRenderTaskList().GetTaskCount() == 1);
- stage.Add( view );
+ stage.Add(view);
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( stage.GetRenderTaskList().GetTaskCount() > 1 );
+ DALI_TEST_CHECK(stage.GetRenderTaskList().GetTaskCount() > 1);
- stage.Remove( view );
+ stage.Remove(view);
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( stage.GetRenderTaskList().GetTaskCount() == 1 );
+ DALI_TEST_CHECK(stage.GetRenderTaskList().GetTaskCount() == 1);
END_TEST;
}
{
ToolkitTestApplication application;
- EffectsView view = EffectsView::New( EffectsView::DROP_SHADOW );
+ EffectsView view = EffectsView::New(EffectsView::DROP_SHADOW);
try
{
view.Refresh();
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( false ); // Should not get here!
+ DALI_TEST_CHECK(false); // Should not get here!
}
END_TEST;
try
{
view.Refresh();
- DALI_TEST_CHECK( false ); // Should not get here
+ DALI_TEST_CHECK(false); // Should not get here
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
{
ToolkitTestApplication application;
- EffectsView view = EffectsView::New( EffectsView::DROP_SHADOW );
+ EffectsView view = EffectsView::New(EffectsView::DROP_SHADOW);
try
{
- view.SetPixelFormat( Pixel::RGBA8888 );
- DALI_TEST_CHECK( true );
+ view.SetPixelFormat(Pixel::RGBA8888);
+ DALI_TEST_CHECK(true);
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( false ); // Should not get here!
+ DALI_TEST_CHECK(false); // Should not get here!
}
END_TEST;
EffectsView view;
try
{
- view.SetPixelFormat( Pixel::RGBA8888 );
- DALI_TEST_CHECK( false ); // Should not get here
+ view.SetPixelFormat(Pixel::RGBA8888);
+ DALI_TEST_CHECK(false); // Should not get here
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
{
ToolkitTestApplication application;
- EffectsView view = EffectsView::New( EffectsView::DROP_SHADOW );
+ EffectsView view = EffectsView::New(EffectsView::DROP_SHADOW);
- Property::Index idx = view.GetPropertyIndex( "effectSize" );
- DALI_TEST_EQUALS( idx, (Property::Index)EffectsView::Property::EFFECT_SIZE, TEST_LOCATION );
+ Property::Index idx = view.GetPropertyIndex("effectSize");
+ DALI_TEST_EQUALS(idx, (Property::Index)EffectsView::Property::EFFECT_SIZE, TEST_LOCATION);
- view.SetProperty( idx, 5 );
- Property::Value value = view.GetProperty( EffectsView::Property::EFFECT_SIZE );
- int size;
- DALI_TEST_CHECK( value.Get(size) );
- DALI_TEST_CHECK( size == 5 );
+ view.SetProperty(idx, 5);
+ Property::Value value = view.GetProperty(EffectsView::Property::EFFECT_SIZE);
+ int size;
+ DALI_TEST_CHECK(value.Get(size));
+ DALI_TEST_CHECK(size == 5);
END_TEST;
}
{
ToolkitTestApplication application;
- EffectsView view = EffectsView::New( EffectsView::EMBOSS );
- application.GetScene().Add( view );
+ EffectsView view = EffectsView::New(EffectsView::EMBOSS);
+ application.GetScene().Add(view);
- Property::Value value = view.GetProperty( EffectsView::Property::EFFECT_OFFSET );
- Vector3 offsetValue;
- DALI_TEST_CHECK( value.Get(offsetValue) );
- DALI_TEST_EQUALS( offsetValue, Vector3::ZERO, TEST_LOCATION );
+ Property::Value value = view.GetProperty(EffectsView::Property::EFFECT_OFFSET);
+ Vector3 offsetValue;
+ DALI_TEST_CHECK(value.Get(offsetValue));
+ DALI_TEST_EQUALS(offsetValue, Vector3::ZERO, TEST_LOCATION);
- Vector3 offsetSet( 2.f, 3.f, 4.f );
- view.SetProperty( EffectsView::Property::EFFECT_OFFSET, offsetSet);
+ Vector3 offsetSet(2.f, 3.f, 4.f);
+ view.SetProperty(EffectsView::Property::EFFECT_OFFSET, offsetSet);
application.SendNotification();
application.Render(0);
- value = view.GetProperty( EffectsView::Property::EFFECT_OFFSET );
+ value = view.GetProperty(EffectsView::Property::EFFECT_OFFSET);
value.Get(offsetValue);
- DALI_TEST_EQUALS( offsetValue, offsetSet, TEST_LOCATION );
+ DALI_TEST_EQUALS(offsetValue, offsetSet, TEST_LOCATION);
- Vector3 offsetAnimate( 4.f, 6.f, 8.f );
- float durationSeconds(0.05f);
- Animation animation = Animation::New( durationSeconds );
- animation.AnimateTo( Property(view,EffectsView::Property::EFFECT_OFFSET ), offsetAnimate );
+ Vector3 offsetAnimate(4.f, 6.f, 8.f);
+ float durationSeconds(0.05f);
+ Animation animation = Animation::New(durationSeconds);
+ animation.AnimateTo(Property(view, EffectsView::Property::EFFECT_OFFSET), offsetAnimate);
animation.Play();
application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*1000.0f) + 1u/*just beyond the animation duration*/);
+ application.Render(static_cast<unsigned int>(durationSeconds * 1000.0f) + 1u /*just beyond the animation duration*/);
- value = view.GetCurrentProperty( EffectsView::Property::EFFECT_OFFSET );
+ value = view.GetCurrentProperty(EffectsView::Property::EFFECT_OFFSET);
value.Get(offsetValue);
- DALI_TEST_EQUALS( offsetValue, offsetAnimate, TEST_LOCATION );
+ DALI_TEST_EQUALS(offsetValue, offsetAnimate, TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- EffectsView view = EffectsView::New( EffectsView::DROP_SHADOW );
- application.GetScene().Add( view );
+ EffectsView view = EffectsView::New(EffectsView::DROP_SHADOW);
+ application.GetScene().Add(view);
- Property::Value value = view.GetProperty( EffectsView::Property::EFFECT_COLOR );
- Vector4 colorValue;
- DALI_TEST_CHECK( value.Get(colorValue) );
- DALI_TEST_EQUALS( colorValue, Color::WHITE, TEST_LOCATION );
+ Property::Value value = view.GetProperty(EffectsView::Property::EFFECT_COLOR);
+ Vector4 colorValue;
+ DALI_TEST_CHECK(value.Get(colorValue));
+ DALI_TEST_EQUALS(colorValue, Color::WHITE, TEST_LOCATION);
- Vector4 colorSet( 0.2f, 0.3f, 0.4f, 0.5f );
- view.SetProperty( EffectsView::Property::EFFECT_COLOR, colorSet);
+ Vector4 colorSet(0.2f, 0.3f, 0.4f, 0.5f);
+ view.SetProperty(EffectsView::Property::EFFECT_COLOR, colorSet);
application.SendNotification();
application.Render(0);
- value = view.GetProperty( EffectsView::Property::EFFECT_COLOR );
+ value = view.GetProperty(EffectsView::Property::EFFECT_COLOR);
value.Get(colorValue);
- DALI_TEST_EQUALS( colorValue, colorSet, TEST_LOCATION );
+ DALI_TEST_EQUALS(colorValue, colorSet, TEST_LOCATION);
- Vector4 colorAnimate( 0.5f, 0.6f, 0.8f, 1.f );
- float durationSeconds(0.05f);
- Animation animation = Animation::New( durationSeconds );
- animation.AnimateTo( Property(view,EffectsView::Property::EFFECT_COLOR ), colorAnimate );
+ Vector4 colorAnimate(0.5f, 0.6f, 0.8f, 1.f);
+ float durationSeconds(0.05f);
+ Animation animation = Animation::New(durationSeconds);
+ animation.AnimateTo(Property(view, EffectsView::Property::EFFECT_COLOR), colorAnimate);
animation.Play();
application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*1000.0f) + 1u/*just beyond the animation duration*/);
+ application.Render(static_cast<unsigned int>(durationSeconds * 1000.0f) + 1u /*just beyond the animation duration*/);
- value = view.GetCurrentProperty( EffectsView::Property::EFFECT_COLOR );
+ value = view.GetCurrentProperty(EffectsView::Property::EFFECT_COLOR);
value.Get(colorValue);
- DALI_TEST_EQUALS( colorValue, colorAnimate, TEST_LOCATION );
+ DALI_TEST_EQUALS(colorValue, colorAnimate, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
EffectsView view = EffectsView::New(EffectsView::DROP_SHADOW);
- view.SetBackgroundColor( Color::RED );
- DALI_TEST_CHECK( Color::RED == view.GetBackgroundColor() );
+ view.SetBackgroundColor(Color::RED);
+ DALI_TEST_CHECK(Color::RED == view.GetBackgroundColor());
- view.SetBackgroundColor( Color::YELLOW );
- DALI_TEST_CHECK( Color::YELLOW == view.GetBackgroundColor() );
+ view.SetBackgroundColor(Color::YELLOW);
+ DALI_TEST_CHECK(Color::YELLOW == view.GetBackgroundColor());
END_TEST;
}
EffectsView view;
try
{
- view.SetBackgroundColor( Color::RED );
- DALI_TEST_CHECK( false ); // Should not get here
+ view.SetBackgroundColor(Color::RED);
+ DALI_TEST_CHECK(false); // Should not get here
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
{
Vector4 color = view.GetBackgroundColor();
(void)color;
- DALI_TEST_CHECK( false ); // Should not get here
+ DALI_TEST_CHECK(false); // Should not get here
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
ToolkitTestApplication application;
EffectsView view = EffectsView::New(EffectsView::DROP_SHADOW);
- view.SetProperty( Actor::Property::SIZE, Vector2(100.f, 100.f) );
+ view.SetProperty(Actor::Property::SIZE, Vector2(100.f, 100.f));
Integration::Scene stage = application.GetScene();
- stage.Add( view );
+ stage.Add(view);
application.SendNotification();
application.Render();
RenderTaskList renderTaskList = stage.GetRenderTaskList();
- DALI_TEST_CHECK( renderTaskList.GetTask( 1 ).GetRefreshRate() == RenderTask::REFRESH_ALWAYS );
+ DALI_TEST_CHECK(renderTaskList.GetTask(1).GetRefreshRate() == RenderTask::REFRESH_ALWAYS);
- view.SetRefreshOnDemand( true );
- DALI_TEST_CHECK( renderTaskList.GetTask( 1 ).GetRefreshRate() == RenderTask::REFRESH_ONCE );
+ view.SetRefreshOnDemand(true);
+ DALI_TEST_CHECK(renderTaskList.GetTask(1).GetRefreshRate() == RenderTask::REFRESH_ONCE);
- view.SetRefreshOnDemand( false );
- DALI_TEST_CHECK( renderTaskList.GetTask( 1 ).GetRefreshRate() == RenderTask::REFRESH_ALWAYS );
+ view.SetRefreshOnDemand(false);
+ DALI_TEST_CHECK(renderTaskList.GetTask(1).GetRefreshRate() == RenderTask::REFRESH_ALWAYS);
END_TEST;
}
EffectsView view;
try
{
- view.SetRefreshOnDemand( false );
- DALI_TEST_CHECK( false ); // Should not get here
+ view.SetRefreshOnDemand(false);
+ DALI_TEST_CHECK(false); // Should not get here
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
int UtcDaliEffectsViewSizeSet(void)
{
ToolkitTestApplication application;
- Integration::Scene stage = application.GetScene();
+ Integration::Scene stage = application.GetScene();
{
EffectsView view = EffectsView::New(EffectsView::DROP_SHADOW);
- view.SetProperty( Actor::Property::SIZE, Vector3( 200.0f, 200.0f, 0.0f ) );
- stage.Add( view );
+ view.SetProperty(Actor::Property::SIZE, Vector3(200.0f, 200.0f, 0.0f));
+ stage.Add(view);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( view.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), Vector3( 200.0f, 200.0f, 0.0f ), TEST_LOCATION );
+ DALI_TEST_EQUALS(view.GetCurrentProperty<Vector3>(Actor::Property::SIZE), Vector3(200.0f, 200.0f, 0.0f), TEST_LOCATION);
}
{
EffectsView view = EffectsView::New(EffectsView::EMBOSS);
- view.SetProperty( Actor::Property::SIZE, Vector3( 200.0f, 200.0f, 0.0f ) );
- stage.Add( view );
+ view.SetProperty(Actor::Property::SIZE, Vector3(200.0f, 200.0f, 0.0f));
+ stage.Add(view);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( view.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), Vector3( 200.0f, 200.0f, 0.0f ), TEST_LOCATION );
+ DALI_TEST_EQUALS(view.GetCurrentProperty<Vector3>(Actor::Property::SIZE), Vector3(200.0f, 200.0f, 0.0f), TEST_LOCATION);
}
{
EffectsView view = EffectsView::New(EffectsView::DROP_SHADOW);
- view.SetProperty( Actor::Property::SIZE, Vector3( 200.0f, 200.0f, 0.0f ) );
- stage.Add( view );
+ view.SetProperty(Actor::Property::SIZE, Vector3(200.0f, 200.0f, 0.0f));
+ stage.Add(view);
application.SendNotification();
application.Render();
- stage.Remove( view );
+ stage.Remove(view);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( view.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), Vector3( 200.0f, 200.0f, 0.0f ), TEST_LOCATION );
+ DALI_TEST_EQUALS(view.GetCurrentProperty<Vector3>(Actor::Property::SIZE), Vector3(200.0f, 200.0f, 0.0f), TEST_LOCATION);
}
END_TEST;
ToolkitTestApplication application;
TypeRegistry typeRegistry = TypeRegistry::Get();
- DALI_TEST_CHECK( typeRegistry );
+ DALI_TEST_CHECK(typeRegistry);
- TypeInfo typeInfo = typeRegistry.GetTypeInfo( "EffectsView" );
- DALI_TEST_CHECK( typeInfo );
+ TypeInfo typeInfo = typeRegistry.GetTypeInfo("EffectsView");
+ DALI_TEST_CHECK(typeInfo);
BaseHandle handle = typeInfo.CreateInstance();
- DALI_TEST_CHECK( handle );
+ DALI_TEST_CHECK(handle);
- EffectsView view = EffectsView::DownCast( handle );
- DALI_TEST_CHECK( view );
+ EffectsView view = EffectsView::DownCast(handle);
+ DALI_TEST_CHECK(view);
END_TEST;
}
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
#include <stdlib.h>
+#include <iostream>
+
#include <dali-toolkit-test-suite-utils.h>
+
#include <dali-toolkit/dali-toolkit.h>
-#include <dali/devel-api/actors/actor-devel.h>
#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
-#include <dali-toolkit/public-api/transition/transition-set.h>
-#include <dali-toolkit/public-api/transition/transition-base.h>
#include <dali-toolkit/public-api/transition/fade-transition.h>
+#include <dali-toolkit/public-api/transition/transition-base.h>
+#include <dali-toolkit/public-api/transition/transition-set.h>
+#include <dali/devel-api/actors/actor-devel.h>
using namespace Dali;
using namespace Dali::Toolkit;
transitionSet.AddTransition(fade);
transitionSet.Play();
- bool signalReceived(false);
+ bool signalReceived(false);
TransitionFinishCheck finishCheck(signalReceived);
transitionSet.FinishedSignal().Connect(&application, finishCheck);
finishCheck.CheckSignalNotReceived();
DALI_TEST_EQUALS(1.0f, control.GetCurrentProperty<float>(Actor::Property::OPACITY), TEST_LOCATION);
-
+
application.SendNotification();
application.Render(200);
transitionSet.AddTransition(fade);
transitionSet.Play();
- bool signalReceived(false);
+ bool signalReceived(false);
TransitionFinishCheck finishCheck(signalReceived);
transitionSet.FinishedSignal().Connect(&application, finishCheck);
float currentOpacity = control.GetCurrentProperty<float>(Actor::Property::OPACITY);
DALI_TEST_CHECK(currentOpacity <= 0.7 && currentOpacity >= 0.5);
-
+
application.SendNotification();
application.Render(200);
transitionSet.AddTransition(fade);
transitionSet.Play();
- bool signalReceived(false);
+ bool signalReceived(false);
TransitionFinishCheck finishCheck(signalReceived);
transitionSet.FinishedSignal().Connect(&application, finishCheck);
float currentOpacity = control.GetCurrentProperty<float>(Actor::Property::OPACITY);
DALI_TEST_CHECK(currentOpacity <= 1.0 && currentOpacity >= 0.8);
-
+
application.SendNotification();
application.Render(200);
END_TEST;
}
-
int UtcDaliFadeTransitionAppearingWithDelay(void)
{
ToolkitTestApplication application;
transitionSet.AddTransition(fade);
transitionSet.Play();
- bool signalReceived(false);
+ bool signalReceived(false);
TransitionFinishCheck finishCheck(signalReceived);
transitionSet.FinishedSignal().Connect(&application, finishCheck);
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
#include <stdlib.h>
+#include <iostream>
+
#include <dali-toolkit-test-suite-utils.h>
+
#include <dali-toolkit/dali-toolkit.h>
#include <dali/devel-api/actors/actor-devel.h>
namespace
{
-
const char* const PROPERTY_NAME_CONTENT_DIRECTION = "contentDirection";
-const char* const PROPERTY_NAME_FLEX_DIRECTION = "flexDirection";
-const char* const PROPERTY_NAME_FLEX_WRAP = "flexWrap";
-const char* const PROPERTY_NAME_JUSTIFY_CONTENT = "justifyContent";
-const char* const PROPERTY_NAME_ALIGN_ITEMS = "alignItems";
-const char* const PROPERTY_NAME_ALIGN_CONTENT = "alignContent";
-const char* const CHILD_PROPERTY_NAME_FLEX = "flex";
-const char* const CHILD_PROPERTY_NAME_ALIGN_SELF = "alignSelf";
-const char* const CHILD_PROPERTY_NAME_FLEX_MARGIN = "flexMargin";
+const char* const PROPERTY_NAME_FLEX_DIRECTION = "flexDirection";
+const char* const PROPERTY_NAME_FLEX_WRAP = "flexWrap";
+const char* const PROPERTY_NAME_JUSTIFY_CONTENT = "justifyContent";
+const char* const PROPERTY_NAME_ALIGN_ITEMS = "alignItems";
+const char* const PROPERTY_NAME_ALIGN_CONTENT = "alignContent";
+const char* const CHILD_PROPERTY_NAME_FLEX = "flex";
+const char* const CHILD_PROPERTY_NAME_ALIGN_SELF = "alignSelf";
+const char* const CHILD_PROPERTY_NAME_FLEX_MARGIN = "flexMargin";
} // namespace
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitFlexContainerConstructorP");
FlexContainer flexContainer;
- DALI_TEST_CHECK( !flexContainer );
+ DALI_TEST_CHECK(!flexContainer);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitFlexContainerNewP");
FlexContainer flexContainer = FlexContainer::New();
- DALI_TEST_CHECK( flexContainer );
+ DALI_TEST_CHECK(flexContainer);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitFlexContainerDownCastP");
FlexContainer flexContainer1 = FlexContainer::New();
- BaseHandle object( flexContainer1 );
+ BaseHandle object(flexContainer1);
- FlexContainer flexContainer2 = FlexContainer::DownCast( object );
- DALI_TEST_CHECK( flexContainer2 );
+ FlexContainer flexContainer2 = FlexContainer::DownCast(object);
+ DALI_TEST_CHECK(flexContainer2);
- FlexContainer flexContainer3 = DownCast< FlexContainer >( object );
- DALI_TEST_CHECK( flexContainer3 );
+ FlexContainer flexContainer3 = DownCast<FlexContainer>(object);
+ DALI_TEST_CHECK(flexContainer3);
END_TEST;
}
{
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitFlexContainerDownCastN");
- BaseHandle uninitializedObject;
- FlexContainer flexContainer1 = FlexContainer::DownCast( uninitializedObject );
- DALI_TEST_CHECK( !flexContainer1 );
+ BaseHandle uninitializedObject;
+ FlexContainer flexContainer1 = FlexContainer::DownCast(uninitializedObject);
+ DALI_TEST_CHECK(!flexContainer1);
- FlexContainer flexContainer2 = DownCast< FlexContainer >( uninitializedObject );
- DALI_TEST_CHECK( !flexContainer2 );
+ FlexContainer flexContainer2 = DownCast<FlexContainer>(uninitializedObject);
+ DALI_TEST_CHECK(!flexContainer2);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitFlexContainerCopyConstructorP");
FlexContainer flexContainer = FlexContainer::New();
- flexContainer.SetProperty( FlexContainer::Property::FLEX_DIRECTION, FlexContainer::ROW_REVERSE );
+ flexContainer.SetProperty(FlexContainer::Property::FLEX_DIRECTION, FlexContainer::ROW_REVERSE);
- FlexContainer copy( flexContainer );
- DALI_TEST_CHECK( copy );
- DALI_TEST_CHECK( copy.GetProperty<int>( FlexContainer::Property::FLEX_DIRECTION ) == flexContainer.GetProperty<int>( FlexContainer::Property::FLEX_DIRECTION ) );
+ FlexContainer copy(flexContainer);
+ DALI_TEST_CHECK(copy);
+ DALI_TEST_CHECK(copy.GetProperty<int>(FlexContainer::Property::FLEX_DIRECTION) == flexContainer.GetProperty<int>(FlexContainer::Property::FLEX_DIRECTION));
END_TEST;
}
ToolkitTestApplication application;
FlexContainer flexContainer = FlexContainer::New();
- DALI_TEST_EQUALS( 1, flexContainer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- flexContainer.SetProperty( FlexContainer::Property::FLEX_DIRECTION, FlexContainer::ROW_REVERSE );
- DALI_TEST_CHECK( flexContainer.GetProperty<int>( FlexContainer::Property::FLEX_DIRECTION ) == FlexContainer::ROW_REVERSE );
+ DALI_TEST_EQUALS(1, flexContainer.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ flexContainer.SetProperty(FlexContainer::Property::FLEX_DIRECTION, FlexContainer::ROW_REVERSE);
+ DALI_TEST_CHECK(flexContainer.GetProperty<int>(FlexContainer::Property::FLEX_DIRECTION) == FlexContainer::ROW_REVERSE);
- FlexContainer moved = std::move( flexContainer );
- DALI_TEST_CHECK( moved );
- DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_CHECK( moved.GetProperty<int>( FlexContainer::Property::FLEX_DIRECTION ) == FlexContainer::ROW_REVERSE );
- DALI_TEST_CHECK( !flexContainer );
+ FlexContainer moved = std::move(flexContainer);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_CHECK(moved.GetProperty<int>(FlexContainer::Property::FLEX_DIRECTION) == FlexContainer::ROW_REVERSE);
+ DALI_TEST_CHECK(!flexContainer);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitFlexContainerAssingmentOperatorP");
FlexContainer flexContainer = FlexContainer::New();
- flexContainer.SetProperty( FlexContainer::Property::FLEX_DIRECTION, FlexContainer::ROW_REVERSE );
+ flexContainer.SetProperty(FlexContainer::Property::FLEX_DIRECTION, FlexContainer::ROW_REVERSE);
FlexContainer copy = flexContainer;
- DALI_TEST_CHECK( copy );
- DALI_TEST_CHECK( copy.GetProperty<int>( FlexContainer::Property::FLEX_DIRECTION ) == flexContainer.GetProperty<int>( FlexContainer::Property::FLEX_DIRECTION ) );
+ DALI_TEST_CHECK(copy);
+ DALI_TEST_CHECK(copy.GetProperty<int>(FlexContainer::Property::FLEX_DIRECTION) == flexContainer.GetProperty<int>(FlexContainer::Property::FLEX_DIRECTION));
END_TEST;
}
ToolkitTestApplication application;
FlexContainer flexContainer = FlexContainer::New();
- DALI_TEST_EQUALS( 1, flexContainer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- flexContainer.SetProperty( FlexContainer::Property::FLEX_DIRECTION, FlexContainer::ROW_REVERSE );
- DALI_TEST_CHECK( flexContainer.GetProperty<int>( FlexContainer::Property::FLEX_DIRECTION ) == FlexContainer::ROW_REVERSE );
+ DALI_TEST_EQUALS(1, flexContainer.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ flexContainer.SetProperty(FlexContainer::Property::FLEX_DIRECTION, FlexContainer::ROW_REVERSE);
+ DALI_TEST_CHECK(flexContainer.GetProperty<int>(FlexContainer::Property::FLEX_DIRECTION) == FlexContainer::ROW_REVERSE);
FlexContainer moved;
- moved = std::move( flexContainer );
- DALI_TEST_CHECK( moved );
- DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_CHECK( moved.GetProperty<int>( FlexContainer::Property::FLEX_DIRECTION ) == FlexContainer::ROW_REVERSE );
- DALI_TEST_CHECK( !flexContainer );
+ moved = std::move(flexContainer);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_CHECK(moved.GetProperty<int>(FlexContainer::Property::FLEX_DIRECTION) == FlexContainer::ROW_REVERSE);
+ DALI_TEST_CHECK(!flexContainer);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitFlexContainerGetPropertyP");
FlexContainer flexContainer = FlexContainer::New();
- DALI_TEST_CHECK( flexContainer );
+ DALI_TEST_CHECK(flexContainer);
// Check Property Indices are correct
- DALI_TEST_CHECK( flexContainer.GetPropertyIndex( PROPERTY_NAME_CONTENT_DIRECTION ) == FlexContainer::Property::CONTENT_DIRECTION );
- DALI_TEST_CHECK( flexContainer.GetPropertyIndex( PROPERTY_NAME_FLEX_DIRECTION ) == FlexContainer::Property::FLEX_DIRECTION );
- DALI_TEST_CHECK( flexContainer.GetPropertyIndex( PROPERTY_NAME_FLEX_WRAP ) == FlexContainer::Property::FLEX_WRAP );
- DALI_TEST_CHECK( flexContainer.GetPropertyIndex( PROPERTY_NAME_JUSTIFY_CONTENT ) == FlexContainer::Property::JUSTIFY_CONTENT );
- DALI_TEST_CHECK( flexContainer.GetPropertyIndex( PROPERTY_NAME_ALIGN_ITEMS ) == FlexContainer::Property::ALIGN_ITEMS );
- DALI_TEST_CHECK( flexContainer.GetPropertyIndex( PROPERTY_NAME_ALIGN_CONTENT ) == FlexContainer::Property::ALIGN_CONTENT );
+ DALI_TEST_CHECK(flexContainer.GetPropertyIndex(PROPERTY_NAME_CONTENT_DIRECTION) == FlexContainer::Property::CONTENT_DIRECTION);
+ DALI_TEST_CHECK(flexContainer.GetPropertyIndex(PROPERTY_NAME_FLEX_DIRECTION) == FlexContainer::Property::FLEX_DIRECTION);
+ DALI_TEST_CHECK(flexContainer.GetPropertyIndex(PROPERTY_NAME_FLEX_WRAP) == FlexContainer::Property::FLEX_WRAP);
+ DALI_TEST_CHECK(flexContainer.GetPropertyIndex(PROPERTY_NAME_JUSTIFY_CONTENT) == FlexContainer::Property::JUSTIFY_CONTENT);
+ DALI_TEST_CHECK(flexContainer.GetPropertyIndex(PROPERTY_NAME_ALIGN_ITEMS) == FlexContainer::Property::ALIGN_ITEMS);
+ DALI_TEST_CHECK(flexContainer.GetPropertyIndex(PROPERTY_NAME_ALIGN_CONTENT) == FlexContainer::Property::ALIGN_CONTENT);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitFlexContainerSetPropertyP");
FlexContainer flexContainer = FlexContainer::New();
- DALI_TEST_CHECK( flexContainer );
+ DALI_TEST_CHECK(flexContainer);
// Add flex container to the stage
- application.GetScene().Add( flexContainer );
+ application.GetScene().Add(flexContainer);
// Create two actors and add them to the container
Actor actor1 = Actor::New();
Actor actor2 = Actor::New();
- DALI_TEST_CHECK( actor1 );
- DALI_TEST_CHECK( actor2 );
+ DALI_TEST_CHECK(actor1);
+ DALI_TEST_CHECK(actor2);
flexContainer.Add(actor1);
flexContainer.Add(actor2);
// Check content direction property.
- flexContainer.SetProperty( FlexContainer::Property::CONTENT_DIRECTION, FlexContainer::RTL );
- DALI_TEST_EQUALS( (FlexContainer::ContentDirection)flexContainer.GetProperty<int>( FlexContainer::Property::CONTENT_DIRECTION ), FlexContainer::RTL, TEST_LOCATION );
+ flexContainer.SetProperty(FlexContainer::Property::CONTENT_DIRECTION, FlexContainer::RTL);
+ DALI_TEST_EQUALS((FlexContainer::ContentDirection)flexContainer.GetProperty<int>(FlexContainer::Property::CONTENT_DIRECTION), FlexContainer::RTL, TEST_LOCATION);
// Check flex direction property.
- flexContainer.SetProperty( FlexContainer::Property::FLEX_DIRECTION, FlexContainer::COLUMN_REVERSE );
- DALI_TEST_EQUALS( (FlexContainer::FlexDirection)flexContainer.GetProperty<int>( FlexContainer::Property::FLEX_DIRECTION ), FlexContainer::COLUMN_REVERSE, TEST_LOCATION );
+ flexContainer.SetProperty(FlexContainer::Property::FLEX_DIRECTION, FlexContainer::COLUMN_REVERSE);
+ DALI_TEST_EQUALS((FlexContainer::FlexDirection)flexContainer.GetProperty<int>(FlexContainer::Property::FLEX_DIRECTION), FlexContainer::COLUMN_REVERSE, TEST_LOCATION);
// Check flex wrap property.
- flexContainer.SetProperty( FlexContainer::Property::FLEX_WRAP, FlexContainer::WRAP );
- DALI_TEST_EQUALS( (FlexContainer::WrapType)flexContainer.GetProperty<int>( FlexContainer::Property::FLEX_WRAP ), FlexContainer::WRAP, TEST_LOCATION );
+ flexContainer.SetProperty(FlexContainer::Property::FLEX_WRAP, FlexContainer::WRAP);
+ DALI_TEST_EQUALS((FlexContainer::WrapType)flexContainer.GetProperty<int>(FlexContainer::Property::FLEX_WRAP), FlexContainer::WRAP, TEST_LOCATION);
// Check justify content property.
- flexContainer.SetProperty( FlexContainer::Property::JUSTIFY_CONTENT, FlexContainer::JUSTIFY_SPACE_BETWEEN );
- DALI_TEST_EQUALS( (FlexContainer::Justification)flexContainer.GetProperty<int>( FlexContainer::Property::JUSTIFY_CONTENT ), FlexContainer::JUSTIFY_SPACE_BETWEEN, TEST_LOCATION );
+ flexContainer.SetProperty(FlexContainer::Property::JUSTIFY_CONTENT, FlexContainer::JUSTIFY_SPACE_BETWEEN);
+ DALI_TEST_EQUALS((FlexContainer::Justification)flexContainer.GetProperty<int>(FlexContainer::Property::JUSTIFY_CONTENT), FlexContainer::JUSTIFY_SPACE_BETWEEN, TEST_LOCATION);
// Check align items property.
- flexContainer.SetProperty( FlexContainer::Property::ALIGN_ITEMS, FlexContainer::ALIGN_FLEX_START );
- DALI_TEST_EQUALS( (FlexContainer::Alignment)flexContainer.GetProperty<int>( FlexContainer::Property::ALIGN_ITEMS ), FlexContainer::ALIGN_FLEX_START, TEST_LOCATION );
+ flexContainer.SetProperty(FlexContainer::Property::ALIGN_ITEMS, FlexContainer::ALIGN_FLEX_START);
+ DALI_TEST_EQUALS((FlexContainer::Alignment)flexContainer.GetProperty<int>(FlexContainer::Property::ALIGN_ITEMS), FlexContainer::ALIGN_FLEX_START, TEST_LOCATION);
// Check align content property.
- flexContainer.SetProperty( FlexContainer::Property::ALIGN_CONTENT, FlexContainer::ALIGN_STRETCH );
- DALI_TEST_EQUALS( (FlexContainer::Alignment)flexContainer.GetProperty<int>( FlexContainer::Property::ALIGN_CONTENT ), FlexContainer::ALIGN_STRETCH, TEST_LOCATION );
+ flexContainer.SetProperty(FlexContainer::Property::ALIGN_CONTENT, FlexContainer::ALIGN_STRETCH);
+ DALI_TEST_EQUALS((FlexContainer::Alignment)flexContainer.GetProperty<int>(FlexContainer::Property::ALIGN_CONTENT), FlexContainer::ALIGN_STRETCH, TEST_LOCATION);
END_TEST;
}
-
int UtcDaliToolkitFlexContainerSetPropertyEnumP(void)
{
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitFlexContainerSetPropertyEnumP");
FlexContainer flexContainer = FlexContainer::New();
- DALI_TEST_CHECK( flexContainer );
+ DALI_TEST_CHECK(flexContainer);
// Add flex container to the stage
- application.GetScene().Add( flexContainer );
+ application.GetScene().Add(flexContainer);
// Create two actors and add them to the container
Actor actor1 = Actor::New();
Actor actor2 = Actor::New();
- DALI_TEST_CHECK( actor1 );
- DALI_TEST_CHECK( actor2 );
+ DALI_TEST_CHECK(actor1);
+ DALI_TEST_CHECK(actor2);
flexContainer.Add(actor1);
flexContainer.Add(actor2);
// Check content direction property.
- flexContainer.SetProperty( FlexContainer::Property::CONTENT_DIRECTION, "RTL" );
- DALI_TEST_EQUALS( (FlexContainer::ContentDirection)flexContainer.GetProperty<int>( FlexContainer::Property::CONTENT_DIRECTION ), FlexContainer::RTL, TEST_LOCATION );
+ flexContainer.SetProperty(FlexContainer::Property::CONTENT_DIRECTION, "RTL");
+ DALI_TEST_EQUALS((FlexContainer::ContentDirection)flexContainer.GetProperty<int>(FlexContainer::Property::CONTENT_DIRECTION), FlexContainer::RTL, TEST_LOCATION);
// Check flex direction property.
- flexContainer.SetProperty( FlexContainer::Property::FLEX_DIRECTION, "columnReverse" );
- DALI_TEST_EQUALS( (FlexContainer::FlexDirection)flexContainer.GetProperty<int>( FlexContainer::Property::FLEX_DIRECTION ), FlexContainer::COLUMN_REVERSE, TEST_LOCATION );
+ flexContainer.SetProperty(FlexContainer::Property::FLEX_DIRECTION, "columnReverse");
+ DALI_TEST_EQUALS((FlexContainer::FlexDirection)flexContainer.GetProperty<int>(FlexContainer::Property::FLEX_DIRECTION), FlexContainer::COLUMN_REVERSE, TEST_LOCATION);
// Check flex wrap property.
- flexContainer.SetProperty( FlexContainer::Property::FLEX_WRAP, "wrap" );
- DALI_TEST_EQUALS( (FlexContainer::WrapType)flexContainer.GetProperty<int>( FlexContainer::Property::FLEX_WRAP ), FlexContainer::WRAP, TEST_LOCATION );
+ flexContainer.SetProperty(FlexContainer::Property::FLEX_WRAP, "wrap");
+ DALI_TEST_EQUALS((FlexContainer::WrapType)flexContainer.GetProperty<int>(FlexContainer::Property::FLEX_WRAP), FlexContainer::WRAP, TEST_LOCATION);
// Check justify content property.
- flexContainer.SetProperty( FlexContainer::Property::JUSTIFY_CONTENT, "spaceBetween" );
- DALI_TEST_EQUALS( (FlexContainer::Justification)flexContainer.GetProperty<int>( FlexContainer::Property::JUSTIFY_CONTENT ), FlexContainer::JUSTIFY_SPACE_BETWEEN, TEST_LOCATION );
+ flexContainer.SetProperty(FlexContainer::Property::JUSTIFY_CONTENT, "spaceBetween");
+ DALI_TEST_EQUALS((FlexContainer::Justification)flexContainer.GetProperty<int>(FlexContainer::Property::JUSTIFY_CONTENT), FlexContainer::JUSTIFY_SPACE_BETWEEN, TEST_LOCATION);
// Check align items property.
- flexContainer.SetProperty( FlexContainer::Property::ALIGN_ITEMS, "flexStart" );
- DALI_TEST_EQUALS( (FlexContainer::Alignment)flexContainer.GetProperty<int>( FlexContainer::Property::ALIGN_ITEMS ), FlexContainer::ALIGN_FLEX_START, TEST_LOCATION );
+ flexContainer.SetProperty(FlexContainer::Property::ALIGN_ITEMS, "flexStart");
+ DALI_TEST_EQUALS((FlexContainer::Alignment)flexContainer.GetProperty<int>(FlexContainer::Property::ALIGN_ITEMS), FlexContainer::ALIGN_FLEX_START, TEST_LOCATION);
// Check align content property.
- flexContainer.SetProperty( FlexContainer::Property::ALIGN_CONTENT, "stretch" );
- DALI_TEST_EQUALS( (FlexContainer::Alignment)flexContainer.GetProperty<int>( FlexContainer::Property::ALIGN_CONTENT ), FlexContainer::ALIGN_STRETCH, TEST_LOCATION );
+ flexContainer.SetProperty(FlexContainer::Property::ALIGN_CONTENT, "stretch");
+ DALI_TEST_EQUALS((FlexContainer::Alignment)flexContainer.GetProperty<int>(FlexContainer::Property::ALIGN_CONTENT), FlexContainer::ALIGN_STRETCH, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitFlexContainerSetChildPropertyP");
FlexContainer flexContainer = FlexContainer::New();
- DALI_TEST_CHECK( flexContainer );
+ DALI_TEST_CHECK(flexContainer);
// Add flex container to the stage
- application.GetScene().Add( flexContainer );
+ application.GetScene().Add(flexContainer);
// Create an actor and add it to the container
Actor actor = Actor::New();
- DALI_TEST_CHECK( actor );
+ DALI_TEST_CHECK(actor);
flexContainer.Add(actor);
// Check flex child property.
- actor.SetProperty( FlexContainer::ChildProperty::FLEX, 2.0f );
- DALI_TEST_EQUALS( actor.GetProperty<float>( FlexContainer::ChildProperty::FLEX ), 2.0f, TEST_LOCATION );
- DALI_TEST_CHECK( actor.GetPropertyIndex( CHILD_PROPERTY_NAME_FLEX ) == FlexContainer::ChildProperty::FLEX );
+ actor.SetProperty(FlexContainer::ChildProperty::FLEX, 2.0f);
+ DALI_TEST_EQUALS(actor.GetProperty<float>(FlexContainer::ChildProperty::FLEX), 2.0f, TEST_LOCATION);
+ DALI_TEST_CHECK(actor.GetPropertyIndex(CHILD_PROPERTY_NAME_FLEX) == FlexContainer::ChildProperty::FLEX);
// Check align self child property.
- actor.SetProperty( FlexContainer::ChildProperty::ALIGN_SELF, FlexContainer::ALIGN_FLEX_END );
- DALI_TEST_EQUALS( (FlexContainer::Alignment)actor.GetProperty<int>( FlexContainer::ChildProperty::ALIGN_SELF ), FlexContainer::ALIGN_FLEX_END, TEST_LOCATION );
- DALI_TEST_CHECK( actor.GetPropertyIndex( CHILD_PROPERTY_NAME_ALIGN_SELF ) == FlexContainer::ChildProperty::ALIGN_SELF );
+ actor.SetProperty(FlexContainer::ChildProperty::ALIGN_SELF, FlexContainer::ALIGN_FLEX_END);
+ DALI_TEST_EQUALS((FlexContainer::Alignment)actor.GetProperty<int>(FlexContainer::ChildProperty::ALIGN_SELF), FlexContainer::ALIGN_FLEX_END, TEST_LOCATION);
+ DALI_TEST_CHECK(actor.GetPropertyIndex(CHILD_PROPERTY_NAME_ALIGN_SELF) == FlexContainer::ChildProperty::ALIGN_SELF);
// Check flex margin child property.
- actor.SetProperty( FlexContainer::ChildProperty::FLEX_MARGIN, Vector4( 10.0f, 10.0f, 10.0f, 10.0f ) );
- DALI_TEST_EQUALS( actor.GetProperty<Vector4>( FlexContainer::ChildProperty::FLEX_MARGIN ), Vector4( 10.0f, 10.0f, 10.0f, 10.0f ), TEST_LOCATION );
- DALI_TEST_CHECK( actor.GetPropertyIndex( CHILD_PROPERTY_NAME_FLEX_MARGIN ) == FlexContainer::ChildProperty::FLEX_MARGIN );
+ actor.SetProperty(FlexContainer::ChildProperty::FLEX_MARGIN, Vector4(10.0f, 10.0f, 10.0f, 10.0f));
+ DALI_TEST_EQUALS(actor.GetProperty<Vector4>(FlexContainer::ChildProperty::FLEX_MARGIN), Vector4(10.0f, 10.0f, 10.0f, 10.0f), TEST_LOCATION);
+ DALI_TEST_CHECK(actor.GetPropertyIndex(CHILD_PROPERTY_NAME_FLEX_MARGIN) == FlexContainer::ChildProperty::FLEX_MARGIN);
application.SendNotification();
application.Render();
END_TEST;
}
-
-
//Functor to test whether RelayoutSignal is emitted
class RelayoutSignalHandler : public Dali::ConnectionTracker
{
public:
-
- RelayoutSignalHandler( FlexContainer& actor )
- : mSignalVerified( false ),
- mActor( actor )
+ RelayoutSignalHandler(FlexContainer& actor)
+ : mSignalVerified(false),
+ mActor(actor)
{
}
// callback to be connected to RelayoutSignal
- void RelayoutCallback( Actor actor )
+ void RelayoutCallback(Actor actor)
{
- if( mActor == actor )
+ if(mActor == actor)
{
mSignalVerified = true;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitFlexContainerSetPropertyP");
FlexContainer flexContainer = FlexContainer::New();
- DALI_TEST_CHECK( flexContainer );
+ DALI_TEST_CHECK(flexContainer);
// Add flex container to the stage
- application.GetScene().Add( flexContainer );
+ application.GetScene().Add(flexContainer);
RelayoutSignalHandler relayoutSignal(flexContainer);
- flexContainer.OnRelayoutSignal().Connect(&relayoutSignal, &RelayoutSignalHandler::RelayoutCallback );
+ flexContainer.OnRelayoutSignal().Connect(&relayoutSignal, &RelayoutSignalHandler::RelayoutCallback);
// Create two actors and add them to the container
Actor actor1 = Actor::New();
Actor actor2 = Actor::New();
- DALI_TEST_CHECK( actor1 );
- DALI_TEST_CHECK( actor2 );
+ DALI_TEST_CHECK(actor1);
+ DALI_TEST_CHECK(actor2);
flexContainer.Add(actor1);
flexContainer.Add(actor2);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( relayoutSignal.mSignalVerified, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(relayoutSignal.mSignalVerified, true, TEST_LOCATION);
relayoutSignal.Reset();
- DALI_TEST_CHECK( actor1 );
- DALI_TEST_CHECK( actor2 );
+ DALI_TEST_CHECK(actor1);
+ DALI_TEST_CHECK(actor2);
flexContainer.Remove(actor1);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( relayoutSignal.mSignalVerified, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(relayoutSignal.mSignalVerified, true, TEST_LOCATION);
relayoutSignal.Reset();
flexContainer.Remove(actor2);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( relayoutSignal.mSignalVerified, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(relayoutSignal.mSignalVerified, true, TEST_LOCATION);
relayoutSignal.Reset();
END_TEST;
namespace
{
-
// Functors to test whether PreFocusChange signal is emitted when the keyboard focus is about to change
class PreFocusChangeCallback : public Dali::ConnectionTracker
{
tet_infoline("Verifying PreFocusChangeCallback()");
mSignalVerified = true;
- mDirection = direction;
- if( ! proposedActorToFocus )
+ mDirection = direction;
+ if(!proposedActorToFocus)
{
return mFirstFocusActor;
}
void Reset()
{
mSignalVerified = false;
- mDirection = Control::KeyboardFocus::LEFT;
+ mDirection = Control::KeyboardFocus::LEFT;
}
- bool& mSignalVerified;
- Actor mFirstFocusActor;
+ bool& mSignalVerified;
+ Actor mFirstFocusActor;
Control::KeyboardFocus::Direction mDirection;
};
}
mOriginalFocusedActor = originalFocusedActor;
- mCurrentFocusedActor = currentFocusedActor;
+ mCurrentFocusedActor = currentFocusedActor;
}
void Reset()
} // anonymous namespace
-
int UtcDaliToolkitFlexContainerMoveFocus(void)
{
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitFlexContainerSetPropertyP");
FlexContainer flexContainer = FlexContainer::New();
- DALI_TEST_CHECK( flexContainer );
+ DALI_TEST_CHECK(flexContainer);
- flexContainer.SetProperty( FlexContainer::Property::FLEX_DIRECTION, FlexContainer::ROW );
+ flexContainer.SetProperty(FlexContainer::Property::FLEX_DIRECTION, FlexContainer::ROW);
// Add flex container to the stage
- application.GetScene().Add( flexContainer );
+ application.GetScene().Add(flexContainer);
Size stageSize = application.GetScene().GetSize();
RelayoutSignalHandler relayoutSignal(flexContainer);
- flexContainer.OnRelayoutSignal().Connect(&relayoutSignal, &RelayoutSignalHandler::RelayoutCallback );
- flexContainer.SetProperty( Actor::Property::SIZE, stageSize );
+ flexContainer.OnRelayoutSignal().Connect(&relayoutSignal, &RelayoutSignalHandler::RelayoutCallback);
+ flexContainer.SetProperty(Actor::Property::SIZE, stageSize);
// Create two actors and add them to the container
Actor actor1 = Actor::New();
Actor actor2 = Actor::New();
- actor1.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true );
- actor2.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true );
- DALI_TEST_CHECK( actor1 );
- DALI_TEST_CHECK( actor2 );
+ actor1.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
+ actor2.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
+ DALI_TEST_CHECK(actor1);
+ DALI_TEST_CHECK(actor2);
flexContainer.Add(actor1);
flexContainer.Add(actor2);
KeyboardFocusManager manager = KeyboardFocusManager::Get();
DALI_TEST_CHECK(manager);
- bool preFocusChangeSignalVerified = false;
+ bool preFocusChangeSignalVerified = false;
PreFocusChangeCallback preFocusChangeCallback(preFocusChangeSignalVerified, actor1);
- manager.PreFocusChangeSignal().Connect( &preFocusChangeCallback, &PreFocusChangeCallback::Callback );
+ manager.PreFocusChangeSignal().Connect(&preFocusChangeCallback, &PreFocusChangeCallback::Callback);
- bool focusChangedSignalVerified = false;
+ bool focusChangedSignalVerified = false;
FocusChangedCallback focusChangedCallback(focusChangedSignalVerified);
- manager.FocusChangedSignal().Connect( &focusChangedCallback, &FocusChangedCallback::Callback );
+ manager.FocusChangedSignal().Connect(&focusChangedCallback, &FocusChangedCallback::Callback);
// Move the focus to the right
DALI_TEST_EQUALS(manager.MoveFocus(Control::KeyboardFocus::RIGHT), true, TEST_LOCATION);
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitFlexContainerRTLSupportP");
FlexContainer flexContainer = FlexContainer::New();
- DALI_TEST_CHECK( flexContainer );
+ DALI_TEST_CHECK(flexContainer);
Actor actor0 = Actor::New();
- application.GetScene().Add( actor0 );
- actor0.Add( flexContainer );
+ application.GetScene().Add(actor0);
+ actor0.Add(flexContainer);
// Create two actors and add them to the container
Actor actor1 = Actor::New();
Actor actor2 = Actor::New();
- DALI_TEST_CHECK( actor1 );
- DALI_TEST_CHECK( actor2 );
+ DALI_TEST_CHECK(actor1);
+ DALI_TEST_CHECK(actor2);
flexContainer.Add(actor1);
flexContainer.Add(actor2);
// Check flex direction property.
- flexContainer.SetProperty( FlexContainer::Property::FLEX_DIRECTION, "row" );
- DALI_TEST_EQUALS( (FlexContainer::FlexDirection)flexContainer.GetProperty<int>( FlexContainer::Property::FLEX_DIRECTION ), FlexContainer::ROW, TEST_LOCATION );
+ flexContainer.SetProperty(FlexContainer::Property::FLEX_DIRECTION, "row");
+ DALI_TEST_EQUALS((FlexContainer::FlexDirection)flexContainer.GetProperty<int>(FlexContainer::Property::FLEX_DIRECTION), FlexContainer::ROW, TEST_LOCATION);
// Check content direction property.
- DALI_TEST_EQUALS( (FlexContainer::ContentDirection)flexContainer.GetProperty<int>( FlexContainer::Property::CONTENT_DIRECTION ), FlexContainer::INHERIT, TEST_LOCATION );
+ DALI_TEST_EQUALS((FlexContainer::ContentDirection)flexContainer.GetProperty<int>(FlexContainer::Property::CONTENT_DIRECTION), FlexContainer::INHERIT, TEST_LOCATION);
- actor0.SetProperty( Dali::Actor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::RIGHT_TO_LEFT );
- DALI_TEST_EQUALS( (FlexContainer::ContentDirection)flexContainer.GetProperty<int>( FlexContainer::Property::CONTENT_DIRECTION ), FlexContainer::RTL, TEST_LOCATION );
+ actor0.SetProperty(Dali::Actor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::RIGHT_TO_LEFT);
+ DALI_TEST_EQUALS((FlexContainer::ContentDirection)flexContainer.GetProperty<int>(FlexContainer::Property::CONTENT_DIRECTION), FlexContainer::RTL, TEST_LOCATION);
- actor0.SetProperty( Dali::Actor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::LEFT_TO_RIGHT );
- DALI_TEST_EQUALS( (FlexContainer::ContentDirection)flexContainer.GetProperty<int>( FlexContainer::Property::CONTENT_DIRECTION ), FlexContainer::LTR, TEST_LOCATION );
+ actor0.SetProperty(Dali::Actor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::LEFT_TO_RIGHT);
+ DALI_TEST_EQUALS((FlexContainer::ContentDirection)flexContainer.GetProperty<int>(FlexContainer::Property::CONTENT_DIRECTION), FlexContainer::LTR, TEST_LOCATION);
- flexContainer.SetProperty( FlexContainer::Property::CONTENT_DIRECTION, "RTL" );
- DALI_TEST_EQUALS( (FlexContainer::ContentDirection)flexContainer.GetProperty<int>( FlexContainer::Property::CONTENT_DIRECTION ), FlexContainer::RTL, TEST_LOCATION );
+ flexContainer.SetProperty(FlexContainer::Property::CONTENT_DIRECTION, "RTL");
+ DALI_TEST_EQUALS((FlexContainer::ContentDirection)flexContainer.GetProperty<int>(FlexContainer::Property::CONTENT_DIRECTION), FlexContainer::RTL, TEST_LOCATION);
- flexContainer.SetProperty( FlexContainer::Property::CONTENT_DIRECTION, "LTR" );
- DALI_TEST_EQUALS( (FlexContainer::ContentDirection)flexContainer.GetProperty<int>( FlexContainer::Property::CONTENT_DIRECTION ), FlexContainer::LTR, TEST_LOCATION );
+ flexContainer.SetProperty(FlexContainer::Property::CONTENT_DIRECTION, "LTR");
+ DALI_TEST_EQUALS((FlexContainer::ContentDirection)flexContainer.GetProperty<int>(FlexContainer::Property::CONTENT_DIRECTION), FlexContainer::LTR, TEST_LOCATION);
- actor0.SetProperty( Dali::Actor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::RIGHT_TO_LEFT );
- DALI_TEST_EQUALS( (FlexContainer::ContentDirection)flexContainer.GetProperty<int>( FlexContainer::Property::CONTENT_DIRECTION ), FlexContainer::LTR, TEST_LOCATION );
+ actor0.SetProperty(Dali::Actor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::RIGHT_TO_LEFT);
+ DALI_TEST_EQUALS((FlexContainer::ContentDirection)flexContainer.GetProperty<int>(FlexContainer::Property::CONTENT_DIRECTION), FlexContainer::LTR, TEST_LOCATION);
- flexContainer.SetProperty( FlexContainer::Property::CONTENT_DIRECTION, "inherit" );
- DALI_TEST_EQUALS( (FlexContainer::ContentDirection)flexContainer.GetProperty<int>( FlexContainer::Property::CONTENT_DIRECTION ), FlexContainer::RTL, TEST_LOCATION );
+ flexContainer.SetProperty(FlexContainer::Property::CONTENT_DIRECTION, "inherit");
+ DALI_TEST_EQUALS((FlexContainer::ContentDirection)flexContainer.GetProperty<int>(FlexContainer::Property::CONTENT_DIRECTION), FlexContainer::RTL, TEST_LOCATION);
- actor0.SetProperty( Dali::Actor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::LEFT_TO_RIGHT );
- DALI_TEST_EQUALS( (FlexContainer::ContentDirection)flexContainer.GetProperty<int>( FlexContainer::Property::CONTENT_DIRECTION ), FlexContainer::LTR, TEST_LOCATION );
+ actor0.SetProperty(Dali::Actor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::LEFT_TO_RIGHT);
+ DALI_TEST_EQUALS((FlexContainer::ContentDirection)flexContainer.GetProperty<int>(FlexContainer::Property::CONTENT_DIRECTION), FlexContainer::LTR, TEST_LOCATION);
- flexContainer.SetProperty( FlexContainer::Property::CONTENT_DIRECTION, "inherit" );
- DALI_TEST_EQUALS( (FlexContainer::ContentDirection)flexContainer.GetProperty<int>( FlexContainer::Property::CONTENT_DIRECTION ), FlexContainer::LTR, TEST_LOCATION );
+ flexContainer.SetProperty(FlexContainer::Property::CONTENT_DIRECTION, "inherit");
+ DALI_TEST_EQUALS((FlexContainer::ContentDirection)flexContainer.GetProperty<int>(FlexContainer::Property::CONTENT_DIRECTION), FlexContainer::LTR, TEST_LOCATION);
- flexContainer.SetProperty( FlexContainer::Property::CONTENT_DIRECTION, "LTR" );
+ flexContainer.SetProperty(FlexContainer::Property::CONTENT_DIRECTION, "LTR");
application.SendNotification();
application.Render();
- flexContainer.SetProperty( FlexContainer::Property::CONTENT_DIRECTION, "RTL" );
+ flexContainer.SetProperty(FlexContainer::Property::CONTENT_DIRECTION, "RTL");
application.SendNotification();
application.Render();
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
#include <stdlib.h>
+#include <iostream>
+
#include <dali-toolkit-test-suite-utils.h>
+
#include <dali-toolkit/dali-toolkit.h>
-#include <dali/devel-api/actors/actor-devel.h>
#include <dali-toolkit/devel-api/layouting/flex-node.h>
+#include <dali/devel-api/actors/actor-devel.h>
using namespace Dali;
using namespace Toolkit;
namespace
{
+const Flex::SizeTuple ITEM_SIZE = Flex::SizeTuple{10.0f, 10.0f};
+const Flex::SizeTuple ITEM_SIZE_CALLBACK_TEST = Flex::SizeTuple{15.0f, 15.0f};
-const Flex::SizeTuple ITEM_SIZE = Flex::SizeTuple{ 10.0f, 10.0f };
-const Flex::SizeTuple ITEM_SIZE_CALLBACK_TEST = Flex::SizeTuple{ 15.0f, 15.0f };
-
-void MeasureChild( Actor child, float width, int measureModeWidth, float height, int measureModeHeight, Flex::SizeTuple *childSize)
+void MeasureChild(Actor child, float width, int measureModeWidth, float height, int measureModeHeight, Flex::SizeTuple* childSize)
{
*childSize = ITEM_SIZE;
- if (child.GetProperty< std::string >( Dali::Actor::Property::NAME ) == "callbackTest")
+ if(child.GetProperty<std::string>(Dali::Actor::Property::NAME) == "callbackTest")
{
*childSize = ITEM_SIZE_CALLBACK_TEST;
}
- tet_printf(" MeasureChild test callback executed (%f,%f)\n", childSize->width, childSize->height );
+ tet_printf(" MeasureChild test callback executed (%f,%f)\n", childSize->width, childSize->height);
}
-}
+} // namespace
int UtcDaliToolkitFlexNodeConstructorP(void)
{
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitFlexNodeNewP");
Flex::Node* flexNode = new Flex::Node();
- DALI_TEST_CHECK( flexNode );
+ DALI_TEST_CHECK(flexNode);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitFlexNodeAddChildWithMarginP");
Flex::Node* flexNode = new Flex::Node();
- DALI_TEST_CHECK( flexNode );
+ DALI_TEST_CHECK(flexNode);
// Position elements as a Row
flexNode->SetFlexDirection(Flex::FlexDirection::ROW);
// Create two actors and add them to the parent flex node
Actor actor = Actor::New();
- DALI_TEST_CHECK( actor );
+ DALI_TEST_CHECK(actor);
- Extents margin( 5,5,5,5);
+ Extents margin(5, 5, 5, 5);
flexNode->AddChild(actor, margin, &MeasureChild, 0);
- DALI_TEST_EQUALS( (int)flexNode->GetFlexDirection(), (int)Flex::FlexDirection::ROW, TEST_LOCATION );
+ DALI_TEST_EQUALS((int)flexNode->GetFlexDirection(), (int)Flex::FlexDirection::ROW, TEST_LOCATION);
flexNode->CalculateLayout(480, 800, false);
tet_printf("Actor frame(left:%f,top:%f,right:%f,bottom:%f)\n", actorFrame.x, actorFrame.y, actorFrame.z, actorFrame.w);
- DALI_TEST_EQUALS( actorFrame, Vector4( 5.0f, 5.0f, ITEM_SIZE.width+5, ITEM_SIZE.height+5 ), TEST_LOCATION );
+ DALI_TEST_EQUALS(actorFrame, Vector4(5.0f, 5.0f, ITEM_SIZE.width + 5, ITEM_SIZE.height + 5), TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitFlexNodeAddChildrenRowP");
Flex::Node* flexNode = new Flex::Node();
- DALI_TEST_CHECK( flexNode );
+ DALI_TEST_CHECK(flexNode);
// Position elements as a Row
flexNode->SetFlexDirection(Flex::FlexDirection::ROW);
// Create two actors and add them to the parent flex node
Actor actor1 = Actor::New();
Actor actor2 = Actor::New();
- DALI_TEST_CHECK( actor1 );
- DALI_TEST_CHECK( actor2 );
+ DALI_TEST_CHECK(actor1);
+ DALI_TEST_CHECK(actor2);
- flexNode->AddChild(actor1, Extents(0,0,0,0), &MeasureChild, 0);
- flexNode->AddChild(actor2, Extents(0,0,0,0), &MeasureChild, 1);
+ flexNode->AddChild(actor1, Extents(0, 0, 0, 0), &MeasureChild, 0);
+ flexNode->AddChild(actor2, Extents(0, 0, 0, 0), &MeasureChild, 1);
- DALI_TEST_EQUALS( (int)flexNode->GetFlexDirection(), (int)Flex::FlexDirection::ROW, TEST_LOCATION );
+ DALI_TEST_EQUALS((int)flexNode->GetFlexDirection(), (int)Flex::FlexDirection::ROW, TEST_LOCATION);
flexNode->CalculateLayout(480, 800, false);
tet_printf("Actor 1 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor1Frame.x, actor1Frame.y, actor1Frame.z, actor1Frame.w);
tet_printf("Actor 2 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor2Frame.x, actor2Frame.y, actor2Frame.z, actor2Frame.w);
- DALI_TEST_EQUALS( actor1Frame, Vector4( 0.0f, 0.0f, ITEM_SIZE.width, ITEM_SIZE.height ), TEST_LOCATION );
- DALI_TEST_EQUALS( actor2Frame, Vector4( ITEM_SIZE.width, 0.0f, ITEM_SIZE.width * 2, ITEM_SIZE.height ), TEST_LOCATION );
+ DALI_TEST_EQUALS(actor1Frame, Vector4(0.0f, 0.0f, ITEM_SIZE.width, ITEM_SIZE.height), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor2Frame, Vector4(ITEM_SIZE.width, 0.0f, ITEM_SIZE.width * 2, ITEM_SIZE.height), TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline("UtcDaliToolkitFlexNodeAddChildrenColumnP");
Flex::Node* flexNode = new Flex::Node();
- DALI_TEST_CHECK( flexNode );
+ DALI_TEST_CHECK(flexNode);
// Position elements in a Column
flexNode->SetFlexDirection(Flex::FlexDirection::COLUMN);
// Create two actors and add them to the parent flex node
Actor actor1 = Actor::New();
Actor actor2 = Actor::New();
- DALI_TEST_CHECK( actor1 );
- DALI_TEST_CHECK( actor2 );
+ DALI_TEST_CHECK(actor1);
+ DALI_TEST_CHECK(actor2);
- flexNode->AddChild(actor1, Extents(0,0,0,0), &MeasureChild, 0);
- flexNode->AddChild(actor2, Extents(0,0,0,0), &MeasureChild, 1);
+ flexNode->AddChild(actor1, Extents(0, 0, 0, 0), &MeasureChild, 0);
+ flexNode->AddChild(actor2, Extents(0, 0, 0, 0), &MeasureChild, 1);
flexNode->CalculateLayout(480, 800, false);
- Vector4 root = flexNode->GetNodeFrame(-1); // -1 is the root
- Vector4 actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
- Vector4 actor2Frame = flexNode->GetNodeFrame(1); // 1 is second child
+ Vector4 root = flexNode->GetNodeFrame(-1); // -1 is the root
+ Vector4 actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
+ Vector4 actor2Frame = flexNode->GetNodeFrame(1); // 1 is second child
tet_printf("Root frame(left:%f,top:%f,right:%f,bottom:%f)\n", root.x, root.y, root.z, root.w);
tet_printf("Actor 1 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor1Frame.x, actor1Frame.y, actor1Frame.z, actor1Frame.w);
tet_printf("Actor 2 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor2Frame.x, actor2Frame.y, actor2Frame.z, actor2Frame.w);
- DALI_TEST_EQUALS( actor1Frame, Vector4( 0.0f, 0.0f, ITEM_SIZE.width, ITEM_SIZE.height ), TEST_LOCATION );
- DALI_TEST_EQUALS( actor2Frame, Vector4( 0.0f, ITEM_SIZE.height, ITEM_SIZE.width, ITEM_SIZE.height *2 ), TEST_LOCATION );
+ DALI_TEST_EQUALS(actor1Frame, Vector4(0.0f, 0.0f, ITEM_SIZE.width, ITEM_SIZE.height), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor2Frame, Vector4(0.0f, ITEM_SIZE.height, ITEM_SIZE.width, ITEM_SIZE.height * 2), TEST_LOCATION);
END_TEST;
}
-
int UtcDaliToolkitFlexNodeAddChildrenColumnJustify(void)
{
ToolkitTestApplication application;
tet_infoline("UtcDaliToolkitFlexNodeAddChildrenColumnJustify");
Flex::Node* flexNode = new Flex::Node();
- DALI_TEST_CHECK( flexNode );
+ DALI_TEST_CHECK(flexNode);
// Position elements in a Column
flexNode->SetFlexDirection(Flex::FlexDirection::COLUMN);
tet_infoline("Justify to the Start, align to start, third item should be displayed at the top and the end");
flexNode->SetFlexJustification(Flex::Justification::FLEX_START);
- flexNode->SetFlexItemsAlignment( Flex::Alignment::FLEX_START );
+ flexNode->SetFlexItemsAlignment(Flex::Alignment::FLEX_START);
// Create three actors and add them to the parent flex node
Actor actor1 = Actor::New();
Actor actor2 = Actor::New();
Actor actor3 = Actor::New();
- DALI_TEST_CHECK( actor1 );
- DALI_TEST_CHECK( actor2 );
- DALI_TEST_CHECK( actor3 );
+ DALI_TEST_CHECK(actor1);
+ DALI_TEST_CHECK(actor2);
+ DALI_TEST_CHECK(actor3);
- DALI_TEST_EQUALS( (int)flexNode->GetFlexJustification(), (int)Flex::Justification::FLEX_START, TEST_LOCATION );
- DALI_TEST_EQUALS( (int)flexNode->GetFlexItemsAlignment(), (int)Flex::Alignment::FLEX_START, TEST_LOCATION );
+ DALI_TEST_EQUALS((int)flexNode->GetFlexJustification(), (int)Flex::Justification::FLEX_START, TEST_LOCATION);
+ DALI_TEST_EQUALS((int)flexNode->GetFlexItemsAlignment(), (int)Flex::Alignment::FLEX_START, TEST_LOCATION);
- flexNode->AddChild(actor1, Extents(0,0,0,0), &MeasureChild, 0);
- flexNode->AddChild(actor2, Extents(0,0,0,0), &MeasureChild, 1);
- Flex::Node* actor3node = flexNode->AddChild(actor3, Extents(0,0,0,0), &MeasureChild, 2);
- actor3node->SetFlexAlignmentSelf( Flex::Alignment::FLEX_END );
+ flexNode->AddChild(actor1, Extents(0, 0, 0, 0), &MeasureChild, 0);
+ flexNode->AddChild(actor2, Extents(0, 0, 0, 0), &MeasureChild, 1);
+ Flex::Node* actor3node = flexNode->AddChild(actor3, Extents(0, 0, 0, 0), &MeasureChild, 2);
+ actor3node->SetFlexAlignmentSelf(Flex::Alignment::FLEX_END);
flexNode->CalculateLayout(480, 800, false);
- Vector4 root = flexNode->GetNodeFrame(-1); // -1 is the root
- Vector4 actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
- Vector4 actor2Frame = flexNode->GetNodeFrame(1); // 1 is second child
- Vector4 actor3Frame = flexNode->GetNodeFrame(2); // 2 is third child
+ Vector4 root = flexNode->GetNodeFrame(-1); // -1 is the root
+ Vector4 actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
+ Vector4 actor2Frame = flexNode->GetNodeFrame(1); // 1 is second child
+ Vector4 actor3Frame = flexNode->GetNodeFrame(2); // 2 is third child
tet_printf("Root frame(left:%f,top:%f,right:%f,bottom:%f)\n", root.x, root.y, root.z, root.w);
---------
*/
- DALI_TEST_EQUALS( actor1Frame, Vector4( 0.0f, 0.0f, ITEM_SIZE.width, ITEM_SIZE.height ), TEST_LOCATION );
- DALI_TEST_EQUALS( actor2Frame, Vector4( 0.0f, ITEM_SIZE.height, ITEM_SIZE.width, ITEM_SIZE.height *2 ), TEST_LOCATION );
- DALI_TEST_EQUALS( actor3Frame, Vector4( root.z - ITEM_SIZE.width, ITEM_SIZE.height *2, root.z, ITEM_SIZE.height *3 ), TEST_LOCATION );
+ DALI_TEST_EQUALS(actor1Frame, Vector4(0.0f, 0.0f, ITEM_SIZE.width, ITEM_SIZE.height), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor2Frame, Vector4(0.0f, ITEM_SIZE.height, ITEM_SIZE.width, ITEM_SIZE.height * 2), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor3Frame, Vector4(root.z - ITEM_SIZE.width, ITEM_SIZE.height * 2, root.z, ITEM_SIZE.height * 3), TEST_LOCATION);
tet_infoline(" Justify to the End, items should now be displayed at the bottom, third item should now be displayed at the end");
- flexNode->SetFlexJustification( Flex::Justification::FLEX_END );
- flexNode->SetFlexItemsAlignment( Flex::Alignment::FLEX_START );
+ flexNode->SetFlexJustification(Flex::Justification::FLEX_END);
+ flexNode->SetFlexItemsAlignment(Flex::Alignment::FLEX_START);
// Recalulate layout
flexNode->CalculateLayout(480, 800, false);
- root = flexNode->GetNodeFrame(-1); // -1 is the root
- actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
- actor2Frame = flexNode->GetNodeFrame(1); // 1 is second child
- actor3Frame = flexNode->GetNodeFrame(2); // 2 is third child
+ root = flexNode->GetNodeFrame(-1); // -1 is the root
+ actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
+ actor2Frame = flexNode->GetNodeFrame(1); // 1 is second child
+ actor3Frame = flexNode->GetNodeFrame(2); // 2 is third child
tet_printf("Root frame(left:%f,top:%f,right:%f,bottom:%f)\n", root.x, root.y, root.z, root.w);
---------
*/
- DALI_TEST_EQUALS( actor1Frame, Vector4( 0.0f, root.w - (ITEM_SIZE.height*3), ITEM_SIZE.width, root.w - (ITEM_SIZE.height*2) ), TEST_LOCATION );
- DALI_TEST_EQUALS( actor2Frame, Vector4( 0.0f, root.w - (ITEM_SIZE.height*2), ITEM_SIZE.width, root.w - ITEM_SIZE.height ), TEST_LOCATION );
- DALI_TEST_EQUALS( actor3Frame, Vector4( root.z - ITEM_SIZE.width, root.w - ITEM_SIZE.height, root.z, root.w ), TEST_LOCATION );
+ DALI_TEST_EQUALS(actor1Frame, Vector4(0.0f, root.w - (ITEM_SIZE.height * 3), ITEM_SIZE.width, root.w - (ITEM_SIZE.height * 2)), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor2Frame, Vector4(0.0f, root.w - (ITEM_SIZE.height * 2), ITEM_SIZE.width, root.w - ITEM_SIZE.height), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor3Frame, Vector4(root.z - ITEM_SIZE.width, root.w - ITEM_SIZE.height, root.z, root.w), TEST_LOCATION);
tet_infoline(" Align to End, items should now be displayed at the bottom and the end");
- flexNode->SetFlexJustification( Flex::Justification::FLEX_END );
- flexNode->SetFlexItemsAlignment( Flex::Alignment::FLEX_END );
+ flexNode->SetFlexJustification(Flex::Justification::FLEX_END);
+ flexNode->SetFlexItemsAlignment(Flex::Alignment::FLEX_END);
// Recalulate layout
flexNode->CalculateLayout(480, 800, false);
- root = flexNode->GetNodeFrame(-1); // -1 is the root
- actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
- actor2Frame = flexNode->GetNodeFrame(1); // 1 is second child
- actor3Frame = flexNode->GetNodeFrame(2); // 2 is third child
+ root = flexNode->GetNodeFrame(-1); // -1 is the root
+ actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
+ actor2Frame = flexNode->GetNodeFrame(1); // 1 is second child
+ actor3Frame = flexNode->GetNodeFrame(2); // 2 is third child
tet_printf("Actor 1 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor1Frame.x, actor1Frame.y, actor1Frame.z, actor1Frame.w);
tet_printf("Actor 2 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor2Frame.x, actor2Frame.y, actor2Frame.z, actor2Frame.w);
---------
*/
- DALI_TEST_EQUALS( actor1Frame, Vector4( root.z - ITEM_SIZE.width, root.w - (ITEM_SIZE.height*3), root.z, root.w - (ITEM_SIZE.height*2) ), TEST_LOCATION );
- DALI_TEST_EQUALS( actor2Frame, Vector4( root.z - ITEM_SIZE.width, root.w - (ITEM_SIZE.height*2), root.z, root.w - ITEM_SIZE.height ), TEST_LOCATION );
- DALI_TEST_EQUALS( actor3Frame, Vector4( root.z - ITEM_SIZE.width, root.w - ITEM_SIZE.height, root.z, root.w ), TEST_LOCATION );
+ DALI_TEST_EQUALS(actor1Frame, Vector4(root.z - ITEM_SIZE.width, root.w - (ITEM_SIZE.height * 3), root.z, root.w - (ITEM_SIZE.height * 2)), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor2Frame, Vector4(root.z - ITEM_SIZE.width, root.w - (ITEM_SIZE.height * 2), root.z, root.w - ITEM_SIZE.height), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor3Frame, Vector4(root.z - ITEM_SIZE.width, root.w - ITEM_SIZE.height, root.z, root.w), TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitFlexNodeSizingP");
Flex::Node* flexNode = new Flex::Node();
- DALI_TEST_CHECK( flexNode );
+ DALI_TEST_CHECK(flexNode);
// Create two actors and add them to the parent flex node
Actor actor1 = Actor::New();
Actor actor2 = Actor::New();
- DALI_TEST_CHECK( actor1 );
- DALI_TEST_CHECK( actor2 );
+ DALI_TEST_CHECK(actor1);
+ DALI_TEST_CHECK(actor2);
- flexNode->AddChild(actor1, Extents(0,0,0,0), &MeasureChild, 0);
- flexNode->AddChild(actor2, Extents(0,0,0,0), &MeasureChild, 1);
+ flexNode->AddChild(actor1, Extents(0, 0, 0, 0), &MeasureChild, 0);
+ flexNode->AddChild(actor2, Extents(0, 0, 0, 0), &MeasureChild, 1);
flexNode->CalculateLayout(480, 800, false);
- DALI_TEST_EQUALS( flexNode->GetFlexWidth(), 480.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( flexNode->GetFlexHeight(), 800.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(flexNode->GetFlexWidth(), 480.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(flexNode->GetFlexHeight(), 800.0f, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline("UtcDaliToolkitFlexNodeWrapModeP");
Flex::Node* flexNode = new Flex::Node();
- DALI_TEST_CHECK( flexNode );
+ DALI_TEST_CHECK(flexNode);
// Position elements in a Column
- flexNode->SetFlexDirection( Flex::FlexDirection::ROW );
- flexNode->SetFlexAlignment( Flex::Alignment::FLEX_START );
- flexNode->SetFlexWrap( Flex::WrapType::NO_WRAP );
+ flexNode->SetFlexDirection(Flex::FlexDirection::ROW);
+ flexNode->SetFlexAlignment(Flex::Alignment::FLEX_START);
+ flexNode->SetFlexWrap(Flex::WrapType::NO_WRAP);
// Create two actors and add them to the parent flex node
Actor actor1 = Actor::New();
Actor actor3 = Actor::New();
Actor actor4 = Actor::New();
- DALI_TEST_EQUALS( (int)flexNode->GetFlexJustification(), (int)Flex::Justification::FLEX_START, TEST_LOCATION );
- DALI_TEST_EQUALS( (int)flexNode->GetFlexItemsAlignment(), (int)Flex::Alignment::FLEX_START, TEST_LOCATION );
- DALI_TEST_EQUALS( (int)flexNode->GetFlexAlignment(), (int)Flex::Alignment::FLEX_START, TEST_LOCATION );
- DALI_TEST_EQUALS( (int)flexNode->GetFlexWrap(), (int)Flex::WrapType::NO_WRAP, TEST_LOCATION );
+ DALI_TEST_EQUALS((int)flexNode->GetFlexJustification(), (int)Flex::Justification::FLEX_START, TEST_LOCATION);
+ DALI_TEST_EQUALS((int)flexNode->GetFlexItemsAlignment(), (int)Flex::Alignment::FLEX_START, TEST_LOCATION);
+ DALI_TEST_EQUALS((int)flexNode->GetFlexAlignment(), (int)Flex::Alignment::FLEX_START, TEST_LOCATION);
+ DALI_TEST_EQUALS((int)flexNode->GetFlexWrap(), (int)Flex::WrapType::NO_WRAP, TEST_LOCATION);
- flexNode->AddChild( actor1, Extents(0,0,0,0), &MeasureChild, 0 );
- flexNode->AddChild( actor2, Extents(0,0,0,0), &MeasureChild, 1 );
- flexNode->AddChild( actor2, Extents(0,0,0,0), &MeasureChild, 2 );
- flexNode->AddChild( actor2, Extents(0,0,0,0), &MeasureChild, 3 );
+ flexNode->AddChild(actor1, Extents(0, 0, 0, 0), &MeasureChild, 0);
+ flexNode->AddChild(actor2, Extents(0, 0, 0, 0), &MeasureChild, 1);
+ flexNode->AddChild(actor2, Extents(0, 0, 0, 0), &MeasureChild, 2);
+ flexNode->AddChild(actor2, Extents(0, 0, 0, 0), &MeasureChild, 3);
flexNode->CalculateLayout(30, 800, false);
- Vector4 root = flexNode->GetNodeFrame(-1); // -1 is the root
- Vector4 actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
- Vector4 actor2Frame = flexNode->GetNodeFrame(1); // 1 is second child
- Vector4 actor3Frame = flexNode->GetNodeFrame(2); // 2 is first child
- Vector4 actor4Frame = flexNode->GetNodeFrame(3); // 3 is second child
+ Vector4 root = flexNode->GetNodeFrame(-1); // -1 is the root
+ Vector4 actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
+ Vector4 actor2Frame = flexNode->GetNodeFrame(1); // 1 is second child
+ Vector4 actor3Frame = flexNode->GetNodeFrame(2); // 2 is first child
+ Vector4 actor4Frame = flexNode->GetNodeFrame(3); // 3 is second child
tet_printf("Root frame(left:%f,top:%f,right:%f,bottom:%f)\n", root.x, root.y, root.z, root.w);
tet_printf("Actor 1 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor1Frame.x, actor1Frame.y, actor1Frame.z, actor1Frame.w);
-------
*/
- DALI_TEST_EQUALS( actor1Frame, Vector4( 0.0f, 0.0f, ITEM_SIZE.width, ITEM_SIZE.height ), TEST_LOCATION );
- DALI_TEST_EQUALS( actor2Frame, Vector4( ITEM_SIZE.width, 0.0f, ITEM_SIZE.width*2, ITEM_SIZE.height ), TEST_LOCATION );
- DALI_TEST_EQUALS( actor3Frame, Vector4( ITEM_SIZE.width*2, 0.0f, ITEM_SIZE.width*3, ITEM_SIZE.height ), TEST_LOCATION );
- DALI_TEST_EQUALS( actor4Frame, Vector4( ITEM_SIZE.width*3, 0.0f, ITEM_SIZE.width*4, ITEM_SIZE.height ), TEST_LOCATION );
+ DALI_TEST_EQUALS(actor1Frame, Vector4(0.0f, 0.0f, ITEM_SIZE.width, ITEM_SIZE.height), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor2Frame, Vector4(ITEM_SIZE.width, 0.0f, ITEM_SIZE.width * 2, ITEM_SIZE.height), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor3Frame, Vector4(ITEM_SIZE.width * 2, 0.0f, ITEM_SIZE.width * 3, ITEM_SIZE.height), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor4Frame, Vector4(ITEM_SIZE.width * 3, 0.0f, ITEM_SIZE.width * 4, ITEM_SIZE.height), TEST_LOCATION);
- flexNode->SetFlexWrap( Flex::WrapType::WRAP );
+ flexNode->SetFlexWrap(Flex::WrapType::WRAP);
- flexNode->CalculateLayout( 30, 800, false );
+ flexNode->CalculateLayout(30, 800, false);
root = flexNode->GetNodeFrame(-1); // -1 is the root
- DALI_TEST_EQUALS( (int)flexNode->GetFlexWrap(), (int)Flex::WrapType::WRAP, TEST_LOCATION );
+ DALI_TEST_EQUALS((int)flexNode->GetFlexWrap(), (int)Flex::WrapType::WRAP, TEST_LOCATION);
tet_printf("Root frame(left:%f,top:%f,right:%f,bottom:%f)\n", root.x, root.y, root.z, root.w);
actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
-------
*/
- DALI_TEST_EQUALS( actor1Frame, Vector4( 0.0f, 0.0f, ITEM_SIZE.width, ITEM_SIZE.height ), TEST_LOCATION );
- DALI_TEST_EQUALS( actor2Frame, Vector4( ITEM_SIZE.width, 0.0f, ITEM_SIZE.width*2, ITEM_SIZE.height ), TEST_LOCATION );
- DALI_TEST_EQUALS( actor3Frame, Vector4( ITEM_SIZE.width*2, 0.0f, ITEM_SIZE.width*3, ITEM_SIZE.height ), TEST_LOCATION );
- DALI_TEST_EQUALS( actor4Frame, Vector4( 0.0,ITEM_SIZE.height, ITEM_SIZE.width, ITEM_SIZE.height*2 ), TEST_LOCATION );
-
+ DALI_TEST_EQUALS(actor1Frame, Vector4(0.0f, 0.0f, ITEM_SIZE.width, ITEM_SIZE.height), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor2Frame, Vector4(ITEM_SIZE.width, 0.0f, ITEM_SIZE.width * 2, ITEM_SIZE.height), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor3Frame, Vector4(ITEM_SIZE.width * 2, 0.0f, ITEM_SIZE.width * 3, ITEM_SIZE.height), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor4Frame, Vector4(0.0, ITEM_SIZE.height, ITEM_SIZE.width, ITEM_SIZE.height * 2), TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitFlexNodeRemoveChildP");
Flex::Node* flexNode = new Flex::Node();
- DALI_TEST_CHECK( flexNode );
+ DALI_TEST_CHECK(flexNode);
// Create two actors and add them to the parent flex node
Actor actor1 = Actor::New();
Actor actor2 = Actor::New();
- actor1.SetProperty( Dali::Actor::Property::NAME,"Actor1");
- actor2.SetProperty( Dali::Actor::Property::NAME,"Actor2");
+ actor1.SetProperty(Dali::Actor::Property::NAME, "Actor1");
+ actor2.SetProperty(Dali::Actor::Property::NAME, "Actor2");
- DALI_TEST_CHECK( actor1 );
- DALI_TEST_CHECK( actor2 );
+ DALI_TEST_CHECK(actor1);
+ DALI_TEST_CHECK(actor2);
- flexNode->AddChild(actor1, Extents(0,0,0,0), &MeasureChild, 0);
- flexNode->AddChild(actor2, Extents(0,0,0,0), &MeasureChild, 1);
+ flexNode->AddChild(actor1, Extents(0, 0, 0, 0), &MeasureChild, 0);
+ flexNode->AddChild(actor2, Extents(0, 0, 0, 0), &MeasureChild, 1);
flexNode->CalculateLayout(480, 800, false);
tet_printf("Actor 1 frame(%f,%f,%f,%f)\n", actor1Frame.x, actor1Frame.y, actor1Frame.z, actor1Frame.w);
tet_printf("Actor 2 frame(%f,%f,%f,%f)\n", actor2Frame.x, actor2Frame.y, actor2Frame.z, actor2Frame.w);
- DALI_TEST_EQUALS( actor2Frame, Vector4( 0.0f, ITEM_SIZE.width, ITEM_SIZE.width, ITEM_SIZE.height*2 ), TEST_LOCATION );
+ DALI_TEST_EQUALS(actor2Frame, Vector4(0.0f, ITEM_SIZE.width, ITEM_SIZE.width, ITEM_SIZE.height * 2), TEST_LOCATION);
flexNode->RemoveChild(actor1);
tet_printf("Actor 1 frame(%f,%f,%f,%f)\n", actor1Frame.x, actor1Frame.y, actor1Frame.z, actor1Frame.w);
tet_printf("Actor 2 frame(%f,%f,%f,%f)\n", actor2Frame.x, actor2Frame.y, actor2Frame.z, actor2Frame.w);
- DALI_TEST_EQUALS( actor2Frame, Vector4( 0.0f, 0.0f, ITEM_SIZE.width, ITEM_SIZE.height ), TEST_LOCATION );
+ DALI_TEST_EQUALS(actor2Frame, Vector4(0.0f, 0.0f, ITEM_SIZE.width, ITEM_SIZE.height), TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitFlexNodeRemoveAllChildrenP");
Flex::Node* flexNode = new Flex::Node();
- DALI_TEST_CHECK( flexNode );
+ DALI_TEST_CHECK(flexNode);
// Create two actors and add them to the parent flex node
Actor actor1 = Actor::New();
Actor actor2 = Actor::New();
- actor1.SetProperty( Dali::Actor::Property::NAME,"Actor1");
- actor2.SetProperty( Dali::Actor::Property::NAME,"Actor2");
+ actor1.SetProperty(Dali::Actor::Property::NAME, "Actor1");
+ actor2.SetProperty(Dali::Actor::Property::NAME, "Actor2");
- DALI_TEST_CHECK( actor1 );
- DALI_TEST_CHECK( actor2 );
+ DALI_TEST_CHECK(actor1);
+ DALI_TEST_CHECK(actor2);
- flexNode->AddChild(actor1, Extents(0,0,0,0), &MeasureChild, 0);
- flexNode->AddChild(actor2, Extents(0,0,0,0), &MeasureChild, 1);
+ flexNode->AddChild(actor1, Extents(0, 0, 0, 0), &MeasureChild, 0);
+ flexNode->AddChild(actor2, Extents(0, 0, 0, 0), &MeasureChild, 1);
flexNode->CalculateLayout(480, 800, false);
tet_printf("Actor 1 frame(%f,%f,%f,%f)\n", actor1FrameRemoved.x, actor1FrameRemoved.y, actor1FrameRemoved.z, actor1FrameRemoved.w);
tet_printf("Actor 2 frame(%f,%f,%f,%f)\n", actor2FrameRemoved.x, actor2FrameRemoved.y, actor2FrameRemoved.z, actor2FrameRemoved.w);
- DALI_TEST_NOT_EQUALS( actor1Frame, actor1FrameRemoved, 0.1, TEST_LOCATION );
- DALI_TEST_NOT_EQUALS( actor2Frame, actor2FrameRemoved, 0.1, TEST_LOCATION );
+ DALI_TEST_NOT_EQUALS(actor1Frame, actor1FrameRemoved, 0.1, TEST_LOCATION);
+ DALI_TEST_NOT_EQUALS(actor2Frame, actor2FrameRemoved, 0.1, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitFlexNodePaddingMarginP");
Flex::Node* flexNode = new Flex::Node();
- DALI_TEST_CHECK( flexNode );
- flexNode->SetFlexDirection( Flex::FlexDirection::ROW );
+ DALI_TEST_CHECK(flexNode);
+ flexNode->SetFlexDirection(Flex::FlexDirection::ROW);
// Create two actors and add them to the parent flex node
Actor actor1 = Actor::New();
Actor actor2 = Actor::New();
- DALI_TEST_CHECK( actor1 );
- DALI_TEST_CHECK( actor2 );
+ DALI_TEST_CHECK(actor1);
+ DALI_TEST_CHECK(actor2);
- flexNode->AddChild(actor1, Extents(0,0,0,0), &MeasureChild, 0);
- flexNode->AddChild(actor2, Extents(0,0,0,0), &MeasureChild, 1);
+ flexNode->AddChild(actor1, Extents(0, 0, 0, 0), &MeasureChild, 0);
+ flexNode->AddChild(actor2, Extents(0, 0, 0, 0), &MeasureChild, 1);
- Extents padding( 5,5,5,5);
- Extents margin( 5,5,5,5);
+ Extents padding(5, 5, 5, 5);
+ Extents margin(5, 5, 5, 5);
- flexNode->SetPadding( padding );
- flexNode->SetMargin( margin );
+ flexNode->SetPadding(padding);
+ flexNode->SetMargin(margin);
flexNode->CalculateLayout(480, 800, false);
|ppppp|
-------
*/
- DALI_TEST_EQUALS( actor1Frame, Vector4( 5.0f, 5.0f, ITEM_SIZE.width +5 , ITEM_SIZE.height + 5 ), TEST_LOCATION );
- DALI_TEST_EQUALS( actor2Frame, Vector4( 5+ ITEM_SIZE.width, 5.0f, (ITEM_SIZE.width*2) +5, ITEM_SIZE.height +5 ), TEST_LOCATION );
+ DALI_TEST_EQUALS(actor1Frame, Vector4(5.0f, 5.0f, ITEM_SIZE.width + 5, ITEM_SIZE.height + 5), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor2Frame, Vector4(5 + ITEM_SIZE.width, 5.0f, (ITEM_SIZE.width * 2) + 5, ITEM_SIZE.height + 5), TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline("UtcDaliToolkitFlexNodeCallbackTestP");
Flex::Node* flexNode = new Flex::Node();
- DALI_TEST_CHECK( flexNode );
+ DALI_TEST_CHECK(flexNode);
// Position elements in a Column
flexNode->SetFlexDirection(Flex::FlexDirection::COLUMN);
Actor actor1 = Actor::New();
Actor actor2 = Actor::New();
- actor1.SetProperty( Dali::Actor::Property::NAME,"callbackTest");
+ actor1.SetProperty(Dali::Actor::Property::NAME, "callbackTest");
- DALI_TEST_CHECK( actor1 );
- DALI_TEST_CHECK( actor2 );
+ DALI_TEST_CHECK(actor1);
+ DALI_TEST_CHECK(actor2);
- flexNode->AddChild(actor1, Extents(0,0,0,0), &MeasureChild, 0);
- flexNode->AddChild(actor2, Extents(0,0,0,0), &MeasureChild, 1);
+ flexNode->AddChild(actor1, Extents(0, 0, 0, 0), &MeasureChild, 0);
+ flexNode->AddChild(actor2, Extents(0, 0, 0, 0), &MeasureChild, 1);
flexNode->CalculateLayout(480, 800, false);
- Vector4 root = flexNode->GetNodeFrame(-1); // -1 is the root
- Vector4 actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
- Vector4 actor2Frame = flexNode->GetNodeFrame(1); // 1 is second child
+ Vector4 root = flexNode->GetNodeFrame(-1); // -1 is the root
+ Vector4 actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
+ Vector4 actor2Frame = flexNode->GetNodeFrame(1); // 1 is second child
tet_printf("Root frame(left:%f,top:%f,right:%f,bottom:%f)\n", root.x, root.y, root.z, root.w);
tet_printf("Actor 1 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor1Frame.x, actor1Frame.y, actor1Frame.z, actor1Frame.w);
tet_printf("Actor 2 frame(left:%f,top:%f,right:%f,bottom:%f)\n", actor2Frame.x, actor2Frame.y, actor2Frame.z, actor2Frame.w);
- DALI_TEST_EQUALS( actor1Frame, Vector4( 0.0f, 0.0f, ITEM_SIZE_CALLBACK_TEST.width, ITEM_SIZE_CALLBACK_TEST.height ), TEST_LOCATION );
- DALI_TEST_EQUALS( actor2Frame, Vector4( 0.0f, ITEM_SIZE_CALLBACK_TEST.height, ITEM_SIZE.width, ITEM_SIZE_CALLBACK_TEST.height + ITEM_SIZE.height ), TEST_LOCATION );
+ DALI_TEST_EQUALS(actor1Frame, Vector4(0.0f, 0.0f, ITEM_SIZE_CALLBACK_TEST.width, ITEM_SIZE_CALLBACK_TEST.height), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor2Frame, Vector4(0.0f, ITEM_SIZE_CALLBACK_TEST.height, ITEM_SIZE.width, ITEM_SIZE_CALLBACK_TEST.height + ITEM_SIZE.height), TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline("UtcDaliToolkitFlexNodeFlexPositionType");
Flex::Node* flexNode = new Flex::Node();
- DALI_TEST_CHECK( flexNode );
+ DALI_TEST_CHECK(flexNode);
tet_infoline(" FlexPositionType is RELATIVE by default");
// Create two actors and add them to the parent flex node
Actor actor1 = Actor::New();
Actor actor2 = Actor::New();
- DALI_TEST_CHECK( actor1 );
- DALI_TEST_CHECK( actor2 );
+ DALI_TEST_CHECK(actor1);
+ DALI_TEST_CHECK(actor2);
- flexNode->AddChild(actor1, Extents(0,0,0,0), &MeasureChild, 0);
- Flex::Node* actor2node = flexNode->AddChild(actor2, Extents(0,0,0,0), &MeasureChild, 1);
+ flexNode->AddChild(actor1, Extents(0, 0, 0, 0), &MeasureChild, 0);
+ Flex::Node* actor2node = flexNode->AddChild(actor2, Extents(0, 0, 0, 0), &MeasureChild, 1);
- DALI_TEST_EQUALS( (int)actor2node->GetFlexPositionType(), (int)Flex::PositionType::RELATIVE, TEST_LOCATION );
+ DALI_TEST_EQUALS((int)actor2node->GetFlexPositionType(), (int)Flex::PositionType::RELATIVE, TEST_LOCATION);
flexNode->CalculateLayout(480, 800, false);
- Vector4 root = flexNode->GetNodeFrame(-1); // -1 is the root
- Vector4 actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
- Vector4 actor2Frame = flexNode->GetNodeFrame(1); // 1 is second child
+ Vector4 root = flexNode->GetNodeFrame(-1); // -1 is the root
+ Vector4 actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
+ Vector4 actor2Frame = flexNode->GetNodeFrame(1); // 1 is second child
tet_printf("Root frame(left:%f,top:%f,right:%f,bottom:%f)\n", root.x, root.y, root.z, root.w);
---------
*/
- DALI_TEST_EQUALS( actor1Frame, Vector4( 0.0f, 0.0f, ITEM_SIZE.width, ITEM_SIZE.height ), TEST_LOCATION );
- DALI_TEST_EQUALS( actor2Frame, Vector4( 0.0f, ITEM_SIZE.height, ITEM_SIZE.width, ITEM_SIZE.height *2 ), TEST_LOCATION );
+ DALI_TEST_EQUALS(actor1Frame, Vector4(0.0f, 0.0f, ITEM_SIZE.width, ITEM_SIZE.height), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor2Frame, Vector4(0.0f, ITEM_SIZE.height, ITEM_SIZE.width, ITEM_SIZE.height * 2), TEST_LOCATION);
tet_infoline(" ABSOLUTE FlexPositionType, second item should now be ignore any properties");
- actor2node->SetFlexPositionType( Flex::PositionType::ABSOLUTE );
+ actor2node->SetFlexPositionType(Flex::PositionType::ABSOLUTE);
// Recalulate layout
flexNode->CalculateLayout(480, 800, false);
- root = flexNode->GetNodeFrame(-1); // -1 is the root
- actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
- actor2Frame = flexNode->GetNodeFrame(1); // 1 is second child
+ root = flexNode->GetNodeFrame(-1); // -1 is the root
+ actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
+ actor2Frame = flexNode->GetNodeFrame(1); // 1 is second child
tet_printf("Root frame(left:%f,top:%f,right:%f,bottom:%f)\n", root.x, root.y, root.z, root.w);
---------
*/
- DALI_TEST_EQUALS( actor1Frame, Vector4( 0.0f, 0.0f, ITEM_SIZE.width, ITEM_SIZE.height ), TEST_LOCATION );
- DALI_TEST_EQUALS( actor2Frame, Vector4( 0.0f, 0.0f, ITEM_SIZE.width, ITEM_SIZE.height ), TEST_LOCATION );
+ DALI_TEST_EQUALS(actor1Frame, Vector4(0.0f, 0.0f, ITEM_SIZE.width, ITEM_SIZE.height), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor2Frame, Vector4(0.0f, 0.0f, ITEM_SIZE.width, ITEM_SIZE.height), TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline("UtcDaliToolkitFlexNodeFlexAspectRatio");
Flex::Node* flexNode = new Flex::Node();
- DALI_TEST_CHECK( flexNode );
+ DALI_TEST_CHECK(flexNode);
// Create a actor and add them to the parent flex node
Actor actor1 = Actor::New();
- DALI_TEST_CHECK( actor1 );
+ DALI_TEST_CHECK(actor1);
tet_infoline(" 1.0 FlexAspectRatio");
- Flex::Node* actor1node = flexNode->AddChild(actor1, Extents(0,0,0,0), &MeasureChild, 0);
+ Flex::Node* actor1node = flexNode->AddChild(actor1, Extents(0, 0, 0, 0), &MeasureChild, 0);
actor1node->SetFlexAspectRatio(1.0);
- DALI_TEST_EQUALS( actor1node->GetFlexAspectRatio(), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(actor1node->GetFlexAspectRatio(), 1.0f, TEST_LOCATION);
flexNode->CalculateLayout(480, 800, false);
- Vector4 root = flexNode->GetNodeFrame(-1); // -1 is the root
- Vector4 actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
+ Vector4 root = flexNode->GetNodeFrame(-1); // -1 is the root
+ Vector4 actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
tet_printf("Root frame(left:%f,top:%f,right:%f,bottom:%f)\n", root.x, root.y, root.z, root.w);
---------
*/
- DALI_TEST_EQUALS( actor1Frame, Vector4( 0.0f, 0.0f, ITEM_SIZE.width, ITEM_SIZE.height ), TEST_LOCATION );
+ DALI_TEST_EQUALS(actor1Frame, Vector4(0.0f, 0.0f, ITEM_SIZE.width, ITEM_SIZE.height), TEST_LOCATION);
tet_infoline(" 2.0 FlexAspectRatio");
actor1node->SetFlexAspectRatio(2.0);
- DALI_TEST_EQUALS( actor1node->GetFlexAspectRatio(), 2.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(actor1node->GetFlexAspectRatio(), 2.0f, TEST_LOCATION);
// Recalulate layout
flexNode->CalculateLayout(480, 800, false);
- root = flexNode->GetNodeFrame(-1); // -1 is the root
- actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
+ root = flexNode->GetNodeFrame(-1); // -1 is the root
+ actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
tet_printf("Root frame(left:%f,top:%f,right:%f,bottom:%f)\n", root.x, root.y, root.z, root.w);
---------
*/
- DALI_TEST_EQUALS( actor1Frame, Vector4( 0.0f, 0.0f, ITEM_SIZE.width*2, ITEM_SIZE.height ), TEST_LOCATION );
+ DALI_TEST_EQUALS(actor1Frame, Vector4(0.0f, 0.0f, ITEM_SIZE.width * 2, ITEM_SIZE.height), TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline("UtcDaliToolkitFlexNodeFlexBasisShrinkGrow");
Flex::Node* flexNode = new Flex::Node();
- DALI_TEST_CHECK( flexNode );
+ DALI_TEST_CHECK(flexNode);
// Position elements as a Row
flexNode->SetFlexDirection(Flex::FlexDirection::ROW);
Actor actor1 = Actor::New();
Actor actor2 = Actor::New();
Actor actor3 = Actor::New();
- DALI_TEST_CHECK( actor1 );
- DALI_TEST_CHECK( actor2 );
- DALI_TEST_CHECK( actor3 );
+ DALI_TEST_CHECK(actor1);
+ DALI_TEST_CHECK(actor2);
+ DALI_TEST_CHECK(actor3);
- Flex::Node* actor1node = flexNode->AddChild(actor1, Extents(0,0,0,0), &MeasureChild, 0);
- Flex::Node* actor2node = flexNode->AddChild(actor2, Extents(0,0,0,0), &MeasureChild, 1);
- Flex::Node* actor3node = flexNode->AddChild(actor3, Extents(0,0,0,0), &MeasureChild, 2);
+ Flex::Node* actor1node = flexNode->AddChild(actor1, Extents(0, 0, 0, 0), &MeasureChild, 0);
+ Flex::Node* actor2node = flexNode->AddChild(actor2, Extents(0, 0, 0, 0), &MeasureChild, 1);
+ Flex::Node* actor3node = flexNode->AddChild(actor3, Extents(0, 0, 0, 0), &MeasureChild, 2);
float basis = 5;
actor2node->SetFlexBasis(basis);
actor3node->SetFlexBasis(basis);
- DALI_TEST_EQUALS( actor1node->GetFlexGrow(), 0.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor1node->GetFlexShrink(), 1.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( actor1node->GetFlexBasis(), basis, TEST_LOCATION );
+ DALI_TEST_EQUALS(actor1node->GetFlexGrow(), 0.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(actor1node->GetFlexShrink(), 1.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(actor1node->GetFlexBasis(), basis, TEST_LOCATION);
flexNode->CalculateLayout(600, 200, false);
- Vector4 root = flexNode->GetNodeFrame(-1); // -1 is the root
- Vector4 actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
- Vector4 actor2Frame = flexNode->GetNodeFrame(1); // 1 is second child
- Vector4 actor3Frame = flexNode->GetNodeFrame(2); // 2 is third child
+ Vector4 root = flexNode->GetNodeFrame(-1); // -1 is the root
+ Vector4 actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
+ Vector4 actor2Frame = flexNode->GetNodeFrame(1); // 1 is second child
+ Vector4 actor3Frame = flexNode->GetNodeFrame(2); // 2 is third child
tet_printf("Root frame(left:%f,top:%f,right:%f,bottom:%f)\n", root.x, root.y, root.z, root.w);
-------------------
*/
- DALI_TEST_EQUALS( actor1Frame, Vector4( 0.0f, 0.0f, basis, ITEM_SIZE.height ), TEST_LOCATION );
- DALI_TEST_EQUALS( actor2Frame, Vector4( basis, 0.0f, basis*2, ITEM_SIZE.height ), TEST_LOCATION );
- DALI_TEST_EQUALS( actor3Frame, Vector4( basis*2, 0.0f, basis*3, ITEM_SIZE.height ), TEST_LOCATION );
-
+ DALI_TEST_EQUALS(actor1Frame, Vector4(0.0f, 0.0f, basis, ITEM_SIZE.height), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor2Frame, Vector4(basis, 0.0f, basis * 2, ITEM_SIZE.height), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor3Frame, Vector4(basis * 2, 0.0f, basis * 3, ITEM_SIZE.height), TEST_LOCATION);
actor2node->SetFlexGrow(1.0);
actor3node->SetFlexGrow(1.0);
// Recalulate layout
flexNode->CalculateLayout(605, 200, false);
- root = flexNode->GetNodeFrame(-1); // -1 is the root
- actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
- actor2Frame = flexNode->GetNodeFrame(1); // 1 is second child
- actor3Frame = flexNode->GetNodeFrame(2); // 2 is third child
+ root = flexNode->GetNodeFrame(-1); // -1 is the root
+ actor1Frame = flexNode->GetNodeFrame(0); // 0 is first child
+ actor2Frame = flexNode->GetNodeFrame(1); // 1 is second child
+ actor3Frame = flexNode->GetNodeFrame(2); // 2 is third child
tet_printf("Root frame(left:%f,top:%f,right:%f,bottom:%f)\n", root.x, root.y, root.z, root.w);
-------------------
*/
- DALI_TEST_EQUALS( actor1Frame, Vector4( 0.0f, 0.0f, basis, ITEM_SIZE.height ), TEST_LOCATION );
- DALI_TEST_EQUALS( actor2Frame, Vector4( basis, 0.0f, basis + (root.z-basis)/2, ITEM_SIZE.height ), TEST_LOCATION );
- DALI_TEST_EQUALS( actor3Frame, Vector4( basis + (root.z-basis)/2, 0.0f, root.z, ITEM_SIZE.height ), TEST_LOCATION );
+ DALI_TEST_EQUALS(actor1Frame, Vector4(0.0f, 0.0f, basis, ITEM_SIZE.height), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor2Frame, Vector4(basis, 0.0f, basis + (root.z - basis) / 2, ITEM_SIZE.height), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor3Frame, Vector4(basis + (root.z - basis) / 2, 0.0f, root.z, ITEM_SIZE.height), TEST_LOCATION);
END_TEST;
}
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
#include <stdlib.h>
+#include <iostream>
+
#include <dali-toolkit-test-suite-utils.h>
+
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/controls/gaussian-blur-view/gaussian-blur-view.h>
class TestCallback : public ConnectionTracker
{
public:
- TestCallback( Dali::Toolkit::GaussianBlurView& blurView )
- : mBlurView( blurView )
+ TestCallback(Dali::Toolkit::GaussianBlurView& blurView)
+ : mBlurView(blurView)
{
mFinished = false;
}
void Connect()
{
- mBlurView.FinishedSignal().Connect( this, &TestCallback::OnFinished );
+ mBlurView.FinishedSignal().Connect(this, &TestCallback::OnFinished);
}
- void OnFinished( Dali::Toolkit::GaussianBlurView source )
+ void OnFinished(Dali::Toolkit::GaussianBlurView source)
{
mFinished = true;
}
- bool mFinished;
+ bool mFinished;
Dali::Toolkit::GaussianBlurView& mBlurView;
};
{
// New() must be called to create a GaussianBlurView or it wont be valid.
Actor a = Actor::New();
- view.Add( a );
- DALI_TEST_CHECK( false );
+ view.Add(a);
+ DALI_TEST_CHECK(false);
}
- catch (Dali::DaliException& e)
+ catch(Dali::DaliException& e)
{
// Tests that a negative test of an assertion succeeds
- DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_PRINT_ASSERT(e);
DALI_TEST_CHECK(!view);
}
END_TEST;
tet_infoline("UtcDaliGaussianBlurViewNew");
Toolkit::GaussianBlurView view = Toolkit::GaussianBlurView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Toolkit::GaussianBlurView view2 = Toolkit::GaussianBlurView::New(5, 1.5f, Pixel::RGB888, 0.5f, 0.5f, false);
- DALI_TEST_CHECK( view2 );
+ DALI_TEST_CHECK(view2);
END_TEST;
}
tet_infoline("UtcDaliGaussianBlurViewDownCast");
Toolkit::GaussianBlurView view = Toolkit::GaussianBlurView::New();
- BaseHandle handle(view);
+ BaseHandle handle(view);
- Toolkit::GaussianBlurView gaussianBlurView = Toolkit::GaussianBlurView::DownCast( handle );
- DALI_TEST_CHECK( view );
- DALI_TEST_CHECK( gaussianBlurView );
- DALI_TEST_CHECK( gaussianBlurView == view );
+ Toolkit::GaussianBlurView gaussianBlurView = Toolkit::GaussianBlurView::DownCast(handle);
+ DALI_TEST_CHECK(view);
+ DALI_TEST_CHECK(gaussianBlurView);
+ DALI_TEST_CHECK(gaussianBlurView == view);
END_TEST;
}
-
// Positive test case for a method
int UtcDaliGaussianBlurViewPropertyNames(void)
{
tet_infoline("UtcDaliGaussianBlurViewPropertyNames");
Toolkit::GaussianBlurView view = Toolkit::GaussianBlurView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
// Check the names, this names are used in the shader code,
// if they change in the shader code, then it has to be updated here.
- DALI_TEST_EQUALS( view.GetBlurStrengthPropertyIndex(), view.GetPropertyIndex("GaussianBlurStrengthPropertyName"), TEST_LOCATION );
+ DALI_TEST_EQUALS(view.GetBlurStrengthPropertyIndex(), view.GetPropertyIndex("GaussianBlurStrengthPropertyName"), TEST_LOCATION);
END_TEST;
}
tet_infoline("UtcDaliGaussianBlurViewAddRemove");
Toolkit::GaussianBlurView view = Toolkit::GaussianBlurView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Actor actor = Actor::New();
- DALI_TEST_CHECK( !actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
-
+ DALI_TEST_CHECK(!actor.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE));
- view.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- view.SetProperty( Actor::Property::SIZE, application.GetScene().GetSize());
+ view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ view.SetProperty(Actor::Property::SIZE, application.GetScene().GetSize());
view.Add(actor);
application.GetScene().Add(view);
- DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
+ DALI_TEST_CHECK(actor.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE));
view.Remove(actor);
- DALI_TEST_CHECK( !actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
+ DALI_TEST_CHECK(!actor.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE));
END_TEST;
}
tet_infoline("UtcDaliGaussianBlurActivateDeactivate");
Toolkit::GaussianBlurView view = Toolkit::GaussianBlurView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
RenderTaskList taskList = application.GetScene().GetRenderTaskList();
- DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
+ DALI_TEST_CHECK(1u == taskList.GetTaskCount());
- view.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- view.SetProperty( Actor::Property::SIZE, application.GetScene().GetSize());
+ view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ view.SetProperty(Actor::Property::SIZE, application.GetScene().GetSize());
view.Add(Actor::New());
application.GetScene().Add(view);
view.Activate();
RenderTaskList taskList2 = application.GetScene().GetRenderTaskList();
- DALI_TEST_CHECK( 1u != taskList2.GetTaskCount() );
- DALI_TEST_CHECK( 2u == view.GetChildCount() );
+ DALI_TEST_CHECK(1u != taskList2.GetTaskCount());
+ DALI_TEST_CHECK(2u == view.GetChildCount());
view.Deactivate();
RenderTaskList taskList3 = application.GetScene().GetRenderTaskList();
- DALI_TEST_CHECK( 1u == taskList3.GetTaskCount() );
- DALI_TEST_CHECK( 1u == view.GetChildCount() );
+ DALI_TEST_CHECK(1u == taskList3.GetTaskCount());
+ DALI_TEST_CHECK(1u == view.GetChildCount());
END_TEST;
}
{
#ifdef OLD_GRAPHICS_TEST // NEeds framebuffers implementing
ToolkitTestApplication application;
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
tet_infoline("UtcDaliGaussianBlurActivateDeactivateRepeat");
Toolkit::GaussianBlurView view = Toolkit::GaussianBlurView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- view.SetProperty( Actor::Property::SIZE, application.GetScene().GetSize());
+ view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ view.SetProperty(Actor::Property::SIZE, application.GetScene().GetSize());
view.Add(Actor::New());
application.GetScene().Add(view);
view.Activate();
application.SendNotification();
application.Render(20);
- DALI_TEST_EQUALS( gl.GetLastGenTextureId(), 3, TEST_LOCATION );
+ DALI_TEST_EQUALS(gl.GetLastGenTextureId(), 3, TEST_LOCATION);
view.Deactivate();
application.SendNotification();
application.Render(20);
- DALI_TEST_EQUALS( gl.GetLastGenTextureId(), 3, TEST_LOCATION);
+ DALI_TEST_EQUALS(gl.GetLastGenTextureId(), 3, TEST_LOCATION);
view.Activate();
application.SendNotification();
application.Render(20);
- DALI_TEST_EQUALS( gl.GetLastGenTextureId(), 6, TEST_LOCATION);
+ DALI_TEST_EQUALS(gl.GetLastGenTextureId(), 6, TEST_LOCATION);
#else
tet_result(TET_PASS);
#endif
tet_infoline("UtcDaliGaussianBlurViewSetGetBackgroundColor");
Toolkit::GaussianBlurView view = Toolkit::GaussianBlurView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
view.SetBackgroundColor(Dali::Color::RED);
Vector4 color = view.GetBackgroundColor();
- DALI_TEST_CHECK( color == Dali::Color::RED );
+ DALI_TEST_CHECK(color == Dali::Color::RED);
END_TEST;
}
tet_infoline("UtcDaliGaussianBlurViewSetGetRenderTarget");
Toolkit::GaussianBlurView view = Toolkit::GaussianBlurView::New(5, 1.5f, Pixel::RGB888, 0.5f, 0.5f, true);
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- view.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- view.SetProperty( Actor::Property::SIZE, application.GetScene().GetSize());
+ view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ view.SetProperty(Actor::Property::SIZE, application.GetScene().GetSize());
view.Add(Actor::New());
application.GetScene().Add(view);
view.Activate();
- PixelData pixels = Toolkit::SyncImageLoader::Load( TEST_IMAGE_FILE_NAME );
- Texture texture = Texture::New( TextureType::TEXTURE_2D, pixels.GetPixelFormat(), pixels.GetWidth(), pixels.GetHeight() );
- texture.Upload( pixels, 0, 0, 0, 0, pixels.GetWidth(), pixels.GetHeight() );
+ PixelData pixels = Toolkit::SyncImageLoader::Load(TEST_IMAGE_FILE_NAME);
+ Texture texture = Texture::New(TextureType::TEXTURE_2D, pixels.GetPixelFormat(), pixels.GetWidth(), pixels.GetHeight());
+ texture.Upload(pixels, 0, 0, 0, 0, pixels.GetWidth(), pixels.GetHeight());
- FrameBuffer renderTarget = FrameBuffer::New( 480, 800, FrameBuffer::Attachment::NONE );
+ FrameBuffer renderTarget = FrameBuffer::New(480, 800, FrameBuffer::Attachment::NONE);
view.SetUserImageAndOutputRenderTarget(texture, renderTarget);
- DALI_TEST_CHECK( view.GetBlurredRenderTarget() == renderTarget );
+ DALI_TEST_CHECK(view.GetBlurredRenderTarget() == renderTarget);
END_TEST;
}
tet_infoline("UtcDaliGaussianBlurActivateOnce1");
Toolkit::GaussianBlurView view = Toolkit::GaussianBlurView::New(5, 1.5f, Pixel::RGB888, 0.5f, 0.5f, true);
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
RenderTaskList taskList = application.GetScene().GetRenderTaskList();
- DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
+ DALI_TEST_CHECK(1u == taskList.GetTaskCount());
- view.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- view.SetProperty( Actor::Property::SIZE, application.GetScene().GetSize());
+ view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ view.SetProperty(Actor::Property::SIZE, application.GetScene().GetSize());
view.Add(Actor::New());
application.GetScene().Add(view);
view.ActivateOnce();
RenderTaskList taskList2 = application.GetScene().GetRenderTaskList();
- DALI_TEST_CHECK( 1u != taskList2.GetTaskCount() );
+ DALI_TEST_CHECK(1u != taskList2.GetTaskCount());
application.Render();
END_TEST;
{
#ifdef OLD_GRAPHICS_TEST // requires framebuffers to be implemented
ToolkitTestApplication application;
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
tet_infoline("UtcDaliGaussianBlurActivateOnce2");
Toolkit::GaussianBlurView view = Toolkit::GaussianBlurView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- view.SetProperty( Actor::Property::SIZE, application.GetScene().GetSize());
+ view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ view.SetProperty(Actor::Property::SIZE, application.GetScene().GetSize());
view.Add(Actor::New());
application.GetScene().Add(view);
view.ActivateOnce();
application.SendNotification();
application.Render(20);
- DALI_TEST_CHECK( gl.GetLastGenTextureId() == 3 );
+ DALI_TEST_CHECK(gl.GetLastGenTextureId() == 3);
view.ActivateOnce();
application.SendNotification();
application.Render(20);
- DALI_TEST_CHECK( gl.GetLastGenTextureId() == 6 );
+ DALI_TEST_CHECK(gl.GetLastGenTextureId() == 6);
#else
tet_result(TET_PASS);
tet_infoline("UtcDaliGaussianBlurViewFinishedSignalN");
Toolkit::GaussianBlurView view = Toolkit::GaussianBlurView::New(5, 1.5f, Pixel::RGB888, 0.5f, 0.5f, true);
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- view.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- view.SetProperty( Actor::Property::SIZE, application.GetScene().GetSize());
+ view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ view.SetProperty(Actor::Property::SIZE, application.GetScene().GetSize());
view.Add(Actor::New());
application.GetScene().Add(view);
view.Activate();
- TestCallback callback( view );
- DALI_TEST_CHECK( callback.mFinished == false );
+ TestCallback callback(view);
+ DALI_TEST_CHECK(callback.mFinished == false);
callback.Connect();
application.SendNotification();
// FinishedSignal is only for ActivateOnce()
- DALI_TEST_CHECK( callback.mFinished == false );
+ DALI_TEST_CHECK(callback.mFinished == false);
END_TEST;
}
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <unistd.h>
#include <thread>
+
#include <dali-toolkit-test-suite-utils.h>
+
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/public-api/controls/gl-view/gl-view.h>
#include <dali/devel-api/adaptor-framework/window-devel.h>
ToolkitTestApplication application;
tet_infoline(" UtcDaliGlViewNew");
GlView view = GlView::New(GlView::ColorFormat::RGBA8888);
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliGlViewDownCast");
- GlView view = GlView::New(GlView::ColorFormat::RGB888);
+ GlView view = GlView::New(GlView::ColorFormat::RGB888);
BaseHandle handle(view);
- Toolkit::GlView view2 = Toolkit::GlView::DownCast( handle );
- DALI_TEST_CHECK( view );
- DALI_TEST_CHECK( view2 );
- DALI_TEST_CHECK( view == view2 );
+ Toolkit::GlView view2 = Toolkit::GlView::DownCast(handle);
+ DALI_TEST_CHECK(view);
+ DALI_TEST_CHECK(view2);
+ DALI_TEST_CHECK(view == view2);
END_TEST;
}
tet_infoline("UtcDaliGlViewCopyAndAssignment");
GlView view = Toolkit::GlView::New(GlView::ColorFormat::RGB888);
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- GlView copy( view );
- DALI_TEST_CHECK( view == copy );
+ GlView copy(view);
+ DALI_TEST_CHECK(view == copy);
GlView assign;
- DALI_TEST_CHECK( !assign );
+ DALI_TEST_CHECK(!assign);
assign = copy;
- DALI_TEST_CHECK( assign == view );
+ DALI_TEST_CHECK(assign == view);
END_TEST;
}
tet_infoline("UtcDaliGlViewMoveAssignment");
GlView view = Toolkit::GlView::New(GlView::ColorFormat::RGB888);
- DALI_TEST_EQUALS( 1, view.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS(1, view.GetBaseObject().ReferenceCount(), TEST_LOCATION);
GlView moved;
- moved = std::move( view );
- DALI_TEST_CHECK( moved );
- DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_CHECK( !view );
+ moved = std::move(view);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_CHECK(!view);
END_TEST;
}
GlView::RenderingMode mode = view.GetRenderingMode();
- DALI_TEST_EQUALS( GlView::RenderingMode::ON_DEMAND, mode, TEST_LOCATION );
+ DALI_TEST_EQUALS(GlView::RenderingMode::ON_DEMAND, mode, TEST_LOCATION);
END_TEST;
}
tet_infoline("UtcDaliGlViewOnSizeSet");
GlView view = Toolkit::GlView::New(GlView::ColorFormat::RGB888);
-
- application.GetScene().Add( view );
+ application.GetScene().Add(view);
application.SendNotification();
application.Render();
- Vector3 size( 200.0f, 300.0f, 0.0f );
- view.SetProperty( Actor::Property::SIZE, size );
+ Vector3 size(200.0f, 300.0f, 0.0f);
+ view.SetProperty(Actor::Property::SIZE, size);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( view.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), size, TEST_LOCATION );
+ DALI_TEST_EQUALS(view.GetCurrentProperty<Vector3>(Actor::Property::SIZE), size, TEST_LOCATION);
END_TEST;
}
-
// Internal callback function
void glInit(void)
{
ToolkitTestApplication application;
tet_infoline("UtcDaliGlViewWindowVisibilityChanged");
GlView view = Toolkit::GlView::New(GlView::ColorFormat::RGB888);
- application.GetScene().Add( view );
+ application.GetScene().Add(view);
view.SetRenderingMode(GlView::RenderingMode::CONTINUOUS);
view.SetGraphicsConfig(true, true, 0, GlView::GraphicsApiVersion::GLES_VERSION_2_0);
view.RegisterGlCallbacks(Dali::MakeCallback(glInit), Dali::MakeCallback(glRenderFrame), Dali::MakeCallback(glTerminate));
application.SendNotification();
application.Render();
- Window window = DevelWindow::Get( view );
+ Window window = DevelWindow::Get(view);
window.Hide();
application.SendNotification();
application.Render();
GlView view = Toolkit::GlView::New(GlView::ColorFormat::RGB888);
//Onscene
- application.GetScene().Add( view );
+ application.GetScene().Add(view);
view.SetRenderingMode(GlView::RenderingMode::CONTINUOUS);
view.SetGraphicsConfig(true, true, 0, GlView::GraphicsApiVersion::GLES_VERSION_2_0);
view.RegisterGlCallbacks(Dali::MakeCallback(glInit), Dali::MakeCallback(glRenderFrame), Dali::MakeCallback(glTerminate));
ToolkitTestApplication application;
GlView view = Toolkit::GlView::New(GlView::ColorFormat::RGB888);
- application.GetScene().Add( view );
+ application.GetScene().Add(view);
application.SendNotification();
application.Render();
- view.SetProperty( Actor::Property::VISIBLE, false );
+ view.SetProperty(Actor::Property::VISIBLE, false);
application.SendNotification();
application.Render();
DALI_TEST_CHECK(view.GetCurrentProperty<bool>(Actor::Property::VISIBLE) == false);
- view.SetProperty( Actor::Property::VISIBLE, true );
+ view.SetProperty(Actor::Property::VISIBLE, true);
application.SendNotification();
application.Render();
DALI_TEST_CHECK(view.GetCurrentProperty<bool>(Actor::Property::VISIBLE) == true);
tet_infoline("UtcDaliGlViewResize");
GlView view = Toolkit::GlView::New(GlView::ColorFormat::RGB888);
- application.GetScene().Add( view );
+ application.GetScene().Add(view);
view.SetGraphicsConfig(true, true, 0, GlView::GraphicsApiVersion::GLES_VERSION_2_0);
view.RegisterGlCallbacks(Dali::MakeCallback(glInit), Dali::MakeCallback(glRenderFrame), Dali::MakeCallback(glTerminate));
view.SetResizeCallback(Dali::MakeCallback(resizeCB));
application.Render();
//To GlViewRenderThread can recognize Resize signal the main thread have to sleep.
- std::this_thread::sleep_for( std::chrono::milliseconds( 100 ) );
+ std::this_thread::sleep_for(std::chrono::milliseconds(100));
application.SendNotification();
application.Render();
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
* limitations under the License.
*/
-#include <iostream>
#include <stdlib.h>
+#include <iostream>
+
#include <dali-toolkit-test-suite-utils.h>
-#include <dali/public-api/rendering/texture.h>
+
+#include <dali-toolkit/public-api/image-loader/image-url.h>
+#include <dali-toolkit/public-api/image-loader/image.h>
+#include <dali/public-api/adaptor-framework/native-image-source.h>
#include <dali/public-api/images/pixel-data.h>
#include <dali/public-api/rendering/frame-buffer.h>
-#include <dali/public-api/adaptor-framework/native-image-source.h>
-#include <dali-toolkit/public-api/image-loader/image.h>
-#include <dali-toolkit/public-api/image-loader/image-url.h>
+#include <dali/public-api/rendering/texture.h>
using namespace Dali;
using namespace Dali::Toolkit;
{
} // namespace
-
void dali_image_startup(void)
{
test_return_value = TET_UNDEF;
int UtcDaliImageConvertFrameBufferToUrl1(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliImageConvertFrameBufferToUrl1" );
+ tet_infoline("UtcDaliImageConvertFrameBufferToUrl1");
unsigned int width(64);
unsigned int height(64);
- FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::NONE );
+ FrameBuffer frameBuffer = FrameBuffer::New(width, height, FrameBuffer::Attachment::NONE);
- DALI_TEST_CHECK( frameBuffer );
- ImageUrl url = Dali::Toolkit::Image::GenerateUrl( frameBuffer, Pixel::Format::RGBA8888, width, height );
+ DALI_TEST_CHECK(frameBuffer);
+ ImageUrl url = Dali::Toolkit::Image::GenerateUrl(frameBuffer, Pixel::Format::RGBA8888, width, height);
- DALI_TEST_CHECK( url.GetUrl().size() > 0u );
+ DALI_TEST_CHECK(url.GetUrl().size() > 0u);
END_TEST;
}
-
int UtcDaliImageConvertFrameBufferToUrl2(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliImageConvertFrameBufferToUrl2" );
+ tet_infoline("UtcDaliImageConvertFrameBufferToUrl2");
unsigned int width(64);
unsigned int height(64);
- FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::NONE );
+ FrameBuffer frameBuffer = FrameBuffer::New(width, height, FrameBuffer::Attachment::NONE);
- Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height );
- frameBuffer.AttachColorTexture( texture );
+ Texture texture = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height);
+ frameBuffer.AttachColorTexture(texture);
- DALI_TEST_CHECK( Dali::Toolkit::Image::GenerateUrl( frameBuffer, 0 ).GetUrl().size() > 0u );
+ DALI_TEST_CHECK(Dali::Toolkit::Image::GenerateUrl(frameBuffer, 0).GetUrl().size() > 0u);
END_TEST;
}
-
int UtcDaliImageConvertPixelDataToUrl(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliImageConvertPixelDataToUrl" );
+ tet_infoline("UtcDaliImageConvertPixelDataToUrl");
unsigned int width(64);
unsigned int height(64);
- unsigned int bufferSize = width*height*Pixel::GetBytesPerPixel( Pixel::RGB888 );
+ unsigned int bufferSize = width * height * Pixel::GetBytesPerPixel(Pixel::RGB888);
- unsigned char* buffer= reinterpret_cast<unsigned char*>( malloc( bufferSize ) );
- PixelData pixelData = PixelData::New( buffer, bufferSize, width, height, Pixel::RGB888, PixelData::FREE );
+ unsigned char* buffer = reinterpret_cast<unsigned char*>(malloc(bufferSize));
+ PixelData pixelData = PixelData::New(buffer, bufferSize, width, height, Pixel::RGB888, PixelData::FREE);
- DALI_TEST_CHECK( Dali::Toolkit::Image::GenerateUrl( pixelData ).GetUrl().size() > 0u );
+ DALI_TEST_CHECK(Dali::Toolkit::Image::GenerateUrl(pixelData).GetUrl().size() > 0u);
END_TEST;
}
-
int UtcDaliImageConvertNativeImageSourceToUrl(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliImageConvertNativeImageSourceToUrl" );
+ tet_infoline("UtcDaliImageConvertNativeImageSourceToUrl");
unsigned int width(64);
unsigned int height(64);
try
{
- NativeImageSourcePtr nativeImageSource = NativeImageSource::New(width, height, NativeImageSource::COLOR_DEPTH_DEFAULT );
+ NativeImageSourcePtr nativeImageSource = NativeImageSource::New(width, height, NativeImageSource::COLOR_DEPTH_DEFAULT);
- DALI_TEST_CHECK( Dali::Toolkit::Image::GenerateUrl( nativeImageSource ).GetUrl().size() > 0u );
+ DALI_TEST_CHECK(Dali::Toolkit::Image::GenerateUrl(nativeImageSource).GetUrl().size() > 0u);
}
catch(Dali::DaliException& e)
{
- DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_PRINT_ASSERT(e);
DALI_TEST_ASSERT(e, "Adaptor::IsAvailable()", TEST_LOCATION);
}
catch(...)
{
- tet_printf("Assertion test failed - wrong Exception\n" );
+ tet_printf("Assertion test failed - wrong Exception\n");
tet_result(TET_FAIL);
}
int UtcDaliImageConvertEncodedImageBufferToUrl(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliImageConvertEncodedImageBufferToUrl" );
+ tet_infoline("UtcDaliImageConvertEncodedImageBufferToUrl");
Dali::Vector<uint8_t> buffer;
buffer.PushBack(0x11);
buffer.PushBack(0x22);
buffer.PushBack(0x33);
- DALI_TEST_CHECK( Dali::Toolkit::Image::GenerateUrl( EncodedImageBuffer::New(buffer) ).GetUrl().size() > 0u );
+ DALI_TEST_CHECK(Dali::Toolkit::Image::GenerateUrl(EncodedImageBuffer::New(buffer)).GetUrl().size() > 0u);
END_TEST;
}
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <stdlib.h>
#include <unistd.h>
-#include <dali/dali.h>
+
#include <dali-toolkit-test-suite-utils.h>
#include <toolkit-event-thread-callback.h>
-#include <dali-toolkit/devel-api/image-loader/image-atlas.h>
+
#include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/image-loader/image-atlas.h>
+#include <dali/dali.h>
using namespace Dali;
using namespace Dali::Toolkit;
const int RENDER_FRAME_INTERVAL = 16; ///< Duration of each frame in ms. (at approx 60FPS)
-PixelData CreatePixelData( unsigned int width, unsigned int height )
+PixelData CreatePixelData(unsigned int width, unsigned int height)
{
- unsigned int bufferSize = width*height*Pixel::GetBytesPerPixel( Pixel::RGBA8888 );
+ unsigned int bufferSize = width * height * Pixel::GetBytesPerPixel(Pixel::RGBA8888);
- unsigned char* buffer= reinterpret_cast<unsigned char*>( malloc( bufferSize ) );
- PixelData pixelData = PixelData::New( buffer, bufferSize, width, height, Pixel::RGBA8888, PixelData::FREE );
+ unsigned char* buffer = reinterpret_cast<unsigned char*>(malloc(bufferSize));
+ PixelData pixelData = PixelData::New(buffer, bufferSize, width, height, Pixel::RGBA8888, PixelData::FREE);
return pixelData;
}
-Rect<int> TextureCoordinateToPixelArea( const Vector4& textureCoordinate, float size )
+Rect<int> TextureCoordinateToPixelArea(const Vector4& textureCoordinate, float size)
{
- Vector4 temp = textureCoordinate * size;
+ Vector4 temp = textureCoordinate * size;
Rect<int> pixelArea;
- pixelArea.x = static_cast<int>( temp.x );
- pixelArea.y = static_cast<int>( temp.y );
- pixelArea.width = static_cast<int>( temp.z-temp.x+1.01f );
- pixelArea.height = static_cast<int>( temp.w-temp.y+1.01f );
+ pixelArea.x = static_cast<int>(temp.x);
+ pixelArea.y = static_cast<int>(temp.y);
+ pixelArea.width = static_cast<int>(temp.z - temp.x + 1.01f);
+ pixelArea.height = static_cast<int>(temp.w - temp.y + 1.01f);
return pixelArea;
}
-Rect<int> TextureCoordinateToPixelArea( const Vector4& textureCoordinate, float width, float height )
+Rect<int> TextureCoordinateToPixelArea(const Vector4& textureCoordinate, float width, float height)
{
Rect<int> pixelArea;
- pixelArea.x = static_cast<int>( textureCoordinate.x*width );
- pixelArea.y = static_cast<int>( textureCoordinate.y*height);
- pixelArea.width = static_cast<int>( (textureCoordinate.z-textureCoordinate.x)*width+1.01f );
- pixelArea.height = static_cast<int>( (textureCoordinate.w-textureCoordinate.y)*height+1.01f );
+ pixelArea.x = static_cast<int>(textureCoordinate.x * width);
+ pixelArea.y = static_cast<int>(textureCoordinate.y * height);
+ pixelArea.width = static_cast<int>((textureCoordinate.z - textureCoordinate.x) * width + 1.01f);
+ pixelArea.height = static_cast<int>((textureCoordinate.w - textureCoordinate.y) * height + 1.01f);
return pixelArea;
}
-bool IsOverlap( Rect<int> rect1, Rect<int> rect2 )
+bool IsOverlap(Rect<int> rect1, Rect<int> rect2)
{
- return rect1.x < rect2.x+rect2.width
- && rect2.x < rect1.x+rect1.width
- && rect1.y < rect2.y+rect2.height
- && rect2.y < rect1.y+rect1.height;
+ return rect1.x < rect2.x + rect2.width && rect2.x < rect1.x + rect1.width && rect1.y < rect2.y + rect2.height && rect2.y < rect1.y + rect1.height;
}
static unsigned int gCountOfTestFuncCall;
{
public:
TestUploadObserver()
- {}
+ {
+ }
virtual ~TestUploadObserver()
- {}
+ {
+ }
void UploadCompleted()
{
// invoke default handle constructor
ImageAtlas atlas;
- DALI_TEST_CHECK( !atlas );
+ DALI_TEST_CHECK(!atlas);
// initialise handle
- atlas = ImageAtlas::New( 32, 32 );
+ atlas = ImageAtlas::New(32, 32);
- DALI_TEST_CHECK( atlas );
+ DALI_TEST_CHECK(atlas);
END_TEST;
}
{
ToolkitTestApplication application;
- ImageAtlas atlas = ImageAtlas::New( 32, 32);
+ ImageAtlas atlas = ImageAtlas::New(32, 32);
ImageAtlas atlasCopy(atlas);
- DALI_TEST_EQUALS( (bool)atlasCopy, true, TEST_LOCATION );
+ DALI_TEST_EQUALS((bool)atlasCopy, true, TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- ImageAtlas atlas = ImageAtlas::New( 32, 32 );
+ ImageAtlas atlas = ImageAtlas::New(32, 32);
ImageAtlas atlas2;
- DALI_TEST_EQUALS( (bool)atlas2, false, TEST_LOCATION );
+ DALI_TEST_EQUALS((bool)atlas2, false, TEST_LOCATION);
atlas2 = atlas;
- DALI_TEST_EQUALS( (bool)atlas2, true, TEST_LOCATION );
+ DALI_TEST_EQUALS((bool)atlas2, true, TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- ImageAtlas atlas = ImageAtlas::New( 32, 32 );
- Texture image = atlas.GetAtlas();
+ ImageAtlas atlas = ImageAtlas::New(32, 32);
+ Texture image = atlas.GetAtlas();
// test the atlas created
- DALI_TEST_EQUALS( (bool)image, true, TEST_LOCATION );
- DALI_TEST_CHECK( image.GetHeight() == 32u );
- DALI_TEST_CHECK( image.GetWidth() == 32u );
+ DALI_TEST_EQUALS((bool)image, true, TEST_LOCATION);
+ DALI_TEST_CHECK(image.GetHeight() == 32u);
+ DALI_TEST_CHECK(image.GetWidth() == 32u);
END_TEST;
}
{
ToolkitTestApplication application;
- ImageAtlas atlas = ImageAtlas::New( 100, 100 );
+ ImageAtlas atlas = ImageAtlas::New(100, 100);
- DALI_TEST_EQUALS( atlas.GetOccupancyRate(), 0.f, TEST_LOCATION );
+ DALI_TEST_EQUALS(atlas.GetOccupancyRate(), 0.f, TEST_LOCATION);
Vector4 textureRect1;
- atlas.Upload( textureRect1, gImage_34_RGBA, ImageDimensions(34, 34) );
- DALI_TEST_EQUALS( atlas.GetOccupancyRate(), 34.f*34.f/10000.f, 0.001f, TEST_LOCATION );
+ atlas.Upload(textureRect1, gImage_34_RGBA, ImageDimensions(34, 34));
+ DALI_TEST_EQUALS(atlas.GetOccupancyRate(), 34.f * 34.f / 10000.f, 0.001f, TEST_LOCATION);
Vector4 textureRect2;
- atlas.Upload( textureRect2, gImage_50_RGBA, ImageDimensions(50, 50) );
- DALI_TEST_EQUALS( atlas.GetOccupancyRate(), (34.f*34.f+50.f*50.f)/10000.f, 0.001f, TEST_LOCATION );
+ atlas.Upload(textureRect2, gImage_50_RGBA, ImageDimensions(50, 50));
+ DALI_TEST_EQUALS(atlas.GetOccupancyRate(), (34.f * 34.f + 50.f * 50.f) / 10000.f, 0.001f, TEST_LOCATION);
END_TEST;
}
int UtcDaliImageAtlasSetBrokenImage(void)
{
ToolkitTestApplication application;
- unsigned int size = 200;
- ImageAtlas atlas = ImageAtlas::New( size, size );
+ unsigned int size = 200;
+ ImageAtlas atlas = ImageAtlas::New(size, size);
// Set broken image
TestPlatformAbstraction& platform = application.GetPlatform();
- platform.SetClosestImageSize(Vector2( 34, 34));
- atlas.SetBrokenImage( gImage_34_RGBA );
+ platform.SetClosestImageSize(Vector2(34, 34));
+ atlas.SetBrokenImage(gImage_34_RGBA);
Vector4 textureRect;
// the empty image will be replaced with the broken image
- platform.SetClosestImageSize(Vector2( 20, 20));
- atlas.Upload( textureRect, gEmptyImage );
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ platform.SetClosestImageSize(Vector2(20, 20));
+ atlas.Upload(textureRect, gEmptyImage);
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
Rect<int> pixelArea = TextureCoordinateToPixelArea(textureRect, size);
- DALI_TEST_EQUALS( pixelArea.width, 20, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelArea.height, 20, TEST_LOCATION );
+ DALI_TEST_EQUALS(pixelArea.width, 20, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelArea.height, 20, TEST_LOCATION);
END_TEST;
}
-
-
int UtcDaliImageAtlasUploadP(void)
{
ToolkitTestApplication application;
- unsigned int size = 200;
- ImageAtlas atlas = ImageAtlas::New( size, size );
+ unsigned int size = 200;
+ ImageAtlas atlas = ImageAtlas::New(size, size);
TraceCallStack& callStack = application.GetGlAbstraction().GetTextureTrace();
callStack.Reset();
callStack.Enable(true);
Vector4 textureRect1;
- atlas.Upload( textureRect1, gImage_34_RGBA, ImageDimensions(34, 34) );
+ atlas.Upload(textureRect1, gImage_34_RGBA, ImageDimensions(34, 34));
Vector4 textureRect2;
- atlas.Upload( textureRect2, gImage_50_RGBA, ImageDimensions(50, 50) );
+ atlas.Upload(textureRect2, gImage_50_RGBA, ImageDimensions(50, 50));
Vector4 textureRect3;
- atlas.Upload( textureRect3, gImage_128_RGB, ImageDimensions(128, 128) );
+ atlas.Upload(textureRect3, gImage_128_RGB, ImageDimensions(128, 128));
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 3 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(3), true, TEST_LOCATION);
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
callStack.Enable(false);
Rect<int> pixelArea1 = TextureCoordinateToPixelArea(textureRect1, size);
- DALI_TEST_EQUALS( pixelArea1.width, 34, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelArea1.height, 34, TEST_LOCATION );
+ DALI_TEST_EQUALS(pixelArea1.width, 34, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelArea1.height, 34, TEST_LOCATION);
TraceCallStack::NamedParams params;
- params["width"] <<pixelArea1.width;
- params["height"] <<pixelArea1.height;
- params["xoffset"] <<pixelArea1.x;
- params["yoffset"] <<pixelArea1.y;
- DALI_TEST_CHECK( callStack.FindMethodAndParams("TexSubImage2D", params ));
+ params["width"] << pixelArea1.width;
+ params["height"] << pixelArea1.height;
+ params["xoffset"] << pixelArea1.x;
+ params["yoffset"] << pixelArea1.y;
+ DALI_TEST_CHECK(callStack.FindMethodAndParams("TexSubImage2D", params));
Rect<int> pixelArea2 = TextureCoordinateToPixelArea(textureRect2, size);
- DALI_TEST_EQUALS( pixelArea2.width, 50, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelArea2.height, 50, TEST_LOCATION );
+ DALI_TEST_EQUALS(pixelArea2.width, 50, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelArea2.height, 50, TEST_LOCATION);
params.mParams.clear();
- params["width"] <<pixelArea2.width;
- params["height"] <<pixelArea2.height;
- params["xoffset"] <<pixelArea2.x;
- params["yoffset"] <<pixelArea2.y;
- DALI_TEST_CHECK( callStack.FindMethodAndParams("TexSubImage2D", params ) );
+ params["width"] << pixelArea2.width;
+ params["height"] << pixelArea2.height;
+ params["xoffset"] << pixelArea2.x;
+ params["yoffset"] << pixelArea2.y;
+ DALI_TEST_CHECK(callStack.FindMethodAndParams("TexSubImage2D", params));
Rect<int> pixelArea3 = TextureCoordinateToPixelArea(textureRect3, size);
- DALI_TEST_EQUALS( pixelArea3.width, 128, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelArea3.height, 128, TEST_LOCATION );
+ DALI_TEST_EQUALS(pixelArea3.width, 128, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelArea3.height, 128, TEST_LOCATION);
params.mParams.clear();
- params["width"] <<pixelArea3.width;
- params["height"] <<pixelArea3.height;
- params["xoffset"] <<pixelArea3.x;
- params["yoffset"] <<pixelArea3.y;
- DALI_TEST_CHECK( callStack.FindMethodAndParams("TexSubImage2D", params ) );
+ params["width"] << pixelArea3.width;
+ params["height"] << pixelArea3.height;
+ params["xoffset"] << pixelArea3.x;
+ params["yoffset"] << pixelArea3.y;
+ DALI_TEST_CHECK(callStack.FindMethodAndParams("TexSubImage2D", params));
- DALI_TEST_CHECK( ! IsOverlap(pixelArea1, pixelArea2) );
- DALI_TEST_CHECK( ! IsOverlap(pixelArea1, pixelArea3) );
- DALI_TEST_CHECK( ! IsOverlap(pixelArea2, pixelArea3) );
+ DALI_TEST_CHECK(!IsOverlap(pixelArea1, pixelArea2));
+ DALI_TEST_CHECK(!IsOverlap(pixelArea1, pixelArea3));
+ DALI_TEST_CHECK(!IsOverlap(pixelArea2, pixelArea3));
END_TEST;
}
int UtcDaliImageAtlasUploadWithObserver01(void)
{
ToolkitTestApplication application;
- ImageAtlas atlas = ImageAtlas::New( 200, 200 );
-
+ ImageAtlas atlas = ImageAtlas::New(200, 200);
gCountOfTestFuncCall = 0;
TestUploadObserver uploadObserver;
Vector4 textureRect1;
- atlas.Upload( textureRect1, gImage_34_RGBA, ImageDimensions(34, 34), FittingMode::DEFAULT, true, &uploadObserver );
+ atlas.Upload(textureRect1, gImage_34_RGBA, ImageDimensions(34, 34), FittingMode::DEFAULT, true, &uploadObserver);
Vector4 textureRect2;
- atlas.Upload( textureRect2, gImage_50_RGBA, ImageDimensions(50, 50), FittingMode::DEFAULT, true, NULL );
+ atlas.Upload(textureRect2, gImage_50_RGBA, ImageDimensions(50, 50), FittingMode::DEFAULT, true, NULL);
Vector4 textureRect3;
- atlas.Upload( textureRect3, gImage_128_RGB, ImageDimensions(128, 128), FittingMode::DEFAULT, true, &uploadObserver );
+ atlas.Upload(textureRect3, gImage_128_RGB, ImageDimensions(128, 128), FittingMode::DEFAULT, true, &uploadObserver);
// waiting until all three images are loaded and uploaded to atlas
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 3 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(3), true, TEST_LOCATION);
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
// Check that TestFunc is called twice
- DALI_TEST_EQUALS( gCountOfTestFuncCall, 2, TEST_LOCATION );
+ DALI_TEST_EQUALS(gCountOfTestFuncCall, 2, TEST_LOCATION);
END_TEST;
}
int UtcDaliImageAtlasUploadWithObserver02(void)
{
ToolkitTestApplication application;
- ImageAtlas atlas = ImageAtlas::New( 200, 200 );
+ ImageAtlas atlas = ImageAtlas::New(200, 200);
- gCountOfTestFuncCall = 0;
+ gCountOfTestFuncCall = 0;
TestUploadObserver* uploadObserver = new TestUploadObserver;
Vector4 textureRect1;
- atlas.Upload( textureRect1, gImage_34_RGBA, ImageDimensions(34, 34), FittingMode::DEFAULT, true, uploadObserver );
+ atlas.Upload(textureRect1, gImage_34_RGBA, ImageDimensions(34, 34), FittingMode::DEFAULT, true, uploadObserver);
Vector4 textureRect2;
- atlas.Upload( textureRect2, gImage_50_RGBA, ImageDimensions(50, 50), FittingMode::DEFAULT, true, uploadObserver );
+ atlas.Upload(textureRect2, gImage_50_RGBA, ImageDimensions(50, 50), FittingMode::DEFAULT, true, uploadObserver);
Vector4 textureRect3;
- atlas.Upload( textureRect3, gImage_128_RGB, ImageDimensions(128, 128), FittingMode::DEFAULT, true, uploadObserver );
+ atlas.Upload(textureRect3, gImage_128_RGB, ImageDimensions(128, 128), FittingMode::DEFAULT, true, uploadObserver);
// destroy the object.
delete uploadObserver;
- // waiting until all three images are loaded and uploaded to atlas
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 3 ), true, TEST_LOCATION );
+ // waiting until all three images are loaded and uploaded to atlas
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(3), true, TEST_LOCATION);
application.Render(RENDER_FRAME_INTERVAL);
application.SendNotification();
// Check that TestFunc is called twice
- DALI_TEST_EQUALS( gCountOfTestFuncCall, 0, TEST_LOCATION );
+ DALI_TEST_EQUALS(gCountOfTestFuncCall, 0, TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- gCountOfTestFuncCall = 0;
+ gCountOfTestFuncCall = 0;
TestUploadObserver* uploadObserver = new TestUploadObserver;
{
- ImageAtlas atlas = ImageAtlas::New( 200, 200 );
+ ImageAtlas atlas = ImageAtlas::New(200, 200);
Vector4 textureRect1;
- atlas.Upload( textureRect1, gImage_34_RGBA, ImageDimensions(34, 34), FittingMode::DEFAULT, true, uploadObserver );
+ atlas.Upload(textureRect1, gImage_34_RGBA, ImageDimensions(34, 34), FittingMode::DEFAULT, true, uploadObserver);
Vector4 textureRect2;
- atlas.Upload( textureRect2, gImage_50_RGBA, ImageDimensions(50, 50), FittingMode::DEFAULT, true, uploadObserver );
+ atlas.Upload(textureRect2, gImage_50_RGBA, ImageDimensions(50, 50), FittingMode::DEFAULT, true, uploadObserver);
Vector4 textureRect3;
- atlas.Upload( textureRect3, gImage_128_RGB, ImageDimensions(128, 128), FittingMode::DEFAULT, true, uploadObserver );
+ atlas.Upload(textureRect3, gImage_128_RGB, ImageDimensions(128, 128), FittingMode::DEFAULT, true, uploadObserver);
}
//ImageAtlas is out of scope, so it will get destroyed
application.Render(RENDER_FRAME_INTERVAL);
// Check that TestFunc is called twice
- DALI_TEST_EQUALS( gCountOfTestFuncCall, 0, TEST_LOCATION );
+ DALI_TEST_EQUALS(gCountOfTestFuncCall, 0, TEST_LOCATION);
END_TEST;
}
int UtcDaliImageAtlasRemove(void)
{
ToolkitTestApplication application;
- unsigned int size = 100;
- ImageAtlas atlas = ImageAtlas::New( size, size );
- Vector4 textureRect1;
- atlas.Upload( textureRect1, gImage_34_RGBA, ImageDimensions(34, 34) );
+ unsigned int size = 100;
+ ImageAtlas atlas = ImageAtlas::New(size, size);
+ Vector4 textureRect1;
+ atlas.Upload(textureRect1, gImage_34_RGBA, ImageDimensions(34, 34));
- atlas.Remove( textureRect1 );
+ atlas.Remove(textureRect1);
Vector4 textureRect2;
- atlas.Upload( textureRect2, gImage_50_RGBA, ImageDimensions(50, 50) );
+ atlas.Upload(textureRect2, gImage_50_RGBA, ImageDimensions(50, 50));
// one pixel gap
Rect<int> pixelArea = TextureCoordinateToPixelArea(textureRect2, size);
- DALI_TEST_EQUALS( pixelArea.x, 0, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelArea.y, 0, TEST_LOCATION );
+ DALI_TEST_EQUALS(pixelArea.x, 0, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelArea.y, 0, TEST_LOCATION);
END_TEST;
}
Property::Map imageMap1;
- imageMap1[ ImageVisual::Property::URL ] = gImage_34_RGBA;
- imageMap1[ ImageVisual::Property::DESIRED_HEIGHT ] = 34;
- imageMap1[ ImageVisual::Property::DESIRED_WIDTH ] = 34;
- imageMap1[ ImageVisual::Property::ATLASING] = true;
+ imageMap1[ImageVisual::Property::URL] = gImage_34_RGBA;
+ imageMap1[ImageVisual::Property::DESIRED_HEIGHT] = 34;
+ imageMap1[ImageVisual::Property::DESIRED_WIDTH] = 34;
+ imageMap1[ImageVisual::Property::ATLASING] = true;
Property::Map imageMap2;
- imageMap2[ ImageVisual::Property::URL ] = gImage_50_RGBA;
- imageMap2[ ImageVisual::Property::DESIRED_HEIGHT ] = 50;
- imageMap2[ ImageVisual::Property::DESIRED_WIDTH ] = 50;
- imageMap2[ ImageVisual::Property::ATLASING ] = true;
+ imageMap2[ImageVisual::Property::URL] = gImage_50_RGBA;
+ imageMap2[ImageVisual::Property::DESIRED_HEIGHT] = 50;
+ imageMap2[ImageVisual::Property::DESIRED_WIDTH] = 50;
+ imageMap2[ImageVisual::Property::ATLASING] = true;
ImageView imageView1 = ImageView::New();
- imageView1.SetProperty( ImageView::Property::IMAGE, imageMap1 );
+ imageView1.SetProperty(ImageView::Property::IMAGE, imageMap1);
ImageView imageView2 = ImageView::New();
- imageView2.SetProperty( ImageView::Property::IMAGE, imageMap2 );
+ imageView2.SetProperty(ImageView::Property::IMAGE, imageMap2);
// ImageView doesn't do size negotiation properly: it only listens to OnSizeSet:
- imageView1.SetProperty( Actor::Property::SIZE, Vector2( 100, 100 ) );
- imageView2.SetProperty( Actor::Property::SIZE, Vector2( 100, 100 ) );
- imageView1.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- imageView2.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ imageView1.SetProperty(Actor::Property::SIZE, Vector2(100, 100));
+ imageView2.SetProperty(Actor::Property::SIZE, Vector2(100, 100));
+ imageView1.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ imageView2.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
- application.GetPlatform().SetClosestImageSize( Vector2(34, 34) );
- application.GetScene().Add( imageView1 );
- application.GetPlatform().SetClosestImageSize( Vector2(50, 50) );
- application.GetScene().Add( imageView2 );
+ application.GetPlatform().SetClosestImageSize(Vector2(34, 34));
+ application.GetScene().Add(imageView1);
+ application.GetPlatform().SetClosestImageSize(Vector2(50, 50));
+ application.GetScene().Add(imageView2);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
params2["xoffset"] << 0;
params2["yoffset"] << 34;
- DALI_TEST_EQUALS( callStack.FindMethodAndParams("TexSubImage2D", params1 ), true, TEST_LOCATION );
- DALI_TEST_EQUALS( callStack.FindMethodAndParams("TexSubImage2D", params2 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(callStack.FindMethodAndParams("TexSubImage2D", params1), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(callStack.FindMethodAndParams("TexSubImage2D", params2), true, TEST_LOCATION);
callStack.Reset();
callStack.Enable(true);
// remove the imageView2 from stage, the second image will also be removed from atlas
// then the space on the atlas will be used by the third image added.
- application.GetScene().Remove( imageView2 );
+ application.GetScene().Remove(imageView2);
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
Property::Map imageMap3;
- imageMap3[ ImageVisual::Property::URL ] = gImage_128_RGB;
- imageMap3[ ImageVisual::Property::DESIRED_HEIGHT ] = 100;
- imageMap3[ ImageVisual::Property::DESIRED_WIDTH ] = 100;
- imageMap3[ ImageVisual::Property::ATLASING ] = true;
+ imageMap3[ImageVisual::Property::URL] = gImage_128_RGB;
+ imageMap3[ImageVisual::Property::DESIRED_HEIGHT] = 100;
+ imageMap3[ImageVisual::Property::DESIRED_WIDTH] = 100;
+ imageMap3[ImageVisual::Property::ATLASING] = true;
ImageView imageView3 = ImageView::New();
- imageView3.SetProperty( ImageView::Property::IMAGE, imageMap3 );
+ imageView3.SetProperty(ImageView::Property::IMAGE, imageMap3);
- application.GetPlatform().SetClosestImageSize( Vector2(100, 100) );
- application.GetScene().Add( imageView3 );
+ application.GetPlatform().SetClosestImageSize(Vector2(100, 100));
+ application.GetScene().Add(imageView3);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
params3["xoffset"] << 0;
params3["yoffset"] << 34;
- DALI_TEST_EQUALS( callStack.FindMethodAndParams("TexSubImage2D", params3 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(callStack.FindMethodAndParams("TexSubImage2D", params3), true, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
std::vector<PixelData> pixelDataContainer;
- pixelDataContainer.push_back( CreatePixelData( 20, 30 ) );
- pixelDataContainer.push_back( CreatePixelData( 10, 10 ) );
- pixelDataContainer.push_back( CreatePixelData( 45, 30 ) );
- pixelDataContainer.push_back( CreatePixelData( 20, 20 ) );
+ pixelDataContainer.push_back(CreatePixelData(20, 30));
+ pixelDataContainer.push_back(CreatePixelData(10, 10));
+ pixelDataContainer.push_back(CreatePixelData(45, 30));
+ pixelDataContainer.push_back(CreatePixelData(20, 20));
Dali::Vector<Vector4> textureRects;
- Texture texture = ImageAtlas::PackToAtlas( pixelDataContainer, textureRects );
+ Texture texture = ImageAtlas::PackToAtlas(pixelDataContainer, textureRects);
- // --------------
- // | |
- // | 45*30 |
-// | |
-// --------------
-// | 20 | | 20*20
-// | * |____|
-// | 30 | | 10*10
-// --------
+ // --------------
+ // | |
+ // | 45*30 |
+ // | |
+ // --------------
+ // | 20 | | 20*20
+ // | * |____|
+ // | 30 | | 10*10
+ // --------
- DALI_TEST_EQUALS( texture.GetWidth(), 45, TEST_LOCATION );
- DALI_TEST_EQUALS( texture.GetHeight(), 60, TEST_LOCATION );
+ DALI_TEST_EQUALS(texture.GetWidth(), 45, TEST_LOCATION);
+ DALI_TEST_EQUALS(texture.GetHeight(), 60, TEST_LOCATION);
Rect<int> pixelArea = TextureCoordinateToPixelArea(textureRects[0], texture.GetWidth(), texture.GetHeight());
- DALI_TEST_EQUALS( pixelArea.x, 0, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelArea.y, 30, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelArea.width, 20, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelArea.height, 30, TEST_LOCATION );
+ DALI_TEST_EQUALS(pixelArea.x, 0, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelArea.y, 30, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelArea.width, 20, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelArea.height, 30, TEST_LOCATION);
pixelArea = TextureCoordinateToPixelArea(textureRects[1], texture.GetWidth(), texture.GetHeight());
- DALI_TEST_EQUALS( pixelArea.x, 20, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelArea.y, 50, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelArea.width, 10, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelArea.height, 10, TEST_LOCATION );
+ DALI_TEST_EQUALS(pixelArea.x, 20, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelArea.y, 50, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelArea.width, 10, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelArea.height, 10, TEST_LOCATION);
pixelArea = TextureCoordinateToPixelArea(textureRects[2], texture.GetWidth(), texture.GetHeight());
- DALI_TEST_EQUALS( pixelArea.x, 0, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelArea.y, 0, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelArea.width, 45, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelArea.height, 30, TEST_LOCATION );
+ DALI_TEST_EQUALS(pixelArea.x, 0, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelArea.y, 0, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelArea.width, 45, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelArea.height, 30, TEST_LOCATION);
pixelArea = TextureCoordinateToPixelArea(textureRects[3], texture.GetWidth(), texture.GetHeight());
- DALI_TEST_EQUALS( pixelArea.x, 20, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelArea.y, 30, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelArea.width, 20, TEST_LOCATION );
- DALI_TEST_EQUALS( pixelArea.height, 20, TEST_LOCATION );
+ DALI_TEST_EQUALS(pixelArea.x, 20, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelArea.y, 30, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelArea.width, 20, TEST_LOCATION);
+ DALI_TEST_EQUALS(pixelArea.height, 20, TEST_LOCATION);
END_TEST;
}
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
* limitations under the License.
*/
-#include <iostream>
#include <stdlib.h>
+#include <iostream>
+
#include <dali-toolkit-test-suite-utils.h>
+
#include <dali-toolkit/public-api/image-loader/image-url.h>
using namespace Dali;
// Test default constructor.
ImageUrl imageUrl;
- DALI_TEST_CHECK( !imageUrl );
+ DALI_TEST_CHECK(!imageUrl);
// Test object creation
Texture image = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 4u, 4u); // test texture
- imageUrl = ImageUrl::New(image);
- DALI_TEST_CHECK( imageUrl );
+ imageUrl = ImageUrl::New(image);
+ DALI_TEST_CHECK(imageUrl);
// Test copy constructor
- ImageUrl ImageUrlCopy( imageUrl );
- DALI_TEST_CHECK( ImageUrlCopy );
+ ImageUrl ImageUrlCopy(imageUrl);
+ DALI_TEST_CHECK(ImageUrlCopy);
// Test down cast
BaseHandle baseUrl;
- baseUrl = imageUrl;
- ImageUrl downcastUrl = ImageUrl::DownCast( baseUrl );
- DALI_TEST_CHECK( downcastUrl );
+ baseUrl = imageUrl;
+ ImageUrl downcastUrl = ImageUrl::DownCast(baseUrl);
+ DALI_TEST_CHECK(downcastUrl);
END_TEST;
-}
\ No newline at end of file
+}
*
*/
+#include <unistd.h>
+#include <sstream>
+
// 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 <toolkit-event-thread-callback.h>
+#include "dummy-control.h"
+
+#include <test-encoded-image-buffer.h>
+#include <test-native-image.h>
#include <dali-toolkit/dali-toolkit.h>
-#include <dali/devel-api/scripting/scripting.h>
#include <dali-toolkit/devel-api/controls/control-devel.h>
#include <dali-toolkit/devel-api/image-loader/texture-manager.h>
+#include <dali-toolkit/devel-api/styling/style-manager-devel.h>
#include <dali-toolkit/devel-api/visual-factory/visual-base.h>
-#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
#include <dali-toolkit/devel-api/visuals/image-visual-actions-devel.h>
+#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
-#include <dali-toolkit/public-api/image-loader/image.h>
#include <dali-toolkit/public-api/image-loader/image-url.h>
-#include <dali-toolkit/devel-api/styling/style-manager-devel.h>
-
-#include <test-native-image.h>
-#include <test-encoded-image-buffer.h>
-#include <sstream>
-#include <unistd.h>
-
-
-#include "dummy-control.h"
+#include <dali-toolkit/public-api/image-loader/image.h>
+#include <dali/devel-api/scripting/scripting.h>
using namespace Dali;
using namespace Toolkit;
namespace
{
-
-const char* TEST_IMAGE_FILE_NAME = "gallery_image_01.jpg";
-const char* TEST_IMAGE_FILE_NAME2 = "gallery_image_02.jpg";
+const char* TEST_IMAGE_FILE_NAME = "gallery_image_01.jpg";
+const char* TEST_IMAGE_FILE_NAME2 = "gallery_image_02.jpg";
const char* TEST_IMAGE_1 = TEST_RESOURCE_DIR "/TB-gloss.png";
const char* TEST_IMAGE_2 = TEST_RESOURCE_DIR "/tb-norm.png";
const char* TEST_BROKEN_IMAGE_DEFAULT = TEST_RESOURCE_DIR "/broken.png";
-const char* TEST_BROKEN_IMAGE_S = TEST_RESOURCE_DIR "/broken_s.9.png";
-const char* TEST_BROKEN_IMAGE_M = TEST_RESOURCE_DIR "/broken_m.9.png";
-const char* TEST_BROKEN_IMAGE_L = TEST_RESOURCE_DIR "/broken_l.9.png";
-const char* TEST_BROKEN_IMAGE_01 = TEST_RESOURCE_DIR "/button-up.9.png";
-const char* TEST_BROKEN_IMAGE_02 = TEST_RESOURCE_DIR "/heartsframe.9.png";
+const char* TEST_BROKEN_IMAGE_S = TEST_RESOURCE_DIR "/broken_s.9.png";
+const char* TEST_BROKEN_IMAGE_M = TEST_RESOURCE_DIR "/broken_m.9.png";
+const char* TEST_BROKEN_IMAGE_L = TEST_RESOURCE_DIR "/broken_l.9.png";
+const char* TEST_BROKEN_IMAGE_01 = TEST_RESOURCE_DIR "/button-up.9.png";
+const char* TEST_BROKEN_IMAGE_02 = TEST_RESOURCE_DIR "/heartsframe.9.png";
// resolution: 34*34, pixel format: RGBA8888
static const char* gImage_34_RGBA = TEST_RESOURCE_DIR "/icon-edit.png";
// resolution: 50*50, frame count: 4, frame delay: 0.2 second for each frame
const char* TEST_GIF_FILE_NAME = TEST_RESOURCE_DIR "/anim.gif";
-const char* TEST_VECTOR_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/insta_camera.json";
+const char* TEST_VECTOR_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/insta_camera.json";
-void TestUrl( ImageView imageView, const std::string url )
+void TestUrl(ImageView imageView, const std::string url)
{
- Property::Value value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
+ Property::Value value = imageView.GetProperty(imageView.GetPropertyIndex("image"));
std::string urlActual;
- DALI_TEST_CHECK( value.Get( urlActual ) );
- DALI_TEST_EQUALS( urlActual, url, TEST_LOCATION );
+ DALI_TEST_CHECK(value.Get(urlActual));
+ DALI_TEST_EQUALS(urlActual, url, TEST_LOCATION);
}
} // namespace
ImageView imageView = ImageView::New();
- DALI_TEST_CHECK( imageView );
+ DALI_TEST_CHECK(imageView);
END_TEST;
}
{
ToolkitTestApplication application;
- ImageView imageView = ImageView::New( TEST_IMAGE_FILE_NAME );
- DALI_TEST_CHECK( imageView );
+ ImageView imageView = ImageView::New(TEST_IMAGE_FILE_NAME);
+ DALI_TEST_CHECK(imageView);
- TestUrl( imageView, TEST_IMAGE_FILE_NAME );
+ TestUrl(imageView, TEST_IMAGE_FILE_NAME);
END_TEST;
}
ImageView imageView;
- DALI_TEST_CHECK( !imageView );
+ DALI_TEST_CHECK(!imageView);
END_TEST;
}
// Initialize an object, ref count == 1
ImageView imageView = ImageView::New();
- ImageView copy( imageView );
- DALI_TEST_CHECK( copy );
+ ImageView copy(imageView);
+ DALI_TEST_CHECK(copy);
END_TEST;
}
ToolkitTestApplication application;
ImageView imageView = ImageView::New();
- DALI_TEST_EQUALS( 1, imageView.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- imageView.SetProperty( Actor::Property::SENSITIVE, false );
- DALI_TEST_CHECK( false == imageView.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+ DALI_TEST_EQUALS(1, imageView.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ imageView.SetProperty(Actor::Property::SENSITIVE, false);
+ DALI_TEST_CHECK(false == imageView.GetProperty<bool>(Actor::Property::SENSITIVE));
- ImageView moved = std::move( imageView );
- 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( !imageView );
+ ImageView moved = std::move(imageView);
+ 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(!imageView);
END_TEST;
}
ImageView imageView = ImageView::New();
- ImageView copy( imageView );
- DALI_TEST_CHECK( copy );
- DALI_TEST_EQUALS( imageView, copy, TEST_LOCATION );
+ ImageView copy(imageView);
+ DALI_TEST_CHECK(copy);
+ DALI_TEST_EQUALS(imageView, copy, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
ImageView imageView = ImageView::New();
- DALI_TEST_EQUALS( 1, imageView.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- imageView.SetProperty( Actor::Property::SENSITIVE, false );
- DALI_TEST_CHECK( false == imageView.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+ DALI_TEST_EQUALS(1, imageView.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ imageView.SetProperty(Actor::Property::SENSITIVE, false);
+ DALI_TEST_CHECK(false == imageView.GetProperty<bool>(Actor::Property::SENSITIVE));
ImageView moved;
- moved = std::move( imageView );
- 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( !imageView );
+ moved = std::move(imageView);
+ 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(!imageView);
END_TEST;
}
BaseHandle object(imageView);
- ImageView imageView2 = ImageView::DownCast( object );
+ ImageView imageView2 = ImageView::DownCast(object);
DALI_TEST_CHECK(imageView2);
- ImageView imageView3 = DownCast< ImageView >( object );
+ ImageView imageView3 = DownCast<ImageView>(object);
DALI_TEST_CHECK(imageView3);
END_TEST;
BaseHandle unInitializedObject;
- ImageView imageView1 = ImageView::DownCast( unInitializedObject );
- DALI_TEST_CHECK( !imageView1 );
+ ImageView imageView1 = ImageView::DownCast(unInitializedObject);
+ DALI_TEST_CHECK(!imageView1);
- ImageView imageView2 = DownCast< ImageView >( unInitializedObject );
- DALI_TEST_CHECK( !imageView2 );
+ ImageView imageView2 = DownCast<ImageView>(unInitializedObject);
+ DALI_TEST_CHECK(!imageView2);
END_TEST;
}
ToolkitTestApplication application;
TypeRegistry typeRegistry = TypeRegistry::Get();
- DALI_TEST_CHECK( typeRegistry );
+ DALI_TEST_CHECK(typeRegistry);
- TypeInfo typeInfo = typeRegistry.GetTypeInfo( "ImageView" );
- DALI_TEST_CHECK( typeInfo );
+ TypeInfo typeInfo = typeRegistry.GetTypeInfo("ImageView");
+ DALI_TEST_CHECK(typeInfo);
BaseHandle handle = typeInfo.CreateInstance();
- DALI_TEST_CHECK( handle );
+ DALI_TEST_CHECK(handle);
- ImageView imageView = ImageView::DownCast( handle );
- DALI_TEST_CHECK( imageView );
+ ImageView imageView = ImageView::DownCast(handle);
+ DALI_TEST_CHECK(imageView);
END_TEST;
}
ImageView imageView = ImageView::New();
- Property::Index idx = imageView.GetPropertyIndex( "image" );
- DALI_TEST_EQUALS( idx, (Property::Index)ImageView::Property::IMAGE, TEST_LOCATION );
+ Property::Index idx = imageView.GetPropertyIndex("image");
+ DALI_TEST_EQUALS(idx, (Property::Index)ImageView::Property::IMAGE, TEST_LOCATION);
- imageView.SetProperty( idx, TEST_IMAGE_FILE_NAME );
- TestUrl( imageView, TEST_IMAGE_FILE_NAME );
+ imageView.SetProperty(idx, TEST_IMAGE_FILE_NAME);
+ TestUrl(imageView, TEST_IMAGE_FILE_NAME);
END_TEST;
}
ToolkitTestApplication application;
// Set up trace debug
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
- textureTrace.Enable( true );
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
+ textureTrace.Enable(true);
Property::Map imageMap;
- imageMap[ ImageVisual::Property::URL ] = gImage_34_RGBA;
- imageMap[ ImageVisual::Property::RELEASE_POLICY] = ImageVisual::ReleasePolicy::NEVER; // To keep the texture cache
+ imageMap[ImageVisual::Property::URL] = gImage_34_RGBA;
+ imageMap[ImageVisual::Property::RELEASE_POLICY] = ImageVisual::ReleasePolicy::NEVER; // To keep the texture cache
ImageView imageView1 = ImageView::New();
- imageView1.SetProperty( ImageView::Property::IMAGE, imageMap );
+ imageView1.SetProperty(ImageView::Property::IMAGE, imageMap);
- application.GetScene().Add( imageView1 );
+ application.GetScene().Add(imageView1);
- Property::Value value = imageView1.GetProperty( ImageView::Property::PRE_MULTIPLIED_ALPHA );
- bool enable;
- DALI_TEST_CHECK( value.Get( enable ) );
- DALI_TEST_CHECK( enable ); // Default value is true
+ Property::Value value = imageView1.GetProperty(ImageView::Property::PRE_MULTIPLIED_ALPHA);
+ bool enable;
+ DALI_TEST_CHECK(value.Get(enable));
+ DALI_TEST_CHECK(enable); // Default value is true
// loading started, this waits for the loader thread for max 30 seconds
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- value = imageView1.GetProperty( ImageView::Property::PRE_MULTIPLIED_ALPHA );
- DALI_TEST_CHECK( value.Get( enable ) );
- DALI_TEST_CHECK( enable ); // Keep true
+ value = imageView1.GetProperty(ImageView::Property::PRE_MULTIPLIED_ALPHA);
+ DALI_TEST_CHECK(value.Get(enable));
+ DALI_TEST_CHECK(enable); // Keep true
// conventional alpha blending
- Renderer renderer1 = imageView1.GetRendererAt( 0 );
- value = renderer1.GetProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA );
- DALI_TEST_CHECK( value.Get( enable ) );
- DALI_TEST_CHECK( enable );
-
- int srcFactorRgb = renderer1.GetProperty<int>( Renderer::Property::BLEND_FACTOR_SRC_RGB );
- int destFactorRgb = renderer1.GetProperty<int>( Renderer::Property::BLEND_FACTOR_DEST_RGB );
- int srcFactorAlpha = renderer1.GetProperty<int>( Renderer::Property::BLEND_FACTOR_SRC_ALPHA );
- int destFactorAlpha = renderer1.GetProperty<int>( Renderer::Property::BLEND_FACTOR_DEST_ALPHA );
- DALI_TEST_CHECK( srcFactorRgb == BlendFactor::ONE );
- DALI_TEST_CHECK( destFactorRgb == BlendFactor::ONE_MINUS_SRC_ALPHA );
- DALI_TEST_CHECK( srcFactorAlpha == BlendFactor::ONE );
- DALI_TEST_CHECK( destFactorAlpha == BlendFactor::ONE_MINUS_SRC_ALPHA );
-
- DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION ); // A new texture should be generated.
+ Renderer renderer1 = imageView1.GetRendererAt(0);
+ value = renderer1.GetProperty(Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA);
+ DALI_TEST_CHECK(value.Get(enable));
+ DALI_TEST_CHECK(enable);
+
+ int srcFactorRgb = renderer1.GetProperty<int>(Renderer::Property::BLEND_FACTOR_SRC_RGB);
+ int destFactorRgb = renderer1.GetProperty<int>(Renderer::Property::BLEND_FACTOR_DEST_RGB);
+ int srcFactorAlpha = renderer1.GetProperty<int>(Renderer::Property::BLEND_FACTOR_SRC_ALPHA);
+ int destFactorAlpha = renderer1.GetProperty<int>(Renderer::Property::BLEND_FACTOR_DEST_ALPHA);
+ DALI_TEST_CHECK(srcFactorRgb == BlendFactor::ONE);
+ DALI_TEST_CHECK(destFactorRgb == BlendFactor::ONE_MINUS_SRC_ALPHA);
+ DALI_TEST_CHECK(srcFactorAlpha == BlendFactor::ONE);
+ DALI_TEST_CHECK(destFactorAlpha == BlendFactor::ONE_MINUS_SRC_ALPHA);
+
+ DALI_TEST_EQUALS(textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION); // A new texture should be generated.
textureTrace.Reset();
// Disable pre-multiplied alpha blending
- imageView1.SetProperty( ImageView::Property::PRE_MULTIPLIED_ALPHA, false );
+ imageView1.SetProperty(ImageView::Property::PRE_MULTIPLIED_ALPHA, false);
// Reload the image
Property::Map attributes;
- DevelControl::DoAction( imageView1, ImageView::Property::IMAGE, DevelImageVisual::Action::RELOAD, attributes );
+ DevelControl::DoAction(imageView1, ImageView::Property::IMAGE, DevelImageVisual::Action::RELOAD, attributes);
// loading started, this waits for the loader thread for max 30 seconds
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- value = imageView1.GetProperty( ImageView::Property::PRE_MULTIPLIED_ALPHA );
- DALI_TEST_CHECK( value.Get( enable ) );
- DALI_TEST_CHECK( !enable );
+ value = imageView1.GetProperty(ImageView::Property::PRE_MULTIPLIED_ALPHA);
+ DALI_TEST_CHECK(value.Get(enable));
+ DALI_TEST_CHECK(!enable);
// conventional alpha blending
- value = renderer1.GetProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA );
- DALI_TEST_CHECK( value.Get( enable ) );
- DALI_TEST_CHECK( !enable );
-
- srcFactorRgb = renderer1.GetProperty<int>( Renderer::Property::BLEND_FACTOR_SRC_RGB );
- destFactorRgb = renderer1.GetProperty<int>( Renderer::Property::BLEND_FACTOR_DEST_RGB );
- srcFactorAlpha = renderer1.GetProperty<int>( Renderer::Property::BLEND_FACTOR_SRC_ALPHA );
- destFactorAlpha = renderer1.GetProperty<int>( Renderer::Property::BLEND_FACTOR_DEST_ALPHA );
- DALI_TEST_CHECK( srcFactorRgb == BlendFactor::SRC_ALPHA );
- DALI_TEST_CHECK( destFactorRgb == BlendFactor::ONE_MINUS_SRC_ALPHA );
- DALI_TEST_CHECK( srcFactorAlpha == BlendFactor::ONE );
- DALI_TEST_CHECK( destFactorAlpha == BlendFactor::ONE_MINUS_SRC_ALPHA );
-
- DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION ); // A new texture should be generated.
+ value = renderer1.GetProperty(Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA);
+ DALI_TEST_CHECK(value.Get(enable));
+ DALI_TEST_CHECK(!enable);
+
+ srcFactorRgb = renderer1.GetProperty<int>(Renderer::Property::BLEND_FACTOR_SRC_RGB);
+ destFactorRgb = renderer1.GetProperty<int>(Renderer::Property::BLEND_FACTOR_DEST_RGB);
+ srcFactorAlpha = renderer1.GetProperty<int>(Renderer::Property::BLEND_FACTOR_SRC_ALPHA);
+ destFactorAlpha = renderer1.GetProperty<int>(Renderer::Property::BLEND_FACTOR_DEST_ALPHA);
+ DALI_TEST_CHECK(srcFactorRgb == BlendFactor::SRC_ALPHA);
+ DALI_TEST_CHECK(destFactorRgb == BlendFactor::ONE_MINUS_SRC_ALPHA);
+ DALI_TEST_CHECK(srcFactorAlpha == BlendFactor::ONE);
+ DALI_TEST_CHECK(destFactorAlpha == BlendFactor::ONE_MINUS_SRC_ALPHA);
+
+ DALI_TEST_EQUALS(textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION); // A new texture should be generated.
textureTrace.Reset();
// Make a new ImageView using the same image
ImageView imageView2 = ImageView::New();
- imageView2.SetProperty( ImageView::Property::IMAGE, imageMap );
+ imageView2.SetProperty(ImageView::Property::IMAGE, imageMap);
- application.GetScene().Add( imageView2 );
+ application.GetScene().Add(imageView2);
application.SendNotification();
application.Render();
- Renderer renderer2 = imageView2.GetRendererAt( 0 );
- value = renderer2.GetProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA );
- DALI_TEST_CHECK( value.Get( enable ) );
- DALI_TEST_CHECK( enable );
+ Renderer renderer2 = imageView2.GetRendererAt(0);
+ value = renderer2.GetProperty(Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA);
+ DALI_TEST_CHECK(value.Get(enable));
+ DALI_TEST_CHECK(enable);
- srcFactorRgb = renderer2.GetProperty<int>( Renderer::Property::BLEND_FACTOR_SRC_RGB );
- destFactorRgb = renderer2.GetProperty<int>( Renderer::Property::BLEND_FACTOR_DEST_RGB );
- srcFactorAlpha = renderer2.GetProperty<int>( Renderer::Property::BLEND_FACTOR_SRC_ALPHA );
- destFactorAlpha = renderer2.GetProperty<int>( Renderer::Property::BLEND_FACTOR_DEST_ALPHA );
- DALI_TEST_CHECK( srcFactorRgb == BlendFactor::ONE );
- DALI_TEST_CHECK( destFactorRgb == BlendFactor::ONE_MINUS_SRC_ALPHA );
- DALI_TEST_CHECK( srcFactorAlpha == BlendFactor::ONE );
- DALI_TEST_CHECK( destFactorAlpha == BlendFactor::ONE_MINUS_SRC_ALPHA );
+ srcFactorRgb = renderer2.GetProperty<int>(Renderer::Property::BLEND_FACTOR_SRC_RGB);
+ destFactorRgb = renderer2.GetProperty<int>(Renderer::Property::BLEND_FACTOR_DEST_RGB);
+ srcFactorAlpha = renderer2.GetProperty<int>(Renderer::Property::BLEND_FACTOR_SRC_ALPHA);
+ destFactorAlpha = renderer2.GetProperty<int>(Renderer::Property::BLEND_FACTOR_DEST_ALPHA);
+ DALI_TEST_CHECK(srcFactorRgb == BlendFactor::ONE);
+ DALI_TEST_CHECK(destFactorRgb == BlendFactor::ONE_MINUS_SRC_ALPHA);
+ DALI_TEST_CHECK(srcFactorAlpha == BlendFactor::ONE);
+ DALI_TEST_CHECK(destFactorAlpha == BlendFactor::ONE_MINUS_SRC_ALPHA);
- DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), false, TEST_LOCATION ); // The cached texture should be used.
+ DALI_TEST_EQUALS(textureTrace.FindMethod("GenTextures"), false, TEST_LOCATION); // The cached texture should be used.
END_TEST;
}
ToolkitTestApplication application;
// Set up trace debug
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
- textureTrace.Enable( true );
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
+ textureTrace.Enable(true);
Property::Map imageMap;
- imageMap[ ImageVisual::Property::URL ] = gImage_600_RGB;
- imageMap[ ImageVisual::Property::RELEASE_POLICY] = ImageVisual::ReleasePolicy::NEVER; // To keep the texture cache
+ imageMap[ImageVisual::Property::URL] = gImage_600_RGB;
+ imageMap[ImageVisual::Property::RELEASE_POLICY] = ImageVisual::ReleasePolicy::NEVER; // To keep the texture cache
ImageView imageView1 = ImageView::New();
- imageView1.SetProperty( ImageView::Property::IMAGE, imageMap );
+ imageView1.SetProperty(ImageView::Property::IMAGE, imageMap);
- application.GetScene().Add( imageView1 );
+ application.GetScene().Add(imageView1);
- Property::Value value = imageView1.GetProperty( ImageView::Property::PRE_MULTIPLIED_ALPHA );
- bool enable;
- DALI_TEST_CHECK( value.Get( enable ) );
- DALI_TEST_CHECK( enable ); // Default value is true
+ Property::Value value = imageView1.GetProperty(ImageView::Property::PRE_MULTIPLIED_ALPHA);
+ bool enable;
+ DALI_TEST_CHECK(value.Get(enable));
+ DALI_TEST_CHECK(enable); // Default value is true
// loading started, this waits for the loader thread for max 30 seconds
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- value = imageView1.GetProperty( ImageView::Property::PRE_MULTIPLIED_ALPHA );
- DALI_TEST_CHECK( value.Get( enable ) );
- DALI_TEST_CHECK( !enable ); // Should be false after loading
+ value = imageView1.GetProperty(ImageView::Property::PRE_MULTIPLIED_ALPHA);
+ DALI_TEST_CHECK(value.Get(enable));
+ DALI_TEST_CHECK(!enable); // Should be false after loading
// conventional alpha blending
- Renderer renderer1 = imageView1.GetRendererAt( 0 );
- value = renderer1.GetProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA );
- DALI_TEST_CHECK( value.Get( enable ) );
- DALI_TEST_CHECK( !enable );
-
- int srcFactorRgb = renderer1.GetProperty<int>( Renderer::Property::BLEND_FACTOR_SRC_RGB );
- int destFactorRgb = renderer1.GetProperty<int>( Renderer::Property::BLEND_FACTOR_DEST_RGB );
- int srcFactorAlpha = renderer1.GetProperty<int>( Renderer::Property::BLEND_FACTOR_SRC_ALPHA );
- int destFactorAlpha = renderer1.GetProperty<int>( Renderer::Property::BLEND_FACTOR_DEST_ALPHA );
- DALI_TEST_CHECK( srcFactorRgb == BlendFactor::SRC_ALPHA );
- DALI_TEST_CHECK( destFactorRgb == BlendFactor::ONE_MINUS_SRC_ALPHA );
- DALI_TEST_CHECK( srcFactorAlpha == BlendFactor::ONE );
- DALI_TEST_CHECK( destFactorAlpha == BlendFactor::ONE_MINUS_SRC_ALPHA );
-
- DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION ); // A new texture should be generated.
+ Renderer renderer1 = imageView1.GetRendererAt(0);
+ value = renderer1.GetProperty(Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA);
+ DALI_TEST_CHECK(value.Get(enable));
+ DALI_TEST_CHECK(!enable);
+
+ int srcFactorRgb = renderer1.GetProperty<int>(Renderer::Property::BLEND_FACTOR_SRC_RGB);
+ int destFactorRgb = renderer1.GetProperty<int>(Renderer::Property::BLEND_FACTOR_DEST_RGB);
+ int srcFactorAlpha = renderer1.GetProperty<int>(Renderer::Property::BLEND_FACTOR_SRC_ALPHA);
+ int destFactorAlpha = renderer1.GetProperty<int>(Renderer::Property::BLEND_FACTOR_DEST_ALPHA);
+ DALI_TEST_CHECK(srcFactorRgb == BlendFactor::SRC_ALPHA);
+ DALI_TEST_CHECK(destFactorRgb == BlendFactor::ONE_MINUS_SRC_ALPHA);
+ DALI_TEST_CHECK(srcFactorAlpha == BlendFactor::ONE);
+ DALI_TEST_CHECK(destFactorAlpha == BlendFactor::ONE_MINUS_SRC_ALPHA);
+
+ DALI_TEST_EQUALS(textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION); // A new texture should be generated.
textureTrace.Reset();
ImageView imageView2 = ImageView::New();
- imageView2.SetProperty( ImageView::Property::IMAGE, imageMap );
+ imageView2.SetProperty(ImageView::Property::IMAGE, imageMap);
// Disable pre-multiplied alpha blending
- imageView2.SetProperty( ImageView::Property::PRE_MULTIPLIED_ALPHA, false );
+ imageView2.SetProperty(ImageView::Property::PRE_MULTIPLIED_ALPHA, false);
- application.GetScene().Add( imageView2 );
+ application.GetScene().Add(imageView2);
application.SendNotification();
application.Render();
- value = imageView2.GetProperty( ImageView::Property::PRE_MULTIPLIED_ALPHA );
- DALI_TEST_CHECK( value.Get( enable ) );
- DALI_TEST_CHECK( !enable );
+ value = imageView2.GetProperty(ImageView::Property::PRE_MULTIPLIED_ALPHA);
+ DALI_TEST_CHECK(value.Get(enable));
+ DALI_TEST_CHECK(!enable);
// conventional alpha blending
- Renderer renderer2 = imageView2.GetRendererAt( 0 );
- value = renderer2.GetProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA );
- DALI_TEST_CHECK( value.Get( enable ) );
- DALI_TEST_CHECK( !enable );
+ Renderer renderer2 = imageView2.GetRendererAt(0);
+ value = renderer2.GetProperty(Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA);
+ DALI_TEST_CHECK(value.Get(enable));
+ DALI_TEST_CHECK(!enable);
- srcFactorRgb = renderer2.GetProperty<int>( Renderer::Property::BLEND_FACTOR_SRC_RGB );
- destFactorRgb = renderer2.GetProperty<int>( Renderer::Property::BLEND_FACTOR_DEST_RGB );
- srcFactorAlpha = renderer2.GetProperty<int>( Renderer::Property::BLEND_FACTOR_SRC_ALPHA );
- destFactorAlpha = renderer2.GetProperty<int>( Renderer::Property::BLEND_FACTOR_DEST_ALPHA );
- DALI_TEST_CHECK( srcFactorRgb == BlendFactor::SRC_ALPHA );
- DALI_TEST_CHECK( destFactorRgb == BlendFactor::ONE_MINUS_SRC_ALPHA );
- DALI_TEST_CHECK( srcFactorAlpha == BlendFactor::ONE );
- DALI_TEST_CHECK( destFactorAlpha == BlendFactor::ONE_MINUS_SRC_ALPHA );
+ srcFactorRgb = renderer2.GetProperty<int>(Renderer::Property::BLEND_FACTOR_SRC_RGB);
+ destFactorRgb = renderer2.GetProperty<int>(Renderer::Property::BLEND_FACTOR_DEST_RGB);
+ srcFactorAlpha = renderer2.GetProperty<int>(Renderer::Property::BLEND_FACTOR_SRC_ALPHA);
+ destFactorAlpha = renderer2.GetProperty<int>(Renderer::Property::BLEND_FACTOR_DEST_ALPHA);
+ DALI_TEST_CHECK(srcFactorRgb == BlendFactor::SRC_ALPHA);
+ DALI_TEST_CHECK(destFactorRgb == BlendFactor::ONE_MINUS_SRC_ALPHA);
+ DALI_TEST_CHECK(srcFactorAlpha == BlendFactor::ONE);
+ DALI_TEST_CHECK(destFactorAlpha == BlendFactor::ONE_MINUS_SRC_ALPHA);
- DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), false, TEST_LOCATION ); // The cached texture should be used.
+ DALI_TEST_EQUALS(textureTrace.FindMethod("GenTextures"), false, TEST_LOCATION); // The cached texture should be used.
END_TEST;
}
ToolkitTestApplication application;
static std::vector<UniformData> customUniforms =
- {
- UniformData("pixelArea", Property::Type::VECTOR4),
- };
+ {
+ UniformData("pixelArea", Property::Type::VECTOR4),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
// Gif image, use AnimatedImageVisual internally
// Atlasing is applied to pack multiple frames, use custom wrap mode
- ImageView gifView = ImageView::New();
- const Vector4 pixelAreaVisual( 0.f, 0.f, 2.f, 2.f );
- gifView.SetProperty( ImageView::Property::IMAGE,
- Property::Map().Add( ImageVisual::Property::URL, TEST_GIF_FILE_NAME )
- .Add( ImageVisual::Property::PIXEL_AREA, pixelAreaVisual ) );
+ ImageView gifView = ImageView::New();
+ const Vector4 pixelAreaVisual(0.f, 0.f, 2.f, 2.f);
+ gifView.SetProperty(ImageView::Property::IMAGE,
+ Property::Map().Add(ImageVisual::Property::URL, TEST_GIF_FILE_NAME).Add(ImageVisual::Property::PIXEL_AREA, pixelAreaVisual));
// Add to stage
Integration::Scene stage = application.GetScene();
- stage.Add( gifView );
+ stage.Add(gifView);
// loading started
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( gifView.GetRendererCount() == 1u );
+ DALI_TEST_CHECK(gifView.GetRendererCount() == 1u);
- const Vector4 fullTextureRect( 0.f, 0.f, 1.f, 1.f );
+ const Vector4 fullTextureRect(0.f, 0.f, 1.f, 1.f);
// test that the pixel area value defined in the visual property map is registered on renderer
- Renderer renderer = gifView.GetRendererAt(0);
- Property::Value pixelAreaValue = renderer.GetProperty( renderer.GetPropertyIndex( "pixelArea" ) );
- DALI_TEST_EQUALS( pixelAreaValue.Get<Vector4>(), pixelAreaVisual, TEST_LOCATION );
+ Renderer renderer = gifView.GetRendererAt(0);
+ Property::Value pixelAreaValue = renderer.GetProperty(renderer.GetPropertyIndex("pixelArea"));
+ DALI_TEST_EQUALS(pixelAreaValue.Get<Vector4>(), pixelAreaVisual, TEST_LOCATION);
// test that the shader has the default pixel area value registered.
- Shader shader = renderer.GetShader();
- pixelAreaValue = shader.GetProperty( shader.GetPropertyIndex( "pixelArea" ) );
- DALI_TEST_EQUALS( pixelAreaValue.Get<Vector4>(), fullTextureRect, TEST_LOCATION );
+ Shader shader = renderer.GetShader();
+ pixelAreaValue = shader.GetProperty(shader.GetPropertyIndex("pixelArea"));
+ DALI_TEST_EQUALS(pixelAreaValue.Get<Vector4>(), fullTextureRect, TEST_LOCATION);
// test that the uniform uses the pixelArea property on the renderer.
TestGlAbstraction& gl = application.GetGlAbstraction();
- Vector4 pixelAreaUniform;
- DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "pixelArea", pixelAreaUniform ) );
- DALI_TEST_EQUALS( pixelAreaVisual, pixelAreaUniform, Math::MACHINE_EPSILON_100, TEST_LOCATION );
+ Vector4 pixelAreaUniform;
+ DALI_TEST_CHECK(gl.GetUniformValue<Vector4>("pixelArea", pixelAreaUniform));
+ DALI_TEST_EQUALS(pixelAreaVisual, pixelAreaUniform, Math::MACHINE_EPSILON_100, TEST_LOCATION);
// set the pixelArea property on the control
- const Vector4 pixelAreaControl( -1.f, -1.f, 3.f, 3.f );
- gifView.SetProperty( ImageView::Property::PIXEL_AREA, pixelAreaControl );
+ const Vector4 pixelAreaControl(-1.f, -1.f, 3.f, 3.f);
+ gifView.SetProperty(ImageView::Property::PIXEL_AREA, pixelAreaControl);
application.SendNotification();
application.Render(16);
// check the pixelArea property on the control
- pixelAreaValue = gifView.GetProperty( gifView.GetPropertyIndex( "pixelArea" ) );
- DALI_TEST_EQUALS( pixelAreaValue.Get<Vector4>(), pixelAreaControl, TEST_LOCATION );
+ pixelAreaValue = gifView.GetProperty(gifView.GetPropertyIndex("pixelArea"));
+ DALI_TEST_EQUALS(pixelAreaValue.Get<Vector4>(), pixelAreaControl, TEST_LOCATION);
// test that the uniform uses the pixelArea property on the control.
- DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "pixelArea", pixelAreaUniform ) );
- DALI_TEST_EQUALS( pixelAreaControl, pixelAreaUniform, Math::MACHINE_EPSILON_100, TEST_LOCATION );
-
+ DALI_TEST_CHECK(gl.GetUniformValue<Vector4>("pixelArea", pixelAreaUniform));
+ DALI_TEST_EQUALS(pixelAreaControl, pixelAreaUniform, Math::MACHINE_EPSILON_100, TEST_LOCATION);
END_TEST;
}
int UtcDaliImageViewAsyncLoadingWithoutAltasing(void)
{
- ToolkitTestApplication application;
- TestGlAbstraction& gl = application.GetGlAbstraction();
- const std::vector<GLuint>& textures = gl.GetBoundTextures();
- size_t numTextures = textures.size();
+ ToolkitTestApplication application;
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ const std::vector<GLuint>& textures = gl.GetBoundTextures();
+ size_t numTextures = textures.size();
// Async loading, no atlasing for big size image
- ImageView imageView = ImageView::New( gImage_600_RGB );
+ ImageView imageView = ImageView::New(gImage_600_RGB);
// By default, Aysnc loading is used
- application.GetScene().Add( imageView );
- imageView.SetProperty( Actor::Property::SIZE, Vector2(100, 100) );
- imageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ application.GetScene().Add(imageView);
+ imageView.SetProperty(Actor::Property::SIZE, Vector2(100, 100));
+ imageView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render(16);
application.SendNotification();
const std::vector<GLuint>& textures2 = gl.GetBoundTextures();
- DALI_TEST_GREATER( textures2.size(), numTextures, TEST_LOCATION );
+ DALI_TEST_GREATER(textures2.size(), numTextures, TEST_LOCATION);
END_TEST;
}
Property::Map imageMap;
- imageMap[ ImageVisual::Property::URL ] = gImage_34_RGBA;
- imageMap[ ImageVisual::Property::DESIRED_HEIGHT ] = 34;
- imageMap[ ImageVisual::Property::DESIRED_WIDTH ] = 34;
- imageMap[ ImageVisual::Property::ATLASING] = true;
+ imageMap[ImageVisual::Property::URL] = gImage_34_RGBA;
+ imageMap[ImageVisual::Property::DESIRED_HEIGHT] = 34;
+ imageMap[ImageVisual::Property::DESIRED_WIDTH] = 34;
+ imageMap[ImageVisual::Property::ATLASING] = true;
ImageView imageView = ImageView::New();
- imageView.SetProperty( ImageView::Property::IMAGE, imageMap );
- imageView.SetProperty( Toolkit::Control::Property::PADDING, Extents( 10u, 10u, 10u, 10u ) );
+ imageView.SetProperty(ImageView::Property::IMAGE, imageMap);
+ imageView.SetProperty(Toolkit::Control::Property::PADDING, Extents(10u, 10u, 10u, 10u));
// By default, Aysnc loading is used
// loading is not started if the actor is offScene
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
application.SendNotification();
application.Render(16);
application.Render(16);
application.SendNotification();
- imageView.SetProperty( Dali::Actor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::RIGHT_TO_LEFT );
+ imageView.SetProperty(Dali::Actor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::RIGHT_TO_LEFT);
application.SendNotification();
application.Render(16);
application.Render(16);
application.SendNotification();
// loading started, this waits for the loader thread for max 30 seconds
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render(16);
TraceCallStack::NamedParams params;
params["width"] << 34;
params["height"] << 34;
-DALI_TEST_EQUALS( callStack.FindMethodAndParams( "TexSubImage2D", params ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(callStack.FindMethodAndParams("TexSubImage2D", params), true, TEST_LOCATION);
END_TEST;
}
callStack.Enable(true);
Property::Map asyncLoadingMap;
- asyncLoadingMap[ "url" ] = gImage_34_RGBA;
- asyncLoadingMap[ "desiredHeight" ] = 34;
- asyncLoadingMap[ "desiredWidth" ] = 34;
- asyncLoadingMap[ "synchronousLoading" ] = false;
- asyncLoadingMap[ "atlasing" ] = true;
+ asyncLoadingMap["url"] = gImage_34_RGBA;
+ asyncLoadingMap["desiredHeight"] = 34;
+ asyncLoadingMap["desiredWidth"] = 34;
+ asyncLoadingMap["synchronousLoading"] = false;
+ asyncLoadingMap["atlasing"] = true;
ImageView imageView = ImageView::New();
- imageView.SetProperty( ImageView::Property::IMAGE, asyncLoadingMap );
+ imageView.SetProperty(ImageView::Property::IMAGE, asyncLoadingMap);
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
application.SendNotification();
application.Render(16);
application.Render(16);
application.SendNotification();
// loading started, this waits for the loader thread for max 30 seconds
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render(16);
TraceCallStack::NamedParams params;
params["width"] << 34;
params["height"] << 34;
- DALI_TEST_EQUALS( callStack.FindMethodAndParams( "TexSubImage2D", params ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(callStack.FindMethodAndParams("TexSubImage2D", params), true, TEST_LOCATION);
END_TEST;
}
tet_infoline("ImageView Testing sync loading and size using index key property map");
Property::Map syncLoadingMap;
- syncLoadingMap[ ImageVisual::Property::SYNCHRONOUS_LOADING ] = true;
- syncLoadingMap[ ImageVisual::Property::ATLASING ] = true;
+ syncLoadingMap[ImageVisual::Property::SYNCHRONOUS_LOADING] = true;
+ syncLoadingMap[ImageVisual::Property::ATLASING] = true;
// Sync loading, no atlasing for big size image
{
ImageView imageView = ImageView::New();
// Sync loading is used
- syncLoadingMap[ ImageVisual::Property::URL ] = gImage_600_RGB;
- imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap );
+ syncLoadingMap[ImageVisual::Property::URL] = gImage_600_RGB;
+ imageView.SetProperty(ImageView::Property::IMAGE, syncLoadingMap);
}
// Sync loading, automatic atlasing for small size image
callStack.Reset();
callStack.Enable(true);
- ImageView imageView = ImageView::New( );
+ ImageView imageView = ImageView::New();
// Sync loading is used
- syncLoadingMap[ ImageVisual::Property::URL ] = gImage_34_RGBA;
- syncLoadingMap[ ImageVisual::Property::DESIRED_HEIGHT ] = 34;
- syncLoadingMap[ ImageVisual::Property::DESIRED_WIDTH ] = 34;
- imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap );
+ syncLoadingMap[ImageVisual::Property::URL] = gImage_34_RGBA;
+ syncLoadingMap[ImageVisual::Property::DESIRED_HEIGHT] = 34;
+ syncLoadingMap[ImageVisual::Property::DESIRED_WIDTH] = 34;
+ imageView.SetProperty(ImageView::Property::IMAGE, syncLoadingMap);
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
application.SendNotification();
application.Render(16);
TraceCallStack::NamedParams params;
params["width"] << 34;
params["height"] << 34;
- DALI_TEST_EQUALS( callStack.FindMethodAndParams( "TexSubImage2D", params ),
- true, TEST_LOCATION );
+ DALI_TEST_EQUALS(callStack.FindMethodAndParams("TexSubImage2D", params),
+ true,
+ TEST_LOCATION);
}
END_TEST;
}
callStack.Reset();
callStack.Enable(true);
- ImageView imageView = ImageView::New( );
+ ImageView imageView = ImageView::New();
// Sync loading is used
Property::Map syncLoadingMap;
- syncLoadingMap[ "url" ] = gImage_34_RGBA;
- syncLoadingMap[ "desiredHeight" ] = 34;
- syncLoadingMap[ "desiredWidth" ] = 34;
- syncLoadingMap[ "synchronousLoading" ] = true;
- syncLoadingMap[ "atlasing" ] = true;
- imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap );
-
- application.GetScene().Add( imageView );
+ syncLoadingMap["url"] = gImage_34_RGBA;
+ syncLoadingMap["desiredHeight"] = 34;
+ syncLoadingMap["desiredWidth"] = 34;
+ syncLoadingMap["synchronousLoading"] = true;
+ syncLoadingMap["atlasing"] = true;
+ imageView.SetProperty(ImageView::Property::IMAGE, syncLoadingMap);
+
+ application.GetScene().Add(imageView);
application.SendNotification();
application.Render(16);
TraceCallStack::NamedParams params;
params["width"] << 34;
params["height"] << 34;
- DALI_TEST_EQUALS( callStack.FindMethodAndParams( "TexSubImage2D", params ),
- true, TEST_LOCATION );
+ DALI_TEST_EQUALS(callStack.FindMethodAndParams("TexSubImage2D", params),
+ true,
+ TEST_LOCATION);
}
END_TEST;
}
int UtcDaliImageViewAsyncLoadingEncodedBuffer(void)
{
- ToolkitTestApplication application;
- TestGlAbstraction& gl = application.GetGlAbstraction();
- const std::vector<GLuint>& textures = gl.GetBoundTextures();
- size_t numTextures = textures.size();
+ ToolkitTestApplication application;
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ const std::vector<GLuint>& textures = gl.GetBoundTextures();
+ size_t numTextures = textures.size();
// Get encoded raw-buffer image and generate url
EncodedImageBuffer buffer = ConvertFileToEncodedImageBuffer(gImage_600_RGB);
// By default, Aysnc loading is used
application.GetScene().Add(imageView);
- imageView.SetProperty( Actor::Property::SIZE, Vector2(100, 100) );
- imageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ imageView.SetProperty(Actor::Property::SIZE, Vector2(100, 100));
+ imageView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render(16);
application.SendNotification();
const std::vector<GLuint>& textures2 = gl.GetBoundTextures();
- DALI_TEST_GREATER( textures2.size(), numTextures, TEST_LOCATION );
+ DALI_TEST_GREATER(textures2.size(), numTextures, TEST_LOCATION);
END_TEST;
}
DALI_TEST_CHECK(url.GetUrl() == url2.GetUrl());
EncodedImageBuffer buffer2 = ConvertFileToEncodedImageBuffer(gImage_600_RGB);
- url2 = Toolkit::Image::GenerateUrl(buffer2);
+ url2 = Toolkit::Image::GenerateUrl(buffer2);
// Check whethere two url are not equal
DALI_TEST_CHECK(url.GetUrl() != url2.GetUrl());
Property::Map imageMap;
- imageMap[ ImageVisual::Property::URL ] = url.GetUrl();
- imageMap[ ImageVisual::Property::DESIRED_HEIGHT ] = 34;
- imageMap[ ImageVisual::Property::DESIRED_WIDTH ] = 34;
- imageMap[ ImageVisual::Property::ATLASING] = true;
+ imageMap[ImageVisual::Property::URL] = url.GetUrl();
+ imageMap[ImageVisual::Property::DESIRED_HEIGHT] = 34;
+ imageMap[ImageVisual::Property::DESIRED_WIDTH] = 34;
+ imageMap[ImageVisual::Property::ATLASING] = true;
ImageView imageView = ImageView::New();
- imageView.SetProperty( ImageView::Property::IMAGE, imageMap );
- imageView.SetProperty( Toolkit::Control::Property::PADDING, Extents( 10u, 10u, 10u, 10u ) );
+ imageView.SetProperty(ImageView::Property::IMAGE, imageMap);
+ imageView.SetProperty(Toolkit::Control::Property::PADDING, Extents(10u, 10u, 10u, 10u));
// By default, Aysnc loading is used
// loading is not started if the actor is offScene
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
application.SendNotification();
application.Render(16);
application.Render(16);
application.SendNotification();
// Change url to url2
- imageMap[ ImageVisual::Property::URL ] = url2.GetUrl();
- imageView.SetProperty( ImageView::Property::IMAGE, imageMap );
+ imageMap[ImageVisual::Property::URL] = url2.GetUrl();
+ imageView.SetProperty(ImageView::Property::IMAGE, imageMap);
- imageView.SetProperty( Dali::Actor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::RIGHT_TO_LEFT );
+ imageView.SetProperty(Dali::Actor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::RIGHT_TO_LEFT);
application.SendNotification();
application.Render(16);
application.Render(16);
application.SendNotification();
// loading started, this waits for the loader thread for max 30 seconds
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render(16);
TraceCallStack::NamedParams params;
params["width"] << 34;
params["height"] << 34;
- DALI_TEST_EQUALS( callStack.FindMethodAndParams( "TexSubImage2D", params ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(callStack.FindMethodAndParams("TexSubImage2D", params), true, TEST_LOCATION);
END_TEST;
}
callStack.Reset();
callStack.Enable(true);
- ImageView imageView = ImageView::New( );
+ ImageView imageView = ImageView::New();
// Sync loading is used
Property::Map syncLoadingMap;
- syncLoadingMap[ "url" ] = url.GetUrl();
- syncLoadingMap[ "desiredHeight" ] = 34;
- syncLoadingMap[ "desiredWidth" ] = 34;
- syncLoadingMap[ "synchronousLoading" ] = true;
- syncLoadingMap[ "atlasing" ] = true;
- imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap );
-
- application.GetScene().Add( imageView );
+ syncLoadingMap["url"] = url.GetUrl();
+ syncLoadingMap["desiredHeight"] = 34;
+ syncLoadingMap["desiredWidth"] = 34;
+ syncLoadingMap["synchronousLoading"] = true;
+ syncLoadingMap["atlasing"] = true;
+ imageView.SetProperty(ImageView::Property::IMAGE, syncLoadingMap);
+
+ application.GetScene().Add(imageView);
application.SendNotification();
application.Render(16);
TraceCallStack::NamedParams params;
params["width"] << 34;
params["height"] << 34;
- DALI_TEST_EQUALS( callStack.FindMethodAndParams( "TexSubImage2D", params ),
- true, TEST_LOCATION );
+ DALI_TEST_EQUALS(callStack.FindMethodAndParams("TexSubImage2D", params),
+ true,
+ TEST_LOCATION);
}
END_TEST;
propertyMap[ImageVisual::Property::URL] = url;
imageView.SetProperty(ImageView::Property::IMAGE, propertyMap);
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
application.SendNotification();
application.Render();
{
ToolkitTestApplication application;
- int width = 100;
- int height = 200;
+ int width = 100;
+ int height = 200;
ImageView imageView = ImageView::New();
- imageView.SetProperty( Control::Property::BACKGROUND,
- {
- { Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE },
- { Toolkit::ImageVisual::Property::URL, TEST_RESOURCE_DIR "/gallery-small-1.jpg" },
- { ImageVisual::Property::DESIRED_WIDTH, width },
- { ImageVisual::Property::DESIRED_HEIGHT, height },
- }
- );
+ imageView.SetProperty(Control::Property::BACKGROUND,
+ {
+ {Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE},
+ {Toolkit::ImageVisual::Property::URL, TEST_RESOURCE_DIR "/gallery-small-1.jpg"},
+ {ImageVisual::Property::DESIRED_WIDTH, width},
+ {ImageVisual::Property::DESIRED_HEIGHT, height},
+ });
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( imageView.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).width, (float)width, TEST_LOCATION );
- DALI_TEST_EQUALS( imageView.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).height, (float)height, TEST_LOCATION );
+ DALI_TEST_EQUALS(imageView.GetCurrentProperty<Vector3>(Actor::Property::SIZE).width, (float)width, TEST_LOCATION);
+ DALI_TEST_EQUALS(imageView.GetCurrentProperty<Vector3>(Actor::Property::SIZE).height, (float)height, TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- int widthBackground = 100;
+ int widthBackground = 100;
int heightBackground = 200;
- int width = 600;
- int height = 600;
+ int width = 600;
+ int height = 600;
ImageView imageView = ImageView::New();
- imageView.SetProperty( Control::Property::BACKGROUND,
- {
- { Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE },
- { Toolkit::ImageVisual::Property::URL, TEST_RESOURCE_DIR "/gallery-small-1.jpg" },
- { ImageVisual::Property::DESIRED_WIDTH, widthBackground },
- { ImageVisual::Property::DESIRED_HEIGHT, heightBackground },
- }
- );
+ imageView.SetProperty(Control::Property::BACKGROUND,
+ {
+ {Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE},
+ {Toolkit::ImageVisual::Property::URL, TEST_RESOURCE_DIR "/gallery-small-1.jpg"},
+ {ImageVisual::Property::DESIRED_WIDTH, widthBackground},
+ {ImageVisual::Property::DESIRED_HEIGHT, heightBackground},
+ });
- imageView.SetImage( gImage_600_RGB ); // 1 to 1 ratio, 600x600 pixels
+ imageView.SetImage(gImage_600_RGB); // 1 to 1 ratio, 600x600 pixels
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( imageView.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).width, (float)width, TEST_LOCATION );
- DALI_TEST_EQUALS( imageView.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).height, (float)height, TEST_LOCATION );
+ DALI_TEST_EQUALS(imageView.GetCurrentProperty<Vector3>(Actor::Property::SIZE).width, (float)width, TEST_LOCATION);
+ DALI_TEST_EQUALS(imageView.GetCurrentProperty<Vector3>(Actor::Property::SIZE).height, (float)height, TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- int widthBackground = 100;
+ int widthBackground = 100;
int heightBackground = 200;
ImageView imageView = ImageView::New();
- imageView.SetProperty( Control::Property::BACKGROUND,
- {
- { Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE },
- { Toolkit::ImageVisual::Property::URL, TEST_RESOURCE_DIR "/gallery-small-1.jpg" },
- { ImageVisual::Property::DESIRED_WIDTH, widthBackground },
- { ImageVisual::Property::DESIRED_HEIGHT, heightBackground }
- }
- );
+ imageView.SetProperty(Control::Property::BACKGROUND,
+ {{Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE},
+ {Toolkit::ImageVisual::Property::URL, TEST_RESOURCE_DIR "/gallery-small-1.jpg"},
+ {ImageVisual::Property::DESIRED_WIDTH, widthBackground},
+ {ImageVisual::Property::DESIRED_HEIGHT, heightBackground}});
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
application.SendNotification();
application.Render();
- Control control = Control::DownCast( imageView );
- DALI_TEST_CHECK( control );
- DALI_TEST_EQUALS( imageView.GetHeightForWidth( 123.f ), control.GetHeightForWidth( 123.f ), TEST_LOCATION );
- DALI_TEST_EQUALS( imageView.GetWidthForHeight( 321.f ), control.GetWidthForHeight( 321.f ), TEST_LOCATION );
+ Control control = Control::DownCast(imageView);
+ DALI_TEST_CHECK(control);
+ DALI_TEST_EQUALS(imageView.GetHeightForWidth(123.f), control.GetHeightForWidth(123.f), TEST_LOCATION);
+ DALI_TEST_EQUALS(imageView.GetWidthForHeight(321.f), control.GetWidthForHeight(321.f), TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- int widthBackground = 100;
+ int widthBackground = 100;
int heightBackground = 200;
- int width = 300;
- int height = 300;
+ int width = 300;
+ int height = 300;
ImageView imageView = ImageView::New();
- imageView.SetProperty( Control::Property::BACKGROUND,
- {
- { Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE },
- { Toolkit::ImageVisual::Property::URL, TEST_RESOURCE_DIR "/gallery-small-1.jpg" },
- { ImageVisual::Property::DESIRED_WIDTH, widthBackground },
- { ImageVisual::Property::DESIRED_HEIGHT, heightBackground }
- }
- ); // 1 to 2 ratio
+ imageView.SetProperty(Control::Property::BACKGROUND,
+ {{Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE},
+ {Toolkit::ImageVisual::Property::URL, TEST_RESOURCE_DIR "/gallery-small-1.jpg"},
+ {ImageVisual::Property::DESIRED_WIDTH, widthBackground},
+ {ImageVisual::Property::DESIRED_HEIGHT, heightBackground}}); // 1 to 2 ratio
- imageView.SetImage( gImage_600_RGB ); // 1 to 1 ratio
+ imageView.SetImage(gImage_600_RGB); // 1 to 1 ratio
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( imageView.GetHeightForWidth( width ), (float)height, TEST_LOCATION );
- DALI_TEST_EQUALS( imageView.GetWidthForHeight( height ), (float)width, TEST_LOCATION );
+ DALI_TEST_EQUALS(imageView.GetHeightForWidth(width), (float)height, TEST_LOCATION);
+ DALI_TEST_EQUALS(imageView.GetWidthForHeight(height), (float)width, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
ImageView imageView = ImageView::New();
- imageView.SetImage( TEST_IMAGE_FILE_NAME );
- TestUrl( imageView, TEST_IMAGE_FILE_NAME );
-
+ imageView.SetImage(TEST_IMAGE_FILE_NAME);
+ TestUrl(imageView, TEST_IMAGE_FILE_NAME);
- imageView.SetImage( TEST_IMAGE_FILE_NAME2 );
- TestUrl( imageView, TEST_IMAGE_FILE_NAME2 );
+ imageView.SetImage(TEST_IMAGE_FILE_NAME2);
+ TestUrl(imageView, TEST_IMAGE_FILE_NAME2);
END_TEST;
}
-bool gResourceReadySignalFired = false;
+bool gResourceReadySignalFired = false;
Vector3 gNaturalSize;
-void ResourceReadySignal( Control control )
+void ResourceReadySignal(Control control)
{
gResourceReadySignalFired = true;
}
gResourceReadySignalFired = false;
// Check ImageView with background and main image, to ensure both visuals are marked as loaded
- ImageView imageView = ImageView::New( TEST_GIF_FILE_NAME );
+ ImageView imageView = ImageView::New(TEST_GIF_FILE_NAME);
- imageView.SetProperty( Control::Property::BACKGROUND,
- {
- { Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE },
- { Toolkit::ImageVisual::Property::URL, TEST_RESOURCE_DIR "/gallery-small-1.jpg" },
- { ImageVisual::Property::DESIRED_WIDTH, 100 },
- { ImageVisual::Property::DESIRED_HEIGHT, 200 }
- }
- );
+ imageView.SetProperty(Control::Property::BACKGROUND,
+ {{Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE},
+ {Toolkit::ImageVisual::Property::URL, TEST_RESOURCE_DIR "/gallery-small-1.jpg"},
+ {ImageVisual::Property::DESIRED_WIDTH, 100},
+ {ImageVisual::Property::DESIRED_HEIGHT, 200}});
- DALI_TEST_EQUALS( imageView.IsResourceReady(), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(imageView.IsResourceReady(), false, TEST_LOCATION);
- imageView.ResourceReadySignal().Connect( &ResourceReadySignal);
+ imageView.ResourceReadySignal().Connect(&ResourceReadySignal);
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
// loading started, this waits for the loader thread
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( imageView.IsResourceReady(), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(imageView.IsResourceReady(), true, TEST_LOCATION);
- DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gResourceReadySignalFired, true, TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- ImageView imageView = ImageView::New();
- Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( imageView );
+ ImageView imageView = ImageView::New();
+ Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation(imageView);
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
- std::string url;
- Property::Map map;
+ std::string url;
+ Property::Map map;
Toolkit::Visual::Base visual;
- Property::Value value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
- visual = DevelControl::GetVisual( controlImpl, ImageView::Property::IMAGE );
+ Property::Value value = imageView.GetProperty(imageView.GetPropertyIndex("image"));
+ visual = DevelControl::GetVisual(controlImpl, ImageView::Property::IMAGE);
application.SendNotification();
- application.Render( 16 );
+ application.Render(16);
- DALI_TEST_CHECK( ! value.Get( url ) ); // Value should be empty
- value.Get( map );
- DALI_TEST_CHECK( map.Empty() ); // Value should be empty
- DALI_TEST_CHECK( ! visual ); // Visual should be invalid
+ DALI_TEST_CHECK(!value.Get(url)); // Value should be empty
+ value.Get(map);
+ DALI_TEST_CHECK(map.Empty()); // Value should be empty
+ DALI_TEST_CHECK(!visual); // Visual should be invalid
// Set a URL
- imageView.SetImage( "TEST_URL" );
+ imageView.SetImage("TEST_URL");
application.SendNotification();
- application.Render( 16 );
+ application.Render(16);
- value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
- visual = DevelControl::GetVisual( controlImpl, ImageView::Property::IMAGE );
+ value = imageView.GetProperty(imageView.GetPropertyIndex("image"));
+ visual = DevelControl::GetVisual(controlImpl, ImageView::Property::IMAGE);
- DALI_TEST_CHECK( value.Get( url ) ); // Value should NOT be empty
- DALI_TEST_CHECK( ! value.Get( map ) ); // Value should be empty
- DALI_TEST_CHECK( visual ); // Visual should be valid
+ DALI_TEST_CHECK(value.Get(url)); // Value should NOT be empty
+ DALI_TEST_CHECK(!value.Get(map)); // Value should be empty
+ DALI_TEST_CHECK(visual); // Visual should be valid
// Set an empty URL
- imageView.SetImage( "" );
+ imageView.SetImage("");
application.SendNotification();
- application.Render( 16 );
+ application.Render(16);
- value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
- visual = DevelControl::GetVisual( controlImpl, ImageView::Property::IMAGE );
+ value = imageView.GetProperty(imageView.GetPropertyIndex("image"));
+ visual = DevelControl::GetVisual(controlImpl, ImageView::Property::IMAGE);
- DALI_TEST_CHECK( ! value.Get( url ) ); // Value should be empty
- value.Get( map );
- DALI_TEST_CHECK( map.Empty() ); // Value should be empty
- DALI_TEST_CHECK( ! visual ); // Visual should be invalid
+ DALI_TEST_CHECK(!value.Get(url)); // Value should be empty
+ value.Get(map);
+ DALI_TEST_CHECK(map.Empty()); // Value should be empty
+ DALI_TEST_CHECK(!visual); // Visual should be invalid
// Set a URL in property map
Property::Map propertyMap;
propertyMap[ImageVisual::Property::URL] = TEST_IMAGE_FILE_NAME;
- imageView.SetProperty( ImageView::Property::IMAGE, propertyMap );
+ imageView.SetProperty(ImageView::Property::IMAGE, propertyMap);
application.SendNotification();
- application.Render( 16 );
+ application.Render(16);
- value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
- visual = DevelControl::GetVisual( controlImpl, ImageView::Property::IMAGE );
+ value = imageView.GetProperty(imageView.GetPropertyIndex("image"));
+ visual = DevelControl::GetVisual(controlImpl, ImageView::Property::IMAGE);
- DALI_TEST_CHECK( ! value.Get( url ) ); // Value should be empty
- DALI_TEST_CHECK( value.Get( map ) ); // Value should NOT be empty
- DALI_TEST_CHECK( visual ); // Visual should be valid
+ DALI_TEST_CHECK(!value.Get(url)); // Value should be empty
+ DALI_TEST_CHECK(value.Get(map)); // Value should NOT be empty
+ DALI_TEST_CHECK(visual); // Visual should be valid
// Set a URL in property map again
propertyMap[ImageVisual::Property::URL] = gImage_34_RGBA;
- imageView.SetProperty( ImageView::Property::IMAGE, propertyMap );
+ imageView.SetProperty(ImageView::Property::IMAGE, propertyMap);
application.SendNotification();
- application.Render( 16 );
+ application.Render(16);
- value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
- visual = DevelControl::GetVisual( controlImpl, ImageView::Property::IMAGE );
+ value = imageView.GetProperty(imageView.GetPropertyIndex("image"));
+ visual = DevelControl::GetVisual(controlImpl, ImageView::Property::IMAGE);
- DALI_TEST_CHECK( ! value.Get( url ) ); // Value should be empty
- DALI_TEST_CHECK( value.Get( map ) ); // Value should NOT be empty
- DALI_TEST_CHECK( visual ); // Visual should be valid
+ DALI_TEST_CHECK(!value.Get(url)); // Value should be empty
+ DALI_TEST_CHECK(value.Get(map)); // Value should NOT be empty
+ DALI_TEST_CHECK(visual); // Visual should be valid
// Set an empty URL in property map
propertyMap[ImageVisual::Property::URL] = std::string();
- imageView.SetProperty( ImageView::Property::IMAGE, propertyMap );
+ imageView.SetProperty(ImageView::Property::IMAGE, propertyMap);
application.SendNotification();
- application.Render( 16 );
+ application.Render(16);
- value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
- visual = DevelControl::GetVisual( controlImpl, ImageView::Property::IMAGE );
+ value = imageView.GetProperty(imageView.GetPropertyIndex("image"));
+ visual = DevelControl::GetVisual(controlImpl, ImageView::Property::IMAGE);
- DALI_TEST_CHECK( ! value.Get( url ) ); // Value should be empty
- DALI_TEST_CHECK( value.Get( map ) ); // Value should NOT be empty
- DALI_TEST_CHECK( ! visual ); // Visual should be invalid
+ DALI_TEST_CHECK(!value.Get(url)); // Value should be empty
+ DALI_TEST_CHECK(value.Get(map)); // Value should NOT be empty
+ DALI_TEST_CHECK(!visual); // Visual should be invalid
// Set a URL in property map again
propertyMap[ImageVisual::Property::URL] = gImage_34_RGBA;
- imageView.SetProperty( ImageView::Property::IMAGE, propertyMap );
+ imageView.SetProperty(ImageView::Property::IMAGE, propertyMap);
application.SendNotification();
- application.Render( 16 );
+ application.Render(16);
- value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
- visual = DevelControl::GetVisual( controlImpl, ImageView::Property::IMAGE );
+ value = imageView.GetProperty(imageView.GetPropertyIndex("image"));
+ visual = DevelControl::GetVisual(controlImpl, ImageView::Property::IMAGE);
- DALI_TEST_CHECK( ! value.Get( url ) ); // Value should be empty
- DALI_TEST_CHECK( value.Get( map ) ); // Value should NOT be empty
- DALI_TEST_CHECK( visual ); // Visual should be valid
+ DALI_TEST_CHECK(!value.Get(url)); // Value should be empty
+ DALI_TEST_CHECK(value.Get(map)); // Value should NOT be empty
+ DALI_TEST_CHECK(visual); // Visual should be valid
// Set an empty property map
propertyMap.Clear();
- imageView.SetProperty( ImageView::Property::IMAGE, propertyMap );
+ imageView.SetProperty(ImageView::Property::IMAGE, propertyMap);
application.SendNotification();
- application.Render( 16 );
+ application.Render(16);
- value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
- visual = DevelControl::GetVisual( controlImpl, ImageView::Property::IMAGE );
+ value = imageView.GetProperty(imageView.GetPropertyIndex("image"));
+ visual = DevelControl::GetVisual(controlImpl, ImageView::Property::IMAGE);
- DALI_TEST_CHECK( ! value.Get( url ) ); // Value should be empty
- DALI_TEST_CHECK( value.Get( map ) ); // Value should NOT be empty
- DALI_TEST_CHECK( map.Empty() ); // But PropertyMap should be empty
- DALI_TEST_CHECK( ! visual ); // Visual should be invalid
+ DALI_TEST_CHECK(!value.Get(url)); // Value should be empty
+ DALI_TEST_CHECK(value.Get(map)); // Value should NOT be empty
+ DALI_TEST_CHECK(map.Empty()); // But PropertyMap should be empty
+ DALI_TEST_CHECK(!visual); // Visual should be invalid
END_TEST;
}
ToolkitTestApplication application;
ImageView imageView = ImageView::New();
- DALI_TEST_CHECK( imageView.GetProperty( ImageView::Property::IMAGE ).Get< std::string >().empty() );
+ DALI_TEST_CHECK(imageView.GetProperty(ImageView::Property::IMAGE).Get<std::string>().empty());
- imageView.SetProperty( ImageView::Property::IMAGE, "TestString" );
- DALI_TEST_EQUALS( imageView.GetProperty( ImageView::Property::IMAGE ).Get< std::string >(), "TestString", TEST_LOCATION );
+ imageView.SetProperty(ImageView::Property::IMAGE, "TestString");
+ DALI_TEST_EQUALS(imageView.GetProperty(ImageView::Property::IMAGE).Get<std::string>(), "TestString", TEST_LOCATION);
END_TEST;
}
gResourceReadySignalFired = false;
// Check ImageView with background and main image, to ensure both visuals are marked as loaded
- ImageView imageView = ImageView::New( TEST_IMAGE_1 );
+ ImageView imageView = ImageView::New(TEST_IMAGE_1);
- DALI_TEST_EQUALS( imageView.IsResourceReady(), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(imageView.IsResourceReady(), false, TEST_LOCATION);
- imageView.ResourceReadySignal().Connect( &ResourceReadySignal);
+ imageView.ResourceReadySignal().Connect(&ResourceReadySignal);
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
application.SendNotification();
application.Render(16);
// loading started, this waits for the loader thread for max 30 seconds
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
- DALI_TEST_EQUALS( imageView.GetRendererCount(), 1u, TEST_LOCATION );
+ DALI_TEST_EQUALS(imageView.GetRendererCount(), 1u, TEST_LOCATION);
- DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gResourceReadySignalFired, true, TEST_LOCATION);
gResourceReadySignalFired = false;
application.Render(16);
// loading started, this waits for the loader thread for max 30 seconds
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
- DALI_TEST_EQUALS( imageView.GetRendererCount(), 1u, TEST_LOCATION );
+ DALI_TEST_EQUALS(imageView.GetRendererCount(), 1u, TEST_LOCATION);
- DALI_TEST_EQUALS( imageView.IsResourceReady(), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(imageView.IsResourceReady(), true, TEST_LOCATION);
- DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gResourceReadySignalFired, true, TEST_LOCATION);
END_TEST;
}
-void OnRelayoutOverride( Size size )
+void OnRelayoutOverride(Size size)
{
gNaturalSize = size; // Size Relayout is using
}
ToolkitTestApplication application;
// Check ImageView with background and main image, to ensure both visuals are marked as loaded
- ImageView imageView = ImageView::New( TEST_IMAGE_1 );
- imageView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+ ImageView imageView = ImageView::New(TEST_IMAGE_1);
+ imageView.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS);
- DummyControl dummyControl = DummyControl::New( true );
- Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
- dummyControl.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS );
+ DummyControl dummyControl = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+ dummyControl.SetResizePolicy(ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS);
- dummyControl.Add( imageView );
- dummyImpl.SetRelayoutCallback( &OnRelayoutOverride );
- application.GetScene().Add( dummyControl );
+ dummyControl.Add(imageView);
+ dummyImpl.SetRelayoutCallback(&OnRelayoutOverride);
+ application.GetScene().Add(dummyControl);
application.SendNotification();
application.Render();
// loading started, this waits for the loader thread for max 30 seconds
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
- DALI_TEST_EQUALS( gNaturalSize.width, 1024.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( gNaturalSize.height, 1024.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(gNaturalSize.width, 1024.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(gNaturalSize.height, 1024.0f, TEST_LOCATION);
gNaturalSize = Vector3::ZERO;
// Waiting for resourceReady so SendNotifcation not called here.
// loading started, this waits for the loader thread for max 30 seconds
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
// Trigger a potential relayout
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( gNaturalSize.width, 600.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( gNaturalSize.height, 600.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(gNaturalSize.width, 600.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(gNaturalSize.height, 600.0f, TEST_LOCATION);
END_TEST;
}
Property::Map imageMap;
- imageMap[ ImageVisual::Property::URL ] = gImage_34_RGBA;
- imageMap[ ImageVisual::Property::LOAD_POLICY ] = ImageVisual::LoadPolicy::IMMEDIATE;
+ imageMap[ImageVisual::Property::URL] = gImage_34_RGBA;
+ imageMap[ImageVisual::Property::LOAD_POLICY] = ImageVisual::LoadPolicy::IMMEDIATE;
tet_infoline("Creating ImageView without URL so image does not start loading");
ImageView imageView = ImageView::New();
tet_infoline("Connect to image loaded signal before setting image");
- imageView.ResourceReadySignal().Connect( &ResourceReadySignal);
+ imageView.ResourceReadySignal().Connect(&ResourceReadySignal);
tet_infoline("Setting Image with IMMEDIATE load, signal already connected so will be triggered.");
- imageView.SetProperty( ImageView::Property::IMAGE, imageMap );
+ imageView.SetProperty(ImageView::Property::IMAGE, imageMap);
// loading started, this waits for the loader thread
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gResourceReadySignalFired, true, TEST_LOCATION);
END_TEST;
}
Property::Map imageMap;
- imageMap[ ImageVisual::Property::URL ] = gImage_34_RGBA;
- imageMap[ ImageVisual::Property::LOAD_POLICY ] = ImageVisual::LoadPolicy::IMMEDIATE;
+ imageMap[ImageVisual::Property::URL] = gImage_34_RGBA;
+ imageMap[ImageVisual::Property::LOAD_POLICY] = ImageVisual::LoadPolicy::IMMEDIATE;
ImageView imageView = ImageView::New();
- imageView.ResourceReadySignal().Connect( &ResourceReadySignal);
- imageView.SetProperty( ImageView::Property::IMAGE, imageMap );
+ imageView.ResourceReadySignal().Connect(&ResourceReadySignal);
+ imageView.SetProperty(ImageView::Property::IMAGE, imageMap);
// loading started, this waits for the loader thread
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gResourceReadySignalFired, true, TEST_LOCATION);
gResourceReadySignalFired = false;
ImageView imageViewWithExistingImage = ImageView::New();
- imageViewWithExistingImage.ResourceReadySignal().Connect( &ResourceReadySignal);
- imageViewWithExistingImage.SetProperty( ImageView::Property::IMAGE, imageMap );
+ imageViewWithExistingImage.ResourceReadySignal().Connect(&ResourceReadySignal);
+ imageViewWithExistingImage.SetProperty(ImageView::Property::IMAGE, imageMap);
- DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gResourceReadySignalFired, true, TEST_LOCATION);
END_TEST;
}
gResourceReadySignalFired = false;
Property::Map imageImmediateLoadingMap;
- imageImmediateLoadingMap[ ImageVisual::Property::URL ] = gImage_34_RGBA;
- imageImmediateLoadingMap[ ImageVisual::Property::LOAD_POLICY ] = ImageVisual::LoadPolicy::IMMEDIATE;
+ imageImmediateLoadingMap[ImageVisual::Property::URL] = gImage_34_RGBA;
+ imageImmediateLoadingMap[ImageVisual::Property::LOAD_POLICY] = ImageVisual::LoadPolicy::IMMEDIATE;
tet_infoline("Immediate load an image");
ImageView imageView = ImageView::New();
- imageView.ResourceReadySignal().Connect( &ResourceReadySignal);
- imageView.SetProperty( ImageView::Property::IMAGE, imageImmediateLoadingMap );
+ imageView.ResourceReadySignal().Connect(&ResourceReadySignal);
+ imageView.SetProperty(ImageView::Property::IMAGE, imageImmediateLoadingMap);
// loading started, this waits for the loader thread
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render(16);
tet_infoline("Check image loaded");
- DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gResourceReadySignalFired, true, TEST_LOCATION);
gResourceReadySignalFired = false;
tet_infoline("Create another ImageView with the same URL");
- ImageView imageViewWithExistingImage = ImageView::New( gImage_34_RGBA );
+ ImageView imageViewWithExistingImage = ImageView::New(gImage_34_RGBA);
tet_infoline("Connect to ResourceReady signal for second ImageView, it should still fire as resource is ready");
- imageViewWithExistingImage.ResourceReadySignal().Connect( &ResourceReadySignal);
+ imageViewWithExistingImage.ResourceReadySignal().Connect(&ResourceReadySignal);
- application.GetScene().Add( imageViewWithExistingImage );
+ application.GetScene().Add(imageViewWithExistingImage);
- DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gResourceReadySignalFired, true, TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- ImageView imageView = ImageView::New();
+ ImageView imageView = ImageView::New();
Property::Map imagePropertyMap;
- imagePropertyMap[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::IMAGE;
- imagePropertyMap[ Toolkit::ImageVisual::Property::URL ] = TEST_RESOURCE_DIR "/gallery-small-1.jpg" ;
- imagePropertyMap[ ImageVisual::Property::DESIRED_WIDTH ] = 128;
- imagePropertyMap[ ImageVisual::Property::DESIRED_HEIGHT ] = 128;
- imageView.SetProperty( Toolkit::ImageView::Property::IMAGE , imagePropertyMap );
- imageView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- imageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- imageView.SetProperty( Control::Property::PADDING, Extents( 15, 10, 5, 10 ) );
- application.GetScene().Add( imageView );
+ imagePropertyMap[Toolkit::Visual::Property::TYPE] = Toolkit::Visual::IMAGE;
+ imagePropertyMap[Toolkit::ImageVisual::Property::URL] = TEST_RESOURCE_DIR "/gallery-small-1.jpg";
+ imagePropertyMap[ImageVisual::Property::DESIRED_WIDTH] = 128;
+ imagePropertyMap[ImageVisual::Property::DESIRED_HEIGHT] = 128;
+ imageView.SetProperty(Toolkit::ImageView::Property::IMAGE, imagePropertyMap);
+ imageView.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ imageView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ imageView.SetProperty(Control::Property::PADDING, Extents(15, 10, 5, 10));
+ application.GetScene().Add(imageView);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( imageView.GetProperty<Extents>( Control::Property::PADDING ), Extents( 15, 10, 5, 10 ), TEST_LOCATION );
+ DALI_TEST_EQUALS(imageView.GetProperty<Extents>(Control::Property::PADDING), Extents(15, 10, 5, 10), TEST_LOCATION);
ImageView childImage = ImageView::New();
- childImage.SetBackgroundColor( Color::BLACK );
- childImage.SetProperty( Actor::Property::SIZE, Vector2( 10.f, 10.f ) );
- imageView.Add( childImage );
+ childImage.SetBackgroundColor(Color::BLACK);
+ childImage.SetProperty(Actor::Property::SIZE, Vector2(10.f, 10.f));
+ imageView.Add(childImage);
application.SendNotification();
application.Render();
// Child ImageView should be positioned dependinig on Parent ImageView's Padding value
- DALI_TEST_EQUALS( childImage.GetProperty<Vector3>( Dali::Actor::Property::POSITION ), Vector3( 15, 5, 0 ), TEST_LOCATION );
+ DALI_TEST_EQUALS(childImage.GetProperty<Vector3>(Dali::Actor::Property::POSITION), Vector3(15, 5, 0), TEST_LOCATION);
// Check whether Image Visual transforms on ImageVieiw::OnRelayout()
- Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( imageView );
- Toolkit::Visual::Base imageVisual = DevelControl::GetVisual( controlImpl, ImageView::Property::IMAGE );
- Property::Map resultMap;
- imageVisual.CreatePropertyMap( resultMap );
+ Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation(imageView);
+ Toolkit::Visual::Base imageVisual = DevelControl::GetVisual(controlImpl, ImageView::Property::IMAGE);
+ Property::Map resultMap;
+ imageVisual.CreatePropertyMap(resultMap);
- Property::Value* transformValue = resultMap.Find( Visual::Property::TRANSFORM );
- DALI_TEST_CHECK( transformValue );
+ Property::Value* transformValue = resultMap.Find(Visual::Property::TRANSFORM);
+ DALI_TEST_CHECK(transformValue);
Property::Map* retMap = transformValue->GetMap();
- DALI_TEST_CHECK( retMap );
+ DALI_TEST_CHECK(retMap);
// Image Visual should be positioned depending on ImageView's padding
- DALI_TEST_EQUALS( retMap->Find( Visual::Transform::Property::OFFSET )->Get< Vector2 >(), Vector2( 15, 5 ), TEST_LOCATION );
+ DALI_TEST_EQUALS(retMap->Find(Visual::Transform::Property::OFFSET)->Get<Vector2>(), Vector2(15, 5), TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- ImageView imageView = ImageView::New();
+ ImageView imageView = ImageView::New();
Property::Map imagePropertyMap;
- imagePropertyMap[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::IMAGE;
- imagePropertyMap[ Toolkit::ImageVisual::Property::URL ] = TEST_RESOURCE_DIR "/Kid1.svg" ;
- imagePropertyMap[ ImageVisual::Property::DESIRED_WIDTH ] = 128;
- imagePropertyMap[ ImageVisual::Property::DESIRED_HEIGHT ] = 128;
- imagePropertyMap[ DevelVisual::Property::VISUAL_FITTING_MODE ] = Toolkit::DevelVisual::FIT_KEEP_ASPECT_RATIO;
- imageView.SetProperty( Toolkit::ImageView::Property::IMAGE , imagePropertyMap );
- imageView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- imageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- imageView.SetProperty( Control::Property::PADDING, Extents( 15, 10, 5, 10 ) );
- application.GetScene().Add( imageView );
+ imagePropertyMap[Toolkit::Visual::Property::TYPE] = Toolkit::Visual::IMAGE;
+ imagePropertyMap[Toolkit::ImageVisual::Property::URL] = TEST_RESOURCE_DIR "/Kid1.svg";
+ imagePropertyMap[ImageVisual::Property::DESIRED_WIDTH] = 128;
+ imagePropertyMap[ImageVisual::Property::DESIRED_HEIGHT] = 128;
+ imagePropertyMap[DevelVisual::Property::VISUAL_FITTING_MODE] = Toolkit::DevelVisual::FIT_KEEP_ASPECT_RATIO;
+ imageView.SetProperty(Toolkit::ImageView::Property::IMAGE, imagePropertyMap);
+ imageView.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ imageView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ imageView.SetProperty(Control::Property::PADDING, Extents(15, 10, 5, 10));
+ application.GetScene().Add(imageView);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( imageView.GetProperty<Extents>( Control::Property::PADDING ), Extents( 15, 10, 5, 10 ), TEST_LOCATION );
+ DALI_TEST_EQUALS(imageView.GetProperty<Extents>(Control::Property::PADDING), Extents(15, 10, 5, 10), TEST_LOCATION);
// Check whether Image Visual transforms on ImageVieiw::OnRelayout()
- Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( imageView );
- Toolkit::Visual::Base imageVisual = DevelControl::GetVisual( controlImpl, ImageView::Property::IMAGE );
- Property::Map resultMap;
- imageVisual.CreatePropertyMap( resultMap );
+ Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation(imageView);
+ Toolkit::Visual::Base imageVisual = DevelControl::GetVisual(controlImpl, ImageView::Property::IMAGE);
+ Property::Map resultMap;
+ imageVisual.CreatePropertyMap(resultMap);
- Property::Value* transformValue = resultMap.Find( Visual::Property::TRANSFORM );
- DALI_TEST_CHECK( transformValue );
+ Property::Value* transformValue = resultMap.Find(Visual::Property::TRANSFORM);
+ DALI_TEST_CHECK(transformValue);
Property::Map* retMap = transformValue->GetMap();
- DALI_TEST_CHECK( retMap );
+ DALI_TEST_CHECK(retMap);
// Image Visual should be positioned depending on ImageView's padding
- DALI_TEST_EQUALS( retMap->Find( Visual::Transform::Property::OFFSET )->Get< Vector2 >(), Vector2( 15, 5 ), TEST_LOCATION );
+ DALI_TEST_EQUALS(retMap->Find(Visual::Transform::Property::OFFSET)->Get<Vector2>(), Vector2(15, 5), TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
- ImageView imageView = ImageView::New();
+ ImageView imageView = ImageView::New();
Property::Map imagePropertyMap;
- imagePropertyMap[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::IMAGE;
- imagePropertyMap[ Toolkit::ImageVisual::Property::URL ] = TEST_RESOURCE_DIR "/Kid1.svg" ;
- imagePropertyMap[ ImageVisual::Property::DESIRED_WIDTH ] = 128;
- imagePropertyMap[ ImageVisual::Property::DESIRED_HEIGHT ] = 128;
- imagePropertyMap[ DevelVisual::Property::VISUAL_FITTING_MODE ] = Toolkit::DevelVisual::FIT_KEEP_ASPECT_RATIO;
- imageView.SetProperty( Toolkit::ImageView::Property::IMAGE , imagePropertyMap );
- imageView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- imageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- imageView.SetProperty( Control::Property::PADDING, Extents( 15, 10, 5, 10 ) );
- application.GetScene().Add( imageView );
+ imagePropertyMap[Toolkit::Visual::Property::TYPE] = Toolkit::Visual::IMAGE;
+ imagePropertyMap[Toolkit::ImageVisual::Property::URL] = TEST_RESOURCE_DIR "/Kid1.svg";
+ imagePropertyMap[ImageVisual::Property::DESIRED_WIDTH] = 128;
+ imagePropertyMap[ImageVisual::Property::DESIRED_HEIGHT] = 128;
+ imagePropertyMap[DevelVisual::Property::VISUAL_FITTING_MODE] = Toolkit::DevelVisual::FIT_KEEP_ASPECT_RATIO;
+ imageView.SetProperty(Toolkit::ImageView::Property::IMAGE, imagePropertyMap);
+ imageView.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ imageView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ imageView.SetProperty(Control::Property::PADDING, Extents(15, 10, 5, 10));
+ application.GetScene().Add(imageView);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( imageView.GetProperty<Extents>( Control::Property::PADDING ), Extents( 15, 10, 5, 10 ), TEST_LOCATION );
+ DALI_TEST_EQUALS(imageView.GetProperty<Extents>(Control::Property::PADDING), Extents(15, 10, 5, 10), TEST_LOCATION);
tet_infoline("Remove Padding and test Visual is position correctly");
- imageView.SetProperty( Control::Property::PADDING, Extents( 0, 0, 0, 0 ) );
+ imageView.SetProperty(Control::Property::PADDING, Extents(0, 0, 0, 0));
application.SendNotification();
application.Render();
// Check whether Image Visual transforms on ImageVieiw::OnRelayout()
- Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( imageView );
- Toolkit::Visual::Base imageVisual = DevelControl::GetVisual( controlImpl, ImageView::Property::IMAGE );
- Property::Map resultMap;
- imageVisual.CreatePropertyMap( resultMap );
+ Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation(imageView);
+ Toolkit::Visual::Base imageVisual = DevelControl::GetVisual(controlImpl, ImageView::Property::IMAGE);
+ Property::Map resultMap;
+ imageVisual.CreatePropertyMap(resultMap);
- Property::Value* transformValue = resultMap.Find( Visual::Property::TRANSFORM );
- DALI_TEST_CHECK( transformValue );
+ Property::Value* transformValue = resultMap.Find(Visual::Property::TRANSFORM);
+ DALI_TEST_CHECK(transformValue);
Property::Map* retMap = transformValue->GetMap();
- DALI_TEST_CHECK( retMap );
+ DALI_TEST_CHECK(retMap);
// Image Visual should be positioned depending on ImageView's padding
- DALI_TEST_EQUALS( retMap->Find( Visual::Transform::Property::OFFSET )->Get< Vector2 >(), Vector2( 0, 0 ), TEST_LOCATION );
+ DALI_TEST_EQUALS(retMap->Find(Visual::Transform::Property::OFFSET)->Get<Vector2>(), Vector2(0, 0), TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
- ImageView imageView = ImageView::New();
+ ImageView imageView = ImageView::New();
Property::Map imagePropertyMap;
- imagePropertyMap[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::IMAGE;
- imagePropertyMap[ Toolkit::ImageVisual::Property::URL ] = TEST_RESOURCE_DIR "/Kid1.svg" ;
- imagePropertyMap[ ImageVisual::Property::DESIRED_WIDTH ] = 128;
- imagePropertyMap[ ImageVisual::Property::DESIRED_HEIGHT ] = 128;
- imagePropertyMap[ DevelVisual::Property::VISUAL_FITTING_MODE ] = Toolkit::DevelVisual::FILL;
- imageView.SetProperty( Toolkit::ImageView::Property::IMAGE , imagePropertyMap );
- imageView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- imageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- imageView.SetProperty( Control::Property::PADDING, Extents( 15, 10, 5, 10 ) );
- application.GetScene().Add( imageView );
+ imagePropertyMap[Toolkit::Visual::Property::TYPE] = Toolkit::Visual::IMAGE;
+ imagePropertyMap[Toolkit::ImageVisual::Property::URL] = TEST_RESOURCE_DIR "/Kid1.svg";
+ imagePropertyMap[ImageVisual::Property::DESIRED_WIDTH] = 128;
+ imagePropertyMap[ImageVisual::Property::DESIRED_HEIGHT] = 128;
+ imagePropertyMap[DevelVisual::Property::VISUAL_FITTING_MODE] = Toolkit::DevelVisual::FILL;
+ imageView.SetProperty(Toolkit::ImageView::Property::IMAGE, imagePropertyMap);
+ imageView.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ imageView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ imageView.SetProperty(Control::Property::PADDING, Extents(15, 10, 5, 10));
+ application.GetScene().Add(imageView);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( imageView.GetProperty<Extents>( Control::Property::PADDING ), Extents( 15, 10, 5, 10 ), TEST_LOCATION );
+ DALI_TEST_EQUALS(imageView.GetProperty<Extents>(Control::Property::PADDING), Extents(15, 10, 5, 10), TEST_LOCATION);
tet_infoline("Remove Padding and test Visual is position correctly");
- imageView.SetProperty( Control::Property::PADDING, Extents( 0, 0, 0, 0 ) );
+ imageView.SetProperty(Control::Property::PADDING, Extents(0, 0, 0, 0));
application.SendNotification();
application.Render();
// Check whether Image Visual transforms on ImageVieiw::OnRelayout()
- Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( imageView );
- Toolkit::Visual::Base imageVisual = DevelControl::GetVisual( controlImpl, ImageView::Property::IMAGE );
- Property::Map resultMap;
- imageVisual.CreatePropertyMap( resultMap );
+ Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation(imageView);
+ Toolkit::Visual::Base imageVisual = DevelControl::GetVisual(controlImpl, ImageView::Property::IMAGE);
+ Property::Map resultMap;
+ imageVisual.CreatePropertyMap(resultMap);
- Property::Value* transformValue = resultMap.Find( Visual::Property::TRANSFORM );
- DALI_TEST_CHECK( transformValue );
+ Property::Value* transformValue = resultMap.Find(Visual::Property::TRANSFORM);
+ DALI_TEST_CHECK(transformValue);
Property::Map* retMap = transformValue->GetMap();
- DALI_TEST_CHECK( retMap );
+ DALI_TEST_CHECK(retMap);
// Image Visual should be positioned depending on ImageView's padding
- DALI_TEST_EQUALS( retMap->Find( Visual::Transform::Property::OFFSET )->Get< Vector2 >(), Vector2( 0, 0 ), TEST_LOCATION );
+ DALI_TEST_EQUALS(retMap->Find(Visual::Transform::Property::OFFSET)->Get<Vector2>(), Vector2(0, 0), TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
- ImageView imageView = ImageView::New();
+ ImageView imageView = ImageView::New();
Property::Map imagePropertyMap;
- imagePropertyMap.Add( Toolkit::Visual::Property::TYPE,Toolkit::Visual::IMAGE )
- .Add( Toolkit::ImageVisual::Property::URL,TEST_RESOURCE_DIR "/Kid1.svg" )
- .Add( ImageVisual::Property::DESIRED_WIDTH,120 )
- .Add( ImageVisual::Property::DESIRED_HEIGHT,120 )
- .Add( DevelVisual::Property::VISUAL_FITTING_MODE, Toolkit::DevelVisual::FILL )
- .Add( Visual::Property::TRANSFORM,
- Property::Map().Add( Toolkit::Visual::Transform::Property::OFFSET_POLICY,
- Vector2( Visual::Transform::Policy::ABSOLUTE, Visual::Transform::Policy::ABSOLUTE ) )
- .Add( Toolkit::Visual::Transform::Property::OFFSET, Vector2( 8, 8 ) ) );
-
- imageView.SetProperty( Toolkit::ImageView::Property::IMAGE , imagePropertyMap );
- imageView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- imageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- application.GetScene().Add( imageView );
+ imagePropertyMap.Add(Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE)
+ .Add(Toolkit::ImageVisual::Property::URL, TEST_RESOURCE_DIR "/Kid1.svg")
+ .Add(ImageVisual::Property::DESIRED_WIDTH, 120)
+ .Add(ImageVisual::Property::DESIRED_HEIGHT, 120)
+ .Add(DevelVisual::Property::VISUAL_FITTING_MODE, Toolkit::DevelVisual::FILL)
+ .Add(Visual::Property::TRANSFORM,
+ Property::Map().Add(Toolkit::Visual::Transform::Property::OFFSET_POLICY,
+ Vector2(Visual::Transform::Policy::ABSOLUTE, Visual::Transform::Policy::ABSOLUTE))
+ .Add(Toolkit::Visual::Transform::Property::OFFSET, Vector2(8, 8)));
+
+ imageView.SetProperty(Toolkit::ImageView::Property::IMAGE, imagePropertyMap);
+ imageView.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ imageView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ application.GetScene().Add(imageView);
application.SendNotification();
application.Render();
// Check whether Image Visual transforms on ImageVieiw::OnRelayout()
- Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( imageView );
- Toolkit::Visual::Base imageVisual = DevelControl::GetVisual( controlImpl, ImageView::Property::IMAGE );
- Property::Map resultMap;
- imageVisual.CreatePropertyMap( resultMap );
+ Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation(imageView);
+ Toolkit::Visual::Base imageVisual = DevelControl::GetVisual(controlImpl, ImageView::Property::IMAGE);
+ Property::Map resultMap;
+ imageVisual.CreatePropertyMap(resultMap);
- Property::Value* transformValue = resultMap.Find( Visual::Property::TRANSFORM );
- DALI_TEST_CHECK( transformValue );
+ Property::Value* transformValue = resultMap.Find(Visual::Property::TRANSFORM);
+ DALI_TEST_CHECK(transformValue);
Property::Map* retMap = transformValue->GetMap();
- DALI_TEST_CHECK( retMap );
+ DALI_TEST_CHECK(retMap);
// Image Visual should be positioned depending on ImageView's padding
- DALI_TEST_EQUALS( retMap->Find( Visual::Transform::Property::OFFSET )->Get< Vector2 >(), Vector2( 8, 8 ), TEST_LOCATION );
- DALI_TEST_EQUALS( retMap->Find( Visual::Transform::Property::OFFSET_POLICY )->Get< Vector2 >(), Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+ DALI_TEST_EQUALS(retMap->Find(Visual::Transform::Property::OFFSET)->Get<Vector2>(), Vector2(8, 8), TEST_LOCATION);
+ DALI_TEST_EQUALS(retMap->Find(Visual::Transform::Property::OFFSET_POLICY)->Get<Vector2>(), Vector2(Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE), TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
// Check ImageView with background and main image, to ensure both visuals are marked as loaded
- ImageView imageView = ImageView::New();
+ ImageView imageView = ImageView::New();
Property::Map imageMap;
- imageMap[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::IMAGE;
- imageMap[ Toolkit::ImageVisual::Property::URL ] = gImage_34_RGBA;
- imageMap[ Toolkit::ImageVisual::Property::ATLASING ] = true;
- imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
- application.GetScene().Add( imageView );
+ imageMap[Toolkit::Visual::Property::TYPE] = Toolkit::Visual::IMAGE;
+ imageMap[Toolkit::ImageVisual::Property::URL] = gImage_34_RGBA;
+ imageMap[Toolkit::ImageVisual::Property::ATLASING] = true;
+ imageView.SetProperty(Toolkit::ImageView::Property::IMAGE, imageMap);
+ application.GetScene().Add(imageView);
// Trigger a potential relayout
application.SendNotification();
Vector3 naturalSize = imageView.GetNaturalSize();
- DALI_TEST_EQUALS( naturalSize.width, 34.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( naturalSize.height, 34.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(naturalSize.width, 34.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(naturalSize.height, 34.0f, TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- tet_infoline( "Create an ImageVisual without padding and set the fill-mode to fill" );
+ tet_infoline("Create an ImageVisual without padding and set the fill-mode to fill");
- ImageView imageView = ImageView::New();
+ ImageView imageView = ImageView::New();
Property::Map imageMap;
- imageMap.Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE );
- imageMap.Add( Toolkit::ImageVisual::Property::URL, gImage_600_RGB );
- imageMap.Add( DevelVisual::Property::VISUAL_FITTING_MODE, DevelVisual::FittingMode::FILL );
+ imageMap.Add(Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE);
+ imageMap.Add(Toolkit::ImageVisual::Property::URL, gImage_600_RGB);
+ imageMap.Add(DevelVisual::Property::VISUAL_FITTING_MODE, DevelVisual::FittingMode::FILL);
- imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
+ imageView.SetProperty(Toolkit::ImageView::Property::IMAGE, imageMap);
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
// Trigger a potential relayout
application.SendNotification();
application.Render();
- Toolkit::Visual::Base visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
- Property::Map returnedMap;
- visual.CreatePropertyMap( returnedMap );
+ Toolkit::Visual::Base visual = DevelControl::GetVisual(Toolkit::Internal::GetImplementation(imageView), Toolkit::ImageView::Property::IMAGE);
+ Property::Map returnedMap;
+ visual.CreatePropertyMap(returnedMap);
- Property::Value* value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
- DALI_TEST_CHECK( value );
+ Property::Value* value = returnedMap.Find(Toolkit::Visual::Property::TRANSFORM);
+ DALI_TEST_CHECK(value);
Property::Map* map = value->GetMap();
- DALI_TEST_CHECK( map );
+ DALI_TEST_CHECK(map);
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2::ONE, TEST_LOCATION );
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2::ONE, TEST_LOCATION);
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get< int >() == Toolkit::Visual::Transform::Policy::RELATIVE );
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE_POLICY);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<int>() == Toolkit::Visual::Transform::Policy::RELATIVE);
END_TEST;
}
{
ToolkitTestApplication application;
- tet_infoline( "Create an ImageVisual using FitKeepAspectRatio ( image: [600,600], view: [600,700] )" );
- tet_infoline( " There should be need to change the transform, offset is adjusted to fit inside");
+ tet_infoline("Create an ImageVisual using FitKeepAspectRatio ( image: [600,600], view: [600,700] )");
+ tet_infoline(" There should be need to change the transform, offset is adjusted to fit inside");
- ImageView imageView = ImageView::New();
+ ImageView imageView = ImageView::New();
Property::Map imageMap;
- imageMap.Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE );
- imageMap.Add( Toolkit::ImageVisual::Property::URL, gImage_600_RGB ); // 600x600 image
- imageMap.Add( DevelVisual::Property::VISUAL_FITTING_MODE , Toolkit::DevelVisual::FIT_KEEP_ASPECT_RATIO );
+ imageMap.Add(Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE);
+ imageMap.Add(Toolkit::ImageVisual::Property::URL, gImage_600_RGB); // 600x600 image
+ imageMap.Add(DevelVisual::Property::VISUAL_FITTING_MODE, Toolkit::DevelVisual::FIT_KEEP_ASPECT_RATIO);
- imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
- imageView.SetProperty( Actor::Property::SIZE, Vector2(600,700) );
+ imageView.SetProperty(Toolkit::ImageView::Property::IMAGE, imageMap);
+ imageView.SetProperty(Actor::Property::SIZE, Vector2(600, 700));
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
// Trigger a potential relayout
application.SendNotification();
application.Render();
- Toolkit::Visual::Base visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
- Property::Map returnedMap;
- visual.CreatePropertyMap( returnedMap );
+ Toolkit::Visual::Base visual = DevelControl::GetVisual(Toolkit::Internal::GetImplementation(imageView), Toolkit::ImageView::Property::IMAGE);
+ Property::Map returnedMap;
+ visual.CreatePropertyMap(returnedMap);
- Property::Value* value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
- DALI_TEST_CHECK( value );
+ Property::Value* value = returnedMap.Find(Toolkit::Visual::Property::TRANSFORM);
+ DALI_TEST_CHECK(value);
Property::Map* map = value->GetMap();
- DALI_TEST_CHECK( map );
+ DALI_TEST_CHECK(map);
// If there's
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 600, 600 ), TEST_LOCATION );
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(600, 600), TEST_LOCATION);
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE_POLICY);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE), TEST_LOCATION);
- value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 0, 50 ), TEST_LOCATION );
+ value = map->Find(Toolkit::Visual::Transform::Property::OFFSET);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(0, 50), TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- tet_infoline( "Create an ImageVisual using Fill ( image: [600,600], view: [600,700] )" );
- tet_infoline( " There should be no need to change the transform, only size is changed to fit view");
+ tet_infoline("Create an ImageVisual using Fill ( image: [600,600], view: [600,700] )");
+ tet_infoline(" There should be no need to change the transform, only size is changed to fit view");
- ImageView imageView = ImageView::New();
+ ImageView imageView = ImageView::New();
Property::Map imageMap;
- imageMap.Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE );
- imageMap.Add( Toolkit::ImageVisual::Property::URL, gImage_600_RGB ); // 600x600 image
- imageMap.Add( DevelVisual::Property::VISUAL_FITTING_MODE , Toolkit::DevelVisual::FILL );
+ imageMap.Add(Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE);
+ imageMap.Add(Toolkit::ImageVisual::Property::URL, gImage_600_RGB); // 600x600 image
+ imageMap.Add(DevelVisual::Property::VISUAL_FITTING_MODE, Toolkit::DevelVisual::FILL);
- imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
- imageView.SetProperty( Actor::Property::SIZE, Vector2(600,700) );
+ imageView.SetProperty(Toolkit::ImageView::Property::IMAGE, imageMap);
+ imageView.SetProperty(Actor::Property::SIZE, Vector2(600, 700));
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
// Trigger a potential relayout
application.SendNotification();
application.Render();
- Toolkit::Visual::Base visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
- Property::Map returnedMap;
- visual.CreatePropertyMap( returnedMap );
+ Toolkit::Visual::Base visual = DevelControl::GetVisual(Toolkit::Internal::GetImplementation(imageView), Toolkit::ImageView::Property::IMAGE);
+ Property::Map returnedMap;
+ visual.CreatePropertyMap(returnedMap);
- Property::Value* value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
- DALI_TEST_CHECK( value );
+ Property::Value* value = returnedMap.Find(Toolkit::Visual::Property::TRANSFORM);
+ DALI_TEST_CHECK(value);
Property::Map* map = value->GetMap();
- DALI_TEST_CHECK( map );
+ DALI_TEST_CHECK(map);
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2::ONE, TEST_LOCATION ); // Change the internal size according to the image view size
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2::ONE, TEST_LOCATION); // Change the internal size according to the image view size
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get< int >() == Toolkit::Visual::Transform::Policy::RELATIVE );
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE_POLICY);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<int>() == Toolkit::Visual::Transform::Policy::RELATIVE);
- value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 0, 0 ), TEST_LOCATION ); // OFFSET is zero
+ value = map->Find(Toolkit::Visual::Transform::Property::OFFSET);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(0, 0), TEST_LOCATION); // OFFSET is zero
END_TEST;
}
{
ToolkitTestApplication application;
- tet_infoline( "Create an ImageVisual using OverFitKeepAspectRatio ( image: [600,600], view: [600,500] )" );
- tet_infoline( " offset or size is the same as view, but adjust internally using pixelArea ");
+ tet_infoline("Create an ImageVisual using OverFitKeepAspectRatio ( image: [600,600], view: [600,500] )");
+ tet_infoline(" offset or size is the same as view, but adjust internally using pixelArea ");
- ImageView imageView = ImageView::New();
+ ImageView imageView = ImageView::New();
Property::Map imageMap;
- imageMap.Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE );
- imageMap.Add( Toolkit::ImageVisual::Property::URL, gImage_600_RGB ); // 600x600 image
- imageMap.Add( DevelVisual::Property::VISUAL_FITTING_MODE , Toolkit::DevelVisual::OVER_FIT_KEEP_ASPECT_RATIO );
+ imageMap.Add(Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE);
+ imageMap.Add(Toolkit::ImageVisual::Property::URL, gImage_600_RGB); // 600x600 image
+ imageMap.Add(DevelVisual::Property::VISUAL_FITTING_MODE, Toolkit::DevelVisual::OVER_FIT_KEEP_ASPECT_RATIO);
- imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
- imageView.SetProperty( Actor::Property::SIZE, Vector2(600,500) );
+ imageView.SetProperty(Toolkit::ImageView::Property::IMAGE, imageMap);
+ imageView.SetProperty(Actor::Property::SIZE, Vector2(600, 500));
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
// Trigger a potential relayout
application.SendNotification();
application.Render();
- Toolkit::Visual::Base visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
- Property::Map returnedMap;
- visual.CreatePropertyMap( returnedMap );
+ Toolkit::Visual::Base visual = DevelControl::GetVisual(Toolkit::Internal::GetImplementation(imageView), Toolkit::ImageView::Property::IMAGE);
+ Property::Map returnedMap;
+ visual.CreatePropertyMap(returnedMap);
- Property::Value* value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
- DALI_TEST_CHECK( value );
+ Property::Value* value = returnedMap.Find(Toolkit::Visual::Property::TRANSFORM);
+ DALI_TEST_CHECK(value);
Property::Map* map = value->GetMap();
- DALI_TEST_CHECK( map );
+ DALI_TEST_CHECK(map);
// If there's
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 600, 500 ), TEST_LOCATION ); // Change the internal size according to the image view size
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(600, 500), TEST_LOCATION); // Change the internal size according to the image view size
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE_POLICY);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE), TEST_LOCATION);
- value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 0, 0 ), TEST_LOCATION ); // OFFSET is zero
+ value = map->Find(Toolkit::Visual::Transform::Property::OFFSET);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(0, 0), TEST_LOCATION); // OFFSET is zero
END_TEST;
}
{
ToolkitTestApplication application;
- tet_infoline( "Create an ImageVisual using Center ( image: [600,600], view: [700,700] )" );
- tet_infoline( " There should be need to change the transform, offset is adjusted to fit inside");
+ tet_infoline("Create an ImageVisual using Center ( image: [600,600], view: [700,700] )");
+ tet_infoline(" There should be need to change the transform, offset is adjusted to fit inside");
- ImageView imageView = ImageView::New();
+ ImageView imageView = ImageView::New();
Property::Map imageMap;
- imageMap.Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE );
- imageMap.Add( Toolkit::ImageVisual::Property::URL, gImage_600_RGB ); // 600x600 image
- imageMap.Add( DevelVisual::Property::VISUAL_FITTING_MODE, Toolkit::DevelVisual::CENTER);
+ imageMap.Add(Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE);
+ imageMap.Add(Toolkit::ImageVisual::Property::URL, gImage_600_RGB); // 600x600 image
+ imageMap.Add(DevelVisual::Property::VISUAL_FITTING_MODE, Toolkit::DevelVisual::CENTER);
- imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
- imageView.SetProperty( Actor::Property::SIZE, Vector2(700,700) );
+ imageView.SetProperty(Toolkit::ImageView::Property::IMAGE, imageMap);
+ imageView.SetProperty(Actor::Property::SIZE, Vector2(700, 700));
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
// Trigger a potential relayout
application.SendNotification();
application.Render();
- Toolkit::Visual::Base visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
- Property::Map returnedMap;
- visual.CreatePropertyMap( returnedMap );
+ Toolkit::Visual::Base visual = DevelControl::GetVisual(Toolkit::Internal::GetImplementation(imageView), Toolkit::ImageView::Property::IMAGE);
+ Property::Map returnedMap;
+ visual.CreatePropertyMap(returnedMap);
- Property::Value* value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
- DALI_TEST_CHECK( value );
+ Property::Value* value = returnedMap.Find(Toolkit::Visual::Property::TRANSFORM);
+ DALI_TEST_CHECK(value);
Property::Map* map = value->GetMap();
- DALI_TEST_CHECK( map );
+ DALI_TEST_CHECK(map);
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 600, 600 ), TEST_LOCATION ); // Change the internal size according to the image view size
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(600, 600), TEST_LOCATION); // Change the internal size according to the image view size
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE_POLICY);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE), TEST_LOCATION);
- value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 50, 50 ), TEST_LOCATION );
+ value = map->Find(Toolkit::Visual::Transform::Property::OFFSET);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(50, 50), TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- tet_infoline( "Create an ImageVisual using Center ( image: [600,600], view: [500,500] )" );
- tet_infoline( " There should be need to change the transform, offset is adjusted to fit inside");
+ tet_infoline("Create an ImageVisual using Center ( image: [600,600], view: [500,500] )");
+ tet_infoline(" There should be need to change the transform, offset is adjusted to fit inside");
- ImageView imageView = ImageView::New();
+ ImageView imageView = ImageView::New();
Property::Map imageMap;
- imageMap.Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE );
- imageMap.Add( Toolkit::ImageVisual::Property::URL, gImage_600_RGB ); // 600x600 image
- imageMap.Add( DevelVisual::Property::VISUAL_FITTING_MODE, Toolkit::DevelVisual::CENTER);
+ imageMap.Add(Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE);
+ imageMap.Add(Toolkit::ImageVisual::Property::URL, gImage_600_RGB); // 600x600 image
+ imageMap.Add(DevelVisual::Property::VISUAL_FITTING_MODE, Toolkit::DevelVisual::CENTER);
- imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
- imageView.SetProperty( Actor::Property::SIZE, Vector2(700,700) );
+ imageView.SetProperty(Toolkit::ImageView::Property::IMAGE, imageMap);
+ imageView.SetProperty(Actor::Property::SIZE, Vector2(700, 700));
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
// Trigger a potential relayout
application.SendNotification();
application.Render();
- Toolkit::Visual::Base visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
- Property::Map returnedMap;
- visual.CreatePropertyMap( returnedMap );
+ Toolkit::Visual::Base visual = DevelControl::GetVisual(Toolkit::Internal::GetImplementation(imageView), Toolkit::ImageView::Property::IMAGE);
+ Property::Map returnedMap;
+ visual.CreatePropertyMap(returnedMap);
- Property::Value* value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
- DALI_TEST_CHECK( value );
+ Property::Value* value = returnedMap.Find(Toolkit::Visual::Property::TRANSFORM);
+ DALI_TEST_CHECK(value);
Property::Map* map = value->GetMap();
- DALI_TEST_CHECK( map );
+ DALI_TEST_CHECK(map);
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 600, 600 ), TEST_LOCATION ); // Change the internal size according to the image view size
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(600, 600), TEST_LOCATION); // Change the internal size according to the image view size
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE_POLICY);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE), TEST_LOCATION);
- value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 50, 50 ), TEST_LOCATION );
+ value = map->Find(Toolkit::Visual::Transform::Property::OFFSET);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(50, 50), TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- tet_infoline( "Create an ImageVisual using FitHeight ( image: [600,600], view: [600,700] )" );
+ tet_infoline("Create an ImageVisual using FitHeight ( image: [600,600], view: [600,700] )");
- ImageView imageView = ImageView::New();
+ ImageView imageView = ImageView::New();
Property::Map imageMap;
- imageMap.Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE );
- imageMap.Add( Toolkit::ImageVisual::Property::URL, gImage_600_RGB ); // 600x600 image
- imageMap.Add( DevelVisual::Property::VISUAL_FITTING_MODE, Toolkit::DevelVisual::FIT_HEIGHT);
+ imageMap.Add(Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE);
+ imageMap.Add(Toolkit::ImageVisual::Property::URL, gImage_600_RGB); // 600x600 image
+ imageMap.Add(DevelVisual::Property::VISUAL_FITTING_MODE, Toolkit::DevelVisual::FIT_HEIGHT);
- imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
- imageView.SetProperty( Actor::Property::SIZE, Vector2(600,700) );
+ imageView.SetProperty(Toolkit::ImageView::Property::IMAGE, imageMap);
+ imageView.SetProperty(Actor::Property::SIZE, Vector2(600, 700));
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
// Trigger a potential relayout
application.SendNotification();
application.Render();
- Toolkit::Visual::Base visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
- Property::Map returnedMap;
- visual.CreatePropertyMap( returnedMap );
+ Toolkit::Visual::Base visual = DevelControl::GetVisual(Toolkit::Internal::GetImplementation(imageView), Toolkit::ImageView::Property::IMAGE);
+ Property::Map returnedMap;
+ visual.CreatePropertyMap(returnedMap);
- Property::Value* value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
- DALI_TEST_CHECK( value );
+ Property::Value* value = returnedMap.Find(Toolkit::Visual::Property::TRANSFORM);
+ DALI_TEST_CHECK(value);
Property::Map* map = value->GetMap();
- DALI_TEST_CHECK( map );
+ DALI_TEST_CHECK(map);
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 600, 700 ), TEST_LOCATION ); // Change the internal size according to the image view size
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(600, 700), TEST_LOCATION); // Change the internal size according to the image view size
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE_POLICY);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE), TEST_LOCATION);
- value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 0, 0 ), TEST_LOCATION ); // OFFSET is zero
+ value = map->Find(Toolkit::Visual::Transform::Property::OFFSET);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(0, 0), TEST_LOCATION); // OFFSET is zero
END_TEST;
}
{
ToolkitTestApplication application;
- tet_infoline( "Create an ImageVisual using FitHeight ( image: [600,600], view: [700,600] )" );
+ tet_infoline("Create an ImageVisual using FitHeight ( image: [600,600], view: [700,600] )");
- ImageView imageView = ImageView::New();
+ ImageView imageView = ImageView::New();
Property::Map imageMap;
- imageMap.Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE );
- imageMap.Add( Toolkit::ImageVisual::Property::URL, gImage_600_RGB ); // 249x169 image
- imageMap.Add( DevelVisual::Property::VISUAL_FITTING_MODE, Toolkit::DevelVisual::FIT_HEIGHT);
+ imageMap.Add(Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE);
+ imageMap.Add(Toolkit::ImageVisual::Property::URL, gImage_600_RGB); // 249x169 image
+ imageMap.Add(DevelVisual::Property::VISUAL_FITTING_MODE, Toolkit::DevelVisual::FIT_HEIGHT);
- imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
- imageView.SetProperty( Actor::Property::SIZE, Vector2(700,600) );
+ imageView.SetProperty(Toolkit::ImageView::Property::IMAGE, imageMap);
+ imageView.SetProperty(Actor::Property::SIZE, Vector2(700, 600));
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
// Trigger a potential relayout
application.SendNotification();
application.Render();
- Toolkit::Visual::Base visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
- Property::Map returnedMap;
- visual.CreatePropertyMap( returnedMap );
+ Toolkit::Visual::Base visual = DevelControl::GetVisual(Toolkit::Internal::GetImplementation(imageView), Toolkit::ImageView::Property::IMAGE);
+ Property::Map returnedMap;
+ visual.CreatePropertyMap(returnedMap);
- Property::Value* value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
- DALI_TEST_CHECK( value );
+ Property::Value* value = returnedMap.Find(Toolkit::Visual::Property::TRANSFORM);
+ DALI_TEST_CHECK(value);
Property::Map* map = value->GetMap();
- DALI_TEST_CHECK( map );
+ DALI_TEST_CHECK(map);
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 600, 600 ), TEST_LOCATION ); // Change the internal size according to the image view size
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(600, 600), TEST_LOCATION); // Change the internal size according to the image view size
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE_POLICY);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE), TEST_LOCATION);
- value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 50, 0 ), TEST_LOCATION );
+ value = map->Find(Toolkit::Visual::Transform::Property::OFFSET);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(50, 0), TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- tet_infoline( "Create an ImageVisual using FitWidth ( image: [600,600], view: [600,700] )" );
+ tet_infoline("Create an ImageVisual using FitWidth ( image: [600,600], view: [600,700] )");
- ImageView imageView = ImageView::New();
+ ImageView imageView = ImageView::New();
Property::Map imageMap;
- imageMap.Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE );
- imageMap.Add( Toolkit::ImageVisual::Property::URL, gImage_600_RGB ); // 600x600 image
- imageMap.Add( DevelVisual::Property::VISUAL_FITTING_MODE, Toolkit::DevelVisual::FIT_WIDTH);
+ imageMap.Add(Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE);
+ imageMap.Add(Toolkit::ImageVisual::Property::URL, gImage_600_RGB); // 600x600 image
+ imageMap.Add(DevelVisual::Property::VISUAL_FITTING_MODE, Toolkit::DevelVisual::FIT_WIDTH);
- imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
- imageView.SetProperty( Actor::Property::SIZE, Vector2(600,700) );
+ imageView.SetProperty(Toolkit::ImageView::Property::IMAGE, imageMap);
+ imageView.SetProperty(Actor::Property::SIZE, Vector2(600, 700));
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
// Trigger a potential relayout
application.SendNotification();
application.Render();
- Toolkit::Visual::Base visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
- Property::Map returnedMap;
- visual.CreatePropertyMap( returnedMap );
+ Toolkit::Visual::Base visual = DevelControl::GetVisual(Toolkit::Internal::GetImplementation(imageView), Toolkit::ImageView::Property::IMAGE);
+ Property::Map returnedMap;
+ visual.CreatePropertyMap(returnedMap);
- Property::Value* value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
- DALI_TEST_CHECK( value );
+ Property::Value* value = returnedMap.Find(Toolkit::Visual::Property::TRANSFORM);
+ DALI_TEST_CHECK(value);
Property::Map* map = value->GetMap();
- DALI_TEST_CHECK( map );
+ DALI_TEST_CHECK(map);
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 600, 600 ), TEST_LOCATION ); // Change the internal size according to the image view size
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(600, 600), TEST_LOCATION); // Change the internal size according to the image view size
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE_POLICY);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE), TEST_LOCATION);
- value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 0, 50 ), TEST_LOCATION );
+ value = map->Find(Toolkit::Visual::Transform::Property::OFFSET);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(0, 50), TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- tet_infoline( "Create an ImageVisual using FitWidth ( image: [600,600], view:[700,600] )" );
+ tet_infoline("Create an ImageVisual using FitWidth ( image: [600,600], view:[700,600] )");
- ImageView imageView = ImageView::New();
+ ImageView imageView = ImageView::New();
Property::Map imageMap;
- imageMap.Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE );
- imageMap.Add( Toolkit::ImageVisual::Property::URL, gImage_600_RGB ); // 249x169 image
- imageMap.Add( DevelVisual::Property::VISUAL_FITTING_MODE, Toolkit::DevelVisual::FIT_WIDTH);
+ imageMap.Add(Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE);
+ imageMap.Add(Toolkit::ImageVisual::Property::URL, gImage_600_RGB); // 249x169 image
+ imageMap.Add(DevelVisual::Property::VISUAL_FITTING_MODE, Toolkit::DevelVisual::FIT_WIDTH);
- imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
- imageView.SetProperty( Actor::Property::SIZE, Vector2(700,600) );
+ imageView.SetProperty(Toolkit::ImageView::Property::IMAGE, imageMap);
+ imageView.SetProperty(Actor::Property::SIZE, Vector2(700, 600));
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
// Trigger a potential relayout
application.SendNotification();
application.Render();
- Toolkit::Visual::Base visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
- Property::Map returnedMap;
- visual.CreatePropertyMap( returnedMap );
+ Toolkit::Visual::Base visual = DevelControl::GetVisual(Toolkit::Internal::GetImplementation(imageView), Toolkit::ImageView::Property::IMAGE);
+ Property::Map returnedMap;
+ visual.CreatePropertyMap(returnedMap);
- Property::Value* value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
- DALI_TEST_CHECK( value );
+ Property::Value* value = returnedMap.Find(Toolkit::Visual::Property::TRANSFORM);
+ DALI_TEST_CHECK(value);
Property::Map* map = value->GetMap();
- DALI_TEST_CHECK( map );
+ DALI_TEST_CHECK(map);
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 700, 600 ), TEST_LOCATION ); // Change the internal size according to the image view size
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(700, 600), TEST_LOCATION); // Change the internal size according to the image view size
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE_POLICY);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE), TEST_LOCATION);
- value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 0, 0 ), TEST_LOCATION ); // OFFSET is zero
+ value = map->Find(Toolkit::Visual::Transform::Property::OFFSET);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(0, 0), TEST_LOCATION); // OFFSET is zero
END_TEST;
}
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliImageViewFittingModesChangeFittingMode, image: [600,600], view:[800,700]" );
+ tet_infoline("UtcDaliImageViewFittingModesChangeFittingMode, image: [600,600], view:[800,700]");
ImageView imageView = ImageView::New();
// 1. Render using FittingMode::SHRINK_TO_FIT
Property::Map imageMap;
- imageMap[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::IMAGE;
- imageMap[ Toolkit::ImageVisual::Property::URL ] = gImage_600_RGB;
- imageMap[ DevelVisual::Property::VISUAL_FITTING_MODE ] = Toolkit::DevelVisual::FIT_KEEP_ASPECT_RATIO;
+ imageMap[Toolkit::Visual::Property::TYPE] = Toolkit::Visual::IMAGE;
+ imageMap[Toolkit::ImageVisual::Property::URL] = gImage_600_RGB;
+ imageMap[DevelVisual::Property::VISUAL_FITTING_MODE] = Toolkit::DevelVisual::FIT_KEEP_ASPECT_RATIO;
- imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
- imageView.SetProperty( Actor::Property::SIZE, Vector2(800,700) );
+ imageView.SetProperty(Toolkit::ImageView::Property::IMAGE, imageMap);
+ imageView.SetProperty(Actor::Property::SIZE, Vector2(800, 700));
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
// Trigger a potential relayout
application.SendNotification();
application.Render();
- Toolkit::Visual::Base visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
- Property::Map returnedMap;
- visual.CreatePropertyMap( returnedMap );
+ Toolkit::Visual::Base visual = DevelControl::GetVisual(Toolkit::Internal::GetImplementation(imageView), Toolkit::ImageView::Property::IMAGE);
+ Property::Map returnedMap;
+ visual.CreatePropertyMap(returnedMap);
- Property::Value* value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
- DALI_TEST_CHECK( value );
+ Property::Value* value = returnedMap.Find(Toolkit::Visual::Property::TRANSFORM);
+ DALI_TEST_CHECK(value);
Property::Map* map = value->GetMap();
- DALI_TEST_CHECK( map );
+ DALI_TEST_CHECK(map);
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 700, 700 ), TEST_LOCATION ); // Change the internal size according to the image view size
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(700, 700), TEST_LOCATION); // Change the internal size according to the image view size
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE_POLICY);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE), TEST_LOCATION);
- value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 50, 0 ), TEST_LOCATION );
+ value = map->Find(Toolkit::Visual::Transform::Property::OFFSET);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(50, 0), TEST_LOCATION);
// 2. Render again using DevelVisaul::CENTER
Property::Map imageMap2;
- imageMap2[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::IMAGE;
- imageMap2[ Toolkit::ImageVisual::Property::URL ] = gImage_600_RGB;
- imageMap2[ DevelVisual::Property::VISUAL_FITTING_MODE ] = Toolkit::DevelVisual::CENTER;
+ imageMap2[Toolkit::Visual::Property::TYPE] = Toolkit::Visual::IMAGE;
+ imageMap2[Toolkit::ImageVisual::Property::URL] = gImage_600_RGB;
+ imageMap2[DevelVisual::Property::VISUAL_FITTING_MODE] = Toolkit::DevelVisual::CENTER;
- imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap2 );
- imageView.SetProperty( Actor::Property::SIZE, Vector2(800,700) );
+ imageView.SetProperty(Toolkit::ImageView::Property::IMAGE, imageMap2);
+ imageView.SetProperty(Actor::Property::SIZE, Vector2(800, 700));
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
// Trigger a potential relayout
application.SendNotification();
application.Render();
returnedMap.Clear();
- visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
+ visual = DevelControl::GetVisual(Toolkit::Internal::GetImplementation(imageView), Toolkit::ImageView::Property::IMAGE);
- visual.CreatePropertyMap( returnedMap );
+ visual.CreatePropertyMap(returnedMap);
- value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
- DALI_TEST_CHECK( value );
+ value = returnedMap.Find(Toolkit::Visual::Property::TRANSFORM);
+ DALI_TEST_CHECK(value);
map = value->GetMap();
- DALI_TEST_CHECK( map );
+ DALI_TEST_CHECK(map);
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 600, 600 ), TEST_LOCATION ); // Change the internal size according to the image view size
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(600, 600), TEST_LOCATION); // Change the internal size according to the image view size
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE_POLICY);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE), TEST_LOCATION);
- value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 100, 50 ), TEST_LOCATION );
+ value = map->Find(Toolkit::Visual::Transform::Property::OFFSET);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(100, 50), TEST_LOCATION);
// 3. Render again using before fittingMode
Property::Map imageMap3;
- imageMap3[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::IMAGE;
- imageMap3[ Toolkit::ImageVisual::Property::URL ] = gImage_600_RGB;
- imageMap3[ DevelVisual::Property::VISUAL_FITTING_MODE ] = Toolkit::DevelVisual::FIT_KEEP_ASPECT_RATIO;
+ imageMap3[Toolkit::Visual::Property::TYPE] = Toolkit::Visual::IMAGE;
+ imageMap3[Toolkit::ImageVisual::Property::URL] = gImage_600_RGB;
+ imageMap3[DevelVisual::Property::VISUAL_FITTING_MODE] = Toolkit::DevelVisual::FIT_KEEP_ASPECT_RATIO;
- imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap3 );
- imageView.SetProperty( Actor::Property::SIZE, Vector2(800,700) );
+ imageView.SetProperty(Toolkit::ImageView::Property::IMAGE, imageMap3);
+ imageView.SetProperty(Actor::Property::SIZE, Vector2(800, 700));
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
// Trigger a potential relayout
application.SendNotification();
application.Render();
returnedMap.Clear();
- visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
- visual.CreatePropertyMap( returnedMap );
+ visual = DevelControl::GetVisual(Toolkit::Internal::GetImplementation(imageView), Toolkit::ImageView::Property::IMAGE);
+ visual.CreatePropertyMap(returnedMap);
- value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
- DALI_TEST_CHECK( value );
+ value = returnedMap.Find(Toolkit::Visual::Property::TRANSFORM);
+ DALI_TEST_CHECK(value);
map = value->GetMap();
- DALI_TEST_CHECK( map );
+ DALI_TEST_CHECK(map);
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 700, 700 ), TEST_LOCATION ); // Change the internal size according to the image view size
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(700, 700), TEST_LOCATION); // Change the internal size according to the image view size
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE_POLICY);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE), TEST_LOCATION);
- value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 50, 0 ), TEST_LOCATION );
+ value = map->Find(Toolkit::Visual::Transform::Property::OFFSET);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(50, 0), TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliImageViewFittingModesChangeFittingMode, image: [600,600], view:[800,700]" );
+ tet_infoline("UtcDaliImageViewFittingModesChangeFittingMode, image: [600,600], view:[800,700]");
ImageView imageView = ImageView::New();
// 1. Render using FittingMode::OVER_FIT_KEEP_ASPECT_RATIO
Property::Map imageMap;
- imageMap[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::IMAGE;
- imageMap[ Toolkit::ImageVisual::Property::URL ] = gImage_600_RGB;
- imageMap[ DevelVisual::Property::VISUAL_FITTING_MODE ] = Toolkit::DevelVisual::OVER_FIT_KEEP_ASPECT_RATIO;
+ imageMap[Toolkit::Visual::Property::TYPE] = Toolkit::Visual::IMAGE;
+ imageMap[Toolkit::ImageVisual::Property::URL] = gImage_600_RGB;
+ imageMap[DevelVisual::Property::VISUAL_FITTING_MODE] = Toolkit::DevelVisual::OVER_FIT_KEEP_ASPECT_RATIO;
- imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
- imageView.SetProperty( Actor::Property::SIZE, Vector2(800,700) );
+ imageView.SetProperty(Toolkit::ImageView::Property::IMAGE, imageMap);
+ imageView.SetProperty(Actor::Property::SIZE, Vector2(800, 700));
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
// Trigger a potential relayout
application.SendNotification();
application.Render();
- Toolkit::Visual::Base visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
- Property::Map returnedMap;
- visual.CreatePropertyMap( returnedMap );
+ Toolkit::Visual::Base visual = DevelControl::GetVisual(Toolkit::Internal::GetImplementation(imageView), Toolkit::ImageView::Property::IMAGE);
+ Property::Map returnedMap;
+ visual.CreatePropertyMap(returnedMap);
- Property::Value* value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
- DALI_TEST_CHECK( value );
+ Property::Value* value = returnedMap.Find(Toolkit::Visual::Property::TRANSFORM);
+ DALI_TEST_CHECK(value);
Property::Map* map = value->GetMap();
- DALI_TEST_CHECK( map );
+ DALI_TEST_CHECK(map);
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 800, 700 ), TEST_LOCATION ); // Change the internal size according to the image view size
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(800, 700), TEST_LOCATION); // Change the internal size according to the image view size
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE_POLICY);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE), TEST_LOCATION);
- value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 0, 0 ), TEST_LOCATION );
+ value = map->Find(Toolkit::Visual::Transform::Property::OFFSET);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(0, 0), TEST_LOCATION);
// 2. Render again using DevelVisaul::CENTER
Property::Map imageMap2;
- imageMap2[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::IMAGE;
- imageMap2[ Toolkit::ImageVisual::Property::URL ] = gImage_600_RGB;
- imageMap2[ DevelVisual::Property::VISUAL_FITTING_MODE ] = Toolkit::DevelVisual::CENTER;
+ imageMap2[Toolkit::Visual::Property::TYPE] = Toolkit::Visual::IMAGE;
+ imageMap2[Toolkit::ImageVisual::Property::URL] = gImage_600_RGB;
+ imageMap2[DevelVisual::Property::VISUAL_FITTING_MODE] = Toolkit::DevelVisual::CENTER;
- imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap2 );
- imageView.SetProperty( Actor::Property::SIZE, Vector2(800,700) );
+ imageView.SetProperty(Toolkit::ImageView::Property::IMAGE, imageMap2);
+ imageView.SetProperty(Actor::Property::SIZE, Vector2(800, 700));
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
// Trigger a potential relayout
application.SendNotification();
application.Render();
returnedMap.Clear();
- visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
+ visual = DevelControl::GetVisual(Toolkit::Internal::GetImplementation(imageView), Toolkit::ImageView::Property::IMAGE);
- visual.CreatePropertyMap( returnedMap );
+ visual.CreatePropertyMap(returnedMap);
- value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
- DALI_TEST_CHECK( value );
+ value = returnedMap.Find(Toolkit::Visual::Property::TRANSFORM);
+ DALI_TEST_CHECK(value);
map = value->GetMap();
- DALI_TEST_CHECK( map );
+ DALI_TEST_CHECK(map);
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 600, 600 ), TEST_LOCATION ); // Change the internal size according to the image view size
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(600, 600), TEST_LOCATION); // Change the internal size according to the image view size
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE_POLICY);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE), TEST_LOCATION);
- value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 100, 50 ), TEST_LOCATION );
+ value = map->Find(Toolkit::Visual::Transform::Property::OFFSET);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(100, 50), TEST_LOCATION);
// 3. Render again using before fittingMode
Property::Map imageMap3;
- imageMap3[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::IMAGE;
- imageMap3[ Toolkit::ImageVisual::Property::URL ] = gImage_600_RGB;
- imageMap3[ DevelVisual::Property::VISUAL_FITTING_MODE ] = Toolkit::DevelVisual::OVER_FIT_KEEP_ASPECT_RATIO;
+ imageMap3[Toolkit::Visual::Property::TYPE] = Toolkit::Visual::IMAGE;
+ imageMap3[Toolkit::ImageVisual::Property::URL] = gImage_600_RGB;
+ imageMap3[DevelVisual::Property::VISUAL_FITTING_MODE] = Toolkit::DevelVisual::OVER_FIT_KEEP_ASPECT_RATIO;
- imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap3 );
- imageView.SetProperty( Actor::Property::SIZE, Vector2(800,700) );
+ imageView.SetProperty(Toolkit::ImageView::Property::IMAGE, imageMap3);
+ imageView.SetProperty(Actor::Property::SIZE, Vector2(800, 700));
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
// Trigger a potential relayout
application.SendNotification();
application.Render();
returnedMap.Clear();
- visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
- visual.CreatePropertyMap( returnedMap );
+ visual = DevelControl::GetVisual(Toolkit::Internal::GetImplementation(imageView), Toolkit::ImageView::Property::IMAGE);
+ visual.CreatePropertyMap(returnedMap);
- value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
- DALI_TEST_CHECK( value );
+ value = returnedMap.Find(Toolkit::Visual::Property::TRANSFORM);
+ DALI_TEST_CHECK(value);
map = value->GetMap();
- DALI_TEST_CHECK( map );
+ DALI_TEST_CHECK(map);
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 800, 700 ), TEST_LOCATION ); // Change the internal size according to the image view size
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(800, 700), TEST_LOCATION); // Change the internal size according to the image view size
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ), TEST_LOCATION );
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE_POLICY);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE), TEST_LOCATION);
- value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 0, 0 ), TEST_LOCATION );
+ value = map->Find(Toolkit::Visual::Transform::Property::OFFSET);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(0, 0), TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- tet_infoline( "Create an ImageVisual using SCALE_TO_FILL and animated vector image ( image: [600,600], view:[600,600] )" );
+ tet_infoline("Create an ImageVisual using SCALE_TO_FILL and animated vector image ( image: [600,600], view:[600,600] )");
- ImageView imageView = ImageView::New();
+ ImageView imageView = ImageView::New();
Property::Map imageMap;
- imageMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE );
- imageMap.Add( Toolkit::ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME ); // 249x169 image
+ imageMap.Add(Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE);
+ imageMap.Add(Toolkit::ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME); // 249x169 image
- imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imageMap );
- imageView.SetProperty( Actor::Property::SIZE, Vector2(600,600) );
+ imageView.SetProperty(Toolkit::ImageView::Property::IMAGE, imageMap);
+ imageView.SetProperty(Actor::Property::SIZE, Vector2(600, 600));
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
// Trigger a potential relayout
application.SendNotification();
application.Render();
- Toolkit::Visual::Base visual = DevelControl::GetVisual( Toolkit::Internal::GetImplementation( imageView ), Toolkit::ImageView::Property::IMAGE );
- Property::Map returnedMap;
- visual.CreatePropertyMap( returnedMap );
+ Toolkit::Visual::Base visual = DevelControl::GetVisual(Toolkit::Internal::GetImplementation(imageView), Toolkit::ImageView::Property::IMAGE);
+ Property::Map returnedMap;
+ visual.CreatePropertyMap(returnedMap);
- Property::Value* value = returnedMap.Find( Toolkit::Visual::Property::TRANSFORM );
- DALI_TEST_CHECK( value );
+ Property::Value* value = returnedMap.Find(Toolkit::Visual::Property::TRANSFORM);
+ DALI_TEST_CHECK(value);
Property::Map* map = value->GetMap();
- DALI_TEST_CHECK( map );
+ DALI_TEST_CHECK(map);
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2::ONE, TEST_LOCATION ); // Relative size so will take up 100%
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2::ONE, TEST_LOCATION); // Relative size so will take up 100%
- value = map->Find( Toolkit::Visual::Transform::Property::SIZE_POLICY );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get< int >() == Toolkit::Visual::Transform::Policy::RELATIVE );
+ value = map->Find(Toolkit::Visual::Transform::Property::SIZE_POLICY);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_CHECK(value->Get<int>() == Toolkit::Visual::Transform::Policy::RELATIVE);
- value = map->Find( Toolkit::Visual::Transform::Property::OFFSET );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get< Vector2 >(), Vector2( 0, 0 ), TEST_LOCATION ); // OFFSET is zero
+ value = map->Find(Toolkit::Visual::Transform::Property::OFFSET);
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<Vector2>(), Vector2(0, 0), TEST_LOCATION); // OFFSET is zero
END_TEST;
}
-
int UtcDaliImageViewCustomShader(void)
{
ToolkitTestApplication application;
// Set a custom shader with an image url
{
- Property::Map properties;
- Property::Map shader;
- const std::string vertexShader = "Foobar";
- const std::string fragmentShader = "Foobar";
+ Property::Map properties;
+ Property::Map shader;
+ const std::string vertexShader = "Foobar";
+ const std::string fragmentShader = "Foobar";
shader[Visual::Shader::Property::FRAGMENT_SHADER] = fragmentShader;
- shader[Visual::Shader::Property::VERTEX_SHADER] = vertexShader;
+ shader[Visual::Shader::Property::VERTEX_SHADER] = vertexShader;
- properties[Visual::Property::TYPE] = Visual::IMAGE;
- properties[Visual::Property::SHADER] = shader;
+ properties[Visual::Property::TYPE] = Visual::IMAGE;
+ properties[Visual::Property::SHADER] = shader;
properties[ImageVisual::Property::URL] = TEST_IMAGE_FILE_NAME;
ImageView imageView = ImageView::New();
- imageView.SetProperty( ImageView::Property::IMAGE, properties );
+ imageView.SetProperty(ImageView::Property::IMAGE, properties);
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
- Renderer renderer = imageView.GetRendererAt( 0 );
- Shader shader2 = renderer.GetShader();
- Property::Value value = shader2.GetProperty( Shader::Property::PROGRAM );
- Property::Map* map = value.GetMap();
- DALI_TEST_CHECK( map );
+ Renderer renderer = imageView.GetRendererAt(0);
+ Shader shader2 = renderer.GetShader();
+ Property::Value value = shader2.GetProperty(Shader::Property::PROGRAM);
+ Property::Map* map = value.GetMap();
+ DALI_TEST_CHECK(map);
- Property::Value* fragment = map->Find( "fragment" ); // fragment key name from shader-impl.cpp
- DALI_TEST_EQUALS( fragmentShader, fragment->Get< std::string >(), TEST_LOCATION );
+ Property::Value* fragment = map->Find("fragment"); // fragment key name from shader-impl.cpp
+ DALI_TEST_EQUALS(fragmentShader, fragment->Get<std::string>(), TEST_LOCATION);
- Property::Value* vertex = map->Find( "vertex" ); // vertex key name from shader-impl.cpp
- DALI_TEST_EQUALS( vertexShader, vertex->Get< std::string >(), TEST_LOCATION );
+ Property::Value* vertex = map->Find("vertex"); // vertex key name from shader-impl.cpp
+ DALI_TEST_EQUALS(vertexShader, vertex->Get<std::string>(), TEST_LOCATION);
}
// Set a custom shader after setting an image url
{
- Property::Map properties;
- Property::Map shader;
- const std::string vertexShader = "Foobar";
- const std::string fragmentShader = "Foobar";
+ Property::Map properties;
+ Property::Map shader;
+ const std::string vertexShader = "Foobar";
+ const std::string fragmentShader = "Foobar";
shader[Visual::Shader::Property::FRAGMENT_SHADER] = fragmentShader;
- shader[Visual::Shader::Property::VERTEX_SHADER] = vertexShader;
+ shader[Visual::Shader::Property::VERTEX_SHADER] = vertexShader;
properties[Visual::Property::SHADER] = shader;
- ImageView imageView = ImageView::New( TEST_IMAGE_FILE_NAME );
- imageView.SetProperty( ImageView::Property::IMAGE, properties );
+ ImageView imageView = ImageView::New(TEST_IMAGE_FILE_NAME);
+ imageView.SetProperty(ImageView::Property::IMAGE, properties);
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
- Renderer renderer = imageView.GetRendererAt( 0 );
- Shader shader2 = renderer.GetShader();
- Property::Value value = shader2.GetProperty( Shader::Property::PROGRAM );
- Property::Map* map = value.GetMap();
- DALI_TEST_CHECK( map );
+ Renderer renderer = imageView.GetRendererAt(0);
+ Shader shader2 = renderer.GetShader();
+ Property::Value value = shader2.GetProperty(Shader::Property::PROGRAM);
+ Property::Map* map = value.GetMap();
+ DALI_TEST_CHECK(map);
- Property::Value* fragment = map->Find( "fragment" ); // fragment key name from shader-impl.cpp
- DALI_TEST_EQUALS( fragmentShader, fragment->Get< std::string >(), TEST_LOCATION );
+ Property::Value* fragment = map->Find("fragment"); // fragment key name from shader-impl.cpp
+ DALI_TEST_EQUALS(fragmentShader, fragment->Get<std::string>(), TEST_LOCATION);
- Property::Value* vertex = map->Find( "vertex" ); // vertex key name from shader-impl.cpp
- DALI_TEST_EQUALS( vertexShader, vertex->Get< std::string >(), TEST_LOCATION );
+ Property::Value* vertex = map->Find("vertex"); // vertex key name from shader-impl.cpp
+ DALI_TEST_EQUALS(vertexShader, vertex->Get<std::string>(), TEST_LOCATION);
}
// Set a custom shader before setting an image url
{
- Property::Map properties;
- Property::Map shader;
- const std::string vertexShader = "Foobar";
- const std::string fragmentShader = "Foobar";
+ Property::Map properties;
+ Property::Map shader;
+ const std::string vertexShader = "Foobar";
+ const std::string fragmentShader = "Foobar";
shader[Visual::Shader::Property::FRAGMENT_SHADER] = fragmentShader;
- shader[Visual::Shader::Property::VERTEX_SHADER] = vertexShader;
+ shader[Visual::Shader::Property::VERTEX_SHADER] = vertexShader;
properties[Visual::Property::SHADER] = shader;
ImageView imageView = ImageView::New();
- imageView.SetProperty( ImageView::Property::IMAGE, properties );
- imageView.SetProperty( ImageView::Property::IMAGE, TEST_IMAGE_FILE_NAME );
+ imageView.SetProperty(ImageView::Property::IMAGE, properties);
+ imageView.SetProperty(ImageView::Property::IMAGE, TEST_IMAGE_FILE_NAME);
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
- Renderer renderer = imageView.GetRendererAt( 0 );
- Shader shader2 = renderer.GetShader();
- Property::Value value = shader2.GetProperty( Shader::Property::PROGRAM );
- Property::Map* map = value.GetMap();
- DALI_TEST_CHECK( map );
+ Renderer renderer = imageView.GetRendererAt(0);
+ Shader shader2 = renderer.GetShader();
+ Property::Value value = shader2.GetProperty(Shader::Property::PROGRAM);
+ Property::Map* map = value.GetMap();
+ DALI_TEST_CHECK(map);
- Property::Value* fragment = map->Find( "fragment" ); // fragment key name from shader-impl.cpp
- DALI_TEST_EQUALS( fragmentShader, fragment->Get< std::string >(), TEST_LOCATION );
+ Property::Value* fragment = map->Find("fragment"); // fragment key name from shader-impl.cpp
+ DALI_TEST_EQUALS(fragmentShader, fragment->Get<std::string>(), TEST_LOCATION);
- Property::Value* vertex = map->Find( "vertex" ); // vertex key name from shader-impl.cpp
- DALI_TEST_EQUALS( vertexShader, vertex->Get< std::string >(), TEST_LOCATION );
+ Property::Value* vertex = map->Find("vertex"); // vertex key name from shader-impl.cpp
+ DALI_TEST_EQUALS(vertexShader, vertex->Get<std::string>(), TEST_LOCATION);
}
// Set a custom shader after setting a property map
{
- Property::Map properties;
- Property::Map shader;
- const std::string vertexShader = "Foobar";
- const std::string fragmentShader = "Foobar";
+ Property::Map properties;
+ Property::Map shader;
+ const std::string vertexShader = "Foobar";
+ const std::string fragmentShader = "Foobar";
shader[Visual::Shader::Property::FRAGMENT_SHADER] = fragmentShader;
- shader[Visual::Shader::Property::VERTEX_SHADER] = vertexShader;
+ shader[Visual::Shader::Property::VERTEX_SHADER] = vertexShader;
properties[Visual::Property::SHADER] = shader;
Property::Map properties1;
- properties1[Visual::Property::TYPE] = Visual::IMAGE;
+ properties1[Visual::Property::TYPE] = Visual::IMAGE;
properties1[ImageVisual::Property::URL] = TEST_IMAGE_FILE_NAME;
ImageView imageView = ImageView::New();
- imageView.SetProperty( ImageView::Property::IMAGE, properties1 );
- imageView.SetProperty( ImageView::Property::IMAGE, properties );
+ imageView.SetProperty(ImageView::Property::IMAGE, properties1);
+ imageView.SetProperty(ImageView::Property::IMAGE, properties);
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
- Renderer renderer = imageView.GetRendererAt( 0 );
- Shader shader2 = renderer.GetShader();
- Property::Value value = shader2.GetProperty( Shader::Property::PROGRAM );
- Property::Map* map = value.GetMap();
- DALI_TEST_CHECK( map );
+ Renderer renderer = imageView.GetRendererAt(0);
+ Shader shader2 = renderer.GetShader();
+ Property::Value value = shader2.GetProperty(Shader::Property::PROGRAM);
+ Property::Map* map = value.GetMap();
+ DALI_TEST_CHECK(map);
- Property::Value* fragment = map->Find( "fragment" ); // fragment key name from shader-impl.cpp
- DALI_TEST_EQUALS( fragmentShader, fragment->Get< std::string >(), TEST_LOCATION );
+ Property::Value* fragment = map->Find("fragment"); // fragment key name from shader-impl.cpp
+ DALI_TEST_EQUALS(fragmentShader, fragment->Get<std::string>(), TEST_LOCATION);
- Property::Value* vertex = map->Find( "vertex" ); // vertex key name from shader-impl.cpp
- DALI_TEST_EQUALS( vertexShader, vertex->Get< std::string >(), TEST_LOCATION );
+ Property::Value* vertex = map->Find("vertex"); // vertex key name from shader-impl.cpp
+ DALI_TEST_EQUALS(vertexShader, vertex->Get<std::string>(), TEST_LOCATION);
}
// Set a custom shader before setting a property map
{
- Property::Map properties;
- Property::Map shader;
- const std::string vertexShader = "Foobar";
- const std::string fragmentShader = "Foobar";
+ Property::Map properties;
+ Property::Map shader;
+ const std::string vertexShader = "Foobar";
+ const std::string fragmentShader = "Foobar";
shader[Visual::Shader::Property::FRAGMENT_SHADER] = fragmentShader;
- shader[Visual::Shader::Property::VERTEX_SHADER] = vertexShader;
+ shader[Visual::Shader::Property::VERTEX_SHADER] = vertexShader;
properties[Visual::Property::SHADER] = shader;
Property::Map properties1;
- properties1[Visual::Property::TYPE] = Visual::IMAGE;
+ properties1[Visual::Property::TYPE] = Visual::IMAGE;
properties1[ImageVisual::Property::URL] = TEST_IMAGE_FILE_NAME;
ImageView imageView = ImageView::New();
- imageView.SetProperty( ImageView::Property::IMAGE, properties );
- imageView.SetProperty( ImageView::Property::IMAGE, properties1 );
+ imageView.SetProperty(ImageView::Property::IMAGE, properties);
+ imageView.SetProperty(ImageView::Property::IMAGE, properties1);
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
- Renderer renderer = imageView.GetRendererAt( 0 );
- Shader shader2 = renderer.GetShader();
- Property::Value value = shader2.GetProperty( Shader::Property::PROGRAM );
- Property::Map* map = value.GetMap();
- DALI_TEST_CHECK( map );
+ Renderer renderer = imageView.GetRendererAt(0);
+ Shader shader2 = renderer.GetShader();
+ Property::Value value = shader2.GetProperty(Shader::Property::PROGRAM);
+ Property::Map* map = value.GetMap();
+ DALI_TEST_CHECK(map);
- Property::Value* fragment = map->Find( "fragment" ); // fragment key name from shader-impl.cpp
- DALI_TEST_EQUALS( fragmentShader, fragment->Get< std::string >(), TEST_LOCATION );
+ Property::Value* fragment = map->Find("fragment"); // fragment key name from shader-impl.cpp
+ DALI_TEST_EQUALS(fragmentShader, fragment->Get<std::string>(), TEST_LOCATION);
- Property::Value* vertex = map->Find( "vertex" ); // vertex key name from shader-impl.cpp
- DALI_TEST_EQUALS( vertexShader, vertex->Get< std::string >(), TEST_LOCATION );
+ Property::Value* vertex = map->Find("vertex"); // vertex key name from shader-impl.cpp
+ DALI_TEST_EQUALS(vertexShader, vertex->Get<std::string>(), TEST_LOCATION);
}
END_TEST;
}
-
namespace
{
static int gFailCounter = 0;
-const int MAX_RETRIES(3);
+const int MAX_RETRIES(3);
void ReloadImage(ImageView imageView)
{
Property::Map imageImmediateLoadingMap;
- imageImmediateLoadingMap[ ImageVisual::Property::URL ] = "Non-existant-image.jpg";
- imageImmediateLoadingMap[ ImageVisual::Property::LOAD_POLICY ] = ImageVisual::LoadPolicy::IMMEDIATE;
+ imageImmediateLoadingMap[ImageVisual::Property::URL] = "Non-existant-image.jpg";
+ imageImmediateLoadingMap[ImageVisual::Property::LOAD_POLICY] = ImageVisual::LoadPolicy::IMMEDIATE;
tet_infoline("Immediate load an image");
- imageView.SetProperty( ImageView::Property::IMAGE, imageImmediateLoadingMap );
+ imageView.SetProperty(ImageView::Property::IMAGE, imageImmediateLoadingMap);
}
-void ResourceFailedReload( Control control )
+void ResourceFailedReload(Control control)
{
gFailCounter++;
- if( gFailCounter < MAX_RETRIES )
+ if(gFailCounter < MAX_RETRIES)
{
ReloadImage(ImageView::DownCast(control));
}
}
-}
+} // namespace
int UtcDaliImageViewReloadFailedOnResourceReadySignal(void)
{
gFailCounter = 0;
ImageView imageView = ImageView::New();
- imageView.ResourceReadySignal().Connect( &ResourceFailedReload );
- DALI_TEST_EQUALS( gFailCounter, 0, TEST_LOCATION );
+ imageView.ResourceReadySignal().Connect(&ResourceFailedReload);
+ DALI_TEST_EQUALS(gFailCounter, 0, TEST_LOCATION);
ReloadImage(imageView);
// loading started, this waits for the loader thread to complete
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
- DALI_TEST_EQUALS( gFailCounter, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(gFailCounter, 1, TEST_LOCATION);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
- DALI_TEST_EQUALS( gFailCounter, 2, TEST_LOCATION );
+ DALI_TEST_EQUALS(gFailCounter, 2, TEST_LOCATION);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
- DALI_TEST_EQUALS( gFailCounter, 3, TEST_LOCATION );
+ DALI_TEST_EQUALS(gFailCounter, 3, TEST_LOCATION);
END_TEST;
}
tet_infoline("Test load from a remote server.");
ToolkitTestApplication application;
- Toolkit::ImageView imageView;
+ Toolkit::ImageView imageView;
imageView = Toolkit::ImageView::New();
imageView.SetImage("https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/check.svg");
// Victor. Temporary (or permanent?) update as the url above seems not to work from time to time ...
-// imageView.SetImage("https://upload.wikimedia.org/wikipedia/commons/thumb/0/02/SVG_logo.svg/64px-SVG_logo.svg.png");
- imageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- imageView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- imageView.SetProperty( Actor::Property::SIZE, Vector2(300, 300) );
- imageView.SetProperty( Actor::Property::POSITION, Vector3( 150.0f , 150.0f , 0.0f ) );
+ // imageView.SetImage("https://upload.wikimedia.org/wikipedia/commons/thumb/0/02/SVG_logo.svg/64px-SVG_logo.svg.png");
+ imageView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ imageView.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ imageView.SetProperty(Actor::Property::SIZE, Vector2(300, 300));
+ imageView.SetProperty(Actor::Property::POSITION, Vector3(150.0f, 150.0f, 0.0f));
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
- DALI_TEST_CHECK( imageView );
+ DALI_TEST_CHECK(imageView);
- DALI_TEST_EQUALS( imageView.GetRendererCount(), 0u, TEST_LOCATION );
+ DALI_TEST_EQUALS(imageView.GetRendererCount(), 0u, TEST_LOCATION);
application.SendNotification();
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( imageView.GetRendererCount(), 1u, TEST_LOCATION );
+ DALI_TEST_EQUALS(imageView.GetRendererCount(), 1u, TEST_LOCATION);
END_TEST;
}
callStack.Reset();
callStack.Enable(true);
- ImageView imageView = ImageView::New( );
+ ImageView imageView = ImageView::New();
// Sync loading is used
Property::Map syncLoadingMap;
- syncLoadingMap.Insert( Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE );
- syncLoadingMap.Insert( Toolkit::ImageVisual::Property::URL, TEST_RESOURCE_DIR "/svg1.svg" );
- syncLoadingMap.Insert( Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING, true);
- imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap );
+ syncLoadingMap.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE);
+ syncLoadingMap.Insert(Toolkit::ImageVisual::Property::URL, TEST_RESOURCE_DIR "/svg1.svg");
+ syncLoadingMap.Insert(Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING, true);
+ imageView.SetProperty(ImageView::Property::IMAGE, syncLoadingMap);
- application.GetScene().Add( imageView );
- DALI_TEST_CHECK( imageView );
+ application.GetScene().Add(imageView);
+ DALI_TEST_CHECK(imageView);
application.SendNotification();
application.Render(16);
Vector3 naturalSize = imageView.GetNaturalSize();
- DALI_TEST_EQUALS( naturalSize.width, 100.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( naturalSize.height, 100.0f, TEST_LOCATION );
-
+ DALI_TEST_EQUALS(naturalSize.width, 100.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(naturalSize.height, 100.0f, TEST_LOCATION);
}
END_TEST;
}
callStack.Reset();
callStack.Enable(true);
- ImageView imageView = ImageView::New( );
+ ImageView imageView = ImageView::New();
// Sync loading is used
Property::Map syncLoadingMap;
- syncLoadingMap.Insert( Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE );
- syncLoadingMap.Insert( Toolkit::ImageVisual::Property::URL, TEST_RESOURCE_DIR "/svg1.svg" );
- syncLoadingMap.Insert( Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING, false);
- imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap );
+ syncLoadingMap.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE);
+ syncLoadingMap.Insert(Toolkit::ImageVisual::Property::URL, TEST_RESOURCE_DIR "/svg1.svg");
+ syncLoadingMap.Insert(Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING, false);
+ imageView.SetProperty(ImageView::Property::IMAGE, syncLoadingMap);
- application.GetScene().Add( imageView );
- DALI_TEST_CHECK( imageView );
+ application.GetScene().Add(imageView);
+ DALI_TEST_CHECK(imageView);
application.SendNotification();
application.Render(16);
Vector3 naturalSize = imageView.GetNaturalSize();
- DALI_TEST_EQUALS( naturalSize.width, 100.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( naturalSize.height, 100.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(naturalSize.width, 100.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(naturalSize.height, 100.0f, TEST_LOCATION);
}
END_TEST;
}
callStack.Reset();
callStack.Enable(true);
- ImageView imageView = ImageView::New( );
+ ImageView imageView = ImageView::New();
// Sync loading is used
Property::Map syncLoadingMap;
- syncLoadingMap.Insert( Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE );
- syncLoadingMap.Insert( Toolkit::ImageVisual::Property::URL, TEST_RESOURCE_DIR "/svg1.svg" );
+ syncLoadingMap.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE);
+ syncLoadingMap.Insert(Toolkit::ImageVisual::Property::URL, TEST_RESOURCE_DIR "/svg1.svg");
// Check to set invalid value
// The SYNCHRONOUS_LOADING property must be set to the bool value.
// Check if error log is outputted when setting other value like string.
// Even if the wrong value is set, the image will be shown normally, and the synchronous value should be the default value(false).
- syncLoadingMap.Insert( Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING, std::to_string(5) );
- imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap );
+ syncLoadingMap.Insert(Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING, std::to_string(5));
+ imageView.SetProperty(ImageView::Property::IMAGE, syncLoadingMap);
- application.GetScene().Add( imageView );
- DALI_TEST_CHECK( imageView );
+ application.GetScene().Add(imageView);
+ DALI_TEST_CHECK(imageView);
application.SendNotification();
application.Render(16);
Vector3 naturalSize = imageView.GetNaturalSize();
- DALI_TEST_EQUALS( naturalSize.width, 100.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( naturalSize.height, 100.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(naturalSize.width, 100.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(naturalSize.height, 100.0f, TEST_LOCATION);
- Property::Value value = imageView.GetProperty( ImageView::Property::IMAGE );
- Property::Map* map = value.GetMap();
- DALI_TEST_CHECK( map );
-
- Property::Value* sync = map->Find( Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING );
- DALI_TEST_CHECK( sync );
- DALI_TEST_EQUALS( false, sync->Get< bool >(), TEST_LOCATION );
+ Property::Value value = imageView.GetProperty(ImageView::Property::IMAGE);
+ Property::Map* map = value.GetMap();
+ DALI_TEST_CHECK(map);
+ Property::Value* sync = map->Find(Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING);
+ DALI_TEST_CHECK(sync);
+ DALI_TEST_EQUALS(false, sync->Get<bool>(), TEST_LOCATION);
}
END_TEST;
}
{
gResourceReadySignalFired = false;
- ImageView imageView = ImageView::New( TEST_RESOURCE_DIR "/foo.svg" );
- imageView.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- imageView.ResourceReadySignal().Connect( &ResourceReadySignal);
+ ImageView imageView = ImageView::New(TEST_RESOURCE_DIR "/foo.svg");
+ imageView.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+ imageView.ResourceReadySignal().Connect(&ResourceReadySignal);
- DALI_TEST_EQUALS( imageView.IsResourceReady(), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(imageView.IsResourceReady(), false, TEST_LOCATION);
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION );
- DALI_TEST_EQUALS( imageView.IsResourceReady(), true, TEST_LOCATION );
- DALI_TEST_EQUALS( imageView.GetVisualResourceStatus( ImageView::Property::IMAGE ), Visual::ResourceStatus::FAILED, TEST_LOCATION );
+ DALI_TEST_EQUALS(gResourceReadySignalFired, true, TEST_LOCATION);
+ DALI_TEST_EQUALS(imageView.IsResourceReady(), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(imageView.GetVisualResourceStatus(ImageView::Property::IMAGE), Visual::ResourceStatus::FAILED, TEST_LOCATION);
}
// Local svg file - invalid file
{
gResourceReadySignalFired = false;
- ImageView imageView = ImageView::New( TEST_RESOURCE_DIR "/invalid.svg" );
- imageView.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- imageView.ResourceReadySignal().Connect( &ResourceReadySignal);
+ ImageView imageView = ImageView::New(TEST_RESOURCE_DIR "/invalid.svg");
+ imageView.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+ imageView.ResourceReadySignal().Connect(&ResourceReadySignal);
- DALI_TEST_EQUALS( imageView.IsResourceReady(), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(imageView.IsResourceReady(), false, TEST_LOCATION);
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION );
- DALI_TEST_EQUALS( imageView.IsResourceReady(), true, TEST_LOCATION );
- DALI_TEST_EQUALS( imageView.GetVisualResourceStatus( ImageView::Property::IMAGE ), Visual::ResourceStatus::FAILED, TEST_LOCATION );
+ DALI_TEST_EQUALS(gResourceReadySignalFired, true, TEST_LOCATION);
+ DALI_TEST_EQUALS(imageView.IsResourceReady(), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(imageView.GetVisualResourceStatus(ImageView::Property::IMAGE), Visual::ResourceStatus::FAILED, TEST_LOCATION);
}
// Remote svg file
{
gResourceReadySignalFired = false;
- ImageView imageView = ImageView::New( "https://bar.org/foobar.svg" );
- imageView.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- imageView.ResourceReadySignal().Connect( &ResourceReadySignal);
+ ImageView imageView = ImageView::New("https://bar.org/foobar.svg");
+ imageView.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+ imageView.ResourceReadySignal().Connect(&ResourceReadySignal);
- DALI_TEST_EQUALS( imageView.IsResourceReady(), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(imageView.IsResourceReady(), false, TEST_LOCATION);
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
application.SendNotification();
// loading started, this waits for the loader thread
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION );
- DALI_TEST_EQUALS( imageView.IsResourceReady(), true, TEST_LOCATION );
- DALI_TEST_EQUALS( imageView.GetVisualResourceStatus( ImageView::Property::IMAGE ), Visual::ResourceStatus::FAILED, TEST_LOCATION );
+ DALI_TEST_EQUALS(gResourceReadySignalFired, true, TEST_LOCATION);
+ DALI_TEST_EQUALS(imageView.IsResourceReady(), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(imageView.GetVisualResourceStatus(ImageView::Property::IMAGE), Visual::ResourceStatus::FAILED, TEST_LOCATION);
}
END_TEST;
gResourceReadySignalFired = false;
- ImageView imageView = ImageView::New( TEST_RESOURCE_DIR "/svg1.svg" );
- imageView.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- imageView.ResourceReadySignal().Connect( &ResourceReadySignal);
+ ImageView imageView = ImageView::New(TEST_RESOURCE_DIR "/svg1.svg");
+ imageView.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+ imageView.ResourceReadySignal().Connect(&ResourceReadySignal);
- DALI_TEST_EQUALS( imageView.IsResourceReady(), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(imageView.IsResourceReady(), false, TEST_LOCATION);
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
application.SendNotification();
// loading started, this waits for the loader thread
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION );
- DALI_TEST_EQUALS( imageView.IsResourceReady(), true, TEST_LOCATION );
- DALI_TEST_EQUALS( imageView.GetVisualResourceStatus( ImageView::Property::IMAGE ), Visual::ResourceStatus::READY, TEST_LOCATION );
+ DALI_TEST_EQUALS(gResourceReadySignalFired, true, TEST_LOCATION);
+ DALI_TEST_EQUALS(imageView.IsResourceReady(), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(imageView.GetVisualResourceStatus(ImageView::Property::IMAGE), Visual::ResourceStatus::READY, TEST_LOCATION);
// Reset flag
gResourceReadySignalFired = false;
// Change size
- imageView.SetProperty( Actor::Property::SIZE, Vector2( 0.f, 0.f ) );
+ imageView.SetProperty(Actor::Property::SIZE, Vector2(0.f, 0.f));
application.SendNotification();
// rasterization started, this waits for the rasterize thread
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render(16);
- DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION );
- DALI_TEST_EQUALS( imageView.IsResourceReady(), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gResourceReadySignalFired, true, TEST_LOCATION);
+ DALI_TEST_EQUALS(imageView.IsResourceReady(), true, TEST_LOCATION);
// Fail to rasterize because the size is 0.
- DALI_TEST_EQUALS( imageView.GetVisualResourceStatus( ImageView::Property::IMAGE ), Visual::ResourceStatus::FAILED, TEST_LOCATION );
+ DALI_TEST_EQUALS(imageView.GetVisualResourceStatus(ImageView::Property::IMAGE), Visual::ResourceStatus::FAILED, TEST_LOCATION);
END_TEST;
}
tet_infoline("ImageView Testing TVG image loading");
{
- ImageView imageView = ImageView::New( );
+ ImageView imageView = ImageView::New();
- imageView.SetImage( TEST_RESOURCE_DIR "/test.tvg" );
+ imageView.SetImage(TEST_RESOURCE_DIR "/test.tvg");
- application.GetScene().Add( imageView );
- DALI_TEST_CHECK( imageView );
+ application.GetScene().Add(imageView);
+ DALI_TEST_CHECK(imageView);
Vector3 naturalSize = imageView.GetNaturalSize();
- DALI_TEST_EQUALS( naturalSize.width, 100.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( naturalSize.height, 100.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(naturalSize.width, 100.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(naturalSize.height, 100.0f, TEST_LOCATION);
}
END_TEST;
}
std::string brokenUrl;
brokenUrl = DevelStyleManager::GetBrokenImageUrl(styleManager, DevelStyleManager::BrokenImageType::SMALL);
- DALI_TEST_EQUALS( TEST_BROKEN_IMAGE_S, brokenUrl, TEST_LOCATION);
+ DALI_TEST_EQUALS(TEST_BROKEN_IMAGE_S, brokenUrl, TEST_LOCATION);
brokenUrl = DevelStyleManager::GetBrokenImageUrl(styleManager, DevelStyleManager::BrokenImageType::NORMAL);
- DALI_TEST_EQUALS( TEST_BROKEN_IMAGE_M, brokenUrl, TEST_LOCATION);
+ DALI_TEST_EQUALS(TEST_BROKEN_IMAGE_M, brokenUrl, TEST_LOCATION);
brokenUrl = DevelStyleManager::GetBrokenImageUrl(styleManager, DevelStyleManager::BrokenImageType::LARGE);
- DALI_TEST_EQUALS( TEST_BROKEN_IMAGE_L, brokenUrl, TEST_LOCATION);
+ DALI_TEST_EQUALS(TEST_BROKEN_IMAGE_L, brokenUrl, TEST_LOCATION);
ImageView imageView = ImageView::New("invalidUrl.png");
- imageView.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
+ imageView.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
application.SendNotification();
application.Render(16);
// loading started, this waits for the loader thread
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
END_TEST;
}
std::string brokenUrl;
brokenUrl = DevelStyleManager::GetBrokenImageUrl(styleManager, DevelStyleManager::BrokenImageType::SMALL);
- DALI_TEST_EQUALS( TEST_BROKEN_IMAGE_DEFAULT, brokenUrl, TEST_LOCATION);
+ DALI_TEST_EQUALS(TEST_BROKEN_IMAGE_DEFAULT, brokenUrl, TEST_LOCATION);
brokenUrl = DevelStyleManager::GetBrokenImageUrl(styleManager, DevelStyleManager::BrokenImageType::NORMAL);
- DALI_TEST_EQUALS( TEST_BROKEN_IMAGE_M, brokenUrl, TEST_LOCATION);
+ DALI_TEST_EQUALS(TEST_BROKEN_IMAGE_M, brokenUrl, TEST_LOCATION);
brokenUrl = DevelStyleManager::GetBrokenImageUrl(styleManager, DevelStyleManager::BrokenImageType::LARGE);
- DALI_TEST_EQUALS( TEST_BROKEN_IMAGE_L, brokenUrl, TEST_LOCATION);
+ DALI_TEST_EQUALS(TEST_BROKEN_IMAGE_L, brokenUrl, TEST_LOCATION);
ImageView imageView = ImageView::New("invalidUrl.png");
- imageView.SetProperty( Actor::Property::SIZE, Vector2( 30.f, 30.f ) );
- application.GetScene().Add( imageView );
+ imageView.SetProperty(Actor::Property::SIZE, Vector2(30.f, 30.f));
+ application.GetScene().Add(imageView);
application.SendNotification();
application.Render(16);
// loading started, this waits for the loader thread
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
END_TEST;
}
std::string brokenUrl;
brokenUrl = DevelStyleManager::GetBrokenImageUrl(styleManager, DevelStyleManager::BrokenImageType::SMALL);
- DALI_TEST_EQUALS( TEST_BROKEN_IMAGE_01, brokenUrl, TEST_LOCATION);
+ DALI_TEST_EQUALS(TEST_BROKEN_IMAGE_01, brokenUrl, TEST_LOCATION);
brokenUrl = DevelStyleManager::GetBrokenImageUrl(styleManager, DevelStyleManager::BrokenImageType::NORMAL);
- DALI_TEST_EQUALS( TEST_BROKEN_IMAGE_02, brokenUrl, TEST_LOCATION);
+ DALI_TEST_EQUALS(TEST_BROKEN_IMAGE_02, brokenUrl, TEST_LOCATION);
ImageView imageView = ImageView::New("invalidUrl.png");
- imageView.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
- application.GetScene().Add( imageView );
+ imageView.SetProperty(Actor::Property::SIZE, Vector2(100.f, 100.f));
+ application.GetScene().Add(imageView);
application.SendNotification();
application.Render(16);
// loading started, this waits for the loader thread
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
ImageView imageView = ImageView::New("invalidUrl.png");
- imageView.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
- application.GetScene().Add( imageView );
+ imageView.SetProperty(Actor::Property::SIZE, Vector2(100.f, 100.f));
+ application.GetScene().Add(imageView);
application.SendNotification();
application.Render(16);
// loading started, this waits for the loader thread
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
-
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get();
DevelStyleManager::SetBrokenImageUrl(styleManager, DevelStyleManager::BrokenImageType::SMALL, TEST_BROKEN_IMAGE_S);
DevelStyleManager::SetBrokenImageUrl(styleManager, DevelStyleManager::BrokenImageType::LARGE, TEST_BROKEN_IMAGE_L);
ImageView imageView2 = ImageView::New("invalidUrl.png");
- imageView2.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
- application.GetScene().Add( imageView2 );
+ imageView2.SetProperty(Actor::Property::SIZE, Vector2(100.f, 100.f));
+ application.GetScene().Add(imageView2);
std::string brokenUrl;
brokenUrl = DevelStyleManager::GetBrokenImageUrl(styleManager, DevelStyleManager::BrokenImageType::SMALL);
- DALI_TEST_EQUALS( TEST_BROKEN_IMAGE_S, brokenUrl, TEST_LOCATION);
+ DALI_TEST_EQUALS(TEST_BROKEN_IMAGE_S, brokenUrl, TEST_LOCATION);
brokenUrl = DevelStyleManager::GetBrokenImageUrl(styleManager, DevelStyleManager::BrokenImageType::LARGE);
- DALI_TEST_EQUALS( TEST_BROKEN_IMAGE_L, brokenUrl, TEST_LOCATION);
+ DALI_TEST_EQUALS(TEST_BROKEN_IMAGE_L, brokenUrl, TEST_LOCATION);
application.SendNotification();
application.Render(16);
// loading started, this waits for the loader thread
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
-
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
DevelStyleManager::SetBrokenImageUrl(styleManager, DevelStyleManager::BrokenImageType::NORMAL, "invalidBroken.9.png");
ImageView imageView3 = ImageView::New("invalidUrl.png");
- imageView3.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
- application.GetScene().Add( imageView3 );
+ imageView3.SetProperty(Actor::Property::SIZE, Vector2(100.f, 100.f));
+ application.GetScene().Add(imageView3);
application.SendNotification();
application.Render(16);
// loading started, this waits for the loader thread
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
END_TEST;
}
-
namespace
{
-
static int gResourceReadySignalCounter = 0;
-void OnResourceReadySignal01( Control control )
+void OnResourceReadySignal01(Control control)
{
gResourceReadySignalCounter++;
if(control.GetVisualResourceStatus(ImageView::Property::IMAGE) == Visual::ResourceStatus::READY)
{
- if( gResourceReadySignalCounter == 1 )
+ if(gResourceReadySignalCounter == 1)
{
// Set image twice
// It makes the first new visual be deleted immediately
- ImageView::DownCast( control ).SetImage( gImage_34_RGBA );
- ImageView::DownCast( control ).SetImage( gImage_34_RGBA );
+ ImageView::DownCast(control).SetImage(gImage_34_RGBA);
+ ImageView::DownCast(control).SetImage(gImage_34_RGBA);
}
}
else if(control.GetVisualResourceStatus(ImageView::Property::IMAGE) == Visual::ResourceStatus::FAILED)
}
}
-void OnResourceReadySignal02( Control control )
+void OnResourceReadySignal02(Control control)
{
if(++gResourceReadySignalCounter == 1)
{
// It makes the first new visual be deleted immediately
// The first image will not be loaded.
- control[ImageView::Property::IMAGE] = Property::Map().Add(ImageVisual::Property::URL, gImage_600_RGB)
- .Add(ImageVisual::Property::RELEASE_POLICY, ImageVisual::ReleasePolicy::NEVER);
+ control[ImageView::Property::IMAGE] = Property::Map().Add(ImageVisual::Property::URL, gImage_600_RGB).Add(ImageVisual::Property::RELEASE_POLICY, ImageVisual::ReleasePolicy::NEVER);
control[ImageView::Property::IMAGE] = TEST_IMAGE_1;
}
}
ImageView gImageView2;
ImageView gImageView3;
-void OnResourceReadySignal03( Control control )
+void OnResourceReadySignal03(Control control)
{
if(gResourceReadySignalCounter == 0)
{
gResourceReadySignalCounter++;
}
-}
+} // namespace
int UtcDaliImageViewSetImageOnResourceReadySignal01(void)
{
gResourceReadySignalCounter = 0;
- ImageView imageView = ImageView::New( gImage_34_RGBA );
- imageView.ResourceReadySignal().Connect( &OnResourceReadySignal01 );
+ ImageView imageView = ImageView::New(gImage_34_RGBA);
+ imageView.ResourceReadySignal().Connect(&OnResourceReadySignal01);
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( gResourceReadySignalCounter, 2, TEST_LOCATION );
+ DALI_TEST_EQUALS(gResourceReadySignalCounter, 2, TEST_LOCATION);
- DALI_TEST_EQUALS( imageView.IsResourceReady(), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(imageView.IsResourceReady(), true, TEST_LOCATION);
// Reset count
gResourceReadySignalCounter = 0;
imageView[ImageView::Property::IMAGE] = "invalid.jpg";
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render();
// Run idle callback
application.RunIdles();
- DALI_TEST_EQUALS( gResourceReadySignalCounter, 2, TEST_LOCATION );
+ DALI_TEST_EQUALS(gResourceReadySignalCounter, 2, TEST_LOCATION);
- DALI_TEST_EQUALS( imageView.IsResourceReady(), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(imageView.IsResourceReady(), true, TEST_LOCATION);
END_TEST;
}
gResourceReadySignalCounter = 0;
- ImageView imageView = ImageView::New( gImage_34_RGBA );
- imageView.ResourceReadySignal().Connect( &OnResourceReadySignal02 );
+ ImageView imageView = ImageView::New(gImage_34_RGBA);
+ imageView.ResourceReadySignal().Connect(&OnResourceReadySignal02);
- application.GetScene().Add( imageView );
+ application.GetScene().Add(imageView);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render();
// Wait for loading an image
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
- DALI_TEST_EQUALS( gResourceReadySignalCounter, 2, TEST_LOCATION );
+ DALI_TEST_EQUALS(gResourceReadySignalCounter, 2, TEST_LOCATION);
- DALI_TEST_EQUALS( imageView.IsResourceReady(), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(imageView.IsResourceReady(), true, TEST_LOCATION);
END_TEST;
}
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
#include <stdlib.h>
+#include <iostream>
// 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.h>
#include <dali-toolkit/dali-toolkit.h>
+#include <dali.h>
using namespace Dali;
using namespace Toolkit;
namespace
{
-const unsigned int TOTAL_ITEM_NUMBER = 200;
-const char* TEST_IMAGE_FILE_NAME = "gallery_image_01.jpg";
-
+const unsigned int TOTAL_ITEM_NUMBER = 200;
+const char* TEST_IMAGE_FILE_NAME = "gallery_image_01.jpg";
// Implementation of ItemFactory for providing actors to ItemView
class TestItemFactory : public ItemFactory
{
public:
-
/**
* Constructor
* @param application class, stored as reference
}
public: // From ItemFactory
-
/**
* Query the number of items available from the factory.
* The maximum available item has an ID of GetNumberOfItems() - 1.
virtual Actor NewItem(unsigned int itemId)
{
// Create a renderable actor for this item
- return ImageView::New( TEST_IMAGE_FILE_NAME );
+ return ImageView::New(TEST_IMAGE_FILE_NAME);
}
};
class TestItemLayout : public ItemLayout
{
public:
-
/**
* Constructor
*/
}
public: // From ItemLayout
-
/**
* Query the minimum valid layout position; this is a negative value.
*
* @param[in] layoutSize The layout size
* @param[out] itemSize The target size of an item.
*/
- virtual void GetDefaultItemSize( unsigned int itemId, const Vector3& layoutSize, Vector3& itemSize ) const
+ virtual void GetDefaultItemSize(unsigned int itemId, const Vector3& layoutSize, Vector3& itemSize) const
{
}
*/
virtual Degree GetScrollDirection() const
{
- return Degree( 0.0f );
+ return Degree(0.0f);
}
/**
* @param[in] layoutSize the current size of the item view instance.
* @param[in] itemViewActor The item view instance which requests the application of constraints.
*/
- virtual void ApplyConstraints( Actor& actor, const int itemId, const Vector3& layoutSize, const Actor& itemViewActor )
+ virtual void ApplyConstraints(Actor& actor, const int itemId, const Vector3& layoutSize, const Actor& itemViewActor)
{
}
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New(factory);
+ ItemView view = ItemView::New(factory);
// Create a grid layout and add it to ItemView
- ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+ ItemLayoutPtr gridLayout = DefaultItemLayout::New(DefaultItemLayout::GRID);
view.AddLayout(*gridLayout);
// Set the orientation of the layout to be horizontal from left to right
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 );
+ DALI_TEST_EQUALS(-1.0f, gridLayout->GetItemScrollToPosition(1), TEST_LOCATION);
- ItemLayoutPtr depthLayout = DefaultItemLayout::New( DefaultItemLayout::DEPTH );
+ ItemLayoutPtr depthLayout = DefaultItemLayout::New(DefaultItemLayout::DEPTH);
view.AddLayout(*depthLayout);
layout = view.GetLayout(1);
DALI_TEST_CHECK(depthLayout == layout);
- ItemLayoutPtr listLayout = DefaultItemLayout::New( DefaultItemLayout::LIST );
+ ItemLayoutPtr listLayout = DefaultItemLayout::New(DefaultItemLayout::LIST);
view.AddLayout(*listLayout);
layout = view.GetLayout(2);
DALI_TEST_CHECK(listLayout == layout);
- ItemLayoutPtr spiralLayout = DefaultItemLayout::New( DefaultItemLayout::SPIRAL );
+ ItemLayoutPtr spiralLayout = DefaultItemLayout::New(DefaultItemLayout::SPIRAL);
view.AddLayout(*spiralLayout);
layout = view.GetLayout(3);
{
ToolkitTestApplication application;
- ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
- DALI_TEST_CHECK( gridLayout );
- DALI_TEST_CHECK( !gridLayout->GetExtension() );
+ ItemLayoutPtr gridLayout = DefaultItemLayout::New(DefaultItemLayout::GRID);
+ DALI_TEST_CHECK(gridLayout);
+ DALI_TEST_CHECK(!gridLayout->GetExtension());
END_TEST;
}
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 );
+ 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;
}
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 );
+ 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;
}
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New(factory);
+ ItemView view = ItemView::New(factory);
// Create a grid layout and add it to ItemView
- ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+ ItemLayoutPtr gridLayout = DefaultItemLayout::New(DefaultItemLayout::GRID);
// Set the property of the grid 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)) );
- gridLayoutProperty.Insert( DefaultItemLayoutProperty::GRID_ROW_SPACING, Dali::Property::Value(50.0f) );
- gridLayoutProperty.Insert( DefaultItemLayoutProperty::GRID_COLUMN_NUMBER, Dali::Property::Value(4) );
- gridLayoutProperty.Insert( DefaultItemLayoutProperty::GRID_COLUMN_SPACING, Dali::Property::Value(50.0f) );
- gridLayoutProperty.Insert( DefaultItemLayoutProperty::GRID_TOP_MARGIN, Dali::Property::Value(95.0f) );
- gridLayoutProperty.Insert( DefaultItemLayoutProperty::GRID_BOTTOM_MARGIN, Dali::Property::Value(20.0f) );
- gridLayoutProperty.Insert( DefaultItemLayoutProperty::GRID_SIDE_MARGIN, Dali::Property::Value(20.0f) );
- gridLayoutProperty.Insert( DefaultItemLayoutProperty::GRID_SCROLL_SPEED_FACTOR, Dali::Property::Value(0.03f) );
- gridLayoutProperty.Insert( DefaultItemLayoutProperty::GRID_ITEM_FLICK_ANIMATION_DURATION, Dali::Property::Value(0.015f) );
- gridLayoutProperty.Insert( DefaultItemLayoutProperty::GRID_MAXIMUM_SWIPE_SPEED, Dali::Property::Value(100.0f) );
- gridLayoutProperty.Insert( DefaultItemLayoutProperty::ORIENTATION, Dali::Property::Value((int)ControlOrientation::Up) );
+ gridLayoutProperty.Insert(DefaultItemLayoutProperty::TYPE, Dali::Property::Value((int)DefaultItemLayout::GRID));
+ gridLayoutProperty.Insert(DefaultItemLayoutProperty::ITEM_SIZE, Dali::Property::Value(Vector3(200, 200, 50)));
+ gridLayoutProperty.Insert(DefaultItemLayoutProperty::GRID_ROW_SPACING, Dali::Property::Value(50.0f));
+ gridLayoutProperty.Insert(DefaultItemLayoutProperty::GRID_COLUMN_NUMBER, Dali::Property::Value(4));
+ gridLayoutProperty.Insert(DefaultItemLayoutProperty::GRID_COLUMN_SPACING, Dali::Property::Value(50.0f));
+ gridLayoutProperty.Insert(DefaultItemLayoutProperty::GRID_TOP_MARGIN, Dali::Property::Value(95.0f));
+ gridLayoutProperty.Insert(DefaultItemLayoutProperty::GRID_BOTTOM_MARGIN, Dali::Property::Value(20.0f));
+ gridLayoutProperty.Insert(DefaultItemLayoutProperty::GRID_SIDE_MARGIN, Dali::Property::Value(20.0f));
+ gridLayoutProperty.Insert(DefaultItemLayoutProperty::GRID_SCROLL_SPEED_FACTOR, Dali::Property::Value(0.03f));
+ gridLayoutProperty.Insert(DefaultItemLayoutProperty::GRID_ITEM_FLICK_ANIMATION_DURATION, Dali::Property::Value(0.015f));
+ gridLayoutProperty.Insert(DefaultItemLayoutProperty::GRID_MAXIMUM_SWIPE_SPEED, Dali::Property::Value(100.0f));
+ gridLayoutProperty.Insert(DefaultItemLayoutProperty::ORIENTATION, Dali::Property::Value((int)ControlOrientation::Up));
gridLayout->SetLayoutProperties(gridLayoutProperty);
view.AddLayout(*gridLayout);
Property::Map firstLayout = gridLayout->GetLayoutProperties();
//Check all the properties of grid layout
- DALI_TEST_EQUALS( gridLayoutProperty.Count(), firstLayout.Count(), TEST_LOCATION );
+ DALI_TEST_EQUALS(gridLayoutProperty.Count(), firstLayout.Count(), TEST_LOCATION);
- for( unsigned int mapIdx = 0, mapCount = firstLayout.Count(); mapIdx < mapCount; ++mapIdx )
+ for(unsigned int mapIdx = 0, mapCount = firstLayout.Count(); mapIdx < mapCount; ++mapIdx)
{
- KeyValuePair propertyPair( firstLayout.GetKeyValue( mapIdx ) );
+ KeyValuePair propertyPair(firstLayout.GetKeyValue(mapIdx));
if(propertyPair.first == DefaultItemLayoutProperty::TYPE)
{
int layoutType = propertyPair.second.Get<int>();
- DALI_TEST_EQUALS( layoutType, (int)DefaultItemLayout::GRID, TEST_LOCATION );
+ DALI_TEST_EQUALS(layoutType, (int)DefaultItemLayout::GRID, TEST_LOCATION);
}
else if(propertyPair.first == DefaultItemLayoutProperty::ITEM_SIZE)
{
Vector3 size = propertyPair.second.Get<Vector3>();
- DALI_TEST_EQUALS( size, Vector3(200, 200,50), TEST_LOCATION );
+ DALI_TEST_EQUALS(size, Vector3(200, 200, 50), TEST_LOCATION);
}
else if(propertyPair.first == DefaultItemLayoutProperty::GRID_ROW_SPACING)
{
float rowSpacing = propertyPair.second.Get<float>();
- DALI_TEST_EQUALS( rowSpacing, 50.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(rowSpacing, 50.0f, TEST_LOCATION);
}
else if(propertyPair.first == DefaultItemLayoutProperty::GRID_COLUMN_NUMBER)
{
int number = propertyPair.second.Get<int>();
- DALI_TEST_EQUALS(number, 4, TEST_LOCATION );
+ DALI_TEST_EQUALS(number, 4, TEST_LOCATION);
}
else if(propertyPair.first == DefaultItemLayoutProperty::GRID_COLUMN_SPACING)
{
float columnSpacing = propertyPair.second.Get<float>();
- DALI_TEST_EQUALS(columnSpacing, 50.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(columnSpacing, 50.0f, TEST_LOCATION);
}
else if(propertyPair.first == DefaultItemLayoutProperty::GRID_TOP_MARGIN)
{
float topMargin = propertyPair.second.Get<float>();
- DALI_TEST_EQUALS(topMargin, 95.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(topMargin, 95.0f, TEST_LOCATION);
}
else if(propertyPair.first == DefaultItemLayoutProperty::GRID_BOTTOM_MARGIN)
{
float bottomMargin = propertyPair.second.Get<float>();
- DALI_TEST_EQUALS(bottomMargin, 20.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(bottomMargin, 20.0f, TEST_LOCATION);
}
else if(propertyPair.first == DefaultItemLayoutProperty::GRID_SIDE_MARGIN)
{
float sideMargin = propertyPair.second.Get<float>();
- DALI_TEST_EQUALS(sideMargin, 20.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(sideMargin, 20.0f, TEST_LOCATION);
}
else if(propertyPair.first == DefaultItemLayoutProperty::GRID_SCROLL_SPEED_FACTOR)
{
float scrollSpeedFactor = propertyPair.second.Get<float>();
- DALI_TEST_EQUALS(scrollSpeedFactor, 0.03f, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollSpeedFactor, 0.03f, TEST_LOCATION);
}
else if(propertyPair.first == DefaultItemLayoutProperty::GRID_ITEM_FLICK_ANIMATION_DURATION)
{
float animationDuration = propertyPair.second.Get<float>();
- DALI_TEST_EQUALS(animationDuration, 0.015f, TEST_LOCATION );
+ DALI_TEST_EQUALS(animationDuration, 0.015f, TEST_LOCATION);
}
else if(propertyPair.first == DefaultItemLayoutProperty::GRID_MAXIMUM_SWIPE_SPEED)
{
float swipSpeed = propertyPair.second.Get<float>();
- DALI_TEST_EQUALS(swipSpeed, 100.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(swipSpeed, 100.0f, TEST_LOCATION);
}
}
- ItemLayoutPtr depthLayout = DefaultItemLayout::New( DefaultItemLayout::DEPTH );
+ ItemLayoutPtr depthLayout = DefaultItemLayout::New(DefaultItemLayout::DEPTH);
// Set the property of the depth layout
Property::Map depthLayoutProperty;
- depthLayoutProperty.Insert( DefaultItemLayoutProperty::TYPE, Dali::Property::Value((int)DefaultItemLayout::DEPTH) );
- depthLayoutProperty.Insert( DefaultItemLayoutProperty::DEPTH_COLUMN_NUMBER, Dali::Property::Value(3) );
- depthLayoutProperty.Insert( DefaultItemLayoutProperty::DEPTH_ROW_NUMBER, Dali::Property::Value(26.0f) );
- depthLayoutProperty.Insert( DefaultItemLayoutProperty::DEPTH_ROW_SPACING, Dali::Property::Value(55.0f) );
- depthLayoutProperty.Insert( DefaultItemLayoutProperty::DEPTH_TILT_ANGLE, Dali::Property::Value(Math::PI*0.15f) );
- depthLayoutProperty.Insert( DefaultItemLayoutProperty::DEPTH_ITEM_TILT_ANGLE, Dali::Property::Value(-Math::PI*0.025f ) );
- depthLayoutProperty.Insert( DefaultItemLayoutProperty::DEPTH_SCROLL_SPEED_FACTOR, Dali::Property::Value(0.02f) );
- depthLayoutProperty.Insert( DefaultItemLayoutProperty::DEPTH_ITEM_FLICK_ANIMATION_DURATION, Dali::Property::Value(0.03f) );
- depthLayoutProperty.Insert( DefaultItemLayoutProperty::DEPTH_MAXIMUM_SWIPE_SPEED, Dali::Property::Value(50.0f) );
- depthLayoutProperty.Insert( DefaultItemLayoutProperty::ORIENTATION, Dali::Property::Value((int)ControlOrientation::Up) );
+ depthLayoutProperty.Insert(DefaultItemLayoutProperty::TYPE, Dali::Property::Value((int)DefaultItemLayout::DEPTH));
+ depthLayoutProperty.Insert(DefaultItemLayoutProperty::DEPTH_COLUMN_NUMBER, Dali::Property::Value(3));
+ depthLayoutProperty.Insert(DefaultItemLayoutProperty::DEPTH_ROW_NUMBER, Dali::Property::Value(26.0f));
+ depthLayoutProperty.Insert(DefaultItemLayoutProperty::DEPTH_ROW_SPACING, Dali::Property::Value(55.0f));
+ depthLayoutProperty.Insert(DefaultItemLayoutProperty::DEPTH_TILT_ANGLE, Dali::Property::Value(Math::PI * 0.15f));
+ depthLayoutProperty.Insert(DefaultItemLayoutProperty::DEPTH_ITEM_TILT_ANGLE, Dali::Property::Value(-Math::PI * 0.025f));
+ depthLayoutProperty.Insert(DefaultItemLayoutProperty::DEPTH_SCROLL_SPEED_FACTOR, Dali::Property::Value(0.02f));
+ depthLayoutProperty.Insert(DefaultItemLayoutProperty::DEPTH_ITEM_FLICK_ANIMATION_DURATION, Dali::Property::Value(0.03f));
+ depthLayoutProperty.Insert(DefaultItemLayoutProperty::DEPTH_MAXIMUM_SWIPE_SPEED, Dali::Property::Value(50.0f));
+ depthLayoutProperty.Insert(DefaultItemLayoutProperty::ORIENTATION, Dali::Property::Value((int)ControlOrientation::Up));
depthLayout->SetLayoutProperties(depthLayoutProperty);
view.AddLayout(*depthLayout);
Property::Map secondLayout = depthLayout->GetLayoutProperties();
//Check all the properties of grid layout
- DALI_TEST_EQUALS( depthLayoutProperty.Count(), secondLayout.Count(), TEST_LOCATION );
- for( unsigned int mapIdx = 0, mapCount = secondLayout.Count(); mapIdx < mapCount; ++mapIdx )
+ DALI_TEST_EQUALS(depthLayoutProperty.Count(), secondLayout.Count(), TEST_LOCATION);
+ for(unsigned int mapIdx = 0, mapCount = secondLayout.Count(); mapIdx < mapCount; ++mapIdx)
{
- KeyValuePair propertyPair( secondLayout.GetKeyValue( mapIdx ) );
+ KeyValuePair propertyPair(secondLayout.GetKeyValue(mapIdx));
if(propertyPair.first == DefaultItemLayoutProperty::TYPE)
{
int layoutType = propertyPair.second.Get<int>();
- DALI_TEST_EQUALS( layoutType, (int)DefaultItemLayout::DEPTH, TEST_LOCATION );
+ DALI_TEST_EQUALS(layoutType, (int)DefaultItemLayout::DEPTH, TEST_LOCATION);
}
else if(propertyPair.first == DefaultItemLayoutProperty::ORIENTATION)
{
int orientation = propertyPair.second.Get<int>();
- DALI_TEST_EQUALS(orientation, (int)ControlOrientation::Up, TEST_LOCATION );
+ DALI_TEST_EQUALS(orientation, (int)ControlOrientation::Up, TEST_LOCATION);
}
else if(propertyPair.first == DefaultItemLayoutProperty::ITEM_SIZE)
{
Vector3 size = propertyPair.second.Get<Vector3>();
- DALI_TEST_EQUALS( size, Vector3(200, 200,50), TEST_LOCATION );
+ DALI_TEST_EQUALS(size, Vector3(200, 200, 50), TEST_LOCATION);
}
else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_COLUMN_NUMBER)
{
int columnNumber = propertyPair.second.Get<int>();
- DALI_TEST_EQUALS( columnNumber, 3, TEST_LOCATION );
+ DALI_TEST_EQUALS(columnNumber, 3, TEST_LOCATION);
}
else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_ROW_NUMBER)
{
float rowNumber = propertyPair.second.Get<float>();
- DALI_TEST_EQUALS(rowNumber, 26.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(rowNumber, 26.0f, TEST_LOCATION);
}
else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_ROW_SPACING)
{
float rowSpacing = propertyPair.second.Get<float>();
- DALI_TEST_EQUALS(rowSpacing, 55.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(rowSpacing, 55.0f, TEST_LOCATION);
}
else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_TILT_ANGLE)
{
float tiltAngle = propertyPair.second.Get<float>();
- DALI_TEST_EQUALS(tiltAngle, Math::PI*0.15f, TEST_LOCATION );
+ DALI_TEST_EQUALS(tiltAngle, Math::PI * 0.15f, TEST_LOCATION);
}
else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_ITEM_TILT_ANGLE)
{
float itemTiltAngle = propertyPair.second.Get<float>();
- DALI_TEST_EQUALS(itemTiltAngle, -Math::PI*0.025f, TEST_LOCATION );
+ DALI_TEST_EQUALS(itemTiltAngle, -Math::PI * 0.025f, TEST_LOCATION);
}
else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_SCROLL_SPEED_FACTOR)
{
float scrollSpeedFactor = propertyPair.second.Get<float>();
- DALI_TEST_EQUALS(scrollSpeedFactor, 0.02f, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollSpeedFactor, 0.02f, TEST_LOCATION);
}
else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_ITEM_FLICK_ANIMATION_DURATION)
{
float animationDuration = propertyPair.second.Get<float>();
- DALI_TEST_EQUALS(animationDuration, 0.03f, TEST_LOCATION );
+ DALI_TEST_EQUALS(animationDuration, 0.03f, TEST_LOCATION);
}
else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_MAXIMUM_SWIPE_SPEED)
{
float swipSpeed = propertyPair.second.Get<float>();
- DALI_TEST_EQUALS(swipSpeed, 50.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(swipSpeed, 50.0f, TEST_LOCATION);
}
}
- ItemLayoutPtr spiralLayout = DefaultItemLayout::New( DefaultItemLayout::SPIRAL );
+ ItemLayoutPtr spiralLayout = DefaultItemLayout::New(DefaultItemLayout::SPIRAL);
// Set the property of the spiral layout
Property::Map spiralLayoutPrperty;
- spiralLayoutPrperty.Insert( DefaultItemLayoutProperty::TYPE, Dali::Property::Value((int)DefaultItemLayout::SPIRAL) );
- spiralLayoutPrperty.Insert( DefaultItemLayoutProperty::SPIRAL_ITEM_SPACING, Dali::Property::Value((Math::PI*2.0f)/9.5f) );
- spiralLayoutPrperty.Insert( DefaultItemLayoutProperty::SPIRAL_TOP_ITEM_ALIGNMENT, Dali::Property::Value(-0.125f) );
- spiralLayoutPrperty.Insert( DefaultItemLayoutProperty::SPIRAL_REVOLUTION_DISTANCE, Dali::Property::Value(190.0f) );
- spiralLayoutPrperty.Insert( DefaultItemLayoutProperty::SPIRAL_SCROLL_SPEED_FACTOR, Dali::Property::Value(0.01f) );
- spiralLayoutPrperty.Insert( DefaultItemLayoutProperty::SPIRAL_ITEM_FLICK_ANIMATION_DURATION, Dali::Property::Value(0.1f) );
- spiralLayoutPrperty.Insert( DefaultItemLayoutProperty::SPIRAL_MAXIMUM_SWIPE_SPEED, Dali::Property::Value(30.0f) );
+ spiralLayoutPrperty.Insert(DefaultItemLayoutProperty::TYPE, Dali::Property::Value((int)DefaultItemLayout::SPIRAL));
+ spiralLayoutPrperty.Insert(DefaultItemLayoutProperty::SPIRAL_ITEM_SPACING, Dali::Property::Value((Math::PI * 2.0f) / 9.5f));
+ spiralLayoutPrperty.Insert(DefaultItemLayoutProperty::SPIRAL_TOP_ITEM_ALIGNMENT, Dali::Property::Value(-0.125f));
+ spiralLayoutPrperty.Insert(DefaultItemLayoutProperty::SPIRAL_REVOLUTION_DISTANCE, Dali::Property::Value(190.0f));
+ spiralLayoutPrperty.Insert(DefaultItemLayoutProperty::SPIRAL_SCROLL_SPEED_FACTOR, Dali::Property::Value(0.01f));
+ spiralLayoutPrperty.Insert(DefaultItemLayoutProperty::SPIRAL_ITEM_FLICK_ANIMATION_DURATION, Dali::Property::Value(0.1f));
+ spiralLayoutPrperty.Insert(DefaultItemLayoutProperty::SPIRAL_MAXIMUM_SWIPE_SPEED, Dali::Property::Value(30.0f));
spiralLayout->SetLayoutProperties(spiralLayoutPrperty);
view.AddLayout(*spiralLayout);
Property::Map thridLayout = spiralLayout->GetLayoutProperties();
//Check all the properties of grid layout
- DALI_TEST_EQUALS( spiralLayoutPrperty.Count(), thridLayout.Count(), TEST_LOCATION );
+ DALI_TEST_EQUALS(spiralLayoutPrperty.Count(), thridLayout.Count(), TEST_LOCATION);
- for( unsigned int mapIdx = 0, mapCount = thridLayout.Count(); mapIdx < mapCount; ++mapIdx )
+ for(unsigned int mapIdx = 0, mapCount = thridLayout.Count(); mapIdx < mapCount; ++mapIdx)
{
- KeyValuePair propertyPair( thridLayout.GetKeyValue( mapIdx ) );
+ KeyValuePair propertyPair(thridLayout.GetKeyValue(mapIdx));
if(propertyPair.first == DefaultItemLayoutProperty::TYPE)
{
int layoutType = propertyPair.second.Get<int>();
- DALI_TEST_EQUALS( layoutType, (int)DefaultItemLayout::SPIRAL, TEST_LOCATION );
+ DALI_TEST_EQUALS(layoutType, (int)DefaultItemLayout::SPIRAL, TEST_LOCATION);
}
else if(propertyPair.first == DefaultItemLayoutProperty::SPIRAL_ITEM_SPACING)
{
float columnNumber = propertyPair.second.Get<float>();
- DALI_TEST_EQUALS( columnNumber, (Math::PI*2.0f)/9.5f, TEST_LOCATION );
+ DALI_TEST_EQUALS(columnNumber, (Math::PI * 2.0f) / 9.5f, TEST_LOCATION);
}
else if(propertyPair.first == DefaultItemLayoutProperty::SPIRAL_TOP_ITEM_ALIGNMENT)
{
float rowNumber = propertyPair.second.Get<float>();
- DALI_TEST_EQUALS(rowNumber, -0.125f, TEST_LOCATION );
+ DALI_TEST_EQUALS(rowNumber, -0.125f, TEST_LOCATION);
}
else if(propertyPair.first == DefaultItemLayoutProperty::SPIRAL_REVOLUTION_DISTANCE)
{
float rowSpacing = propertyPair.second.Get<float>();
- DALI_TEST_EQUALS(rowSpacing, 190.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(rowSpacing, 190.0f, TEST_LOCATION);
}
else if(propertyPair.first == DefaultItemLayoutProperty::SPIRAL_SCROLL_SPEED_FACTOR)
{
float scrollSpeedFactor = propertyPair.second.Get<float>();
- DALI_TEST_EQUALS(scrollSpeedFactor, 0.01f, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollSpeedFactor, 0.01f, TEST_LOCATION);
}
else if(propertyPair.first == DefaultItemLayoutProperty::SPIRAL_ITEM_FLICK_ANIMATION_DURATION)
{
float animationDuration = propertyPair.second.Get<float>();
- DALI_TEST_EQUALS(animationDuration, 0.1f, TEST_LOCATION );
+ DALI_TEST_EQUALS(animationDuration, 0.1f, TEST_LOCATION);
}
else if(propertyPair.first == DefaultItemLayoutProperty::SPIRAL_MAXIMUM_SWIPE_SPEED)
{
float swipSpeed = propertyPair.second.Get<float>();
- DALI_TEST_EQUALS(swipSpeed, 30.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(swipSpeed, 30.0f, TEST_LOCATION);
}
}
Dali::Integration::Scene scene = application.GetScene();
- Vector3 sceneSize(scene.GetSize());
+ Vector3 sceneSize(scene.GetSize());
view.ActivateLayout(0, sceneSize, 0.5f);
view.ActivateLayout(1, sceneSize, 0.5f);
view.ActivateLayout(2, sceneSize, 0.5f);
END_TEST;
-
}
int UtcDaliItemRangeIntersection(void)
unsigned int uBeginItemFirst = 100u, uEndItemFirst = 300u;
unsigned int uBeginItemSecond = 290u, uEndItemSecond = 400;
- unsigned int uInterBeginCheck=290u , uInterEndCheck=301u;
- bool bIsInThisRange = false, bOutOfThisRange = false;
+ 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);
+ ItemRange itmInterSect = objItemRangeFirst.Intersection(objItemRangeSecond);
bIsInThisRange = itmInterSect.Within(uInterBeginCheck);
- DALI_TEST_EQUALS(bIsInThisRange, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(bIsInThisRange, true, TEST_LOCATION);
bOutOfThisRange = itmInterSect.Within(uInterEndCheck);
- DALI_TEST_EQUALS(bOutOfThisRange, false, TEST_LOCATION );
+ DALI_TEST_EQUALS(bOutOfThisRange, false, TEST_LOCATION);
END_TEST;
}
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
+#include <float.h> // for FLT_MAX
#include <stdlib.h>
-#include <float.h> // for FLT_MAX
+#include <iostream>
// Need to override adaptor classes for toolkit test harness, so include
// test harness headers before dali headers.
namespace
{
+const unsigned int TOTAL_ITEM_NUMBER = 400;
+const char* TEST_IMAGE_FILE_NAME = "gallery_image_01.jpg";
-const unsigned int TOTAL_ITEM_NUMBER = 400;
-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)
+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 bool gOnLayoutActivatedCalled; ///< Whether the LayoutActivated signal was invoked.
static bool gOnScrollUpdateCalled;
-static bool gOnWheelEventCalled; ///< Whether the WheelEventSignal signal was invoked.
+static bool gOnWheelEventCalled; ///< Whether the WheelEventSignal signal was invoked.
static void TestCallback(BaseHandle handle)
{
gOnLayoutActivatedCalled = true;
}
-static void OnScrollUpdate( const Vector2& position )
+static void OnScrollUpdate(const Vector2& position)
{
gOnScrollUpdateCalled = true;
}
-static bool OnWheelEvent( Actor actor, const Dali::WheelEvent& wheelEvent )
+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 GenerateSingleTouch(PointState::Type state, const Vector2& screenPosition, uint32_t time)
{
Integration::TouchEvent touchEvent;
- Integration::Point point;
- point.SetState( state );
+ 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 );
+ point.SetScreenPosition(screenPosition);
+ point.SetDeviceClass(Device::Class::TOUCH);
+ point.SetDeviceSubclass(Device::Subclass::NONE);
+ touchEvent.points.push_back(point);
touchEvent.time = time;
return touchEvent;
}
{
int time = 0;
- for(int i = 0; i <= ( duration / RENDER_FRAME_INTERVAL); i++)
+ for(int i = 0; i <= (duration / RENDER_FRAME_INTERVAL); i++)
{
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
class TestItemFactory : public ItemFactory
{
public:
-
/**
* Constructor
* @param application class, stored as reference
}
public: // From ItemFactory
-
/**
* Query the number of items available from the factory.
* The maximum available item has an ID of GetNumberOfItems() - 1.
virtual Actor NewItem(unsigned int itemId)
{
// Create a renderable actor for this item
- return ImageView::New( TEST_IMAGE_FILE_NAME );
+ return ImageView::New(TEST_IMAGE_FILE_NAME);
}
};
} // namespace
-
int UtcDaliItemViewNew(void)
{
ToolkitTestApplication application;
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New(factory);
+ ItemView view = ItemView::New(factory);
DALI_TEST_CHECK(view);
//Additional check to ensure object is created by checking if it's registered
ObjectRegistry registry = application.GetCore().GetObjectRegistry();
- DALI_TEST_CHECK( registry );
+ DALI_TEST_CHECK(registry);
gObjectCreatedCallBackCalled = false;
registry.ObjectCreatedSignal().Connect(&TestCallback);
{
TestItemFactory factory;
- ItemView view = ItemView::New(factory);
+ ItemView view = ItemView::New(factory);
}
- DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
+ DALI_TEST_CHECK(gObjectCreatedCallBackCalled);
END_TEST;
}
ToolkitTestApplication application;
TestItemFactory factory;
- ItemView itemView = ItemView::New( factory );
- DALI_TEST_CHECK( itemView );
+ ItemView itemView = ItemView::New(factory);
+ DALI_TEST_CHECK(itemView);
- ItemView copy( itemView );
- DALI_TEST_CHECK( copy );
+ ItemView copy(itemView);
+ DALI_TEST_CHECK(copy);
END_TEST;
}
ToolkitTestApplication application;
TestItemFactory factory;
- ItemView itemView = ItemView::New( factory );
- DALI_TEST_CHECK( itemView );
+ ItemView itemView = ItemView::New(factory);
+ DALI_TEST_CHECK(itemView);
ItemView copy;
copy = itemView;
- DALI_TEST_CHECK( copy );
- DALI_TEST_EQUALS( itemView, copy, TEST_LOCATION );
+ DALI_TEST_CHECK(copy);
+ DALI_TEST_EQUALS(itemView, copy, TEST_LOCATION);
END_TEST;
}
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 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 );
+ 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;
}
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 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 );
+ 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;
}
// Create the ItemView actor
TestItemFactory factory;
- const ItemView itemViewConst = ItemView::New(factory);
- ItemView itemView(itemViewConst);
+ const ItemView itemViewConst = ItemView::New(factory);
+ ItemView itemView(itemViewConst);
BaseHandle handle(itemView);
- ItemView newItemView = ItemView::DownCast( handle );
- DALI_TEST_CHECK( itemView );
- DALI_TEST_CHECK( newItemView == itemView );
+ ItemView newItemView = ItemView::DownCast(handle);
+ DALI_TEST_CHECK(itemView);
+ DALI_TEST_CHECK(newItemView == itemView);
END_TEST;
}
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New(factory);
+ ItemView view = ItemView::New(factory);
// Create a grid layout and add it to ItemView
- ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+ 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
- ItemLayoutPtr depthLayout = DefaultItemLayout::New( DefaultItemLayout::DEPTH );
+ 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
- ItemLayoutPtr spiralLayout = DefaultItemLayout::New( DefaultItemLayout::SPIRAL );
+ ItemLayoutPtr spiralLayout = DefaultItemLayout::New(DefaultItemLayout::SPIRAL);
view.AddLayout(*spiralLayout);
// As we have added another layout, check the number of layout is now 3
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New(factory);
+ ItemView view = ItemView::New(factory);
// Create a grid layout and add it to ItemView
- ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+ 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
- ItemLayoutPtr depthLayout = DefaultItemLayout::New( DefaultItemLayout::DEPTH );
+ ItemLayoutPtr depthLayout = DefaultItemLayout::New(DefaultItemLayout::DEPTH);
view.AddLayout(*depthLayout);
// As we have added another layout, check the number of layout is now 2
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New(factory);
+ ItemView view = ItemView::New(factory);
// Create a grid layout and add it to ItemView
- ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+ ItemLayoutPtr gridLayout = DefaultItemLayout::New(DefaultItemLayout::GRID);
view.AddLayout(*gridLayout);
// Create a depth layout and add it to ItemView
- ItemLayoutPtr depthLayout = DefaultItemLayout::New( DefaultItemLayout::DEPTH );
+ ItemLayoutPtr depthLayout = DefaultItemLayout::New(DefaultItemLayout::DEPTH);
view.AddLayout(*depthLayout);
// Create a spiral layout and add it to ItemView
- ItemLayoutPtr spiralLayout = DefaultItemLayout::New( DefaultItemLayout::SPIRAL );
+ ItemLayoutPtr spiralLayout = DefaultItemLayout::New(DefaultItemLayout::SPIRAL);
view.AddLayout(*spiralLayout);
// As we have added three layouts, check the number of layout is now 3
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New(factory);
+ ItemView view = ItemView::New(factory);
// Create a grid layout and add it to ItemView
- ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+ ItemLayoutPtr gridLayout = DefaultItemLayout::New(DefaultItemLayout::GRID);
gridLayout->SetOrientation(ControlOrientation::Down);
view.AddLayout(*gridLayout);
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New(factory);
+ ItemView view = ItemView::New(factory);
// Create a grid layout and add it to ItemView
- ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+ ItemLayoutPtr gridLayout = DefaultItemLayout::New(DefaultItemLayout::GRID);
gridLayout->SetOrientation(ControlOrientation::Left);
view.AddLayout(*gridLayout);
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New(factory);
+ ItemView view = ItemView::New(factory);
// Create a grid layout and add it to ItemView
- ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+ ItemLayoutPtr gridLayout = DefaultItemLayout::New(DefaultItemLayout::GRID);
gridLayout->SetOrientation(ControlOrientation::Right);
view.AddLayout(*gridLayout);
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New(factory);
+ ItemView view = ItemView::New(factory);
// Create a depth layout and add it to ItemView
- ItemLayoutPtr depthLayout = DefaultItemLayout::New( DefaultItemLayout::DEPTH );
+ ItemLayoutPtr depthLayout = DefaultItemLayout::New(DefaultItemLayout::DEPTH);
depthLayout->SetOrientation(ControlOrientation::Up);
view.AddLayout(*depthLayout);
view.ActivateLayout(0, stageSize, 0.0f);
// Check the current layout position for the 10th items is 9.0f
- DALI_TEST_EQUALS(view.GetCurrentLayoutPosition(9), 9.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(view.GetCurrentLayoutPosition(9), 9.0f, TEST_LOCATION);
END_TEST;
}
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New(factory);
+ ItemView view = ItemView::New(factory);
// Set the minimum swipe speed to be 1.5f
view.SetMinimumSwipeSpeed(1.5f);
// Check the minimum swipe speed is 1.5f
- DALI_TEST_EQUALS(view.GetMinimumSwipeSpeed(), 1.5f, TEST_LOCATION );
+ DALI_TEST_EQUALS(view.GetMinimumSwipeSpeed(), 1.5f, TEST_LOCATION);
END_TEST;
}
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New(factory);
+ ItemView view = ItemView::New(factory);
// Set the minimum swipe distance to be 2.5f
view.SetMinimumSwipeDistance(2.5f);
// Check the minimum swipe distance is 2.5f
- DALI_TEST_EQUALS(view.GetMinimumSwipeDistance(), 2.5f, TEST_LOCATION );
+ DALI_TEST_EQUALS(view.GetMinimumSwipeDistance(), 2.5f, TEST_LOCATION);
END_TEST;
}
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New(factory);
+ ItemView view = ItemView::New(factory);
// Disable the anchor animation
view.SetAnchoring(false);
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New(factory);
+ ItemView view = ItemView::New(factory);
// Set the duration of anchor animation to be 1.5f
view.SetAnchoringDuration(1.5f);
// Check the duration of anchor animation is 1.5f
- DALI_TEST_EQUALS(view.GetAnchoringDuration(), 1.5f, TEST_LOCATION );
+ DALI_TEST_EQUALS(view.GetAnchoringDuration(), 1.5f, TEST_LOCATION);
END_TEST;
}
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New(factory);
+ ItemView view = ItemView::New(factory);
// Set the interval between refreshes to be 20
view.SetRefreshInterval(20);
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New(factory);
- Vector3 vec(480.0f, 800.0f, 0.0f);
- ItemLayoutPtr layout = DefaultItemLayout::New( DefaultItemLayout::DEPTH );
+ ItemView view = ItemView::New(factory);
+ Vector3 vec(480.0f, 800.0f, 0.0f);
+ ItemLayoutPtr layout = DefaultItemLayout::New(DefaultItemLayout::DEPTH);
- view.SetProperty( Dali::Actor::Property::NAME,"view actor");
+ view.SetProperty(Dali::Actor::Property::NAME, "view actor");
view.AddLayout(*layout);
- view.SetProperty( Actor::Property::SIZE, vec );
+ view.SetProperty(Actor::Property::SIZE, vec);
application.GetScene().Add(view);
layout->SetOrientation(ControlOrientation::Down);
for(unsigned int i = 0; i < 10; i++)
{
Actor testActor = view.GetItem(i);
- if (testActor)
+ if(testActor)
{
indices.push_back(i);
}
try
{
- if (!indices.empty())
+ if(!indices.empty())
{
- const unsigned int firstTargetIndex = indices[indices.size()-1];
+ const unsigned int firstTargetIndex = indices[indices.size() - 1];
// scroll to last item
view.ScrollToItem(firstTargetIndex, 0.00f);
for(int i = 0; i < 10; ++i)
view.ScrollToItem(indices[i], 0.0f);
float layoutPosAfter = view.GetCurrentLayoutPosition(i);
- if (fabs(layoutPosBefore-layoutPosAfter) <= FLT_EPSILON)
+ if(fabs(layoutPosBefore - layoutPosAfter) <= FLT_EPSILON)
{
++moveCount;
}
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New(factory);
+ ItemView view = ItemView::New(factory);
// 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.GetWheelScrollDistanceStep(), 100.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(view.GetWheelScrollDistanceStep(), 100.0f, TEST_LOCATION);
END_TEST;
}
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New(factory);
+ ItemView view = ItemView::New(factory);
// Create a grid layout and add it to ItemView
- ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID);
+ ItemLayoutPtr gridLayout = DefaultItemLayout::New(DefaultItemLayout::GRID);
gridLayout->SetOrientation(ControlOrientation::Left);
view.AddLayout(*gridLayout);
// Get the specified item where new item to be inserted before that
Actor itemActor = view.GetItem(2);
- ItemId id = view.GetItemId( itemActor );
+ ItemId id = view.GetItemId(itemActor);
// Check we are getting the correct Item ID given the specified actor
DALI_TEST_CHECK(view.GetItemId(itemActor) == 2);
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New(factory);
+ ItemView view = ItemView::New(factory);
// Create a depth layout and add it to ItemView
- ItemLayoutPtr depthLayout = DefaultItemLayout::New( DefaultItemLayout::DEPTH);
+ ItemLayoutPtr depthLayout = DefaultItemLayout::New(DefaultItemLayout::DEPTH);
depthLayout->SetOrientation(ControlOrientation::Right);
view.AddLayout(*depthLayout);
ItemContainer insertList;
- for( unsigned int i = 1u; i < 11; ++i )
+ for(unsigned int i = 1u; i < 11; ++i)
{
- Actor child = view.GetChildAt( i );
+ Actor child = view.GetChildAt(i);
Actor newActor = Actor::New();
- newActor.SetProperty( Dali::Actor::Property::NAME,"Inserted");
- insertList.push_back( Item( view.GetItemId(child), newActor ) );
+ newActor.SetProperty(Dali::Actor::Property::NAME, "Inserted");
+ insertList.push_back(Item(view.GetItemId(child), newActor));
}
- if( !insertList.empty() )
+ if(!insertList.empty())
{
- view.InsertItems( insertList, 0.5f );
+ view.InsertItems(insertList, 0.5f);
}
DALI_TEST_CHECK(view.GetChildCount() == itemCount + 10);
ItemIdContainer removeList;
- for( unsigned int i = 0u; i < view.GetChildCount(); ++i )
+ for(unsigned int i = 0u; i < view.GetChildCount(); ++i)
{
- Actor child = view.GetChildAt( i );
+ Actor child = view.GetChildAt(i);
- if( child.GetProperty< std::string >( Dali::Actor::Property::NAME ) == "Inserted" )
+ if(child.GetProperty<std::string>(Dali::Actor::Property::NAME) == "Inserted")
{
- removeList.push_back( view.GetItemId(child) );
+ removeList.push_back(view.GetItemId(child));
}
}
- if( ! removeList.empty() )
+ if(!removeList.empty())
{
- view.RemoveItems( removeList, 0.5f );
+ view.RemoveItems(removeList, 0.5f);
}
DALI_TEST_CHECK(view.GetChildCount() == itemCount);
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New(factory);
+ ItemView view = ItemView::New(factory);
// Create a spiral layout and add it to ItemView
- ItemLayoutPtr spiralLayout = DefaultItemLayout::New( DefaultItemLayout::SPIRAL );
+ ItemLayoutPtr spiralLayout = DefaultItemLayout::New(DefaultItemLayout::SPIRAL);
view.AddLayout(*spiralLayout);
// Activate the grid layout so that the items will be created and added to ItemView
Actor newActor = Actor::New();
- view.ReplaceItem( Item( 5, newActor ), 0.5f );
+ view.ReplaceItem(Item(5, newActor), 0.5f);
DALI_TEST_CHECK(view.GetItem(5) == newActor);
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New(factory);
+ ItemView view = ItemView::New(factory);
// Create a spiral layout and add it to ItemView
- ItemLayoutPtr spiralLayout = DefaultItemLayout::New( DefaultItemLayout::SPIRAL );
- spiralLayout->SetOrientation( ControlOrientation::Down );
+ ItemLayoutPtr spiralLayout = DefaultItemLayout::New(DefaultItemLayout::SPIRAL);
+ spiralLayout->SetOrientation(ControlOrientation::Down);
view.AddLayout(*spiralLayout);
// Activate the grid layout so that the items will be created and added to ItemView
ItemContainer replaceList;
- for( unsigned int i = 0u; i < 10; ++i )
+ for(unsigned int i = 0u; i < 10; ++i)
{
- Actor child = view.GetItem( i );
+ Actor child = view.GetItem(i);
Actor newActor = Actor::New();
- newActor.SetProperty( Dali::Actor::Property::NAME,"Replaced");
+ newActor.SetProperty(Dali::Actor::Property::NAME, "Replaced");
- replaceList.push_back( Item( i, newActor ) );
+ replaceList.push_back(Item(i, newActor));
}
- if( !replaceList.empty() )
+ if(!replaceList.empty())
{
- view.ReplaceItems( replaceList, 0.5f );
+ view.ReplaceItems(replaceList, 0.5f);
}
- 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");
+ 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;
}
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New(factory);
+ ItemView view = ItemView::New(factory);
// Create a spiral layout and add it to ItemView
- ItemLayoutPtr spiralLayout = DefaultItemLayout::New( DefaultItemLayout::SPIRAL );
- spiralLayout->SetOrientation( ControlOrientation::Left );
+ ItemLayoutPtr spiralLayout = DefaultItemLayout::New(DefaultItemLayout::SPIRAL);
+ spiralLayout->SetOrientation(ControlOrientation::Left);
view.AddLayout(*spiralLayout);
// Activate the grid layout so that the items will be created and added to ItemView
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New(factory);
+ ItemView view = ItemView::New(factory);
// Create a spiral layout and add it to ItemView
- ItemLayoutPtr spiralLayout = DefaultItemLayout::New( DefaultItemLayout::SPIRAL );
- spiralLayout->SetOrientation( ControlOrientation::Right );
+ ItemLayoutPtr spiralLayout = DefaultItemLayout::New(DefaultItemLayout::SPIRAL);
+ spiralLayout->SetOrientation(ControlOrientation::Right);
view.AddLayout(*spiralLayout);
// Activate the grid layout so that the items will be created and added to ItemView
view.SetItemsAnchorPoint(anchorPoint);
DALI_TEST_CHECK(view.GetItemsAnchorPoint() == anchorPoint);
- DALI_TEST_CHECK(view.GetItem(0).GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ) == anchorPoint);
+ DALI_TEST_CHECK(view.GetItem(0).GetCurrentProperty<Vector3>(Actor::Property::ANCHOR_POINT) == anchorPoint);
END_TEST;
}
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New(factory);
+ ItemView view = ItemView::New(factory);
// Create a grid layout and add it to ItemView
- ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+ ItemLayoutPtr gridLayout = DefaultItemLayout::New(DefaultItemLayout::GRID);
view.AddLayout(*gridLayout);
// Activate the grid layout so that the items will be created and added to ItemView
view.SetItemsParentOrigin(parentOrigin);
DALI_TEST_CHECK(view.GetItemsParentOrigin() == parentOrigin);
- DALI_TEST_CHECK(view.GetItem(0).GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ) == parentOrigin);
+ DALI_TEST_CHECK(view.GetItem(0).GetCurrentProperty<Vector3>(Actor::Property::PARENT_ORIGIN) == parentOrigin);
END_TEST;
}
int UtcDaliItemFactoryGetExtention(void)
{
ToolkitTestApplication application;
- TestItemFactory factory;
- DALI_TEST_CHECK( factory.GetExtension() == NULL );
+ TestItemFactory factory;
+ DALI_TEST_CHECK(factory.GetExtension() == NULL);
END_TEST;
}
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New(factory);
+ ItemView view = ItemView::New(factory);
// Create a grid layout and add it to ItemView
- ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+ ItemLayoutPtr gridLayout = DefaultItemLayout::New(DefaultItemLayout::GRID);
view.AddLayout(*gridLayout);
- application.GetScene().Add( view );
+ application.GetScene().Add(view);
// Connect the layout activated signal
- view.LayoutActivatedSignal().Connect( &OnLayoutActivated );
+ view.LayoutActivatedSignal().Connect(&OnLayoutActivated);
gOnLayoutActivatedCalled = false;
// Wait for 0.1 second
Wait(application, 100);
- DALI_TEST_EQUALS( gOnLayoutActivatedCalled, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gOnLayoutActivatedCalled, true, TEST_LOCATION);
END_TEST;
}
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New(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 );
+ 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 );
+ 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 );
+ 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 );
+ 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 );
+ 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 "layout" property
- DALI_TEST_CHECK( view.GetPropertyIndex("layout") == ItemView::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)) );
- gridLayoutProperty.Insert( DefaultItemLayoutProperty::GRID_ROW_SPACING, Dali::Property::Value(50.0f) );
- gridLayoutProperty.Insert( DefaultItemLayoutProperty::GRID_COLUMN_NUMBER, Dali::Property::Value(4) );
+ gridLayoutProperty.Insert(DefaultItemLayoutProperty::TYPE, Dali::Property::Value((int)DefaultItemLayout::GRID));
+ gridLayoutProperty.Insert(DefaultItemLayoutProperty::ITEM_SIZE, Dali::Property::Value(Vector3(200, 200, 50)));
+ gridLayoutProperty.Insert(DefaultItemLayoutProperty::GRID_ROW_SPACING, Dali::Property::Value(50.0f));
+ gridLayoutProperty.Insert(DefaultItemLayoutProperty::GRID_COLUMN_NUMBER, Dali::Property::Value(4));
Property::Map depthLayoutProperty;
- depthLayoutProperty.Insert( DefaultItemLayoutProperty::TYPE, Dali::Property::Value((int)DefaultItemLayout::DEPTH) );
- depthLayoutProperty.Insert( DefaultItemLayoutProperty::DEPTH_COLUMN_NUMBER, Dali::Property::Value(3) );
- depthLayoutProperty.Insert( DefaultItemLayoutProperty::DEPTH_ROW_NUMBER, Dali::Property::Value(26.0f) );
+ depthLayoutProperty.Insert(DefaultItemLayoutProperty::TYPE, Dali::Property::Value((int)DefaultItemLayout::DEPTH));
+ depthLayoutProperty.Insert(DefaultItemLayoutProperty::DEPTH_COLUMN_NUMBER, Dali::Property::Value(3));
+ depthLayoutProperty.Insert(DefaultItemLayoutProperty::DEPTH_ROW_NUMBER, Dali::Property::Value(26.0f));
Property::Map spiralLayoutPrperty;
- spiralLayoutPrperty.Insert( DefaultItemLayoutProperty::TYPE, Dali::Property::Value((int)DefaultItemLayout::SPIRAL) );
- spiralLayoutPrperty.Insert( DefaultItemLayoutProperty::SPIRAL_ITEM_SPACING, Dali::Property::Value((Math::PI*2.0f)/9.5f) );
- spiralLayoutPrperty.Insert( DefaultItemLayoutProperty::SPIRAL_TOP_ITEM_ALIGNMENT, Dali::Property::Value(-0.125f) );
+ spiralLayoutPrperty.Insert(DefaultItemLayoutProperty::TYPE, Dali::Property::Value((int)DefaultItemLayout::SPIRAL));
+ spiralLayoutPrperty.Insert(DefaultItemLayoutProperty::SPIRAL_ITEM_SPACING, Dali::Property::Value((Math::PI * 2.0f) / 9.5f));
+ spiralLayoutPrperty.Insert(DefaultItemLayoutProperty::SPIRAL_TOP_ITEM_ALIGNMENT, Dali::Property::Value(-0.125f));
Property::Map listLayoutPrperty;
- listLayoutPrperty.Insert( DefaultItemLayoutProperty::TYPE, Dali::Property::Value((int)DefaultItemLayout::LIST) );
- listLayoutPrperty.Insert( DefaultItemLayoutProperty::ITEM_SIZE, Dali::Property::Value(Vector3(100, 100,50)) );
-
+ listLayoutPrperty.Insert(DefaultItemLayoutProperty::TYPE, Dali::Property::Value((int)DefaultItemLayout::LIST));
+ listLayoutPrperty.Insert(DefaultItemLayoutProperty::ITEM_SIZE, Dali::Property::Value(Vector3(100, 100, 50)));
Property::Array layoutArray;
layoutArray.PushBack(gridLayoutProperty);
layoutArray.PushBack(spiralLayoutPrperty);
layoutArray.PushBack(listLayoutPrperty);
- view.SetProperty( ItemView::Property::LAYOUT, layoutArray);
+ view.SetProperty(ItemView::Property::LAYOUT, layoutArray);
Property::Array getLayoutArray;
- DALI_TEST_CHECK( view.GetProperty( ItemView::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 );
- Property::Map firstLayout = *((getLayoutArray.GetElementAt( 0 )).GetMap());
+ DALI_TEST_EQUALS(layoutArray.Count(), getLayoutArray.Count(), TEST_LOCATION);
+ Property::Map firstLayout = *((getLayoutArray.GetElementAt(0)).GetMap());
- for( unsigned int mapIdx = 0, mapCount = firstLayout.Count(); mapIdx < mapCount; ++mapIdx )
+ for(unsigned int mapIdx = 0, mapCount = firstLayout.Count(); mapIdx < mapCount; ++mapIdx)
{
- KeyValuePair propertyPair( firstLayout.GetKeyValue( mapIdx ) );
+ KeyValuePair propertyPair(firstLayout.GetKeyValue(mapIdx));
if(propertyPair.first == DefaultItemLayoutProperty::TYPE)
{
int layoutType = propertyPair.second.Get<int>();
- DALI_TEST_EQUALS( layoutType, (int)DefaultItemLayout::GRID, TEST_LOCATION );
+ DALI_TEST_EQUALS(layoutType, (int)DefaultItemLayout::GRID, TEST_LOCATION);
}
else if(propertyPair.first == DefaultItemLayoutProperty::ITEM_SIZE)
{
Vector3 size = propertyPair.second.Get<Vector3>();
- DALI_TEST_EQUALS( size, Vector3(200, 200,50), TEST_LOCATION );
+ DALI_TEST_EQUALS(size, Vector3(200, 200, 50), TEST_LOCATION);
}
else if(propertyPair.first == DefaultItemLayoutProperty::GRID_ROW_SPACING)
{
float spacing = propertyPair.second.Get<float>();
- DALI_TEST_EQUALS( spacing, 50.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(spacing, 50.0f, TEST_LOCATION);
}
else if(propertyPair.first == DefaultItemLayoutProperty::GRID_COLUMN_NUMBER)
{
int number = propertyPair.second.Get<int>();
- DALI_TEST_EQUALS(number, 4, TEST_LOCATION );
+ DALI_TEST_EQUALS(number, 4, TEST_LOCATION);
}
}
- view.SetProperty( ItemView::Property::LAYOUT, layoutArray);
-
+ view.SetProperty(ItemView::Property::LAYOUT, layoutArray);
// 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 );
+ 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);
// Test "overshootSize" property
- DALI_TEST_CHECK( view.GetPropertyIndex("overshootSize") == Scrollable::Property::OVERSHOOT_SIZE );
- Vector2 overshootSize = Vector2(100.0f,100.0f);
- view.SetProperty( Scrollable::Property::OVERSHOOT_SIZE, overshootSize );
- DALI_TEST_EQUALS( view.GetProperty(Scrollable::Property::OVERSHOOT_SIZE).Get<Vector2>(), overshootSize, TEST_LOCATION );
+ DALI_TEST_CHECK(view.GetPropertyIndex("overshootSize") == Scrollable::Property::OVERSHOOT_SIZE);
+ Vector2 overshootSize = Vector2(100.0f, 100.0f);
+ view.SetProperty(Scrollable::Property::OVERSHOOT_SIZE, overshootSize);
+ DALI_TEST_EQUALS(view.GetProperty(Scrollable::Property::OVERSHOOT_SIZE).Get<Vector2>(), overshootSize, 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 );
+ 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 );
+ 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 );
+ 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 );
+ 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 );
+ 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 );
+ 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) );
+ 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 );
+ 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 );
+ 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 );
+ 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 );
+ 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 );
+ DALI_TEST_EQUALS(view.GetProperty(ItemView::Property::SCROLL_CONTENT_SIZE).Get<float>(), 250.0f, TEST_LOCATION);
END_TEST;
}
-
int UtcDaliItemViewOvershootVertical(void)
{
- ToolkitTestApplication application;
+ ToolkitTestApplication application;
Dali::Integration::Scene stage = application.GetScene();
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New(factory);
+ ItemView view = ItemView::New(factory);
// Create a grid layout and add it to ItemView
- ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+ ItemLayoutPtr gridLayout = DefaultItemLayout::New(DefaultItemLayout::GRID);
view.AddLayout(*gridLayout);
stage.Add(view);
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_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) );
+ 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);
- application.ProcessEvent( GenerateSingleTouch(PointState::DOWN, pos, 100 ) );
- application.ProcessEvent( GenerateSingleTouch(PointState::MOTION, pos, 100 ) );
+ 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++)
+ for(int i = 0; i < 200; i++)
{
- application.ProcessEvent( GenerateSingleTouch(PointState::MOTION, pos, 100 ) );
+ application.ProcessEvent(GenerateSingleTouch(PointState::MOTION, pos, 100));
pos.y += 5.0f;
Wait(application);
}
- application.ProcessEvent( GenerateSingleTouch(PointState::UP, pos, 100 ) );
+ 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);
- application.ProcessEvent( GenerateSingleTouch(PointState::DOWN, pos, 100 ) );
- application.ProcessEvent( GenerateSingleTouch(PointState::MOTION, pos, 100 ) );
+ 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++)
+ for(int i = 0; i < 200; i++)
{
- application.ProcessEvent( GenerateSingleTouch(PointState::MOTION, pos, 100 ) );
+ application.ProcessEvent(GenerateSingleTouch(PointState::MOTION, pos, 100));
pos.y -= 5.0f;
Wait(application);
}
- application.ProcessEvent( GenerateSingleTouch(PointState::UP, pos, 100 ) );
+ application.ProcessEvent(GenerateSingleTouch(PointState::UP, pos, 100));
Wait(application, 100);
END_TEST;
}
int UtcDaliItemViewOvershootHorizontal(void)
{
- ToolkitTestApplication application;
+ ToolkitTestApplication application;
Dali::Integration::Scene stage = application.GetScene();
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New(factory);
+ ItemView view = ItemView::New(factory);
// Create a grid layout and add it to ItemView
- ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::SPIRAL );
+ ItemLayoutPtr gridLayout = DefaultItemLayout::New(DefaultItemLayout::SPIRAL);
view.AddLayout(*gridLayout);
stage.Add(view);
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_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) );
+ 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);
- application.ProcessEvent( GenerateSingleTouch(PointState::DOWN, pos, 100 ));
- application.ProcessEvent( GenerateSingleTouch(PointState::MOTION, pos, 100 ));
+ 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++)
+ for(int i = 0; i < 200; i++)
{
- application.ProcessEvent( GenerateSingleTouch(PointState::MOTION, pos, 100 ) );
+ application.ProcessEvent(GenerateSingleTouch(PointState::MOTION, pos, 100));
pos.x -= 5.0f;
Wait(application);
}
- application.ProcessEvent( GenerateSingleTouch(PointState::UP, pos, 100 ) );
+ 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);
- application.ProcessEvent( GenerateSingleTouch(PointState::DOWN, pos, 100 ) );
- application.ProcessEvent( GenerateSingleTouch(PointState::MOTION, pos, 100 ) );
+ 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++)
+ for(int i = 0; i < 200; i++)
{
- application.ProcessEvent( GenerateSingleTouch(PointState::MOTION, pos, 100 ) );
+ application.ProcessEvent(GenerateSingleTouch(PointState::MOTION, pos, 100));
pos.x += 5.0f;
Wait(application);
}
- application.ProcessEvent( GenerateSingleTouch(PointState::UP, pos, 100 ) );
+ application.ProcessEvent(GenerateSingleTouch(PointState::UP, pos, 100));
Wait(application, 100);
END_TEST;
int UtcDaliItemEnableDisableRefresh(void)
{
- ToolkitTestApplication application;
+ ToolkitTestApplication application;
Dali::Integration::Scene stage = application.GetScene();
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New(factory);
+ ItemView view = ItemView::New(factory);
// Create a grid layout and add it to ItemView
- ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+ ItemLayoutPtr gridLayout = DefaultItemLayout::New(DefaultItemLayout::GRID);
view.AddLayout(*gridLayout);
stage.Add(view);
view.ActivateLayout(0, stageSize, 0.5f);
//Connect to signal scroll updated
- view.ScrollUpdatedSignal().Connect( &OnScrollUpdate );
+ view.ScrollUpdatedSignal().Connect(&OnScrollUpdate);
Property::Map attributes;
- view.DoAction("enableRefresh", attributes );
+ view.DoAction("enableRefresh", attributes);
gOnScrollUpdateCalled = true;
- view.SetProperty( ItemView::Property::LAYOUT_POSITION, 100.0f );
+ view.SetProperty(ItemView::Property::LAYOUT_POSITION, 100.0f);
application.SendNotification();
application.Render(1000);
- DALI_TEST_EQUALS( gOnScrollUpdateCalled, true, TEST_LOCATION );
-
+ DALI_TEST_EQUALS(gOnScrollUpdateCalled, true, TEST_LOCATION);
- view.DoAction("disableRefresh", attributes );
+ view.DoAction("disableRefresh", attributes);
gOnScrollUpdateCalled = false;
- view.SetProperty( ItemView::Property::LAYOUT_POSITION, 100.0f );
+ view.SetProperty(ItemView::Property::LAYOUT_POSITION, 100.0f);
application.SendNotification();
application.Render(1000);
- DALI_TEST_EQUALS( gOnScrollUpdateCalled, false, TEST_LOCATION );
+ DALI_TEST_EQUALS(gOnScrollUpdateCalled, false, TEST_LOCATION);
END_TEST;
}
int UtcDaliItemViewWheelEvent(void)
{
- ToolkitTestApplication application;
+ ToolkitTestApplication application;
Dali::Integration::Scene stage = application.GetScene();
// Create the ItemView actor
TestItemFactory factory;
- ItemView view = ItemView::New( 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 );
+ 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 );
+ Vector3 stageSize(stage.GetSize());
+ view.ActivateLayout(0, stageSize, 0.5f);
//Connect to wheel event signal
- view.WheelEventSignal().Connect( &OnWheelEvent );
+ view.WheelEventSignal().Connect(&OnWheelEvent);
- DALI_TEST_CHECK( !gOnWheelEventCalled );
+ DALI_TEST_CHECK(!gOnWheelEventCalled);
// Render and notify
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 );
+ 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;
}
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
-#include <stdlib.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/builder/json-parser.h>
+#include <stdlib.h>
+#include <iostream>
using namespace Dali;
using namespace Dali::Toolkit;
namespace
{
-
-std::string ReplaceQuotes(const std::string &in_s)
+std::string ReplaceQuotes(const std::string& in_s)
{
std::string s(in_s);
// wrong as no embedded quote but had regex link problems
void CompareTrees(const TreeNode& a, const TreeNode& b)
{
- DALI_TEST_CHECK( a.GetType() == b.GetType() );
+ DALI_TEST_CHECK(a.GetType() == b.GetType());
- DALI_TEST_CHECK( a.Size() == b.Size() );
+ DALI_TEST_CHECK(a.Size() == b.Size());
- if( a.GetName() )
+ if(a.GetName())
{
- DALI_TEST_CHECK( std::string( a.GetName() ) == std::string( b.GetName() ) );
+ DALI_TEST_CHECK(std::string(a.GetName()) == std::string(b.GetName()));
}
- DALI_TEST_CHECK( a.HasSubstitution() == b.HasSubstitution() );
+ DALI_TEST_CHECK(a.HasSubstitution() == b.HasSubstitution());
- switch( a.GetType() )
+ switch(a.GetType())
{
case TreeNode::OBJECT:
case TreeNode::ARRAY:
{
- for( TreeNode::ConstIterator aiter = a.CBegin(), biter = b.CBegin();
- aiter != a.CEnd() && biter != b.CEnd(); ++aiter, ++biter )
+ for(TreeNode::ConstIterator aiter = a.CBegin(), biter = b.CBegin();
+ aiter != a.CEnd() && biter != b.CEnd();
+ ++aiter, ++biter)
{
- CompareTrees( (*aiter).second, (*biter).second );
+ CompareTrees((*aiter).second, (*biter).second);
}
break;
}
case TreeNode::STRING:
{
- DALI_TEST_CHECK( std::string( a.GetString() ) == std::string( b.GetString() ) );
+ DALI_TEST_CHECK(std::string(a.GetString()) == std::string(b.GetString()));
break;
}
case TreeNode::FLOAT:
{
- DALI_TEST_CHECK( a.GetFloat() == b.GetFloat() );
+ DALI_TEST_CHECK(a.GetFloat() == b.GetFloat());
break;
}
case TreeNode::INTEGER:
{
- DALI_TEST_CHECK( a.GetInteger() == b.GetInteger());
+ DALI_TEST_CHECK(a.GetInteger() == b.GetInteger());
break;
}
case TreeNode::BOOLEAN:
{
- DALI_TEST_CHECK( a.GetBoolean() == b.GetBoolean() );
+ DALI_TEST_CHECK(a.GetBoolean() == b.GetBoolean());
break;
}
default:
}
}
-
-}
-
+} // namespace
int UtcDaliJsonParserMethod01(void)
{
tet_infoline("JSON basic test");
- std::string s1( ReplaceQuotes(
-"{ \
+ std::string s1(ReplaceQuotes(
+ "{ \
'string':'value2', \
'integer':2, \
'float':2.0, \
JsonParser parser = JsonParser::New();
- parser.Parse( s1 );
+ parser.Parse(s1);
if(parser.ParseError())
{
TreeNode::ConstIterator iterArray = node->CBegin();
DALI_TEST_CHECK(iterArray != node->CEnd());
- DALI_TEST_CHECK( ((*iterArray).second).GetType() == TreeNode::INTEGER);
- DALI_TEST_CHECK( (*iterArray).first == NULL );
- DALI_TEST_CHECK( ((*iterArray).second).GetInteger() == 1);
+ DALI_TEST_CHECK(((*iterArray).second).GetType() == TreeNode::INTEGER);
+ DALI_TEST_CHECK((*iterArray).first == NULL);
+ DALI_TEST_CHECK(((*iterArray).second).GetInteger() == 1);
++iterArray;
DALI_TEST_CHECK(iterArray != node->CEnd());
- DALI_TEST_CHECK( ((*iterArray).second).GetType() == TreeNode::INTEGER);
- DALI_TEST_CHECK( (*iterArray).first == NULL );
- DALI_TEST_CHECK( ((*iterArray).second).GetInteger() == 2);
+ DALI_TEST_CHECK(((*iterArray).second).GetType() == TreeNode::INTEGER);
+ DALI_TEST_CHECK((*iterArray).first == NULL);
+ DALI_TEST_CHECK(((*iterArray).second).GetInteger() == 2);
++iterArray;
DALI_TEST_CHECK(iterArray != node->CEnd());
- DALI_TEST_CHECK( ((*iterArray).second).GetType() == TreeNode::INTEGER);
- DALI_TEST_CHECK( (*iterArray).first == NULL );
- DALI_TEST_CHECK( ((*iterArray).second).GetInteger() == 3);
+ DALI_TEST_CHECK(((*iterArray).second).GetType() == TreeNode::INTEGER);
+ DALI_TEST_CHECK((*iterArray).first == NULL);
+ DALI_TEST_CHECK(((*iterArray).second).GetInteger() == 3);
++iter;
DALI_TEST_CHECK(iter != root->CEnd());
TreeNode::ConstIterator iterObject = node->CBegin();
DALI_TEST_CHECK(iterObject != node->CEnd());
- DALI_TEST_CHECK( ((*iterObject).second).GetType() == TreeNode::STRING);
- DALI_TEST_CHECK( std::string((*iterObject).first) == std::string("key" ));
- DALI_TEST_CHECK( std::string(((*iterObject).second).GetString()) == std::string("value"));
+ DALI_TEST_CHECK(((*iterObject).second).GetType() == TreeNode::STRING);
+ DALI_TEST_CHECK(std::string((*iterObject).first) == std::string("key"));
+ DALI_TEST_CHECK(std::string(((*iterObject).second).GetString()) == std::string("value"));
++iter;
- DALI_TEST_CHECK(!( iter != root->CEnd() ));
+ DALI_TEST_CHECK(!(iter != root->CEnd()));
++iter; // Go past the end
tet_infoline("JSON Comments");
- std::string s1( ReplaceQuotes(" \
+ std::string s1(ReplaceQuotes(
+ " \
// some comments with empty line above \n\
{ \
// inline comments \n\
JsonParser parser = JsonParser::New();
- parser.Parse( s1 );
+ parser.Parse(s1);
if(parser.ParseError())
{
END_TEST;
}
-
int UtcDaliJsonParserMethod03(void)
{
ToolkitTestApplication application;
tet_infoline("JSON Empty line comment");
- std::string s1( ReplaceQuotes(
-"/*\n" \
-"c comment\n" \
-"*/"\
-"// next empty line comment\n"\
-"//\n"\
-"{\n"\
-" 'key':'value'\n"\
-"}\n"\
-));
+ std::string s1(ReplaceQuotes(
+ "/*\n"
+ "c comment\n"
+ "*/"
+ "// next empty line comment\n"
+ "//\n"
+ "{\n"
+ " 'key':'value'\n"
+ "}\n"));
JsonParser parser = JsonParser::New();
- parser.Parse( s1 );
+ parser.Parse(s1);
if(parser.ParseError())
{
tet_infoline("JSON Merge");
- std::string s1( ReplaceQuotes(" \
+ std::string s1(ReplaceQuotes(
+ " \
{ \
'animations': \
{ \
} \
"));
- std::string s2( ReplaceQuotes(" \
+ std::string s2(ReplaceQuotes(
+ " \
{ \
'animations': \
{ \
JsonParser parser = JsonParser::New();
- parser.Parse( s1 );
+ parser.Parse(s1);
if(parser.ParseError())
{
}
DALI_TEST_CHECK(!parser.ParseError());
- parser.Parse( s2 );
+ parser.Parse(s2);
if(parser.ParseError())
{
const TreeNode* root = parser.GetRoot();
DALI_TEST_CHECK(root);
- const TreeNode *node = root->Find("bump");
+ const TreeNode* node = root->Find("bump");
DALI_TEST_CHECK(node);
DALI_TEST_CHECK(static_cast<int>(node->Size()) == 4);
- DALI_TEST_CHECK( node->GetChild("duration") );
- DALI_TEST_CHECK( node->GetChild("loop") );
- DALI_TEST_CHECK( node->GetChild("properties") );
-
+ DALI_TEST_CHECK(node->GetChild("duration"));
+ DALI_TEST_CHECK(node->GetChild("loop"));
+ DALI_TEST_CHECK(node->GetChild("properties"));
tet_result(TET_PASS);
END_TEST;
tet_infoline("JSON Pack & Write");
- std::string s1( ReplaceQuotes(" \
+ std::string s1(ReplaceQuotes(
+ " \
{ \
'animations': \
{ \
JsonParser parser = JsonParser::New();
- parser.Parse( s1 );
+ parser.Parse(s1);
if(parser.ParseError())
{
std::stringstream b;
parser.Write(b, 2);
- DALI_TEST_CHECK( a.str() == b.str() );
+ DALI_TEST_CHECK(a.str() == b.str());
tet_result(TET_PASS);
END_TEST;
namespace
{
-
-static const int NUMBER_OK_TESTS = 36;
-const char *TEST_OK[NUMBER_OK_TESTS] = {
+static const int NUMBER_OK_TESTS = 36;
+const char* TEST_OK[NUMBER_OK_TESTS] = {
"{ 'hex': '\u0123\u4567\u89AB\uCDEF\uabcd\uef4A' }",
"{ 'special': '`1~!@#$%^&*()_+-={:[,]}|;.</>?' }",
"{ 'slash': '/ & \' }",
"{'JSON Test Pattern pass3': { 'The outermost value': 'must be an object or array.', 'In this test': 'It is an object.' } }",
"[[[[[[[[[[[[[[[[[[['Not too deep']]]]]]]]]]]]]]]]]]]",
};
-}
-
+} // namespace
int UtcDaliJsonParserMethod06(void)
{
{
parser = JsonParser::New();
- parser.Parse( ReplaceQuotes(TEST_OK[i]) );
+ parser.Parse(ReplaceQuotes(TEST_OK[i]));
if(parser.ParseError())
{
namespace
{
-
static const int NUMBER_FAIL_TESTS = 34;
-const char *TEST_FAIL[] = {
+const char* TEST_FAIL[] = {
"[' tab\t character \t in\t string ']",
"['Extra close']]",
"['Colon instead of comma': false]",
"[{'no comma':1} {'b:2}]",
"{'extra comma':1,}",
};
-}
+} // namespace
int UtcDaliJsonParserMethod07(void)
{
{
parser = JsonParser::New();
- parser.Parse( ReplaceQuotes(TEST_FAIL[i]) );
+ parser.Parse(ReplaceQuotes(TEST_FAIL[i]));
if(!parser.ParseError())
{
tet_printf("Invalid JSON parse test %d Failed", i);
tet_printf("%s", ReplaceQuotes(TEST_FAIL[i]).c_str());
- tet_printf("JSON Error %d:%d %s (%s)", parser.GetErrorLineNumber(), parser.GetErrorColumn(),
- parser.GetErrorDescription().c_str(), parser.GetErrorPosition());
+ tet_printf("JSON Error %d:%d %s (%s)", parser.GetErrorLineNumber(), parser.GetErrorColumn(), parser.GetErrorDescription().c_str(), parser.GetErrorPosition());
}
DALI_TEST_CHECK(parser.ParseError());
}
-
parser = JsonParser::New();
- parser.Parse( "['single quote']" );
+ parser.Parse("['single quote']");
if(!parser.ParseError())
{
tet_infoline("JSON error reporting");
- std::string s1( ReplaceQuotes("\
+ std::string s1(ReplaceQuotes(
+ "\
{ \n\
'float':,], \n\
} \n\
JsonParser parser = JsonParser::New();
- parser.Parse( s1 );
+ parser.Parse(s1);
DALI_TEST_CHECK(parser.ParseError());
- DALI_TEST_CHECK(1 == parser.GetErrorLineNumber());
+ DALI_TEST_CHECK(1 == parser.GetErrorLineNumber());
DALI_TEST_CHECK(53 == parser.GetErrorPosition());
DALI_TEST_CHECK(11 == parser.GetErrorColumn());
DALI_TEST_CHECK("Missing Value" == parser.GetErrorDescription());
tet_infoline("JSON Pack()");
- std::string s1( ReplaceQuotes("\
+ std::string s1(ReplaceQuotes(
+ "\
{ \
'string':'value2', \
'integer':2, \
JsonParser parser = JsonParser::New();
- parser.Parse( s1 );
+ parser.Parse(s1);
std::stringstream ss1;
parser.Write(ss1, 2);
tet_infoline("JSON empty data");
- std::string s1( "" );
+ std::string s1("");
JsonParser parser = JsonParser::New();
- parser.Parse( s1 );
+ parser.Parse(s1);
DALI_TEST_CHECK(parser.ParseError());
ToolkitTestApplication application;
tet_infoline("JSON tree copy");
- std::string s1( ReplaceQuotes(" \
+ std::string s1(ReplaceQuotes(
+ " \
{ \
'animations': \
{ \
JsonParser parser = JsonParser::New();
- parser.Parse( s1 );
+ parser.Parse(s1);
JsonParser parser2 = JsonParser::New(*parser.GetRoot());
DALI_TEST_CHECK(parser.GetRoot());
DALI_TEST_CHECK(parser2.GetRoot());
- CompareTrees( *parser.GetRoot(), *parser2.GetRoot() );
+ CompareTrees(*parser.GetRoot(), *parser2.GetRoot());
tet_result(TET_PASS);
END_TEST;
}
-
int UtcDaliJsonParserMerge1(void)
{
ToolkitTestApplication application;
tet_infoline("JSON tree merge");
- std::string s1( ReplaceQuotes(" \
+ std::string s1(ReplaceQuotes(
+ " \
{ \
'styles': \
{ \
} \
"));
- JsonParser parser = JsonParser::New();
+ JsonParser parser = JsonParser::New();
JsonParser testParser = JsonParser::New();
- testParser.Parse( s1 );
+ testParser.Parse(s1);
- parser.Parse( s1 );
- parser.Parse( s1 ); // Merge the tree into itself. The value array should not grow.
+ parser.Parse(s1);
+ parser.Parse(s1); // Merge the tree into itself. The value array should not grow.
DALI_TEST_CHECK(parser.GetRoot());
- CompareTrees( *parser.GetRoot(), *testParser.GetRoot() );
+ CompareTrees(*parser.GetRoot(), *testParser.GetRoot());
END_TEST;
}
int UtcDaliJsonParserDownCast(void)
{
BaseHandle handle = JsonParser::New();
- JsonParser parser = JsonParser::DownCast( handle );
- DALI_TEST_CHECK( parser );
+ JsonParser parser = JsonParser::DownCast(handle);
+ DALI_TEST_CHECK(parser);
END_TEST;
}
int UtcDaliJsonParserTreeNodeCount(void)
{
- std::string s1( ReplaceQuotes(" \
+ std::string s1(ReplaceQuotes(
+ " \
{ \
'styles': \
{ \
"));
JsonParser parser = JsonParser::New();
- parser.Parse( s1 );
+ parser.Parse(s1);
const TreeNode* treeNode = parser.GetRoot();
- DALI_TEST_EQUALS(1, treeNode->Count("styles"), TEST_LOCATION );
- DALI_TEST_EQUALS(0, treeNode->Count("random"), TEST_LOCATION );
+ DALI_TEST_EQUALS(1, treeNode->Count("styles"), TEST_LOCATION);
+ DALI_TEST_EQUALS(0, treeNode->Count("random"), TEST_LOCATION);
END_TEST;
}
int UtcDaliJsonParserTreeNodeFind(void)
{
- std::string s1( ReplaceQuotes("\
+ std::string s1(ReplaceQuotes(
+ "\
{ \
'string':'value2', \
'integer':2, \
"));
JsonParser parser = JsonParser::New();
- parser.Parse( s1 );
+ parser.Parse(s1);
- const TreeNode* treeNode = parser.GetRoot();
+ const TreeNode* treeNode = parser.GetRoot();
const TreeNode* childNode = treeNode->Find("string");
- DALI_TEST_CHECK( childNode );
+ DALI_TEST_CHECK(childNode);
const TreeNode* sameNode = childNode->Find("string");
- DALI_TEST_EQUALS( sameNode, childNode, TEST_LOCATION );
+ DALI_TEST_EQUALS(sameNode, childNode, TEST_LOCATION);
END_TEST;
}
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
-#include <stdlib.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
-#include <dali/integration-api/events/key-event-integ.h>
#include <dali-toolkit/devel-api/controls/control-devel.h>
#include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
#include <dali/devel-api/common/stage-devel.h>
+#include <dali/integration-api/events/key-event-integ.h>
+#include <stdlib.h>
+#include <iostream>
#include "dummy-control.h"
namespace
{
-
/**
* Callback class for KeyInputFocusChanged signal.
*/
* @param[in] gainActor Ref to the actor that should be set as the one that gains key input focus.
* @param[in] lostActor Ref to the actor that should be set as the one that loses key input focus.
*/
- KeyInputFocusChangedCallback( Control& gainActor, Control& lostActor )
- : mActorGain( gainActor ),
- mActorLost( lostActor )
+ KeyInputFocusChangedCallback(Control& gainActor, Control& lostActor)
+ : mActorGain(gainActor),
+ mActorLost(lostActor)
{
}
- void Callback( Control gainingActor, Control lostActor )
+ void Callback(Control gainingActor, Control lostActor)
{
mActorGain = gainingActor;
mActorLost = lostActor;
{
SignalData()
: functorCalled(false)
- {}
+ {
+ }
void Reset()
{
functorCalled = false;
receivedKeyEvent.Reset();
-
}
- bool functorCalled;
+ bool functorCalled;
KeyEvent receivedKeyEvent;
};
* Constructor
* @param[in] returnValue Set return value of KeyEvent callback.
* */
- KeyEventCallback( bool consumed )
- : mConsumed( consumed ),
- mIsCalled( false )
+ KeyEventCallback(bool consumed)
+ : mConsumed(consumed),
+ mIsCalled(false)
{
}
- bool Callback( Control control, const KeyEvent& keyEvent )
+ bool Callback(Control control, const KeyEvent& keyEvent)
{
mIsCalled = true;
return mConsumed;
}
- void Callback( const KeyEvent& keyEvent )
+ void Callback(const KeyEvent& keyEvent)
{
mIsCalled = true;
}
int UtcDaliKeyInputFocusManagerSetFocus01(void)
{
ToolkitTestApplication application;
- Integration::Scene stage = application.GetScene();
+ Integration::Scene stage = application.GetScene();
tet_infoline(" Check that there is no focused control. Set focus to control. Check it is now the focused actor and receives KeyInputFocusGained signal");
DALI_TEST_CHECK(manager);
Control focusedControl = manager.GetCurrentFocusControl();
- DALI_TEST_CHECK( ! focusedControl );
+ DALI_TEST_CHECK(!focusedControl);
- DummyControl dummy = DummyControl::New(true);
+ DummyControl dummy = DummyControl::New(true);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
- dummy.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
- stage.Add( dummy );
- DALI_TEST_CHECK( ! dummyImpl.keyInputFocusGained );
+ dummy.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ stage.Add(dummy);
+ DALI_TEST_CHECK(!dummyImpl.keyInputFocusGained);
- manager.SetFocus( dummy );
- DALI_TEST_CHECK( dummy.HasKeyInputFocus()); // Also tests IsKeyboardListener() API
- DALI_TEST_CHECK( dummyImpl.keyInputFocusGained );
+ manager.SetFocus(dummy);
+ DALI_TEST_CHECK(dummy.HasKeyInputFocus()); // Also tests IsKeyboardListener() API
+ DALI_TEST_CHECK(dummyImpl.keyInputFocusGained);
focusedControl = manager.GetCurrentFocusControl();
- DALI_TEST_CHECK( focusedControl );
- DALI_TEST_CHECK( focusedControl == dummy );
+ DALI_TEST_CHECK(focusedControl);
+ DALI_TEST_CHECK(focusedControl == dummy);
END_TEST;
}
int UtcDaliKeyInputFocusManagerSetFocus02(void)
{
ToolkitTestApplication application;
- Integration::Scene stage = application.GetScene();
+ Integration::Scene stage = application.GetScene();
tet_infoline(" Set focus to control. Check it is now the focused actor and receives KeyInputFocusGained signal. Set focuse to another control - check that the first control receives KeyInputFocusLost");
KeyInputFocusManager manager = KeyInputFocusManager::Get();
DALI_TEST_CHECK(manager);
- DummyControl dummy1 = DummyControl::New(true);
+ DummyControl dummy1 = DummyControl::New(true);
Impl::DummyControl& dummy1Impl = static_cast<Impl::DummyControl&>(dummy1.GetImplementation());
- dummy1.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
- stage.Add( dummy1 );
- DALI_TEST_CHECK( ! dummy1Impl.keyInputFocusGained );
- DALI_TEST_CHECK( ! dummy1Impl.keyInputFocusLost );
-
- manager.SetFocus( dummy1 );
- DALI_TEST_CHECK( dummy1.HasKeyInputFocus()); // Also tests IsKeyboardListener() API
- DALI_TEST_CHECK( dummy1Impl.keyInputFocusGained );
+ dummy1.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ stage.Add(dummy1);
+ DALI_TEST_CHECK(!dummy1Impl.keyInputFocusGained);
+ DALI_TEST_CHECK(!dummy1Impl.keyInputFocusLost);
+
+ manager.SetFocus(dummy1);
+ DALI_TEST_CHECK(dummy1.HasKeyInputFocus()); // Also tests IsKeyboardListener() API
+ DALI_TEST_CHECK(dummy1Impl.keyInputFocusGained);
dummy1Impl.keyInputFocusGained = false;
- DummyControl dummy2 = DummyControl::New(true);
+ DummyControl dummy2 = DummyControl::New(true);
Impl::DummyControl& dummy2Impl = static_cast<Impl::DummyControl&>(dummy2.GetImplementation());
- dummy2.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
- stage.Add( dummy2 );
- DALI_TEST_CHECK( ! dummy2Impl.keyInputFocusGained );
- DALI_TEST_CHECK( ! dummy1Impl.keyInputFocusLost );
-
- manager.SetFocus( dummy2 );
- DALI_TEST_CHECK( dummy2.HasKeyInputFocus()); // Also tests IsKeyboardListener() API
- DALI_TEST_CHECK( dummy2Impl.keyInputFocusGained );
+ dummy2.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ stage.Add(dummy2);
+ DALI_TEST_CHECK(!dummy2Impl.keyInputFocusGained);
+ DALI_TEST_CHECK(!dummy1Impl.keyInputFocusLost);
+
+ manager.SetFocus(dummy2);
+ DALI_TEST_CHECK(dummy2.HasKeyInputFocus()); // Also tests IsKeyboardListener() API
+ DALI_TEST_CHECK(dummy2Impl.keyInputFocusGained);
dummy1Impl.keyInputFocusGained = false;
- DALI_TEST_CHECK( ! dummy1Impl.keyInputFocusGained );
- DALI_TEST_CHECK( dummy1Impl.keyInputFocusLost );
+ DALI_TEST_CHECK(!dummy1Impl.keyInputFocusGained);
+ DALI_TEST_CHECK(dummy1Impl.keyInputFocusLost);
END_TEST;
}
int UtcDaliKeyInputFocusManagerKeyEventPropagation01(void)
{
-
ToolkitTestApplication application;
- Integration::Scene stage = application.GetScene();
+ Integration::Scene stage = application.GetScene();
tet_infoline("Test KeyEvent propagation. If focused control doesn't consume KeyEvent, KeyEvent will be recursively delivered to the control and its parents, until the event is consumed or the stage is reached. In this case, KeyEvent is delivered to KeyboardFocusManager via Stage's KeyEventSignal");
KeyInputFocusManager manager = KeyInputFocusManager::Get();
DALI_TEST_CHECK(manager);
- KeyEventCallback stageCallback( false );
- stage.KeyEventSignal().Connect( &stageCallback, &KeyEventCallback::Callback );
+ KeyEventCallback stageCallback(false);
+ stage.KeyEventSignal().Connect(&stageCallback, &KeyEventCallback::Callback);
DummyControl dummy1 = DummyControl::New(true);
- dummy1.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
- KeyEventCallback callback1( false );
- dummy1.KeyEventSignal().Connect( &callback1, &KeyEventCallback::Callback );
- stage.Add( dummy1 );
+ dummy1.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ KeyEventCallback callback1(false);
+ dummy1.KeyEventSignal().Connect(&callback1, &KeyEventCallback::Callback);
+ stage.Add(dummy1);
DummyControl dummy2 = DummyControl::New(true);
- dummy2.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
- KeyEventCallback callback2( false );
- dummy2.KeyEventSignal().Connect( &callback2, &KeyEventCallback::Callback );
- dummy1.Add( dummy2 );
+ dummy2.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ KeyEventCallback callback2(false);
+ dummy2.KeyEventSignal().Connect(&callback2, &KeyEventCallback::Callback);
+ dummy1.Add(dummy2);
- DummyControl dummy3 = DummyControl::New(true);
+ DummyControl dummy3 = DummyControl::New(true);
Impl::DummyControl& dummy3Impl = static_cast<Impl::DummyControl&>(dummy3.GetImplementation());
- dummy3.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
- KeyEventCallback callback3( false );
- dummy3.KeyEventSignal().Connect( &callback3, &KeyEventCallback::Callback );
- dummy2.Add( dummy3 );
- DALI_TEST_CHECK( ! dummy3Impl.keyInputFocusGained );
- DALI_TEST_CHECK( ! dummy3Impl.keyInputFocusLost );
+ dummy3.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ KeyEventCallback callback3(false);
+ dummy3.KeyEventSignal().Connect(&callback3, &KeyEventCallback::Callback);
+ dummy2.Add(dummy3);
+ DALI_TEST_CHECK(!dummy3Impl.keyInputFocusGained);
+ DALI_TEST_CHECK(!dummy3Impl.keyInputFocusLost);
- manager.SetFocus( dummy3 );
- DALI_TEST_CHECK( dummy3Impl.keyInputFocusGained );
+ manager.SetFocus(dummy3);
+ DALI_TEST_CHECK(dummy3Impl.keyInputFocusGained);
- Integration::KeyEvent event( "a", "", "a", 0, 0, 0, Integration::KeyEvent::UP, "", "", Device::Class::TOUCH, Device::Subclass::NONE );
+ Integration::KeyEvent event("a", "", "a", 0, 0, 0, Integration::KeyEvent::UP, "", "", Device::Class::TOUCH, Device::Subclass::NONE);
application.ProcessEvent(event);
- DALI_TEST_CHECK( callback1.mIsCalled );
- DALI_TEST_CHECK( callback2.mIsCalled );
- DALI_TEST_CHECK( callback3.mIsCalled );
- DALI_TEST_CHECK( stageCallback.mIsCalled );
+ DALI_TEST_CHECK(callback1.mIsCalled);
+ DALI_TEST_CHECK(callback2.mIsCalled);
+ DALI_TEST_CHECK(callback3.mIsCalled);
+ DALI_TEST_CHECK(stageCallback.mIsCalled);
END_TEST;
}
int UtcDaliKeyInputFocusManagerKeyEventPropagation02(void)
{
-
ToolkitTestApplication application;
- Integration::Scene stage = application.GetScene();
+ Integration::Scene stage = application.GetScene();
tet_infoline("Test KeyEvent propagation. If focused control doesn't consume KeyEvent, KeyEvent will be recursively delivered to the control and its parents, until the event is consumed or the stage is reached. In this case, KeyEvent is delivered from dummy3 to dummy2");
DALI_TEST_CHECK(manager);
DummyControl dummy1 = DummyControl::New(true);
- dummy1.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
- KeyEventCallback callback1( false );
- dummy1.KeyEventSignal().Connect( &callback1, &KeyEventCallback::Callback );
- stage.Add( dummy1 );
+ dummy1.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ KeyEventCallback callback1(false);
+ dummy1.KeyEventSignal().Connect(&callback1, &KeyEventCallback::Callback);
+ stage.Add(dummy1);
DummyControl dummy2 = DummyControl::New(true);
- dummy2.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
- KeyEventCallback callback2( true );
- dummy2.KeyEventSignal().Connect( &callback2, &KeyEventCallback::Callback );
- dummy1.Add( dummy2 );
+ dummy2.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ KeyEventCallback callback2(true);
+ dummy2.KeyEventSignal().Connect(&callback2, &KeyEventCallback::Callback);
+ dummy1.Add(dummy2);
- DummyControl dummy3 = DummyControl::New(true);
+ DummyControl dummy3 = DummyControl::New(true);
Impl::DummyControl& dummy3Impl = static_cast<Impl::DummyControl&>(dummy3.GetImplementation());
- dummy3.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
- KeyEventCallback callback3( false );
- dummy3.KeyEventSignal().Connect( &callback3, &KeyEventCallback::Callback );
- dummy2.Add( dummy3 );
- DALI_TEST_CHECK( ! dummy3Impl.keyInputFocusGained );
- DALI_TEST_CHECK( ! dummy3Impl.keyInputFocusLost );
+ dummy3.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ KeyEventCallback callback3(false);
+ dummy3.KeyEventSignal().Connect(&callback3, &KeyEventCallback::Callback);
+ dummy2.Add(dummy3);
+ DALI_TEST_CHECK(!dummy3Impl.keyInputFocusGained);
+ DALI_TEST_CHECK(!dummy3Impl.keyInputFocusLost);
- manager.SetFocus( dummy3 );
- DALI_TEST_CHECK( dummy3Impl.keyInputFocusGained );
+ manager.SetFocus(dummy3);
+ DALI_TEST_CHECK(dummy3Impl.keyInputFocusGained);
- Integration::KeyEvent event( "a", "", "a", 0, 0, 0, Integration::KeyEvent::UP, "", "", Device::Class::TOUCH, Device::Subclass::NONE );
+ Integration::KeyEvent event("a", "", "a", 0, 0, 0, Integration::KeyEvent::UP, "", "", Device::Class::TOUCH, Device::Subclass::NONE);
application.ProcessEvent(event);
- DALI_TEST_CHECK( !callback1.mIsCalled );
- DALI_TEST_CHECK( callback2.mIsCalled );
- DALI_TEST_CHECK( callback3.mIsCalled );
+ DALI_TEST_CHECK(!callback1.mIsCalled);
+ DALI_TEST_CHECK(callback2.mIsCalled);
+ DALI_TEST_CHECK(callback3.mIsCalled);
END_TEST;
}
int UtcDaliKeyInputFocusManagerDispatchKeyEvents(void)
{
-
ToolkitTestApplication application;
- Integration::Scene stage = application.GetScene();
+ Integration::Scene stage = application.GetScene();
tet_infoline("Test KeyEvents propagation. If DISPATCH_KEY_EVENTS property is false, the KeyEvent is also not received.");
DALI_TEST_CHECK(manager);
DummyControl dummy1 = DummyControl::New(true);
- dummy1.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
- KeyEventCallback callback1( false );
- dummy1.KeyEventSignal().Connect( &callback1, &KeyEventCallback::Callback );
- stage.Add( dummy1 );
+ dummy1.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ KeyEventCallback callback1(false);
+ dummy1.KeyEventSignal().Connect(&callback1, &KeyEventCallback::Callback);
+ stage.Add(dummy1);
DummyControl dummy2 = DummyControl::New(true);
- dummy2.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
- KeyEventCallback callback2( false );
- dummy2.KeyEventSignal().Connect( &callback2, &KeyEventCallback::Callback );
+ dummy2.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ KeyEventCallback callback2(false);
+ dummy2.KeyEventSignal().Connect(&callback2, &KeyEventCallback::Callback);
// dummy2 set DISPATCH_KEY_EVENTS property to false.
- dummy2.SetProperty( Toolkit::DevelControl::Property::DISPATCH_KEY_EVENTS, false);
- dummy1.Add( dummy2 );
+ dummy2.SetProperty(Toolkit::DevelControl::Property::DISPATCH_KEY_EVENTS, false);
+ dummy1.Add(dummy2);
- DummyControl dummy3 = DummyControl::New(true);
+ DummyControl dummy3 = DummyControl::New(true);
Impl::DummyControl& dummy3Impl = static_cast<Impl::DummyControl&>(dummy3.GetImplementation());
- dummy3.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
- KeyEventCallback callback3( false );
- dummy3.KeyEventSignal().Connect( &callback3, &KeyEventCallback::Callback );
- dummy2.Add( dummy3 );
- DALI_TEST_CHECK( ! dummy3Impl.keyInputFocusGained );
- DALI_TEST_CHECK( ! dummy3Impl.keyInputFocusLost );
+ dummy3.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ KeyEventCallback callback3(false);
+ dummy3.KeyEventSignal().Connect(&callback3, &KeyEventCallback::Callback);
+ dummy2.Add(dummy3);
+ DALI_TEST_CHECK(!dummy3Impl.keyInputFocusGained);
+ DALI_TEST_CHECK(!dummy3Impl.keyInputFocusLost);
- manager.SetFocus( dummy3 );
- DALI_TEST_CHECK( dummy3Impl.keyInputFocusGained );
+ manager.SetFocus(dummy3);
+ DALI_TEST_CHECK(dummy3Impl.keyInputFocusGained);
- Integration::KeyEvent event( "a", "", "a", 0, 0, 0, Integration::KeyEvent::UP, "", "", Device::Class::TOUCH, Device::Subclass::NONE );
+ Integration::KeyEvent event("a", "", "a", 0, 0, 0, Integration::KeyEvent::UP, "", "", Device::Class::TOUCH, Device::Subclass::NONE);
application.ProcessEvent(event);
- DALI_TEST_CHECK( !callback1.mIsCalled );
- DALI_TEST_CHECK( !callback2.mIsCalled );
- DALI_TEST_CHECK( !callback3.mIsCalled );
+ DALI_TEST_CHECK(!callback1.mIsCalled);
+ DALI_TEST_CHECK(!callback2.mIsCalled);
+ DALI_TEST_CHECK(!callback3.mIsCalled);
END_TEST;
}
int UtcDaliKeyInputFocusManagerGetCurrentFocusControl(void)
{
ToolkitTestApplication application;
- Integration::Scene stage = application.GetScene();
+ Integration::Scene stage = application.GetScene();
tet_infoline(" Add 2 controls, check they each get focused. Re-focus the first control - ensure it's now got focus (check signals)");
KeyInputFocusManager manager = KeyInputFocusManager::Get();
DALI_TEST_CHECK(manager);
- DummyControl dummy1 = DummyControl::New(true);
+ DummyControl dummy1 = DummyControl::New(true);
Impl::DummyControl& dummy1Impl = static_cast<Impl::DummyControl&>(dummy1.GetImplementation());
- dummy1.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
- stage.Add( dummy1 );
- DALI_TEST_CHECK( ! dummy1Impl.keyInputFocusGained );
- DALI_TEST_CHECK( ! dummy1Impl.keyInputFocusLost );
+ dummy1.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ stage.Add(dummy1);
+ DALI_TEST_CHECK(!dummy1Impl.keyInputFocusGained);
+ DALI_TEST_CHECK(!dummy1Impl.keyInputFocusLost);
- DummyControl dummy2 = DummyControl::New(true);
+ DummyControl dummy2 = DummyControl::New(true);
Impl::DummyControl& dummy2Impl = static_cast<Impl::DummyControl&>(dummy2.GetImplementation());
- dummy2.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
- stage.Add( dummy2 );
- DALI_TEST_CHECK( ! dummy2Impl.keyInputFocusGained );
- DALI_TEST_CHECK( ! dummy2Impl.keyInputFocusLost );
+ dummy2.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ stage.Add(dummy2);
+ DALI_TEST_CHECK(!dummy2Impl.keyInputFocusGained);
+ DALI_TEST_CHECK(!dummy2Impl.keyInputFocusLost);
manager.SetFocus(dummy1);
- DALI_TEST_CHECK( dummy1 == manager.GetCurrentFocusControl() );
- DALI_TEST_CHECK( dummy1Impl.keyInputFocusGained );
- DALI_TEST_CHECK( ! dummy1Impl.keyInputFocusLost );
+ DALI_TEST_CHECK(dummy1 == manager.GetCurrentFocusControl());
+ DALI_TEST_CHECK(dummy1Impl.keyInputFocusGained);
+ DALI_TEST_CHECK(!dummy1Impl.keyInputFocusLost);
dummy1Impl.keyInputFocusGained = false;
- dummy1Impl.keyInputFocusLost = false;
+ dummy1Impl.keyInputFocusLost = false;
manager.SetFocus(dummy2);
- DALI_TEST_CHECK( dummy2 == manager.GetCurrentFocusControl() );
- DALI_TEST_CHECK( dummy1Impl.keyInputFocusLost );
- DALI_TEST_CHECK( dummy2Impl.keyInputFocusGained );
- DALI_TEST_CHECK( ! dummy1Impl.keyInputFocusGained );
- DALI_TEST_CHECK( ! dummy2Impl.keyInputFocusLost );
+ DALI_TEST_CHECK(dummy2 == manager.GetCurrentFocusControl());
+ DALI_TEST_CHECK(dummy1Impl.keyInputFocusLost);
+ DALI_TEST_CHECK(dummy2Impl.keyInputFocusGained);
+ DALI_TEST_CHECK(!dummy1Impl.keyInputFocusGained);
+ DALI_TEST_CHECK(!dummy2Impl.keyInputFocusLost);
// Reset signal received
dummy1Impl.keyInputFocusGained = false;
- dummy1Impl.keyInputFocusLost = false;
+ dummy1Impl.keyInputFocusLost = false;
dummy2Impl.keyInputFocusGained = false;
- dummy2Impl.keyInputFocusLost = false;
+ dummy2Impl.keyInputFocusLost = false;
manager.SetFocus(dummy1);
- DALI_TEST_CHECK( dummy1 == manager.GetCurrentFocusControl());
- DALI_TEST_CHECK( dummy1Impl.keyInputFocusGained );
- DALI_TEST_CHECK( dummy2Impl.keyInputFocusLost );
- DALI_TEST_CHECK( ! dummy1Impl.keyInputFocusLost );
- DALI_TEST_CHECK( ! dummy2Impl.keyInputFocusGained );
+ DALI_TEST_CHECK(dummy1 == manager.GetCurrentFocusControl());
+ DALI_TEST_CHECK(dummy1Impl.keyInputFocusGained);
+ DALI_TEST_CHECK(dummy2Impl.keyInputFocusLost);
+ DALI_TEST_CHECK(!dummy1Impl.keyInputFocusLost);
+ DALI_TEST_CHECK(!dummy2Impl.keyInputFocusGained);
END_TEST;
}
int UtcDaliKeyInputFocusManagerRemoveFocus(void)
{
ToolkitTestApplication application;
- Integration::Scene stage = application.GetScene();
+ Integration::Scene stage = application.GetScene();
tet_infoline(" Add focus controls. Test that removing focus from control which has focus. ");
KeyInputFocusManager manager = KeyInputFocusManager::Get();
DALI_TEST_CHECK(manager);
- DummyControl dummy1 = DummyControl::New(true);
+ DummyControl dummy1 = DummyControl::New(true);
Impl::DummyControl& dummy1Impl = static_cast<Impl::DummyControl&>(dummy1.GetImplementation());
- dummy1.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
- stage.Add( dummy1 );
- DALI_TEST_CHECK( ! dummy1Impl.keyInputFocusGained );
- DALI_TEST_CHECK( ! dummy1Impl.keyInputFocusLost );
+ dummy1.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ stage.Add(dummy1);
+ DALI_TEST_CHECK(!dummy1Impl.keyInputFocusGained);
+ DALI_TEST_CHECK(!dummy1Impl.keyInputFocusLost);
manager.SetFocus(dummy1);
DALI_TEST_CHECK(dummy1 == manager.GetCurrentFocusControl());
dummy1Impl.keyInputFocusGained = false;
- dummy1Impl.keyInputFocusLost = false;
+ dummy1Impl.keyInputFocusLost = false;
manager.RemoveFocus(dummy1);
DALI_TEST_CHECK(Control() == manager.GetCurrentFocusControl());
- DALI_TEST_CHECK( dummy1Impl.keyInputFocusLost );
- DALI_TEST_CHECK( ! dummy1Impl.keyInputFocusGained );
+ DALI_TEST_CHECK(dummy1Impl.keyInputFocusLost);
+ DALI_TEST_CHECK(!dummy1Impl.keyInputFocusGained);
END_TEST;
}
int UtcDaliKeyInputFocusManagerSignalKeyInputFocusChanged(void)
{
ToolkitTestApplication application;
- KeyInputFocusManager manager = KeyInputFocusManager::Get();
- Integration::Scene stage = application.GetScene();
+ KeyInputFocusManager manager = KeyInputFocusManager::Get();
+ Integration::Scene stage = application.GetScene();
tet_infoline(" UtcDaliKeyInputFocusManagerSignalKeyInputFocusChanged");
PushButton pushButton1 = PushButton::New();
PushButton pushButton2 = PushButton::New();
- stage.Add( pushButton1 );
- stage.Add( pushButton2 );
+ stage.Add(pushButton1);
+ stage.Add(pushButton2);
- PushButton gainActor, lostActor;
- KeyInputFocusChangedCallback callback( gainActor, lostActor );
- manager.KeyInputFocusChangedSignal().Connect( &callback, &KeyInputFocusChangedCallback::Callback );
+ PushButton gainActor, lostActor;
+ KeyInputFocusChangedCallback callback(gainActor, lostActor);
+ manager.KeyInputFocusChangedSignal().Connect(&callback, &KeyInputFocusChangedCallback::Callback);
manager.SetFocus(pushButton1);
- DALI_TEST_CHECK( gainActor == pushButton1 );
- DALI_TEST_CHECK( lostActor == Control() );
+ DALI_TEST_CHECK(gainActor == pushButton1);
+ DALI_TEST_CHECK(lostActor == Control());
gainActor.Reset();
lostActor.Reset();
manager.SetFocus(pushButton2);
- DALI_TEST_CHECK( gainActor == pushButton2 );
- DALI_TEST_CHECK( lostActor == pushButton1 );
+ DALI_TEST_CHECK(gainActor == pushButton2);
+ DALI_TEST_CHECK(lostActor == pushButton1);
gainActor.Reset();
lostActor.Reset();
// Removing the focus actor from the stage would also result in signal emission.
- stage.Remove( pushButton1 );
- stage.Remove( pushButton2 );
+ stage.Remove(pushButton1);
+ stage.Remove(pushButton2);
- DALI_TEST_CHECK( gainActor == Control() );
- DALI_TEST_CHECK( lostActor == Control() );
+ DALI_TEST_CHECK(gainActor == Control());
+ DALI_TEST_CHECK(lostActor == Control());
END_TEST;
}
int UtcDaliKeyInputFocusManagerSignalKeyInputFocusChangedforNewWindow(void)
{
ToolkitTestApplication application;
- KeyInputFocusManager manager = KeyInputFocusManager::Get();
+ KeyInputFocusManager manager = KeyInputFocusManager::Get();
tet_infoline(" UtcDaliKeyInputFocusManagerSignalKeyInputFocusChanged");
PushButton pushButton1 = PushButton::New();
PushButton pushButton2 = PushButton::New();
- Window window = Window::New(PositionSize(0,0,0,0) ,"", false);
- DALI_TEST_CHECK( window );
+ Window window = Window::New(PositionSize(0, 0, 0, 0), "", false);
+ DALI_TEST_CHECK(window);
- window.Add( pushButton1 );
- window.Add( pushButton2 );
+ window.Add(pushButton1);
+ window.Add(pushButton2);
- PushButton gainActor, lostActor;
- KeyInputFocusChangedCallback callback( gainActor, lostActor );
- manager.KeyInputFocusChangedSignal().Connect( &callback, &KeyInputFocusChangedCallback::Callback );
+ PushButton gainActor, lostActor;
+ KeyInputFocusChangedCallback callback(gainActor, lostActor);
+ manager.KeyInputFocusChangedSignal().Connect(&callback, &KeyInputFocusChangedCallback::Callback);
manager.SetFocus(pushButton1);
- DALI_TEST_CHECK( gainActor == pushButton1 );
- DALI_TEST_CHECK( lostActor == Control() );
+ DALI_TEST_CHECK(gainActor == pushButton1);
+ DALI_TEST_CHECK(lostActor == Control());
gainActor.Reset();
lostActor.Reset();
manager.SetFocus(pushButton2);
- DALI_TEST_CHECK( gainActor == pushButton2 );
- DALI_TEST_CHECK( lostActor == pushButton1 );
+ DALI_TEST_CHECK(gainActor == pushButton2);
+ DALI_TEST_CHECK(lostActor == pushButton1);
gainActor.Reset();
lostActor.Reset();
// Removing the focus actor from the window would also result in signal emission.
- window.Remove( pushButton1 );
- window.Remove( pushButton2 );
- DALI_TEST_CHECK( gainActor == Control() );
- DALI_TEST_CHECK( lostActor == Control() );
+ window.Remove(pushButton1);
+ window.Remove(pushButton2);
+ DALI_TEST_CHECK(gainActor == Control());
+ DALI_TEST_CHECK(lostActor == Control());
window.Reset();
END_TEST;
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
#include <stdlib.h>
+#include <iostream>
// Need to override adaptor classes for toolkit test harness, so include
// test harness headers before dali headers.
-#include <dali/devel-api/actors/actor-devel.h>
-#include <dali/integration-api/events/key-event-integ.h>
-#include <dali/integration-api/events/touch-event-integ.h>
-#include <dali/integration-api/events/wheel-event-integ.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
-#include <dali-toolkit/devel-api/focus-manager/keyboard-focus-manager-devel.h>
#include <dali-toolkit/devel-api/controls/control-devel.h>
#include <dali-toolkit/devel-api/controls/table-view/table-view.h>
+#include <dali-toolkit/devel-api/focus-manager/keyboard-focus-manager-devel.h>
+#include <dali/devel-api/actors/actor-devel.h>
+#include <dali/integration-api/events/key-event-integ.h>
+#include <dali/integration-api/events/touch-event-integ.h>
+#include <dali/integration-api/events/wheel-event-integ.h>
using namespace Dali;
using namespace Dali::Toolkit;
test_return_value = TET_PASS;
}
-
namespace
{
-
const std::string DEFAULT_DEVICE_NAME("hwKeyboard");
// Functors to test whether GetNextFocusableActor() method of CustomAlgorithmInterface is called when the keyboard focus is about to change
mInterfaceVerified = true;
- mCurrentFocusedActor = currentFocusedActor;
+ mCurrentFocusedActor = currentFocusedActor;
mProposedActorToFocus = proposedActorToFocus;
- mDirection = direction;
+ mDirection = direction;
return mProposedActorToFocus;
}
void Reset()
{
- mInterfaceVerified = false;
- mCurrentFocusedActor = Actor();
+ mInterfaceVerified = false;
+ mCurrentFocusedActor = Actor();
mProposedActorToFocus = Actor();
- mDirection = Control::KeyboardFocus::LEFT;
+ mDirection = Control::KeyboardFocus::LEFT;
}
- bool& mInterfaceVerified;
- Actor mCurrentFocusedActor;
- Actor mProposedActorToFocus;
+ bool& mInterfaceVerified;
+ Actor mCurrentFocusedActor;
+ Actor mProposedActorToFocus;
Control::KeyboardFocus::Direction mDirection;
};
mSignalVerified = true;
- mCurrentFocusedActor = currentFocusedActor;
+ mCurrentFocusedActor = currentFocusedActor;
mProposedActorToFocus = proposedActorToFocus;
- mDirection = direction;
+ mDirection = direction;
return mProposedActorToFocus;
}
void Reset()
{
- mSignalVerified = false;
- mCurrentFocusedActor = Actor();
+ mSignalVerified = false;
+ mCurrentFocusedActor = Actor();
mProposedActorToFocus = Actor();
- mDirection = Control::KeyboardFocus::LEFT;
+ mDirection = Control::KeyboardFocus::LEFT;
}
- bool& mSignalVerified;
- Actor mCurrentFocusedActor;
- Actor mProposedActorToFocus;
+ bool& mSignalVerified;
+ Actor mCurrentFocusedActor;
+ Actor mProposedActorToFocus;
Control::KeyboardFocus::Direction mDirection;
};
}
mOriginalFocusedActor = originalFocusedActor;
- mCurrentFocusedActor = currentFocusedActor;
+ mCurrentFocusedActor = currentFocusedActor;
}
void Reset()
mSignalVerified = true;
mCurrentFocusedActor = currentFocusedActor;
- mForward = forward;
+ mForward = forward;
}
void Reset()
bool& mSignalVerified;
Actor mCurrentFocusedActor;
- bool mForward;
+ bool mForward;
};
// Functors to test whether focused actor activated signal is emitted when the focused actor is activated
* Constructor
* @param[in] returnValue Set return value of KeyEvent callback.
* */
- KeyEventCallback( bool consumed )
- : mConsumed( consumed ),
- mIsCalled( false )
+ KeyEventCallback(bool consumed)
+ : mConsumed(consumed),
+ mIsCalled(false)
{
}
- bool Callback( Control control, const KeyEvent& keyEvent )
+ bool Callback(Control control, const KeyEvent& keyEvent)
{
mIsCalled = true;
return mConsumed;
}
- void Callback( const KeyEvent& keyEvent )
+ void Callback(const KeyEvent& keyEvent)
{
mIsCalled = true;
}
* Constructor
* @param[in] returnValue Set return value of WheelEvent callback.
* */
- WheelEventCallback( bool consumed )
- : mConsumed( consumed ),
- mIsCalled( false )
+ WheelEventCallback(bool consumed)
+ : mConsumed(consumed),
+ mIsCalled(false)
{
}
- bool Callback( Actor actor, const WheelEvent& wheelEvent )
+ bool Callback(Actor actor, const WheelEvent& wheelEvent)
{
mIsCalled = true;
return mConsumed;
}
- void Callback( const WheelEvent& wheelEvent )
+ void Callback(const WheelEvent& wheelEvent)
{
mIsCalled = true;
}
// Register Type
TypeInfo type;
- type = TypeRegistry::Get().GetTypeInfo( "KeyboardFocusManager" );
- DALI_TEST_CHECK( type );
+ type = TypeRegistry::Get().GetTypeInfo("KeyboardFocusManager");
+ DALI_TEST_CHECK(type);
BaseHandle handle = type.CreateInstance();
- DALI_TEST_CHECK( handle );
+ DALI_TEST_CHECK(handle);
KeyboardFocusManager manager;
// Create the first actor and add it to the stage
Actor first = Actor::New();
- first.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ first.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
application.GetScene().Add(first);
// Create the second actor and add it to the stage
Actor second = Actor::New();
- second.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ second.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
application.GetScene().Add(second);
// Create the third actor but don't add it to the stage
DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
// Make the third actor focusable
- third.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ third.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
// Check that the focus is successfully moved to the third actor
DALI_TEST_CHECK(manager.SetCurrentFocusActor(third) == true);
// Register Type
TypeInfo type;
- type = TypeRegistry::Get().GetTypeInfo( "KeyboardFocusManager" );
- DALI_TEST_CHECK( type );
+ type = TypeRegistry::Get().GetTypeInfo("KeyboardFocusManager");
+ DALI_TEST_CHECK(type);
BaseHandle handle = type.CreateInstance();
- DALI_TEST_CHECK( handle );
+ DALI_TEST_CHECK(handle);
KeyboardFocusManager manager = KeyboardFocusManager::Get();
DALI_TEST_CHECK(manager);
- bool preFocusChangeSignalVerified = false;
+ bool preFocusChangeSignalVerified = false;
PreFocusChangeCallback preFocusChangeCallback(preFocusChangeSignalVerified);
- manager.PreFocusChangeSignal().Connect( &preFocusChangeCallback, &PreFocusChangeCallback::Callback );
+ manager.PreFocusChangeSignal().Connect(&preFocusChangeCallback, &PreFocusChangeCallback::Callback);
- bool focusChangedSignalVerified = false;
+ bool focusChangedSignalVerified = false;
FocusChangedCallback focusChangedCallback(focusChangedSignalVerified);
- manager.FocusChangedSignal().Connect( &focusChangedCallback, &FocusChangedCallback::Callback );
+ manager.FocusChangedSignal().Connect(&focusChangedCallback, &FocusChangedCallback::Callback);
// Create the first actor and add it to the stage
Actor first = Actor::New();
- first.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ first.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
application.GetScene().Add(first);
// Create the second actor and add it to the stage
Actor second = Actor::New();
- second.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ second.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
application.GetScene().Add(second);
// Move the focus to the right
DALI_TEST_CHECK(!focusChangedCallback.mSignalVerified);
// Create a 2x2 table view and try to move focus inside it
- TableView tableView = TableView::New( 2, 2 );
+ TableView tableView = TableView::New(2, 2);
application.GetScene().Add(tableView);
// Create the third actor
Actor third = Actor::New();
- third.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ third.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
// Create the fourth actor
Actor fourth = Actor::New();
- fourth.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ fourth.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
// Add the four children to table view
tableView.AddChild(first, TableView::CellPosition(0, 0));
// Register Type
TypeInfo type;
- type = TypeRegistry::Get().GetTypeInfo( "KeyboardFocusManager" );
- DALI_TEST_CHECK( type );
+ type = TypeRegistry::Get().GetTypeInfo("KeyboardFocusManager");
+ DALI_TEST_CHECK(type);
BaseHandle handle = type.CreateInstance();
- DALI_TEST_CHECK( handle );
+ DALI_TEST_CHECK(handle);
KeyboardFocusManager manager = KeyboardFocusManager::Get();
DALI_TEST_CHECK(manager);
- bool preFocusChangeSignalVerified = false;
+ bool preFocusChangeSignalVerified = false;
PreFocusChangeCallback preFocusChangeCallback(preFocusChangeSignalVerified);
- manager.PreFocusChangeSignal().Connect( &preFocusChangeCallback, &PreFocusChangeCallback::Callback );
+ manager.PreFocusChangeSignal().Connect(&preFocusChangeCallback, &PreFocusChangeCallback::Callback);
- bool focusChangedSignalVerified = false;
+ bool focusChangedSignalVerified = false;
FocusChangedCallback focusChangedCallback(focusChangedSignalVerified);
- manager.FocusChangedSignal().Connect( &focusChangedCallback, &FocusChangedCallback::Callback );
+ manager.FocusChangedSignal().Connect(&focusChangedCallback, &FocusChangedCallback::Callback);
// Create the first actor and add it to the stage
Actor first = Actor::New();
- first.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ first.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
application.GetScene().Add(first);
// Create the second actor and add it to the stage
Actor second = Actor::New();
- second.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ second.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
application.GetScene().Add(second);
// Move the focus to the right
DALI_TEST_CHECK(preFocusChangeCallback.mDirection == Control::KeyboardFocus::RIGHT);
preFocusChangeCallback.Reset();
- bool customAlgorithmInterfaceVerified = false;
+ bool customAlgorithmInterfaceVerified = false;
CustomAlgorithm customAlgorithm(customAlgorithmInterfaceVerified);
Toolkit::DevelKeyboardFocusManager::SetCustomAlgorithm(manager, customAlgorithm);
// Register Type
TypeInfo type;
- type = TypeRegistry::Get().GetTypeInfo( "KeyboardFocusManager" );
- DALI_TEST_CHECK( type );
+ type = TypeRegistry::Get().GetTypeInfo("KeyboardFocusManager");
+ DALI_TEST_CHECK(type);
BaseHandle handle = type.CreateInstance();
- DALI_TEST_CHECK( handle );
+ DALI_TEST_CHECK(handle);
KeyboardFocusManager manager = KeyboardFocusManager::Get();
DALI_TEST_CHECK(manager);
- bool focusChangedSignalVerified = false;
+ bool focusChangedSignalVerified = false;
FocusChangedCallback focusChangedCallback(focusChangedSignalVerified);
- manager.FocusChangedSignal().Connect( &focusChangedCallback, &FocusChangedCallback::Callback );
+ manager.FocusChangedSignal().Connect(&focusChangedCallback, &FocusChangedCallback::Callback);
PushButton button1 = PushButton::New();
PushButton button2 = PushButton::New();
- button1.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
- button2.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ button1.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
+ button2.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
application.GetScene().Add(button1);
application.GetScene().Add(button2);
focusChangedCallback.Reset();
// set the navigation properties of button1
- button1.SetProperty(Toolkit::DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID, Property::Value((int)button2.GetProperty< int >( Actor::Property::ID )));
- button1.SetProperty(Toolkit::DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID, Property::Value((int)button2.GetProperty< int >( Actor::Property::ID )));
- button1.SetProperty(Toolkit::DevelControl::Property::UP_FOCUSABLE_ACTOR_ID, Property::Value((int)button2.GetProperty< int >( Actor::Property::ID )));
- button1.SetProperty(Toolkit::DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID, Property::Value((int)button2.GetProperty< int >( Actor::Property::ID )));
+ button1.SetProperty(Toolkit::DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID, Property::Value((int)button2.GetProperty<int>(Actor::Property::ID)));
+ button1.SetProperty(Toolkit::DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID, Property::Value((int)button2.GetProperty<int>(Actor::Property::ID)));
+ button1.SetProperty(Toolkit::DevelControl::Property::UP_FOCUSABLE_ACTOR_ID, Property::Value((int)button2.GetProperty<int>(Actor::Property::ID)));
+ button1.SetProperty(Toolkit::DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID, Property::Value((int)button2.GetProperty<int>(Actor::Property::ID)));
// set the navigation properties of button2
- button2.SetProperty(Toolkit::DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID, Property::Value((int)button1.GetProperty< int >( Actor::Property::ID )));
- button2.SetProperty(Toolkit::DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID, Property::Value((int)button1.GetProperty< int >( Actor::Property::ID )));
- button2.SetProperty(Toolkit::DevelControl::Property::UP_FOCUSABLE_ACTOR_ID, Property::Value((int)button1.GetProperty< int >( Actor::Property::ID )));
- button2.SetProperty(Toolkit::DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID, Property::Value((int)button1.GetProperty< int >( Actor::Property::ID )));
+ button2.SetProperty(Toolkit::DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID, Property::Value((int)button1.GetProperty<int>(Actor::Property::ID)));
+ button2.SetProperty(Toolkit::DevelControl::Property::RIGHT_FOCUSABLE_ACTOR_ID, Property::Value((int)button1.GetProperty<int>(Actor::Property::ID)));
+ button2.SetProperty(Toolkit::DevelControl::Property::UP_FOCUSABLE_ACTOR_ID, Property::Value((int)button1.GetProperty<int>(Actor::Property::ID)));
+ button2.SetProperty(Toolkit::DevelControl::Property::DOWN_FOCUSABLE_ACTOR_ID, Property::Value((int)button1.GetProperty<int>(Actor::Property::ID)));
// Move the focus towards left
DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::LEFT) == true);
// Confirm whether focus is moved to button2
- DALI_TEST_EQUALS(button2.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION );
+ DALI_TEST_EQUALS(button2.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION);
DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == button1);
DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == button2);
DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::RIGHT) == true);
// Confirm whether focus is moved to button1
- DALI_TEST_EQUALS(button1.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION );
+ DALI_TEST_EQUALS(button1.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION);
DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == button2);
DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == button1);
DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::UP) == true);
// Confirm whether focus is moved to button2
- DALI_TEST_EQUALS(button2.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION );
+ DALI_TEST_EQUALS(button2.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION);
DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == button1);
DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == button2);
DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::DOWN) == true);
// Confirm whether focus is moved to button1
- DALI_TEST_EQUALS(button1.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION );
+ DALI_TEST_EQUALS(button1.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION);
DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == button2);
DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == button1);
focusChangedCallback.Reset();
// Create a 1x1 table view and try to move focus inside it
- TableView tableView = TableView::New( 1, 1 );
+ TableView tableView = TableView::New(1, 1);
application.GetScene().Add(tableView);
PushButton button = PushButton::New();
- button.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ button.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
tableView.AddChild(button, TableView::CellPosition(0, 0));
// set the navigation properties of button3
- button.SetProperty(Toolkit::DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID, Property::Value((int)button1.GetProperty< int >( Actor::Property::ID )));
+ button.SetProperty(Toolkit::DevelControl::Property::LEFT_FOCUSABLE_ACTOR_ID, Property::Value((int)button1.GetProperty<int>(Actor::Property::ID)));
// Set the focus to the button
DALI_TEST_CHECK(manager.SetCurrentFocusActor(button) == true);
DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::LEFT) == true);
// Confirm whether focus is moved to button1
- DALI_TEST_EQUALS(button1.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION );
+ DALI_TEST_EQUALS(button1.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION);
DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == button);
DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == button1);
// Create the first actor and add it to the stage
Actor first = Actor::New();
- first.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ first.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
application.GetScene().Add(first);
// Create the second actor and add it to the stage
Actor second = Actor::New();
- second.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ second.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
application.GetScene().Add(second);
// Check that the focus is set on the first actor
// Create an actor with two child actors and add it to the stage
Actor parent = Actor::New();
- Actor child = Actor::New();
+ Actor child = Actor::New();
parent.Add(child);
application.GetScene().Add(parent);
END_TEST;
}
-
int UtcDaliKeyboardFocusManagerSignalFocusedActorActivated(void)
{
ToolkitTestApplication application;
KeyboardFocusManager manager = KeyboardFocusManager::Get();
DALI_TEST_CHECK(manager);
- bool focusedActorActivatedSignalVerified = false;
+ bool focusedActorActivatedSignalVerified = false;
FocusedActorActivatedCallback focusedActorActivatedCallback(focusedActorActivatedSignalVerified);
- manager.FocusedActorEnterKeySignal().Connect( &focusedActorActivatedCallback, &FocusedActorActivatedCallback::Callback );
+ manager.FocusedActorEnterKeySignal().Connect(&focusedActorActivatedCallback, &FocusedActorActivatedCallback::Callback);
- Integration::KeyEvent returnEvent( "Return", "", "", 0, 0, 0, Integration::KeyEvent::UP, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent returnEvent("Return", "", "", 0, 0, 0, Integration::KeyEvent::UP, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE);
// Press Any key to notice physical keyboard event is comming to KeyboardFocusManager
// It makes mIsFocusIndicatorEnabled true
// Create the first button and add it to the stage
PushButton firstPushButton = PushButton::New();
- firstPushButton.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ firstPushButton.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
application.GetScene().Add(firstPushButton);
// Create the second button and add it to the stage
PushButton secondPushButton = PushButton::New();
- secondPushButton.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ secondPushButton.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
application.GetScene().Add(secondPushButton);
// Check that the focus is set on the first button
// Register Type
TypeInfo type;
- type = TypeRegistry::Get().GetTypeInfo( "KeyboardFocusManager" );
- DALI_TEST_CHECK( type );
+ type = TypeRegistry::Get().GetTypeInfo("KeyboardFocusManager");
+ DALI_TEST_CHECK(type);
BaseHandle handle = type.CreateInstance();
- DALI_TEST_CHECK( handle );
+ DALI_TEST_CHECK(handle);
KeyboardFocusManager manager = KeyboardFocusManager::Get();
DALI_TEST_CHECK(manager);
- bool focusGroupChangedSignalVerified = false;
+ bool focusGroupChangedSignalVerified = false;
FocusGroupChangedCallback focusGroupChangedCallback(focusGroupChangedSignalVerified);
- manager.FocusGroupChangedSignal().Connect( &focusGroupChangedCallback, &FocusGroupChangedCallback::Callback );
+ manager.FocusGroupChangedSignal().Connect(&focusGroupChangedCallback, &FocusGroupChangedCallback::Callback);
- Integration::KeyEvent tabEvent( "Tab", "", "", 0, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
- Integration::KeyEvent shiftTabEvent( "Tab", "", "", 0, 1, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent tabEvent("Tab", "", "", 0, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE);
+ Integration::KeyEvent shiftTabEvent("Tab", "", "", 0, 1, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE);
// Press Any key to notice physical keyboard event is comming to KeyboardFocusManager
// It makes mIsFocusIndicatorEnabled true
ToolkitTestApplication application;
KeyboardFocusManager manager = KeyboardFocusManager::Get();
- DALI_TEST_CHECK( manager );
+ DALI_TEST_CHECK(manager);
ConnectionTracker* testTracker = new ConnectionTracker();
- DALI_TEST_EQUALS( true, manager.ConnectSignal( testTracker, "keyboardPreFocusChange", CallbackFunctor() ), TEST_LOCATION );
- DALI_TEST_EQUALS( true, manager.ConnectSignal( testTracker, "keyboardFocusChanged", CallbackFunctor() ), TEST_LOCATION );
- DALI_TEST_EQUALS( true, manager.ConnectSignal( testTracker, "keyboardFocusGroupChanged", CallbackFunctor() ), TEST_LOCATION );
- DALI_TEST_EQUALS( true, manager.ConnectSignal( testTracker, "keyboardFocusedActorEnterKey", CallbackFunctor() ), TEST_LOCATION );
+ DALI_TEST_EQUALS(true, manager.ConnectSignal(testTracker, "keyboardPreFocusChange", CallbackFunctor()), TEST_LOCATION);
+ DALI_TEST_EQUALS(true, manager.ConnectSignal(testTracker, "keyboardFocusChanged", CallbackFunctor()), TEST_LOCATION);
+ DALI_TEST_EQUALS(true, manager.ConnectSignal(testTracker, "keyboardFocusGroupChanged", CallbackFunctor()), TEST_LOCATION);
+ DALI_TEST_EQUALS(true, manager.ConnectSignal(testTracker, "keyboardFocusedActorEnterKey", CallbackFunctor()), TEST_LOCATION);
END_TEST;
}
// Create the first actor and add it to the stage
Actor first = Actor::New();
- first.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ first.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
application.GetScene().Add(first);
// Create the second actor and add it to the stage
Actor second = Actor::New();
- second.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ second.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
application.GetScene().Add(second);
// Create the third actor and add it to the stage
Actor third = Actor::New();
- third.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ third.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
application.GetScene().Add(third);
// Create the fourth actor and add it to the stage
Actor fourth = Actor::New();
- fourth.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ fourth.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
application.GetScene().Add(fourth);
// Check that the focus is set on the second actor
DALI_TEST_CHECK(manager.GetCurrentFocusActor() == third);
// Make history stack full
- for(int i = 0 ; i < 31 ; i ++)
+ for(int i = 0; i < 31; i++)
{
Actor actor = Actor::New();
- actor.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ actor.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
application.GetScene().Add(actor);
manager.SetCurrentFocusActor(actor);
}
- for(int i = 0 ; i < 31 ; i ++)
+ for(int i = 0; i < 31; i++)
{
manager.MoveFocusBackward();
}
KeyboardFocusManager manager = KeyboardFocusManager::Get();
DALI_TEST_CHECK(manager);
- bool preFocusChangeSignalVerified = false;
+ bool preFocusChangeSignalVerified = false;
PreFocusChangeCallback preFocusChangeCallback(preFocusChangeSignalVerified);
- manager.PreFocusChangeSignal().Connect( &preFocusChangeCallback, &PreFocusChangeCallback::Callback );
+ manager.PreFocusChangeSignal().Connect(&preFocusChangeCallback, &PreFocusChangeCallback::Callback);
- bool focusChangedSignalVerified = false;
+ bool focusChangedSignalVerified = false;
FocusChangedCallback focusChangedCallback(focusChangedSignalVerified);
- manager.FocusChangedSignal().Connect( &focusChangedCallback, &FocusChangedCallback::Callback );
+ manager.FocusChangedSignal().Connect(&focusChangedCallback, &FocusChangedCallback::Callback);
- Integration::KeyEvent leftEvent( "Left", "", "", 0, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
- Integration::KeyEvent rightEvent( "Right", "", "", 0, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
- Integration::KeyEvent upEvent( "Up", "", "", 0, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
- Integration::KeyEvent downEvent( "Down", "", "", 0, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
- Integration::KeyEvent pageUpEvent( "Prior", "", "", 0, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
- Integration::KeyEvent pageDownEvent( "Next", "", "", 0, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent leftEvent("Left", "", "", 0, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE);
+ Integration::KeyEvent rightEvent("Right", "", "", 0, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE);
+ Integration::KeyEvent upEvent("Up", "", "", 0, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE);
+ Integration::KeyEvent downEvent("Down", "", "", 0, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE);
+ Integration::KeyEvent pageUpEvent("Prior", "", "", 0, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE);
+ Integration::KeyEvent pageDownEvent("Next", "", "", 0, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE);
// Press Any key to notice physical keyboard event is comming to KeyboardFocusManager
// It makes mIsFocusIndicatorEnabled true
application.ProcessEvent(leftEvent);
// Create a 2x2 table view and try to move focus inside it
- TableView tableView = TableView::New( 2, 2 );
+ TableView tableView = TableView::New(2, 2);
application.GetScene().Add(tableView);
// Create the first actor
Actor first = Actor::New();
- first.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ first.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
// Create the second actor
Actor second = Actor::New();
- second.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ second.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
// Create the third actor
Actor third = Actor::New();
- third.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ third.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
// Create the fourth actor
Actor fourth = Actor::New();
- fourth.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ fourth.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
// Add the four children to table view
tableView.AddChild(first, TableView::CellPosition(0, 0));
KeyboardFocusManager manager = KeyboardFocusManager::Get();
DALI_TEST_CHECK(manager);
- bool preFocusChangeSignalVerified = false;
+ bool preFocusChangeSignalVerified = false;
PreFocusChangeCallback preFocusChangeCallback(preFocusChangeSignalVerified);
- manager.PreFocusChangeSignal().Connect( &preFocusChangeCallback, &PreFocusChangeCallback::Callback );
+ manager.PreFocusChangeSignal().Connect(&preFocusChangeCallback, &PreFocusChangeCallback::Callback);
- Integration::KeyEvent spaceEvent( "space", "", "", 0, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent spaceEvent("space", "", "", 0, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE);
// Press Any key to notice physical keyboard event is comming to KeyboardFocusManager
// It makes mIsFocusIndicatorEnabled true
END_TEST;
}
-
-
int UtcDaliKeyboardFocusManagerMoveFocusTestStateChange(void)
{
ToolkitTestApplication application;
// Register Type
TypeInfo type;
- type = TypeRegistry::Get().GetTypeInfo( "KeyboardFocusManager" );
- DALI_TEST_CHECK( type );
+ type = TypeRegistry::Get().GetTypeInfo("KeyboardFocusManager");
+ DALI_TEST_CHECK(type);
BaseHandle handle = type.CreateInstance();
- DALI_TEST_CHECK( handle );
+ DALI_TEST_CHECK(handle);
KeyboardFocusManager manager = KeyboardFocusManager::Get();
DALI_TEST_CHECK(manager);
- bool preFocusChangeSignalVerified = false;
+ bool preFocusChangeSignalVerified = false;
PreFocusChangeCallback preFocusChangeCallback(preFocusChangeSignalVerified);
- manager.PreFocusChangeSignal().Connect( &preFocusChangeCallback, &PreFocusChangeCallback::Callback );
+ manager.PreFocusChangeSignal().Connect(&preFocusChangeCallback, &PreFocusChangeCallback::Callback);
- bool focusChangedSignalVerified = false;
+ bool focusChangedSignalVerified = false;
FocusChangedCallback focusChangedCallback(focusChangedSignalVerified);
- manager.FocusChangedSignal().Connect( &focusChangedCallback, &FocusChangedCallback::Callback );
+ manager.FocusChangedSignal().Connect(&focusChangedCallback, &FocusChangedCallback::Callback);
// Create the first actor and add it to the stage
Control first = Control::New();
- first.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ first.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
application.GetScene().Add(first);
// Create the second actor and add it to the stage
Control second = Control::New();
- second.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ second.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
application.GetScene().Add(second);
// Move the focus to the right
DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == Actor());
DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == first);
- DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION );
+ DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION);
focusChangedCallback.Reset();
// Move the focus towards right
DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == first);
DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == second);
- DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
- DALI_TEST_EQUALS(second.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION );
+ DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION);
+ DALI_TEST_EQUALS(second.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION);
focusChangedCallback.Reset();
// Move the focus towards up
DALI_TEST_CHECK(!focusChangedCallback.mSignalVerified);
// Create a 2x2 table view and try to move focus inside it
- TableView tableView = TableView::New( 2, 2 );
+ TableView tableView = TableView::New(2, 2);
application.GetScene().Add(tableView);
// Create the third actor
Control third = Control::New();
- third.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ third.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
// Create the fourth actor
Control fourth = Control::New();
- fourth.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ fourth.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
// Add the four children to table view
tableView.AddChild(first, TableView::CellPosition(0, 0));
DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == second);
DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == first);
- DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION );
- DALI_TEST_EQUALS(second.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
+ DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION);
+ DALI_TEST_EQUALS(second.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION);
focusChangedCallback.Reset();
DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == first);
DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == second);
- DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
- DALI_TEST_EQUALS(second.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION );
+ DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION);
+ DALI_TEST_EQUALS(second.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION);
focusChangedCallback.Reset();
DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == second);
DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == fourth);
- DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
- DALI_TEST_EQUALS(second.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
- DALI_TEST_EQUALS(third.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
- DALI_TEST_EQUALS(fourth.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION );
+ DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION);
+ DALI_TEST_EQUALS(second.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION);
+ DALI_TEST_EQUALS(third.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION);
+ DALI_TEST_EQUALS(fourth.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION);
focusChangedCallback.Reset();
DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == fourth);
DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == third);
- DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
- DALI_TEST_EQUALS(second.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
- DALI_TEST_EQUALS(third.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION );
- DALI_TEST_EQUALS(fourth.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
+ DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION);
+ DALI_TEST_EQUALS(second.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION);
+ DALI_TEST_EQUALS(third.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION);
+ DALI_TEST_EQUALS(fourth.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION);
focusChangedCallback.Reset();
DALI_TEST_CHECK(focusChangedCallback.mSignalVerified);
DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == third);
DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == first);
- DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION );
- DALI_TEST_EQUALS(second.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
- DALI_TEST_EQUALS(third.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
- DALI_TEST_EQUALS(fourth.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
+ DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION);
+ DALI_TEST_EQUALS(second.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION);
+ DALI_TEST_EQUALS(third.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION);
+ DALI_TEST_EQUALS(fourth.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION);
focusChangedCallback.Reset();
// Move the focus towards left. The focus move will fail as no way to move it upwards
DALI_TEST_CHECK(preFocusChangeCallback.mCurrentFocusedActor == first);
DALI_TEST_CHECK(preFocusChangeCallback.mProposedActorToFocus == Actor());
DALI_TEST_CHECK(preFocusChangeCallback.mDirection == Control::KeyboardFocus::LEFT);
- DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION );
- DALI_TEST_EQUALS(second.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
- DALI_TEST_EQUALS(third.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
- DALI_TEST_EQUALS(fourth.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
+ DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION);
+ DALI_TEST_EQUALS(second.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION);
+ DALI_TEST_EQUALS(third.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION);
+ DALI_TEST_EQUALS(fourth.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION);
preFocusChangeCallback.Reset();
DALI_TEST_CHECK(!focusChangedCallback.mSignalVerified);
DALI_TEST_CHECK(focusChangedCallback.mOriginalFocusedActor == first);
DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == fourth);
- DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
- DALI_TEST_EQUALS(second.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
- DALI_TEST_EQUALS(third.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
- DALI_TEST_EQUALS(fourth.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION );
+ DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION);
+ DALI_TEST_EQUALS(second.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION);
+ DALI_TEST_EQUALS(third.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION);
+ DALI_TEST_EQUALS(fourth.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::FOCUSED, TEST_LOCATION);
focusChangedCallback.Reset();
// Clear the focus
manager.ClearFocus();
- DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
- DALI_TEST_EQUALS(second.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
- DALI_TEST_EQUALS(third.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
- DALI_TEST_EQUALS(fourth.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION );
-
+ DALI_TEST_EQUALS(first.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION);
+ DALI_TEST_EQUALS(second.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION);
+ DALI_TEST_EQUALS(third.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION);
+ DALI_TEST_EQUALS(fourth.GetProperty<int>(DevelControl::Property::STATE), (int)DevelControl::NORMAL, TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- tet_infoline( "Ensure we cannot set an actor to be focused if it is not staged and that we do not retrieve an actor if it has been unstaged" );
+ tet_infoline("Ensure we cannot set an actor to be focused if it is not staged and that we do not retrieve an actor if it has been unstaged");
KeyboardFocusManager manager = KeyboardFocusManager::Get();
- DALI_TEST_CHECK( ! manager.GetCurrentFocusActor() );
+ DALI_TEST_CHECK(!manager.GetCurrentFocusActor());
Actor actor = Actor::New();
- actor.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true );
+ actor.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
- tet_infoline( "Attempt to set unstaged actor, no actor should be returned from KeyboardFocusManager" );
- manager.SetCurrentFocusActor( actor );
- DALI_TEST_CHECK( ! manager.GetCurrentFocusActor() );
+ tet_infoline("Attempt to set unstaged actor, no actor should be returned from KeyboardFocusManager");
+ manager.SetCurrentFocusActor(actor);
+ DALI_TEST_CHECK(!manager.GetCurrentFocusActor());
- tet_infoline( "Add actor to stage and attempt to set, our actor should be returned from KeyboardFocusManager" );
- application.GetScene().Add( actor );
- manager.SetCurrentFocusActor( actor );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor() == actor );
+ tet_infoline("Add actor to stage and attempt to set, our actor should be returned from KeyboardFocusManager");
+ application.GetScene().Add(actor);
+ manager.SetCurrentFocusActor(actor);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor() == actor);
- tet_infoline( "Remove actor from stage and attempt to retrieve, no actor should be returned from KeyboardFocusManager" );
+ tet_infoline("Remove actor from stage and attempt to retrieve, no actor should be returned from KeyboardFocusManager");
actor.Unparent();
- DALI_TEST_CHECK( ! manager.GetCurrentFocusActor() );
+ DALI_TEST_CHECK(!manager.GetCurrentFocusActor());
END_TEST;
}
{
ToolkitTestApplication application;
- tet_infoline( "Ensure we cannot set an actor to be focused if it is not staged and that we do not retrieve an actor if it has been unstaged" );
+ tet_infoline("Ensure we cannot set an actor to be focused if it is not staged and that we do not retrieve an actor if it has been unstaged");
KeyboardFocusManager manager = KeyboardFocusManager::Get();
- DALI_TEST_CHECK( ! manager.GetCurrentFocusActor() );
+ DALI_TEST_CHECK(!manager.GetCurrentFocusActor());
Actor actor = Actor::New();
- actor.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true );
- application.GetScene().Add( actor );
- manager.SetCurrentFocusActor( actor );
+ actor.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
+ application.GetScene().Add(actor);
+ manager.SetCurrentFocusActor(actor);
// Press Any key to notice physical keyboard event is comming to KeyboardFocusManager
// It makes mIsFocusIndicatorEnabled true and add focus indicator to focused actor.
- Integration::KeyEvent rightEvent( "Right", "", "", 0, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent rightEvent("Right", "", "", 0, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE);
application.ProcessEvent(rightEvent);
Actor indicatorActor = manager.GetFocusIndicatorActor();
- tet_infoline( "Indicator is added to focused actor" );
- DALI_TEST_CHECK( actor == indicatorActor.GetParent() );
+ tet_infoline("Indicator is added to focused actor");
+ DALI_TEST_CHECK(actor == indicatorActor.GetParent());
Dali::Toolkit::DevelKeyboardFocusManager::EnableFocusIndicator(manager, false);
- DALI_TEST_CHECK( !Dali::Toolkit::DevelKeyboardFocusManager::IsFocusIndicatorEnabled(manager) );
+ DALI_TEST_CHECK(!Dali::Toolkit::DevelKeyboardFocusManager::IsFocusIndicatorEnabled(manager));
- tet_infoline( "Indicator is removed from focused actor because mUseFocusIndicator is false" );
- DALI_TEST_CHECK( !indicatorActor.GetParent() );
+ tet_infoline("Indicator is removed from focused actor because mUseFocusIndicator is false");
+ DALI_TEST_CHECK(!indicatorActor.GetParent());
END_TEST;
}
{
ToolkitTestApplication application;
- tet_infoline( "Ensure Window can't receive KeyEvent when Control already consumed it" );
+ tet_infoline("Ensure Window can't receive KeyEvent when Control already consumed it");
Dali::Integration::Scene scene = application.GetScene();
KeyboardFocusManager manager = KeyboardFocusManager::Get();
- DALI_TEST_CHECK( ! manager.GetCurrentFocusActor() );
+ DALI_TEST_CHECK(!manager.GetCurrentFocusActor());
// Create the first actor and add it to the stage
Control control = Control::New();
- control.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ control.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
scene.Add(control);
- KeyEventCallback controlCallback( true );
- control.KeyEventSignal().Connect( &controlCallback, &KeyEventCallback::Callback );
+ KeyEventCallback controlCallback(true);
+ control.KeyEventSignal().Connect(&controlCallback, &KeyEventCallback::Callback);
- KeyEventCallback sceneCallback( false );
- scene.KeyEventSignal().Connect( &sceneCallback, &KeyEventCallback::Callback );
+ KeyEventCallback sceneCallback(false);
+ scene.KeyEventSignal().Connect(&sceneCallback, &KeyEventCallback::Callback);
- manager.SetCurrentFocusActor( control );
+ manager.SetCurrentFocusActor(control);
// Press Any key to notice physical keyboard event is comming to KeyboardFocusManager
// It makes mIsFocusIndicatorEnabled true and add focus indicator to focused actor.
- Integration::KeyEvent event1( "Right", "", "", 0, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent event1("Right", "", "", 0, 0, 0, Integration::KeyEvent::DOWN, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE);
application.ProcessEvent(event1);
- DALI_TEST_CHECK( controlCallback.mIsCalled );
- DALI_TEST_CHECK( !sceneCallback.mIsCalled );
+ DALI_TEST_CHECK(controlCallback.mIsCalled);
+ DALI_TEST_CHECK(!sceneCallback.mIsCalled);
END_TEST;
}
{
ToolkitTestApplication application;
- tet_infoline( "Ensure Memory focus actors for each window ");
+ tet_infoline("Ensure Memory focus actors for each window ");
KeyboardFocusManager manager = KeyboardFocusManager::Get();
- DALI_TEST_CHECK( ! manager.GetCurrentFocusActor() );
+ DALI_TEST_CHECK(!manager.GetCurrentFocusActor());
- Window firstWindow = Window::New(PositionSize(0,0,300,500) ,"", false);
- DALI_TEST_CHECK( firstWindow );
+ Window firstWindow = Window::New(PositionSize(0, 0, 300, 500), "", false);
+ DALI_TEST_CHECK(firstWindow);
Control first = Control::New();
- first.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ first.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
firstWindow.Add(first);
- Window secondWindow = Window::New(PositionSize(0,0,400,600) ,"", false);
- DALI_TEST_CHECK( secondWindow );
+ Window secondWindow = Window::New(PositionSize(0, 0, 400, 600), "", false);
+ DALI_TEST_CHECK(secondWindow);
Control second = Control::New();
- second.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
- secondWindow.Add( second );
+ second.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
+ secondWindow.Add(second);
DALI_TEST_CHECK(manager.SetCurrentFocusActor(first) == true);
DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
firstWindow.Raise();
DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
- secondWindow.Remove( second );
+ secondWindow.Remove(second);
secondWindow.Raise();
DALI_TEST_CHECK(manager.GetCurrentFocusActor() != second);
// Register Type
TypeInfo type;
- type = TypeRegistry::Get().GetTypeInfo( "KeyboardFocusManager" );
- DALI_TEST_CHECK( type );
+ type = TypeRegistry::Get().GetTypeInfo("KeyboardFocusManager");
+ DALI_TEST_CHECK(type);
BaseHandle handle = type.CreateInstance();
- DALI_TEST_CHECK( handle );
+ DALI_TEST_CHECK(handle);
KeyboardFocusManager manager = KeyboardFocusManager::Get();
DALI_TEST_CHECK(manager);
- bool focusChangedSignalVerified = false;
+ bool focusChangedSignalVerified = false;
FocusChangedCallback focusChangedCallback(focusChangedSignalVerified);
- manager.FocusChangedSignal().Connect( &focusChangedCallback, &FocusChangedCallback::Callback );
+ manager.FocusChangedSignal().Connect(&focusChangedCallback, &FocusChangedCallback::Callback);
PushButton button1 = PushButton::New();
PushButton button2 = PushButton::New();
button4.SetProperty(Actor::Property::SIZE, Vector2(50, 50));
button5.SetProperty(Actor::Property::SIZE, Vector2(50, 50));
- button1.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE,true);
- button2.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE,true);
- button3.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE,true);
- button4.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE,true);
- button5.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE,true);
+ button1.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
+ button2.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
+ button3.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
+ button4.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
+ button5.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
application.GetScene().Add(button1);
application.GetScene().Add(button2);
// without set the navigation properties, but we can focus move
// enable the default algorithm
Dali::Toolkit::DevelKeyboardFocusManager::EnableDefaultAlgorithm(manager, true);
- DALI_TEST_CHECK( Dali::Toolkit::DevelKeyboardFocusManager::IsDefaultAlgorithmEnabled(manager) );
+ DALI_TEST_CHECK(Dali::Toolkit::DevelKeyboardFocusManager::IsDefaultAlgorithmEnabled(manager));
// Move the focus towards right
// button1 -- [button2]
DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == button1);
focusChangedCallback.Reset();
-
// Move the focus towards left. The focus move will fail as no way to move it upwards
DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::LEFT) == false);
END_TEST;
}
-
int UtcDaliKeyboardFocusManagerSetAndGetCurrentFocusActorInTouchMode(void)
{
ToolkitTestApplication application;
// Create the first actor and add it to the stage
Actor first = Actor::New();
- first.SetProperty(Actor::Property::SIZE, Vector2( 50, 50 ));
+ first.SetProperty(Actor::Property::SIZE, Vector2(50, 50));
first.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 0.0f));
first.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
- first.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE,true);
- first.SetProperty(DevelActor::Property::TOUCH_FOCUSABLE,true);
+ first.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
+ first.SetProperty(DevelActor::Property::TOUCH_FOCUSABLE, true);
application.GetScene().Add(first);
// Create the second actor and add it to the stage
Actor second = Actor::New();
- second.SetProperty(Actor::Property::SIZE, Vector2( 50, 50 ));
+ second.SetProperty(Actor::Property::SIZE, Vector2(50, 50));
second.SetProperty(Actor::Property::POSITION, Vector2(100.0f, 0.0f));
second.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
- second.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE,true);
+ second.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
application.GetScene().Add(second);
// flush the queue and render once
// Check that it will fail to set focus on an invalid actor
DALI_TEST_CHECK(manager.SetCurrentFocusActor(Actor()) == false);
-
Dali::Integration::TouchEvent event1 = Dali::Integration::TouchEvent();
- Dali::Integration::Point pointDown1;
- pointDown1.SetState( PointState::DOWN );
+ Dali::Integration::Point pointDown1;
+ pointDown1.SetState(PointState::DOWN);
pointDown1.SetDeviceId(1);
// touch first actor
- pointDown1.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
+ pointDown1.SetScreenPosition(Vector2(10.0f, 10.0f));
event1.AddPoint(pointDown1);
- application.ProcessEvent( event1 );
+ application.ProcessEvent(event1);
// flush the queue and render once
application.SendNotification();
DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
Dali::Integration::TouchEvent event2 = Dali::Integration::TouchEvent();
- Dali::Integration::Point pointDown2;
- pointDown2.SetState( PointState::DOWN );
+ Dali::Integration::Point pointDown2;
+ pointDown2.SetState(PointState::DOWN);
pointDown2.SetDeviceId(1);
// touch second actor
- pointDown2.SetScreenPosition( Vector2( 110.0f, 10.0f ) );
+ pointDown2.SetScreenPosition(Vector2(110.0f, 10.0f));
event2.AddPoint(pointDown2);
- application.ProcessEvent( event2 );
+ application.ProcessEvent(event2);
// flush the queue and render once
application.SendNotification();
DALI_TEST_CHECK(manager.GetCurrentFocusActor() == Actor());
// Make the second actor focusableInTouchMode
- second.SetProperty( DevelActor::Property::TOUCH_FOCUSABLE,true);
+ second.SetProperty(DevelActor::Property::TOUCH_FOCUSABLE, true);
// touch second actor
- application.ProcessEvent( event2 );
+ application.ProcessEvent(event2);
// flush the queue and render once
application.SendNotification();
// Register Type
TypeInfo type;
- type = TypeRegistry::Get().GetTypeInfo( "KeyboardFocusManager" );
- DALI_TEST_CHECK( type );
+ type = TypeRegistry::Get().GetTypeInfo("KeyboardFocusManager");
+ DALI_TEST_CHECK(type);
BaseHandle handle = type.CreateInstance();
- DALI_TEST_CHECK( handle );
+ DALI_TEST_CHECK(handle);
KeyboardFocusManager manager = KeyboardFocusManager::Get();
DALI_TEST_CHECK(manager);
- bool focusChangedSignalVerified = false;
+ bool focusChangedSignalVerified = false;
FocusChangedCallback focusChangedCallback(focusChangedSignalVerified);
- manager.FocusChangedSignal().Connect( &focusChangedCallback, &FocusChangedCallback::Callback );
+ manager.FocusChangedSignal().Connect(&focusChangedCallback, &FocusChangedCallback::Callback);
PushButton button1 = PushButton::New();
PushButton button2 = PushButton::New();
button1.SetProperty(Actor::Property::SIZE, Vector2(50, 50));
button2.SetProperty(Actor::Property::SIZE, Vector2(50, 50));
- button1.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE,true);
- button2.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE,true);
+ button1.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
+ button2.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
application.GetScene().Add(button1);
application.GetScene().Add(button2);
// without set the navigation properties, but we can focus move
// enable the default algorithm
Dali::Toolkit::DevelKeyboardFocusManager::EnableDefaultAlgorithm(manager, true);
- DALI_TEST_CHECK( Dali::Toolkit::DevelKeyboardFocusManager::IsDefaultAlgorithmEnabled(manager) );
+ DALI_TEST_CHECK(Dali::Toolkit::DevelKeyboardFocusManager::IsDefaultAlgorithmEnabled(manager));
// Move the focus towards right
// button1 -- [button2]
// disable the default algorithm
Dali::Toolkit::DevelKeyboardFocusManager::EnableDefaultAlgorithm(manager, false);
- DALI_TEST_CHECK( !Dali::Toolkit::DevelKeyboardFocusManager::IsDefaultAlgorithmEnabled(manager) );
+ DALI_TEST_CHECK(!Dali::Toolkit::DevelKeyboardFocusManager::IsDefaultAlgorithmEnabled(manager));
// Move the focus towards left, The focus move will fail because the default algorithm is disabled.
DALI_TEST_CHECK(manager.MoveFocus(Control::KeyboardFocus::LEFT) == false);
// enable the default algorithm
Dali::Toolkit::DevelKeyboardFocusManager::EnableDefaultAlgorithm(manager, true);
- DALI_TEST_CHECK( Dali::Toolkit::DevelKeyboardFocusManager::IsDefaultAlgorithmEnabled(manager) );
+ DALI_TEST_CHECK(Dali::Toolkit::DevelKeyboardFocusManager::IsDefaultAlgorithmEnabled(manager));
// Move the focus towards left, The focus move will success because the default algorithm is enabled.
// [button1] -- button2
DALI_TEST_CHECK(focusChangedCallback.mCurrentFocusedActor == button1);
focusChangedCallback.Reset();
-
END_TEST;
}
-
int UtcDaliKeyboardFocusManagerWithKeyboardFocusableChildren(void)
{
ToolkitTestApplication application;
// Create the first actor and add it to the stage
Actor first = Actor::New();
- first.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true);
+ first.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
application.GetScene().Add(first);
// Create the second actor and add it to the first actor.
Actor second = Actor::New();
- second.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true);
+ second.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
first.Add(second);
// Check that no actor is being focused yet.
DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
// Set KeyboardFocusableChildren false.
- first.SetProperty( DevelActor::Property::KEYBOARD_FOCUSABLE_CHILDREN, false);
+ first.SetProperty(DevelActor::Property::KEYBOARD_FOCUSABLE_CHILDREN, false);
// Check that it will fail to set focus on the second actor as it's not focusable
DALI_TEST_CHECK(manager.SetCurrentFocusActor(second) == false);
DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
// Set KeyboardFocusableChildren true.
- first.SetProperty( DevelActor::Property::KEYBOARD_FOCUSABLE_CHILDREN, true);
+ first.SetProperty(DevelActor::Property::KEYBOARD_FOCUSABLE_CHILDREN, true);
// Check that the focus is set on the second actor
DALI_TEST_CHECK(manager.SetCurrentFocusActor(second) == true);
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliKeyboardFocusManagerCheckWheelEvent" );
+ tet_infoline("UtcDaliKeyboardFocusManagerCheckWheelEvent");
Dali::Integration::Scene scene = application.GetScene();
KeyboardFocusManager manager = KeyboardFocusManager::Get();
- DALI_TEST_CHECK( ! manager.GetCurrentFocusActor() );
+ DALI_TEST_CHECK(!manager.GetCurrentFocusActor());
// Create the first actor and add it to the stage
Actor parent = Actor::New();
- parent.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ parent.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
Actor child = Actor::New();
- child.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE,true);
+ child.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
parent.Add(child);
scene.Add(parent);
- WheelEventCallback childCallback( false );
- child.WheelEventSignal().Connect( &childCallback, &WheelEventCallback::Callback );
+ WheelEventCallback childCallback(false);
+ child.WheelEventSignal().Connect(&childCallback, &WheelEventCallback::Callback);
- WheelEventCallback parentCallback( true );
- parent.WheelEventSignal().Connect( &parentCallback, &WheelEventCallback::Callback );
+ WheelEventCallback parentCallback(true);
+ parent.WheelEventSignal().Connect(&parentCallback, &WheelEventCallback::Callback);
- WheelEventCallback sceneCallback( false );
- scene.WheelEventSignal().Connect( &sceneCallback, &WheelEventCallback::Callback );
+ WheelEventCallback sceneCallback(false);
+ scene.WheelEventSignal().Connect(&sceneCallback, &WheelEventCallback::Callback);
- manager.SetCurrentFocusActor( child );
+ manager.SetCurrentFocusActor(child);
// Emit custom wheel event is comming to KeyboardFocusManager
Integration::WheelEvent event(Integration::WheelEvent::CUSTOM_WHEEL, 0, 0u, Vector2(0.0f, 0.0f), 1, 1000u);
application.ProcessEvent(event);
- DALI_TEST_CHECK( childCallback.mIsCalled );
- DALI_TEST_CHECK( parentCallback.mIsCalled );
- DALI_TEST_CHECK( !sceneCallback.mIsCalled );
+ DALI_TEST_CHECK(childCallback.mIsCalled);
+ DALI_TEST_CHECK(parentCallback.mIsCalled);
+ DALI_TEST_CHECK(!sceneCallback.mIsCalled);
END_TEST;
-}
\ No newline at end of file
+}
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
-#include <stdlib.h>
-#include <sstream>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/controls/magnifier/magnifier.h>
+#include <stdlib.h>
+#include <iostream>
+#include <sstream>
using namespace Dali;
using namespace Toolkit;
ToolkitTestApplication application;
Magnifier magnifier;
- DALI_TEST_CHECK( !magnifier );
+ DALI_TEST_CHECK(!magnifier);
magnifier = Magnifier::New();
- DALI_TEST_CHECK( magnifier );
+ DALI_TEST_CHECK(magnifier);
- application.GetScene().Add( magnifier );
+ application.GetScene().Add(magnifier);
application.SendNotification();
application.Render();
ToolkitTestApplication application;
Magnifier view = Magnifier::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- Magnifier copy( view );
- DALI_TEST_CHECK( copy == view );
+ Magnifier copy(view);
+ DALI_TEST_CHECK(copy == view);
Magnifier assign;
- DALI_TEST_CHECK( !assign );
+ DALI_TEST_CHECK(!assign);
assign = view;
- DALI_TEST_CHECK( assign == view );
+ DALI_TEST_CHECK(assign == view);
// Self assignment
assign = assign;
- DALI_TEST_CHECK( assign );
- DALI_TEST_CHECK( assign == view );
+ DALI_TEST_CHECK(assign);
+ DALI_TEST_CHECK(assign == view);
END_TEST;
}
ToolkitTestApplication application;
BaseHandle view = Magnifier::New();
- DALI_TEST_CHECK( Magnifier::DownCast( view ) );
+ DALI_TEST_CHECK(Magnifier::DownCast(view));
BaseHandle empty;
- DALI_TEST_CHECK( ! Magnifier::DownCast( empty ) );
+ DALI_TEST_CHECK(!Magnifier::DownCast(empty));
BaseHandle another = Actor::New();
- DALI_TEST_CHECK( ! Magnifier::DownCast( another ) );
+ DALI_TEST_CHECK(!Magnifier::DownCast(another));
END_TEST;
}
ToolkitTestApplication application;
TypeRegistry typeRegistry = TypeRegistry::Get();
- DALI_TEST_CHECK( typeRegistry );
+ DALI_TEST_CHECK(typeRegistry);
- TypeInfo typeInfo = typeRegistry.GetTypeInfo( "Magnifier" );
- DALI_TEST_CHECK( typeInfo );
+ TypeInfo typeInfo = typeRegistry.GetTypeInfo("Magnifier");
+ DALI_TEST_CHECK(typeInfo);
BaseHandle handle = typeInfo.CreateInstance();
- DALI_TEST_CHECK( handle );
+ DALI_TEST_CHECK(handle);
- Magnifier view = Magnifier::DownCast( handle );
- DALI_TEST_CHECK( view );
+ Magnifier view = Magnifier::DownCast(handle);
+ DALI_TEST_CHECK(view);
END_TEST;
}
Integration::Scene stage = application.GetScene();
Magnifier view = Magnifier::New();
- stage.Add( view );
+ stage.Add(view);
application.SendNotification();
application.Render();
RenderTaskList renderTaskList = stage.GetRenderTaskList();
- DALI_TEST_CHECK( renderTaskList.GetTaskCount() > 1 );
+ DALI_TEST_CHECK(renderTaskList.GetTaskCount() > 1);
Actor actor = Actor::New();
- stage.Add( actor );
- DALI_TEST_CHECK( stage.GetRenderTaskList().GetTask( 1 ).GetSourceActor() != actor );
+ stage.Add(actor);
+ DALI_TEST_CHECK(stage.GetRenderTaskList().GetTask(1).GetSourceActor() != actor);
- view.SetSourceActor( actor );
+ view.SetSourceActor(actor);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( stage.GetRenderTaskList().GetTask( 1 ).GetSourceActor(), actor, TEST_LOCATION );
+ DALI_TEST_EQUALS(stage.GetRenderTaskList().GetTask(1).GetSourceActor(), actor, TEST_LOCATION);
END_TEST;
}
try
{
- view.SetSourceActor( Actor::New() );
- DALI_TEST_CHECK( false ); // should not get here
+ view.SetSourceActor(Actor::New());
+ DALI_TEST_CHECK(false); // should not get here
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
Integration::Scene stage = application.GetScene();
Magnifier view = Magnifier::New();
- stage.Add( view );
+ stage.Add(view);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::FRAME_VISIBILITY ).Get< bool >(), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(view.GetProperty(Magnifier::Property::FRAME_VISIBILITY).Get<bool>(), true, TEST_LOCATION);
- view.SetProperty( Magnifier::Property::FRAME_VISIBILITY, false );
- DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::FRAME_VISIBILITY ).Get< bool >(), false, TEST_LOCATION );
+ view.SetProperty(Magnifier::Property::FRAME_VISIBILITY, false);
+ DALI_TEST_EQUALS(view.GetProperty(Magnifier::Property::FRAME_VISIBILITY).Get<bool>(), false, TEST_LOCATION);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::FRAME_VISIBILITY ).Get< bool >(), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(view.GetProperty(Magnifier::Property::FRAME_VISIBILITY).Get<bool>(), false, TEST_LOCATION);
- view.SetProperty( Magnifier::Property::FRAME_VISIBILITY, true );
- DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::FRAME_VISIBILITY ).Get< bool >(), true, TEST_LOCATION );
+ view.SetProperty(Magnifier::Property::FRAME_VISIBILITY, true);
+ DALI_TEST_EQUALS(view.GetProperty(Magnifier::Property::FRAME_VISIBILITY).Get<bool>(), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::FRAME_VISIBILITY ).Get< bool >(), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(view.GetProperty(Magnifier::Property::FRAME_VISIBILITY).Get<bool>(), true, TEST_LOCATION);
END_TEST;
}
Integration::Scene stage = application.GetScene();
Magnifier view = Magnifier::New();
- stage.Add( view );
+ stage.Add(view);
application.SendNotification();
application.Render();
- float magnificationFactor( 200.0f );
+ float magnificationFactor(200.0f);
- DALI_TEST_CHECK( view.GetProperty( Magnifier::Property::MAGNIFICATION_FACTOR ).Get< float >() != magnificationFactor );
+ DALI_TEST_CHECK(view.GetProperty(Magnifier::Property::MAGNIFICATION_FACTOR).Get<float>() != magnificationFactor);
- view.SetProperty( Magnifier::Property::MAGNIFICATION_FACTOR, magnificationFactor );
- DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::MAGNIFICATION_FACTOR ).Get< float >(), magnificationFactor, TEST_LOCATION );
+ view.SetProperty(Magnifier::Property::MAGNIFICATION_FACTOR, magnificationFactor);
+ DALI_TEST_EQUALS(view.GetProperty(Magnifier::Property::MAGNIFICATION_FACTOR).Get<float>(), magnificationFactor, TEST_LOCATION);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::MAGNIFICATION_FACTOR ).Get< float >(), magnificationFactor, TEST_LOCATION );
+ DALI_TEST_EQUALS(view.GetProperty(Magnifier::Property::MAGNIFICATION_FACTOR).Get<float>(), magnificationFactor, TEST_LOCATION);
- view.SetProperty( Magnifier::Property::MAGNIFICATION_FACTOR, 1.0f );
- DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::MAGNIFICATION_FACTOR ).Get< float >(), 1.0f, TEST_LOCATION );
+ view.SetProperty(Magnifier::Property::MAGNIFICATION_FACTOR, 1.0f);
+ DALI_TEST_EQUALS(view.GetProperty(Magnifier::Property::MAGNIFICATION_FACTOR).Get<float>(), 1.0f, TEST_LOCATION);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::MAGNIFICATION_FACTOR ).Get< float >(), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(view.GetProperty(Magnifier::Property::MAGNIFICATION_FACTOR).Get<float>(), 1.0f, TEST_LOCATION);
END_TEST;
}
Integration::Scene stage = application.GetScene();
Magnifier view = Magnifier::New();
- stage.Add( view );
+ stage.Add(view);
application.SendNotification();
application.Render();
- Vector3 position( 100.0f, 200.0f, 300.0f );
+ Vector3 position(100.0f, 200.0f, 300.0f);
- DALI_TEST_CHECK( view.GetProperty( Magnifier::Property::SOURCE_POSITION ).Get< Vector3 >() != position );
+ DALI_TEST_CHECK(view.GetProperty(Magnifier::Property::SOURCE_POSITION).Get<Vector3>() != position);
- view.SetProperty( Magnifier::Property::SOURCE_POSITION, position );
+ view.SetProperty(Magnifier::Property::SOURCE_POSITION, position);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::SOURCE_POSITION ).Get< Vector3 >(), position, TEST_LOCATION );
+ DALI_TEST_EQUALS(view.GetProperty(Magnifier::Property::SOURCE_POSITION).Get<Vector3>(), position, TEST_LOCATION);
- view.SetProperty( Magnifier::Property::SOURCE_POSITION, Vector3::ONE );
+ view.SetProperty(Magnifier::Property::SOURCE_POSITION, Vector3::ONE);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( view.GetProperty( Magnifier::Property::SOURCE_POSITION ).Get< Vector3 >(), Vector3::ONE, TEST_LOCATION );
+ DALI_TEST_EQUALS(view.GetProperty(Magnifier::Property::SOURCE_POSITION).Get<Vector3>(), Vector3::ONE, TEST_LOCATION);
END_TEST;
}
Magnifier view = Magnifier::New();
- application.GetScene().Add( view );
+ application.GetScene().Add(view);
application.SendNotification();
application.Render();
- Vector3 size( 200.0f, 300.0f, 0.0f );
- view.SetProperty( Actor::Property::SIZE, size );
+ Vector3 size(200.0f, 300.0f, 0.0f);
+ view.SetProperty(Actor::Property::SIZE, size);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( view.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), size, TEST_LOCATION );
+ DALI_TEST_EQUALS(view.GetCurrentProperty<Vector3>(Actor::Property::SIZE), size, TEST_LOCATION);
END_TEST;
}
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
-#include <stdlib.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/public-api/controls/model3d-view/model3d-view.h>
-
+#include <stdlib.h>
+#include <iostream>
using namespace Dali;
using namespace Dali::Toolkit;
-
void model_view_startup(void)
{
test_return_value = TET_UNDEF;
namespace
{
-const char* TEST_OBJ_FILE_NAME = TEST_RESOURCE_DIR "/Cube.obj";
-const char* TEST_MTL_FILE_NAME = TEST_RESOURCE_DIR "/ToyRobot-Metal.mtl";
+const char* TEST_OBJ_FILE_NAME = TEST_RESOURCE_DIR "/Cube.obj";
+const char* TEST_MTL_FILE_NAME = TEST_RESOURCE_DIR "/ToyRobot-Metal.mtl";
const char* TEST_RESOURCE_LOCATION = TEST_RESOURCE_DIR "/";
-}
+} // namespace
// Negative test case for a method
int UtcDaliModelViewUninitialized(void)
{
// New() must be called to create a Model3dView or it wont be valid.
Actor a = Actor::New();
- view.Add( a );
- DALI_TEST_CHECK( false );
+ view.Add(a);
+ DALI_TEST_CHECK(false);
}
- catch (Dali::DaliException& e)
+ catch(Dali::DaliException& e)
{
// Tests that a negative test of an assertion succeeds
- DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_PRINT_ASSERT(e);
DALI_TEST_CHECK(!view);
}
END_TEST;
tet_infoline(" UtcDaliModel3dViewNew");
Toolkit::Model3dView view = Toolkit::Model3dView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- Toolkit::Model3dView view2 = Toolkit::Model3dView::New("","","");
- DALI_TEST_CHECK( view2 );
+ Toolkit::Model3dView view2 = Toolkit::Model3dView::New("", "", "");
+ DALI_TEST_CHECK(view2);
END_TEST;
}
tet_infoline(" UtcDaliModelViewDownCast");
Toolkit::Model3dView view = Toolkit::Model3dView::New();
- BaseHandle handle(view);
+ BaseHandle handle(view);
- Toolkit::Model3dView modelView = Toolkit::Model3dView::DownCast( handle );
- DALI_TEST_CHECK( view );
- DALI_TEST_CHECK( modelView );
- DALI_TEST_CHECK( modelView == view );
+ Toolkit::Model3dView modelView = Toolkit::Model3dView::DownCast(handle);
+ DALI_TEST_CHECK(view);
+ DALI_TEST_CHECK(modelView);
+ DALI_TEST_CHECK(modelView == view);
END_TEST;
}
-
// Positive test case for a method
int UtcDaliModelViewPropertyNames(void)
{
tet_infoline(" UtcDaliModel3dViewPropertyNames");
Toolkit::Model3dView view = Toolkit::Model3dView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- view.SetProperty( Model3dView::Property::GEOMETRY_URL, Dali::Property::Value( TEST_OBJ_FILE_NAME ) );
- Property::Value val = view.GetProperty( Model3dView::Property::GEOMETRY_URL );
- std::string obj_file_name;
- DALI_TEST_CHECK( val.Get( obj_file_name ) );
- DALI_TEST_EQUALS( obj_file_name, TEST_OBJ_FILE_NAME, TEST_LOCATION );
+ view.SetProperty(Model3dView::Property::GEOMETRY_URL, Dali::Property::Value(TEST_OBJ_FILE_NAME));
+ Property::Value val = view.GetProperty(Model3dView::Property::GEOMETRY_URL);
+ std::string obj_file_name;
+ DALI_TEST_CHECK(val.Get(obj_file_name));
+ DALI_TEST_EQUALS(obj_file_name, TEST_OBJ_FILE_NAME, TEST_LOCATION);
- view.SetProperty( Model3dView::Property::MATERIAL_URL, Dali::Property::Value( TEST_MTL_FILE_NAME ) );
- val = view.GetProperty( Model3dView::Property::MATERIAL_URL );
- DALI_TEST_CHECK( val.Get( obj_file_name ) );
- DALI_TEST_EQUALS( obj_file_name, TEST_MTL_FILE_NAME, TEST_LOCATION );
+ view.SetProperty(Model3dView::Property::MATERIAL_URL, Dali::Property::Value(TEST_MTL_FILE_NAME));
+ val = view.GetProperty(Model3dView::Property::MATERIAL_URL);
+ DALI_TEST_CHECK(val.Get(obj_file_name));
+ DALI_TEST_EQUALS(obj_file_name, TEST_MTL_FILE_NAME, TEST_LOCATION);
- view.SetProperty( Model3dView::Property::IMAGES_URL, Dali::Property::Value( TEST_RESOURCE_LOCATION ) );
- val = view.GetProperty( Model3dView::Property::IMAGES_URL );
- DALI_TEST_CHECK( val.Get( obj_file_name ) );
- DALI_TEST_EQUALS( obj_file_name, TEST_RESOURCE_LOCATION, TEST_LOCATION );
+ view.SetProperty(Model3dView::Property::IMAGES_URL, Dali::Property::Value(TEST_RESOURCE_LOCATION));
+ val = view.GetProperty(Model3dView::Property::IMAGES_URL);
+ DALI_TEST_CHECK(val.Get(obj_file_name));
+ DALI_TEST_EQUALS(obj_file_name, TEST_RESOURCE_LOCATION, TEST_LOCATION);
application.GetScene().Add(view);
tet_infoline(" UtcDaliModel3dViewAddRemove");
Toolkit::Model3dView view = Toolkit::Model3dView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Actor actor = Actor::New();
- DALI_TEST_CHECK( !actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
-
+ DALI_TEST_CHECK(!actor.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE));
- view.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- view.SetProperty( Actor::Property::SIZE, application.GetScene().GetSize());
+ view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ view.SetProperty(Actor::Property::SIZE, application.GetScene().GetSize());
view.Add(actor);
application.GetScene().Add(view);
- DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
+ DALI_TEST_CHECK(actor.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE));
view.Remove(actor);
- DALI_TEST_CHECK( !actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
+ DALI_TEST_CHECK(!actor.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE));
END_TEST;
}
-
int UtcDaliModelCopyAndAssignment(void)
{
ToolkitTestApplication application;
Model3dView view = Toolkit::Model3dView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- Model3dView copy( view );
- DALI_TEST_CHECK( view == copy );
+ Model3dView copy(view);
+ DALI_TEST_CHECK(view == copy);
Model3dView assign;
- DALI_TEST_CHECK( ! assign );
+ DALI_TEST_CHECK(!assign);
assign = copy;
- DALI_TEST_CHECK( assign == view );
+ DALI_TEST_CHECK(assign == view);
END_TEST;
}
ToolkitTestApplication application;
Model3dView view = Toolkit::Model3dView::New();
- DALI_TEST_EQUALS( 1, view.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- view.SetProperty( Actor::Property::SENSITIVE, false );
- DALI_TEST_CHECK( false == view.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+ DALI_TEST_EQUALS(1, view.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ view.SetProperty(Actor::Property::SENSITIVE, false);
+ DALI_TEST_CHECK(false == view.GetProperty<bool>(Actor::Property::SENSITIVE));
- Model3dView moved = std::move( view );
- 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( !view );
+ Model3dView moved = std::move(view);
+ 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(!view);
END_TEST;
}
ToolkitTestApplication application;
Model3dView view = Toolkit::Model3dView::New();
- DALI_TEST_EQUALS( 1, view.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- view.SetProperty( Actor::Property::SENSITIVE, false );
- DALI_TEST_CHECK( false == view.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+ DALI_TEST_EQUALS(1, view.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ view.SetProperty(Actor::Property::SENSITIVE, false);
+ DALI_TEST_CHECK(false == view.GetProperty<bool>(Actor::Property::SENSITIVE));
Model3dView moved;
- moved = std::move( view );
- 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( !view );
+ moved = std::move(view);
+ 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(!view);
END_TEST;
}
ToolkitTestApplication application;
TypeRegistry typeRegistry = TypeRegistry::Get();
- DALI_TEST_CHECK( typeRegistry );
+ DALI_TEST_CHECK(typeRegistry);
- TypeInfo typeInfo = typeRegistry.GetTypeInfo( "Model3dView" );
- DALI_TEST_CHECK( typeInfo );
+ TypeInfo typeInfo = typeRegistry.GetTypeInfo("Model3dView");
+ DALI_TEST_CHECK(typeInfo);
BaseHandle handle = typeInfo.CreateInstance();
- DALI_TEST_CHECK( handle );
+ DALI_TEST_CHECK(handle);
- Model3dView view = Model3dView::DownCast( handle );
- DALI_TEST_CHECK( view );
+ Model3dView view = Model3dView::DownCast(handle);
+ DALI_TEST_CHECK(view);
END_TEST;
}
Model3dView view = Toolkit::Model3dView::New();
- application.GetScene().Add( view );
+ application.GetScene().Add(view);
application.SendNotification();
application.Render();
- Vector3 size( 200.0f, 300.0f, 0.0f );
- view.SetProperty( Actor::Property::SIZE, size );
+ Vector3 size(200.0f, 300.0f, 0.0f);
+ view.SetProperty(Actor::Property::SIZE, size);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( view.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), size, TEST_LOCATION );
+ DALI_TEST_EQUALS(view.GetCurrentProperty<Vector3>(Actor::Property::SIZE), size, TEST_LOCATION);
END_TEST;
}
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
* limitations under the License.
*/
-#include <iostream>
-#include <stdlib.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/utility/npatch-utilities.h>
+#include <stdlib.h>
+#include <iostream>
using namespace Dali;
using namespace Dali::Toolkit;
namespace
{
-
-void InitialiseRegionsToZeroAlpha( Dali::Devel::PixelBuffer pixelBuffer, uint32_t width, uint32_t height, Pixel::Format pixelFormat )
+void InitialiseRegionsToZeroAlpha(Dali::Devel::PixelBuffer pixelBuffer, uint32_t width, uint32_t height, Pixel::Format pixelFormat)
{
- unsigned char* buffer = pixelBuffer.GetBuffer();
- uint32_t bytesPerPixel = GetBytesPerPixel( pixelFormat );
+ unsigned char* buffer = pixelBuffer.GetBuffer();
+ uint32_t bytesPerPixel = GetBytesPerPixel(pixelFormat);
- for( uint32_t row = 0; row < width; ++row )
+ for(uint32_t row = 0; row < width; ++row)
{
- uint32_t pixelOffset = row * bytesPerPixel;
- buffer[ pixelOffset + 3 ] = 0x00;
- pixelOffset += ( height - 1 ) * width * bytesPerPixel;
- buffer[ pixelOffset + 3 ] = 0x00;
+ uint32_t pixelOffset = row * bytesPerPixel;
+ buffer[pixelOffset + 3] = 0x00;
+ pixelOffset += (height - 1) * width * bytesPerPixel;
+ buffer[pixelOffset + 3] = 0x00;
}
- for( unsigned int column = 0; column < height; ++column )
+ for(unsigned int column = 0; column < height; ++column)
{
- uint32_t pixelOffset = column * width * bytesPerPixel;
- buffer[ pixelOffset + 3 ] = 0x00;
- pixelOffset += ( width -1 ) * bytesPerPixel;
- buffer[ pixelOffset + 3 ] = 0x00;
+ uint32_t pixelOffset = column * width * bytesPerPixel;
+ buffer[pixelOffset + 3] = 0x00;
+ pixelOffset += (width - 1) * bytesPerPixel;
+ buffer[pixelOffset + 3] = 0x00;
}
}
-void AddStretchRegionsToImage( Dali::Devel::PixelBuffer pixelBuffer, uint32_t width, uint32_t height, const Vector4& requiredStretchBorder, Pixel::Format pixelFormat )
+void AddStretchRegionsToImage(Dali::Devel::PixelBuffer pixelBuffer, uint32_t width, uint32_t height, const Vector4& requiredStretchBorder, Pixel::Format pixelFormat)
{
- unsigned char* buffer = pixelBuffer.GetBuffer();
- uint32_t bytesPerPixel = GetBytesPerPixel( pixelFormat );
+ unsigned char* buffer = pixelBuffer.GetBuffer();
+ uint32_t bytesPerPixel = GetBytesPerPixel(pixelFormat);
- for( uint32_t column = requiredStretchBorder.x; column < width - requiredStretchBorder.z; ++column )
+ for(uint32_t column = requiredStretchBorder.x; column < width - requiredStretchBorder.z; ++column)
{
- uint32_t pixelOffset = column * bytesPerPixel;
- buffer[ pixelOffset ] = 0x00;
- buffer[ pixelOffset + 1 ] = 0x00;
- buffer[ pixelOffset + 2 ] = 0x00;
- buffer[ pixelOffset + 3 ] = 0xFF;
+ uint32_t pixelOffset = column * bytesPerPixel;
+ buffer[pixelOffset] = 0x00;
+ buffer[pixelOffset + 1] = 0x00;
+ buffer[pixelOffset + 2] = 0x00;
+ buffer[pixelOffset + 3] = 0xFF;
}
- for( uint32_t row = requiredStretchBorder.y; row < height - requiredStretchBorder.w; ++row )
+ for(uint32_t row = requiredStretchBorder.y; row < height - requiredStretchBorder.w; ++row)
{
unsigned int pixelOffset = row * width * bytesPerPixel;
- buffer[ pixelOffset ] = 0x00;
- buffer[ pixelOffset + 1 ] = 0x00;
- buffer[ pixelOffset + 2 ] = 0x00;
- buffer[ pixelOffset + 3 ] = 0xFF;
+ buffer[pixelOffset] = 0x00;
+ buffer[pixelOffset + 1] = 0x00;
+ buffer[pixelOffset + 2] = 0x00;
+ buffer[pixelOffset + 3] = 0xFF;
}
}
-Dali::Devel::PixelBuffer CustomizeNPatch( uint32_t width, uint32_t height, const Vector4& requiredStretchBorder )
+Dali::Devel::PixelBuffer CustomizeNPatch(uint32_t width, uint32_t height, const Vector4& requiredStretchBorder)
{
- Pixel::Format pixelFormat = Pixel::RGBA8888;
- Dali::Devel::PixelBuffer pixelBuffer = Dali::Devel::PixelBuffer::New( width, height, pixelFormat );
+ Pixel::Format pixelFormat = Pixel::RGBA8888;
+ Dali::Devel::PixelBuffer pixelBuffer = Dali::Devel::PixelBuffer::New(width, height, pixelFormat);
unsigned char* buffer = pixelBuffer.GetBuffer();
- memset( buffer, 0, width * height * Dali::Pixel::GetBytesPerPixel( pixelFormat ) );
+ memset(buffer, 0, width * height * Dali::Pixel::GetBytesPerPixel(pixelFormat));
- InitialiseRegionsToZeroAlpha( pixelBuffer, width, height, pixelFormat );
+ InitialiseRegionsToZeroAlpha(pixelBuffer, width, height, pixelFormat);
- AddStretchRegionsToImage( pixelBuffer, width, height, requiredStretchBorder, pixelFormat );
+ AddStretchRegionsToImage(pixelBuffer, width, height, requiredStretchBorder, pixelFormat);
return pixelBuffer;
}
tet_infoline("UtcDaliNPatchUtilityGetRedOffsetAndMask");
int32_t byteOffset = 0;
- int32_t bitMask = 0;
+ int32_t bitMask = 0;
- NPatchUtility::GetRedOffsetAndMask( Pixel::A8, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::L8, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::LA88, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask(Pixel::A8, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::L8, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::LA88, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
- NPatchUtility::GetRedOffsetAndMask( Pixel::RGB888, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0xff );
- NPatchUtility::GetRedOffsetAndMask( Pixel::RGB8888, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0xff );
- NPatchUtility::GetRedOffsetAndMask( Pixel::RGBA8888, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0xff );
+ NPatchUtility::GetRedOffsetAndMask(Pixel::RGB888, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0xff);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::RGB8888, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0xff);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::RGBA8888, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0xff);
- NPatchUtility::GetRedOffsetAndMask( Pixel::BGR8888, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 2 && bitMask == 0xff );
- NPatchUtility::GetRedOffsetAndMask( Pixel::BGRA8888, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 2 && bitMask == 0xff );
+ NPatchUtility::GetRedOffsetAndMask(Pixel::BGR8888, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 2 && bitMask == 0xff);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::BGRA8888, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 2 && bitMask == 0xff);
- NPatchUtility::GetRedOffsetAndMask( Pixel::RGB565, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0xf8 );
+ NPatchUtility::GetRedOffsetAndMask(Pixel::RGB565, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0xf8);
- NPatchUtility::GetRedOffsetAndMask( Pixel::BGR565, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 1 && bitMask == 0x1f );
+ NPatchUtility::GetRedOffsetAndMask(Pixel::BGR565, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 1 && bitMask == 0x1f);
- NPatchUtility::GetRedOffsetAndMask( Pixel::RGBA4444, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0xf0 );
+ NPatchUtility::GetRedOffsetAndMask(Pixel::RGBA4444, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0xf0);
- NPatchUtility::GetRedOffsetAndMask( Pixel::BGRA4444, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 1 && bitMask == 0xf0 );
+ NPatchUtility::GetRedOffsetAndMask(Pixel::BGRA4444, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 1 && bitMask == 0xf0);
- NPatchUtility::GetRedOffsetAndMask( Pixel::RGBA5551, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0xf8 );
+ NPatchUtility::GetRedOffsetAndMask(Pixel::RGBA5551, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0xf8);
- NPatchUtility::GetRedOffsetAndMask( Pixel::BGRA5551, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 1 && bitMask == 0x1e );
+ NPatchUtility::GetRedOffsetAndMask(Pixel::BGRA5551, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 1 && bitMask == 0x1e);
// Compressed formats are not supported
- NPatchUtility::GetRedOffsetAndMask( Pixel::INVALID, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_R11_EAC, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SIGNED_R11_EAC, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RG11_EAC, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SIGNED_RG11_EAC, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGB8_ETC2, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ETC2, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGB8_ETC1, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGB_PVRTC_4BPPV1, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA8_ETC2_EAC, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_4x4_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_5x4_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_5x5_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_6x5_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_6x6_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_8x5_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_8x6_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_8x8_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_10x5_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_10x6_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_10x8_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_10x10_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_12x10_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_12x12_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask(Pixel::INVALID, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_R11_EAC, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_SIGNED_R11_EAC, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_RG11_EAC, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_SIGNED_RG11_EAC, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_RGB8_ETC2, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_SRGB8_ETC2, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_RGB8_ETC1, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_RGB_PVRTC_4BPPV1, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_RGBA8_ETC2_EAC, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_RGBA_ASTC_4x4_KHR, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_RGBA_ASTC_5x4_KHR, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_RGBA_ASTC_5x5_KHR, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_RGBA_ASTC_6x5_KHR, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_RGBA_ASTC_6x6_KHR, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_RGBA_ASTC_8x5_KHR, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_RGBA_ASTC_8x6_KHR, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_RGBA_ASTC_8x8_KHR, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_RGBA_ASTC_10x5_KHR, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_RGBA_ASTC_10x6_KHR, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_RGBA_ASTC_10x8_KHR, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_RGBA_ASTC_10x10_KHR, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_RGBA_ASTC_12x10_KHR, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_RGBA_ASTC_12x12_KHR, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
// Not supported
- NPatchUtility::GetRedOffsetAndMask( Pixel::RGB16F, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- NPatchUtility::GetRedOffsetAndMask( Pixel::RGB32F, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask(Pixel::RGB16F, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ NPatchUtility::GetRedOffsetAndMask(Pixel::RGB32F, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
END_TEST;
}
* cccc
*/
- const unsigned int imageHeight = 18;
- const unsigned int imageWidth = 28;
- const Vector4 requiredStretchBorder( 3, 4, 5, 6 );
+ const unsigned int imageHeight = 18;
+ const unsigned int imageWidth = 28;
+ const Vector4 requiredStretchBorder(3, 4, 5, 6);
- Dali::Devel::PixelBuffer pixelBuffer = CustomizeNPatch( imageHeight, imageWidth, requiredStretchBorder );
- DALI_TEST_CHECK( pixelBuffer );
+ Dali::Devel::PixelBuffer pixelBuffer = CustomizeNPatch(imageHeight, imageWidth, requiredStretchBorder);
+ DALI_TEST_CHECK(pixelBuffer);
- if( pixelBuffer )
- {
- NPatchUtility::StretchRanges stretchPixelsX;
- NPatchUtility::StretchRanges stretchPixelsY;
+ if(pixelBuffer)
+ {
+ NPatchUtility::StretchRanges stretchPixelsX;
+ NPatchUtility::StretchRanges stretchPixelsY;
- NPatchUtility::ParseBorders( pixelBuffer, stretchPixelsX, stretchPixelsY );
+ NPatchUtility::ParseBorders(pixelBuffer, stretchPixelsX, stretchPixelsY);
- DALI_TEST_CHECK( stretchPixelsX.Size() == 1 );
- DALI_TEST_CHECK( stretchPixelsY.Size() == 1 );
+ DALI_TEST_CHECK(stretchPixelsX.Size() == 1);
+ DALI_TEST_CHECK(stretchPixelsY.Size() == 1);
- Vector4 stretchBorders;
- //The NPatch image stretch pixels are in the cropped image space, inset by 1 to get it to uncropped image space
- stretchBorders.x = stretchPixelsX[ 0 ].GetX() + 1;
- stretchBorders.y = stretchPixelsY[ 0 ].GetX() + 1;
- stretchBorders.z = imageHeight - stretchPixelsX[ 0 ].GetY() - 1;
- stretchBorders.w = imageWidth - stretchPixelsY[ 0 ].GetY() - 1;
+ Vector4 stretchBorders;
+ //The NPatch image stretch pixels are in the cropped image space, inset by 1 to get it to uncropped image space
+ stretchBorders.x = stretchPixelsX[0].GetX() + 1;
+ stretchBorders.y = stretchPixelsY[0].GetX() + 1;
+ stretchBorders.z = imageHeight - stretchPixelsX[0].GetY() - 1;
+ stretchBorders.w = imageWidth - stretchPixelsY[0].GetY() - 1;
- DALI_TEST_EQUALS( stretchBorders, requiredStretchBorder, 0.001, TEST_LOCATION );
- }
- else
- {
- test_return_value = TET_FAIL;
- }
+ DALI_TEST_EQUALS(stretchBorders, requiredStretchBorder, 0.001, TEST_LOCATION);
+ }
+ else
+ {
+ test_return_value = TET_FAIL;
+ }
END_TEST;
}
int UtcDaliNPatchUtilityIsNinePatchUrl(void)
{
- tet_infoline( "UtcDaliNPatchUtilityIsNinePatchUrl" );
+ tet_infoline("UtcDaliNPatchUtilityIsNinePatchUrl");
- DALI_TEST_CHECK( NPatchUtility::IsNinePatchUrl( "test.9.jpg" ) );
- DALI_TEST_CHECK( NPatchUtility::IsNinePatchUrl( "test.#.jpg" ) );
- DALI_TEST_CHECK( !NPatchUtility::IsNinePatchUrl( "test.9" ) );
- DALI_TEST_CHECK( !NPatchUtility::IsNinePatchUrl( "test.#" ) );
- DALI_TEST_CHECK( !NPatchUtility::IsNinePatchUrl( "test" ) );
+ DALI_TEST_CHECK(NPatchUtility::IsNinePatchUrl("test.9.jpg"));
+ DALI_TEST_CHECK(NPatchUtility::IsNinePatchUrl("test.#.jpg"));
+ DALI_TEST_CHECK(!NPatchUtility::IsNinePatchUrl("test.9"));
+ DALI_TEST_CHECK(!NPatchUtility::IsNinePatchUrl("test.#"));
+ DALI_TEST_CHECK(!NPatchUtility::IsNinePatchUrl("test"));
END_TEST;
}
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
-#include <stdlib.h>
-#include <sstream>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/controls/navigation-view/navigation-view.h>
+#include <stdlib.h>
+#include <iostream>
+#include <sstream>
using namespace Dali;
using namespace Toolkit;
ToolkitTestApplication application;
TypeRegistry typeRegistry = TypeRegistry::Get();
- DALI_TEST_CHECK( typeRegistry );
+ DALI_TEST_CHECK(typeRegistry);
- TypeInfo typeInfo = typeRegistry.GetTypeInfo( "NavigationView" );
- DALI_TEST_CHECK( typeInfo );
+ TypeInfo typeInfo = typeRegistry.GetTypeInfo("NavigationView");
+ DALI_TEST_CHECK(typeInfo);
BaseHandle handle = typeInfo.CreateInstance();
- DALI_TEST_CHECK( handle );
+ DALI_TEST_CHECK(handle);
- NavigationView view = NavigationView::DownCast( handle );
- DALI_TEST_CHECK( view );
+ NavigationView view = NavigationView::DownCast(handle);
+ DALI_TEST_CHECK(view);
END_TEST;
}
ToolkitTestApplication application;
NavigationView navigationView;
- DALI_TEST_CHECK( !navigationView );
+ DALI_TEST_CHECK(!navigationView);
navigationView = NavigationView::New();
- DALI_TEST_CHECK( navigationView );
+ DALI_TEST_CHECK(navigationView);
- application.GetScene().Add( navigationView );
+ application.GetScene().Add(navigationView);
application.SendNotification();
application.Render();
ToolkitTestApplication application;
NavigationView view = NavigationView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- NavigationView copy( view );
- DALI_TEST_CHECK( copy == view );
+ NavigationView copy(view);
+ DALI_TEST_CHECK(copy == view);
NavigationView assign;
- DALI_TEST_CHECK( !assign );
+ DALI_TEST_CHECK(!assign);
assign = view;
- DALI_TEST_CHECK( assign == view );
+ DALI_TEST_CHECK(assign == view);
// Self assignment
assign = assign;
- DALI_TEST_CHECK( assign );
- DALI_TEST_CHECK( assign == view );
+ DALI_TEST_CHECK(assign);
+ DALI_TEST_CHECK(assign == view);
END_TEST;
}
ToolkitTestApplication application;
BaseHandle view = NavigationView::New();
- DALI_TEST_CHECK( NavigationView::DownCast( view ) );
+ DALI_TEST_CHECK(NavigationView::DownCast(view));
BaseHandle empty;
- DALI_TEST_CHECK( ! NavigationView::DownCast( empty ) );
+ DALI_TEST_CHECK(!NavigationView::DownCast(empty));
BaseHandle another = Actor::New();
- DALI_TEST_CHECK( ! NavigationView::DownCast( another ) );
+ DALI_TEST_CHECK(!NavigationView::DownCast(another));
END_TEST;
}
// 1 Create and Add Navigation View to stage, actor count should be zero
NavigationView naviView = NavigationView::New();
- stage.Add( naviView );
+ stage.Add(naviView);
- DALI_TEST_EQUALS( naviView.GetChildCount(), 0, TEST_LOCATION );
+ DALI_TEST_EQUALS(naviView.GetChildCount(), 0, TEST_LOCATION);
// 2 Add Actor to Navigation View, actor count should increase to 1
Actor TestParentActor1 = Actor::New();
- naviView.Push( TestParentActor1 );
+ naviView.Push(TestParentActor1);
- DALI_TEST_EQUALS( naviView.GetChildCount(), 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(naviView.GetChildCount(), 1, TEST_LOCATION);
END_TEST;
}
// 1 Create Navigation View
NavigationView naviView = NavigationView::New();
- stage.Add( naviView );
+ stage.Add(naviView);
// 2 Push initial Actor
Actor testParentActor1 = Actor::New();
- testParentActor1.SetProperty( Dali::Actor::Property::NAME,"TestParentActor1");
- naviView.Push( testParentActor1 );
- DALI_TEST_EQUALS( naviView.GetChildCount(), 1 , TEST_LOCATION );
+ testParentActor1.SetProperty(Dali::Actor::Property::NAME, "TestParentActor1");
+ naviView.Push(testParentActor1);
+ DALI_TEST_EQUALS(naviView.GetChildCount(), 1, TEST_LOCATION);
// 3 Push Second Actor which contains a child actor
Actor testParentActor2 = Actor::New();
- testParentActor2.SetProperty( Dali::Actor::Property::NAME,"TestParentActor2");
+ testParentActor2.SetProperty(Dali::Actor::Property::NAME, "TestParentActor2");
Actor testChildActor1 = Actor::New();
- testParentActor2.Add( testChildActor1 );
- naviView.Push( testParentActor2 );
-
+ testParentActor2.Add(testChildActor1);
+ naviView.Push(testParentActor2);
// 4 Pop head actor, it should be TestParentActor2
Actor poppedActor = naviView.Pop();
- DALI_TEST_EQUALS( poppedActor.GetProperty< std::string >( Dali::Actor::Property::NAME ) , "TestParentActor2", TEST_LOCATION );
+ DALI_TEST_EQUALS(poppedActor.GetProperty<std::string>(Dali::Actor::Property::NAME), "TestParentActor2", TEST_LOCATION);
// 5 Navigation View child count should be 1
- DALI_TEST_EQUALS( naviView.GetChildCount(), 1 , TEST_LOCATION );
-
+ DALI_TEST_EQUALS(naviView.GetChildCount(), 1, TEST_LOCATION);
END_TEST;
}
// 1 Create Navigation View
NavigationView naviView = NavigationView::New();
- stage.Add( naviView );
+ stage.Add(naviView);
// 2 Push initial Actor
Actor testParentActor1 = Actor::New();
- testParentActor1.SetProperty( Dali::Actor::Property::NAME,"TestParentActor1");
- naviView.Push( testParentActor1 );
- DALI_TEST_EQUALS( naviView.GetChildCount(), 1 , TEST_LOCATION );
+ testParentActor1.SetProperty(Dali::Actor::Property::NAME, "TestParentActor1");
+ naviView.Push(testParentActor1);
+ DALI_TEST_EQUALS(naviView.GetChildCount(), 1, TEST_LOCATION);
// 3 Push Second Actor which contains a child actor
Actor testParentActor2 = Actor::New();
- testParentActor2.SetProperty( Dali::Actor::Property::NAME,"TestParentActor2");
+ testParentActor2.SetProperty(Dali::Actor::Property::NAME, "TestParentActor2");
Actor testChildActor1 = Actor::New();
- testParentActor2.Add( testChildActor1 );
- naviView.Push( testParentActor2 );
+ testParentActor2.Add(testChildActor1);
+ naviView.Push(testParentActor2);
// 3 Push third Actor which contains a child actor
Actor testParentActor3 = Actor::New();
- testParentActor3.SetProperty( Dali::Actor::Property::NAME,"TestParentActor3");
+ testParentActor3.SetProperty(Dali::Actor::Property::NAME, "TestParentActor3");
Actor testChildActor2 = Actor::New();
- testParentActor2.Add( testChildActor2 );
- naviView.Push( testParentActor3 );
+ testParentActor2.Add(testChildActor2);
+ naviView.Push(testParentActor3);
// 4 Pop head actor, it should be TestParentActor3
Actor poppedActor = naviView.Pop();
- DALI_TEST_EQUALS( poppedActor.GetProperty< std::string >( Dali::Actor::Property::NAME ) , "TestParentActor3", TEST_LOCATION );
+ DALI_TEST_EQUALS(poppedActor.GetProperty<std::string>(Dali::Actor::Property::NAME), "TestParentActor3", TEST_LOCATION);
// 5 Pop head actor, it should be TestParentActor2
Actor poppedActor2 = naviView.Pop();
- DALI_TEST_EQUALS( poppedActor2.GetProperty< std::string >( Dali::Actor::Property::NAME ) , "TestParentActor2", TEST_LOCATION );
-
+ DALI_TEST_EQUALS(poppedActor2.GetProperty<std::string>(Dali::Actor::Property::NAME), "TestParentActor2", TEST_LOCATION);
END_TEST;
}
// 1 Create Navigation View
NavigationView naviView = NavigationView::New();
- stage.Add( naviView );
+ stage.Add(naviView);
// 2 Push initial Actor
Actor testParentActor1 = Actor::New();
- testParentActor1.SetProperty( Dali::Actor::Property::NAME,"TestParentActor1");
- naviView.Push( testParentActor1 );
- DALI_TEST_EQUALS( naviView.GetChildCount(), 1 , TEST_LOCATION );
+ testParentActor1.SetProperty(Dali::Actor::Property::NAME, "TestParentActor1");
+ naviView.Push(testParentActor1);
+ DALI_TEST_EQUALS(naviView.GetChildCount(), 1, TEST_LOCATION);
// 3 Push Second Actor which contains a child actor
Actor testParentActor2 = Actor::New();
- testParentActor2.SetProperty( Dali::Actor::Property::NAME,"TestParentActor2");
+ testParentActor2.SetProperty(Dali::Actor::Property::NAME, "TestParentActor2");
Actor testChildActor1 = Actor::New();
- testParentActor2.Add( testChildActor1 );
- naviView.Push( testParentActor2 );
+ testParentActor2.Add(testChildActor1);
+ naviView.Push(testParentActor2);
// 4 Pop head actor, it should be TestParentActor2
Actor poppedActor1 = naviView.Pop();
- DALI_TEST_EQUALS( poppedActor1.GetProperty< std::string >( Dali::Actor::Property::NAME ) , "TestParentActor2", TEST_LOCATION );
-
+ DALI_TEST_EQUALS(poppedActor1.GetProperty<std::string>(Dali::Actor::Property::NAME), "TestParentActor2", TEST_LOCATION);
// 5 Try to Pop head actor, Should be empty hence can not get name of Actor
Actor poppedActorEmpty = naviView.Pop();
try
{
- const std::string hasNoName = poppedActorEmpty.GetProperty< std::string >( Dali::Actor::Property::NAME );
- tet_infoline( hasNoName.c_str() );
- DALI_TEST_CHECK( false ); // should not get here
+ const std::string hasNoName = poppedActorEmpty.GetProperty<std::string>(Dali::Actor::Property::NAME);
+ tet_infoline(hasNoName.c_str());
+ DALI_TEST_CHECK(false); // should not get here
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
-
END_TEST;
}
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
-#include <stdlib.h>
-#include <string.h>
-#include <sstream>
#include <dali-toolkit-test-suite-utils.h>
-#include <dali/integration-api/events/touch-event-integ.h>
#include <dali-toolkit/devel-api/controls/page-turn-view/page-factory.h>
#include <dali-toolkit/devel-api/controls/page-turn-view/page-turn-landscape-view.h>
#include <dali-toolkit/devel-api/controls/page-turn-view/page-turn-portrait-view.h>
#include <dali-toolkit/devel-api/controls/page-turn-view/page-turn-view.h>
+#include <dali/integration-api/events/touch-event-integ.h>
+#include <stdlib.h>
+#include <string.h>
+#include <iostream>
+#include <sstream>
using namespace Dali;
using namespace Dali::Toolkit;
namespace
{
-const int RENDER_FRAME_INTERVAL = 16; ///< Duration of each frame in ms. (at approx 60FPS)
-const unsigned int TOTAL_PAGE_NUMBER = 20;
-const Vector2 VIEW_PAGE_SIZE( 300.f,400.f );
-const Vector2 SPINE_SHADOW_PARAMETER( 60.0f, 30.0f );
+const int RENDER_FRAME_INTERVAL = 16; ///< Duration of each frame in ms. (at approx 60FPS)
+const unsigned int TOTAL_PAGE_NUMBER = 20;
+const Vector2 VIEW_PAGE_SIZE(300.f, 400.f);
+const Vector2 SPINE_SHADOW_PARAMETER(60.0f, 30.0f);
static bool gObjectCreatedCallBackCalled;
static void TestCallback(BaseHandle handle)
{
int time = 0;
- for(int i = 0; i <= ( duration / RENDER_FRAME_INTERVAL); i++)
+ for(int i = 0; i <= (duration / RENDER_FRAME_INTERVAL); i++)
{
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
return time;
}
-
static Vector2 PerformGestureDiagonalSwipe(ToolkitTestApplication& application, Vector2 start, Vector2 direction, int frames, uint32_t& time, bool toStart = true, bool toFinish = true)
{
- Vector2 pos( start );
+ Vector2 pos(start);
- if( toStart )
+ if(toStart)
{
// Now do a pan starting from (start + 20) and heading (direction)
- Vector2 pos_start_jump( start + Vector2(15.0f, 0.0f) );
- TestStartPan( application, start, pos_start_jump, time );
+ Vector2 pos_start_jump(start + Vector2(15.0f, 0.0f));
+ TestStartPan(application, start, pos_start_jump, time);
pos += direction;
}
time += Wait(application);
- for(int i = 0;i<frames;i++)
+ for(int i = 0; i < frames; i++)
{
pos += direction;
- TestMovePan(application, pos, time );
+ TestMovePan(application, pos, time);
time += Wait(application);
}
if(toFinish)
{
pos += direction;
- TestEndPan(application, pos, time );
+ TestEndPan(application, pos, time);
time += Wait(application);
}
return pos;
}
-
//Functor to test whether PageTurnSignal / PagePanSignal is emitted
class PageSignalCallback : public Dali::ConnectionTracker
{
public:
-
- PageSignalCallback( bool& signalReceived, PageTurnView& view, unsigned int& pageIndex, bool& isForwards )
- : mSignalVerified( signalReceived ),
- mView( view ),
- mPageIndex( pageIndex ),
- mIsTurningForwards( isForwards )
+ PageSignalCallback(bool& signalReceived, PageTurnView& view, unsigned int& pageIndex, bool& isForwards)
+ : mSignalVerified(signalReceived),
+ mView(view),
+ mPageIndex(pageIndex),
+ mIsTurningForwards(isForwards)
{
}
// callback to be connected to PageTurnSignal
- void PageTurnSignalCallback( PageTurnView view, unsigned int pageIndex, bool isTurningForward )
+ void PageTurnSignalCallback(PageTurnView view, unsigned int pageIndex, bool isTurningForward)
{
- tet_infoline( "Verifying PageTurnedSignal" );
+ tet_infoline("Verifying PageTurnedSignal");
- if( mView == view && mPageIndex == pageIndex && mIsTurningForwards == isTurningForward )
+ if(mView == view && mPageIndex == pageIndex && mIsTurningForwards == isTurningForward)
{
mSignalVerified = true;
}
}
// callback to be connected to PagePanSignal
- void PagePanSignalCallback( PageTurnView view )
+ void PagePanSignalCallback(PageTurnView view)
{
- tet_infoline( "Verifying PagePannedSignal" );
+ tet_infoline("Verifying PagePannedSignal");
- if( mView == view )
+ if(mView == view)
{
mSignalVerified = true;
}
PageTurnView& mView;
unsigned int& mPageIndex;
bool& mIsTurningForwards;
-
};
-
//Implementation of PageFactory for providing page actors to PageTurnView
class TestPageFactory : public PageFactory
{
public:
-
- TestPageFactory( bool returnValidTexture = true )
- : mValidTexture( returnValidTexture )
+ TestPageFactory(bool returnValidTexture = true)
+ : mValidTexture(returnValidTexture)
{
mTotalPageNumber = TOTAL_PAGE_NUMBER;
}
* @param[in] pageId The ID of the page to create.
* @return An image, or an empty handle if the ID is out of range.
*/
- virtual Texture NewPage( unsigned int pageId )
+ virtual Texture NewPage(unsigned int pageId)
{
- if( mValidTexture )
+ if(mValidTexture)
{
- return Texture::New( Dali::TextureType::TEXTURE_2D, Pixel::RGB888, 100, 100 );
+ return Texture::New(Dali::TextureType::TEXTURE_2D, Pixel::RGB888, 100, 100);
}
return Texture(); // empty handle
}
private:
- unsigned int mTotalPageNumber;
- bool mValidTexture;
+ unsigned int mTotalPageNumber;
+ bool mValidTexture;
};
-}// namespace
+} // namespace
void dali_page_turn_view_startup(void)
{
// Test default constructor
PageTurnView portraitView;
- DALI_TEST_CHECK( !portraitView );
+ DALI_TEST_CHECK(!portraitView);
// Test object creation
TestPageFactory factory;
- portraitView = PageTurnPortraitView::New( factory, VIEW_PAGE_SIZE );
- DALI_TEST_CHECK( portraitView );
+ portraitView = PageTurnPortraitView::New(factory, VIEW_PAGE_SIZE);
+ DALI_TEST_CHECK(portraitView);
//Additional check to ensure object is created by checking if it's registered
ObjectRegistry registry = application.GetCore().GetObjectRegistry();
- DALI_TEST_CHECK( registry );
+ DALI_TEST_CHECK(registry);
gObjectCreatedCallBackCalled = false;
- registry.ObjectCreatedSignal().Connect( &TestCallback );
+ registry.ObjectCreatedSignal().Connect(&TestCallback);
{
TestPageFactory factory;
- PageTurnView portraitView = PageTurnPortraitView::New( factory, VIEW_PAGE_SIZE );
+ PageTurnView portraitView = PageTurnPortraitView::New(factory, VIEW_PAGE_SIZE);
}
- DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
+ DALI_TEST_CHECK(gObjectCreatedCallBackCalled);
// Test copy constructor
- PageTurnView viewCopy( portraitView );
- DALI_TEST_CHECK( viewCopy );
+ PageTurnView viewCopy(portraitView);
+ DALI_TEST_CHECK(viewCopy);
// Test down cast
Handle handleView;
- handleView = portraitView;
- PageTurnView downCastView = PageTurnView::DownCast( handleView );
- DALI_TEST_CHECK( downCastView );
+ handleView = portraitView;
+ PageTurnView downCastView = PageTurnView::DownCast(handleView);
+ DALI_TEST_CHECK(downCastView);
END_TEST;
}
//Test default constructor
PageTurnView landscapeView;
- DALI_TEST_CHECK( !landscapeView );
+ DALI_TEST_CHECK(!landscapeView);
// Test object creation
TestPageFactory factory;
- landscapeView = PageTurnLandscapeView::New( factory, VIEW_PAGE_SIZE );
- DALI_TEST_CHECK( landscapeView );
+ landscapeView = PageTurnLandscapeView::New(factory, VIEW_PAGE_SIZE);
+ DALI_TEST_CHECK(landscapeView);
//Additional check to ensure object is created by checking if it's registered
ObjectRegistry registry = application.GetCore().GetObjectRegistry();
- DALI_TEST_CHECK( registry );
+ DALI_TEST_CHECK(registry);
gObjectCreatedCallBackCalled = false;
- registry.ObjectCreatedSignal().Connect( &TestCallback );
+ registry.ObjectCreatedSignal().Connect(&TestCallback);
{
TestPageFactory factory;
- PageTurnView landscapeView = PageTurnLandscapeView::New( factory, VIEW_PAGE_SIZE );
+ PageTurnView landscapeView = PageTurnLandscapeView::New(factory, VIEW_PAGE_SIZE);
}
- DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
+ DALI_TEST_CHECK(gObjectCreatedCallBackCalled);
// Test copy constructor
- PageTurnView viewCopy( landscapeView );
- DALI_TEST_CHECK( viewCopy );
+ PageTurnView viewCopy(landscapeView);
+ DALI_TEST_CHECK(viewCopy);
// Test down cast
Handle handleView;
- handleView = landscapeView;
- PageTurnView downCastView = PageTurnView::DownCast( handleView );
- DALI_TEST_CHECK( downCastView );
+ handleView = landscapeView;
+ PageTurnView downCastView = PageTurnView::DownCast(handleView);
+ DALI_TEST_CHECK(downCastView);
END_TEST;
}
// Test default constructor
PageTurnPortraitView portraitView;
- DALI_TEST_CHECK( !portraitView );
+ DALI_TEST_CHECK(!portraitView);
// Test object creation
TestPageFactory factory;
- portraitView = PageTurnPortraitView::New( factory, VIEW_PAGE_SIZE );
- DALI_TEST_CHECK( portraitView );
+ portraitView = PageTurnPortraitView::New(factory, VIEW_PAGE_SIZE);
+ DALI_TEST_CHECK(portraitView);
// Test copy constructor
- PageTurnPortraitView viewCopy( portraitView );
- DALI_TEST_CHECK( viewCopy );
+ PageTurnPortraitView viewCopy(portraitView);
+ DALI_TEST_CHECK(viewCopy);
// Test assignment
PageTurnPortraitView portraitView2;
portraitView2 = portraitView;
- DALI_TEST_CHECK( portraitView2 );
- DALI_TEST_CHECK( portraitView == portraitView2);
+ DALI_TEST_CHECK(portraitView2);
+ DALI_TEST_CHECK(portraitView == portraitView2);
// Test down cast
Handle handleView;
- handleView = portraitView;
- PageTurnPortraitView downCastView = PageTurnPortraitView::DownCast( handleView );
- DALI_TEST_CHECK( downCastView );
+ handleView = portraitView;
+ PageTurnPortraitView downCastView = PageTurnPortraitView::DownCast(handleView);
+ DALI_TEST_CHECK(downCastView);
END_TEST;
}
// Test default constructor
PageTurnLandscapeView landscapeView;
- DALI_TEST_CHECK( !landscapeView );
+ DALI_TEST_CHECK(!landscapeView);
// Test object creation
TestPageFactory factory;
- landscapeView = PageTurnLandscapeView::New( factory, VIEW_PAGE_SIZE );
- DALI_TEST_CHECK( landscapeView );
+ landscapeView = PageTurnLandscapeView::New(factory, VIEW_PAGE_SIZE);
+ DALI_TEST_CHECK(landscapeView);
// Test copy constructor
- PageTurnLandscapeView viewCopy( landscapeView );
- DALI_TEST_CHECK( viewCopy );
+ PageTurnLandscapeView viewCopy(landscapeView);
+ DALI_TEST_CHECK(viewCopy);
// Test assignment
PageTurnLandscapeView landscapeView2;
landscapeView2 = landscapeView;
- DALI_TEST_CHECK( landscapeView2 );
- DALI_TEST_CHECK( landscapeView == landscapeView2);
+ DALI_TEST_CHECK(landscapeView2);
+ DALI_TEST_CHECK(landscapeView == landscapeView2);
// Test down cast
Handle handleView;
- handleView = landscapeView;
- PageTurnLandscapeView downCastView = PageTurnLandscapeView::DownCast( handleView );
- DALI_TEST_CHECK( downCastView );
+ handleView = landscapeView;
+ PageTurnLandscapeView downCastView = PageTurnLandscapeView::DownCast(handleView);
+ DALI_TEST_CHECK(downCastView);
END_TEST;
}
tet_infoline(" UtcDaliPageTurnViewSetGetProperty ");
TestPageFactory factory;
- PageTurnView landscapeView = PageTurnLandscapeView::New( factory, VIEW_PAGE_SIZE );
- DALI_TEST_CHECK( landscapeView );
+ PageTurnView landscapeView = PageTurnLandscapeView::New(factory, VIEW_PAGE_SIZE);
+ DALI_TEST_CHECK(landscapeView);
- application.GetScene().Add( landscapeView );
+ application.GetScene().Add(landscapeView);
// Test "viewPageSize" property
- DALI_TEST_CHECK( landscapeView.GetPropertyIndex("viewPageSize") == PageTurnView::Property::VIEW_PAGE_SIZE );
- DALI_TEST_EQUALS( landscapeView.GetProperty(PageTurnView::Property::VIEW_PAGE_SIZE).Get<Vector2>(), VIEW_PAGE_SIZE, TEST_LOCATION );
+ DALI_TEST_CHECK(landscapeView.GetPropertyIndex("viewPageSize") == PageTurnView::Property::VIEW_PAGE_SIZE);
+ DALI_TEST_EQUALS(landscapeView.GetProperty(PageTurnView::Property::VIEW_PAGE_SIZE).Get<Vector2>(), VIEW_PAGE_SIZE, TEST_LOCATION);
- Vector2 newSize( VIEW_PAGE_SIZE.x*0.75, VIEW_PAGE_SIZE.y*0.5f );
- landscapeView.SetProperty( PageTurnView::Property::VIEW_PAGE_SIZE, newSize );
- DALI_TEST_EQUALS( landscapeView.GetProperty(PageTurnView::Property::VIEW_PAGE_SIZE).Get<Vector2>(), newSize, TEST_LOCATION );
- Wait( application);
- DALI_TEST_EQUALS( Vector2(landscapeView.GetTargetSize()), Vector2(newSize.x*2.f, newSize.y), TEST_LOCATION);
+ Vector2 newSize(VIEW_PAGE_SIZE.x * 0.75, VIEW_PAGE_SIZE.y * 0.5f);
+ landscapeView.SetProperty(PageTurnView::Property::VIEW_PAGE_SIZE, newSize);
+ DALI_TEST_EQUALS(landscapeView.GetProperty(PageTurnView::Property::VIEW_PAGE_SIZE).Get<Vector2>(), newSize, TEST_LOCATION);
+ Wait(application);
+ DALI_TEST_EQUALS(Vector2(landscapeView.GetTargetSize()), Vector2(newSize.x * 2.f, newSize.y), TEST_LOCATION);
- landscapeView.SetProperty( PageTurnView::Property::VIEW_PAGE_SIZE,newSize*1.5f);
- DALI_TEST_EQUALS( landscapeView.GetProperty(PageTurnView::Property::VIEW_PAGE_SIZE).Get<Vector2>(), newSize*1.5f, TEST_LOCATION );
- Wait( application);
- DALI_TEST_EQUALS( Vector2(landscapeView.GetTargetSize()), Vector2(newSize.x*3.f, newSize.y*1.5f), TEST_LOCATION);
+ landscapeView.SetProperty(PageTurnView::Property::VIEW_PAGE_SIZE, newSize * 1.5f);
+ DALI_TEST_EQUALS(landscapeView.GetProperty(PageTurnView::Property::VIEW_PAGE_SIZE).Get<Vector2>(), newSize * 1.5f, TEST_LOCATION);
+ Wait(application);
+ DALI_TEST_EQUALS(Vector2(landscapeView.GetTargetSize()), Vector2(newSize.x * 3.f, newSize.y * 1.5f), TEST_LOCATION);
// Test "currentPageId" property
- DALI_TEST_CHECK( landscapeView.GetPropertyIndex("currentPageId") == PageTurnView::Property::CURRENT_PAGE_ID );
- DALI_TEST_EQUALS( landscapeView.GetProperty(PageTurnView::Property::CURRENT_PAGE_ID).Get<int>(), 0, TEST_LOCATION );
+ DALI_TEST_CHECK(landscapeView.GetPropertyIndex("currentPageId") == PageTurnView::Property::CURRENT_PAGE_ID);
+ DALI_TEST_EQUALS(landscapeView.GetProperty(PageTurnView::Property::CURRENT_PAGE_ID).Get<int>(), 0, TEST_LOCATION);
- int pageId = static_cast<int>(TOTAL_PAGE_NUMBER)/3;
- landscapeView.SetProperty( PageTurnView::Property::CURRENT_PAGE_ID, pageId );
- DALI_TEST_EQUALS( landscapeView.GetProperty(PageTurnView::Property::CURRENT_PAGE_ID).Get<int>(), pageId, TEST_LOCATION );
+ int pageId = static_cast<int>(TOTAL_PAGE_NUMBER) / 3;
+ landscapeView.SetProperty(PageTurnView::Property::CURRENT_PAGE_ID, pageId);
+ DALI_TEST_EQUALS(landscapeView.GetProperty(PageTurnView::Property::CURRENT_PAGE_ID).Get<int>(), pageId, TEST_LOCATION);
- landscapeView.SetProperty( PageTurnView::Property::CURRENT_PAGE_ID, pageId*2 );
- DALI_TEST_EQUALS( landscapeView.GetProperty(PageTurnView::Property::CURRENT_PAGE_ID).Get<int>(), pageId*2, TEST_LOCATION );
+ landscapeView.SetProperty(PageTurnView::Property::CURRENT_PAGE_ID, pageId * 2);
+ DALI_TEST_EQUALS(landscapeView.GetProperty(PageTurnView::Property::CURRENT_PAGE_ID).Get<int>(), pageId * 2, TEST_LOCATION);
// Test "spinShadow" property
- DALI_TEST_CHECK( landscapeView.GetPropertyIndex( "spineShadow" ) == PageTurnView::Property::SPINE_SHADOW );
- landscapeView.SetProperty( PageTurnView::Property::SPINE_SHADOW, SPINE_SHADOW_PARAMETER );
- DALI_TEST_EQUALS( landscapeView.GetProperty(PageTurnView::Property::SPINE_SHADOW).Get<Vector2>(), SPINE_SHADOW_PARAMETER, TEST_LOCATION );
+ DALI_TEST_CHECK(landscapeView.GetPropertyIndex("spineShadow") == PageTurnView::Property::SPINE_SHADOW);
+ landscapeView.SetProperty(PageTurnView::Property::SPINE_SHADOW, SPINE_SHADOW_PARAMETER);
+ DALI_TEST_EQUALS(landscapeView.GetProperty(PageTurnView::Property::SPINE_SHADOW).Get<Vector2>(), SPINE_SHADOW_PARAMETER, TEST_LOCATION);
- landscapeView.SetProperty( PageTurnView::Property::SPINE_SHADOW, SPINE_SHADOW_PARAMETER*0.75f );
- DALI_TEST_EQUALS( landscapeView.GetProperty(PageTurnView::Property::SPINE_SHADOW).Get<Vector2>(), SPINE_SHADOW_PARAMETER*0.75f, TEST_LOCATION );
+ landscapeView.SetProperty(PageTurnView::Property::SPINE_SHADOW, SPINE_SHADOW_PARAMETER * 0.75f);
+ DALI_TEST_EQUALS(landscapeView.GetProperty(PageTurnView::Property::SPINE_SHADOW).Get<Vector2>(), SPINE_SHADOW_PARAMETER * 0.75f, TEST_LOCATION);
END_TEST;
}
tet_infoline(" UtcDaliPageTurnPortraitViewSignals ");
- application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
TestPageFactory factory;
- Vector2 size = application.GetScene().GetSize();
- PageTurnView portraitView = PageTurnPortraitView::New( factory, size );
- portraitView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- application.GetScene().Add( portraitView );
+ Vector2 size = application.GetScene().GetSize();
+ PageTurnView portraitView = PageTurnPortraitView::New(factory, size);
+ portraitView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ application.GetScene().Add(portraitView);
// Render and notify
application.SendNotification();
// [0]: testing PageTurnStartedSignal; [1]: testing PageTurnFinishedSignal
// [2]: testing PagePanStartedSignal; [3]: testing PagePanFinishedSignal
- bool signalVerified[4] = {false, false, false, false};
+ bool signalVerified[4] = {false, false, false, false};
PageTurnView currentView;
unsigned int pageIndex;
- bool isTurningForwards;
+ bool isTurningForwards;
- PageSignalCallback callbackTurnStarted( signalVerified[0], currentView, pageIndex, isTurningForwards );
- portraitView.PageTurnStartedSignal().Connect( &callbackTurnStarted, &PageSignalCallback::PageTurnSignalCallback );
+ PageSignalCallback callbackTurnStarted(signalVerified[0], currentView, pageIndex, isTurningForwards);
+ portraitView.PageTurnStartedSignal().Connect(&callbackTurnStarted, &PageSignalCallback::PageTurnSignalCallback);
- PageSignalCallback callbackTurnFinished( signalVerified[1], currentView, pageIndex, isTurningForwards );
- portraitView.PageTurnFinishedSignal().Connect( &callbackTurnFinished, &PageSignalCallback::PageTurnSignalCallback );
+ PageSignalCallback callbackTurnFinished(signalVerified[1], currentView, pageIndex, isTurningForwards);
+ portraitView.PageTurnFinishedSignal().Connect(&callbackTurnFinished, &PageSignalCallback::PageTurnSignalCallback);
- PageSignalCallback callbackPanStarted( signalVerified[2], currentView, pageIndex, isTurningForwards );
- portraitView.PagePanStartedSignal().Connect( &callbackPanStarted, &PageSignalCallback::PagePanSignalCallback );
+ PageSignalCallback callbackPanStarted(signalVerified[2], currentView, pageIndex, isTurningForwards);
+ portraitView.PagePanStartedSignal().Connect(&callbackPanStarted, &PageSignalCallback::PagePanSignalCallback);
- PageSignalCallback callbackPanFinished( signalVerified[3], currentView, pageIndex, isTurningForwards );
- portraitView.PagePanFinishedSignal().Connect( &callbackPanFinished, &PageSignalCallback::PagePanSignalCallback );
+ PageSignalCallback callbackPanFinished(signalVerified[3], currentView, pageIndex, isTurningForwards);
+ portraitView.PagePanFinishedSignal().Connect(&callbackPanFinished, &PageSignalCallback::PagePanSignalCallback);
- DALI_TEST_CHECK( !callbackTurnStarted.mSignalVerified );
- DALI_TEST_CHECK( !callbackTurnFinished.mSignalVerified );
- DALI_TEST_CHECK( !callbackPanStarted.mSignalVerified );
- DALI_TEST_CHECK( !callbackPanFinished.mSignalVerified );
+ DALI_TEST_CHECK(!callbackTurnStarted.mSignalVerified);
+ DALI_TEST_CHECK(!callbackTurnFinished.mSignalVerified);
+ DALI_TEST_CHECK(!callbackPanStarted.mSignalVerified);
+ DALI_TEST_CHECK(!callbackPanFinished.mSignalVerified);
currentView = portraitView;
//-----Test 1: pan 10 frames from position(size * 0.75f) to position(size * 0.25f), page 0 will be turned forward----
- pageIndex = 0;
+ pageIndex = 0;
isTurningForwards = true;
// Do a pan moving up diagonally
- uint32_t time = 0;
- Vector2 start = size * 0.75f;
- Vector2 direction = -size*0.05f; //-size*0.5f/10.f;
+ uint32_t time = 0;
+ Vector2 start = size * 0.75f;
+ Vector2 direction = -size * 0.05f; //-size*0.5f/10.f;
- DALI_TEST_EQUALS( portraitView.GetProperty(PageTurnView::Property::CURRENT_PAGE_ID).Get<int>(), 0, TEST_LOCATION );
- PerformGestureDiagonalSwipe( application, start, direction, 5, time, true, false);
- DALI_TEST_CHECK( callbackTurnStarted.mSignalVerified );
- DALI_TEST_CHECK( !callbackTurnFinished.mSignalVerified );
- DALI_TEST_CHECK( callbackPanStarted.mSignalVerified );
- DALI_TEST_CHECK( !callbackPanFinished.mSignalVerified );
+ DALI_TEST_EQUALS(portraitView.GetProperty(PageTurnView::Property::CURRENT_PAGE_ID).Get<int>(), 0, TEST_LOCATION);
+ PerformGestureDiagonalSwipe(application, start, direction, 5, time, true, false);
+ DALI_TEST_CHECK(callbackTurnStarted.mSignalVerified);
+ DALI_TEST_CHECK(!callbackTurnFinished.mSignalVerified);
+ DALI_TEST_CHECK(callbackPanStarted.mSignalVerified);
+ DALI_TEST_CHECK(!callbackPanFinished.mSignalVerified);
- PerformGestureDiagonalSwipe( application, start+direction*5.f, direction, 5, time, false, true);
- DALI_TEST_CHECK( !callbackTurnFinished.mSignalVerified );
- DALI_TEST_CHECK( callbackPanFinished.mSignalVerified );
+ PerformGestureDiagonalSwipe(application, start + direction * 5.f, direction, 5, time, false, true);
+ DALI_TEST_CHECK(!callbackTurnFinished.mSignalVerified);
+ DALI_TEST_CHECK(callbackPanFinished.mSignalVerified);
time += Wait(application, 1000);
- DALI_TEST_CHECK( callbackTurnFinished.mSignalVerified );
+ DALI_TEST_CHECK(callbackTurnFinished.mSignalVerified);
// the page is turned over
- DALI_TEST_EQUALS( portraitView.GetProperty(PageTurnView::Property::CURRENT_PAGE_ID).Get<int>(), (int)(pageIndex+1), TEST_LOCATION );
+ DALI_TEST_EQUALS(portraitView.GetProperty(PageTurnView::Property::CURRENT_PAGE_ID).Get<int>(), (int)(pageIndex + 1), TEST_LOCATION);
//---Test 2: pan from position( size*0.5f ) to position( size.width, size.height*0.5f ) to position( size * 0.75f ), page 1 will bent then slid back---
callbackTurnStarted.Reset();
callbackTurnFinished.Reset();
callbackPanStarted.Reset();
callbackPanFinished.Reset();
- portraitView.SetProperty( PageTurnView::Property::CURRENT_PAGE_ID, 5 );
- pageIndex = 5;
+ portraitView.SetProperty(PageTurnView::Property::CURRENT_PAGE_ID, 5);
+ pageIndex = 5;
isTurningForwards = true;
//pan 10 frames from position( size.width, size.height*0.5f ) to position( size * 0.75f )
- start = Vector2( size.width, size.height*0.5f );
- direction = Vector2(-size.width*0.025f, size.height*0.025f);
- PerformGestureDiagonalSwipe( application, start, direction, 5, time, true, false);
- DALI_TEST_CHECK( callbackPanStarted.mSignalVerified );
- DALI_TEST_CHECK( callbackTurnStarted.mSignalVerified );
- DALI_TEST_CHECK( !callbackTurnFinished.mSignalVerified );
- DALI_TEST_CHECK( !callbackPanFinished.mSignalVerified );
+ start = Vector2(size.width, size.height * 0.5f);
+ direction = Vector2(-size.width * 0.025f, size.height * 0.025f);
+ PerformGestureDiagonalSwipe(application, start, direction, 5, time, true, false);
+ DALI_TEST_CHECK(callbackPanStarted.mSignalVerified);
+ DALI_TEST_CHECK(callbackTurnStarted.mSignalVerified);
+ DALI_TEST_CHECK(!callbackTurnFinished.mSignalVerified);
+ DALI_TEST_CHECK(!callbackPanFinished.mSignalVerified);
signalVerified[0] = false;
isTurningForwards = false;
- PerformGestureDiagonalSwipe( application, start + direction*2 , direction, 5, time, false, true);
- DALI_TEST_CHECK( !callbackTurnFinished.mSignalVerified );
- DALI_TEST_CHECK( callbackPanFinished.mSignalVerified );
- DALI_TEST_CHECK( callbackTurnStarted.mSignalVerified ); // start the sliding back
+ PerformGestureDiagonalSwipe(application, start + direction * 2, direction, 5, time, false, true);
+ DALI_TEST_CHECK(!callbackTurnFinished.mSignalVerified);
+ DALI_TEST_CHECK(callbackPanFinished.mSignalVerified);
+ DALI_TEST_CHECK(callbackTurnStarted.mSignalVerified); // start the sliding back
time += Wait(application, 1000);
- DALI_TEST_CHECK( callbackTurnFinished.mSignalVerified );
- DALI_TEST_EQUALS( portraitView.GetProperty(PageTurnView::Property::CURRENT_PAGE_ID).Get<int>(), (int)pageIndex, TEST_LOCATION ); // the page is not turned over
+ DALI_TEST_CHECK(callbackTurnFinished.mSignalVerified);
+ DALI_TEST_EQUALS(portraitView.GetProperty(PageTurnView::Property::CURRENT_PAGE_ID).Get<int>(), (int)pageIndex, TEST_LOCATION); // the page is not turned over
// ----Test 3: pan 10 frames from position( size*0.25f ) to position( size.width*0.75f, size.height*0.25f ), the previous page will be turned backwards---
callbackTurnStarted.Reset();
callbackTurnFinished.Reset();
callbackPanStarted.Reset();
callbackPanFinished.Reset();
- portraitView.SetProperty( PageTurnView::Property::CURRENT_PAGE_ID, 10);
- pageIndex = 9; // will turn the previous page back
+ portraitView.SetProperty(PageTurnView::Property::CURRENT_PAGE_ID, 10);
+ pageIndex = 9; // will turn the previous page back
isTurningForwards = false;
- start = size*0.25f;
- direction = Vector2(size.x*0.05f, 0.f);
- PerformGestureDiagonalSwipe( application, start, direction, 4, time, true, false);
- DALI_TEST_CHECK( callbackPanStarted.mSignalVerified );
- DALI_TEST_CHECK( !callbackTurnStarted.mSignalVerified );
- DALI_TEST_CHECK( !callbackTurnFinished.mSignalVerified );
- DALI_TEST_CHECK( !callbackPanFinished.mSignalVerified );
-
- PerformGestureDiagonalSwipe( application, start+direction*5.f, direction, 5, time, false, true);
- DALI_TEST_CHECK( callbackTurnStarted.mSignalVerified );
- DALI_TEST_CHECK( callbackPanFinished.mSignalVerified );
- DALI_TEST_CHECK( !callbackTurnFinished.mSignalVerified );
-
- Wait( application, 1000 );
-
- DALI_TEST_CHECK( callbackTurnFinished.mSignalVerified );
- DALI_TEST_EQUALS( portraitView.GetProperty(PageTurnView::Property::CURRENT_PAGE_ID).Get<int>(), 9, TEST_LOCATION );
+ start = size * 0.25f;
+ direction = Vector2(size.x * 0.05f, 0.f);
+ PerformGestureDiagonalSwipe(application, start, direction, 4, time, true, false);
+ DALI_TEST_CHECK(callbackPanStarted.mSignalVerified);
+ DALI_TEST_CHECK(!callbackTurnStarted.mSignalVerified);
+ DALI_TEST_CHECK(!callbackTurnFinished.mSignalVerified);
+ DALI_TEST_CHECK(!callbackPanFinished.mSignalVerified);
+
+ PerformGestureDiagonalSwipe(application, start + direction * 5.f, direction, 5, time, false, true);
+ DALI_TEST_CHECK(callbackTurnStarted.mSignalVerified);
+ DALI_TEST_CHECK(callbackPanFinished.mSignalVerified);
+ DALI_TEST_CHECK(!callbackTurnFinished.mSignalVerified);
+
+ Wait(application, 1000);
+
+ DALI_TEST_CHECK(callbackTurnFinished.mSignalVerified);
+ DALI_TEST_EQUALS(portraitView.GetProperty(PageTurnView::Property::CURRENT_PAGE_ID).Get<int>(), 9, TEST_LOCATION);
END_TEST;
}
tet_infoline(" UtcDaliPageTurnLanscapeViewSignals ");
- application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
/***
* -----------------
* | |
*/
TestPageFactory factory;
- Vector2 stageSize = application.GetScene().GetSize();
- PageTurnView landscapeView = PageTurnLandscapeView::New( factory, Vector2(stageSize.x*0.5f, stageSize.x*0.8f) );
- landscapeView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- application.GetScene().Add( landscapeView );
+ Vector2 stageSize = application.GetScene().GetSize();
+ PageTurnView landscapeView = PageTurnLandscapeView::New(factory, Vector2(stageSize.x * 0.5f, stageSize.x * 0.8f));
+ landscapeView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ application.GetScene().Add(landscapeView);
// Render and notify
application.SendNotification();
// [0]: testing PageTurnStartedSignal; [1]: testing PageTurnFinishedSignal
// [2]: testing PagePanStartedSignal; [3]: testing PagePanFinishedSignal
- bool signalVerified[4] = {false, false, false, false};
+ bool signalVerified[4] = {false, false, false, false};
PageTurnView currentView;
unsigned int pageIndex;
- bool isTurningForwards;
+ bool isTurningForwards;
- PageSignalCallback callbackTurnStarted( signalVerified[0], currentView, pageIndex, isTurningForwards );
- landscapeView.PageTurnStartedSignal().Connect( &callbackTurnStarted, &PageSignalCallback::PageTurnSignalCallback );
+ PageSignalCallback callbackTurnStarted(signalVerified[0], currentView, pageIndex, isTurningForwards);
+ landscapeView.PageTurnStartedSignal().Connect(&callbackTurnStarted, &PageSignalCallback::PageTurnSignalCallback);
- PageSignalCallback callbackTurnFinished( signalVerified[1], currentView, pageIndex, isTurningForwards );
- landscapeView.PageTurnFinishedSignal().Connect( &callbackTurnFinished, &PageSignalCallback::PageTurnSignalCallback );
+ PageSignalCallback callbackTurnFinished(signalVerified[1], currentView, pageIndex, isTurningForwards);
+ landscapeView.PageTurnFinishedSignal().Connect(&callbackTurnFinished, &PageSignalCallback::PageTurnSignalCallback);
- PageSignalCallback callbackPanStarted( signalVerified[2], currentView, pageIndex, isTurningForwards );
- landscapeView.PagePanStartedSignal().Connect( &callbackPanStarted, &PageSignalCallback::PagePanSignalCallback );
+ PageSignalCallback callbackPanStarted(signalVerified[2], currentView, pageIndex, isTurningForwards);
+ landscapeView.PagePanStartedSignal().Connect(&callbackPanStarted, &PageSignalCallback::PagePanSignalCallback);
- PageSignalCallback callbackPanFinished( signalVerified[3], currentView, pageIndex, isTurningForwards );
- landscapeView.PagePanFinishedSignal().Connect( &callbackPanFinished, &PageSignalCallback::PagePanSignalCallback );
+ PageSignalCallback callbackPanFinished(signalVerified[3], currentView, pageIndex, isTurningForwards);
+ landscapeView.PagePanFinishedSignal().Connect(&callbackPanFinished, &PageSignalCallback::PagePanSignalCallback);
- DALI_TEST_CHECK( !callbackTurnStarted.mSignalVerified );
- DALI_TEST_CHECK( !callbackTurnFinished.mSignalVerified );
- DALI_TEST_CHECK( !callbackPanStarted.mSignalVerified );
- DALI_TEST_CHECK( !callbackPanFinished.mSignalVerified );
+ DALI_TEST_CHECK(!callbackTurnStarted.mSignalVerified);
+ DALI_TEST_CHECK(!callbackTurnFinished.mSignalVerified);
+ DALI_TEST_CHECK(!callbackPanStarted.mSignalVerified);
+ DALI_TEST_CHECK(!callbackPanFinished.mSignalVerified);
currentView = landscapeView;
//-----Test 1: pan 10 frames from position(stageSize.x * 0.85f, stageSize.y*0.5) to position(stageSize.x * 0.45f, stageSize.y*0.5-stageSize.x * 0.3f), page 0 will be turned forward----
- pageIndex = 0;
+ pageIndex = 0;
isTurningForwards = true;
// Do a pan to the left.
- uint32_t time = 0;
- Vector2 start = Vector2(stageSize.x * 0.85f, stageSize.y*0.5);
- Vector2 direction = Vector2(-stageSize.x*0.04f, -stageSize.x*0.03f);
+ uint32_t time = 0;
+ Vector2 start = Vector2(stageSize.x * 0.85f, stageSize.y * 0.5);
+ Vector2 direction = Vector2(-stageSize.x * 0.04f, -stageSize.x * 0.03f);
- DALI_TEST_EQUALS( landscapeView.GetProperty(PageTurnView::Property::CURRENT_PAGE_ID).Get<int>(), 0, TEST_LOCATION );
- PerformGestureDiagonalSwipe( application, start, direction, 5, time, true, false);
- DALI_TEST_CHECK( callbackTurnStarted.mSignalVerified );
- DALI_TEST_CHECK( !callbackTurnFinished.mSignalVerified );
- DALI_TEST_CHECK( callbackPanStarted.mSignalVerified );
- DALI_TEST_CHECK( !callbackPanFinished.mSignalVerified );
+ DALI_TEST_EQUALS(landscapeView.GetProperty(PageTurnView::Property::CURRENT_PAGE_ID).Get<int>(), 0, TEST_LOCATION);
+ PerformGestureDiagonalSwipe(application, start, direction, 5, time, true, false);
+ DALI_TEST_CHECK(callbackTurnStarted.mSignalVerified);
+ DALI_TEST_CHECK(!callbackTurnFinished.mSignalVerified);
+ DALI_TEST_CHECK(callbackPanStarted.mSignalVerified);
+ DALI_TEST_CHECK(!callbackPanFinished.mSignalVerified);
- PerformGestureDiagonalSwipe( application, start+direction*5.f, direction, 5, time, false, true);
- DALI_TEST_CHECK( !callbackTurnFinished.mSignalVerified );
- DALI_TEST_CHECK( callbackPanFinished.mSignalVerified );
+ PerformGestureDiagonalSwipe(application, start + direction * 5.f, direction, 5, time, false, true);
+ DALI_TEST_CHECK(!callbackTurnFinished.mSignalVerified);
+ DALI_TEST_CHECK(callbackPanFinished.mSignalVerified);
time += Wait(application, 1000);
- DALI_TEST_CHECK( callbackTurnFinished.mSignalVerified );
+ DALI_TEST_CHECK(callbackTurnFinished.mSignalVerified);
// the page is turned over
- DALI_TEST_EQUALS( landscapeView.GetProperty(PageTurnView::Property::CURRENT_PAGE_ID).Get<int>(), (int)(pageIndex+1), TEST_LOCATION );
+ DALI_TEST_EQUALS(landscapeView.GetProperty(PageTurnView::Property::CURRENT_PAGE_ID).Get<int>(), (int)(pageIndex + 1), TEST_LOCATION);
//---Test 2: pan from position(stageSize.x * 0.15f, stageSize.y*0.5) to position(stageSize.x * 0.45f, stageSize.y*0.5) page 4 will be turned back---
callbackTurnStarted.Reset();
isTurningForwards = false;
//pan 10 frames from position( size.width, size.height*0.5f ) to position( size * 0.75f )
- start = Vector2( stageSize.x * 0.15f, stageSize.y*0.5f );
+ start = Vector2(stageSize.x * 0.15f, stageSize.y * 0.5f);
direction = Vector2(stageSize.x * 0.03f, 0.f);
- PerformGestureDiagonalSwipe( application, start, direction, 5, time, true, false);
- DALI_TEST_CHECK( callbackPanStarted.mSignalVerified );
- DALI_TEST_CHECK( callbackTurnStarted.mSignalVerified );
- DALI_TEST_CHECK( !callbackTurnFinished.mSignalVerified );
- DALI_TEST_CHECK( !callbackPanFinished.mSignalVerified );
+ PerformGestureDiagonalSwipe(application, start, direction, 5, time, true, false);
+ DALI_TEST_CHECK(callbackPanStarted.mSignalVerified);
+ DALI_TEST_CHECK(callbackTurnStarted.mSignalVerified);
+ DALI_TEST_CHECK(!callbackTurnFinished.mSignalVerified);
+ DALI_TEST_CHECK(!callbackPanFinished.mSignalVerified);
- PerformGestureDiagonalSwipe( application, start + direction*5.f , direction, 5, time, false, true);
- DALI_TEST_CHECK( !callbackTurnFinished.mSignalVerified );
- DALI_TEST_CHECK( callbackPanFinished.mSignalVerified );
+ PerformGestureDiagonalSwipe(application, start + direction * 5.f, direction, 5, time, false, true);
+ DALI_TEST_CHECK(!callbackTurnFinished.mSignalVerified);
+ DALI_TEST_CHECK(callbackPanFinished.mSignalVerified);
time += Wait(application, 1000);
- DALI_TEST_CHECK( callbackTurnFinished.mSignalVerified );
- DALI_TEST_EQUALS( landscapeView.GetProperty(PageTurnView::Property::CURRENT_PAGE_ID).Get<int>(), 0, TEST_LOCATION ); // the first page is turned back
+ DALI_TEST_CHECK(callbackTurnFinished.mSignalVerified);
+ DALI_TEST_EQUALS(landscapeView.GetProperty(PageTurnView::Property::CURRENT_PAGE_ID).Get<int>(), 0, TEST_LOCATION); // the first page is turned back
// ----Test 3: pan 10 frames from position( size*0.55f ) to position( size.width*0.8f, size.height*0.5f ), no page turn will be started---
callbackTurnStarted.Reset();
callbackPanStarted.Reset();
callbackPanFinished.Reset();
isTurningForwards = false;
- start = stageSize*0.55f;
- direction = Vector2(stageSize.x*0.025f, 0.f);
- PerformGestureDiagonalSwipe( application, start, direction, 5, time, true, false);
- DALI_TEST_CHECK( callbackPanStarted.mSignalVerified );
- DALI_TEST_CHECK( !callbackTurnStarted.mSignalVerified );
- DALI_TEST_CHECK( !callbackTurnFinished.mSignalVerified );
- DALI_TEST_CHECK( !callbackPanFinished.mSignalVerified );
-
- PerformGestureDiagonalSwipe( application, start+direction*5.f, direction, 5, time, false, true);
- DALI_TEST_CHECK( !callbackTurnStarted.mSignalVerified );
- DALI_TEST_CHECK( callbackPanFinished.mSignalVerified );
- DALI_TEST_CHECK( !callbackTurnFinished.mSignalVerified );
-
- Wait( application, 1000 );
-
- DALI_TEST_CHECK( !callbackTurnFinished.mSignalVerified );
- DALI_TEST_EQUALS( landscapeView.GetProperty(PageTurnView::Property::CURRENT_PAGE_ID).Get<int>(), 0, TEST_LOCATION );
+ start = stageSize * 0.55f;
+ direction = Vector2(stageSize.x * 0.025f, 0.f);
+ PerformGestureDiagonalSwipe(application, start, direction, 5, time, true, false);
+ DALI_TEST_CHECK(callbackPanStarted.mSignalVerified);
+ DALI_TEST_CHECK(!callbackTurnStarted.mSignalVerified);
+ DALI_TEST_CHECK(!callbackTurnFinished.mSignalVerified);
+ DALI_TEST_CHECK(!callbackPanFinished.mSignalVerified);
+
+ PerformGestureDiagonalSwipe(application, start + direction * 5.f, direction, 5, time, false, true);
+ DALI_TEST_CHECK(!callbackTurnStarted.mSignalVerified);
+ DALI_TEST_CHECK(callbackPanFinished.mSignalVerified);
+ DALI_TEST_CHECK(!callbackTurnFinished.mSignalVerified);
+
+ Wait(application, 1000);
+
+ DALI_TEST_CHECK(!callbackTurnFinished.mSignalVerified);
+ DALI_TEST_EQUALS(landscapeView.GetProperty(PageTurnView::Property::CURRENT_PAGE_ID).Get<int>(), 0, TEST_LOCATION);
END_TEST;
}
int UtcDaliPageImageFactoryGetExtention(void)
{
ToolkitTestApplication application;
- TestPageFactory factory;
- DALI_TEST_CHECK( factory.GetExtension() == NULL );
+ TestPageFactory factory;
+ DALI_TEST_CHECK(factory.GetExtension() == NULL);
END_TEST;
}
tet_infoline(" UtcDaliPageTurnEmptyTextureHandle ");
- application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE );
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
- TestPageFactory factory( false /* returns empty handles */ );
- Vector2 size = application.GetScene().GetSize();
+ TestPageFactory factory(false /* returns empty handles */);
+ Vector2 size = application.GetScene().GetSize();
try
{
- PageTurnView portraitView = PageTurnPortraitView::New( factory, size );
- portraitView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- application.GetScene().Add( portraitView );
+ PageTurnView portraitView = PageTurnPortraitView::New(factory, size);
+ portraitView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ application.GetScene().Add(portraitView);
tet_result(TET_FAIL);
}
- catch (DaliException& e)
+ catch(DaliException& e)
{
- DALI_TEST_ASSERT(e, "must pass in valid texture", TEST_LOCATION );
+ DALI_TEST_ASSERT(e, "must pass in valid texture", TEST_LOCATION);
}
- catch (...)
+ catch(...)
{
tet_result(TET_FAIL);
}
END_TEST;
}
-
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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-test-utils/toolkit-timer.h"
+#include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/popup/popup.h>
#include <dali.h>
+#include <dali/devel-api/actors/actor-devel.h>
+#include <dali/devel-api/scripting/scripting.h>
#include <dali/integration-api/events/key-event-integ.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali/integration-api/events/wheel-event-integ.h>
-#include <dali/devel-api/actors/actor-devel.h>
-#include <dali/devel-api/scripting/scripting.h>
-#include <dali-toolkit/dali-toolkit.h>
-#include <dali-toolkit/devel-api/controls/popup/popup.h>
using namespace Dali;
using namespace Toolkit;
gObjectCreatedCallBackCalled = true;
}
-const int RENDER_FRAME_INTERVAL = 10; ///< Duration of each frame in ms.
-const int RENDER_ANIMATION_TEST_DURATION_MS = 2000; ///< 2000ms to test animation.
-const int RENDER_ANIMATION_TEST_DURATION_FRAMES = RENDER_ANIMATION_TEST_DURATION_MS / RENDER_FRAME_INTERVAL; ///< equivalent frames.
+const int RENDER_FRAME_INTERVAL = 10; ///< Duration of each frame in ms.
+const int RENDER_ANIMATION_TEST_DURATION_MS = 2000; ///< 2000ms to test animation.
+const int RENDER_ANIMATION_TEST_DURATION_FRAMES = RENDER_ANIMATION_TEST_DURATION_MS / RENDER_FRAME_INTERVAL; ///< equivalent frames.
const Vector3 DEFAULT_BUTTON_SIZE(100.0f, 50.0f, 0.0f);
Dali::Integration::Point GetPointDown()
{
Dali::Integration::Point point;
- point.SetState( PointState::DOWN );
- point.SetScreenPosition( Vector2( 10, 10 ) );
+ point.SetState(PointState::DOWN);
+ point.SetScreenPosition(Vector2(10, 10));
return point;
}
Dali::Integration::Point GetPointUp()
{
Dali::Integration::Point point;
- point.SetState( PointState::UP );
- point.SetScreenPosition( Vector2( 10, 10 ) );
+ point.SetState(PointState::UP);
+ point.SetScreenPosition(Vector2(10, 10));
return point;
}
* @param[in] root The root actor to count from.
* @return The number of descendants including root actor itself.
*/
-int DescendentCount( const Actor& root )
+int DescendentCount(const Actor& root)
{
unsigned int numChildren = root.GetChildCount();
int count = 1;
- for( unsigned int i = 0; i < numChildren; ++i )
+ for(unsigned int i = 0; i < numChildren; ++i)
{
- count += DescendentCount( root.GetChildAt( i ) );
+ count += DescendentCount(root.GetChildAt(i));
}
return count;
}
-bool HasAncestor( Actor child, Actor ancestor )
+bool HasAncestor(Actor child, Actor ancestor)
{
- while( child && child != ancestor )
+ while(child && child != ancestor)
{
child = child.GetParent();
}
- return ( child == ancestor );
+ return (child == ancestor);
}
static Toolkit::Popup::DisplayState gPopupState = Toolkit::Popup::HIDDEN;
-static bool gTouchedOutside;
+static bool gTouchedOutside;
// Signal callbacks
gPopupState = Toolkit::Popup::HIDDEN;
}
-void ConnectStateSignals( Toolkit::Popup popup )
+void ConnectStateSignals(Toolkit::Popup popup)
{
- popup.ShowingSignal().Connect( &OnPopupShowing );
- popup.ShownSignal().Connect( &OnPopupShown );
- popup.HidingSignal().Connect( &OnPopupHiding );
- popup.HiddenSignal().Connect( &OnPopupHidden );
+ popup.ShowingSignal().Connect(&OnPopupShowing);
+ popup.ShownSignal().Connect(&OnPopupShown);
+ popup.HidingSignal().Connect(&OnPopupHiding);
+ popup.HiddenSignal().Connect(&OnPopupHidden);
}
-void WaitAnimation( ToolkitTestApplication& application )
+void WaitAnimation(ToolkitTestApplication& application)
{
// Wait for a while (allow animation to complete), and then check state.
- for( int i = 0; i < RENDER_ANIMATION_TEST_DURATION_FRAMES; i++ )
+ for(int i = 0; i < RENDER_ANIMATION_TEST_DURATION_FRAMES; i++)
{
application.SendNotification();
- application.Render( RENDER_FRAME_INTERVAL );
+ application.Render(RENDER_FRAME_INTERVAL);
}
}
};
// Generate a KeyEvent to send to Core.
-Integration::KeyEvent GenerateKey( const std::string& keyName,
- const std::string& logicalKey,
- const std::string& keyString,
- int keyCode,
- int keyModifier,
- unsigned long timeStamp,
- const Integration::KeyEvent::State& keyState,
- const std::string& compose = "",
- const std::string& deviceName = "",
- const Device::Class::Type& deviceClass = Device::Class::NONE,
- const Device::Subclass::Type& deviceSubclass = Device::Subclass::NONE
- )
+Integration::KeyEvent GenerateKey(const std::string& keyName,
+ const std::string& logicalKey,
+ const std::string& keyString,
+ int keyCode,
+ int keyModifier,
+ unsigned long timeStamp,
+ const Integration::KeyEvent::State& keyState,
+ const std::string& compose = "",
+ const std::string& deviceName = "",
+ const Device::Class::Type& deviceClass = Device::Class::NONE,
+ const Device::Subclass::Type& deviceSubclass = Device::Subclass::NONE)
{
- return Integration::KeyEvent( keyName,
- logicalKey,
- keyString,
- keyCode,
- keyModifier,
- timeStamp,
- keyState,
- compose,
- deviceName,
- deviceClass,
- deviceSubclass );
+ return Integration::KeyEvent(keyName,
+ logicalKey,
+ keyString,
+ keyCode,
+ keyModifier,
+ timeStamp,
+ keyState,
+ compose,
+ deviceName,
+ deviceClass,
+ deviceSubclass);
}
} // Anonymous namespace
/*
* This test checks popup creation.
*/
-int UtcDaliPopupNewP( void )
+int UtcDaliPopupNewP(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliPopupNewP" );
+ tet_infoline(" UtcDaliPopupNewP");
// Create the Popup actor.
Popup popup;
- DALI_TEST_CHECK( !popup );
+ DALI_TEST_CHECK(!popup);
popup = Popup::New();
- DALI_TEST_CHECK( popup );
+ DALI_TEST_CHECK(popup);
- Popup popup2( popup );
+ Popup popup2(popup);
- DALI_TEST_CHECK( popup2 == popup );
+ DALI_TEST_CHECK(popup2 == popup);
// Additional check to ensure object is created by checking if it's registered.
ObjectRegistry registry = application.GetCore().GetObjectRegistry();
- DALI_TEST_CHECK( registry );
+ DALI_TEST_CHECK(registry);
gObjectCreatedCallBackCalled = false;
- registry.ObjectCreatedSignal().Connect( &TestCallback );
+ registry.ObjectCreatedSignal().Connect(&TestCallback);
{
Popup popup = Popup::New();
}
- DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
+ DALI_TEST_CHECK(gObjectCreatedCallBackCalled);
END_TEST;
}
/*
* This test checks popup destruction.
*/
-int UtcDaliPopupDestructorP( void )
+int UtcDaliPopupDestructorP(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliPopupDestructorP" );
+ tet_infoline(" UtcDaliPopupDestructorP");
Popup* popup = new Popup();
delete popup;
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
END_TEST;
}
int UtcDaliPopupDownCastP(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliPopupDownCastP" );
+ tet_infoline(" UtcDaliPopupDownCastP");
Handle handle = Popup::New();
- Popup popup = Popup::DownCast( handle );
+ Popup popup = Popup::DownCast(handle);
- DALI_TEST_CHECK( popup == handle );
+ DALI_TEST_CHECK(popup == handle);
END_TEST;
}
int UtcDaliPopupSetPropertyP(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliPopupSetProperty" );
+ tet_infoline(" UtcDaliPopupSetProperty");
Popup popup = Popup::New();
//Test properties
std::string testString = "Hello World";
- TextLabel textActorIn = TextLabel::New( testString );
+ TextLabel textActorIn = TextLabel::New(testString);
Property::Map map;
- Scripting::CreatePropertyMap( textActorIn, map );
- popup.SetProperty( popup.GetPropertyIndex( "title" ), map );
- TextLabel textActorOut = TextLabel::DownCast( popup.GetTitle() );
+ Scripting::CreatePropertyMap(textActorIn, map);
+ popup.SetProperty(popup.GetPropertyIndex("title"), map);
+ TextLabel textActorOut = TextLabel::DownCast(popup.GetTitle());
std::string resultText;
- DALI_TEST_CHECK( textActorOut.GetProperty( Toolkit::TextLabel::Property::TEXT ).Get( resultText ) );
- DALI_TEST_EQUALS( testString, resultText, TEST_LOCATION );
+ DALI_TEST_CHECK(textActorOut.GetProperty(Toolkit::TextLabel::Property::TEXT).Get(resultText));
+ DALI_TEST_EQUALS(testString, resultText, TEST_LOCATION);
END_TEST;
}
int UtcDaliPopupSetTitleP(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
- tet_infoline( " UtcDaliPopupSetTitleP" );
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ tet_infoline(" UtcDaliPopupSetTitleP");
// Create the Popup actor
Popup popup = Popup::New();
// Put in show state so it's layer is connected to popup (for ancestor check).
- popup.SetDisplayState( Popup::SHOWN );
+ popup.SetDisplayState(Popup::SHOWN);
TextLabel titleActor = TextLabel::New();
- titleActor.SetProperty( Toolkit::TextLabel::Property::TEXT, "title" );
+ titleActor.SetProperty(Toolkit::TextLabel::Property::TEXT, "title");
- DALI_TEST_CHECK( !popup.GetTitle() );
- popup.SetTitle( titleActor );
- TextLabel textActor = TextLabel::DownCast( popup.GetTitle() );
- DALI_TEST_CHECK( textActor == titleActor );
+ DALI_TEST_CHECK(!popup.GetTitle());
+ popup.SetTitle(titleActor);
+ TextLabel textActor = TextLabel::DownCast(popup.GetTitle());
+ DALI_TEST_CHECK(textActor == titleActor);
std::string resultText;
- DALI_TEST_CHECK( textActor.GetProperty( Toolkit::TextLabel::Property::TEXT ).Get( resultText ) );
+ DALI_TEST_CHECK(textActor.GetProperty(Toolkit::TextLabel::Property::TEXT).Get(resultText));
- DALI_TEST_CHECK( ( popup.GetTitle() ) && ( resultText == "title" ) );
+ DALI_TEST_CHECK((popup.GetTitle()) && (resultText == "title"));
// verify titleActor is actually inside popup, and not elsewhere on stage, or off even.
- DALI_TEST_CHECK( HasAncestor( titleActor, popup ) );
+ DALI_TEST_CHECK(HasAncestor(titleActor, popup));
TextLabel titleActor2 = TextLabel::New();
- titleActor2.SetProperty( Toolkit::TextLabel::Property::TEXT, "anothertitle" );
- popup.SetTitle( titleActor2 );
- DALI_TEST_CHECK( popup.GetTitle() != titleActor );
- DALI_TEST_CHECK( popup.GetTitle() == titleActor2 );
- DALI_TEST_CHECK( TextLabel::DownCast( popup.GetTitle() ).GetProperty( Toolkit::TextLabel::Property::TEXT ).Get( resultText ) );
+ titleActor2.SetProperty(Toolkit::TextLabel::Property::TEXT, "anothertitle");
+ popup.SetTitle(titleActor2);
+ DALI_TEST_CHECK(popup.GetTitle() != titleActor);
+ DALI_TEST_CHECK(popup.GetTitle() == titleActor2);
+ DALI_TEST_CHECK(TextLabel::DownCast(popup.GetTitle()).GetProperty(Toolkit::TextLabel::Property::TEXT).Get(resultText));
- DALI_TEST_CHECK( ( popup.GetTitle() ) && ( resultText == "anothertitle" ) );
+ DALI_TEST_CHECK((popup.GetTitle()) && (resultText == "anothertitle"));
// verify titleActor is actually inside popup, and not elsewhere on stage, or off even.
- DALI_TEST_CHECK( HasAncestor( titleActor2, popup ) );
+ DALI_TEST_CHECK(HasAncestor(titleActor2, popup));
END_TEST;
}
int UtcDaliPopupSetTitleN(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
- tet_infoline( " UtcDaliPopupSetTitleN" );
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ tet_infoline(" UtcDaliPopupSetTitleN");
// Create the Popup actor
Popup popup = Popup::New();
- TextLabel titleActor = TextLabel::New( "text" );
- popup.SetTitle( titleActor );
+ TextLabel titleActor = TextLabel::New("text");
+ popup.SetTitle(titleActor);
- DALI_TEST_CHECK( popup.GetTitle() );
+ DALI_TEST_CHECK(popup.GetTitle());
// Set a bad title value.
// Confirm this has disabled the title.
Actor badActor;
- popup.SetTitle( badActor );
+ popup.SetTitle(badActor);
- DALI_TEST_CHECK( !popup.GetTitle() );
+ DALI_TEST_CHECK(!popup.GetTitle());
END_TEST;
}
int UtcDaliPopupSetContentP(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
- tet_infoline( " UtcDaliPopupSetContentP" );
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ tet_infoline(" UtcDaliPopupSetContentP");
// Create the Popup actor
Popup popup = Popup::New();
- application.GetScene().Add( popup );
- popup.SetProperty( Toolkit::Popup::Property::ANIMATION_DURATION, 0.0f );
+ application.GetScene().Add(popup);
+ popup.SetProperty(Toolkit::Popup::Property::ANIMATION_DURATION, 0.0f);
// Put in show state so it's layer is connected to popup (for ancestor check).
- popup.SetDisplayState( Popup::SHOWN );
+ popup.SetDisplayState(Popup::SHOWN);
PushButton button = PushButton::New();
- DALI_TEST_CHECK( !HasAncestor( button, popup ) );
- popup.SetFooter( button );
+ DALI_TEST_CHECK(!HasAncestor(button, popup));
+ popup.SetFooter(button);
// Hide and then re-show popup to cause button to be rearranged and added to popup.
- popup.SetDisplayState( Popup::HIDDEN );
- popup.SetDisplayState( Popup::SHOWN );
- DALI_TEST_CHECK( HasAncestor( button, popup ) );
+ popup.SetDisplayState(Popup::HIDDEN);
+ popup.SetDisplayState(Popup::SHOWN);
+ DALI_TEST_CHECK(HasAncestor(button, popup));
END_TEST;
}
int UtcDaliPopupSetContentN(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
- tet_infoline( " UtcDaliPopupSetContentN" );
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ tet_infoline(" UtcDaliPopupSetContentN");
// Create the Popup actor
Popup popup = Popup::New();
- TextLabel content = TextLabel::New( "text" );
- popup.SetContent( content );
+ TextLabel content = TextLabel::New("text");
+ popup.SetContent(content);
- DALI_TEST_CHECK( popup.GetContent() );
+ DALI_TEST_CHECK(popup.GetContent());
// Set a bad title value.
Actor badActor;
- popup.SetContent( badActor );
+ popup.SetContent(badActor);
- DALI_TEST_CHECK( !popup.GetContent() );
+ DALI_TEST_CHECK(!popup.GetContent());
END_TEST;
}
int UtcDaliPopupSetFooterP(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
tet_infoline(" UtcDaliPopupSetFooterP");
// Create the Popup actor
Popup popup = Popup::New();
- application.GetScene().Add( popup );
- popup.SetProperty( Toolkit::Popup::Property::ANIMATION_DURATION, 0.0f );
+ application.GetScene().Add(popup);
+ popup.SetProperty(Toolkit::Popup::Property::ANIMATION_DURATION, 0.0f);
// Put in show state so it's layer is connected to popup (for ancestor check).
- popup.SetDisplayState( Popup::SHOWN );
+ popup.SetDisplayState(Popup::SHOWN);
PushButton button = PushButton::New();
- DALI_TEST_CHECK( !HasAncestor(button, popup) );
- popup.SetFooter( button );
+ DALI_TEST_CHECK(!HasAncestor(button, popup));
+ popup.SetFooter(button);
// Hide and then re-show popup to cause button to be rearranged and added to popup.
- popup.SetDisplayState( Popup::HIDDEN );
- popup.SetDisplayState( Popup::SHOWN );
- DALI_TEST_CHECK( HasAncestor( button, popup ) );
+ popup.SetDisplayState(Popup::HIDDEN);
+ popup.SetDisplayState(Popup::SHOWN);
+ DALI_TEST_CHECK(HasAncestor(button, popup));
END_TEST;
}
int UtcDaliPopupSetFooterN(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
tet_infoline(" UtcDaliPopupSetFooterN");
// Create the Popup actor
Popup popup = Popup::New();
PushButton button = PushButton::New();
- popup.SetFooter( button );
+ popup.SetFooter(button);
- DALI_TEST_CHECK( popup.GetFooter() );
+ DALI_TEST_CHECK(popup.GetFooter());
// Set a bad title value.
Actor badActor;
- popup.SetFooter( badActor );
+ popup.SetFooter(badActor);
- DALI_TEST_CHECK( !popup.GetFooter() );
+ DALI_TEST_CHECK(!popup.GetFooter());
END_TEST;
}
int UtcDaliPopupSetControlFooterMultiple(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
tet_infoline(" UtcDaliPopupSetControlFooterMultiple");
// Create the Popup actor
Popup popup = Popup::New();
- application.GetScene().Add( popup );
- popup.SetProperty( Toolkit::Popup::Property::ANIMATION_DURATION, 0.0f );
+ application.GetScene().Add(popup);
+ popup.SetProperty(Toolkit::Popup::Property::ANIMATION_DURATION, 0.0f);
// Put in show state so it's layer is connected to popup (for ancestor check).
- popup.SetDisplayState( Popup::SHOWN );
+ popup.SetDisplayState(Popup::SHOWN);
- Actor container = Actor::New();
- PushButton button1 = PushButton::New();
- PushButton button2 = PushButton::New();
- DALI_TEST_CHECK( !HasAncestor( button1, popup ) );
- DALI_TEST_CHECK( !HasAncestor( button2, popup ) );
- container.Add( button1 );
- container.Add( button2 );
- popup.SetFooter( container );
+ Actor container = Actor::New();
+ PushButton button1 = PushButton::New();
+ PushButton button2 = PushButton::New();
+ DALI_TEST_CHECK(!HasAncestor(button1, popup));
+ DALI_TEST_CHECK(!HasAncestor(button2, popup));
+ container.Add(button1);
+ container.Add(button2);
+ popup.SetFooter(container);
// Hide and then re-show popup to cause button to be rearranged and added to popup.
- popup.SetDisplayState( Popup::HIDDEN );
- popup.SetDisplayState( Popup::SHOWN );
- DALI_TEST_CHECK( HasAncestor( button1, popup ) );
- DALI_TEST_CHECK( HasAncestor( button2, popup ) );
+ popup.SetDisplayState(Popup::HIDDEN);
+ popup.SetDisplayState(Popup::SHOWN);
+ DALI_TEST_CHECK(HasAncestor(button1, popup));
+ DALI_TEST_CHECK(HasAncestor(button2, popup));
END_TEST;
}
int UtcDaliPopupSetTitleAndFooter(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
- tet_infoline( " UtcDaliPopupSetTitleAndFooter" );
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ tet_infoline(" UtcDaliPopupSetTitleAndFooter");
// Create the Popup actor
Popup popup = Popup::New();
// Put in show state so it's layer is connected to popup (for ancestor check).
- popup.SetDisplayState( Popup::SHOWN );
+ popup.SetDisplayState(Popup::SHOWN);
// Add the title
TextLabel titleActor = TextLabel::New();
- titleActor.SetProperty( Toolkit::TextLabel::Property::TEXT, "title" );
+ titleActor.SetProperty(Toolkit::TextLabel::Property::TEXT, "title");
- DALI_TEST_CHECK( !popup.GetTitle() );
- popup.SetTitle( titleActor );
- TextLabel textActor = TextLabel::DownCast( popup.GetTitle() );
- DALI_TEST_CHECK( textActor == titleActor );
+ DALI_TEST_CHECK(!popup.GetTitle());
+ popup.SetTitle(titleActor);
+ TextLabel textActor = TextLabel::DownCast(popup.GetTitle());
+ DALI_TEST_CHECK(textActor == titleActor);
std::string resultText;
- DALI_TEST_CHECK( textActor.GetProperty( Toolkit::TextLabel::Property::TEXT ).Get( resultText ) );
- DALI_TEST_CHECK( ( popup.GetTitle() ) && ( resultText == "title" ) );
+ DALI_TEST_CHECK(textActor.GetProperty(Toolkit::TextLabel::Property::TEXT).Get(resultText));
+ DALI_TEST_CHECK((popup.GetTitle()) && (resultText == "title"));
// verify titleActor is actually inside popup, and not elsewhere on stage, or off even.
- DALI_TEST_CHECK( HasAncestor( titleActor, popup ) );
+ DALI_TEST_CHECK(HasAncestor(titleActor, popup));
// Add the footer
PushButton button = PushButton::New();
- DALI_TEST_CHECK( !HasAncestor(button, popup) );
- popup.SetFooter( button );
+ DALI_TEST_CHECK(!HasAncestor(button, popup));
+ popup.SetFooter(button);
// Hide and then re-show popup to cause button to be rearranged and added to popup.
- popup.SetDisplayState( Popup::HIDDEN );
- popup.SetDisplayState( Popup::SHOWN );
- DALI_TEST_CHECK( HasAncestor( button, popup ) );
+ popup.SetDisplayState(Popup::HIDDEN);
+ popup.SetDisplayState(Popup::SHOWN);
+ DALI_TEST_CHECK(HasAncestor(button, popup));
END_TEST;
}
int UtcDaliPopupSetStateP(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
tet_infoline(" UtcDaliPopupSetStateP");
// Create the Popup actor
Popup popup = Popup::New();
- popup.SetProperty( Toolkit::Popup::Property::ANIMATION_DURATION, 0.0f );
+ popup.SetProperty(Toolkit::Popup::Property::ANIMATION_DURATION, 0.0f);
- DALI_TEST_EQUALS( popup.GetDisplayState(), Popup::HIDDEN, TEST_LOCATION );
+ DALI_TEST_EQUALS(popup.GetDisplayState(), Popup::HIDDEN, TEST_LOCATION);
- popup.SetDisplayState( Popup::SHOWN );
- DALI_TEST_EQUALS( Popup::SHOWN, popup.GetDisplayState(), TEST_LOCATION );
+ popup.SetDisplayState(Popup::SHOWN);
+ DALI_TEST_EQUALS(Popup::SHOWN, popup.GetDisplayState(), TEST_LOCATION);
- popup.SetDisplayState( Popup::HIDDEN );
- DALI_TEST_EQUALS( Popup::HIDDEN, popup.GetDisplayState(), TEST_LOCATION );
+ popup.SetDisplayState(Popup::HIDDEN);
+ DALI_TEST_EQUALS(Popup::HIDDEN, popup.GetDisplayState(), TEST_LOCATION);
END_TEST;
}
int UtcDaliPopupSetStateN(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
tet_infoline(" UtcDaliPopupSetStateN");
// Create the Popup actor
Popup popup = Popup::New();
- popup.SetProperty( Toolkit::Popup::Property::ANIMATION_DURATION, 1.0f );
+ popup.SetProperty(Toolkit::Popup::Property::ANIMATION_DURATION, 1.0f);
- DALI_TEST_EQUALS( popup.GetDisplayState(), Popup::HIDDEN, TEST_LOCATION );
+ DALI_TEST_EQUALS(popup.GetDisplayState(), Popup::HIDDEN, TEST_LOCATION);
- popup.SetDisplayState( Popup::SHOWN );
- DALI_TEST_EQUALS( Popup::SHOWING, popup.GetDisplayState(), TEST_LOCATION );
+ popup.SetDisplayState(Popup::SHOWN);
+ DALI_TEST_EQUALS(Popup::SHOWING, popup.GetDisplayState(), TEST_LOCATION);
// Test cancelling a show before it has finished.
- popup.SetDisplayState( Popup::HIDDEN );
- DALI_TEST_EQUALS( Popup::HIDING, popup.GetDisplayState(), TEST_LOCATION );
+ popup.SetDisplayState(Popup::HIDDEN);
+ DALI_TEST_EQUALS(Popup::HIDING, popup.GetDisplayState(), TEST_LOCATION);
END_TEST;
}
int UtcDaliPopupDisplayStateSignal(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
- tet_infoline( " UtcDaliPopupDisplayStateSignal" );
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ tet_infoline(" UtcDaliPopupDisplayStateSignal");
// Create the Popup actor
Popup popup = Popup::New();
- ConnectStateSignals( popup );
+ ConnectStateSignals(popup);
- popup.SetProperty( Toolkit::Popup::Property::ANIMATION_DURATION, 1.0f );
- popup.SetDisplayState( Popup::SHOWN );
- DALI_TEST_EQUALS( Popup::SHOWING, popup.GetDisplayState(), TEST_LOCATION );
- DALI_TEST_EQUALS( gPopupState, Popup::SHOWING, TEST_LOCATION );
+ popup.SetProperty(Toolkit::Popup::Property::ANIMATION_DURATION, 1.0f);
+ popup.SetDisplayState(Popup::SHOWN);
+ DALI_TEST_EQUALS(Popup::SHOWING, popup.GetDisplayState(), TEST_LOCATION);
+ DALI_TEST_EQUALS(gPopupState, Popup::SHOWING, TEST_LOCATION);
// Wait for a while (allow animation to complete), and then check state.
- for( int i = 0; i < RENDER_ANIMATION_TEST_DURATION_FRAMES; i++)
+ for(int i = 0; i < RENDER_ANIMATION_TEST_DURATION_FRAMES; i++)
{
application.SendNotification();
- application.Render( RENDER_FRAME_INTERVAL );
+ application.Render(RENDER_FRAME_INTERVAL);
}
- DALI_TEST_EQUALS( Popup::SHOWN, popup.GetDisplayState(), TEST_LOCATION );
- DALI_TEST_EQUALS( gPopupState, Popup::SHOWN, TEST_LOCATION );
+ DALI_TEST_EQUALS(Popup::SHOWN, popup.GetDisplayState(), TEST_LOCATION);
+ DALI_TEST_EQUALS(gPopupState, Popup::SHOWN, TEST_LOCATION);
// Hide slowly
- popup.SetDisplayState( Popup::HIDDEN );
- DALI_TEST_EQUALS( Popup::HIDING, popup.GetDisplayState(), TEST_LOCATION );
- DALI_TEST_EQUALS( gPopupState, Popup::HIDING, TEST_LOCATION );
+ popup.SetDisplayState(Popup::HIDDEN);
+ DALI_TEST_EQUALS(Popup::HIDING, popup.GetDisplayState(), TEST_LOCATION);
+ DALI_TEST_EQUALS(gPopupState, Popup::HIDING, TEST_LOCATION);
// Wait for a while (allow animation to complete), and then check state.
- for( int i = 0; i < RENDER_ANIMATION_TEST_DURATION_FRAMES; i++)
+ for(int i = 0; i < RENDER_ANIMATION_TEST_DURATION_FRAMES; i++)
{
application.SendNotification();
- application.Render( RENDER_FRAME_INTERVAL );
+ application.Render(RENDER_FRAME_INTERVAL);
}
- DALI_TEST_EQUALS( Popup::HIDDEN, popup.GetDisplayState(), TEST_LOCATION );
- DALI_TEST_EQUALS( gPopupState, Popup::HIDDEN, TEST_LOCATION );
+ DALI_TEST_EQUALS(Popup::HIDDEN, popup.GetDisplayState(), TEST_LOCATION);
+ DALI_TEST_EQUALS(gPopupState, Popup::HIDDEN, TEST_LOCATION);
END_TEST;
}
int UtcDaliPopupShowHide(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
tet_infoline(" UtcDaliPopupShowHide");
// Create the Popup actor
Popup popup = Popup::New();
- ConnectStateSignals( popup );
+ ConnectStateSignals(popup);
- Actor container = Actor::New();
- PushButton button1 = PushButton::New();
- PushButton button2 = PushButton::New();
- button1.SetProperty( Actor::Property::SIZE, DEFAULT_BUTTON_SIZE.GetVectorXY() );
- button2.SetProperty( Actor::Property::SIZE, DEFAULT_BUTTON_SIZE.GetVectorXY() );
- container.Add( button1 );
- container.Add( button2 );
- popup.SetFooter( container );
+ Actor container = Actor::New();
+ PushButton button1 = PushButton::New();
+ PushButton button2 = PushButton::New();
+ button1.SetProperty(Actor::Property::SIZE, DEFAULT_BUTTON_SIZE.GetVectorXY());
+ button2.SetProperty(Actor::Property::SIZE, DEFAULT_BUTTON_SIZE.GetVectorXY());
+ container.Add(button1);
+ container.Add(button2);
+ popup.SetFooter(container);
// Show
// Note: in most popup animation implementations show would result in
// popup being onstage immediately following Show(). However we can't
// assume for all. e.g. If one creates a animation with a delay.
- popup.SetDisplayState( Popup::SHOWN );
+ popup.SetDisplayState(Popup::SHOWN);
// Wait for a while (allow animation to complete), and then check state.
for(int i = 0; i < RENDER_ANIMATION_TEST_DURATION_FRAMES; i++)
{
application.SendNotification();
- application.Render( RENDER_FRAME_INTERVAL );
+ application.Render(RENDER_FRAME_INTERVAL);
}
// Hide
- popup.SetDisplayState( Popup::HIDDEN );
+ popup.SetDisplayState(Popup::HIDDEN);
// Wait for a while (allow animation to complete), and then check state.
for(int i = 0; i < RENDER_ANIMATION_TEST_DURATION_FRAMES; i++)
application.Render(RENDER_FRAME_INTERVAL);
}
- DALI_TEST_EQUALS( gPopupState, Popup::HIDDEN, TEST_LOCATION );
+ DALI_TEST_EQUALS(gPopupState, Popup::HIDDEN, TEST_LOCATION);
END_TEST;
}
int UtcDaliPopupPropertyTailVisibility(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
tet_infoline(" UtcDaliPopupShowHideTail");
// Create the Popup actor
Popup popup = Popup::New();
- application.GetScene().Add( popup );
+ application.GetScene().Add(popup);
- popup.SetProperty( Popup::Property::TAIL_VISIBILITY, false );
- popup.SetDisplayState( Popup::SHOWN );
+ popup.SetProperty(Popup::Property::TAIL_VISIBILITY, false);
+ popup.SetDisplayState(Popup::SHOWN);
- int withoutTailCount = DescendentCount( popup );
+ int withoutTailCount = DescendentCount(popup);
- popup.SetDisplayState( Popup::HIDDEN );
+ popup.SetDisplayState(Popup::HIDDEN);
- popup.SetProperty( Popup::Property::TAIL_POSITION, "BOTTOM_CENTER" );
- popup.SetProperty( Popup::Property::TAIL_VISIBILITY, true );
- popup.SetDisplayState( Popup::SHOWN );
+ popup.SetProperty(Popup::Property::TAIL_POSITION, "BOTTOM_CENTER");
+ popup.SetProperty(Popup::Property::TAIL_VISIBILITY, true);
+ popup.SetDisplayState(Popup::SHOWN);
- int withTailCount = DescendentCount( popup );
+ int withTailCount = DescendentCount(popup);
// There should be more actors if the Tail has been added.
- DALI_TEST_CHECK( withTailCount > withoutTailCount );
+ DALI_TEST_CHECK(withTailCount > withoutTailCount);
// Hide again
- popup.SetDisplayState( Popup::HIDDEN );
- popup.SetProperty( Popup::Property::TAIL_VISIBILITY, false );
- popup.SetDisplayState( Popup::SHOWN );
+ popup.SetDisplayState(Popup::HIDDEN);
+ popup.SetProperty(Popup::Property::TAIL_VISIBILITY, false);
+ popup.SetDisplayState(Popup::SHOWN);
int withoutTailCount2 = DescendentCount(popup);
- DALI_TEST_CHECK( withTailCount > withoutTailCount2 );
+ DALI_TEST_CHECK(withTailCount > withoutTailCount2);
END_TEST;
}
int UtcDaliPopupOnTouchedOutsideSignal(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
tet_infoline(" UtcDaliPopupOnTouchedOutside");
// Create the Popup actor
Popup popup = Popup::New();
- popup.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- popup.SetProperty( Actor::Property::ANCHOR_POINT, ParentOrigin::CENTER );
- popup.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
- popup.SetProperty( Actor::Property::SIZE, Vector2( 50.0f, 50.0f ) );
- popup.SetProperty( Popup::Property::ANIMATION_DURATION, 0.0f );
- application.GetScene().Add( popup );
- popup.OutsideTouchedSignal().Connect( &OnPopupTouchedOutside );
- popup.SetDisplayState( Popup::SHOWN );
+ popup.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ popup.SetProperty(Actor::Property::ANCHOR_POINT, ParentOrigin::CENTER);
+ popup.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
+ popup.SetProperty(Actor::Property::SIZE, Vector2(50.0f, 50.0f));
+ popup.SetProperty(Popup::Property::ANIMATION_DURATION, 0.0f);
+ application.GetScene().Add(popup);
+ popup.OutsideTouchedSignal().Connect(&OnPopupTouchedOutside);
+ popup.SetDisplayState(Popup::SHOWN);
application.SendNotification();
application.Render();
Dali::Integration::TouchEvent event;
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointDown() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointDown());
+ application.ProcessEvent(event);
application.SendNotification();
application.Render();
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointUp() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointUp());
+ application.ProcessEvent(event);
application.SendNotification();
application.Render();
// Confirm the signal is ignored if touch_transparent.
gTouchedOutside = false;
- popup.SetProperty( Popup::Property::TOUCH_TRANSPARENT, true );
+ popup.SetProperty(Popup::Property::TOUCH_TRANSPARENT, true);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointDown() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointDown());
+ application.ProcessEvent(event);
application.SendNotification();
application.Render();
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointUp() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointUp());
+ application.ProcessEvent(event);
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( !gTouchedOutside );
+ DALI_TEST_CHECK(!gTouchedOutside);
END_TEST;
}
int UtcDaliPopupPropertyAutoHide(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
- tet_infoline( " UtcDaliPopupPropertyAutoHide" );
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ tet_infoline(" UtcDaliPopupPropertyAutoHide");
// Create the Popup actor
Popup popup = Popup::New();
- ConnectStateSignals( popup );
+ ConnectStateSignals(popup);
- Actor container = Actor::New();
- PushButton button1 = PushButton::New();
- button1.SetProperty( Actor::Property::SIZE, DEFAULT_BUTTON_SIZE.GetVectorXY() );
- container.Add( button1 );
- popup.SetFooter( container );
+ Actor container = Actor::New();
+ PushButton button1 = PushButton::New();
+ button1.SetProperty(Actor::Property::SIZE, DEFAULT_BUTTON_SIZE.GetVectorXY());
+ container.Add(button1);
+ popup.SetFooter(container);
- popup.SetProperty( Popup::Property::ANIMATION_DURATION, 0.0f );
+ popup.SetProperty(Popup::Property::ANIMATION_DURATION, 0.0f);
float getAnimationDuration = 0.0f;
- DALI_TEST_CHECK( popup.GetProperty( Popup::Property::ANIMATION_DURATION ).Get( getAnimationDuration ) );
- DALI_TEST_EQUALS( getAnimationDuration, 0.0f, Math::MACHINE_EPSILON_0, TEST_LOCATION );
+ DALI_TEST_CHECK(popup.GetProperty(Popup::Property::ANIMATION_DURATION).Get(getAnimationDuration));
+ DALI_TEST_EQUALS(getAnimationDuration, 0.0f, Math::MACHINE_EPSILON_0, TEST_LOCATION);
- popup.SetProperty( Popup::Property::AUTO_HIDE_DELAY, 200 );
+ popup.SetProperty(Popup::Property::AUTO_HIDE_DELAY, 200);
int getAutoHideDelay = 0;
- DALI_TEST_CHECK( popup.GetProperty( Popup::Property::AUTO_HIDE_DELAY ).Get( getAutoHideDelay ) );
- DALI_TEST_EQUALS( getAutoHideDelay, 200, TEST_LOCATION );
+ DALI_TEST_CHECK(popup.GetProperty(Popup::Property::AUTO_HIDE_DELAY).Get(getAutoHideDelay));
+ DALI_TEST_EQUALS(getAutoHideDelay, 200, TEST_LOCATION);
- application.GetScene().Add( popup );
+ application.GetScene().Add(popup);
- DALI_TEST_EQUALS( gPopupState, Popup::HIDDEN, TEST_LOCATION );
+ DALI_TEST_EQUALS(gPopupState, Popup::HIDDEN, TEST_LOCATION);
// Show
// Note: in most popup animation implementations show would result in
// popup being onstage immediately following Show(). However we can't
// assume for all. e.g. If one creates a animation with a delay.
- popup.SetDisplayState( Popup::SHOWN );
+ popup.SetDisplayState(Popup::SHOWN);
- DALI_TEST_EQUALS( gPopupState, Popup::SHOWN, TEST_LOCATION );
+ DALI_TEST_EQUALS(gPopupState, Popup::SHOWN, TEST_LOCATION);
- for( int i = 0; i < RENDER_ANIMATION_TEST_DURATION_FRAMES; i++ )
+ for(int i = 0; i < RENDER_ANIMATION_TEST_DURATION_FRAMES; i++)
{
application.SendNotification();
- application.Render( RENDER_FRAME_INTERVAL );
+ application.Render(RENDER_FRAME_INTERVAL);
}
// Force the timer used by the popup to expire,
// this will cause the popup to hide automatically.
- Dali::Timer timer = Timer::New( 0 );
+ Dali::Timer timer = Timer::New(0);
timer.MockEmitSignal();
- DALI_TEST_EQUALS( gPopupState, Popup::HIDDEN, TEST_LOCATION );
+ DALI_TEST_EQUALS(gPopupState, Popup::HIDDEN, TEST_LOCATION);
END_TEST;
}
*/
int UtcDaliPopupPropertyAnimationMode(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
- tet_infoline( " UtcDaliPopupPropertyAnimationMode" );
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ tet_infoline(" UtcDaliPopupPropertyAnimationMode");
// Create the Popup actor
Popup popup = Popup::New();
- ConnectStateSignals( popup );
- popup.SetTitle( TextLabel::New( "Title" ) );
- application.GetScene().Add( popup );
+ ConnectStateSignals(popup);
+ popup.SetTitle(TextLabel::New("Title"));
+ application.GetScene().Add(popup);
- std::string animationModes[] = { "NONE", "ZOOM", "FADE", "CUSTOM" };
+ std::string animationModes[] = {"NONE", "ZOOM", "FADE", "CUSTOM"};
// Try both default and zero animation duration, as zero has a special case for some animation types.
- for( int j = 0; j <= 1; j++ )
+ for(int j = 0; j <= 1; j++)
{
// On the second loop, set duration to zero.
- if( j == 1 )
+ if(j == 1)
{
- popup.SetProperty( Popup::Property::ANIMATION_DURATION, 0.0f );
+ popup.SetProperty(Popup::Property::ANIMATION_DURATION, 0.0f);
}
// Loop through 4 animation modes.
- for( int i = 0; i < 4; i++ )
+ for(int i = 0; i < 4; i++)
{
- popup.SetProperty( Popup::Property::ANIMATION_MODE, animationModes[i] );
+ popup.SetProperty(Popup::Property::ANIMATION_MODE, animationModes[i]);
std::string checkMode;
- DALI_TEST_CHECK( popup.GetProperty( Popup::Property::ANIMATION_MODE ).Get( checkMode ) )
+ DALI_TEST_CHECK(popup.GetProperty(Popup::Property::ANIMATION_MODE).Get(checkMode))
- DALI_TEST_EQUALS( checkMode, animationModes[i], TEST_LOCATION );
+ DALI_TEST_EQUALS(checkMode, animationModes[i], TEST_LOCATION);
- popup.SetProperty( Toolkit::Popup::Property::DISPLAY_STATE, "SHOWN" );
+ popup.SetProperty(Toolkit::Popup::Property::DISPLAY_STATE, "SHOWN");
std::string resultState;
// Only wait for animation if it isn't instant.
- if( j == 0 )
+ if(j == 0)
{
- DALI_TEST_EQUALS( gPopupState, Popup::SHOWING, TEST_LOCATION );
- DALI_TEST_CHECK( popup.GetProperty( Toolkit::Popup::Property::DISPLAY_STATE ).Get( resultState ) );
- DALI_TEST_EQUALS( resultState, "SHOWING", TEST_LOCATION );
- WaitAnimation( application );
+ DALI_TEST_EQUALS(gPopupState, Popup::SHOWING, TEST_LOCATION);
+ DALI_TEST_CHECK(popup.GetProperty(Toolkit::Popup::Property::DISPLAY_STATE).Get(resultState));
+ DALI_TEST_EQUALS(resultState, "SHOWING", TEST_LOCATION);
+ WaitAnimation(application);
}
- DALI_TEST_EQUALS( gPopupState, Popup::SHOWN, TEST_LOCATION );
- DALI_TEST_CHECK( popup.GetProperty( Toolkit::Popup::Property::DISPLAY_STATE ).Get( resultState ) );
- DALI_TEST_EQUALS( resultState, "SHOWN", TEST_LOCATION );
- popup.SetDisplayState( Popup::HIDDEN );
+ DALI_TEST_EQUALS(gPopupState, Popup::SHOWN, TEST_LOCATION);
+ DALI_TEST_CHECK(popup.GetProperty(Toolkit::Popup::Property::DISPLAY_STATE).Get(resultState));
+ DALI_TEST_EQUALS(resultState, "SHOWN", TEST_LOCATION);
+ popup.SetDisplayState(Popup::HIDDEN);
- if( j == 0 )
+ if(j == 0)
{
- DALI_TEST_EQUALS( gPopupState, Popup::HIDING, TEST_LOCATION );
- DALI_TEST_CHECK( popup.GetProperty( Toolkit::Popup::Property::DISPLAY_STATE ).Get( resultState ) );
- DALI_TEST_EQUALS( resultState, "HIDING", TEST_LOCATION );
- WaitAnimation( application );
+ DALI_TEST_EQUALS(gPopupState, Popup::HIDING, TEST_LOCATION);
+ DALI_TEST_CHECK(popup.GetProperty(Toolkit::Popup::Property::DISPLAY_STATE).Get(resultState));
+ DALI_TEST_EQUALS(resultState, "HIDING", TEST_LOCATION);
+ WaitAnimation(application);
}
- DALI_TEST_EQUALS( gPopupState, Popup::HIDDEN, TEST_LOCATION );
- DALI_TEST_CHECK( popup.GetProperty( Toolkit::Popup::Property::DISPLAY_STATE ).Get( resultState ) );
- DALI_TEST_EQUALS( resultState, "HIDDEN", TEST_LOCATION );
+ DALI_TEST_EQUALS(gPopupState, Popup::HIDDEN, TEST_LOCATION);
+ DALI_TEST_CHECK(popup.GetProperty(Toolkit::Popup::Property::DISPLAY_STATE).Get(resultState));
+ DALI_TEST_EQUALS(resultState, "HIDDEN", TEST_LOCATION);
}
}
int UtcDaliPopupPropertyTitle(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliPopupPropertyTitle" );
+ tet_infoline(" UtcDaliPopupPropertyTitle");
// Create the Popup actor
Popup popup = Popup::New();
std::string testLabelText = "TitleTest";
- TextLabel titleLabel = TextLabel::New();
- titleLabel.SetProperty( Toolkit::TextLabel::Property::TEXT, testLabelText );
- Actor title = titleLabel;
+ TextLabel titleLabel = TextLabel::New();
+ titleLabel.SetProperty(Toolkit::TextLabel::Property::TEXT, testLabelText);
+ Actor title = titleLabel;
Property::Map map;
- Scripting::CreatePropertyMap( title, map );
- popup.SetProperty( Toolkit::Popup::Property::TITLE, map );
+ Scripting::CreatePropertyMap(title, map);
+ popup.SetProperty(Toolkit::Popup::Property::TITLE, map);
Property::Map resultMap;
- DALI_TEST_CHECK( popup.GetProperty( Toolkit::Popup::Property::TITLE ).Get( resultMap ) );
+ DALI_TEST_CHECK(popup.GetProperty(Toolkit::Popup::Property::TITLE).Get(resultMap));
- Property::Value* resultProperty = resultMap.Find( "text" );
- DALI_TEST_CHECK( resultProperty );
+ Property::Value* resultProperty = resultMap.Find("text");
+ DALI_TEST_CHECK(resultProperty);
std::string resultText;
- DALI_TEST_CHECK( resultProperty->Get( resultText ) );
+ DALI_TEST_CHECK(resultProperty->Get(resultText));
- DALI_TEST_EQUALS( resultText, testLabelText, TEST_LOCATION );
+ DALI_TEST_EQUALS(resultText, testLabelText, TEST_LOCATION);
END_TEST;
}
int UtcDaliPopupPropertyContent(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliPopupPropertyContent" );
+ tet_infoline(" UtcDaliPopupPropertyContent");
// Create the Popup actor
Popup popup = Popup::New();
std::string testLabelText = "ContentTest";
- TextLabel contentLabel = TextLabel::New();
- contentLabel.SetProperty( Toolkit::TextLabel::Property::TEXT, testLabelText );
- Actor content = contentLabel;
+ TextLabel contentLabel = TextLabel::New();
+ contentLabel.SetProperty(Toolkit::TextLabel::Property::TEXT, testLabelText);
+ Actor content = contentLabel;
Property::Map map;
- Scripting::CreatePropertyMap( content, map );
- popup.SetProperty( Toolkit::Popup::Property::CONTENT, map );
+ Scripting::CreatePropertyMap(content, map);
+ popup.SetProperty(Toolkit::Popup::Property::CONTENT, map);
Property::Map resultMap;
- DALI_TEST_CHECK( popup.GetProperty( Toolkit::Popup::Property::CONTENT ).Get( resultMap ) );
+ DALI_TEST_CHECK(popup.GetProperty(Toolkit::Popup::Property::CONTENT).Get(resultMap));
- Property::Value* resultProperty = resultMap.Find( "text" );
- DALI_TEST_CHECK( resultProperty );
+ Property::Value* resultProperty = resultMap.Find("text");
+ DALI_TEST_CHECK(resultProperty);
std::string resultText;
- DALI_TEST_CHECK( resultProperty->Get( resultText ) );
+ DALI_TEST_CHECK(resultProperty->Get(resultText));
- DALI_TEST_EQUALS( resultText, testLabelText, TEST_LOCATION );
+ DALI_TEST_EQUALS(resultText, testLabelText, TEST_LOCATION);
END_TEST;
}
int UtcDaliPopupPropertyFooter(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliPopupPropertyFooter" );
+ tet_infoline(" UtcDaliPopupPropertyFooter");
// Create the Popup actor
Popup popup = Popup::New();
std::string testLabelText = "FooterTest";
- TextLabel footerLabel = TextLabel::New();
- footerLabel.SetProperty( Toolkit::TextLabel::Property::TEXT, testLabelText );
- Actor footer = footerLabel;
+ TextLabel footerLabel = TextLabel::New();
+ footerLabel.SetProperty(Toolkit::TextLabel::Property::TEXT, testLabelText);
+ Actor footer = footerLabel;
Property::Map map;
- Scripting::CreatePropertyMap( footer, map );
- popup.SetProperty( Toolkit::Popup::Property::FOOTER, map );
+ Scripting::CreatePropertyMap(footer, map);
+ popup.SetProperty(Toolkit::Popup::Property::FOOTER, map);
Property::Map resultMap;
- DALI_TEST_CHECK( popup.GetProperty( Toolkit::Popup::Property::FOOTER ).Get( resultMap ) );
+ DALI_TEST_CHECK(popup.GetProperty(Toolkit::Popup::Property::FOOTER).Get(resultMap));
- Property::Value* resultProperty = resultMap.Find( "text" );
- DALI_TEST_CHECK( resultProperty );
+ Property::Value* resultProperty = resultMap.Find("text");
+ DALI_TEST_CHECK(resultProperty);
std::string resultText;
- DALI_TEST_CHECK( resultProperty->Get( resultText ) );
+ DALI_TEST_CHECK(resultProperty->Get(resultText));
- DALI_TEST_EQUALS( resultText, testLabelText, TEST_LOCATION );
+ DALI_TEST_EQUALS(resultText, testLabelText, TEST_LOCATION);
END_TEST;
}
int UtcDaliPopupPropertyContextualMode(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliPopupPropertyContextualMode" );
+ tet_infoline(" UtcDaliPopupPropertyContextualMode");
// Create the Popup actor
Popup popup = Popup::New();
- popup.SetProperty( Popup::Property::ANIMATION_DURATION, 0.0f );
+ popup.SetProperty(Popup::Property::ANIMATION_DURATION, 0.0f);
std::string testLabelText = "ContentTest";
TextLabel contentLabel = TextLabel::New();
- popup.SetContent( contentLabel );
+ popup.SetContent(contentLabel);
// Placement actor to parent the popup from so the popup's contextual position can be relative to it.
Actor placement = Actor::New();
- placement.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- placement.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
- placement.SetProperty( Actor::Property::SIZE, Vector2( 1.0f, 1.0f ) );
- placement.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
- application.GetScene().Add( placement );
+ placement.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ placement.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+ placement.SetProperty(Actor::Property::SIZE, Vector2(1.0f, 1.0f));
+ placement.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
+ application.GetScene().Add(placement);
- placement.Add( popup );
+ placement.Add(popup);
// Test all contextual modes.
- const char* mode[5] = { "NON_CONTEXTUAL", "ABOVE", "RIGHT", "BELOW", "LEFT" };
- Vector2 offsetValues[5];
- offsetValues[0] = Vector2( 0.375f, 0.0f );
- offsetValues[1] = Vector2( -0.125f, -10.5f );
- offsetValues[2] = Vector2( 10.875f, -0.5f );
- offsetValues[3] = Vector2( -0.125f, 10.5f );
- offsetValues[4] = Vector2( -10.875f, -0.5f );
-
- for( int i = 0; i < 5; ++i )
+ const char* mode[5] = {"NON_CONTEXTUAL", "ABOVE", "RIGHT", "BELOW", "LEFT"};
+ Vector2 offsetValues[5];
+ offsetValues[0] = Vector2(0.375f, 0.0f);
+ offsetValues[1] = Vector2(-0.125f, -10.5f);
+ offsetValues[2] = Vector2(10.875f, -0.5f);
+ offsetValues[3] = Vector2(-0.125f, 10.5f);
+ offsetValues[4] = Vector2(-10.875f, -0.5f);
+
+ for(int i = 0; i < 5; ++i)
{
- popup.SetProperty( Toolkit::Popup::Property::CONTEXTUAL_MODE, mode[i] );
+ popup.SetProperty(Toolkit::Popup::Property::CONTEXTUAL_MODE, mode[i]);
std::string propertyResult;
- DALI_TEST_CHECK( popup.GetProperty( Toolkit::Popup::Property::CONTEXTUAL_MODE ).Get( propertyResult ) );
- DALI_TEST_EQUALS( propertyResult, std::string( mode[i] ), TEST_LOCATION );
+ DALI_TEST_CHECK(popup.GetProperty(Toolkit::Popup::Property::CONTEXTUAL_MODE).Get(propertyResult));
+ DALI_TEST_EQUALS(propertyResult, std::string(mode[i]), TEST_LOCATION);
- popup.SetDisplayState( Popup::SHOWN );
+ popup.SetDisplayState(Popup::SHOWN);
application.SendNotification();
application.Render();
// Check the position of the label within the popup.
- DALI_TEST_EQUALS( contentLabel.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).GetVectorXY(), offsetValues[i], TEST_LOCATION );
+ DALI_TEST_EQUALS(contentLabel.GetCurrentProperty<Vector3>(Actor::Property::WORLD_POSITION).GetVectorXY(), offsetValues[i], TEST_LOCATION);
- popup.SetDisplayState( Popup::HIDDEN );
+ popup.SetDisplayState(Popup::HIDDEN);
application.SendNotification();
application.Render();
}
int UtcDaliPopupPropertyBacking(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliPopupPropertyBacking" );
+ tet_infoline(" UtcDaliPopupPropertyBacking");
// Create the Popup actor
Popup popup = Popup::New();
- popup.SetProperty( Popup::Property::ANIMATION_DURATION, 0.0f );
- application.GetScene().Add( popup );
+ popup.SetProperty(Popup::Property::ANIMATION_DURATION, 0.0f);
+ application.GetScene().Add(popup);
- Actor backing = popup.FindChildByName( "popupBacking" );
- DALI_TEST_CHECK( backing );
+ Actor backing = popup.FindChildByName("popupBacking");
+ DALI_TEST_CHECK(backing);
- DALI_TEST_EQUALS( backing.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, Math::MACHINE_EPSILON_0, TEST_LOCATION );
+ DALI_TEST_EQUALS(backing.GetCurrentProperty<float>(Actor::Property::OPACITY), 1.0f, Math::MACHINE_EPSILON_0, TEST_LOCATION);
// Check enabled property.
- popup.SetDisplayState( Popup::SHOWN );
+ popup.SetDisplayState(Popup::SHOWN);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( backing.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.5f, Math::MACHINE_EPSILON_0, TEST_LOCATION );
+ DALI_TEST_EQUALS(backing.GetCurrentProperty<float>(Actor::Property::OPACITY), 0.5f, Math::MACHINE_EPSILON_0, TEST_LOCATION);
- popup.SetDisplayState( Popup::HIDDEN );
+ popup.SetDisplayState(Popup::HIDDEN);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( backing.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, Math::MACHINE_EPSILON_0, TEST_LOCATION );
+ DALI_TEST_EQUALS(backing.GetCurrentProperty<float>(Actor::Property::OPACITY), 0.0f, Math::MACHINE_EPSILON_0, TEST_LOCATION);
- popup.SetProperty( Popup::Property::BACKING_ENABLED, false );
+ popup.SetProperty(Popup::Property::BACKING_ENABLED, false);
bool propertyResult;
- DALI_TEST_CHECK( popup.GetProperty( Popup::Property::BACKING_ENABLED ).Get( propertyResult ) );
- DALI_TEST_EQUALS( propertyResult, false, TEST_LOCATION );
+ DALI_TEST_CHECK(popup.GetProperty(Popup::Property::BACKING_ENABLED).Get(propertyResult));
+ DALI_TEST_EQUALS(propertyResult, false, TEST_LOCATION);
- popup.SetDisplayState( Popup::SHOWN );
+ popup.SetDisplayState(Popup::SHOWN);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( backing.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, Math::MACHINE_EPSILON_0, TEST_LOCATION );
+ DALI_TEST_EQUALS(backing.GetCurrentProperty<float>(Actor::Property::OPACITY), 0.0f, Math::MACHINE_EPSILON_0, TEST_LOCATION);
- popup.SetDisplayState( Popup::HIDDEN );
+ popup.SetDisplayState(Popup::HIDDEN);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( backing.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, Math::MACHINE_EPSILON_0, TEST_LOCATION );
+ DALI_TEST_EQUALS(backing.GetCurrentProperty<float>(Actor::Property::OPACITY), 0.0f, Math::MACHINE_EPSILON_0, TEST_LOCATION);
// Check color property.
- popup.SetProperty( Popup::Property::BACKING_ENABLED, true );
- popup.SetProperty( Popup::Property::BACKING_COLOR, Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
+ popup.SetProperty(Popup::Property::BACKING_ENABLED, true);
+ popup.SetProperty(Popup::Property::BACKING_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
- popup.SetDisplayState( Popup::SHOWN );
+ popup.SetDisplayState(Popup::SHOWN);
application.SendNotification();
application.Render();
Vector4 resultColor;
- popup.GetProperty( Popup::Property::BACKING_COLOR ).Get( resultColor );
- DALI_TEST_EQUALS( resultColor, Vector4( 1.0f, 0.0f, 0.0f, 1.0f ), Math::MACHINE_EPSILON_0, TEST_LOCATION );
+ popup.GetProperty(Popup::Property::BACKING_COLOR).Get(resultColor);
+ DALI_TEST_EQUALS(resultColor, Vector4(1.0f, 0.0f, 0.0f, 1.0f), Math::MACHINE_EPSILON_0, TEST_LOCATION);
END_TEST;
}
int UtcDaliPopupPropertyBackgroundImage(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliPopupPropertyBackgroundImage" );
+ tet_infoline(" UtcDaliPopupPropertyBackgroundImage");
// Create the Popup actor
Popup popup = Popup::New();
- application.GetScene().Add( popup );
+ application.GetScene().Add(popup);
// Check setting an image
- popup.SetProperty( Toolkit::Popup::Property::POPUP_BACKGROUND_IMAGE, "invalid-image.png" );
+ popup.SetProperty(Toolkit::Popup::Property::POPUP_BACKGROUND_IMAGE, "invalid-image.png");
std::string resultString;
- popup.GetProperty( Toolkit::Popup::Property::POPUP_BACKGROUND_IMAGE ).Get( resultString );
- DALI_TEST_EQUALS( resultString, "invalid-image.png", TEST_LOCATION );
+ popup.GetProperty(Toolkit::Popup::Property::POPUP_BACKGROUND_IMAGE).Get(resultString);
+ DALI_TEST_EQUALS(resultString, "invalid-image.png", TEST_LOCATION);
END_TEST;
}
int UtcDaliPopupPropertyCustomAnimation(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliPopupPropertyCustomAnimation" );
+ tet_infoline(" UtcDaliPopupPropertyCustomAnimation");
// Create the Popup actor
- Popup popup = Popup::New();
- TextLabel content = TextLabel::New( "text" );
- popup.SetContent( content );
+ Popup popup = Popup::New();
+ TextLabel content = TextLabel::New("text");
+ popup.SetContent(content);
- popup.SetProperty( Popup::Property::ANIMATION_DURATION, 1.0f );
- popup.SetProperty( Popup::Property::ANIMATION_MODE, "CUSTOM" );
+ popup.SetProperty(Popup::Property::ANIMATION_DURATION, 1.0f);
+ popup.SetProperty(Popup::Property::ANIMATION_MODE, "CUSTOM");
- Actor popupContainer = popup.FindChildByName( "popupContainer" );
- DALI_TEST_CHECK( popupContainer );
+ Actor popupContainer = popup.FindChildByName("popupContainer");
+ DALI_TEST_CHECK(popupContainer);
- Vector3 entryAnimationDestination( 300.0f, 200.0f, 0.0f );
- Vector3 exitAnimationDestination( -300.0f, -200.0f, 0.0f );
+ Vector3 entryAnimationDestination(300.0f, 200.0f, 0.0f);
+ Vector3 exitAnimationDestination(-300.0f, -200.0f, 0.0f);
Property::Map animationMapEntry;
- animationMapEntry.Insert( "actor", "customAnimationPopup" );
- animationMapEntry.Insert( "property", "position" );
- animationMapEntry.Insert( "value", entryAnimationDestination );
- animationMapEntry.Insert( "alphaFunction", "EASE_OUT" );
+ animationMapEntry.Insert("actor", "customAnimationPopup");
+ animationMapEntry.Insert("property", "position");
+ animationMapEntry.Insert("value", entryAnimationDestination);
+ animationMapEntry.Insert("alphaFunction", "EASE_OUT");
Property::Array timePeriodMapEntry;
- timePeriodMapEntry.PushBack( 0.0f );
- timePeriodMapEntry.PushBack( 1.0f );
+ timePeriodMapEntry.PushBack(0.0f);
+ timePeriodMapEntry.PushBack(1.0f);
- animationMapEntry.Insert( "timePeriod", timePeriodMapEntry );
+ animationMapEntry.Insert("timePeriod", timePeriodMapEntry);
Property::Map animationMapExit;
- animationMapExit.Insert( "actor", "customAnimationPopup" );
- animationMapExit.Insert( "property", "position" );
- animationMapExit.Insert( "value", exitAnimationDestination );
- animationMapExit.Insert( "alphaFunction", "EASE_IN" );
+ animationMapExit.Insert("actor", "customAnimationPopup");
+ animationMapExit.Insert("property", "position");
+ animationMapExit.Insert("value", exitAnimationDestination);
+ animationMapExit.Insert("alphaFunction", "EASE_IN");
Property::Array timePeriodMapExit;
- timePeriodMapExit.PushBack( 0.0f );
- timePeriodMapExit.PushBack( 1.0f );
+ timePeriodMapExit.PushBack(0.0f);
+ timePeriodMapExit.PushBack(1.0f);
- animationMapExit.Insert( "timePeriod", timePeriodMapExit );
+ animationMapExit.Insert("timePeriod", timePeriodMapExit);
- popup.SetProperty( Toolkit::Popup::Property::ENTRY_ANIMATION, animationMapEntry );
- popup.SetProperty( Toolkit::Popup::Property::EXIT_ANIMATION, animationMapExit );
+ popup.SetProperty(Toolkit::Popup::Property::ENTRY_ANIMATION, animationMapEntry);
+ popup.SetProperty(Toolkit::Popup::Property::EXIT_ANIMATION, animationMapExit);
Property::Map resultMap;
- DALI_TEST_CHECK( popup.GetProperty( Toolkit::Popup::Property::ENTRY_ANIMATION ).Get( resultMap ) );
- DALI_TEST_EQUALS( resultMap.Count(), 0u, TEST_LOCATION );
- DALI_TEST_CHECK( popup.GetProperty( Toolkit::Popup::Property::EXIT_ANIMATION ).Get( resultMap ) );
- DALI_TEST_EQUALS( resultMap.Count(), 0u, TEST_LOCATION );
+ DALI_TEST_CHECK(popup.GetProperty(Toolkit::Popup::Property::ENTRY_ANIMATION).Get(resultMap));
+ DALI_TEST_EQUALS(resultMap.Count(), 0u, TEST_LOCATION);
+ DALI_TEST_CHECK(popup.GetProperty(Toolkit::Popup::Property::EXIT_ANIMATION).Get(resultMap));
+ DALI_TEST_EQUALS(resultMap.Count(), 0u, TEST_LOCATION);
- application.GetScene().Add( popup );
- popup.SetDisplayState( Popup::SHOWN );
+ application.GetScene().Add(popup);
+ popup.SetDisplayState(Popup::SHOWN);
- for( int i = 0; i < RENDER_ANIMATION_TEST_DURATION_FRAMES; i++ )
+ for(int i = 0; i < RENDER_ANIMATION_TEST_DURATION_FRAMES; i++)
{
application.SendNotification();
- application.Render( RENDER_FRAME_INTERVAL );
+ application.Render(RENDER_FRAME_INTERVAL);
}
// Test the popup has animated to it's entry-transition destination.
- DALI_TEST_EQUALS( popupContainer.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), entryAnimationDestination, 0.1f, TEST_LOCATION );
+ DALI_TEST_EQUALS(popupContainer.GetCurrentProperty<Vector3>(Actor::Property::WORLD_POSITION), entryAnimationDestination, 0.1f, TEST_LOCATION);
- popup.SetDisplayState( Popup::HIDDEN );
+ popup.SetDisplayState(Popup::HIDDEN);
- for( int j = 0; j < RENDER_ANIMATION_TEST_DURATION_FRAMES; j++ )
+ for(int j = 0; j < RENDER_ANIMATION_TEST_DURATION_FRAMES; j++)
{
application.SendNotification();
- application.Render( RENDER_FRAME_INTERVAL );
+ application.Render(RENDER_FRAME_INTERVAL);
}
- DALI_TEST_EQUALS( popupContainer.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), exitAnimationDestination, 0.1f, TEST_LOCATION );
+ DALI_TEST_EQUALS(popupContainer.GetCurrentProperty<Vector3>(Actor::Property::WORLD_POSITION), exitAnimationDestination, 0.1f, TEST_LOCATION);
END_TEST;
}
static bool gPushButtonClicked;
-static bool PushButtonClicked( Button button )
+static bool PushButtonClicked(Button button)
{
gPushButtonClicked = true;
return true;
int UtcDaliPopupPropertyTouchTransparent(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliPopupPropertyTouchTransparent" );
+ tet_infoline(" UtcDaliPopupPropertyTouchTransparent");
// Create the Popup actor
- Popup popup = Popup::New();
- TextLabel content = TextLabel::New( "text" );
- popup.SetContent( content );
- popup.SetProperty( Popup::Property::ANIMATION_DURATION, 0.0f );
- popup.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- popup.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- popup.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
- popup.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
+ Popup popup = Popup::New();
+ TextLabel content = TextLabel::New("text");
+ popup.SetContent(content);
+ popup.SetProperty(Popup::Property::ANIMATION_DURATION, 0.0f);
+ popup.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ popup.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ popup.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ popup.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
// Create a button (to go underneath the popup).
PushButton button = Toolkit::PushButton::New();
- button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- button.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
- button.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
+ button.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ button.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ button.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ button.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
- button.ClickedSignal().Connect( &PushButtonClicked );
+ button.ClickedSignal().Connect(&PushButtonClicked);
- application.GetScene().Add( button );
+ application.GetScene().Add(button);
- button.Add( popup );
+ button.Add(popup);
- popup.SetDisplayState( Popup::SHOWN );
+ popup.SetDisplayState(Popup::SHOWN);
application.SendNotification();
application.Render();
// Perform a click, the popup should block the click from hitting the button.
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointDown() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointDown());
+ application.ProcessEvent(event);
application.SendNotification();
application.Render();
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointUp() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointUp());
+ application.ProcessEvent(event);
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( !gPushButtonClicked );
+ DALI_TEST_CHECK(!gPushButtonClicked);
// 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::Integration::WheelEvent wheelEvent(Dali::Integration::WheelEvent::MOUSE_WHEEL, 0, 0u, Vector2(10.0f, 10.0f), 1, 1000u);
+ application.ProcessEvent(wheelEvent);
application.SendNotification();
application.Render();
// Enable touch transparency.
- popup.SetProperty( Popup::Property::TOUCH_TRANSPARENT, true );
+ popup.SetProperty(Popup::Property::TOUCH_TRANSPARENT, true);
bool propertyResult;
- DALI_TEST_CHECK( popup.GetProperty( Popup::Property::TOUCH_TRANSPARENT ).Get( propertyResult ) );
- DALI_TEST_EQUALS( propertyResult, true, TEST_LOCATION );
+ DALI_TEST_CHECK(popup.GetProperty(Popup::Property::TOUCH_TRANSPARENT).Get(propertyResult));
+ DALI_TEST_EQUALS(propertyResult, true, TEST_LOCATION);
// Perform a click, the popup should allow the click to travel through to the button.
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointDown() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointDown());
+ application.ProcessEvent(event);
application.SendNotification();
application.Render();
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointUp() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointUp());
+ application.ProcessEvent(event);
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( gPushButtonClicked );
+ DALI_TEST_CHECK(gPushButtonClicked);
END_TEST;
}
int UtcDaliPopupPropertyTail(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliPopupPropertyTail" );
+ tet_infoline(" UtcDaliPopupPropertyTail");
// Create the Popup actor
Popup popup = Popup::New();
- popup.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- popup.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- popup.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
- popup.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
- TextLabel content = TextLabel::New( "text" );
- popup.SetContent( content );
+ popup.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ popup.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ popup.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ popup.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
+ TextLabel content = TextLabel::New("text");
+ popup.SetContent(content);
std::string imageFilename = "invalid-image.jpg";
- popup.SetProperty( Popup::Property::TAIL_DOWN_IMAGE, imageFilename );
- popup.SetProperty( Popup::Property::TAIL_UP_IMAGE, imageFilename );
- popup.SetProperty( Popup::Property::TAIL_RIGHT_IMAGE, imageFilename );
- popup.SetProperty( Popup::Property::TAIL_LEFT_IMAGE, imageFilename );
+ popup.SetProperty(Popup::Property::TAIL_DOWN_IMAGE, imageFilename);
+ popup.SetProperty(Popup::Property::TAIL_UP_IMAGE, imageFilename);
+ popup.SetProperty(Popup::Property::TAIL_RIGHT_IMAGE, imageFilename);
+ popup.SetProperty(Popup::Property::TAIL_LEFT_IMAGE, imageFilename);
std::string resultString;
- popup.GetProperty( Toolkit::Popup::Property::TAIL_DOWN_IMAGE ).Get( resultString );
- DALI_TEST_EQUALS( resultString, imageFilename, TEST_LOCATION );
- popup.GetProperty( Toolkit::Popup::Property::TAIL_UP_IMAGE ).Get( resultString );
- DALI_TEST_EQUALS( resultString, imageFilename, TEST_LOCATION );
- popup.GetProperty( Toolkit::Popup::Property::TAIL_RIGHT_IMAGE ).Get( resultString );
- DALI_TEST_EQUALS( resultString, imageFilename, TEST_LOCATION );
- popup.GetProperty( Toolkit::Popup::Property::TAIL_LEFT_IMAGE ).Get( resultString );
- DALI_TEST_EQUALS( resultString, imageFilename, TEST_LOCATION );
-
- popup.SetProperty( Popup::Property::TAIL_VISIBILITY, true );
+ popup.GetProperty(Toolkit::Popup::Property::TAIL_DOWN_IMAGE).Get(resultString);
+ DALI_TEST_EQUALS(resultString, imageFilename, TEST_LOCATION);
+ popup.GetProperty(Toolkit::Popup::Property::TAIL_UP_IMAGE).Get(resultString);
+ DALI_TEST_EQUALS(resultString, imageFilename, TEST_LOCATION);
+ popup.GetProperty(Toolkit::Popup::Property::TAIL_RIGHT_IMAGE).Get(resultString);
+ DALI_TEST_EQUALS(resultString, imageFilename, TEST_LOCATION);
+ popup.GetProperty(Toolkit::Popup::Property::TAIL_LEFT_IMAGE).Get(resultString);
+ DALI_TEST_EQUALS(resultString, imageFilename, TEST_LOCATION);
+
+ popup.SetProperty(Popup::Property::TAIL_VISIBILITY, true);
bool boolResult;
- DALI_TEST_CHECK( popup.GetProperty( Popup::Property::TAIL_VISIBILITY ).Get( boolResult ) );
- DALI_TEST_EQUALS( boolResult, true, TEST_LOCATION );
+ DALI_TEST_CHECK(popup.GetProperty(Popup::Property::TAIL_VISIBILITY).Get(boolResult));
+ DALI_TEST_EQUALS(boolResult, true, TEST_LOCATION);
- Actor tailActor;
- Vector3 tailPosition( ParentOrigin::TOP_CENTER );
+ Actor tailActor;
+ Vector3 tailPosition(ParentOrigin::TOP_CENTER);
- popup.SetProperty( Popup::Property::TAIL_POSITION, tailPosition );
+ popup.SetProperty(Popup::Property::TAIL_POSITION, tailPosition);
Vector3 vectorResult;
- DALI_TEST_CHECK( popup.GetProperty( Popup::Property::TAIL_POSITION ).Get( vectorResult ) );
- DALI_TEST_EQUALS( vectorResult, tailPosition, TEST_LOCATION );
+ DALI_TEST_CHECK(popup.GetProperty(Popup::Property::TAIL_POSITION).Get(vectorResult));
+ DALI_TEST_EQUALS(vectorResult, tailPosition, TEST_LOCATION);
- application.GetScene().Add( popup );
+ application.GetScene().Add(popup);
- popup.SetDisplayState( Popup::SHOWN );
+ popup.SetDisplayState(Popup::SHOWN);
application.SendNotification();
application.Render();
- tailActor = popup.FindChildByName( "tailImage" );
- DALI_TEST_CHECK( tailActor );
+ tailActor = popup.FindChildByName("tailImage");
+ DALI_TEST_CHECK(tailActor);
- float baseValX = tailActor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).x;
+ float baseValX = tailActor.GetCurrentProperty<Vector3>(Actor::Property::WORLD_POSITION).x;
- DALI_TEST_GREATER( baseValX, tailActor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).y, TEST_LOCATION );
+ DALI_TEST_GREATER(baseValX, tailActor.GetCurrentProperty<Vector3>(Actor::Property::WORLD_POSITION).y, TEST_LOCATION);
- popup.SetDisplayState( Popup::HIDDEN );
+ popup.SetDisplayState(Popup::HIDDEN);
application.SendNotification();
application.Render();
tailPosition = ParentOrigin::CENTER_LEFT;
- popup.SetProperty( Popup::Property::TAIL_POSITION, tailPosition );
+ popup.SetProperty(Popup::Property::TAIL_POSITION, tailPosition);
- popup.SetDisplayState( Popup::SHOWN );
+ popup.SetDisplayState(Popup::SHOWN);
application.SendNotification();
application.Render();
- tailActor = popup.FindChildByName( "tailImage" );
- DALI_TEST_CHECK( tailActor );
+ tailActor = popup.FindChildByName("tailImage");
+ DALI_TEST_CHECK(tailActor);
- float baseValY = tailActor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).y;
- DALI_TEST_GREATER( baseValX, tailActor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).x, TEST_LOCATION );
+ float baseValY = tailActor.GetCurrentProperty<Vector3>(Actor::Property::WORLD_POSITION).y;
+ DALI_TEST_GREATER(baseValX, tailActor.GetCurrentProperty<Vector3>(Actor::Property::WORLD_POSITION).x, TEST_LOCATION);
- popup.SetDisplayState( Popup::HIDDEN );
+ popup.SetDisplayState(Popup::HIDDEN);
application.SendNotification();
application.Render();
tailPosition = ParentOrigin::BOTTOM_CENTER;
- popup.SetProperty( Popup::Property::TAIL_POSITION, tailPosition );
+ popup.SetProperty(Popup::Property::TAIL_POSITION, tailPosition);
- popup.SetDisplayState( Popup::SHOWN );
+ popup.SetDisplayState(Popup::SHOWN);
application.SendNotification();
application.Render();
- tailActor = popup.FindChildByName( "tailImage" );
- DALI_TEST_CHECK( tailActor );
- DALI_TEST_EQUALS( tailActor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).x, baseValX, TEST_LOCATION );
- DALI_TEST_GREATER( tailActor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).y, baseValY, TEST_LOCATION );
+ tailActor = popup.FindChildByName("tailImage");
+ DALI_TEST_CHECK(tailActor);
+ DALI_TEST_EQUALS(tailActor.GetCurrentProperty<Vector3>(Actor::Property::WORLD_POSITION).x, baseValX, TEST_LOCATION);
+ DALI_TEST_GREATER(tailActor.GetCurrentProperty<Vector3>(Actor::Property::WORLD_POSITION).y, baseValY, TEST_LOCATION);
- popup.SetDisplayState( Popup::HIDDEN );
+ popup.SetDisplayState(Popup::HIDDEN);
application.SendNotification();
application.Render();
tailPosition = ParentOrigin::CENTER_RIGHT;
- popup.SetProperty( Popup::Property::TAIL_POSITION, tailPosition );
+ popup.SetProperty(Popup::Property::TAIL_POSITION, tailPosition);
- popup.SetDisplayState( Popup::SHOWN );
+ popup.SetDisplayState(Popup::SHOWN);
application.SendNotification();
application.Render();
- tailActor = popup.FindChildByName( "tailImage" );
- DALI_TEST_CHECK( tailActor );
- DALI_TEST_GREATER( tailActor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).x, baseValX, TEST_LOCATION );
- DALI_TEST_EQUALS( tailActor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).y, baseValY, TEST_LOCATION );
+ tailActor = popup.FindChildByName("tailImage");
+ DALI_TEST_CHECK(tailActor);
+ DALI_TEST_GREATER(tailActor.GetCurrentProperty<Vector3>(Actor::Property::WORLD_POSITION).x, baseValX, TEST_LOCATION);
+ DALI_TEST_EQUALS(tailActor.GetCurrentProperty<Vector3>(Actor::Property::WORLD_POSITION).y, baseValY, TEST_LOCATION);
- popup.SetDisplayState( Popup::HIDDEN );
+ popup.SetDisplayState(Popup::HIDDEN);
application.SendNotification();
application.Render();
int UtcDaliPopupTypeToast(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliPopupTypeToast" );
+ tet_infoline(" UtcDaliPopupTypeToast");
- TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo( "PopupToast" );
- DALI_TEST_CHECK( typeInfo )
+ TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo("PopupToast");
+ DALI_TEST_CHECK(typeInfo)
BaseHandle baseHandle = typeInfo.CreateInstance();
- DALI_TEST_CHECK( baseHandle )
+ DALI_TEST_CHECK(baseHandle)
- Toolkit::Popup popup = Toolkit::Popup::DownCast( baseHandle );
- gPopupState = Toolkit::Popup::HIDDEN;
- ConnectStateSignals( popup );
- popup.SetProperty( Popup::Property::ANIMATION_DURATION, 1.0f );
+ Toolkit::Popup popup = Toolkit::Popup::DownCast(baseHandle);
+ gPopupState = Toolkit::Popup::HIDDEN;
+ ConnectStateSignals(popup);
+ popup.SetProperty(Popup::Property::ANIMATION_DURATION, 1.0f);
- popup.SetTitle( Toolkit::TextLabel::New( "This is a Toast Popup.\nIt will auto-hide itself" ) );
- application.GetScene().Add( popup );
- popup.SetDisplayState( Toolkit::Popup::SHOWN );
+ popup.SetTitle(Toolkit::TextLabel::New("This is a Toast Popup.\nIt will auto-hide itself"));
+ application.GetScene().Add(popup);
+ popup.SetDisplayState(Toolkit::Popup::SHOWN);
- for( int i = 0; i < RENDER_ANIMATION_TEST_DURATION_FRAMES; i++ )
+ for(int i = 0; i < RENDER_ANIMATION_TEST_DURATION_FRAMES; i++)
{
application.SendNotification();
- application.Render( RENDER_FRAME_INTERVAL );
+ application.Render(RENDER_FRAME_INTERVAL);
}
// Check the toast popup is shown.
- DALI_TEST_EQUALS( gPopupState, Popup::SHOWN, TEST_LOCATION );
+ DALI_TEST_EQUALS(gPopupState, Popup::SHOWN, TEST_LOCATION);
- for( int i = 0; i < RENDER_ANIMATION_TEST_DURATION_FRAMES; i++ )
+ for(int i = 0; i < RENDER_ANIMATION_TEST_DURATION_FRAMES; i++)
{
application.SendNotification();
- application.Render( RENDER_FRAME_INTERVAL );
+ application.Render(RENDER_FRAME_INTERVAL);
}
// Check the toast popup hides.
- Dali::Timer timer = Timer::New( 0 );
+ Dali::Timer timer = Timer::New(0);
timer.MockEmitSignal();
- for( int i = 0; i < RENDER_ANIMATION_TEST_DURATION_FRAMES; i++ )
+ for(int i = 0; i < RENDER_ANIMATION_TEST_DURATION_FRAMES; i++)
{
application.SendNotification();
- application.Render( RENDER_FRAME_INTERVAL );
+ application.Render(RENDER_FRAME_INTERVAL);
}
- DALI_TEST_EQUALS( gPopupState, Popup::HIDDEN, TEST_LOCATION );
+ DALI_TEST_EQUALS(gPopupState, Popup::HIDDEN, TEST_LOCATION);
END_TEST;
}
int UtcDaliPopupTypeRegistryCreation(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliPopupTypeRegistryCreation" );
+ tet_infoline(" UtcDaliPopupTypeRegistryCreation");
- TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo( "Popup" );
- DALI_TEST_CHECK( typeInfo )
+ TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo("Popup");
+ DALI_TEST_CHECK(typeInfo)
BaseHandle baseHandle = typeInfo.CreateInstance();
- DALI_TEST_CHECK( baseHandle )
+ DALI_TEST_CHECK(baseHandle)
- Toolkit::Popup popup = Toolkit::Popup::DownCast( baseHandle );
- gPopupState = Toolkit::Popup::HIDDEN;
- ConnectStateSignals( popup );
- popup.SetProperty( Popup::Property::ANIMATION_DURATION, 0.0f );
+ Toolkit::Popup popup = Toolkit::Popup::DownCast(baseHandle);
+ gPopupState = Toolkit::Popup::HIDDEN;
+ ConnectStateSignals(popup);
+ popup.SetProperty(Popup::Property::ANIMATION_DURATION, 0.0f);
- application.GetScene().Add( popup );
- popup.SetDisplayState( Toolkit::Popup::SHOWN );
+ application.GetScene().Add(popup);
+ popup.SetDisplayState(Toolkit::Popup::SHOWN);
application.SendNotification();
application.Render();
// Check the popup is shown.
- DALI_TEST_EQUALS( gPopupState, Popup::SHOWN, TEST_LOCATION );
+ DALI_TEST_EQUALS(gPopupState, Popup::SHOWN, TEST_LOCATION);
END_TEST;
}
int UtcDaliPopupPropertyTypeRegistryConnectSignal(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliPopupPropertyTypeRegistryConnectSignal" );
+ tet_infoline(" UtcDaliPopupPropertyTypeRegistryConnectSignal");
// Create the Popup actor
Popup popup = Popup::New();
TestConnectionTrackerObject* testTracker = new TestConnectionTrackerObject();
// Note: The emmision of this signals has already been tested in other tests.
- DALI_TEST_CHECK( popup.ConnectSignal( testTracker, "touchedOutside", PopupTestFunctor() ) );
- DALI_TEST_CHECK( popup.ConnectSignal( testTracker, "showing", PopupTestFunctor() ) );
- DALI_TEST_CHECK( popup.ConnectSignal( testTracker, "shown", PopupTestFunctor() ) );
- DALI_TEST_CHECK( popup.ConnectSignal( testTracker, "hiding", PopupTestFunctor() ) );
- DALI_TEST_CHECK( popup.ConnectSignal( testTracker, "hidden", PopupTestFunctor() ) );
+ DALI_TEST_CHECK(popup.ConnectSignal(testTracker, "touchedOutside", PopupTestFunctor()));
+ DALI_TEST_CHECK(popup.ConnectSignal(testTracker, "showing", PopupTestFunctor()));
+ DALI_TEST_CHECK(popup.ConnectSignal(testTracker, "shown", PopupTestFunctor()));
+ DALI_TEST_CHECK(popup.ConnectSignal(testTracker, "hiding", PopupTestFunctor()));
+ DALI_TEST_CHECK(popup.ConnectSignal(testTracker, "hidden", PopupTestFunctor()));
// Test connecting to an invalid signal does not work.
- DALI_TEST_CHECK( !popup.ConnectSignal( testTracker, "invalid", PopupTestFunctor() ) );
+ DALI_TEST_CHECK(!popup.ConnectSignal(testTracker, "invalid", PopupTestFunctor()));
END_TEST;
}
int UtcDaliPopupOnChildAdd(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliPopupOnChildAdd" );
+ tet_infoline(" UtcDaliPopupOnChildAdd");
// Create the Popup actor
Popup popup = Popup::New();
- popup.SetProperty( Popup::Property::ANIMATION_DURATION, 0.0f );
+ popup.SetProperty(Popup::Property::ANIMATION_DURATION, 0.0f);
std::string testLabelText = "ContentTest";
- TextLabel contentLabel = TextLabel::New( testLabelText );
+ TextLabel contentLabel = TextLabel::New(testLabelText);
- popup.Add( contentLabel );
+ popup.Add(contentLabel);
- DALI_TEST_CHECK( HasAncestor( contentLabel, popup ) );
+ DALI_TEST_CHECK(HasAncestor(contentLabel, popup));
END_TEST;
}
int UtcDaliPopupOnKeyEvent(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliPopupOnKeyEvent" );
+ tet_infoline(" UtcDaliPopupOnKeyEvent");
// Create the Popup actor
Popup popup = Popup::New();
- popup.SetProperty( Popup::Property::ANIMATION_DURATION, 0.0f );
- application.GetScene().Add( popup );
+ popup.SetProperty(Popup::Property::ANIMATION_DURATION, 0.0f);
+ application.GetScene().Add(popup);
- popup.SetDisplayState( Popup::SHOWN );
+ popup.SetDisplayState(Popup::SHOWN);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( popup.GetDisplayState(), Popup::SHOWN, TEST_LOCATION );
+ DALI_TEST_EQUALS(popup.GetDisplayState(), Popup::SHOWN, TEST_LOCATION);
popup.SetKeyInputFocus();
- application.ProcessEvent( GenerateKey( "", "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::DOWN, "", "", Device::Class::TOUCH, Device::Subclass::NONE ) );
+ application.ProcessEvent(GenerateKey("", "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::DOWN, "", "", Device::Class::TOUCH, Device::Subclass::NONE));
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( popup.GetDisplayState(), Popup::HIDDEN, TEST_LOCATION );
+ DALI_TEST_EQUALS(popup.GetDisplayState(), Popup::HIDDEN, TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- tet_infoline( "Set the background border property of a popup & retrieve it" );
+ tet_infoline("Set the background border property of a popup & retrieve it");
Popup popup = Popup::New();
- Rect< int > rect( 40, 30, 20, 10 );
- tet_infoline( "Ensure value we want to set is different from what is already set" );
- DALI_TEST_CHECK( rect != popup.GetProperty( Popup::Property::POPUP_BACKGROUND_BORDER ).Get< Rect< int > >() );
+ Rect<int> rect(40, 30, 20, 10);
+ tet_infoline("Ensure value we want to set is different from what is already set");
+ DALI_TEST_CHECK(rect != popup.GetProperty(Popup::Property::POPUP_BACKGROUND_BORDER).Get<Rect<int> >());
- tet_infoline( "Set the property and retrieve it to make sure it's the value we set" );
- popup.SetProperty( Popup::Property::POPUP_BACKGROUND_BORDER, rect );
- DALI_TEST_EQUALS( rect, popup.GetProperty( Popup::Property::POPUP_BACKGROUND_BORDER ).Get< Rect< int > >(), TEST_LOCATION );
+ tet_infoline("Set the property and retrieve it to make sure it's the value we set");
+ popup.SetProperty(Popup::Property::POPUP_BACKGROUND_BORDER, rect);
+ DALI_TEST_EQUALS(rect, popup.GetProperty(Popup::Property::POPUP_BACKGROUND_BORDER).Get<Rect<int> >(), TEST_LOCATION);
- tet_infoline( "Set a vector4 as well which should also work" );
- Vector4 vectorValue( 10.0f, 20.0f, 30.0f, 40.0f );
- popup.SetProperty( Popup::Property::POPUP_BACKGROUND_BORDER, vectorValue );
- DALI_TEST_EQUALS( Rect< int >( 10, 20, 30, 40 ), popup.GetProperty( Popup::Property::POPUP_BACKGROUND_BORDER ).Get< Rect< int > >(), TEST_LOCATION );
+ tet_infoline("Set a vector4 as well which should also work");
+ Vector4 vectorValue(10.0f, 20.0f, 30.0f, 40.0f);
+ popup.SetProperty(Popup::Property::POPUP_BACKGROUND_BORDER, vectorValue);
+ DALI_TEST_EQUALS(Rect<int>(10, 20, 30, 40), popup.GetProperty(Popup::Property::POPUP_BACKGROUND_BORDER).Get<Rect<int> >(), TEST_LOCATION);
END_TEST;
}
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
using namespace Dali::Toolkit;
using Dali::Toolkit::ProgressBar;
-
void utc_dali_toolkit_progressbar_startup(void)
{
test_return_value = TET_UNDEF;
namespace
{
-static const char* trackImage = TEST_RESOURCE_DIR "/progress-bar-skin-track-progress.png";
-static const char* progressImage = TEST_RESOURCE_DIR "/progress-bar-skin-progress-progress.png";
+static const char* trackImage = TEST_RESOURCE_DIR "/progress-bar-skin-track-progress.png";
+static const char* progressImage = TEST_RESOURCE_DIR "/progress-bar-skin-progress-progress.png";
static const char* secondaryProgressImage = TEST_RESOURCE_DIR "/progress-bar-skin-secondary-progress.png";
-static const char* indeterminateImage = TEST_RESOURCE_DIR "/progress-bar-skin-indeterminate.png";
-static bool gObjectCreatedCallBackCalled;
+static const char* indeterminateImage = TEST_RESOURCE_DIR "/progress-bar-skin-indeterminate.png";
+static bool gObjectCreatedCallBackCalled;
static void TestCallback(BaseHandle handle)
{
gObjectCreatedCallBackCalled = true;
}
-}
+} // namespace
int UtcDaliProgressBarNew(void)
{
// Create the ProgressBar actor
ProgressBar progressBar;
- DALI_TEST_CHECK( !progressBar );
+ DALI_TEST_CHECK(!progressBar);
progressBar = ProgressBar::New();
- DALI_TEST_CHECK( progressBar );
+ DALI_TEST_CHECK(progressBar);
ProgressBar progressBar2(progressBar);
- DALI_TEST_CHECK( progressBar2 == progressBar );
+ DALI_TEST_CHECK(progressBar2 == progressBar);
ProgressBar progressBar3;
progressBar3 = progressBar2;
- DALI_TEST_CHECK( progressBar3 == progressBar2 );
+ DALI_TEST_CHECK(progressBar3 == progressBar2);
//Additional check to ensure object is created by checking if it's registered
ObjectRegistry registry = application.GetCore().GetObjectRegistry();
- DALI_TEST_CHECK( registry );
+ DALI_TEST_CHECK(registry);
gObjectCreatedCallBackCalled = false;
- registry.ObjectCreatedSignal().Connect( &TestCallback );
+ registry.ObjectCreatedSignal().Connect(&TestCallback);
{
ProgressBar progressBar = ProgressBar::New();
}
- DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
+ DALI_TEST_CHECK(gObjectCreatedCallBackCalled);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliProgressBarNew2");
- ProgressBar progressBar1 = DevelProgressBar::New( DevelProgressBar::Style::LINEAR );
- DALI_TEST_CHECK( progressBar1 );
+ ProgressBar progressBar1 = DevelProgressBar::New(DevelProgressBar::Style::LINEAR);
+ DALI_TEST_CHECK(progressBar1);
- ProgressBar progressBar2 = DevelProgressBar::New( DevelProgressBar::Style::CIRCULAR );
- DALI_TEST_CHECK( progressBar2 );
+ ProgressBar progressBar2 = DevelProgressBar::New(DevelProgressBar::Style::CIRCULAR);
+ DALI_TEST_CHECK(progressBar2);
- DALI_TEST_CHECK( progressBar1.GetStyleName() != progressBar2.GetStyleName() );
+ DALI_TEST_CHECK(progressBar1.GetStyleName() != progressBar2.GetStyleName());
END_TEST;
}
ProgressBar* progressBar = new ProgressBar();
delete progressBar;
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
END_TEST;
}
ToolkitTestApplication application;
ProgressBar progressBar = ProgressBar::New();
- DALI_TEST_CHECK( progressBar );
+ DALI_TEST_CHECK(progressBar);
- ProgressBar copy( progressBar );
- DALI_TEST_CHECK( copy );
+ ProgressBar copy(progressBar);
+ DALI_TEST_CHECK(copy);
END_TEST;
}
ToolkitTestApplication application;
ProgressBar progressBar = ProgressBar::New();
- DALI_TEST_CHECK( progressBar );
+ DALI_TEST_CHECK(progressBar);
ProgressBar copy;
copy = progressBar;
- DALI_TEST_CHECK( copy );
- DALI_TEST_EQUALS( progressBar, copy, TEST_LOCATION );
+ DALI_TEST_CHECK(copy);
+ DALI_TEST_EQUALS(progressBar, copy, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
ProgressBar progressBar = ProgressBar::New();
- DALI_TEST_EQUALS( 1, progressBar.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- progressBar.SetProperty( Actor::Property::SENSITIVE, false );
- DALI_TEST_CHECK( false == progressBar.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+ DALI_TEST_EQUALS(1, progressBar.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ progressBar.SetProperty(Actor::Property::SENSITIVE, false);
+ DALI_TEST_CHECK(false == progressBar.GetProperty<bool>(Actor::Property::SENSITIVE));
- ProgressBar moved = std::move( progressBar );
- 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( !progressBar );
+ ProgressBar moved = std::move(progressBar);
+ 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(!progressBar);
END_TEST;
}
ToolkitTestApplication application;
ProgressBar progressBar = ProgressBar::New();
- DALI_TEST_EQUALS( 1, progressBar.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- progressBar.SetProperty( Actor::Property::SENSITIVE, false );
- DALI_TEST_CHECK( false == progressBar.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+ DALI_TEST_EQUALS(1, progressBar.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ progressBar.SetProperty(Actor::Property::SENSITIVE, false);
+ DALI_TEST_CHECK(false == progressBar.GetProperty<bool>(Actor::Property::SENSITIVE));
ProgressBar moved;
- moved = std::move( progressBar );
- 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( !progressBar );
+ moved = std::move(progressBar);
+ 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(!progressBar);
END_TEST;
}
Handle handle = ProgressBar::New();
- ProgressBar progressBar = ProgressBar::DownCast( handle );
+ ProgressBar progressBar = ProgressBar::DownCast(handle);
- DALI_TEST_CHECK( progressBar == handle );
+ DALI_TEST_CHECK(progressBar == handle);
END_TEST;
}
static bool gProgressBarValueChangedCallBackCalled = false;
-static void OnProgressBarValueChanged( ProgressBar progressBar, float value, float secondaryValue )
+static void OnProgressBarValueChanged(ProgressBar progressBar, float value, float secondaryValue)
{
gProgressBarValueChangedCallBackCalled = true;
}
int UtcDaliProgressBarSignals(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
tet_infoline(" UtcDaliProgressBarSignals");
// Create the ProgressBar actor
ProgressBar progressBar = ProgressBar::New();
- application.GetScene().Add( progressBar );
- progressBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- progressBar.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
- progressBar.SetProperty( Actor::Property::SIZE, Vector2( application.GetScene().GetSize().x, 20.0f ) );
- progressBar.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
- progressBar.ValueChangedSignal().Connect( &OnProgressBarValueChanged );
+ application.GetScene().Add(progressBar);
+ progressBar.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ progressBar.SetProperty(Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_LEFT);
+ progressBar.SetProperty(Actor::Property::SIZE, Vector2(application.GetScene().GetSize().x, 20.0f));
+ progressBar.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 0.0f));
+ progressBar.ValueChangedSignal().Connect(&OnProgressBarValueChanged);
progressBar.SetProperty(ProgressBar::Property::PROGRESS_VALUE, 0.2f);
int UtcDaliProgressBarSetPropertyP(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliProgressBarSetPropertyP" );
+ tet_infoline("UtcDaliProgressBarSetPropertyP");
ProgressBar progressBar = ProgressBar::New();
- progressBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- progressBar.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
- progressBar.SetProperty( Actor::Property::SIZE, Vector2( application.GetScene().GetSize().x, 20.0f ) );
- progressBar.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
- progressBar.ValueChangedSignal().Connect( &OnProgressBarValueChanged );
+ progressBar.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ progressBar.SetProperty(Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_LEFT);
+ progressBar.SetProperty(Actor::Property::SIZE, Vector2(application.GetScene().GetSize().x, 20.0f));
+ progressBar.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 0.0f));
+ progressBar.ValueChangedSignal().Connect(&OnProgressBarValueChanged);
application.GetScene().Add(progressBar);
application.SendNotification();
application.Render();
Property::Map map;
- map["visualType"] = "IMAGE";
+ map["visualType"] = "IMAGE";
map[Toolkit::ImageVisual::Property::URL] = trackImage;
progressBar.SetProperty(ProgressBar::Property::TRACK_VISUAL, map);
- Property::Value value = progressBar.GetProperty(ProgressBar::Property::TRACK_VISUAL);
- Property::Map* resultMap = value.GetMap();
- DALI_TEST_CHECK( resultMap );
- Property::Value* urlValue = resultMap->Find( Toolkit::ImageVisual::Property::URL );
- std::string urlString;
- urlValue->Get( urlString );
- DALI_TEST_CHECK( !urlString.empty() ) ;
- DALI_TEST_EQUALS( urlString, trackImage, TEST_LOCATION );
+ Property::Value value = progressBar.GetProperty(ProgressBar::Property::TRACK_VISUAL);
+ Property::Map* resultMap = value.GetMap();
+ DALI_TEST_CHECK(resultMap);
+ Property::Value* urlValue = resultMap->Find(Toolkit::ImageVisual::Property::URL);
+ std::string urlString;
+ urlValue->Get(urlString);
+ DALI_TEST_CHECK(!urlString.empty());
+ DALI_TEST_EQUALS(urlString, trackImage, TEST_LOCATION);
Property::Map colorMap;
- colorMap["visualType"] = "COLOR";
+ colorMap["visualType"] = "COLOR";
colorMap[Toolkit::ColorVisual::Property::MIX_COLOR] = Color::RED;
progressBar.SetProperty(ProgressBar::Property::TRACK_VISUAL, colorMap);
- value = progressBar.GetProperty(ProgressBar::Property::TRACK_VISUAL);
+ value = progressBar.GetProperty(ProgressBar::Property::TRACK_VISUAL);
resultMap = value.GetMap();
- DALI_TEST_CHECK( resultMap );
- Property::Value* colorValue = resultMap->Find( Toolkit::ColorVisual::Property::MIX_COLOR );
- Vector4 color = Color::TRANSPARENT;
- colorValue->Get( color );
- DALI_TEST_CHECK( color != Color::TRANSPARENT );
- DALI_TEST_EQUALS( color, Color::RED, TEST_LOCATION );
+ DALI_TEST_CHECK(resultMap);
+ Property::Value* colorValue = resultMap->Find(Toolkit::ColorVisual::Property::MIX_COLOR);
+ Vector4 color = Color::TRANSPARENT;
+ colorValue->Get(color);
+ DALI_TEST_CHECK(color != Color::TRANSPARENT);
+ DALI_TEST_EQUALS(color, Color::RED, TEST_LOCATION);
map[Toolkit::ImageVisual::Property::URL] = progressImage;
progressBar.SetProperty(ProgressBar::Property::PROGRESS_VISUAL, map);
- value = progressBar.GetProperty(ProgressBar::Property::PROGRESS_VISUAL);
+ value = progressBar.GetProperty(ProgressBar::Property::PROGRESS_VISUAL);
resultMap = value.GetMap();
- DALI_TEST_CHECK( resultMap );
- urlValue = resultMap->Find( Toolkit::ImageVisual::Property::URL );
- urlValue->Get( urlString );
- DALI_TEST_CHECK( !urlString.empty() ) ;
- DALI_TEST_EQUALS( urlString, progressImage, TEST_LOCATION );
+ DALI_TEST_CHECK(resultMap);
+ urlValue = resultMap->Find(Toolkit::ImageVisual::Property::URL);
+ urlValue->Get(urlString);
+ DALI_TEST_CHECK(!urlString.empty());
+ DALI_TEST_EQUALS(urlString, progressImage, TEST_LOCATION);
progressBar.SetProperty(ProgressBar::Property::SECONDARY_PROGRESS_VISUAL, secondaryProgressImage);
- value = progressBar.GetProperty(ProgressBar::Property::SECONDARY_PROGRESS_VISUAL);
+ value = progressBar.GetProperty(ProgressBar::Property::SECONDARY_PROGRESS_VISUAL);
resultMap = value.GetMap();
- DALI_TEST_CHECK( resultMap );
- urlValue = resultMap->Find( Toolkit::ImageVisual::Property::URL );
- urlValue->Get( urlString );
- DALI_TEST_CHECK( !urlString.empty() ) ;
- DALI_TEST_EQUALS( urlString, secondaryProgressImage, TEST_LOCATION );
+ DALI_TEST_CHECK(resultMap);
+ urlValue = resultMap->Find(Toolkit::ImageVisual::Property::URL);
+ urlValue->Get(urlString);
+ DALI_TEST_CHECK(!urlString.empty());
+ DALI_TEST_EQUALS(urlString, secondaryProgressImage, TEST_LOCATION);
map[Toolkit::ImageVisual::Property::URL] = secondaryProgressImage;
progressBar.SetProperty(ProgressBar::Property::SECONDARY_PROGRESS_VISUAL, map);
- value = progressBar.GetProperty(ProgressBar::Property::SECONDARY_PROGRESS_VISUAL);
+ value = progressBar.GetProperty(ProgressBar::Property::SECONDARY_PROGRESS_VISUAL);
resultMap = value.GetMap();
- DALI_TEST_CHECK( resultMap );
- urlValue = resultMap->Find( Toolkit::ImageVisual::Property::URL );
- urlValue->Get( urlString );
- DALI_TEST_CHECK( !urlString.empty() ) ;
- DALI_TEST_EQUALS( urlString, secondaryProgressImage, TEST_LOCATION );
+ DALI_TEST_CHECK(resultMap);
+ urlValue = resultMap->Find(Toolkit::ImageVisual::Property::URL);
+ urlValue->Get(urlString);
+ DALI_TEST_CHECK(!urlString.empty());
+ DALI_TEST_EQUALS(urlString, secondaryProgressImage, TEST_LOCATION);
map[Toolkit::ImageVisual::Property::URL] = indeterminateImage;
progressBar.SetProperty(ProgressBar::Property::INDETERMINATE_VISUAL, map);
- value = progressBar.GetProperty(ProgressBar::Property::INDETERMINATE_VISUAL);
+ value = progressBar.GetProperty(ProgressBar::Property::INDETERMINATE_VISUAL);
resultMap = value.GetMap();
- DALI_TEST_CHECK( resultMap );
- urlValue = resultMap->Find( Toolkit::ImageVisual::Property::URL );
- urlValue->Get( urlString );
- DALI_TEST_CHECK( !urlString.empty() ) ;
- DALI_TEST_EQUALS( urlString, indeterminateImage, TEST_LOCATION );
+ DALI_TEST_CHECK(resultMap);
+ urlValue = resultMap->Find(Toolkit::ImageVisual::Property::URL);
+ urlValue->Get(urlString);
+ DALI_TEST_CHECK(!urlString.empty());
+ DALI_TEST_EQUALS(urlString, indeterminateImage, TEST_LOCATION);
progressBar.SetProperty(ProgressBar::Property::LABEL_VISUAL, "test1");
- value = progressBar.GetProperty(ProgressBar::Property::LABEL_VISUAL);
+ value = progressBar.GetProperty(ProgressBar::Property::LABEL_VISUAL);
resultMap = value.GetMap();
- DALI_TEST_CHECK( resultMap );
+ DALI_TEST_CHECK(resultMap);
Property::Value* textValue = resultMap->Find(Toolkit::TextVisual::Property::TEXT);
std::string textString;
- textValue->Get( textString );
- DALI_TEST_CHECK( !textString.empty() );
- DALI_TEST_EQUALS( textString, std::string( "test1" ), TEST_LOCATION );
+ textValue->Get(textString);
+ DALI_TEST_CHECK(!textString.empty());
+ DALI_TEST_EQUALS(textString, std::string("test1"), TEST_LOCATION);
Property::Map textVisualMap2;
- textVisualMap2.Insert( Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT );
- textVisualMap2.Insert( Toolkit::TextVisual::Property::TEXT, "test2" );
- textVisualMap2.Insert( Toolkit::TextVisual::Property::POINT_SIZE, 12.0f );
+ textVisualMap2.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT);
+ textVisualMap2.Insert(Toolkit::TextVisual::Property::TEXT, "test2");
+ textVisualMap2.Insert(Toolkit::TextVisual::Property::POINT_SIZE, 12.0f);
progressBar.SetProperty(ProgressBar::Property::LABEL_VISUAL, textVisualMap2);
- value = progressBar.GetProperty(ProgressBar::Property::LABEL_VISUAL);
+ value = progressBar.GetProperty(ProgressBar::Property::LABEL_VISUAL);
resultMap = value.GetMap();
- DALI_TEST_CHECK( resultMap );
+ DALI_TEST_CHECK(resultMap);
textValue = resultMap->Find(Toolkit::TextVisual::Property::TEXT);
- textValue->Get( textString );
- DALI_TEST_CHECK( !textString.empty() );
- DALI_TEST_EQUALS( textString, std::string( "test2" ), TEST_LOCATION );
+ textValue->Get(textString);
+ DALI_TEST_CHECK(!textString.empty());
+ DALI_TEST_EQUALS(textString, std::string("test2"), TEST_LOCATION);
progressBar.SetProperty(ProgressBar::Property::LABEL_VISUAL, "test3");
- value = progressBar.GetProperty(ProgressBar::Property::LABEL_VISUAL);
+ value = progressBar.GetProperty(ProgressBar::Property::LABEL_VISUAL);
resultMap = value.GetMap();
- DALI_TEST_CHECK( resultMap );
+ DALI_TEST_CHECK(resultMap);
textValue = resultMap->Find(Toolkit::TextVisual::Property::TEXT);
std::string textString2;
- textValue->Get( textString2 );
- DALI_TEST_CHECK( !textString2.empty() );
- DALI_TEST_EQUALS( textString2, std::string( "test3" ), TEST_LOCATION );
+ textValue->Get(textString2);
+ DALI_TEST_CHECK(!textString2.empty());
+ DALI_TEST_EQUALS(textString2, std::string("test3"), TEST_LOCATION);
Property::Map transitionMap;
- transitionMap["target"] = "indeterminateVisual";
- transitionMap["property"] = "offset";
- transitionMap["initialValue"] = Vector2( 0.0f, 0.0f );
- transitionMap["targetValue"] = Vector2( 10.0f, 0.0f );
- transitionMap["animator"] = Property::Map().Add("alphaFunction", "EASE_IN_OUT_BACK")
- .Add("timePeriod", Property::Map().Add("delay", 0.5f).Add("duration", 1.0f));
+ transitionMap["target"] = "indeterminateVisual";
+ transitionMap["property"] = "offset";
+ transitionMap["initialValue"] = Vector2(0.0f, 0.0f);
+ transitionMap["targetValue"] = Vector2(10.0f, 0.0f);
+ transitionMap["animator"] = Property::Map().Add("alphaFunction", "EASE_IN_OUT_BACK").Add("timePeriod", Property::Map().Add("delay", 0.5f).Add("duration", 1.0f));
Property::Array array;
- array.PushBack( transitionMap );
+ array.PushBack(transitionMap);
progressBar.SetProperty(ProgressBar::Property::INDETERMINATE_VISUAL_ANIMATION, array);
Property::Map transitionMap2;
- transitionMap2["target"] = "indeterminateVisual";
- transitionMap2["property"] = "offset";
- transitionMap2["initialValue"] = Vector2( 0.0f, 0.0f );
- transitionMap2["targetValue"] = Vector2( 15.0f, 0.0f );
- transitionMap2["animator"] = Property::Map().Add("alphaFunction", "EASE_IN_OUT_BACK")
- .Add("timePeriod", Property::Map().Add("delay", 0.5f).Add("duration", 1.0f));
+ transitionMap2["target"] = "indeterminateVisual";
+ transitionMap2["property"] = "offset";
+ transitionMap2["initialValue"] = Vector2(0.0f, 0.0f);
+ transitionMap2["targetValue"] = Vector2(15.0f, 0.0f);
+ transitionMap2["animator"] = Property::Map().Add("alphaFunction", "EASE_IN_OUT_BACK").Add("timePeriod", Property::Map().Add("delay", 0.5f).Add("duration", 1.0f));
progressBar.SetProperty(ProgressBar::Property::INDETERMINATE_VISUAL_ANIMATION, transitionMap2);
END_TEST;
}
int UtcDaliProgressBarSetPropertyP1(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliProgressBarSetPropertyP1" );
+ tet_infoline("UtcDaliProgressBarSetPropertyP1");
ProgressBar progressBar = ProgressBar::New();
- progressBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- progressBar.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
- progressBar.SetProperty( Actor::Property::SIZE, Vector2( application.GetScene().GetSize().x, 20.0f ) );
- progressBar.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
- progressBar.ValueChangedSignal().Connect( &OnProgressBarValueChanged );
+ progressBar.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ progressBar.SetProperty(Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_LEFT);
+ progressBar.SetProperty(Actor::Property::SIZE, Vector2(application.GetScene().GetSize().x, 20.0f));
+ progressBar.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 0.0f));
+ progressBar.ValueChangedSignal().Connect(&OnProgressBarValueChanged);
application.GetScene().Add(progressBar);
application.SendNotification();
// test to download a file of 100k in chunks
float lowerBound = 0, upperBound = 100, progressValue = 0, secondaryProgressValue = 0, chunkValue = 0;
- while( chunkValue <= upperBound )
+ while(chunkValue <= upperBound)
{
- progressValue = (chunkValue - lowerBound ) / ( upperBound - lowerBound );
+ progressValue = (chunkValue - lowerBound) / (upperBound - lowerBound);
progressBar.SetProperty(ProgressBar::Property::PROGRESS_VALUE, progressValue);
val = progressBar.GetProperty<float>(ProgressBar::Property::PROGRESS_VALUE);
DALI_TEST_EQUALS(val, progressValue, TEST_LOCATION);
// test to download a file of 1000k in chunks
lowerBound = 0, upperBound = 1000, progressValue = 0, chunkValue = 0;
- while( chunkValue <= upperBound )
+ while(chunkValue <= upperBound)
{
- progressValue = (chunkValue - lowerBound ) / ( upperBound - lowerBound );
+ progressValue = (chunkValue - lowerBound) / (upperBound - lowerBound);
progressBar.SetProperty(ProgressBar::Property::PROGRESS_VALUE, progressValue);
val = progressBar.GetProperty<float>(ProgressBar::Property::PROGRESS_VALUE);
DALI_TEST_EQUALS(val, progressValue, TEST_LOCATION);
// test to download a file of 100k in chunks
lowerBound = 0, upperBound = 100, secondaryProgressValue = 0, chunkValue = 0;
- while( chunkValue <= upperBound )
+ while(chunkValue <= upperBound)
{
- secondaryProgressValue = (chunkValue - lowerBound ) / ( upperBound - lowerBound );
+ secondaryProgressValue = (chunkValue - lowerBound) / (upperBound - lowerBound);
progressBar.SetProperty(ProgressBar::Property::SECONDARY_PROGRESS_VALUE, secondaryProgressValue);
val = progressBar.GetProperty<float>(ProgressBar::Property::SECONDARY_PROGRESS_VALUE);
DALI_TEST_EQUALS(val, secondaryProgressValue, TEST_LOCATION);
// test to download a file of 1000k in chunks
lowerBound = 0, upperBound = 1000, secondaryProgressValue = 0, chunkValue = 0;
- while( chunkValue <= upperBound )
+ while(chunkValue <= upperBound)
{
- secondaryProgressValue = (chunkValue - lowerBound ) / ( upperBound - lowerBound );
+ secondaryProgressValue = (chunkValue - lowerBound) / (upperBound - lowerBound);
progressBar.SetProperty(ProgressBar::Property::SECONDARY_PROGRESS_VALUE, secondaryProgressValue);
val = progressBar.GetProperty<float>(ProgressBar::Property::SECONDARY_PROGRESS_VALUE);
DALI_TEST_EQUALS(val, secondaryProgressValue, TEST_LOCATION);
int UtcDaliProgressBarSetPropertyP2(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliProgressBarSetPropertyP2" );
+ tet_infoline("UtcDaliProgressBarSetPropertyP2");
ProgressBar progressBar = ProgressBar::New();
- progressBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- progressBar.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
- progressBar.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
+ progressBar.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ progressBar.SetProperty(Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_LEFT);
+ progressBar.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 0.0f));
progressBar.SetProperty(ProgressBar::Property::LABEL_VISUAL, "test");
progressBar.SetProperty(ProgressBar::Property::INDETERMINATE, true);
progressBar.SetProperty(ProgressBar::Property::TRACK_VISUAL, trackImage);
progressBar.SetProperty(ProgressBar::Property::INDETERMINATE_VISUAL, indeterminateImage);
Property::Map transitionMap;
- transitionMap["target"] = "indeterminateVisual";
- transitionMap["property"] = "offset";
- transitionMap["initialValue"] = Vector2( 0.0f, 0.0f );
- transitionMap["targetValue"] = Vector2( 10.0f, 0.0f );
- transitionMap["animator"] = Property::Map().Add("alphaFunction", "EASE_IN_OUT_BACK")
- .Add("timePeriod", Property::Map().Add("delay", 0.5f).Add("duration", 1.0f));
+ transitionMap["target"] = "indeterminateVisual";
+ transitionMap["property"] = "offset";
+ transitionMap["initialValue"] = Vector2(0.0f, 0.0f);
+ transitionMap["targetValue"] = Vector2(10.0f, 0.0f);
+ transitionMap["animator"] = Property::Map().Add("alphaFunction", "EASE_IN_OUT_BACK").Add("timePeriod", Property::Map().Add("delay", 0.5f).Add("duration", 1.0f));
progressBar.SetProperty(ProgressBar::Property::INDETERMINATE_VISUAL_ANIMATION, transitionMap);
progressBar.SetProperty(ProgressBar::Property::PROGRESS_VALUE, 0.2f);
progressBar.SetProperty(ProgressBar::Property::SECONDARY_PROGRESS_VALUE, 0.3f);
- progressBar.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
- progressBar.SetProperty( Actor::Property::SIZE, Vector2( application.GetScene().GetSize().x, 20.0f ) );
+ progressBar.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
+ progressBar.SetProperty(Actor::Property::SIZE, Vector2(application.GetScene().GetSize().x, 20.0f));
application.GetScene().Add(progressBar);
application.SendNotification();
application.Render();
int UtcDaliProgressBarSetPropertyP3(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliProgressBarSetPropertyP3" );
+ tet_infoline("UtcDaliProgressBarSetPropertyP3");
ProgressBar progressBar = ProgressBar::New();
- progressBar.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
- progressBar.SetProperty( Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_LEFT);
- progressBar.SetProperty( Actor::Property::SIZE, Vector2( application.GetScene().GetSize().x, application.GetScene().GetSize().y ) );
- application.GetScene().Add( progressBar );
+ progressBar.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ progressBar.SetProperty(Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_LEFT);
+ progressBar.SetProperty(Actor::Property::SIZE, Vector2(application.GetScene().GetSize().x, application.GetScene().GetSize().y));
+ application.GetScene().Add(progressBar);
application.SendNotification();
application.Render();
Property::Map map;
map["visualType"] = "ARC";
- map["thickness"] = 4.0f;
- map["mixColor"] = Color::BLUE;
+ map["thickness"] = 4.0f;
+ map["mixColor"] = Color::BLUE;
map["sweepAngle"] = 60;
progressBar.SetProperty(ProgressBar::Property::SECONDARY_PROGRESS_VISUAL, map);
progressBar.SetProperty(ProgressBar::Property::SECONDARY_PROGRESS_VALUE, 0.5f); // This should change visual's sweep angle.
- Property::Value value = progressBar.GetProperty( ProgressBar::Property::SECONDARY_PROGRESS_VISUAL );
- Property::Map* resultMap = value.GetMap();
- DALI_TEST_CHECK( resultMap );
+ Property::Value value = progressBar.GetProperty(ProgressBar::Property::SECONDARY_PROGRESS_VISUAL);
+ Property::Map* resultMap = value.GetMap();
+ DALI_TEST_CHECK(resultMap);
- Property::Value* sweepAngle = resultMap->Find( DevelArcVisual::Property::SWEEP_ANGLE );
- float result = 0.0f;
- sweepAngle->Get( result );
- DALI_TEST_EQUALS( result, expected, TEST_LOCATION );
+ Property::Value* sweepAngle = resultMap->Find(DevelArcVisual::Property::SWEEP_ANGLE);
+ float result = 0.0f;
+ sweepAngle->Get(result);
+ DALI_TEST_EQUALS(result, expected, TEST_LOCATION);
}
{
Property::Map map;
map["visualType"] = "ARC";
- map["thickness"] = 4.0f;
- map["mixColor"] = Color::RED;
+ map["thickness"] = 4.0f;
+ map["mixColor"] = Color::RED;
map["sweepAngle"] = 60;
progressBar.SetProperty(ProgressBar::Property::PROGRESS_VISUAL, map);
progressBar.SetProperty(ProgressBar::Property::PROGRESS_VALUE, 0.25f); // This should change visual's sweep angle.
- Property::Value value = progressBar.GetProperty( ProgressBar::Property::PROGRESS_VISUAL );
- Property::Map* resultMap = value.GetMap();
- DALI_TEST_CHECK( resultMap );
+ Property::Value value = progressBar.GetProperty(ProgressBar::Property::PROGRESS_VISUAL);
+ Property::Map* resultMap = value.GetMap();
+ DALI_TEST_CHECK(resultMap);
- Property::Value* sweepAngle = resultMap->Find( DevelArcVisual::Property::SWEEP_ANGLE );
- float result = 0.0f;
- sweepAngle->Get( result );
- DALI_TEST_EQUALS( result, expected, TEST_LOCATION );
+ Property::Value* sweepAngle = resultMap->Find(DevelArcVisual::Property::SWEEP_ANGLE);
+ float result = 0.0f;
+ sweepAngle->Get(result);
+ DALI_TEST_EQUALS(result, expected, TEST_LOCATION);
}
{
Property::Map map;
map["visualType"] = "ARC";
- map["thickness"] = 4.0f;
- map["mixColor"] = expected;
+ map["thickness"] = 4.0f;
+ map["mixColor"] = expected;
progressBar.SetProperty(ProgressBar::Property::INDETERMINATE_VISUAL, map);
- Property::Value value = progressBar.GetProperty( ProgressBar::Property::INDETERMINATE_VISUAL );
- Property::Map* resultMap = value.GetMap();
- DALI_TEST_CHECK( resultMap );
+ Property::Value value = progressBar.GetProperty(ProgressBar::Property::INDETERMINATE_VISUAL);
+ Property::Map* resultMap = value.GetMap();
+ DALI_TEST_CHECK(resultMap);
- Property::Value* mixColor = resultMap->Find( Visual::Property::MIX_COLOR );
- Vector4 result;
- mixColor->Get( result );
- DALI_TEST_EQUALS( result, expected, TEST_LOCATION );
+ Property::Value* mixColor = resultMap->Find(Visual::Property::MIX_COLOR);
+ Vector4 result;
+ mixColor->Get(result);
+ DALI_TEST_EQUALS(result, expected, TEST_LOCATION);
}
{
Property::Map map;
map["visualType"] = "ARC";
- map["thickness"] = 0.4f;
- map["mixColor"] = expected;
- progressBar.SetProperty( ProgressBar::Property::TRACK_VISUAL, map );
- progressBar.SetProperty( ProgressBar::Property::INDETERMINATE, true ); // This should not change track visual's properties.
-
- Property::Value value = progressBar.GetProperty( ProgressBar::Property::TRACK_VISUAL );
- Property::Map* resultMap = value.GetMap();
- DALI_TEST_CHECK( resultMap );
-
- Property::Value* mixColor = resultMap->Find( Visual::Property::MIX_COLOR );
- Vector4 result;
- mixColor->Get( result );
- DALI_TEST_EQUALS( result, expected, TEST_LOCATION );
+ map["thickness"] = 0.4f;
+ map["mixColor"] = expected;
+ progressBar.SetProperty(ProgressBar::Property::TRACK_VISUAL, map);
+ progressBar.SetProperty(ProgressBar::Property::INDETERMINATE, true); // This should not change track visual's properties.
+
+ Property::Value value = progressBar.GetProperty(ProgressBar::Property::TRACK_VISUAL);
+ Property::Map* resultMap = value.GetMap();
+ DALI_TEST_CHECK(resultMap);
+
+ Property::Value* mixColor = resultMap->Find(Visual::Property::MIX_COLOR);
+ Vector4 result;
+ mixColor->Get(result);
+ DALI_TEST_EQUALS(result, expected, TEST_LOCATION);
}
END_TEST;
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
#include <stdlib.h>
+#include <iostream>
// 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.h>
#include <dali/integration-api/events/touch-event-integ.h>
-#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
{
static const char* TEST_IMAGE_ONE = TEST_RESOURCE_DIR "/gallery-small-1.jpg";
-static const Vector2 INSIDE_TOUCH_POINT_POSITON = Vector2( 240, 400 );
-static const Vector3 BUTTON_POSITON_TO_GET_INSIDE_TOUCH_EVENTS = Vector3( 200, 360, 0 );
-static const Size BUTTON_SIZE_TO_GET_INSIDE_TOUCH_EVENTS = Size( 100, 100 );
+static const Vector2 INSIDE_TOUCH_POINT_POSITON = Vector2(240, 400);
+static const Vector3 BUTTON_POSITON_TO_GET_INSIDE_TOUCH_EVENTS = Vector3(200, 360, 0);
+static const Size BUTTON_SIZE_TO_GET_INSIDE_TOUCH_EVENTS = Size(100, 100);
static bool gPushButtonSelectedState = false;
-bool PushButtonSelected( Button button )
+bool PushButtonSelected(Button button)
{
- gPushButtonSelectedState = button.GetProperty<bool>(button.GetPropertyIndex("selected") );
+ gPushButtonSelectedState = button.GetProperty<bool>(button.GetPropertyIndex("selected"));
return true;
}
static bool gPushButtonPressed = false;
-static bool PushButtonPressed( Button button )
+static bool PushButtonPressed(Button button)
{
gPushButtonPressed = true;
return true;
static bool gPushButtonReleased = false;
-static bool PushButtonReleased( Button button )
+static bool PushButtonReleased(Button button)
{
gPushButtonReleased = true;
return true;
static bool gPushButtonClicked = false;
-static bool PushButtonClicked( Button button )
+static bool PushButtonClicked(Button button)
{
gPushButtonClicked = true;
return gPushButtonClicked;
Dali::Integration::Point GetPointDownInside()
{
Dali::Integration::Point point;
- point.SetState( PointState::DOWN );
- point.SetScreenPosition( INSIDE_TOUCH_POINT_POSITON );
+ point.SetState(PointState::DOWN);
+ point.SetScreenPosition(INSIDE_TOUCH_POINT_POSITON);
return point;
}
Dali::Integration::Point GetPointUpInside()
{
Dali::Integration::Point point;
- point.SetState( PointState::UP );
- point.SetScreenPosition( INSIDE_TOUCH_POINT_POSITON );
+ point.SetState(PointState::UP);
+ point.SetScreenPosition(INSIDE_TOUCH_POINT_POSITON);
return point;
}
Dali::Integration::Point GetPointLeave()
{
Dali::Integration::Point point;
- point.SetState( PointState::LEAVE );
- point.SetScreenPosition( INSIDE_TOUCH_POINT_POSITON );
+ point.SetState(PointState::LEAVE);
+ point.SetScreenPosition(INSIDE_TOUCH_POINT_POSITON);
return point;
}
Dali::Integration::Point GetPointEnter()
{
Dali::Integration::Point point;
- point.SetState( PointState::MOTION );
- point.SetScreenPosition( INSIDE_TOUCH_POINT_POSITON );
+ point.SetState(PointState::MOTION);
+ point.SetScreenPosition(INSIDE_TOUCH_POINT_POSITON);
return point;
}
Dali::Integration::Point GetPointDownOutside()
{
Dali::Integration::Point point;
- point.SetState( PointState::DOWN );
- point.SetScreenPosition( Vector2( 10, 10 ) );
+ point.SetState(PointState::DOWN);
+ point.SetScreenPosition(Vector2(10, 10));
return point;
}
Dali::Integration::Point GetPointUpOutside()
{
Dali::Integration::Point point;
- point.SetState( PointState::UP );
- point.SetScreenPosition( Vector2( 10, 10 ) );
+ point.SetState(PointState::UP);
+ point.SetScreenPosition(Vector2(10, 10));
return point;
}
// Set up the position of the button for the default test events
-void SetupButtonForTestTouchEvents( ToolkitTestApplication& application, Button& button, bool useDefaultImages )
+void SetupButtonForTestTouchEvents(ToolkitTestApplication& application, Button& button, bool useDefaultImages)
{
- button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- button.SetProperty( Actor::Property::POSITION, BUTTON_POSITON_TO_GET_INSIDE_TOUCH_EVENTS );
- if ( useDefaultImages )
+ button.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ button.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ button.SetProperty(Actor::Property::POSITION, BUTTON_POSITON_TO_GET_INSIDE_TOUCH_EVENTS);
+ if(useDefaultImages)
{
- const Vector2 TEST_IMAGE_SIZE = Vector2( BUTTON_SIZE_TO_GET_INSIDE_TOUCH_EVENTS );
- TestPlatformAbstraction& platform = application.GetPlatform();
- platform.SetClosestImageSize( TEST_IMAGE_SIZE );
- button.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, TEST_IMAGE_ONE );
- button.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, TEST_IMAGE_ONE );
+ const Vector2 TEST_IMAGE_SIZE = Vector2(BUTTON_SIZE_TO_GET_INSIDE_TOUCH_EVENTS);
+ TestPlatformAbstraction& platform = application.GetPlatform();
+ platform.SetClosestImageSize(TEST_IMAGE_SIZE);
+ button.SetProperty(Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, TEST_IMAGE_ONE);
+ button.SetProperty(Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, TEST_IMAGE_ONE);
}
}
-static std::string GetButtonText( Button button )
+static std::string GetButtonText(Button button)
{
- Property::Value value = button.GetProperty( Toolkit::Button::Property::LABEL );
+ Property::Value value = button.GetProperty(Toolkit::Button::Property::LABEL);
- Property::Map *labelProperty = value.GetMap();
+ Property::Map* labelProperty = value.GetMap();
std::string textLabel;
- if ( labelProperty )
+ if(labelProperty)
{
- Property::Value* value = labelProperty->Find( Toolkit::TextVisual::Property::TEXT );
- value->Get( textLabel );
+ Property::Value* value = labelProperty->Find(Toolkit::TextVisual::Property::TEXT);
+ value->Get(textLabel);
}
return textLabel;
PushButton button;
- DALI_TEST_CHECK( !button );
+ DALI_TEST_CHECK(!button);
END_TEST;
}
// Initialize an object, ref count == 1
PushButton button = PushButton::New();
- PushButton copy( button );
- DALI_TEST_CHECK( copy );
+ PushButton copy(button);
+ DALI_TEST_CHECK(copy);
END_TEST;
}
ToolkitTestApplication application;
PushButton button = PushButton::New();
- DALI_TEST_EQUALS( 1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), false , TEST_LOCATION );
- button.SetProperty( Button::Property::TOGGLABLE, true );
- DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), true , TEST_LOCATION );
+ DALI_TEST_EQUALS(1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_EQUALS(button.GetProperty<bool>(Button::Property::TOGGLABLE), false, TEST_LOCATION);
+ button.SetProperty(Button::Property::TOGGLABLE, true);
+ DALI_TEST_EQUALS(button.GetProperty<bool>(Button::Property::TOGGLABLE), true, TEST_LOCATION);
- PushButton moved = std::move( button );
- DALI_TEST_CHECK( moved );
- DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_EQUALS( moved.GetProperty<bool>( Button::Property::TOGGLABLE ), true , TEST_LOCATION );
- DALI_TEST_CHECK( !button );
+ PushButton moved = std::move(button);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_EQUALS(moved.GetProperty<bool>(Button::Property::TOGGLABLE), true, TEST_LOCATION);
+ DALI_TEST_CHECK(!button);
END_TEST;
}
PushButton button = PushButton::New();
- PushButton copy( button );
- DALI_TEST_CHECK( copy );
+ PushButton copy(button);
+ DALI_TEST_CHECK(copy);
- DALI_TEST_CHECK( button == copy );
+ DALI_TEST_CHECK(button == copy);
END_TEST;
}
ToolkitTestApplication application;
PushButton button = PushButton::New();
- DALI_TEST_EQUALS( 1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), false , TEST_LOCATION );
- button.SetProperty( Button::Property::TOGGLABLE, true );
- DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), true , TEST_LOCATION );
+ DALI_TEST_EQUALS(1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_EQUALS(button.GetProperty<bool>(Button::Property::TOGGLABLE), false, TEST_LOCATION);
+ button.SetProperty(Button::Property::TOGGLABLE, true);
+ DALI_TEST_EQUALS(button.GetProperty<bool>(Button::Property::TOGGLABLE), true, TEST_LOCATION);
PushButton moved;
- moved = std::move( button );
- DALI_TEST_CHECK( moved );
- DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_EQUALS( moved.GetProperty<bool>( Button::Property::TOGGLABLE ), true , TEST_LOCATION );
- DALI_TEST_CHECK( !button );
+ moved = std::move(button);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_EQUALS(moved.GetProperty<bool>(Button::Property::TOGGLABLE), true, TEST_LOCATION);
+ DALI_TEST_CHECK(!button);
END_TEST;
}
PushButton button = PushButton::New();
- DALI_TEST_CHECK( button );
+ DALI_TEST_CHECK(button);
END_TEST;
}
BaseHandle object(button);
- PushButton button2 = PushButton::DownCast( object );
+ PushButton button2 = PushButton::DownCast(object);
DALI_TEST_CHECK(button2);
- PushButton button3 = DownCast< PushButton >(object);
+ PushButton button3 = DownCast<PushButton>(object);
DALI_TEST_CHECK(button3);
END_TEST;
}
BaseHandle unInitializedObject;
- PushButton button1 = PushButton::DownCast( unInitializedObject );
- DALI_TEST_CHECK( !button1 );
+ PushButton button1 = PushButton::DownCast(unInitializedObject);
+ DALI_TEST_CHECK(!button1);
- PushButton button2 = DownCast< PushButton >( unInitializedObject );
- DALI_TEST_CHECK( !button2 );
+ PushButton button2 = DownCast<PushButton>(unInitializedObject);
+ DALI_TEST_CHECK(!button2);
END_TEST;
}
PushButton pushButton = PushButton::New();
- pushButton.SetProperty( pushButton.GetPropertyIndex("autoRepeating"), true );
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("autoRepeating")), true, TEST_LOCATION );
+ pushButton.SetProperty(pushButton.GetPropertyIndex("autoRepeating"), true);
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("autoRepeating")), true, TEST_LOCATION);
- pushButton.SetProperty( pushButton.GetPropertyIndex("autoRepeating"), false );
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("autoRepeating")), false, TEST_LOCATION );
+ pushButton.SetProperty(pushButton.GetPropertyIndex("autoRepeating"), false);
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("autoRepeating")), false, TEST_LOCATION);
- pushButton.SetProperty( pushButton.GetPropertyIndex("autoRepeating"), true );
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("autoRepeating")), true, TEST_LOCATION );
+ pushButton.SetProperty(pushButton.GetPropertyIndex("autoRepeating"), true);
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("autoRepeating")), true, TEST_LOCATION);
- END_TEST;
+ END_TEST;
}
int UtcDaliPushButtonSetAutoRepeating(void)
tet_infoline("Ensure setting AutoRepeating on a SELECTED Toggle button switches off Toggle\n");
PushButton pushButton = PushButton::New();
- const bool INITIAL_TOGGLE_VALUE = true;
+ const bool INITIAL_TOGGLE_VALUE = true;
const bool INITIAL_SELECTED_VALUE = true;
- pushButton.SetProperty( Button::Property::TOGGLABLE, INITIAL_TOGGLE_VALUE);
- pushButton.SetProperty( Button::Property::SELECTED, INITIAL_SELECTED_VALUE );
+ pushButton.SetProperty(Button::Property::TOGGLABLE, INITIAL_TOGGLE_VALUE);
+ pushButton.SetProperty(Button::Property::SELECTED, INITIAL_SELECTED_VALUE);
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::TOGGLABLE ), INITIAL_TOGGLE_VALUE , TEST_LOCATION );
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::SELECTED ), INITIAL_SELECTED_VALUE , TEST_LOCATION );
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(Button::Property::TOGGLABLE), INITIAL_TOGGLE_VALUE, TEST_LOCATION);
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(Button::Property::SELECTED), INITIAL_SELECTED_VALUE, TEST_LOCATION);
- pushButton.SetProperty( Button::Property::AUTO_REPEATING, true );
+ pushButton.SetProperty(Button::Property::AUTO_REPEATING, true);
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::TOGGLABLE ), !INITIAL_TOGGLE_VALUE , TEST_LOCATION );
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(Button::Property::TOGGLABLE), !INITIAL_TOGGLE_VALUE, TEST_LOCATION);
END_TEST;
}
PushButton pushButton = PushButton::New();
- pushButton.SetProperty( pushButton.GetPropertyIndex("togglable"), true );
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("togglable")), true, TEST_LOCATION );
+ pushButton.SetProperty(pushButton.GetPropertyIndex("togglable"), true);
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("togglable")), true, TEST_LOCATION);
- pushButton.SetProperty( pushButton.GetPropertyIndex("togglable"), false );
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("togglable")), false, TEST_LOCATION );
+ pushButton.SetProperty(pushButton.GetPropertyIndex("togglable"), false);
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("togglable")), false, TEST_LOCATION);
- pushButton.SetProperty( pushButton.GetPropertyIndex("togglable"), true );
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("togglable")), true, TEST_LOCATION );
+ pushButton.SetProperty(pushButton.GetPropertyIndex("togglable"), true);
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("togglable")), true, TEST_LOCATION);
END_TEST;
}
PushButton pushButton = PushButton::New();
- pushButton.SetProperty( Button::Property::AUTO_REPEATING, true );
- pushButton.SetProperty( pushButton.GetPropertyIndex("togglable"), true );
+ pushButton.SetProperty(Button::Property::AUTO_REPEATING, true);
+ pushButton.SetProperty(pushButton.GetPropertyIndex("togglable"), true);
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("togglable")), true, TEST_LOCATION );
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("autoRepeating")), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("togglable")), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("autoRepeating")), false, TEST_LOCATION);
- pushButton.SetProperty( pushButton.GetPropertyIndex("togglable"), true );
- pushButton.SetProperty( Button::Property::AUTO_REPEATING, true );
+ pushButton.SetProperty(pushButton.GetPropertyIndex("togglable"), true);
+ pushButton.SetProperty(Button::Property::AUTO_REPEATING, true);
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("autoRepeating")), true, TEST_LOCATION );
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("togglable")), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("autoRepeating")), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("togglable")), false, TEST_LOCATION);
END_TEST;
}
PushButton pushButton = PushButton::New();
- pushButton.SetProperty( pushButton.GetPropertyIndex("togglable"), true );
+ pushButton.SetProperty(pushButton.GetPropertyIndex("togglable"), true);
- pushButton.StateChangedSignal().Connect( &PushButtonSelected );
+ pushButton.StateChangedSignal().Connect(&PushButtonSelected);
gPushButtonSelectedState = false;
- pushButton.SetProperty( Button::Property::SELECTED, true );
+ pushButton.SetProperty(Button::Property::SELECTED, true);
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::SELECTED ), true , TEST_LOCATION );
- DALI_TEST_CHECK( gPushButtonSelectedState );
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(Button::Property::SELECTED), true, TEST_LOCATION);
+ DALI_TEST_CHECK(gPushButtonSelectedState);
- pushButton.SetProperty( Button::Property::SELECTED, false );
+ pushButton.SetProperty(Button::Property::SELECTED, false);
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::SELECTED ), false , TEST_LOCATION );
- DALI_TEST_CHECK( !gPushButtonSelectedState );
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(Button::Property::SELECTED), false, TEST_LOCATION);
+ DALI_TEST_CHECK(!gPushButtonSelectedState);
- pushButton.SetProperty( Button::Property::SELECTED, true );
+ pushButton.SetProperty(Button::Property::SELECTED, true);
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::SELECTED ), true , TEST_LOCATION );
- DALI_TEST_CHECK( gPushButtonSelectedState );
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(Button::Property::SELECTED), true, TEST_LOCATION);
+ DALI_TEST_CHECK(gPushButtonSelectedState);
END_TEST;
}
PushButton pushButton = PushButton::New();
- pushButton.SetProperty( pushButton.GetPropertyIndex("togglable"), false );
- pushButton.StateChangedSignal().Connect( &PushButtonSelected );
+ pushButton.SetProperty(pushButton.GetPropertyIndex("togglable"), false);
+ pushButton.StateChangedSignal().Connect(&PushButtonSelected);
gPushButtonSelectedState = false;
- pushButton.SetProperty( Button::Property::SELECTED, true );
+ pushButton.SetProperty(Button::Property::SELECTED, true);
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::SELECTED ), false , TEST_LOCATION );
- DALI_TEST_CHECK( !gPushButtonSelectedState );
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(Button::Property::SELECTED), false, TEST_LOCATION);
+ DALI_TEST_CHECK(!gPushButtonSelectedState);
- pushButton.SetProperty( Button::Property::SELECTED, false );
+ pushButton.SetProperty(Button::Property::SELECTED, false);
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::SELECTED ), false , TEST_LOCATION );
- DALI_TEST_CHECK( !gPushButtonSelectedState );
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(Button::Property::SELECTED), false, TEST_LOCATION);
+ DALI_TEST_CHECK(!gPushButtonSelectedState);
- pushButton.SetProperty( Button::Property::SELECTED, true );
+ pushButton.SetProperty(Button::Property::SELECTED, true);
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::SELECTED ), false , TEST_LOCATION );
- DALI_TEST_CHECK( !gPushButtonSelectedState );
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(Button::Property::SELECTED), false, TEST_LOCATION);
+ DALI_TEST_CHECK(!gPushButtonSelectedState);
END_TEST;
}
PushButton pushButton = PushButton::New();
- pushButton.SetProperty( Button::Property::AUTO_REPEATING, true );
+ pushButton.SetProperty(Button::Property::AUTO_REPEATING, true);
- pushButton.SetProperty( Button::Property::INITIAL_AUTO_REPEATING_DELAY, 1.f );
+ pushButton.SetProperty(Button::Property::INITIAL_AUTO_REPEATING_DELAY, 1.f);
- DALI_TEST_EQUALS( pushButton.GetProperty<float>(pushButton.GetPropertyIndex("initialAutoRepeatingDelay") ), 1.f, TEST_LOCATION );
+ DALI_TEST_EQUALS(pushButton.GetProperty<float>(pushButton.GetPropertyIndex("initialAutoRepeatingDelay")), 1.f, TEST_LOCATION);
END_TEST;
}
PushButton pushButton = PushButton::New();
- bool assert1( false );
- bool assert2( false );
+ bool assert1(false);
+ bool assert2(false);
- pushButton.SetProperty( Button::Property::AUTO_REPEATING, true );
+ pushButton.SetProperty(Button::Property::AUTO_REPEATING, true);
try
{
- pushButton.SetProperty( Button::Property::INITIAL_AUTO_REPEATING_DELAY, -1.f );
+ pushButton.SetProperty(Button::Property::INITIAL_AUTO_REPEATING_DELAY, -1.f);
}
- catch( Dali::DaliException& e )
+ catch(Dali::DaliException& e)
{
- DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_PRINT_ASSERT(e);
DALI_TEST_EQUALS(e.condition, "initialAutoRepeatingDelay > 0.f", TEST_LOCATION);
assert1 = true;
}
try
{
- pushButton.SetProperty( Button::Property::NEXT_AUTO_REPEATING_DELAY, -1.f );
+ pushButton.SetProperty(Button::Property::NEXT_AUTO_REPEATING_DELAY, -1.f);
}
- catch( Dali::DaliException& e )
+ catch(Dali::DaliException& e)
{
- DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_PRINT_ASSERT(e);
DALI_TEST_EQUALS(e.condition, "nextAutoRepeatingDelay > 0.f", TEST_LOCATION);
assert2 = true;
}
- DALI_TEST_CHECK( assert1 && assert2 );
+ DALI_TEST_CHECK(assert1 && assert2);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliPushButtonSetLabelText");
- const std::string STR( "Hola!" );
+ const std::string STR("Hola!");
PushButton pushButton = PushButton::New();
application.SendNotification();
application.Render();
- pushButton.SetProperty( Toolkit::Button::Property::LABEL,
- Property::Map().Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT )
- .Add( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f )
- );
-
+ pushButton.SetProperty(Toolkit::Button::Property::LABEL,
+ Property::Map().Add(Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT).Add(Toolkit::TextVisual::Property::POINT_SIZE, 15.0f));
- pushButton.SetProperty( Toolkit::Button::Property::LABEL, STR );
+ pushButton.SetProperty(Toolkit::Button::Property::LABEL, STR);
- DALI_TEST_EQUALS( GetButtonText( pushButton ), STR, TEST_LOCATION );
+ DALI_TEST_EQUALS(GetButtonText(pushButton), STR, TEST_LOCATION);
END_TEST;
}
tet_infoline(" UtcDaliPushButtonPressed");
PushButton pushButton = PushButton::New();
- pushButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- pushButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- pushButton.SetProperty( Actor::Property::POSITION, BUTTON_POSITON_TO_GET_INSIDE_TOUCH_EVENTS );
- pushButton.SetProperty( Actor::Property::SIZE, BUTTON_SIZE_TO_GET_INSIDE_TOUCH_EVENTS );
+ pushButton.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ pushButton.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ pushButton.SetProperty(Actor::Property::POSITION, BUTTON_POSITON_TO_GET_INSIDE_TOUCH_EVENTS);
+ pushButton.SetProperty(Actor::Property::SIZE, BUTTON_SIZE_TO_GET_INSIDE_TOUCH_EVENTS);
- application.GetScene().Add( pushButton );
+ application.GetScene().Add(pushButton);
application.SendNotification();
application.Render();
gPushButtonPressed = false;
// connect to its touch signal
- pushButton.PressedSignal().Connect( &PushButtonPressed );
+ pushButton.PressedSignal().Connect(&PushButtonPressed);
Dali::Integration::TouchEvent eventDown;
- eventDown.AddPoint( GetPointDownInside() );
+ eventDown.AddPoint(GetPointDownInside());
// flush the queue and render once
application.SendNotification();
application.Render();
- application.ProcessEvent( eventDown );
+ application.ProcessEvent(eventDown);
- DALI_TEST_CHECK( gPushButtonPressed );
+ DALI_TEST_CHECK(gPushButtonPressed);
END_TEST;
}
tet_infoline(" UtcDaliPushButtonReleased");
PushButton pushButton = PushButton::New();
- pushButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- pushButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- pushButton.SetProperty( Actor::Property::POSITION, BUTTON_POSITON_TO_GET_INSIDE_TOUCH_EVENTS );
- pushButton.SetProperty( Actor::Property::SIZE, BUTTON_SIZE_TO_GET_INSIDE_TOUCH_EVENTS );
+ pushButton.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ pushButton.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ pushButton.SetProperty(Actor::Property::POSITION, BUTTON_POSITON_TO_GET_INSIDE_TOUCH_EVENTS);
+ pushButton.SetProperty(Actor::Property::SIZE, BUTTON_SIZE_TO_GET_INSIDE_TOUCH_EVENTS);
- application.GetScene().Add( pushButton );
+ application.GetScene().Add(pushButton);
application.SendNotification();
application.Render();
// connect to its touch signal
- pushButton.ReleasedSignal().Connect( &PushButtonReleased );
+ pushButton.ReleasedSignal().Connect(&PushButtonReleased);
Dali::Integration::TouchEvent event;
// Test1. Touch point down and up inside the button.
gPushButtonReleased = false;
- event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointDownInside() );
- application.ProcessEvent( event );
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint(GetPointDownInside());
+ application.ProcessEvent(event);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointUpInside() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointUpInside());
+ application.ProcessEvent(event);
- DALI_TEST_CHECK( gPushButtonReleased );
+ DALI_TEST_CHECK(gPushButtonReleased);
// Test2. Touch point down and up outside the button.
gPushButtonReleased = false;
- event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointDownOutside() );
- application.ProcessEvent( event );
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint(GetPointDownOutside());
+ application.ProcessEvent(event);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointUpOutside() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointUpOutside());
+ application.ProcessEvent(event);
- DALI_TEST_CHECK( !gPushButtonReleased );
+ DALI_TEST_CHECK(!gPushButtonReleased);
// Test3. Touch point down inside and up outside the button.
gPushButtonReleased = false;
- event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointDownInside() );
- application.ProcessEvent( event );
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint(GetPointDownInside());
+ application.ProcessEvent(event);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointLeave() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointLeave());
+ application.ProcessEvent(event);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointUpOutside() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointUpOutside());
+ application.ProcessEvent(event);
- DALI_TEST_CHECK( gPushButtonReleased );
+ DALI_TEST_CHECK(gPushButtonReleased);
// Test4. Touch point down outside and up inside the button.
gPushButtonReleased = false;
- event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointDownOutside() );
- application.ProcessEvent( event );
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint(GetPointDownOutside());
+ application.ProcessEvent(event);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointEnter() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointEnter());
+ application.ProcessEvent(event);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointUpInside() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointUpInside());
+ application.ProcessEvent(event);
- DALI_TEST_CHECK( !gPushButtonReleased );
+ DALI_TEST_CHECK(!gPushButtonReleased);
END_TEST;
}
tet_infoline(" UtcDaliPushButtonSelected");
PushButton pushButton = PushButton::New();
- pushButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- pushButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- pushButton.SetProperty( Actor::Property::POSITION, BUTTON_POSITON_TO_GET_INSIDE_TOUCH_EVENTS );
- pushButton.SetProperty( Actor::Property::SIZE, BUTTON_SIZE_TO_GET_INSIDE_TOUCH_EVENTS );
+ pushButton.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ pushButton.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ pushButton.SetProperty(Actor::Property::POSITION, BUTTON_POSITON_TO_GET_INSIDE_TOUCH_EVENTS);
+ pushButton.SetProperty(Actor::Property::SIZE, BUTTON_SIZE_TO_GET_INSIDE_TOUCH_EVENTS);
- application.GetScene().Add( pushButton );
+ application.GetScene().Add(pushButton);
application.SendNotification();
application.Render();
// connect to its touch signal
- pushButton.StateChangedSignal().Connect( &PushButtonSelected );
+ pushButton.StateChangedSignal().Connect(&PushButtonSelected);
Dali::Integration::TouchEvent event;
// Test1. No togglable button.
gPushButtonSelectedState = false;
- event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointDownInside() );
- application.ProcessEvent( event );
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint(GetPointDownInside());
+ application.ProcessEvent(event);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointUpInside() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointUpInside());
+ application.ProcessEvent(event);
- DALI_TEST_CHECK( !gPushButtonSelectedState );
+ DALI_TEST_CHECK(!gPushButtonSelectedState);
// Set togglable property.
- pushButton.SetProperty( Button::Property::TOGGLABLE, true );
+ pushButton.SetProperty(Button::Property::TOGGLABLE, true);
// Test2. Touch point down and up inside the button twice.
gPushButtonSelectedState = false;
- event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointDownInside() );
- application.ProcessEvent( event );
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint(GetPointDownInside());
+ application.ProcessEvent(event);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointUpInside() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointUpInside());
+ application.ProcessEvent(event);
- DALI_TEST_CHECK( gPushButtonSelectedState );
+ DALI_TEST_CHECK(gPushButtonSelectedState);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointDownInside() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointDownInside());
+ application.ProcessEvent(event);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointUpInside() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointUpInside());
+ application.ProcessEvent(event);
- DALI_TEST_CHECK( !gPushButtonSelectedState );
+ DALI_TEST_CHECK(!gPushButtonSelectedState);
// Test3. Touch point down and up outside the button.
gPushButtonSelectedState = false;
- event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointDownOutside() );
- application.ProcessEvent( event );
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint(GetPointDownOutside());
+ application.ProcessEvent(event);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointUpOutside() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointUpOutside());
+ application.ProcessEvent(event);
- DALI_TEST_CHECK( !gPushButtonSelectedState );
+ DALI_TEST_CHECK(!gPushButtonSelectedState);
// Test4. Touch point down inside and up outside the button.
// State changes on Button down
gPushButtonSelectedState = false;
- event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointDownInside() );
- application.ProcessEvent( event );
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint(GetPointDownInside());
+ application.ProcessEvent(event);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointLeave() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointLeave());
+ application.ProcessEvent(event);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointUpOutside() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointUpOutside());
+ application.ProcessEvent(event);
- DALI_TEST_CHECK( gPushButtonSelectedState );
+ DALI_TEST_CHECK(gPushButtonSelectedState);
// Test5. Touch point down outside and up inside the button.
// Start in unselected state
- pushButton.SetProperty( Button::Property::SELECTED, false );
+ pushButton.SetProperty(Button::Property::SELECTED, false);
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("selected") ),false , TEST_LOCATION );
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(pushButton.GetPropertyIndex("selected")), false, TEST_LOCATION);
gPushButtonSelectedState = false;
- event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointDownOutside() );
- application.ProcessEvent( event );
+ event = Dali::Integration::TouchEvent();
+ event.AddPoint(GetPointDownOutside());
+ application.ProcessEvent(event);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointEnter() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointEnter());
+ application.ProcessEvent(event);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointUpInside() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointUpInside());
+ application.ProcessEvent(event);
- DALI_TEST_CHECK( !gPushButtonSelectedState );
+ DALI_TEST_CHECK(!gPushButtonSelectedState);
END_TEST;
}
tet_infoline(" UtcDaliPushButtonPropertySetLabelPadding");
PushButton pushButton = PushButton::New();
- pushButton.SetProperty( Toolkit::PushButton::Property::LABEL_PADDING, Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) );
- DALI_TEST_EQUALS( pushButton.GetProperty<Vector4>( Toolkit::PushButton::Property::LABEL_PADDING ), Vector4( 1.0f, 1.0f, 1.0f, 1.0f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+ pushButton.SetProperty(Toolkit::PushButton::Property::LABEL_PADDING, Vector4(1.0f, 1.0f, 1.0f, 1.0f));
+ DALI_TEST_EQUALS(pushButton.GetProperty<Vector4>(Toolkit::PushButton::Property::LABEL_PADDING), Vector4(1.0f, 1.0f, 1.0f, 1.0f), Math::MACHINE_EPSILON_1000, TEST_LOCATION);
- pushButton.SetProperty( Toolkit::PushButton::Property::LABEL_PADDING, Vector4( 10.0f, 10.0f, 10.0f, 10.0f ) );
- DALI_TEST_EQUALS( pushButton.GetProperty<Vector4>( Toolkit::PushButton::Property::LABEL_PADDING ), Vector4( 10.0f, 10.0f, 10.0f, 10.0f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+ pushButton.SetProperty(Toolkit::PushButton::Property::LABEL_PADDING, Vector4(10.0f, 10.0f, 10.0f, 10.0f));
+ DALI_TEST_EQUALS(pushButton.GetProperty<Vector4>(Toolkit::PushButton::Property::LABEL_PADDING), Vector4(10.0f, 10.0f, 10.0f, 10.0f), Math::MACHINE_EPSILON_1000, TEST_LOCATION);
END_TEST;
}
tet_infoline(" UtcDaliPushButtonPropertySetIconPadding");
PushButton pushButton = PushButton::New();
- pushButton.SetProperty( Toolkit::PushButton::Property::ICON_PADDING, Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) );
- DALI_TEST_EQUALS( pushButton.GetProperty<Vector4>( Toolkit::PushButton::Property::ICON_PADDING ), Vector4( 1.0f, 1.0f, 1.0f, 1.0f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+ pushButton.SetProperty(Toolkit::PushButton::Property::ICON_PADDING, Vector4(1.0f, 1.0f, 1.0f, 1.0f));
+ DALI_TEST_EQUALS(pushButton.GetProperty<Vector4>(Toolkit::PushButton::Property::ICON_PADDING), Vector4(1.0f, 1.0f, 1.0f, 1.0f), Math::MACHINE_EPSILON_1000, TEST_LOCATION);
- pushButton.SetProperty( Toolkit::PushButton::Property::ICON_PADDING, Vector4( 10.0f, 10.0f, 10.0f, 10.0f ) );
- DALI_TEST_EQUALS( pushButton.GetProperty<Vector4>( Toolkit::PushButton::Property::ICON_PADDING ), Vector4( 10.0f, 10.0f, 10.0f, 10.0f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+ pushButton.SetProperty(Toolkit::PushButton::Property::ICON_PADDING, Vector4(10.0f, 10.0f, 10.0f, 10.0f));
+ DALI_TEST_EQUALS(pushButton.GetProperty<Vector4>(Toolkit::PushButton::Property::ICON_PADDING), Vector4(10.0f, 10.0f, 10.0f, 10.0f), Math::MACHINE_EPSILON_1000, TEST_LOCATION);
END_TEST;
}
// The icon and label are each enabled and disabled to confirm the correct padding is used.
PushButton pushButton = PushButton::New();
- const Vector4 TEST_ICON_PADDING( 20.0f, 20.0f, 20.0f, 20.0f );
- const Vector4 TEST_LABEL_PADDING( 10.0f, 10.0f, 10.0f, 10.0f );
+ const Vector4 TEST_ICON_PADDING(20.0f, 20.0f, 20.0f, 20.0f);
+ const Vector4 TEST_LABEL_PADDING(10.0f, 10.0f, 10.0f, 10.0f);
// Get actual size of test image
- ImageDimensions testImageSize = Dali::GetClosestImageSize( TEST_IMAGE_ONE );
- const Vector2 TEST_IMAGE_SIZE( testImageSize.GetWidth(), testImageSize.GetHeight() );
+ ImageDimensions testImageSize = Dali::GetClosestImageSize(TEST_IMAGE_ONE);
+ const Vector2 TEST_IMAGE_SIZE(testImageSize.GetWidth(), testImageSize.GetHeight());
- pushButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- pushButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- pushButton.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
- pushButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+ pushButton.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ pushButton.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ pushButton.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 0.0f));
+ pushButton.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS);
- application.GetScene().Add( pushButton );
+ application.GetScene().Add(pushButton);
application.SendNotification();
application.Render();
// First test the size is zero.
// No padding should be added as there is no label or icon.
- Vector2 size( Vector2::ZERO );
- size.width = pushButton.GetRelayoutSize( Dimension::WIDTH );
- size.height = pushButton.GetRelayoutSize( Dimension::HEIGHT );
- tet_printf( "Button Natural Size(%f,%f)\n", pushButton.GetNaturalSize().width, pushButton.GetNaturalSize().height );
+ Vector2 size(Vector2::ZERO);
+ size.width = pushButton.GetRelayoutSize(Dimension::WIDTH);
+ size.height = pushButton.GetRelayoutSize(Dimension::HEIGHT);
+ tet_printf("Button Natural Size(%f,%f)\n", pushButton.GetNaturalSize().width, pushButton.GetNaturalSize().height);
- DALI_TEST_EQUALS( size, Vector2::ZERO, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+ DALI_TEST_EQUALS(size, Vector2::ZERO, Math::MACHINE_EPSILON_1000, TEST_LOCATION);
// Check label only padding
- pushButton.SetProperty( Toolkit::Button::Property::LABEL, "Label" );
+ pushButton.SetProperty(Toolkit::Button::Property::LABEL, "Label");
application.SendNotification();
application.Render();
- Vector2 sizeWithLabelWithoutPadding( Vector2::ZERO );
- sizeWithLabelWithoutPadding.width = pushButton.GetRelayoutSize( Dimension::WIDTH );
- sizeWithLabelWithoutPadding.height = pushButton.GetRelayoutSize( Dimension::HEIGHT );
+ Vector2 sizeWithLabelWithoutPadding(Vector2::ZERO);
+ sizeWithLabelWithoutPadding.width = pushButton.GetRelayoutSize(Dimension::WIDTH);
+ sizeWithLabelWithoutPadding.height = pushButton.GetRelayoutSize(Dimension::HEIGHT);
- tet_printf( "Button RelayoutSize label without padding (%f,%f)\n", sizeWithLabelWithoutPadding.width, sizeWithLabelWithoutPadding.height );
+ tet_printf("Button RelayoutSize label without padding (%f,%f)\n", sizeWithLabelWithoutPadding.width, sizeWithLabelWithoutPadding.height);
// Add label padding to label
- pushButton.SetProperty( Toolkit::PushButton::Property::LABEL_PADDING, TEST_LABEL_PADDING );
+ pushButton.SetProperty(Toolkit::PushButton::Property::LABEL_PADDING, TEST_LABEL_PADDING);
application.SendNotification();
application.Render();
- Vector2 sizeLabelAndPadding( Vector2::ZERO );
- sizeLabelAndPadding.width = pushButton.GetRelayoutSize( Dimension::WIDTH );
- sizeLabelAndPadding.height = pushButton.GetRelayoutSize( Dimension::HEIGHT );
- tet_printf( "Button RelayoutSize after label padding(%f,%f)\n", sizeLabelAndPadding.width, sizeLabelAndPadding.height );
+ Vector2 sizeLabelAndPadding(Vector2::ZERO);
+ sizeLabelAndPadding.width = pushButton.GetRelayoutSize(Dimension::WIDTH);
+ sizeLabelAndPadding.height = pushButton.GetRelayoutSize(Dimension::HEIGHT);
+ tet_printf("Button RelayoutSize after label padding(%f,%f)\n", sizeLabelAndPadding.width, sizeLabelAndPadding.height);
// If control size has increased beyond size of just label then padding has been applied
- DALI_TEST_GREATER( sizeLabelAndPadding.width, sizeWithLabelWithoutPadding.width+TEST_LABEL_PADDING.x, TEST_LOCATION );
- DALI_TEST_GREATER( sizeLabelAndPadding.height, sizeWithLabelWithoutPadding.height+TEST_LABEL_PADDING.w, TEST_LOCATION );
+ DALI_TEST_GREATER(sizeLabelAndPadding.width, sizeWithLabelWithoutPadding.width + TEST_LABEL_PADDING.x, TEST_LOCATION);
+ DALI_TEST_GREATER(sizeLabelAndPadding.height, sizeWithLabelWithoutPadding.height + TEST_LABEL_PADDING.w, TEST_LOCATION);
// Re-initialise the button so we can setup icon-only padding.
pushButton.Unparent();
pushButton = PushButton::New();
- pushButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- pushButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- pushButton.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
- pushButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
-
- application.GetScene().Add( pushButton );
+ pushButton.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ pushButton.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ pushButton.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 0.0f));
+ pushButton.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS);
+ application.GetScene().Add(pushButton);
- pushButton.SetProperty( Toolkit::DevelButton::Property::LABEL_RELATIVE_ALIGNMENT, "BEGIN" );
- pushButton.SetProperty( Toolkit::Button::Property::UNSELECTED_VISUAL, TEST_IMAGE_ONE );
- pushButton.SetProperty( Toolkit::Button::Property::SELECTED_VISUAL, TEST_IMAGE_ONE );
+ pushButton.SetProperty(Toolkit::DevelButton::Property::LABEL_RELATIVE_ALIGNMENT, "BEGIN");
+ pushButton.SetProperty(Toolkit::Button::Property::UNSELECTED_VISUAL, TEST_IMAGE_ONE);
+ pushButton.SetProperty(Toolkit::Button::Property::SELECTED_VISUAL, TEST_IMAGE_ONE);
application.SendNotification();
application.Render();
// Size of button with just icon
- size.width = pushButton.GetRelayoutSize( Dimension::WIDTH );
- size.height = pushButton.GetRelayoutSize( Dimension::HEIGHT );
- tet_printf( "Button RelayoutSize with icon(%f,%f)\n", size.width, size.height );
+ size.width = pushButton.GetRelayoutSize(Dimension::WIDTH);
+ size.height = pushButton.GetRelayoutSize(Dimension::HEIGHT);
+ tet_printf("Button RelayoutSize with icon(%f,%f)\n", size.width, size.height);
- pushButton.SetProperty( Toolkit::PushButton::Property::ICON_PADDING, TEST_ICON_PADDING );
+ pushButton.SetProperty(Toolkit::PushButton::Property::ICON_PADDING, TEST_ICON_PADDING);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( size, TEST_IMAGE_SIZE, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+ DALI_TEST_EQUALS(size, TEST_IMAGE_SIZE, Math::MACHINE_EPSILON_1000, TEST_LOCATION);
- size.width = pushButton.GetRelayoutSize( Dimension::WIDTH );
- size.height = pushButton.GetRelayoutSize( Dimension::HEIGHT );
- tet_printf( "Button RelayoutSize after icon padding(%f,%f)\n", size.width, size.height );
- const Vector2 expectedIconAndPaddingSize( TEST_ICON_PADDING.x+TEST_ICON_PADDING.y+TEST_IMAGE_SIZE.width, TEST_ICON_PADDING.w + TEST_ICON_PADDING.z + TEST_IMAGE_SIZE.height );
- DALI_TEST_EQUALS( size, expectedIconAndPaddingSize, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+ size.width = pushButton.GetRelayoutSize(Dimension::WIDTH);
+ size.height = pushButton.GetRelayoutSize(Dimension::HEIGHT);
+ tet_printf("Button RelayoutSize after icon padding(%f,%f)\n", size.width, size.height);
+ const Vector2 expectedIconAndPaddingSize(TEST_ICON_PADDING.x + TEST_ICON_PADDING.y + TEST_IMAGE_SIZE.width, TEST_ICON_PADDING.w + TEST_ICON_PADDING.z + TEST_IMAGE_SIZE.height);
+ DALI_TEST_EQUALS(size, expectedIconAndPaddingSize, Math::MACHINE_EPSILON_1000, TEST_LOCATION);
// Now test padding for both label and icon simultaneously.
- pushButton.SetProperty( Toolkit::Button::Property::LABEL, "Label" );
+ pushButton.SetProperty(Toolkit::Button::Property::LABEL, "Label");
application.SendNotification();
application.Render();
- size.width = pushButton.GetRelayoutSize( Dimension::WIDTH );
- size.height = pushButton.GetRelayoutSize( Dimension::HEIGHT );
- tet_printf( "Button RelayoutSize after label added(%f,%f)\n", size.width, size.height );
+ size.width = pushButton.GetRelayoutSize(Dimension::WIDTH);
+ size.height = pushButton.GetRelayoutSize(Dimension::HEIGHT);
+ tet_printf("Button RelayoutSize after label added(%f,%f)\n", size.width, size.height);
- pushButton.SetProperty( Toolkit::PushButton::Property::LABEL_PADDING, TEST_LABEL_PADDING );
+ pushButton.SetProperty(Toolkit::PushButton::Property::LABEL_PADDING, TEST_LABEL_PADDING);
application.SendNotification();
application.Render();
- size.width = pushButton.GetRelayoutSize( Dimension::WIDTH );
- size.height = pushButton.GetRelayoutSize( Dimension::HEIGHT );
- tet_printf( "Button RelayoutSize after icon and label padding(%f,%f)\n", size.width, size.height );
+ size.width = pushButton.GetRelayoutSize(Dimension::WIDTH);
+ size.height = pushButton.GetRelayoutSize(Dimension::HEIGHT);
+ tet_printf("Button RelayoutSize after icon and label padding(%f,%f)\n", size.width, size.height);
- DALI_TEST_EQUALS( size.width, sizeLabelAndPadding.width + expectedIconAndPaddingSize.width, TEST_LOCATION );
+ DALI_TEST_EQUALS(size.width, sizeLabelAndPadding.width + expectedIconAndPaddingSize.width, TEST_LOCATION);
// Test height of control is same as icon and padding, as Text is smaller than icon
- DALI_TEST_EQUALS( size.height, expectedIconAndPaddingSize.height, TEST_LOCATION );
+ DALI_TEST_EQUALS(size.height, expectedIconAndPaddingSize.height, TEST_LOCATION);
END_TEST;
}
* +---------+ -
*/
- const Vector4 TEST_ICON_PADDING( 70.0f, 70.0f, 70.0f, 70.0f );
- const Vector4 TEST_LABEL_PADDING( 30.0f, 30.0f, 30.0f, 30.0f );
+ const Vector4 TEST_ICON_PADDING(70.0f, 70.0f, 70.0f, 70.0f);
+ const Vector4 TEST_LABEL_PADDING(30.0f, 30.0f, 30.0f, 30.0f);
// Get actual size of test image
- ImageDimensions testImageSize = Dali::GetClosestImageSize( TEST_IMAGE_ONE );
- const Vector2 TEST_IMAGE_SIZE( testImageSize.GetWidth(), testImageSize.GetHeight() );
+ ImageDimensions testImageSize = Dali::GetClosestImageSize(TEST_IMAGE_ONE);
+ const Vector2 TEST_IMAGE_SIZE(testImageSize.GetWidth(), testImageSize.GetHeight());
PushButton pushButton = PushButton::New();
- pushButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- pushButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- pushButton.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
- pushButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+ pushButton.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ pushButton.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ pushButton.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 0.0f));
+ pushButton.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS);
- application.GetScene().Add( pushButton );
+ application.GetScene().Add(pushButton);
// Add a label and get size of control
- pushButton.SetProperty( Toolkit::Button::Property::LABEL, "Label" );
+ pushButton.SetProperty(Toolkit::Button::Property::LABEL, "Label");
application.SendNotification();
application.Render();
// First get the size of control with just label
- Vector2 justLabelSize( Vector2::ZERO );
- justLabelSize.width = pushButton.GetRelayoutSize( Dimension::WIDTH );
- justLabelSize.height = pushButton.GetRelayoutSize( Dimension::HEIGHT );
- tet_printf( "Button RelayoutSize with just label and no padding(%f,%f)\n", justLabelSize.width, justLabelSize.height );
+ Vector2 justLabelSize(Vector2::ZERO);
+ justLabelSize.width = pushButton.GetRelayoutSize(Dimension::WIDTH);
+ justLabelSize.height = pushButton.GetRelayoutSize(Dimension::HEIGHT);
+ tet_printf("Button RelayoutSize with just label and no padding(%f,%f)\n", justLabelSize.width, justLabelSize.height);
- pushButton.SetProperty( Toolkit::PushButton::Property::LABEL_PADDING, TEST_LABEL_PADDING );
+ pushButton.SetProperty(Toolkit::PushButton::Property::LABEL_PADDING, TEST_LABEL_PADDING);
application.SendNotification();
application.Render();
// Size of Label and Padding
- Vector2 expectedLabelAndPaddingSize( Vector2::ZERO );
- expectedLabelAndPaddingSize.width = justLabelSize.width + TEST_LABEL_PADDING.x + TEST_LABEL_PADDING.y;
+ Vector2 expectedLabelAndPaddingSize(Vector2::ZERO);
+ expectedLabelAndPaddingSize.width = justLabelSize.width + TEST_LABEL_PADDING.x + TEST_LABEL_PADDING.y;
expectedLabelAndPaddingSize.height = justLabelSize.height + TEST_LABEL_PADDING.w + TEST_LABEL_PADDING.z;
- Vector2 labelAndPaddingSize( Vector2::ZERO );
- labelAndPaddingSize.width = pushButton.GetRelayoutSize( Dimension::WIDTH );
- labelAndPaddingSize.height = pushButton.GetRelayoutSize( Dimension::HEIGHT );
+ Vector2 labelAndPaddingSize(Vector2::ZERO);
+ labelAndPaddingSize.width = pushButton.GetRelayoutSize(Dimension::WIDTH);
+ labelAndPaddingSize.height = pushButton.GetRelayoutSize(Dimension::HEIGHT);
- DALI_TEST_EQUALS( labelAndPaddingSize, expectedLabelAndPaddingSize , Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+ DALI_TEST_EQUALS(labelAndPaddingSize, expectedLabelAndPaddingSize, Math::MACHINE_EPSILON_1000, TEST_LOCATION);
- const Vector2 testImageWithPaddingSize = Vector2 ( ( TEST_IMAGE_SIZE.width + TEST_ICON_PADDING.x + TEST_ICON_PADDING.y ),
- ( TEST_IMAGE_SIZE.height + TEST_ICON_PADDING.w + TEST_ICON_PADDING.z ) );
+ const Vector2 testImageWithPaddingSize = Vector2((TEST_IMAGE_SIZE.width + TEST_ICON_PADDING.x + TEST_ICON_PADDING.y),
+ (TEST_IMAGE_SIZE.height + TEST_ICON_PADDING.w + TEST_ICON_PADDING.z));
// Add Icon and set its alignment
- pushButton.SetProperty( Toolkit::DevelButton::Property::LABEL_RELATIVE_ALIGNMENT, "BEGIN" );
- pushButton.SetProperty( Toolkit::Button::Property::UNSELECTED_VISUAL, TEST_IMAGE_ONE );
- pushButton.SetProperty( Toolkit::Button::Property::SELECTED_VISUAL, TEST_IMAGE_ONE );
- pushButton.SetProperty( Toolkit::PushButton::Property::ICON_PADDING, TEST_ICON_PADDING );
+ pushButton.SetProperty(Toolkit::DevelButton::Property::LABEL_RELATIVE_ALIGNMENT, "BEGIN");
+ pushButton.SetProperty(Toolkit::Button::Property::UNSELECTED_VISUAL, TEST_IMAGE_ONE);
+ pushButton.SetProperty(Toolkit::Button::Property::SELECTED_VISUAL, TEST_IMAGE_ONE);
+ pushButton.SetProperty(Toolkit::PushButton::Property::ICON_PADDING, TEST_ICON_PADDING);
application.SendNotification();
application.Render();
- Vector2 size( Vector2::ZERO );
- size.width = pushButton.GetRelayoutSize( Dimension::WIDTH );
- size.height = pushButton.GetRelayoutSize( Dimension::HEIGHT );
+ Vector2 size(Vector2::ZERO);
+ size.width = pushButton.GetRelayoutSize(Dimension::WIDTH);
+ size.height = pushButton.GetRelayoutSize(Dimension::HEIGHT);
/*
* Test Icon right alignment.
* |............+ |
* +------------+---------+
*/
- DALI_TEST_EQUALS( size.width, ( testImageWithPaddingSize.width + labelAndPaddingSize.width ) , TEST_LOCATION );
- DALI_TEST_EQUALS( size.height, ( std::max( testImageWithPaddingSize.height, labelAndPaddingSize.height) ) , Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+ DALI_TEST_EQUALS(size.width, (testImageWithPaddingSize.width + labelAndPaddingSize.width), TEST_LOCATION);
+ DALI_TEST_EQUALS(size.height, (std::max(testImageWithPaddingSize.height, labelAndPaddingSize.height)), Math::MACHINE_EPSILON_1000, TEST_LOCATION);
// Now test left alignment matches right for size.
- pushButton.SetProperty( Toolkit::DevelButton::Property::LABEL_RELATIVE_ALIGNMENT, "END" );
+ pushButton.SetProperty(Toolkit::DevelButton::Property::LABEL_RELATIVE_ALIGNMENT, "END");
application.SendNotification();
application.Render();
- size.width = pushButton.GetRelayoutSize( Dimension::WIDTH );
- size.height = pushButton.GetRelayoutSize( Dimension::HEIGHT );
+ size.width = pushButton.GetRelayoutSize(Dimension::WIDTH);
+ size.height = pushButton.GetRelayoutSize(Dimension::HEIGHT);
/*
* Test Icon left alignment.
* | +............|
* +---------+------------+
*/
- DALI_TEST_EQUALS( size.width, ( testImageWithPaddingSize.width + labelAndPaddingSize.width ) , TEST_LOCATION );
- DALI_TEST_EQUALS( size.height, ( std::max( testImageWithPaddingSize.height, labelAndPaddingSize.height) ) , Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+ DALI_TEST_EQUALS(size.width, (testImageWithPaddingSize.width + labelAndPaddingSize.width), TEST_LOCATION);
+ DALI_TEST_EQUALS(size.height, (std::max(testImageWithPaddingSize.height, labelAndPaddingSize.height)), Math::MACHINE_EPSILON_1000, TEST_LOCATION);
tet_infoline(" Test Icon TOP alignment - Width grows to largest of Icon or label (plus padding)");
/*
*/
tet_infoline("SetProperty on LABEL_RELATIVE_ALIGNMENT should relayout the Button");
- pushButton.SetProperty( Toolkit::DevelButton::Property::LABEL_RELATIVE_ALIGNMENT, "BOTTOM" );
+ pushButton.SetProperty(Toolkit::DevelButton::Property::LABEL_RELATIVE_ALIGNMENT, "BOTTOM");
application.SendNotification();
application.Render();
- size.width = pushButton.GetRelayoutSize( Dimension::WIDTH );
- size.height = pushButton.GetRelayoutSize( Dimension::HEIGHT );
+ size.width = pushButton.GetRelayoutSize(Dimension::WIDTH);
+ size.height = pushButton.GetRelayoutSize(Dimension::HEIGHT);
- tet_printf("Natural width (%f)\n",pushButton.GetNaturalSize().width);
- tet_printf("Natural height (%f)\n",pushButton.GetNaturalSize().height);
+ tet_printf("Natural width (%f)\n", pushButton.GetNaturalSize().width);
+ tet_printf("Natural height (%f)\n", pushButton.GetNaturalSize().height);
- tet_printf(" UtcDaliPushButtonAlignmentLayout Top layout - Image and Padding size (%f,%f)\n", testImageWithPaddingSize.width, testImageWithPaddingSize.height );
- tet_printf(" UtcDaliPushButtonAlignmentLayout Top layout - Text and Padding size (%f,%f)\n", labelAndPaddingSize.width, labelAndPaddingSize.height );
+ tet_printf(" UtcDaliPushButtonAlignmentLayout Top layout - Image and Padding size (%f,%f)\n", testImageWithPaddingSize.width, testImageWithPaddingSize.height);
+ tet_printf(" UtcDaliPushButtonAlignmentLayout Top layout - Text and Padding size (%f,%f)\n", labelAndPaddingSize.width, labelAndPaddingSize.height);
- DALI_TEST_EQUALS( size.width, ( std::max( testImageWithPaddingSize.width, labelAndPaddingSize.width ) ) , TEST_LOCATION );
+ DALI_TEST_EQUALS(size.width, (std::max(testImageWithPaddingSize.width, labelAndPaddingSize.width)), TEST_LOCATION);
- DALI_TEST_EQUALS( size.height,( testImageWithPaddingSize.height + labelAndPaddingSize.height ) , TEST_LOCATION );
+ DALI_TEST_EQUALS(size.height, (testImageWithPaddingSize.height + labelAndPaddingSize.height), TEST_LOCATION);
/*
* Test Icon bottom alignment.
* +---------+
*/
tet_infoline(" Test Icon BOTTOM alignment - Width grows to largest of Icon or label (plus padding)");
- pushButton.SetProperty( Toolkit::DevelButton::Property::LABEL_RELATIVE_ALIGNMENT, "TOP" );
+ pushButton.SetProperty(Toolkit::DevelButton::Property::LABEL_RELATIVE_ALIGNMENT, "TOP");
application.SendNotification();
application.Render();
- size.width = pushButton.GetRelayoutSize( Dimension::WIDTH );
- size.height = pushButton.GetRelayoutSize( Dimension::HEIGHT );
+ size.width = pushButton.GetRelayoutSize(Dimension::WIDTH);
+ size.height = pushButton.GetRelayoutSize(Dimension::HEIGHT);
- DALI_TEST_EQUALS( size.width, ( std::max(testImageWithPaddingSize.width, labelAndPaddingSize.width )) , TEST_LOCATION );
- DALI_TEST_EQUALS( size.height,( testImageWithPaddingSize.height + labelAndPaddingSize.height ) , TEST_LOCATION );
+ DALI_TEST_EQUALS(size.width, (std::max(testImageWithPaddingSize.width, labelAndPaddingSize.width)), TEST_LOCATION);
+ DALI_TEST_EQUALS(size.height, (testImageWithPaddingSize.height + labelAndPaddingSize.height), TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
PushButton pushButton = PushButton::New();
- pushButton.SetProperty( Actor::Property::SIZE, Vector2( BUTTON_SIZE_TO_GET_INSIDE_TOUCH_EVENTS ) );
+ pushButton.SetProperty(Actor::Property::SIZE, Vector2(BUTTON_SIZE_TO_GET_INSIDE_TOUCH_EVENTS));
- application.GetScene().Add( pushButton );
+ application.GetScene().Add(pushButton);
Property::Map propertyMap;
- propertyMap.Insert(Visual::Property::TYPE, Visual::COLOR);
+ propertyMap.Insert(Visual::Property::TYPE, Visual::COLOR);
propertyMap.Insert(ColorVisual::Property::MIX_COLOR, Color::BLUE);
- pushButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, propertyMap );
+ pushButton.SetProperty(Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, propertyMap);
tet_infoline(" UNSELECTED_VISUAL Added to button\n");
application.Render(0);
unsigned int rendererCount = pushButton.GetRendererCount();
- tet_printf("After adding UNSELECTED_BACKGROUND_VISUAL the renderer count is(%d)\n", rendererCount );
+ tet_printf("After adding UNSELECTED_BACKGROUND_VISUAL the renderer count is(%d)\n", rendererCount);
- DALI_TEST_EQUALS( pushButton.GetRendererCount(), 1 , TEST_LOCATION );
+ DALI_TEST_EQUALS(pushButton.GetRendererCount(), 1, TEST_LOCATION);
- tet_printf("Remove button from stage\n" );
+ tet_printf("Remove button from stage\n");
- application.GetScene().Remove( pushButton );
+ application.GetScene().Remove(pushButton);
rendererCount = pushButton.GetRendererCount();
- tet_printf("After removing pushbutton from stage the renderer count is(%d)\n ", rendererCount );
+ tet_printf("After removing pushbutton from stage the renderer count is(%d)\n ", rendererCount);
- DALI_TEST_EQUALS( pushButton.GetRendererCount(), 0, TEST_LOCATION );
+ DALI_TEST_EQUALS(pushButton.GetRendererCount(), 0, TEST_LOCATION);
- tet_printf("After removing pushbutton from stage the renderer count is(%d)\n ", rendererCount );
+ tet_printf("After removing pushbutton from stage the renderer count is(%d)\n ", rendererCount);
Property::Map propertyMap2;
- propertyMap2.Insert(Visual::Property::TYPE, Visual::COLOR);
+ propertyMap2.Insert(Visual::Property::TYPE, Visual::COLOR);
propertyMap2.Insert(ColorVisual::Property::MIX_COLOR, Color::RED);
- pushButton.SetProperty( Toolkit::Button::Property::UNSELECTED_VISUAL, propertyMap2 );
+ pushButton.SetProperty(Toolkit::Button::Property::UNSELECTED_VISUAL, propertyMap2);
tet_printf("Added UNSELECTED_VISUAL and add button back to Stage\n");
- application.GetScene().Add( pushButton );
+ application.GetScene().Add(pushButton);
- tet_printf("With UNSELECTED_BACKGROUND_VISUAL and UNSELECTED_VISUAL the renderer count is(%d)\n", pushButton.GetRendererCount() );
+ tet_printf("With UNSELECTED_BACKGROUND_VISUAL and UNSELECTED_VISUAL the renderer count is(%d)\n", pushButton.GetRendererCount());
- DALI_TEST_EQUALS( pushButton.GetRendererCount(), 2, TEST_LOCATION );
+ DALI_TEST_EQUALS(pushButton.GetRendererCount(), 2, TEST_LOCATION);
END_TEST;
}
PushButton pushButton = PushButton::New();
- pushButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- pushButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- pushButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+ pushButton.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ pushButton.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ pushButton.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS);
- application.GetScene().Add( pushButton );
+ application.GetScene().Add(pushButton);
application.SendNotification();
application.Render(0);
unsigned int preRendererCount = pushButton.GetRendererCount();
- tet_printf("RendererCount prior to adding visual(%d)\n",preRendererCount);
- DALI_TEST_EQUALS( preRendererCount, 0, TEST_LOCATION );
+ tet_printf("RendererCount prior to adding visual(%d)\n", preRendererCount);
+ DALI_TEST_EQUALS(preRendererCount, 0, TEST_LOCATION);
- application.GetScene().Remove( pushButton );
+ application.GetScene().Remove(pushButton);
application.SendNotification();
application.Render(0);
Property::Map colorMap;
- const int BROKEN_VISUAL_TYPE = 999999999;
+ const int BROKEN_VISUAL_TYPE = 999999999;
- colorMap.Insert(Visual::Property::TYPE, BROKEN_VISUAL_TYPE);
- colorMap.Insert(BorderVisual::Property::COLOR, Color::BLUE);
- colorMap.Insert(BorderVisual::Property::SIZE, 5.f);
- pushButton.SetProperty( Toolkit::Button::Property::UNSELECTED_VISUAL, colorMap );
+ colorMap.Insert(Visual::Property::TYPE, BROKEN_VISUAL_TYPE);
+ colorMap.Insert(BorderVisual::Property::COLOR, Color::BLUE);
+ colorMap.Insert(BorderVisual::Property::SIZE, 5.f);
+ pushButton.SetProperty(Toolkit::Button::Property::UNSELECTED_VISUAL, colorMap);
- application.GetScene().Add( pushButton );
+ application.GetScene().Add(pushButton);
application.SendNotification();
application.Render(0);
- unsigned int postRendererCount = pushButton.GetRendererCount();
+ unsigned int postRendererCount = pushButton.GetRendererCount();
tet_printf("RendererCount post broken visual (%d)\n", postRendererCount);
- DALI_TEST_EQUALS( postRendererCount, 0, TEST_LOCATION );
+ DALI_TEST_EQUALS(postRendererCount, 0, TEST_LOCATION);
END_TEST;
}
tet_infoline(" UtcDaliButtonToggleSignalP Ensure Signals emitted");
PushButton button = PushButton::New();
- button.SetProperty( Button::Property::TOGGLABLE, true);
+ button.SetProperty(Button::Property::TOGGLABLE, true);
- SetupButtonForTestTouchEvents( application, button, true );
+ SetupButtonForTestTouchEvents(application, button, true);
- application.GetScene().Add( button );
+ application.GetScene().Add(button);
application.SendNotification();
application.Render();
// connect to its signal
- button.ClickedSignal().Connect( &PushButtonClicked );
+ button.ClickedSignal().Connect(&PushButtonClicked);
gPushButtonClicked = false;
tet_infoline(" Touch down and up within button");
Dali::Integration::TouchEvent event;
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointDownInside() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointDownInside());
+ application.ProcessEvent(event);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointUpInside() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointUpInside());
+ application.ProcessEvent(event);
- DALI_TEST_EQUALS( gPushButtonClicked, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gPushButtonClicked, true, TEST_LOCATION);
END_TEST;
}
PushButton pushButton = PushButton::New();
- pushButton.SetProperty( Button::Property::AUTO_REPEATING, true );
+ pushButton.SetProperty(Button::Property::AUTO_REPEATING, true);
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::AUTO_REPEATING ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(Button::Property::AUTO_REPEATING), true, TEST_LOCATION);
- pushButton.SetProperty( Button::Property::AUTO_REPEATING, false );
+ pushButton.SetProperty(Button::Property::AUTO_REPEATING, false);
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::AUTO_REPEATING ), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(Button::Property::AUTO_REPEATING), false, TEST_LOCATION);
- pushButton.SetProperty( Button::Property::AUTO_REPEATING, true );
+ pushButton.SetProperty(Button::Property::AUTO_REPEATING, true);
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::AUTO_REPEATING ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(Button::Property::AUTO_REPEATING), true, TEST_LOCATION);
END_TEST;
}
PushButton pushButton = PushButton::New();
- pushButton.SetProperty( Button::Property::TOGGLABLE, true );
+ pushButton.SetProperty(Button::Property::TOGGLABLE, true);
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::TOGGLABLE ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(Button::Property::TOGGLABLE), true, TEST_LOCATION);
- pushButton.SetProperty( Button::Property::TOGGLABLE, false );
+ pushButton.SetProperty(Button::Property::TOGGLABLE, false);
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::TOGGLABLE ), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(Button::Property::TOGGLABLE), false, TEST_LOCATION);
- pushButton.SetProperty( Button::Property::TOGGLABLE, true );
+ pushButton.SetProperty(Button::Property::TOGGLABLE, true);
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::TOGGLABLE ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(Button::Property::TOGGLABLE), true, TEST_LOCATION);
END_TEST;
}
PushButton pushButton = PushButton::New();
- pushButton.SetProperty( Button::Property::AUTO_REPEATING, true );
- pushButton.SetProperty( Button::Property::TOGGLABLE, true);
+ pushButton.SetProperty(Button::Property::AUTO_REPEATING, true);
+ pushButton.SetProperty(Button::Property::TOGGLABLE, true);
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::TOGGLABLE ), true, TEST_LOCATION );
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::AUTO_REPEATING ), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(Button::Property::TOGGLABLE), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(Button::Property::AUTO_REPEATING), false, TEST_LOCATION);
- pushButton.SetProperty( Button::Property::TOGGLABLE, true);
- pushButton.SetProperty( Button::Property::AUTO_REPEATING, true );
+ pushButton.SetProperty(Button::Property::TOGGLABLE, true);
+ pushButton.SetProperty(Button::Property::AUTO_REPEATING, true);
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::AUTO_REPEATING ), true, TEST_LOCATION );
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::TOGGLABLE ), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(Button::Property::AUTO_REPEATING), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(Button::Property::TOGGLABLE), false, TEST_LOCATION);
END_TEST;
}
PushButton pushButton = PushButton::New();
- pushButton.SetProperty( Button::Property::TOGGLABLE, true);
- pushButton.StateChangedSignal().Connect( &PushButtonSelected );
+ pushButton.SetProperty(Button::Property::TOGGLABLE, true);
+ pushButton.StateChangedSignal().Connect(&PushButtonSelected);
gPushButtonSelectedState = false;
- pushButton.SetProperty( Button::Property::SELECTED, true );
+ pushButton.SetProperty(Button::Property::SELECTED, true);
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::SELECTED), true, TEST_LOCATION );
- DALI_TEST_CHECK( gPushButtonSelectedState );
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(Button::Property::SELECTED), true, TEST_LOCATION);
+ DALI_TEST_CHECK(gPushButtonSelectedState);
- pushButton.SetProperty( Button::Property::SELECTED, false );
+ pushButton.SetProperty(Button::Property::SELECTED, false);
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::SELECTED), false, TEST_LOCATION );
- DALI_TEST_CHECK( !gPushButtonSelectedState );
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(Button::Property::SELECTED), false, TEST_LOCATION);
+ DALI_TEST_CHECK(!gPushButtonSelectedState);
- pushButton.SetProperty( Button::Property::SELECTED, true );
+ pushButton.SetProperty(Button::Property::SELECTED, true);
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::SELECTED), true, TEST_LOCATION );
- DALI_TEST_CHECK( gPushButtonSelectedState );
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(Button::Property::SELECTED), true, TEST_LOCATION);
+ DALI_TEST_CHECK(gPushButtonSelectedState);
END_TEST;
}
PushButton pushButton = PushButton::New();
tet_infoline(" Set Toggle feature off");
- pushButton.SetProperty( Button::Property::TOGGLABLE, false);
- pushButton.StateChangedSignal().Connect( &PushButtonSelected );
+ pushButton.SetProperty(Button::Property::TOGGLABLE, false);
+ pushButton.StateChangedSignal().Connect(&PushButtonSelected);
gPushButtonSelectedState = false;
tet_infoline(" Try to set to selected, expecting failure as not a toggle button");
- pushButton.SetProperty( Button::Property::SELECTED, true );
+ pushButton.SetProperty(Button::Property::SELECTED, true);
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::SELECTED), false, TEST_LOCATION );
- DALI_TEST_CHECK( !gPushButtonSelectedState );
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(Button::Property::SELECTED), false, TEST_LOCATION);
+ DALI_TEST_CHECK(!gPushButtonSelectedState);
- pushButton.SetProperty( Button::Property::SELECTED, false );
+ pushButton.SetProperty(Button::Property::SELECTED, false);
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::SELECTED), false, TEST_LOCATION );
- DALI_TEST_CHECK( !gPushButtonSelectedState );
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(Button::Property::SELECTED), false, TEST_LOCATION);
+ DALI_TEST_CHECK(!gPushButtonSelectedState);
- pushButton.SetProperty( Button::Property::SELECTED, true );
+ pushButton.SetProperty(Button::Property::SELECTED, true);
- DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::SELECTED ), false, TEST_LOCATION );
- DALI_TEST_CHECK( !gPushButtonSelectedState );
+ DALI_TEST_EQUALS(pushButton.GetProperty<bool>(Button::Property::SELECTED), false, TEST_LOCATION);
+ DALI_TEST_CHECK(!gPushButtonSelectedState);
END_TEST;
}
PushButton pushButton = PushButton::New();
- pushButton.SetProperty( Button::Property::AUTO_REPEATING, true );
+ pushButton.SetProperty(Button::Property::AUTO_REPEATING, true);
- pushButton.SetProperty( Button::Property::INITIAL_AUTO_REPEATING_DELAY, 1.f);
- DALI_TEST_EQUALS( pushButton.GetProperty<float>( Button::Property::INITIAL_AUTO_REPEATING_DELAY ), 1.f, TEST_LOCATION );
+ pushButton.SetProperty(Button::Property::INITIAL_AUTO_REPEATING_DELAY, 1.f);
+ DALI_TEST_EQUALS(pushButton.GetProperty<float>(Button::Property::INITIAL_AUTO_REPEATING_DELAY), 1.f, TEST_LOCATION);
- pushButton.SetProperty( Button::Property::NEXT_AUTO_REPEATING_DELAY, 1.f);
+ pushButton.SetProperty(Button::Property::NEXT_AUTO_REPEATING_DELAY, 1.f);
- DALI_TEST_EQUALS( pushButton.GetProperty<float>( Button::Property::NEXT_AUTO_REPEATING_DELAY ), 1.f, TEST_LOCATION );
+ DALI_TEST_EQUALS(pushButton.GetProperty<float>(Button::Property::NEXT_AUTO_REPEATING_DELAY), 1.f, TEST_LOCATION);
END_TEST;
}
PushButton pushButton = PushButton::New();
- bool assert1( false );
- bool assert2( false );
+ bool assert1(false);
+ bool assert2(false);
- pushButton.SetProperty( Button::Property::AUTO_REPEATING, true );
+ pushButton.SetProperty(Button::Property::AUTO_REPEATING, true);
try
{
- pushButton.SetProperty( Button::Property::INITIAL_AUTO_REPEATING_DELAY, -1.f );
+ pushButton.SetProperty(Button::Property::INITIAL_AUTO_REPEATING_DELAY, -1.f);
}
- catch( Dali::DaliException& e )
+ catch(Dali::DaliException& e)
{
- DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_PRINT_ASSERT(e);
DALI_TEST_EQUALS(e.condition, "initialAutoRepeatingDelay > 0.f", TEST_LOCATION);
assert1 = true;
}
try
{
- pushButton.SetProperty( Button::Property::NEXT_AUTO_REPEATING_DELAY, -1.f );
+ pushButton.SetProperty(Button::Property::NEXT_AUTO_REPEATING_DELAY, -1.f);
}
- catch( Dali::DaliException& e )
+ catch(Dali::DaliException& e)
{
- DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_PRINT_ASSERT(e);
DALI_TEST_EQUALS(e.condition, "nextAutoRepeatingDelay > 0.f", TEST_LOCATION);
assert2 = true;
}
- DALI_TEST_CHECK( assert1 && assert2 );
+ DALI_TEST_CHECK(assert1 && assert2);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliPushButtonSetLabelText");
- const std::string STR( "Hola!" );
+ const std::string STR("Hola!");
PushButton pushButton = PushButton::New();
- pushButton.SetProperty( Toolkit::Button::Property::LABEL,
- Property::Map().Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT )
- .Add( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f )
- );
+ pushButton.SetProperty(Toolkit::Button::Property::LABEL,
+ Property::Map().Add(Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT).Add(Toolkit::TextVisual::Property::POINT_SIZE, 15.0f));
application.SendNotification();
application.Render();
- pushButton.SetProperty( Button::Property::LABEL, STR );
+ pushButton.SetProperty(Button::Property::LABEL, STR);
- DALI_TEST_EQUALS(GetButtonText( pushButton ), STR, TEST_LOCATION);
+ DALI_TEST_EQUALS(GetButtonText(pushButton), STR, TEST_LOCATION);
END_TEST;
}
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
-#include <stdlib.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali/integration-api/events/touch-event-integ.h>
-
+#include <stdlib.h>
+#include <iostream>
using namespace Dali;
using namespace Dali::Toolkit;
namespace
{
-
static bool gObjectCreatedCallBackCalled;
static void TestCallback(BaseHandle handle)
gObjectCreatedCallBackCalled = true;
}
-static std::string GetButtonText( Button button )
+static std::string GetButtonText(Button button)
{
- Property::Value value = button.GetProperty( Toolkit::Button::Property::LABEL );
+ Property::Value value = button.GetProperty(Toolkit::Button::Property::LABEL);
- Property::Map *labelProperty = value.GetMap();
+ Property::Map* labelProperty = value.GetMap();
std::string textLabel;
- if ( labelProperty )
+ if(labelProperty)
{
- Property::Value* value = labelProperty->Find( Toolkit::TextVisual::Property::TEXT );
- value->Get( textLabel );
+ Property::Value* value = labelProperty->Find(Toolkit::TextVisual::Property::TEXT);
+ value->Get(textLabel);
}
return textLabel;
}
-}
+} // namespace
int UtcDaliRadioButtonConstructorP(void)
{
RadioButton button;
- DALI_TEST_CHECK( !button );
+ DALI_TEST_CHECK(!button);
END_TEST;
}
// Initialize an object, ref count == 1
RadioButton button = RadioButton::New();
- RadioButton copy( button );
- DALI_TEST_CHECK( copy );
+ RadioButton copy(button);
+ DALI_TEST_CHECK(copy);
END_TEST;
}
ToolkitTestApplication application;
RadioButton button = RadioButton::New();
- DALI_TEST_EQUALS( 1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), true , TEST_LOCATION );
- button.SetProperty( Button::Property::TOGGLABLE, false );
- DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), false , TEST_LOCATION );
+ DALI_TEST_EQUALS(1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_EQUALS(button.GetProperty<bool>(Button::Property::TOGGLABLE), true, TEST_LOCATION);
+ button.SetProperty(Button::Property::TOGGLABLE, false);
+ DALI_TEST_EQUALS(button.GetProperty<bool>(Button::Property::TOGGLABLE), false, TEST_LOCATION);
- RadioButton moved = std::move( button );
- DALI_TEST_CHECK( moved );
- DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_EQUALS( moved.GetProperty<bool>( Button::Property::TOGGLABLE ), false , TEST_LOCATION );
- DALI_TEST_CHECK( !button );
+ RadioButton moved = std::move(button);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_EQUALS(moved.GetProperty<bool>(Button::Property::TOGGLABLE), false, TEST_LOCATION);
+ DALI_TEST_CHECK(!button);
END_TEST;
}
RadioButton button = RadioButton::New();
- RadioButton copy( button );
- DALI_TEST_CHECK( copy );
+ RadioButton copy(button);
+ DALI_TEST_CHECK(copy);
- DALI_TEST_CHECK( button == copy );
+ DALI_TEST_CHECK(button == copy);
END_TEST;
}
ToolkitTestApplication application;
RadioButton button = RadioButton::New();
- DALI_TEST_EQUALS( 1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), true , TEST_LOCATION );
- button.SetProperty( Button::Property::TOGGLABLE, false );
- DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::TOGGLABLE ), false , TEST_LOCATION );
+ DALI_TEST_EQUALS(1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_EQUALS(button.GetProperty<bool>(Button::Property::TOGGLABLE), true, TEST_LOCATION);
+ button.SetProperty(Button::Property::TOGGLABLE, false);
+ DALI_TEST_EQUALS(button.GetProperty<bool>(Button::Property::TOGGLABLE), false, TEST_LOCATION);
RadioButton moved;
- moved = std::move( button );
- DALI_TEST_CHECK( moved );
- DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_EQUALS( moved.GetProperty<bool>( Button::Property::TOGGLABLE ), false , TEST_LOCATION );
- DALI_TEST_CHECK( !button );
+ moved = std::move(button);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_EQUALS(moved.GetProperty<bool>(Button::Property::TOGGLABLE), false, TEST_LOCATION);
+ DALI_TEST_CHECK(!button);
END_TEST;
}
// Create the Slider actor
RadioButton radioButton;
- DALI_TEST_CHECK( !radioButton );
+ DALI_TEST_CHECK(!radioButton);
radioButton = RadioButton::New();
- DALI_TEST_CHECK( radioButton );
+ DALI_TEST_CHECK(radioButton);
RadioButton radioButton2(radioButton);
- DALI_TEST_CHECK( radioButton2 == radioButton );
+ DALI_TEST_CHECK(radioButton2 == radioButton);
//Additional check to ensure object is created by checking if it's registered
ObjectRegistry registry = application.GetCore().GetObjectRegistry();
- DALI_TEST_CHECK( registry );
+ DALI_TEST_CHECK(registry);
gObjectCreatedCallBackCalled = false;
- registry.ObjectCreatedSignal().Connect( &TestCallback );
+ registry.ObjectCreatedSignal().Connect(&TestCallback);
{
RadioButton radioButton = RadioButton::New();
}
- DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
+ DALI_TEST_CHECK(gObjectCreatedCallBackCalled);
END_TEST;
}
RadioButton* radioButton = new RadioButton();
delete radioButton;
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
END_TEST;
}
Handle handle = RadioButton::New();
- RadioButton radioButton = RadioButton::DownCast( handle );
+ RadioButton radioButton = RadioButton::DownCast(handle);
- DALI_TEST_CHECK( radioButton == handle );
+ DALI_TEST_CHECK(radioButton == handle);
END_TEST;
}
RadioButton radioButton = RadioButton::New();
- radioButton.SetProperty( Toolkit::Button::Property::LABEL,
- Property::Map().Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT )
- .Add( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f )
- );
-
- radioButton.SetProperty( Toolkit::Button::Property::LABEL, labelText );
- DALI_TEST_EQUALS( GetButtonText( radioButton ), labelText, TEST_LOCATION );
+ radioButton.SetProperty(Toolkit::Button::Property::LABEL,
+ Property::Map().Add(Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT).Add(Toolkit::TextVisual::Property::POINT_SIZE, 15.0f));
+ radioButton.SetProperty(Toolkit::Button::Property::LABEL, labelText);
+ DALI_TEST_EQUALS(GetButtonText(radioButton), labelText, TEST_LOCATION);
std::string labelText2 = "test actor 2";
- radioButton.SetProperty( Toolkit::Button::Property::LABEL, labelText2 );
+ radioButton.SetProperty(Toolkit::Button::Property::LABEL, labelText2);
- DALI_TEST_EQUALS( GetButtonText( radioButton ), labelText2, TEST_LOCATION );
+ DALI_TEST_EQUALS(GetButtonText(radioButton), labelText2, TEST_LOCATION);
END_TEST;
}
int UtcDaliRadioButtonSelectedProperty(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
tet_infoline(" UtcDaliRadioButtonSelectedProperty");
// Create the RadioButton actor
RadioButton radioButton = RadioButton::New();
- application.GetScene().Add( radioButton );
- radioButton.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- radioButton.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
- radioButton.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
+ application.GetScene().Add(radioButton);
+ radioButton.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ radioButton.SetProperty(Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_LEFT);
+ radioButton.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 0.0f));
// Default selected
- DALI_TEST_CHECK( radioButton.GetProperty<bool>( Button::Property::SELECTED ) == false );
+ DALI_TEST_CHECK(radioButton.GetProperty<bool>(Button::Property::SELECTED) == false);
// Setting false selected
- radioButton.SetProperty( Button::Property::SELECTED, false );
- DALI_TEST_CHECK( radioButton.GetProperty<bool>( Button::Property::SELECTED ) == false );
+ radioButton.SetProperty(Button::Property::SELECTED, false);
+ DALI_TEST_CHECK(radioButton.GetProperty<bool>(Button::Property::SELECTED) == false);
// Setting true selected
- radioButton.SetProperty( Button::Property::SELECTED, true );
- DALI_TEST_CHECK( radioButton.GetProperty<bool>( Button::Property::SELECTED ) == true );
+ radioButton.SetProperty(Button::Property::SELECTED, true);
+ DALI_TEST_CHECK(radioButton.GetProperty<bool>(Button::Property::SELECTED) == true);
// Setting false again
- radioButton.SetProperty( Button::Property::SELECTED, false );
- DALI_TEST_CHECK( radioButton.GetProperty<bool>( Button::Property::SELECTED ) == false );
+ radioButton.SetProperty(Button::Property::SELECTED, false);
+ DALI_TEST_CHECK(radioButton.GetProperty<bool>(Button::Property::SELECTED) == false);
// Test selecting radio buttons
- RadioButton radioButton2 = RadioButton::New( "label" );
- radioButton2.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- radioButton2.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
- radioButton2.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
+ RadioButton radioButton2 = RadioButton::New("label");
+ radioButton2.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ radioButton2.SetProperty(Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_LEFT);
+ radioButton2.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 0.0f));
- RadioButton radioButton3 = RadioButton::New( "label" );
- radioButton3.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- radioButton3.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
- radioButton3.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 40.0f ));
+ RadioButton radioButton3 = RadioButton::New("label");
+ radioButton3.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ radioButton3.SetProperty(Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_LEFT);
+ radioButton3.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 40.0f));
Actor radioGroup = Actor::New();
- application.GetScene().Add( radioGroup );
- radioGroup.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- radioGroup.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
- radioGroup.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
- radioGroup.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0 ) );
+ application.GetScene().Add(radioGroup);
+ radioGroup.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ radioGroup.SetProperty(Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_LEFT);
+ radioGroup.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 0.0f));
+ radioGroup.SetProperty(Actor::Property::SIZE, Vector2(400.0f, 400.0));
- radioGroup.Add( radioButton2 );
- radioGroup.Add( radioButton3 );
+ radioGroup.Add(radioButton2);
+ radioGroup.Add(radioButton3);
application.SendNotification();
application.Render();
// Simulate touch events
- DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::Property::SELECTED ) == false );
- DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::Property::SELECTED ) == false );
+ DALI_TEST_CHECK(radioButton2.GetProperty<bool>(Button::Property::SELECTED) == false);
+ DALI_TEST_CHECK(radioButton3.GetProperty<bool>(Button::Property::SELECTED) == false);
// Select first radio
{
Dali::Integration::TouchEvent event2 = Dali::Integration::TouchEvent();
Dali::Integration::Point pointDown;
- pointDown.SetState( PointState::DOWN );
- pointDown.SetScreenPosition( Vector2( 1.0f, 1.0f ) );
+ pointDown.SetState(PointState::DOWN);
+ pointDown.SetScreenPosition(Vector2(1.0f, 1.0f));
- Dali::Integration::Point pointUp( pointDown );
- pointUp.SetState( PointState::UP );
+ Dali::Integration::Point pointUp(pointDown);
+ pointUp.SetState(PointState::UP);
- event1.AddPoint( pointDown );
- application.ProcessEvent( event1 );
+ event1.AddPoint(pointDown);
+ application.ProcessEvent(event1);
- event2.AddPoint( pointUp );
- application.ProcessEvent( event2 );
+ event2.AddPoint(pointUp);
+ application.ProcessEvent(event2);
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::Property::SELECTED ) == true );
- DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::Property::SELECTED ) == false );
+ DALI_TEST_CHECK(radioButton2.GetProperty<bool>(Button::Property::SELECTED) == true);
+ DALI_TEST_CHECK(radioButton3.GetProperty<bool>(Button::Property::SELECTED) == false);
}
// Select an already selected radio
Dali::Integration::TouchEvent event2 = Dali::Integration::TouchEvent();
Dali::Integration::Point pointDown;
- pointDown.SetState( PointState::DOWN );
- pointDown.SetScreenPosition( Vector2( 1.0f, 1.0f ) );
+ pointDown.SetState(PointState::DOWN);
+ pointDown.SetScreenPosition(Vector2(1.0f, 1.0f));
- Dali::Integration::Point pointUp( pointDown );
- pointUp.SetState( PointState::UP );
+ Dali::Integration::Point pointUp(pointDown);
+ pointUp.SetState(PointState::UP);
- event1.AddPoint( pointDown );
- application.ProcessEvent( event1 );
+ event1.AddPoint(pointDown);
+ application.ProcessEvent(event1);
- event2.AddPoint( pointUp );
- application.ProcessEvent( event2 );
+ event2.AddPoint(pointUp);
+ application.ProcessEvent(event2);
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::Property::SELECTED ) == true );
- DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::Property::SELECTED ) == false );
+ DALI_TEST_CHECK(radioButton2.GetProperty<bool>(Button::Property::SELECTED) == true);
+ DALI_TEST_CHECK(radioButton3.GetProperty<bool>(Button::Property::SELECTED) == false);
}
// Select second radio
Dali::Integration::TouchEvent event2 = Dali::Integration::TouchEvent();
Dali::Integration::Point pointDown;
- pointDown.SetState( PointState::DOWN );
- pointDown.SetScreenPosition( Vector2( 1.0f, 41.0f ) );
+ pointDown.SetState(PointState::DOWN);
+ pointDown.SetScreenPosition(Vector2(1.0f, 41.0f));
- Dali::Integration::Point pointUp( pointDown );
- pointUp.SetState( PointState::UP );
+ Dali::Integration::Point pointUp(pointDown);
+ pointUp.SetState(PointState::UP);
- event1.AddPoint( pointDown );
- application.ProcessEvent( event1 );
+ event1.AddPoint(pointDown);
+ application.ProcessEvent(event1);
- event2.AddPoint( pointUp );
- application.ProcessEvent( event2 );
+ event2.AddPoint(pointUp);
+ application.ProcessEvent(event2);
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::Property::SELECTED ) == false );
- DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::Property::SELECTED ) == true );
+ DALI_TEST_CHECK(radioButton2.GetProperty<bool>(Button::Property::SELECTED) == false);
+ DALI_TEST_CHECK(radioButton3.GetProperty<bool>(Button::Property::SELECTED) == true);
}
// Select outside radio group
Dali::Integration::TouchEvent event2 = Dali::Integration::TouchEvent();
Dali::Integration::Point pointDown;
- pointDown.SetState( PointState::DOWN );
- pointDown.SetScreenPosition( Vector2( 1.0f, 500.0f ) );
+ pointDown.SetState(PointState::DOWN);
+ pointDown.SetScreenPosition(Vector2(1.0f, 500.0f));
- Dali::Integration::Point pointUp( pointDown );
- pointUp.SetState( PointState::UP );
+ Dali::Integration::Point pointUp(pointDown);
+ pointUp.SetState(PointState::UP);
- event1.AddPoint( pointDown );
- application.ProcessEvent( event1 );
+ event1.AddPoint(pointDown);
+ application.ProcessEvent(event1);
- event2.AddPoint( pointUp );
- application.ProcessEvent( event2 );
+ event2.AddPoint(pointUp);
+ application.ProcessEvent(event2);
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::Property::SELECTED ) == false );
- DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::Property::SELECTED ) == true );
+ DALI_TEST_CHECK(radioButton2.GetProperty<bool>(Button::Property::SELECTED) == false);
+ DALI_TEST_CHECK(radioButton3.GetProperty<bool>(Button::Property::SELECTED) == true);
}
END_TEST;
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
-#include <stdlib.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
-#include <dali/devel-api/actors/actor-devel.h>
#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
-#include <dali-toolkit/public-api/transition/transition-set.h>
-#include <dali-toolkit/public-api/transition/transition-base.h>
#include <dali-toolkit/public-api/transition/scale-transition.h>
+#include <dali-toolkit/public-api/transition/transition-base.h>
+#include <dali-toolkit/public-api/transition/transition-set.h>
+#include <dali/devel-api/actors/actor-devel.h>
+#include <stdlib.h>
+#include <iostream>
using namespace Dali;
using namespace Dali::Toolkit;
DALI_TEST_EQUALS(0.5f, scaleFactor.x, TEST_LOCATION);
DALI_TEST_EQUALS(0.5f, scaleFactor.y, TEST_LOCATION);
-
scale.SetScaleFactor(Vector2(1.5f, 1.2f));
scaleFactor = scale.GetScaleFactor();
DALI_TEST_EQUALS(1.5f, scaleFactor.x, TEST_LOCATION);
transitionSet.AddTransition(scale);
transitionSet.Play();
- bool signalReceived(false);
+ bool signalReceived(false);
TransitionFinishCheck finishCheck(signalReceived);
transitionSet.FinishedSignal().Connect(&application, finishCheck);
transitionSet.AddTransition(scale);
transitionSet.Play();
- bool signalReceived(false);
+ bool signalReceived(false);
TransitionFinishCheck finishCheck(signalReceived);
transitionSet.FinishedSignal().Connect(&application, finishCheck);
transitionSet.AddTransition(scale);
transitionSet.Play();
- bool signalReceived(false);
+ bool signalReceived(false);
TransitionFinishCheck finishCheck(signalReceived);
transitionSet.FinishedSignal().Connect(&application, finishCheck);
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
-#include <stdlib.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/controls/scene3d-view/scene3d-view.h>
+#include <stdlib.h>
+#include <iostream>
using namespace Dali;
using namespace Dali::Toolkit;
namespace
{
-
/**
* For the AnimatedCube.gltf and its Assets
* Donated by Norbert Nopper for glTF testing.
* These textures are based off version of Wave engine sample
* Take from https://github.com/WaveEngine/Samples
*
- * Copyright (c) 2016 Wave Coorporation
+ * Copyright (c) 2022 Wave Coorporation
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-const char* TEST_DIFFUSE_TEXTURE = TEST_RESOURCE_DIR "/forest_diffuse_cubemap.png";
+const char* TEST_DIFFUSE_TEXTURE = TEST_RESOURCE_DIR "/forest_diffuse_cubemap.png";
const char* TEST_SPECULAR_TEXTURE = TEST_RESOURCE_DIR "/forest_specular_cubemap.png";
-}
+} // namespace
int UtcDaliScene3dViewConstructorP(void)
{
Scene3dView scene3dView;
- DALI_TEST_CHECK( !scene3dView );
+ DALI_TEST_CHECK(!scene3dView);
END_TEST;
}
ToolkitTestApplication application;
// Initialize an object, ref count == 1
- Scene3dView scene3dView = Scene3dView::New( TEST_GLTF_FILE_NAME[0] );
+ Scene3dView scene3dView = Scene3dView::New(TEST_GLTF_FILE_NAME[0]);
- Scene3dView copy( scene3dView );
- DALI_TEST_CHECK( copy );
+ Scene3dView copy(scene3dView);
+ DALI_TEST_CHECK(copy);
END_TEST;
}
ToolkitTestApplication application;
// Initialize an object, ref count == 1
- Toolkit::Scene3dView scene3dView = Toolkit::Scene3dView::New( TEST_GLTF_FILE_NAME[0], TEST_DIFFUSE_TEXTURE, TEST_SPECULAR_TEXTURE, Vector4::ONE );
+ Toolkit::Scene3dView scene3dView = Toolkit::Scene3dView::New(TEST_GLTF_FILE_NAME[0], TEST_DIFFUSE_TEXTURE, TEST_SPECULAR_TEXTURE, Vector4::ONE);
- Scene3dView copy( scene3dView );
- DALI_TEST_CHECK( copy );
+ Scene3dView copy(scene3dView);
+ DALI_TEST_CHECK(copy);
END_TEST;
}
{
ToolkitTestApplication application;
- Scene3dView scene3dView = Scene3dView::New( TEST_GLTF_FILE_NAME[0] );
+ Scene3dView scene3dView = Scene3dView::New(TEST_GLTF_FILE_NAME[0]);
- Scene3dView copy( scene3dView );
- DALI_TEST_CHECK( copy );
+ Scene3dView copy(scene3dView);
+ DALI_TEST_CHECK(copy);
- DALI_TEST_CHECK( scene3dView == copy );
+ DALI_TEST_CHECK(scene3dView == copy);
END_TEST;
}
// Create the Slider actor
Scene3dView scene3dView;
- DALI_TEST_CHECK( !scene3dView );
+ DALI_TEST_CHECK(!scene3dView);
- scene3dView = Scene3dView::New( TEST_GLTF_FILE_NAME[0] );
- DALI_TEST_CHECK( scene3dView );
+ scene3dView = Scene3dView::New(TEST_GLTF_FILE_NAME[0]);
+ DALI_TEST_CHECK(scene3dView);
END_TEST;
}
Scene3dView* scene3dView = new Scene3dView();
delete scene3dView;
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliScene3dViewDownCast");
- Toolkit::Scene3dView view = Toolkit::Scene3dView::New( TEST_GLTF_FILE_NAME[0] );
- BaseHandle handle(view);
+ Toolkit::Scene3dView view = Toolkit::Scene3dView::New(TEST_GLTF_FILE_NAME[0]);
+ BaseHandle handle(view);
- Toolkit::Scene3dView scene3dView = Toolkit::Scene3dView::DownCast( handle );
- DALI_TEST_CHECK( view );
- DALI_TEST_CHECK( scene3dView );
- DALI_TEST_CHECK( scene3dView == view );
+ Toolkit::Scene3dView scene3dView = Toolkit::Scene3dView::DownCast(handle);
+ DALI_TEST_CHECK(view);
+ DALI_TEST_CHECK(scene3dView);
+ DALI_TEST_CHECK(scene3dView == view);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliScene3dViewSetLight");
- Toolkit::Scene3dView view = Toolkit::Scene3dView::New( TEST_GLTF_FILE_NAME[0] );
+ Toolkit::Scene3dView view = Toolkit::Scene3dView::New(TEST_GLTF_FILE_NAME[0]);
- bool lightSet = view.SetLight( Scene3dView::LightType::DIRECTIONAL_LIGHT, Vector3( 1.0, 1.0, -1.0 ), Vector3( 0.3, 0.3, 0.3 ) );
- DALI_TEST_CHECK( lightSet );
- bool lightSet2 = view.SetLight( Scene3dView::LightType::POINT_LIGHT, Vector3( 1.0, 1.0, -1.0 ), Vector3( 0.3, 0.3, 0.3 ) );
- DALI_TEST_CHECK( lightSet2 );
+ bool lightSet = view.SetLight(Scene3dView::LightType::DIRECTIONAL_LIGHT, Vector3(1.0, 1.0, -1.0), Vector3(0.3, 0.3, 0.3));
+ DALI_TEST_CHECK(lightSet);
+ bool lightSet2 = view.SetLight(Scene3dView::LightType::POINT_LIGHT, Vector3(1.0, 1.0, -1.0), Vector3(0.3, 0.3, 0.3));
+ DALI_TEST_CHECK(lightSet2);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliScene3dViewGetCamera");
- Toolkit::Scene3dView view = Toolkit::Scene3dView::New( TEST_GLTF_FILE_NAME[0] );
+ Toolkit::Scene3dView view = Toolkit::Scene3dView::New(TEST_GLTF_FILE_NAME[0]);
CameraActor camera = view.GetDefaultCamera();
- DALI_TEST_CHECK( camera );
+ DALI_TEST_CHECK(camera);
- CameraActor camera2 = view.GetCamera( -1 );
- DALI_TEST_CHECK( !camera2 );
+ CameraActor camera2 = view.GetCamera(-1);
+ DALI_TEST_CHECK(!camera2);
- CameraActor camera3 = view.GetCamera( 0 );
- DALI_TEST_CHECK( camera3 );
+ CameraActor camera3 = view.GetCamera(0);
+ DALI_TEST_CHECK(camera3);
- CameraActor camera4 = view.GetCamera( view.GetCameraCount() - 1 );
- DALI_TEST_CHECK( camera4 );
+ CameraActor camera4 = view.GetCamera(view.GetCameraCount() - 1);
+ DALI_TEST_CHECK(camera4);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliScene3dViewAnimations");
- for( auto filename : TEST_GLTF_FILE_NAME )
+ for(auto filename : TEST_GLTF_FILE_NAME)
{
- Toolkit::Scene3dView view = Toolkit::Scene3dView::New( filename );
+ Toolkit::Scene3dView view = Toolkit::Scene3dView::New(filename);
bool playAnimation = view.PlayAnimations();
- DALI_TEST_CHECK( playAnimation );
+ DALI_TEST_CHECK(playAnimation);
}
END_TEST;
ToolkitTestApplication application;
tet_infoline(" UtcDaliScene3dViewAnimations2");
- Toolkit::Scene3dView view = Toolkit::Scene3dView::New( TEST_GLTF_FILE_NAME[0] );
+ Toolkit::Scene3dView view = Toolkit::Scene3dView::New(TEST_GLTF_FILE_NAME[0]);
- bool animated = true;
+ bool animated = true;
unsigned int animationCount = view.GetAnimationCount();
- for( unsigned int i = 0; i < animationCount; ++i )
+ for(unsigned int i = 0; i < animationCount; ++i)
{
- animated = ( animated && view.PlayAnimation( i ) );
+ animated = (animated && view.PlayAnimation(i));
}
- DALI_TEST_CHECK( animated );
+ DALI_TEST_CHECK(animated);
END_TEST;
}
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
#include <stdlib.h>
+#include <iostream>
#include <string>
+
#include <dali-toolkit-test-suite-utils.h>
#include "dali-toolkit-test-utils/toolkit-timer.h"
+
#include <dali-toolkit/dali-toolkit.h>
-#include <dali/devel-api/actors/actor-devel.h>
#include <dali-toolkit/devel-api/controls/scroll-bar/scroll-bar.h>
+#include <dali/devel-api/actors/actor-devel.h>
using namespace Dali;
using namespace Toolkit;
namespace
{
-
-const int RENDER_FRAME_INTERVAL = 16; ///< Duration of each frame in ms. (at approx 60FPS)
+const int RENDER_FRAME_INTERVAL = 16; ///< Duration of each frame in ms. (at approx 60FPS)
/*
* Simulate time passed by.
{
int time = 0;
- for(int i = 0; i <= ( duration / RENDER_FRAME_INTERVAL); i++)
+ for(int i = 0; i <= (duration / RENDER_FRAME_INTERVAL); i++)
{
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
// Callback probes.
static bool gOnPanFinishedCalled; ///< Whether the PanFinished signal was invoked.
-static bool gOnScrollPositionIntervalReachedSignalCalled; ///< Whether the ScrollPositionIntervalReached signal was invoked.
+static bool gOnScrollPositionIntervalReachedSignalCalled; ///< Whether the ScrollPositionIntervalReached signal was invoked.
/**
* Invoked when pan gesture is finished on the scroll indicator.
struct CallbackFunctor
{
CallbackFunctor(bool* callbackFlag)
- : mCallbackFlag( callbackFlag )
+ : mCallbackFlag(callbackFlag)
{
}
*
* @param[in] position The current scroll position.
*/
-static void OnScrollPositionIntervalReached( float position )
+static void OnScrollPositionIntervalReached(float position)
{
gOnScrollPositionIntervalReachedSignalCalled = true;
}
gOnPanFinishedCalled = false;
// Now do a pan starting from (start) and heading (direction)
- Vector2 pos( start + ( direction * 15 ) );
+ Vector2 pos(start + (direction * 15));
uint32_t time = start_time;
- TestStartPan( application, start, pos, time );
+ TestStartPan(application, start, pos, time);
Wait(application);
pos += direction; // Move in this direction
time += RENDER_FRAME_INTERVAL;
- TestMovePan( application, pos, time);
+ TestMovePan(application, pos, time);
Wait(application);
}
pos += direction; // Move in this direction.
time += RENDER_FRAME_INTERVAL;
- TestEndPan(application, pos, time );
+ TestEndPan(application, pos, time);
Wait(application);
return pos;
ToolkitTestApplication application;
ScrollBar scrollBar;
- DALI_TEST_CHECK( !scrollBar );
+ DALI_TEST_CHECK(!scrollBar);
END_TEST;
}
ToolkitTestApplication application;
ScrollBar scrollBar = ScrollBar::New();
- scrollBar.SetProperty( ScrollBar::Property::INDICATOR_FIXED_HEIGHT, 38.2f );
+ scrollBar.SetProperty(ScrollBar::Property::INDICATOR_FIXED_HEIGHT, 38.2f);
- ScrollBar copy( scrollBar );
- DALI_TEST_CHECK( copy );
- DALI_TEST_CHECK( copy.GetProperty<float>( ScrollBar::Property::INDICATOR_FIXED_HEIGHT ) == scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_FIXED_HEIGHT ) );
+ ScrollBar copy(scrollBar);
+ DALI_TEST_CHECK(copy);
+ DALI_TEST_CHECK(copy.GetProperty<float>(ScrollBar::Property::INDICATOR_FIXED_HEIGHT) == scrollBar.GetProperty<float>(ScrollBar::Property::INDICATOR_FIXED_HEIGHT));
END_TEST;
}
ToolkitTestApplication application;
ScrollBar scrollBar = ScrollBar::New();
- scrollBar.SetProperty( ScrollBar::Property::INDICATOR_FIXED_HEIGHT, 38.2f );
+ scrollBar.SetProperty(ScrollBar::Property::INDICATOR_FIXED_HEIGHT, 38.2f);
ScrollBar copy = scrollBar;
- DALI_TEST_CHECK( copy );
- DALI_TEST_CHECK( copy.GetProperty<float>( ScrollBar::Property::INDICATOR_FIXED_HEIGHT ) == scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_FIXED_HEIGHT ) );
+ DALI_TEST_CHECK(copy);
+ DALI_TEST_CHECK(copy.GetProperty<float>(ScrollBar::Property::INDICATOR_FIXED_HEIGHT) == scrollBar.GetProperty<float>(ScrollBar::Property::INDICATOR_FIXED_HEIGHT));
END_TEST;
}
ScrollBar* scrollBar = new ScrollBar();
delete scrollBar;
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
END_TEST;
}
ToolkitTestApplication application;
ScrollBar scrollBar = ScrollBar::New();
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
END_TEST;
ScrollBar vertical = ScrollBar::New(ScrollBar::VERTICAL);
- DALI_TEST_CHECK( vertical );
- DALI_TEST_CHECK( vertical.GetScrollDirection() == ScrollBar::VERTICAL );
+ DALI_TEST_CHECK(vertical);
+ DALI_TEST_CHECK(vertical.GetScrollDirection() == ScrollBar::VERTICAL);
- Property::Value value = vertical.GetProperty(ScrollBar::Property::SCROLL_DIRECTION);
- std::string scrollDirection = value.Get<std::string>();
- DALI_TEST_EQUALS( scrollDirection, "VERTICAL", TEST_LOCATION );
+ Property::Value value = vertical.GetProperty(ScrollBar::Property::SCROLL_DIRECTION);
+ std::string scrollDirection = value.Get<std::string>();
+ DALI_TEST_EQUALS(scrollDirection, "VERTICAL", TEST_LOCATION);
ScrollBar horizontal = ScrollBar::New(ScrollBar::HORIZONTAL);
- DALI_TEST_CHECK( horizontal );
- DALI_TEST_CHECK( horizontal.GetScrollDirection() == ScrollBar::HORIZONTAL );
- value = vertical.GetProperty(ScrollBar::Property::SCROLL_DIRECTION);
+ DALI_TEST_CHECK(horizontal);
+ DALI_TEST_CHECK(horizontal.GetScrollDirection() == ScrollBar::HORIZONTAL);
+ value = vertical.GetProperty(ScrollBar::Property::SCROLL_DIRECTION);
scrollDirection = value.Get<std::string>();
- DALI_TEST_EQUALS( scrollDirection, "HORIZONTAL", TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollDirection, "HORIZONTAL", TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
TypeRegistry typeRegistry = TypeRegistry::Get();
- DALI_TEST_CHECK( typeRegistry );
+ DALI_TEST_CHECK(typeRegistry);
- TypeInfo typeInfo = typeRegistry.GetTypeInfo( "ScrollBar" );
- DALI_TEST_CHECK( typeInfo );
+ TypeInfo typeInfo = typeRegistry.GetTypeInfo("ScrollBar");
+ DALI_TEST_CHECK(typeInfo);
BaseHandle handle = typeInfo.CreateInstance();
- DALI_TEST_CHECK( handle );
+ DALI_TEST_CHECK(handle);
- ScrollBar scrollBar = ScrollBar::DownCast( handle );
- DALI_TEST_CHECK( scrollBar );
+ ScrollBar scrollBar = ScrollBar::DownCast(handle);
+ DALI_TEST_CHECK(scrollBar);
scrollBar.SetProperty(ScrollBar::Property::SCROLL_DIRECTION, "VERTICAL");
scrollBar.SetProperty(ScrollBar::Property::INDICATOR_HEIGHT_POLICY, "FIXED");
- DALI_TEST_EQUALS( scrollBar.GetScrollDirection(), Toolkit::ScrollBar::VERTICAL, TEST_LOCATION );
- DALI_TEST_EQUALS( scrollBar.GetIndicatorHeightPolicy(), Toolkit::ScrollBar::FIXED, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollBar.GetScrollDirection(), Toolkit::ScrollBar::VERTICAL, TEST_LOCATION);
+ DALI_TEST_EQUALS(scrollBar.GetIndicatorHeightPolicy(), Toolkit::ScrollBar::FIXED, TEST_LOCATION);
scrollBar.SetProperty(ScrollBar::Property::SCROLL_DIRECTION, "HORIZONTAL");
scrollBar.SetProperty(ScrollBar::Property::INDICATOR_HEIGHT_POLICY, "VARIABLE");
- DALI_TEST_EQUALS( scrollBar.GetScrollDirection(), Toolkit::ScrollBar::HORIZONTAL, TEST_LOCATION );
- DALI_TEST_EQUALS( scrollBar.GetIndicatorHeightPolicy(), Toolkit::ScrollBar::VARIABLE, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollBar.GetScrollDirection(), Toolkit::ScrollBar::HORIZONTAL, TEST_LOCATION);
+ DALI_TEST_EQUALS(scrollBar.GetIndicatorHeightPolicy(), Toolkit::ScrollBar::VARIABLE, TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- ScrollBar scrollBar1 = ScrollBar::New();
- BaseHandle object( scrollBar1 );
+ ScrollBar scrollBar1 = ScrollBar::New();
+ BaseHandle object(scrollBar1);
- ScrollBar scrollBar2 = ScrollBar::DownCast( object );
- DALI_TEST_CHECK( scrollBar2 );
+ ScrollBar scrollBar2 = ScrollBar::DownCast(object);
+ DALI_TEST_CHECK(scrollBar2);
- ScrollBar scrollBar3 = DownCast< ScrollBar >( object );
- DALI_TEST_CHECK( scrollBar3 );
+ ScrollBar scrollBar3 = DownCast<ScrollBar>(object);
+ DALI_TEST_CHECK(scrollBar3);
END_TEST;
}
ToolkitTestApplication application;
BaseHandle uninitializedObject;
- ScrollBar scrollBar1 = ScrollBar::DownCast( uninitializedObject );
- DALI_TEST_CHECK( !scrollBar1 );
+ ScrollBar scrollBar1 = ScrollBar::DownCast(uninitializedObject);
+ DALI_TEST_CHECK(!scrollBar1);
- ScrollBar scrollBar2 = DownCast< ScrollBar >( uninitializedObject );
- DALI_TEST_CHECK( !scrollBar2 );
+ ScrollBar scrollBar2 = DownCast<ScrollBar>(uninitializedObject);
+ DALI_TEST_CHECK(!scrollBar2);
END_TEST;
}
// Create a vertical scroll bar
ScrollBar scrollBar = ScrollBar::New(ScrollBar::VERTICAL);
- DALI_TEST_CHECK( scrollBar );
- DALI_TEST_CHECK( scrollBar.GetScrollDirection() == ScrollBar::VERTICAL );
+ DALI_TEST_CHECK(scrollBar);
+ DALI_TEST_CHECK(scrollBar.GetScrollDirection() == ScrollBar::VERTICAL);
float scrollBarHeight = 100.0f;
- scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, scrollBarHeight, 0.0f) );
- application.GetScene().Add( scrollBar );
+ scrollBar.SetProperty(Actor::Property::SIZE, Vector3(20.0f, scrollBarHeight, 0.0f));
+ application.GetScene().Add(scrollBar);
// Create a source actor that owns the scroll properties required by the scroll bar
Actor sourceActor = Actor::New();
- application.GetScene().Add( sourceActor );
+ application.GetScene().Add(sourceActor);
// Register the scroll properties
- Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "sourcePosition", 0.0f );
- Property::Index propertyMinScrollPosition = sourceActor.RegisterProperty( "sourcePositionMin", 0.0f );
- Property::Index propertyMaxScrollPosition = sourceActor.RegisterProperty( "sourcePositionMax", 100.0f );
- Property::Index propertyScrollContentSize = sourceActor.RegisterProperty( "sourceContentSize", 500.0f );
+ Property::Index propertyScrollPosition = sourceActor.RegisterProperty("sourcePosition", 0.0f);
+ Property::Index propertyMinScrollPosition = sourceActor.RegisterProperty("sourcePositionMin", 0.0f);
+ Property::Index propertyMaxScrollPosition = sourceActor.RegisterProperty("sourcePositionMax", 100.0f);
+ Property::Index propertyScrollContentSize = sourceActor.RegisterProperty("sourceContentSize", 500.0f);
- DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "sourcePosition" ), propertyScrollPosition, TEST_LOCATION );
- DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "sourcePositionMin" ), propertyMinScrollPosition, TEST_LOCATION );
- DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "sourcePositionMax" ), propertyMaxScrollPosition, TEST_LOCATION );
- DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "sourceContentSize" ), propertyScrollContentSize, TEST_LOCATION );
+ DALI_TEST_EQUALS(sourceActor.GetPropertyIndex("sourcePosition"), propertyScrollPosition, TEST_LOCATION);
+ DALI_TEST_EQUALS(sourceActor.GetPropertyIndex("sourcePositionMin"), propertyMinScrollPosition, TEST_LOCATION);
+ DALI_TEST_EQUALS(sourceActor.GetPropertyIndex("sourcePositionMax"), propertyMaxScrollPosition, TEST_LOCATION);
+ DALI_TEST_EQUALS(sourceActor.GetPropertyIndex("sourceContentSize"), propertyScrollContentSize, TEST_LOCATION);
// Set the source of the scroll position properties.
scrollBar.SetScrollPropertySource(sourceActor, propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
application.Render();
Actor indicator = scrollBar.GetScrollIndicator();
- DALI_TEST_CHECK( indicator );
+ DALI_TEST_CHECK(indicator);
// Check that the indicator size should be: scroll bar size * (scroll bar size / content size).
// i.e. The bigger the content size, the smaller the indicator size
- float indicatorHeight = indicator.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).y;
- DALI_TEST_EQUALS( indicatorHeight, scrollBarHeight * scrollBarHeight / 500.0f, TEST_LOCATION );
+ float indicatorHeight = indicator.GetCurrentProperty<Vector3>(Actor::Property::SIZE).y;
+ DALI_TEST_EQUALS(indicatorHeight, scrollBarHeight * scrollBarHeight / 500.0f, TEST_LOCATION);
// Decrease the content length
- sourceActor.SetProperty( propertyScrollContentSize, 250.0f );
+ sourceActor.SetProperty(propertyScrollContentSize, 250.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator size is changed accordingly
- indicatorHeight = indicator.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).y;
- DALI_TEST_EQUALS( indicatorHeight, scrollBarHeight * scrollBarHeight / 250.0f, TEST_LOCATION );
+ indicatorHeight = indicator.GetCurrentProperty<Vector3>(Actor::Property::SIZE).y;
+ DALI_TEST_EQUALS(indicatorHeight, scrollBarHeight * scrollBarHeight / 250.0f, TEST_LOCATION);
// As scroll position is 0, check that the indicator position should be 0.0f.
- float indicatorPosition = indicator.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).y;
- DALI_TEST_EQUALS( indicatorPosition, 0.0f, TEST_LOCATION );
+ float indicatorPosition = indicator.GetCurrentProperty<Vector3>(Actor::Property::POSITION).y;
+ DALI_TEST_EQUALS(indicatorPosition, 0.0f, TEST_LOCATION);
// Set the scroll position to the middle
- sourceActor.SetProperty( propertyScrollPosition, -50.0f );
+ sourceActor.SetProperty(propertyScrollPosition, -50.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator should be in the middle of the scroll bar
- indicatorPosition = indicator.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).y;
- DALI_TEST_EQUALS( indicatorPosition, (scrollBarHeight - indicatorHeight) * 0.5f, TEST_LOCATION );
+ indicatorPosition = indicator.GetCurrentProperty<Vector3>(Actor::Property::POSITION).y;
+ DALI_TEST_EQUALS(indicatorPosition, (scrollBarHeight - indicatorHeight) * 0.5f, TEST_LOCATION);
// Set the scroll position to the maximum
- sourceActor.SetProperty( propertyScrollPosition, -100.0f );
+ sourceActor.SetProperty(propertyScrollPosition, -100.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator should be in the end of the scroll bar
- indicatorPosition = indicator.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).y;
- DALI_TEST_EQUALS( indicatorPosition, scrollBarHeight - indicatorHeight, TEST_LOCATION );
+ indicatorPosition = indicator.GetCurrentProperty<Vector3>(Actor::Property::POSITION).y;
+ DALI_TEST_EQUALS(indicatorPosition, scrollBarHeight - indicatorHeight, TEST_LOCATION);
// Increase the maximum scroll position to double
- sourceActor.SetProperty( propertyMaxScrollPosition, 200.0f );
+ sourceActor.SetProperty(propertyMaxScrollPosition, 200.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator should be now in the middle of the scroll bar
- indicatorPosition = indicator.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).y;
- DALI_TEST_EQUALS( indicatorPosition, (scrollBarHeight - indicatorHeight) * 0.5f, TEST_LOCATION );
+ indicatorPosition = indicator.GetCurrentProperty<Vector3>(Actor::Property::POSITION).y;
+ DALI_TEST_EQUALS(indicatorPosition, (scrollBarHeight - indicatorHeight) * 0.5f, TEST_LOCATION);
// Create another source actor
Actor newSourceActor = Actor::New();
- application.GetScene().Add( newSourceActor );
+ application.GetScene().Add(newSourceActor);
// Register the scroll properties
- Property::Index newPropertyScrollPosition = newSourceActor.RegisterProperty( "sourcePosition", 0.0f );
- Property::Index newPropertyMinScrollPosition = newSourceActor.RegisterProperty( "sourcePositionMin", 0.0f );
- Property::Index newPropertyMaxScrollPosition = newSourceActor.RegisterProperty( "sourcePositionMax", 200.0f );
- Property::Index newPropertyScrollContentSize = newSourceActor.RegisterProperty( "sourceContentSize", 400.0f );
+ Property::Index newPropertyScrollPosition = newSourceActor.RegisterProperty("sourcePosition", 0.0f);
+ Property::Index newPropertyMinScrollPosition = newSourceActor.RegisterProperty("sourcePositionMin", 0.0f);
+ Property::Index newPropertyMaxScrollPosition = newSourceActor.RegisterProperty("sourcePositionMax", 200.0f);
+ Property::Index newPropertyScrollContentSize = newSourceActor.RegisterProperty("sourceContentSize", 400.0f);
- DALI_TEST_EQUALS( newSourceActor.GetPropertyIndex( "sourcePosition" ), newPropertyScrollPosition, TEST_LOCATION );
- DALI_TEST_EQUALS( newSourceActor.GetPropertyIndex( "sourcePositionMin" ), newPropertyMinScrollPosition, TEST_LOCATION );
- DALI_TEST_EQUALS( newSourceActor.GetPropertyIndex( "sourcePositionMax" ), newPropertyMaxScrollPosition, TEST_LOCATION );
- DALI_TEST_EQUALS( newSourceActor.GetPropertyIndex( "sourceContentSize" ), newPropertyScrollContentSize, TEST_LOCATION );
+ DALI_TEST_EQUALS(newSourceActor.GetPropertyIndex("sourcePosition"), newPropertyScrollPosition, TEST_LOCATION);
+ DALI_TEST_EQUALS(newSourceActor.GetPropertyIndex("sourcePositionMin"), newPropertyMinScrollPosition, TEST_LOCATION);
+ DALI_TEST_EQUALS(newSourceActor.GetPropertyIndex("sourcePositionMax"), newPropertyMaxScrollPosition, TEST_LOCATION);
+ DALI_TEST_EQUALS(newSourceActor.GetPropertyIndex("sourceContentSize"), newPropertyScrollContentSize, TEST_LOCATION);
// Change the source of the scroll position properties to be the new source actor.
scrollBar.SetScrollPropertySource(newSourceActor, newPropertyScrollPosition, newPropertyMinScrollPosition, newPropertyMaxScrollPosition, newPropertyScrollContentSize);
application.Render();
// Check that the indicator size is changed accordingly
- indicatorHeight = indicator.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).y;
- DALI_TEST_EQUALS( indicatorHeight, scrollBarHeight * scrollBarHeight / 400.0f, TEST_LOCATION );
+ indicatorHeight = indicator.GetCurrentProperty<Vector3>(Actor::Property::SIZE).y;
+ DALI_TEST_EQUALS(indicatorHeight, scrollBarHeight * scrollBarHeight / 400.0f, TEST_LOCATION);
// Check that the indicator position goes back to the beginning of the scroll bar
- indicatorPosition = indicator.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).y;
- DALI_TEST_EQUALS( indicatorPosition, 0.0f, TEST_LOCATION );
+ indicatorPosition = indicator.GetCurrentProperty<Vector3>(Actor::Property::POSITION).y;
+ DALI_TEST_EQUALS(indicatorPosition, 0.0f, TEST_LOCATION);
// Set the scroll position to one fifth of the maximum
- newSourceActor.SetProperty( propertyScrollPosition, -40.0f );
+ newSourceActor.SetProperty(propertyScrollPosition, -40.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator should be in one fifth from the beginning of the scroll bar
- indicatorPosition = indicator.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).y;
- DALI_TEST_EQUALS( indicatorPosition, (scrollBarHeight - indicatorHeight) * 0.2f, TEST_LOCATION );
+ indicatorPosition = indicator.GetCurrentProperty<Vector3>(Actor::Property::POSITION).y;
+ DALI_TEST_EQUALS(indicatorPosition, (scrollBarHeight - indicatorHeight) * 0.2f, TEST_LOCATION);
END_TEST;
}
// Create a scroll bar
ScrollBar scrollBar = ScrollBar::New();
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
// Set empty handle of source object and invalid source property index.
Actor sourceActor;
scrollBar.SetScrollPropertySource(sourceActor, Property::INVALID_INDEX, Property::INVALID_INDEX, Property::INVALID_INDEX, Property::INVALID_INDEX);
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
END_TEST;
}
// Create a scroll bar
ScrollBar scrollBar = ScrollBar::New();
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
Actor indicator = scrollBar.GetScrollIndicator();
- DALI_TEST_CHECK( indicator );
+ DALI_TEST_CHECK(indicator);
// Set a new indicator
Actor newIndicator = Actor::New();
scrollBar.SetScrollIndicator(newIndicator);
// Check that the new indicator is successfully set
- DALI_TEST_CHECK( indicator != scrollBar.GetScrollIndicator() );
- DALI_TEST_CHECK( newIndicator == scrollBar.GetScrollIndicator() );
+ DALI_TEST_CHECK(indicator != scrollBar.GetScrollIndicator());
+ DALI_TEST_CHECK(newIndicator == scrollBar.GetScrollIndicator());
// Check that the new control indicator is successfully set
Control controlIndicator = Control::New();
scrollBar.SetScrollIndicator(controlIndicator);
- DALI_TEST_CHECK( controlIndicator == Control::DownCast( scrollBar.GetScrollIndicator() ) );
+ DALI_TEST_CHECK(controlIndicator == Control::DownCast(scrollBar.GetScrollIndicator()));
END_TEST;
}
// Create a scroll bar
ScrollBar scrollBar = ScrollBar::New();
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
Actor indicator = scrollBar.GetScrollIndicator();
- DALI_TEST_CHECK( indicator );
+ DALI_TEST_CHECK(indicator);
// Try to set an uninitialized actor as the indicator
Actor uninitializedIndicator;
scrollBar.SetScrollIndicator(uninitializedIndicator);
// Check that the uninitialized actor can not be set as the indicator
- DALI_TEST_CHECK( indicator == scrollBar.GetScrollIndicator() );
- DALI_TEST_CHECK( uninitializedIndicator != scrollBar.GetScrollIndicator() );
+ DALI_TEST_CHECK(indicator == scrollBar.GetScrollIndicator());
+ DALI_TEST_CHECK(uninitializedIndicator != scrollBar.GetScrollIndicator());
END_TEST;
}
// Create a scroll bar
ScrollBar scrollBar = ScrollBar::New();
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
Actor indicator = scrollBar.GetScrollIndicator();
- DALI_TEST_CHECK( indicator );
+ DALI_TEST_CHECK(indicator);
// Set a new indicator
Actor newIndicator = Actor::New();
scrollBar.SetScrollIndicator(newIndicator);
// Check that the new indicator is successfully set
- DALI_TEST_CHECK( scrollBar.GetScrollIndicator() );
- DALI_TEST_CHECK( indicator != scrollBar.GetScrollIndicator() );
- DALI_TEST_CHECK( newIndicator == scrollBar.GetScrollIndicator() );
+ DALI_TEST_CHECK(scrollBar.GetScrollIndicator());
+ DALI_TEST_CHECK(indicator != scrollBar.GetScrollIndicator());
+ DALI_TEST_CHECK(newIndicator == scrollBar.GetScrollIndicator());
END_TEST;
}
// Create a scroll bar
ScrollBar scrollBar = ScrollBar::New();
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
Actor indicator = scrollBar.GetScrollIndicator();
- DALI_TEST_CHECK( indicator );
+ DALI_TEST_CHECK(indicator);
// Try to set an uninitialized actor as the indicator
Actor uninitializedIndicator;
scrollBar.SetScrollIndicator(uninitializedIndicator);
// Check that the indicator has not been changed
- DALI_TEST_CHECK( indicator == scrollBar.GetScrollIndicator() );
- DALI_TEST_CHECK( uninitializedIndicator != scrollBar.GetScrollIndicator() );
+ DALI_TEST_CHECK(indicator == scrollBar.GetScrollIndicator());
+ DALI_TEST_CHECK(uninitializedIndicator != scrollBar.GetScrollIndicator());
END_TEST;
}
// Create a vertical scroll bar
ScrollBar scrollBar = ScrollBar::New(ScrollBar::VERTICAL);
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
- scrollBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- scrollBar.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, 800.0f, 0.0f) );
+ scrollBar.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ scrollBar.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ scrollBar.SetProperty(Actor::Property::SIZE, Vector3(20.0f, 800.0f, 0.0f));
- application.GetScene().Add( scrollBar );
+ application.GetScene().Add(scrollBar);
// Connect to the ScrollPositionIntervalReached signal
- scrollBar.ScrollPositionIntervalReachedSignal().Connect( &OnScrollPositionIntervalReached );
+ scrollBar.ScrollPositionIntervalReachedSignal().Connect(&OnScrollPositionIntervalReached);
// Render and notify
application.SendNotification();
// Create a source actor that owns the scroll properties required by the scroll bar
Actor sourceActor = Actor::New();
- application.GetScene().Add( sourceActor );
+ application.GetScene().Add(sourceActor);
// Register the scroll properties
- Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "sourcePosition", 0.0f );
- Property::Index propertyMinScrollPosition = sourceActor.RegisterProperty( "sourcePositionMin", 0.0f );
- Property::Index propertyMaxScrollPosition = sourceActor.RegisterProperty( "sourcePositionMax", 800.0f );
- Property::Index propertyScrollContentSize = sourceActor.RegisterProperty( "sourceContentSize", 2000.0f );
+ Property::Index propertyScrollPosition = sourceActor.RegisterProperty("sourcePosition", 0.0f);
+ Property::Index propertyMinScrollPosition = sourceActor.RegisterProperty("sourcePositionMin", 0.0f);
+ Property::Index propertyMaxScrollPosition = sourceActor.RegisterProperty("sourcePositionMax", 800.0f);
+ Property::Index propertyScrollContentSize = sourceActor.RegisterProperty("sourceContentSize", 2000.0f);
- DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "sourcePosition" ), propertyScrollPosition, TEST_LOCATION );
- DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "sourcePositionMin" ), propertyMinScrollPosition, TEST_LOCATION );
- DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "sourcePositionMax" ), propertyMaxScrollPosition, TEST_LOCATION );
- DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "sourceContentSize" ), propertyScrollContentSize, TEST_LOCATION );
+ DALI_TEST_EQUALS(sourceActor.GetPropertyIndex("sourcePosition"), propertyScrollPosition, TEST_LOCATION);
+ DALI_TEST_EQUALS(sourceActor.GetPropertyIndex("sourcePositionMin"), propertyMinScrollPosition, TEST_LOCATION);
+ DALI_TEST_EQUALS(sourceActor.GetPropertyIndex("sourcePositionMax"), propertyMaxScrollPosition, TEST_LOCATION);
+ DALI_TEST_EQUALS(sourceActor.GetPropertyIndex("sourceContentSize"), propertyScrollContentSize, TEST_LOCATION);
// Set the source of the scroll position properties.
scrollBar.SetScrollPropertySource(sourceActor, propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
// Set the values to get notified when the scroll positions of the source actor goes above or below these values
Dali::Vector<float> positionIntervals;
- for( size_t i = 0; i != 10; ++i )
+ for(size_t i = 0; i != 10; ++i)
{
- positionIntervals.PushBack( -80.0f * i ); // should get notified for each 80 pixels
+ positionIntervals.PushBack(-80.0f * i); // should get notified for each 80 pixels
}
scrollBar.SetScrollPositionIntervals(positionIntervals);
Dali::Vector<float> results = scrollBar.GetScrollPositionIntervals();
// Check that the result is the same as the list previously set.
- DALI_TEST_EQUALS( positionIntervals.Count(), results.Count(), TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[0], results[0], TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[1], results[1], TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[2], results[2], TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[3], results[3], TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[4], results[4], TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[5], results[5], TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[6], results[6], TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[7], results[7], TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[8], results[8], TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[9], results[9], TEST_LOCATION );
+ DALI_TEST_EQUALS(positionIntervals.Count(), results.Count(), TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[0], results[0], TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[1], results[1], TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[2], results[2], TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[3], results[3], TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[4], results[4], TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[5], results[5], TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[6], results[6], TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[7], results[7], TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[8], results[8], TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[9], results[9], TEST_LOCATION);
// Reset the flag
gOnScrollPositionIntervalReachedSignalCalled = false;
// Animate the scroll position to cross the specified value
Animation animation = Animation::New(0.1f);
- animation.AnimateTo( Property( sourceActor, propertyScrollPosition ), -85.0f );
+ animation.AnimateTo(Property(sourceActor, propertyScrollPosition), -85.0f);
animation.Play();
// Wait for 0.1 second
Wait(application, 100);
// Check that the signal callback is called
- DALI_TEST_EQUALS( gOnScrollPositionIntervalReachedSignalCalled, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gOnScrollPositionIntervalReachedSignalCalled, true, TEST_LOCATION);
// Reset the flag
gOnScrollPositionIntervalReachedSignalCalled = false;
// Animate the scroll position to cross another specified value
animation = Animation::New(0.1f);
- animation.AnimateTo( Property( sourceActor, propertyScrollPosition ), -170.0f );
+ animation.AnimateTo(Property(sourceActor, propertyScrollPosition), -170.0f);
animation.Play();
// Wait for 0.1 second
Wait(application, 100);
// Check that the signal callback is called
- DALI_TEST_EQUALS( gOnScrollPositionIntervalReachedSignalCalled, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gOnScrollPositionIntervalReachedSignalCalled, true, TEST_LOCATION);
// Reset the flag
gOnScrollPositionIntervalReachedSignalCalled = false;
// Animate the scroll position back to the previous value
animation = Animation::New(0.1f);
- animation.AnimateTo( Property( sourceActor, propertyScrollPosition ), -85.0f );
+ animation.AnimateTo(Property(sourceActor, propertyScrollPosition), -85.0f);
animation.Play();
// Wait for 0.1 second
Wait(application, 100);
// Check that the signal callback is called
- DALI_TEST_EQUALS( gOnScrollPositionIntervalReachedSignalCalled, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gOnScrollPositionIntervalReachedSignalCalled, true, TEST_LOCATION);
END_TEST;
}
// Create a vertical scroll bar
ScrollBar scrollBar = ScrollBar::New(ScrollBar::VERTICAL);
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
// Set the values to get notified when the scroll positions of the source actor goes above or below these values
Dali::Vector<float> positionIntervals;
- for( size_t i = 0; i != 10; ++i )
+ for(size_t i = 0; i != 10; ++i)
{
- positionIntervals.PushBack( -80.0f * i ); // should get notified for each 80 pixels
+ positionIntervals.PushBack(-80.0f * i); // should get notified for each 80 pixels
}
scrollBar.SetScrollPositionIntervals(positionIntervals);
Dali::Vector<float> results = scrollBar.GetScrollPositionIntervals();
// Check that the result is the same as the list previously set.
- DALI_TEST_EQUALS( positionIntervals.Count(), results.Count(), TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[0], results[0], TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[1], results[1], TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[2], results[2], TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[3], results[3], TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[4], results[4], TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[5], results[5], TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[6], results[6], TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[7], results[7], TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[8], results[8], TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[9], results[9], TEST_LOCATION );
+ DALI_TEST_EQUALS(positionIntervals.Count(), results.Count(), TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[0], results[0], TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[1], results[1], TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[2], results[2], TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[3], results[3], TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[4], results[4], TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[5], results[5], TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[6], results[6], TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[7], results[7], TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[8], results[8], TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[9], results[9], TEST_LOCATION);
Property::Array resultArray = scrollBar.GetProperty<Property::Array>(Toolkit::ScrollBar::Property::SCROLL_POSITION_INTERVALS);
- DALI_TEST_EQUALS( positionIntervals.Count(), resultArray.Count(), TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[0], resultArray[0].Get<float>(), TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[1], resultArray[1].Get<float>(), TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[2], resultArray[2].Get<float>(), TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[3], resultArray[3].Get<float>(), TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[4], resultArray[4].Get<float>(), TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[5], resultArray[5].Get<float>(), TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[6], resultArray[6].Get<float>(), TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[7], resultArray[7].Get<float>(), TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[8], resultArray[8].Get<float>(), TEST_LOCATION );
- DALI_TEST_EQUALS( positionIntervals[9], resultArray[9].Get<float>(), TEST_LOCATION );
+ DALI_TEST_EQUALS(positionIntervals.Count(), resultArray.Count(), TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[0], resultArray[0].Get<float>(), TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[1], resultArray[1].Get<float>(), TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[2], resultArray[2].Get<float>(), TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[3], resultArray[3].Get<float>(), TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[4], resultArray[4].Get<float>(), TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[5], resultArray[5].Get<float>(), TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[6], resultArray[6].Get<float>(), TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[7], resultArray[7].Get<float>(), TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[8], resultArray[8].Get<float>(), TEST_LOCATION);
+ DALI_TEST_EQUALS(positionIntervals[9], resultArray[9].Get<float>(), TEST_LOCATION);
END_TEST;
}
// Create a vertical scroll bar
ScrollBar scrollBar = ScrollBar::New(ScrollBar::VERTICAL);
- DALI_TEST_CHECK( scrollBar );
- DALI_TEST_CHECK( scrollBar.GetScrollDirection() == ScrollBar::VERTICAL );
+ DALI_TEST_CHECK(scrollBar);
+ DALI_TEST_CHECK(scrollBar.GetScrollDirection() == ScrollBar::VERTICAL);
// Change the direction of scroll bar to horizontal
scrollBar.SetScrollDirection(ScrollBar::HORIZONTAL);
- DALI_TEST_CHECK( scrollBar.GetScrollDirection() == ScrollBar::HORIZONTAL );
+ DALI_TEST_CHECK(scrollBar.GetScrollDirection() == ScrollBar::HORIZONTAL);
END_TEST;
}
// Create a scroll bar
ScrollBar scrollBar = ScrollBar::New();
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
float scrollBarHeight = 100.0f;
- scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, scrollBarHeight, 0.0f) );
- application.GetScene().Add( scrollBar );
+ scrollBar.SetProperty(Actor::Property::SIZE, Vector3(20.0f, scrollBarHeight, 0.0f));
+ application.GetScene().Add(scrollBar);
// Create a source actor that owns the scroll properties required by the scroll bar
Actor sourceActor = Actor::New();
- application.GetScene().Add( sourceActor );
+ application.GetScene().Add(sourceActor);
// Register the scroll properties
- Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "sourcePosition", 0.0f );
- Property::Index propertyMinScrollPosition = sourceActor.RegisterProperty( "sourcePositionMin", 0.0f );
- Property::Index propertyMaxScrollPosition = sourceActor.RegisterProperty( "sourcePositionMax", 100.0f );
- Property::Index propertyScrollContentSize = sourceActor.RegisterProperty( "sourceContentSize", 500.0f );
+ Property::Index propertyScrollPosition = sourceActor.RegisterProperty("sourcePosition", 0.0f);
+ Property::Index propertyMinScrollPosition = sourceActor.RegisterProperty("sourcePositionMin", 0.0f);
+ Property::Index propertyMaxScrollPosition = sourceActor.RegisterProperty("sourcePositionMax", 100.0f);
+ Property::Index propertyScrollContentSize = sourceActor.RegisterProperty("sourceContentSize", 500.0f);
- DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "sourcePosition" ), propertyScrollPosition, TEST_LOCATION );
- DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "sourcePositionMin" ), propertyMinScrollPosition, TEST_LOCATION );
- DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "sourcePositionMax" ), propertyMaxScrollPosition, TEST_LOCATION );
- DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "sourceContentSize" ), propertyScrollContentSize, TEST_LOCATION );
+ DALI_TEST_EQUALS(sourceActor.GetPropertyIndex("sourcePosition"), propertyScrollPosition, TEST_LOCATION);
+ DALI_TEST_EQUALS(sourceActor.GetPropertyIndex("sourcePositionMin"), propertyMinScrollPosition, TEST_LOCATION);
+ DALI_TEST_EQUALS(sourceActor.GetPropertyIndex("sourcePositionMax"), propertyMaxScrollPosition, TEST_LOCATION);
+ DALI_TEST_EQUALS(sourceActor.GetPropertyIndex("sourceContentSize"), propertyScrollContentSize, TEST_LOCATION);
// Set the source of the scroll position properties.
scrollBar.SetScrollPropertySource(sourceActor, propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
application.Render();
Actor indicator = scrollBar.GetScrollIndicator();
- DALI_TEST_CHECK( indicator );
+ DALI_TEST_CHECK(indicator);
// Check that the indicator size should be: scroll bar size * (scroll bar size / content size).
// i.e. The bigger the content size, the smaller the indicator size
- float indicatorHeight = indicator.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).y;
- DALI_TEST_EQUALS( indicatorHeight, scrollBarHeight * scrollBarHeight / 500.0f, TEST_LOCATION );
+ float indicatorHeight = indicator.GetCurrentProperty<Vector3>(Actor::Property::SIZE).y;
+ DALI_TEST_EQUALS(indicatorHeight, scrollBarHeight * scrollBarHeight / 500.0f, TEST_LOCATION);
// Set the indicator height to be fixed to 50.0f
scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::FIXED);
scrollBar.SetIndicatorFixedHeight(50.0f);
Property::Value value = scrollBar.GetProperty(ScrollBar::Property::INDICATOR_HEIGHT_POLICY);
- DALI_TEST_EQUALS(value.Get<std::string>(), "FIXED", TEST_LOCATION );
+ DALI_TEST_EQUALS(value.Get<std::string>(), "FIXED", TEST_LOCATION);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator size should be 50.0f
- indicatorHeight = indicator.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).y;
- DALI_TEST_EQUALS( indicatorHeight, 50.0f, TEST_LOCATION );
+ indicatorHeight = indicator.GetCurrentProperty<Vector3>(Actor::Property::SIZE).y;
+ DALI_TEST_EQUALS(indicatorHeight, 50.0f, TEST_LOCATION);
// Set the indicator height to be variable
scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::VARIABLE);
value = scrollBar.GetProperty(ScrollBar::Property::INDICATOR_HEIGHT_POLICY);
- DALI_TEST_EQUALS(value.Get<std::string>(), "VARIABLE", TEST_LOCATION );
+ DALI_TEST_EQUALS(value.Get<std::string>(), "VARIABLE", TEST_LOCATION);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator size should be: scroll bar size * (scroll bar size / content size).
- indicatorHeight = indicator.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).y;
- DALI_TEST_EQUALS( indicatorHeight, scrollBarHeight * scrollBarHeight / 500.0f, TEST_LOCATION );
+ indicatorHeight = indicator.GetCurrentProperty<Vector3>(Actor::Property::SIZE).y;
+ DALI_TEST_EQUALS(indicatorHeight, scrollBarHeight * scrollBarHeight / 500.0f, TEST_LOCATION);
END_TEST;
}
// Create a scroll bar
ScrollBar scrollBar = ScrollBar::New();
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
// Set the indicator height to be fixed
scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::FIXED);
- DALI_TEST_EQUALS( scrollBar.GetIndicatorHeightPolicy(), Toolkit::ScrollBar::FIXED, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollBar.GetIndicatorHeightPolicy(), Toolkit::ScrollBar::FIXED, TEST_LOCATION);
// Set the indicator height to be variable
scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::VARIABLE);
- DALI_TEST_EQUALS( scrollBar.GetIndicatorHeightPolicy(), Toolkit::ScrollBar::VARIABLE, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollBar.GetIndicatorHeightPolicy(), Toolkit::ScrollBar::VARIABLE, TEST_LOCATION);
END_TEST;
}
// Create a scroll bar
ScrollBar scrollBar = ScrollBar::New();
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
float scrollBarHeight = 100.0f;
- scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, scrollBarHeight, 0.0f) );
- application.GetScene().Add( scrollBar );
+ scrollBar.SetProperty(Actor::Property::SIZE, Vector3(20.0f, scrollBarHeight, 0.0f));
+ application.GetScene().Add(scrollBar);
Actor indicator = scrollBar.GetScrollIndicator();
- DALI_TEST_CHECK( indicator );
+ DALI_TEST_CHECK(indicator);
// Set the indicator height to be fixed to 50.0f
scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::FIXED);
application.Render();
// Check that the indicator size should be 50.0f
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).y, 50.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<Vector3>(Actor::Property::SIZE).y, 50.0f, TEST_LOCATION);
// Set the indicator height to be fixed to 25.0f
scrollBar.SetIndicatorFixedHeight(25.0f);
application.Render();
// Check that the indicator size should be 25.0f
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).y, 25.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<Vector3>(Actor::Property::SIZE).y, 25.0f, TEST_LOCATION);
END_TEST;
}
// Create a scroll bar
ScrollBar scrollBar = ScrollBar::New();
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
// Set the fixed indicator height to be 50.0f
scrollBar.SetIndicatorFixedHeight(50.0f);
// Check that the indicator size should be 50.0f
- DALI_TEST_EQUALS( scrollBar.GetIndicatorFixedHeight(), 50.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollBar.GetIndicatorFixedHeight(), 50.0f, TEST_LOCATION);
// Set the indicator height to be fixed to 25.0f
scrollBar.SetIndicatorFixedHeight(25.0f);
// Check that the indicator size should be 50.0f
- DALI_TEST_EQUALS( scrollBar.GetIndicatorFixedHeight(), 25.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollBar.GetIndicatorFixedHeight(), 25.0f, TEST_LOCATION);
END_TEST;
}
// Create a scroll bar
ScrollBar scrollBar = ScrollBar::New();
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
- application.GetScene().Add( scrollBar );
+ application.GetScene().Add(scrollBar);
Actor indicator = scrollBar.GetScrollIndicator();
- DALI_TEST_CHECK( indicator );
+ DALI_TEST_CHECK(indicator);
// Set the duration to show the indicator to be 0.35 second
scrollBar.SetIndicatorShowDuration(0.35);
- DALI_TEST_EQUALS( scrollBar.GetIndicatorShowDuration(), 0.35f, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollBar.GetIndicatorShowDuration(), 0.35f, TEST_LOCATION);
// Make the indicator invisible
- indicator.SetProperty( Actor::Property::OPACITY,0.0f);
+ indicator.SetProperty(Actor::Property::OPACITY, 0.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 0.0f, TEST_LOCATION);
// Show the indicator
scrollBar.ShowIndicator();
application.Render();
// Check that the indicator is now visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 1.0f, TEST_LOCATION);
// Set the duration to show the indicator to be 0.75 second
scrollBar.SetIndicatorShowDuration(0.75);
- DALI_TEST_EQUALS( scrollBar.GetIndicatorShowDuration(), 0.75f, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollBar.GetIndicatorShowDuration(), 0.75f, TEST_LOCATION);
// Make the indicator invisible
- indicator.SetProperty( Actor::Property::OPACITY,0.0f);
+ indicator.SetProperty(Actor::Property::OPACITY, 0.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 0.0f, TEST_LOCATION);
// Show the indicator
scrollBar.ShowIndicator();
application.Render();
// Check that the indicator is not fully visible yet
- DALI_TEST_CHECK( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ) != 1.0f );
+ DALI_TEST_CHECK(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY) != 1.0f);
// Wait for another 0.4 second
Wait(application, 400);
application.Render();
// Check that the indicator is now fully visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 1.0f, TEST_LOCATION);
END_TEST;
}
// Create a scroll bar
ScrollBar scrollBar = ScrollBar::New();
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
- application.GetScene().Add( scrollBar );
+ application.GetScene().Add(scrollBar);
Actor indicator = scrollBar.GetScrollIndicator();
- DALI_TEST_CHECK( indicator );
+ DALI_TEST_CHECK(indicator);
// Get the default duration to show the indicator
float duration = scrollBar.GetIndicatorShowDuration();
// Check that the default duration is greater than 0
- DALI_TEST_CHECK( duration > 0.0f );
+ DALI_TEST_CHECK(duration > 0.0f);
// Make the indicator invisible
- indicator.SetProperty( Actor::Property::OPACITY,0.0f);
+ indicator.SetProperty(Actor::Property::OPACITY, 0.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 0.0f, TEST_LOCATION);
// Show the indicator
scrollBar.ShowIndicator();
application.Render();
// Check that the indicator is now visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 1.0f, TEST_LOCATION);
// Now set the duration to show the indicator to be a negative value (which should be ignored and therefore means instant)
scrollBar.SetIndicatorShowDuration(-0.25f);
- DALI_TEST_EQUALS( scrollBar.GetIndicatorShowDuration(), -0.25f, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollBar.GetIndicatorShowDuration(), -0.25f, TEST_LOCATION);
// Make the indicator invisible
- indicator.SetProperty( Actor::Property::OPACITY,0.0f);
+ indicator.SetProperty(Actor::Property::OPACITY, 0.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 0.0f, TEST_LOCATION);
// Show the indicator
scrollBar.ShowIndicator();
application.Render();
// Check that the indicator becomes instantly visible in the next frame
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 1.0f, TEST_LOCATION);
END_TEST;
}
// Create a scroll bar
ScrollBar scrollBar = ScrollBar::New();
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
// Set the duration to show the indicator to be 0.35 second
scrollBar.SetIndicatorShowDuration(0.35f);
// Check that the duration to show the indicator is 0.35 second
- DALI_TEST_EQUALS( scrollBar.GetIndicatorShowDuration(), 0.35f, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollBar.GetIndicatorShowDuration(), 0.35f, TEST_LOCATION);
// Set the duration to show the indicator to be 0.75 second
scrollBar.SetIndicatorShowDuration(0.75f);
// Check that the duration to show the indicator is 0.75 second
- DALI_TEST_EQUALS( scrollBar.GetIndicatorShowDuration(), 0.75f, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollBar.GetIndicatorShowDuration(), 0.75f, TEST_LOCATION);
END_TEST;
}
// Create a scroll bar
ScrollBar scrollBar = ScrollBar::New();
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
- application.GetScene().Add( scrollBar );
+ application.GetScene().Add(scrollBar);
Actor indicator = scrollBar.GetScrollIndicator();
- DALI_TEST_CHECK( indicator );
+ DALI_TEST_CHECK(indicator);
// Set the duration to hide the indicator to be 0.15 second
scrollBar.SetIndicatorHideDuration(0.15f);
- DALI_TEST_EQUALS( scrollBar.GetIndicatorHideDuration(), 0.15f, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollBar.GetIndicatorHideDuration(), 0.15f, TEST_LOCATION);
// Make the indicator visible
- indicator.SetProperty( Actor::Property::OPACITY,1.0f);
+ indicator.SetProperty(Actor::Property::OPACITY, 1.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 1.0f, TEST_LOCATION);
// Hide the indicator
scrollBar.HideIndicator();
application.Render();
// Check that the indicator is now invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 0.0f, TEST_LOCATION);
// Set the duration to hide the indicator to be 0.65 second
scrollBar.SetIndicatorHideDuration(0.65f);
- DALI_TEST_EQUALS( scrollBar.GetIndicatorHideDuration(), 0.65f, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollBar.GetIndicatorHideDuration(), 0.65f, TEST_LOCATION);
// Make the indicator visible
- indicator.SetProperty( Actor::Property::OPACITY,1.0f);
+ indicator.SetProperty(Actor::Property::OPACITY, 1.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 1.0f, TEST_LOCATION);
// Hide the indicator
scrollBar.HideIndicator();
application.Render();
// Check that the indicator is not fully invisible yet
- DALI_TEST_CHECK( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ) != 0.0f );
+ DALI_TEST_CHECK(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY) != 0.0f);
// Wait for another 0.5 second
Wait(application, 500);
application.Render();
// Check that the indicator is now fully invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 0.0f, TEST_LOCATION);
END_TEST;
}
// Create a scroll bar
ScrollBar scrollBar = ScrollBar::New();
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
- application.GetScene().Add( scrollBar );
+ application.GetScene().Add(scrollBar);
Actor indicator = scrollBar.GetScrollIndicator();
- DALI_TEST_CHECK( indicator );
+ DALI_TEST_CHECK(indicator);
// Get the default duration to hide the indicator
float duration = scrollBar.GetIndicatorHideDuration();
// Check that the default duration is greater than 0
- DALI_TEST_CHECK( duration > 0.0f );
+ DALI_TEST_CHECK(duration > 0.0f);
// Make the indicator visible
- indicator.SetProperty( Actor::Property::OPACITY,1.0f);
+ indicator.SetProperty(Actor::Property::OPACITY, 1.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 1.0f, TEST_LOCATION);
// Hide the indicator
scrollBar.HideIndicator();
application.Render();
// Check that the indicator is now invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 0.0f, TEST_LOCATION);
// Now set the duration to hide the indicator to be a negative value (which should be ignored and therefore means instant)
scrollBar.SetIndicatorHideDuration(-0.25f);
- DALI_TEST_EQUALS( scrollBar.GetIndicatorHideDuration(), -0.25f, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollBar.GetIndicatorHideDuration(), -0.25f, TEST_LOCATION);
// Make the indicator visible
- indicator.SetProperty( Actor::Property::OPACITY,1.0f);
+ indicator.SetProperty(Actor::Property::OPACITY, 1.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 1.0f, TEST_LOCATION);
// Hide the indicator
scrollBar.HideIndicator();
application.Render();
// Check that the indicator becomes instantly invisible in the next frame
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 0.0f, TEST_LOCATION);
END_TEST;
}
// Create a scroll bar
ScrollBar scrollBar = ScrollBar::New();
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
// Set the duration to hide the indicator to be 0.15 second
scrollBar.SetIndicatorHideDuration(0.15f);
// Check that the duration to hide the indicator is 0.15 second
- DALI_TEST_EQUALS( scrollBar.GetIndicatorHideDuration(), 0.15f, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollBar.GetIndicatorHideDuration(), 0.15f, TEST_LOCATION);
// Set the duration to hide the indicator to be 0.65 second
scrollBar.SetIndicatorHideDuration(0.65f);
// Check that the duration to hide the indicator is 0.65 second
- DALI_TEST_EQUALS( scrollBar.GetIndicatorHideDuration(), 0.65f, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollBar.GetIndicatorHideDuration(), 0.65f, TEST_LOCATION);
END_TEST;
}
// Create a scroll bar
ScrollBar scrollBar = ScrollBar::New();
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
- application.GetScene().Add( scrollBar );
+ application.GetScene().Add(scrollBar);
Actor indicator = scrollBar.GetScrollIndicator();
- DALI_TEST_CHECK( indicator );
+ DALI_TEST_CHECK(indicator);
// Get the default duration to show the indicator
float duration = scrollBar.GetIndicatorShowDuration();
// Check that the default duration is greater than 0
- DALI_TEST_CHECK( duration > 0.0f );
+ DALI_TEST_CHECK(duration > 0.0f);
// Make the indicator invisible
- indicator.SetProperty( Actor::Property::OPACITY,0.0f);
+ indicator.SetProperty(Actor::Property::OPACITY, 0.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 0.0f, TEST_LOCATION);
// Show the indicator
scrollBar.ShowIndicator();
application.Render();
// Check that the indicator is now visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 1.0f, TEST_LOCATION);
END_TEST;
}
// Create a scroll bar
ScrollBar scrollBar = ScrollBar::New();
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
- application.GetScene().Add( scrollBar );
+ application.GetScene().Add(scrollBar);
Actor indicator = scrollBar.GetScrollIndicator();
- DALI_TEST_CHECK( indicator );
+ DALI_TEST_CHECK(indicator);
// Make the indicator initially visible
- indicator.SetProperty( Actor::Property::OPACITY,1.0f);
+ indicator.SetProperty(Actor::Property::OPACITY, 1.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is initially visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 1.0f, TEST_LOCATION);
// Get the default duration to show the indicator
float duration = scrollBar.GetIndicatorShowDuration();
// Check that the default duration is greater than 0
- DALI_TEST_CHECK( duration > 0.0f );
+ DALI_TEST_CHECK(duration > 0.0f);
// Show the indicator
scrollBar.ShowIndicator();
application.Render();
// Check that the indicator is still visible in the very next frame
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 1.0f, TEST_LOCATION);
END_TEST;
}
// Create a scroll bar
ScrollBar scrollBar = ScrollBar::New();
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
- application.GetScene().Add( scrollBar );
+ application.GetScene().Add(scrollBar);
Actor indicator = scrollBar.GetScrollIndicator();
- DALI_TEST_CHECK( indicator );
+ DALI_TEST_CHECK(indicator);
// Get the default duration to hide the indicator
float duration = scrollBar.GetIndicatorHideDuration();
// Check that the default duration is greater than 0
- DALI_TEST_CHECK( duration > 0.0f );
+ DALI_TEST_CHECK(duration > 0.0f);
// Make the indicator visible
- indicator.SetProperty( Actor::Property::OPACITY,1.0f);
+ indicator.SetProperty(Actor::Property::OPACITY, 1.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 1.0f, TEST_LOCATION);
// Hide the indicator
scrollBar.HideIndicator();
application.Render();
// Check that the indicator is now invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 0.0f, TEST_LOCATION);
END_TEST;
}
// Create a scroll bar
ScrollBar scrollBar = ScrollBar::New();
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
- application.GetScene().Add( scrollBar );
+ application.GetScene().Add(scrollBar);
Actor indicator = scrollBar.GetScrollIndicator();
- DALI_TEST_CHECK( indicator );
+ DALI_TEST_CHECK(indicator);
// Make the indicator initially invisible
- indicator.SetProperty( Actor::Property::OPACITY,0.0f);
+ indicator.SetProperty(Actor::Property::OPACITY, 0.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is initially invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 0.0f, TEST_LOCATION);
// Get the default duration to hide the indicator
float duration = scrollBar.GetIndicatorHideDuration();
// Check that the default duration is greater than 0
- DALI_TEST_CHECK( duration > 0.0f );
+ DALI_TEST_CHECK(duration > 0.0f);
// Hide the indicator
scrollBar.HideIndicator();
application.Render();
// Check that the indicator is still invisible in the very next frame
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 0.0f, TEST_LOCATION);
END_TEST;
}
// Create a scroll bar
ScrollBar scrollBar = ScrollBar::New();
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
- application.GetScene().Add( scrollBar );
+ application.GetScene().Add(scrollBar);
Actor indicator = scrollBar.GetScrollIndicator();
- DALI_TEST_CHECK( indicator );
+ DALI_TEST_CHECK(indicator);
// Get the default duration to hide the indicator
- float duration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_SHOW_DURATION );
+ float duration = scrollBar.GetProperty<float>(ScrollBar::Property::INDICATOR_SHOW_DURATION);
// Check that the default duration is greater than 0
- DALI_TEST_CHECK( duration > 0.0f );
+ DALI_TEST_CHECK(duration > 0.0f);
// Make the indicator invisible
- indicator.SetProperty( Actor::Property::OPACITY,0.0f);
+ indicator.SetProperty(Actor::Property::OPACITY, 0.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 0.0f, TEST_LOCATION);
// Do the "ShowIndicator" action
Property::Map emptyMap;
- scrollBar.DoAction( "ShowIndicator", emptyMap );
+ scrollBar.DoAction("ShowIndicator", emptyMap);
// Wait for the specified duration
Wait(application, duration * 1000);
application.Render();
// Check that the indicator is now visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 1.0f, TEST_LOCATION);
END_TEST;
}
// Create a scroll bar
ScrollBar scrollBar = ScrollBar::New();
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
- application.GetScene().Add( scrollBar );
+ application.GetScene().Add(scrollBar);
Actor indicator = scrollBar.GetScrollIndicator();
- DALI_TEST_CHECK( indicator );
+ DALI_TEST_CHECK(indicator);
// Get the default duration to hide the indicator
- float duration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_HIDE_DURATION );
+ float duration = scrollBar.GetProperty<float>(ScrollBar::Property::INDICATOR_HIDE_DURATION);
// Check that the default duration is greater than 0
- DALI_TEST_CHECK( duration > 0.0f );
+ DALI_TEST_CHECK(duration > 0.0f);
// Make the indicator visible
- indicator.SetProperty( Actor::Property::OPACITY,1.0f);
+ indicator.SetProperty(Actor::Property::OPACITY, 1.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 1.0f, TEST_LOCATION);
// Do the "HideIndicator" action
Property::Map emptyMap;
- scrollBar.DoAction( "HideIndicator", emptyMap );
+ scrollBar.DoAction("HideIndicator", emptyMap);
// Wait for the specified duration
Wait(application, duration * 1000);
application.Render();
// Check that the indicator is now invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 0.0f, TEST_LOCATION);
END_TEST;
}
// Create a scroll bar
ScrollBar scrollBar = ScrollBar::New();
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
- application.GetScene().Add( scrollBar );
+ application.GetScene().Add(scrollBar);
Actor indicator = scrollBar.GetScrollIndicator();
- DALI_TEST_CHECK( indicator );
+ DALI_TEST_CHECK(indicator);
// Get the default duration to hide the indicator
- float duration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_SHOW_DURATION );
+ float duration = scrollBar.GetProperty<float>(ScrollBar::Property::INDICATOR_SHOW_DURATION);
// Check that the default duration is greater than 0
- DALI_TEST_CHECK( duration > 0.0f );
+ DALI_TEST_CHECK(duration > 0.0f);
// Make the indicator invisible
- indicator.SetProperty( Actor::Property::OPACITY,0.0f);
+ indicator.SetProperty(Actor::Property::OPACITY, 0.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 0.0f, TEST_LOCATION);
// Do the "ShowIndicator" action
Property::Map emptyMap;
- scrollBar.DoAction( "ShowTransientIndicator", emptyMap );
+ scrollBar.DoAction("ShowTransientIndicator", emptyMap);
// Wait for the specified duration
Wait(application, duration * 1000);
application.Render();
// Check that the indicator is now visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 1.0f, TEST_LOCATION);
// Get the default duration to hide the indicator
- float hideDuration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_HIDE_DURATION );
- float transientDuration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_TRANSIENT_DURATION );
+ float hideDuration = scrollBar.GetProperty<float>(ScrollBar::Property::INDICATOR_HIDE_DURATION);
+ float transientDuration = scrollBar.GetProperty<float>(ScrollBar::Property::INDICATOR_TRANSIENT_DURATION);
float totalVisibleDuration = hideDuration + transientDuration;
// Check that the default duration is greater than 0
- DALI_TEST_CHECK( totalVisibleDuration > 0.0f );
+ DALI_TEST_CHECK(totalVisibleDuration > 0.0f);
// Wait for the specified duration
Wait(application, totalVisibleDuration * 1000);
application.Render();
// Check that the indicator is now invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 0.0f, TEST_LOCATION);
END_TEST;
}
// Create a scroll bar
ScrollBar scrollBar = ScrollBar::New();
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
- application.GetScene().Add( scrollBar );
+ application.GetScene().Add(scrollBar);
Actor indicator = scrollBar.GetScrollIndicator();
- DALI_TEST_CHECK( indicator );
+ DALI_TEST_CHECK(indicator);
// Make the indicator invisible
- indicator.SetProperty( Actor::Property::OPACITY,0.0f);
+ indicator.SetProperty(Actor::Property::OPACITY, 0.0f);
// Don't use a show animation; the indicator should appear immediately
- scrollBar.SetProperty( ScrollBar::Property::INDICATOR_SHOW_DURATION, 0.0f );
- float duration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_SHOW_DURATION );
- DALI_TEST_EQUALS( duration, 0.0f, TEST_LOCATION );
+ scrollBar.SetProperty(ScrollBar::Property::INDICATOR_SHOW_DURATION, 0.0f);
+ float duration = scrollBar.GetProperty<float>(ScrollBar::Property::INDICATOR_SHOW_DURATION);
+ DALI_TEST_EQUALS(duration, 0.0f, TEST_LOCATION);
// Render and notify
application.SendNotification();
// Do the "ShowIndicator" action
Property::Map emptyMap;
- scrollBar.DoAction( "ShowTransientIndicator", emptyMap );
+ scrollBar.DoAction("ShowTransientIndicator", emptyMap);
// Wait for the specified duration
Wait(application);
application.Render();
// Check that the indicator is now visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 1.0f, TEST_LOCATION);
// Get the default duration to hide the indicator
- float hideDuration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_HIDE_DURATION );
- float transientDuration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_TRANSIENT_DURATION );
+ float hideDuration = scrollBar.GetProperty<float>(ScrollBar::Property::INDICATOR_HIDE_DURATION);
+ float transientDuration = scrollBar.GetProperty<float>(ScrollBar::Property::INDICATOR_TRANSIENT_DURATION);
float totalVisibleDuration = hideDuration + transientDuration;
// Check that the default duration is greater than 0
- DALI_TEST_CHECK( totalVisibleDuration > 0.0f );
+ DALI_TEST_CHECK(totalVisibleDuration > 0.0f);
// Wait for the specified duration
Wait(application, totalVisibleDuration * 1000);
application.Render();
// Check that the indicator is now invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 0.0f, TEST_LOCATION);
END_TEST;
}
// Create a scroll bar
ScrollBar scrollBar = ScrollBar::New();
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
- application.GetScene().Add( scrollBar );
+ application.GetScene().Add(scrollBar);
Actor indicator = scrollBar.GetScrollIndicator();
- DALI_TEST_CHECK( indicator );
+ DALI_TEST_CHECK(indicator);
// Get the default duration to hide the indicator
float duration = scrollBar.GetIndicatorHideDuration();
// Check that the default duration is greater than 0
- DALI_TEST_CHECK( duration > 0.0f );
+ DALI_TEST_CHECK(duration > 0.0f);
// Make the indicator visible
- indicator.SetProperty( Actor::Property::OPACITY,1.0f);
+ indicator.SetProperty(Actor::Property::OPACITY, 1.0f);
// Render and notify
application.SendNotification();
application.Render();
// Check that the indicator is visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 1.0f, TEST_LOCATION);
// Hide the indicator
scrollBar.HideIndicator();
application.Render();
// Check that the indicator is now partially hidden
- DALI_TEST_CHECK( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ) < 1.0f );
+ DALI_TEST_CHECK(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY) < 1.0f);
// Now interrupt the Hide with a DoAction( "ShowTransientIndicator" )
// Get the default duration to hide the indicator
- duration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_SHOW_DURATION );
+ duration = scrollBar.GetProperty<float>(ScrollBar::Property::INDICATOR_SHOW_DURATION);
// Check that the default duration is greater than 0
- DALI_TEST_CHECK( duration > 0.0f );
+ DALI_TEST_CHECK(duration > 0.0f);
// Do the "ShowIndicator" action
Property::Map emptyMap;
- scrollBar.DoAction( "ShowTransientIndicator", emptyMap );
+ scrollBar.DoAction("ShowTransientIndicator", emptyMap);
// Wait for the specified duration
Wait(application, duration * 1000);
application.Render();
// Check that the indicator is now visible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 1.0f, TEST_LOCATION);
// Get the default duration to hide the indicator
- float hideDuration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_HIDE_DURATION );
- float transientDuration = scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_TRANSIENT_DURATION );
+ float hideDuration = scrollBar.GetProperty<float>(ScrollBar::Property::INDICATOR_HIDE_DURATION);
+ float transientDuration = scrollBar.GetProperty<float>(ScrollBar::Property::INDICATOR_TRANSIENT_DURATION);
float totalVisibleDuration = hideDuration + transientDuration;
// Check that the default duration is greater than 0
- DALI_TEST_CHECK( totalVisibleDuration > 0.0f );
+ DALI_TEST_CHECK(totalVisibleDuration > 0.0f);
// Wait for the specified duration
Wait(application, totalVisibleDuration * 1000);
application.Render();
// Check that the indicator is now invisible
- DALI_TEST_EQUALS( indicator.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(indicator.GetCurrentProperty<float>(Actor::Property::OPACITY), 0.0f, TEST_LOCATION);
END_TEST;
}
// Create a vertical scroll bar
ScrollBar scrollBar = ScrollBar::New(ScrollBar::VERTICAL);
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
- scrollBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- scrollBar.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, 800.0f, 0.0f) );
+ scrollBar.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ scrollBar.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ scrollBar.SetProperty(Actor::Property::SIZE, Vector3(20.0f, 800.0f, 0.0f));
// Set the indicator height to be fixed to 50.0f
scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::FIXED);
scrollBar.SetIndicatorFixedHeight(50.0f);
- application.GetScene().Add( scrollBar );
+ application.GetScene().Add(scrollBar);
// Connect the pan finished signal
ConnectionTracker connectionTracker;
- bool panFinished = false;
- scrollBar.PanFinishedSignal().Connect( &OnPanFinished );
- scrollBar.ConnectSignal( &connectionTracker, "panFinished", CallbackFunctor(&panFinished));
+ bool panFinished = false;
+ scrollBar.PanFinishedSignal().Connect(&OnPanFinished);
+ scrollBar.ConnectSignal(&connectionTracker, "panFinished", CallbackFunctor(&panFinished));
// Render and notify
application.SendNotification();
// Create a source actor that owns the scroll properties required by the scroll bar
Actor sourceActor = Actor::New();
- application.GetScene().Add( sourceActor );
+ application.GetScene().Add(sourceActor);
// Register the scroll properties
- Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "sourcePosition", 0.0f );
- Property::Index propertyMinScrollPosition = sourceActor.RegisterProperty( "sourcePositionMin", 0.0f );
- Property::Index propertyMaxScrollPosition = sourceActor.RegisterProperty( "sourcePositionMax", 100.0f );
- Property::Index propertyScrollContentSize = sourceActor.RegisterProperty( "sourceContentSize", 500.0f );
+ Property::Index propertyScrollPosition = sourceActor.RegisterProperty("sourcePosition", 0.0f);
+ Property::Index propertyMinScrollPosition = sourceActor.RegisterProperty("sourcePositionMin", 0.0f);
+ Property::Index propertyMaxScrollPosition = sourceActor.RegisterProperty("sourcePositionMax", 100.0f);
+ Property::Index propertyScrollContentSize = sourceActor.RegisterProperty("sourceContentSize", 500.0f);
- DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "sourcePosition" ), propertyScrollPosition, TEST_LOCATION );
- DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "sourcePositionMin" ), propertyMinScrollPosition, TEST_LOCATION );
- DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "sourcePositionMax" ), propertyMaxScrollPosition, TEST_LOCATION );
- DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "sourceContentSize" ), propertyScrollContentSize, TEST_LOCATION );
+ DALI_TEST_EQUALS(sourceActor.GetPropertyIndex("sourcePosition"), propertyScrollPosition, TEST_LOCATION);
+ DALI_TEST_EQUALS(sourceActor.GetPropertyIndex("sourcePositionMin"), propertyMinScrollPosition, TEST_LOCATION);
+ DALI_TEST_EQUALS(sourceActor.GetPropertyIndex("sourcePositionMax"), propertyMaxScrollPosition, TEST_LOCATION);
+ DALI_TEST_EQUALS(sourceActor.GetPropertyIndex("sourceContentSize"), propertyScrollContentSize, TEST_LOCATION);
// Set the source of the scroll position properties.
scrollBar.SetScrollPropertySource(sourceActor, propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
// Perform a swipe gesture on the indicator
PerformGestureSwipe(application, Vector2(1.0f, 1.0f), Vector2(Vector2::YAXIS * 1.0f), 1, 500);
- DALI_TEST_EQUALS( gOnPanFinishedCalled, true, TEST_LOCATION );
- DALI_TEST_EQUALS( panFinished, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gOnPanFinishedCalled, true, TEST_LOCATION);
+ DALI_TEST_EQUALS(panFinished, true, TEST_LOCATION);
END_TEST;
}
// Create a vertical scroll bar
ScrollBar scrollBar = ScrollBar::New(ScrollBar::VERTICAL);
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
- scrollBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- scrollBar.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, 800.0f, 0.0f) );
+ scrollBar.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ scrollBar.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ scrollBar.SetProperty(Actor::Property::SIZE, Vector3(20.0f, 800.0f, 0.0f));
// Set the indicator height to be fixed to 50.0f
scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::FIXED);
scrollBar.SetIndicatorFixedHeight(50.0f);
- application.GetScene().Add( scrollBar );
+ application.GetScene().Add(scrollBar);
// Connect the pan finished signal
ConnectionTracker connectionTracker;
- bool panFinished = false;
- scrollBar.PanFinishedSignal().Connect( &OnPanFinished );
- scrollBar.ConnectSignal( &connectionTracker, "panFinished", CallbackFunctor(&panFinished));
+ bool panFinished = false;
+ scrollBar.PanFinishedSignal().Connect(&OnPanFinished);
+ scrollBar.ConnectSignal(&connectionTracker, "panFinished", CallbackFunctor(&panFinished));
// Render and notify
application.SendNotification();
// Perform a vertical swipe gesture on the indicator when there is no source object set on the scroll bar
PerformGestureSwipe(application, Vector2(1.0f, 1.0f), Vector2(Vector2::YAXIS * 1.0f), 20, 500);
- DALI_TEST_EQUALS( gOnPanFinishedCalled, false, TEST_LOCATION );
+ DALI_TEST_EQUALS(gOnPanFinishedCalled, false, TEST_LOCATION);
// Create a source actor that owns the scroll properties required by the scroll bar
Actor sourceActor = Actor::New();
- application.GetScene().Add( sourceActor );
+ application.GetScene().Add(sourceActor);
// Register the scroll properties
- Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "sourcePosition", 0.0f );
- Property::Index propertyMinScrollPosition = sourceActor.RegisterProperty( "sourcePositionMin", 0.0f );
- Property::Index propertyMaxScrollPosition = sourceActor.RegisterProperty( "sourcePositionMax", 100.0f );
- Property::Index propertyScrollContentSize = sourceActor.RegisterProperty( "sourceContentSize", 500.0f );
+ Property::Index propertyScrollPosition = sourceActor.RegisterProperty("sourcePosition", 0.0f);
+ Property::Index propertyMinScrollPosition = sourceActor.RegisterProperty("sourcePositionMin", 0.0f);
+ Property::Index propertyMaxScrollPosition = sourceActor.RegisterProperty("sourcePositionMax", 100.0f);
+ Property::Index propertyScrollContentSize = sourceActor.RegisterProperty("sourceContentSize", 500.0f);
- DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "sourcePosition" ), propertyScrollPosition, TEST_LOCATION );
- DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "sourcePositionMin" ), propertyMinScrollPosition, TEST_LOCATION );
- DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "sourcePositionMax" ), propertyMaxScrollPosition, TEST_LOCATION );
- DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "sourceContentSize" ), propertyScrollContentSize, TEST_LOCATION );
+ DALI_TEST_EQUALS(sourceActor.GetPropertyIndex("sourcePosition"), propertyScrollPosition, TEST_LOCATION);
+ DALI_TEST_EQUALS(sourceActor.GetPropertyIndex("sourcePositionMin"), propertyMinScrollPosition, TEST_LOCATION);
+ DALI_TEST_EQUALS(sourceActor.GetPropertyIndex("sourcePositionMax"), propertyMaxScrollPosition, TEST_LOCATION);
+ DALI_TEST_EQUALS(sourceActor.GetPropertyIndex("sourceContentSize"), propertyScrollContentSize, TEST_LOCATION);
// Set the source of the scroll position properties.
scrollBar.SetScrollPropertySource(sourceActor, propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
// Perform a swipe gesture on the scroll bar but not on the indicator
PerformGestureSwipe(application, Vector2(1.0f, 780.0f), Vector2(Vector2::YAXIS * -1.0f), 20, 2000);
- DALI_TEST_EQUALS( gOnPanFinishedCalled, false, TEST_LOCATION );
- DALI_TEST_EQUALS( panFinished, false, TEST_LOCATION );
+ DALI_TEST_EQUALS(gOnPanFinishedCalled, false, TEST_LOCATION);
+ DALI_TEST_EQUALS(panFinished, false, TEST_LOCATION);
// Perform a swipe gesture on the indicator
PerformGestureSwipe(application, Vector2(1.0f, 1.0f), Vector2(Vector2::YAXIS * 1.0f), 20, 4000);
- DALI_TEST_EQUALS( gOnPanFinishedCalled, true, TEST_LOCATION );
- DALI_TEST_EQUALS( panFinished, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gOnPanFinishedCalled, true, TEST_LOCATION);
+ DALI_TEST_EQUALS(panFinished, true, TEST_LOCATION);
END_TEST;
}
// Create a vertical scroll bar
ScrollBar scrollBar = ScrollBar::New(ScrollBar::VERTICAL);
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
- scrollBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- scrollBar.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, 800.0f, 0.0f) );
+ scrollBar.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ scrollBar.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ scrollBar.SetProperty(Actor::Property::SIZE, Vector3(20.0f, 800.0f, 0.0f));
- application.GetScene().Add( scrollBar );
+ application.GetScene().Add(scrollBar);
ConnectionTracker connectionTracker;
// Connect to the ScrollPositionIntervalReached signal
bool intervalReached = false;
- scrollBar.ScrollPositionIntervalReachedSignal().Connect( &OnScrollPositionIntervalReached );
- scrollBar.ConnectSignal( &connectionTracker, "scrollPositionIntervalReached", CallbackFunctor(&intervalReached));
+ scrollBar.ScrollPositionIntervalReachedSignal().Connect(&OnScrollPositionIntervalReached);
+ scrollBar.ConnectSignal(&connectionTracker, "scrollPositionIntervalReached", CallbackFunctor(&intervalReached));
// Render and notify
application.SendNotification();
// Create a source actor that owns the scroll properties required by the scroll bar
Actor sourceActor = Actor::New();
- application.GetScene().Add( sourceActor );
+ application.GetScene().Add(sourceActor);
// Register the scroll properties
- Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "sourcePosition", 0.0f );
- Property::Index propertyMinScrollPosition = sourceActor.RegisterProperty( "sourcePositionMin", 0.0f );
- Property::Index propertyMaxScrollPosition = sourceActor.RegisterProperty( "sourcePositionMax", 800.0f );
- Property::Index propertyScrollContentSize = sourceActor.RegisterProperty( "sourceContentSize", 2000.0f );
+ Property::Index propertyScrollPosition = sourceActor.RegisterProperty("sourcePosition", 0.0f);
+ Property::Index propertyMinScrollPosition = sourceActor.RegisterProperty("sourcePositionMin", 0.0f);
+ Property::Index propertyMaxScrollPosition = sourceActor.RegisterProperty("sourcePositionMax", 800.0f);
+ Property::Index propertyScrollContentSize = sourceActor.RegisterProperty("sourceContentSize", 2000.0f);
- DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "sourcePosition" ), propertyScrollPosition, TEST_LOCATION );
- DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "sourcePositionMin" ), propertyMinScrollPosition, TEST_LOCATION );
- DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "sourcePositionMax" ), propertyMaxScrollPosition, TEST_LOCATION );
- DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "sourceContentSize" ), propertyScrollContentSize, TEST_LOCATION );
+ DALI_TEST_EQUALS(sourceActor.GetPropertyIndex("sourcePosition"), propertyScrollPosition, TEST_LOCATION);
+ DALI_TEST_EQUALS(sourceActor.GetPropertyIndex("sourcePositionMin"), propertyMinScrollPosition, TEST_LOCATION);
+ DALI_TEST_EQUALS(sourceActor.GetPropertyIndex("sourcePositionMax"), propertyMaxScrollPosition, TEST_LOCATION);
+ DALI_TEST_EQUALS(sourceActor.GetPropertyIndex("sourceContentSize"), propertyScrollContentSize, TEST_LOCATION);
// Set the source of the scroll position properties.
scrollBar.SetScrollPropertySource(sourceActor, propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
// Set the values to get notified when the scroll positions of the source actor goes above or below these values
Dali::Vector<float> positionIntervals;
- for( size_t i = 0; i != 10; ++i )
+ for(size_t i = 0; i != 10; ++i)
{
- positionIntervals.PushBack( -80.0f * i ); // should get notified for each 80 pixels
+ positionIntervals.PushBack(-80.0f * i); // should get notified for each 80 pixels
}
scrollBar.SetScrollPositionIntervals(positionIntervals);
// Animate the scroll position to cross the specified value
Animation animation = Animation::New(0.1f);
- animation.AnimateTo( Property( sourceActor, propertyScrollPosition ), -85.0f );
+ animation.AnimateTo(Property(sourceActor, propertyScrollPosition), -85.0f);
animation.Play();
// Wait for 0.1 second
Wait(application, 100);
// Check that the signal callback is called
- DALI_TEST_EQUALS( gOnScrollPositionIntervalReachedSignalCalled, true, TEST_LOCATION );
- DALI_TEST_EQUALS( intervalReached, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gOnScrollPositionIntervalReachedSignalCalled, true, TEST_LOCATION);
+ DALI_TEST_EQUALS(intervalReached, true, TEST_LOCATION);
// Reset the flag
gOnScrollPositionIntervalReachedSignalCalled = false;
- intervalReached = false;
+ intervalReached = false;
// Rest and clear the animation
animation.Clear();
// Animate the scroll position to cross another specified value
animation = Animation::New(0.1f);
- animation.AnimateTo( Property( sourceActor, propertyScrollPosition ), -170.0f );
+ animation.AnimateTo(Property(sourceActor, propertyScrollPosition), -170.0f);
animation.Play();
// Wait for 0.1 second
Wait(application, 100);
// Check that the signal callback is called
- DALI_TEST_EQUALS( gOnScrollPositionIntervalReachedSignalCalled, true, TEST_LOCATION );
- DALI_TEST_EQUALS( intervalReached, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gOnScrollPositionIntervalReachedSignalCalled, true, TEST_LOCATION);
+ DALI_TEST_EQUALS(intervalReached, true, TEST_LOCATION);
// Reset the flag
gOnScrollPositionIntervalReachedSignalCalled = false;
- intervalReached = false;
+ intervalReached = false;
// Rest and clear the animation
animation.Clear();
// Animate the scroll position back to the previous value
animation = Animation::New(0.1f);
- animation.AnimateTo( Property( sourceActor, propertyScrollPosition ), -85.0f );
+ animation.AnimateTo(Property(sourceActor, propertyScrollPosition), -85.0f);
animation.Play();
// Wait for 0.1 second
Wait(application, 100);
// Check that the signal callback is called
- DALI_TEST_EQUALS( gOnScrollPositionIntervalReachedSignalCalled, true, TEST_LOCATION );
- DALI_TEST_EQUALS( intervalReached, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gOnScrollPositionIntervalReachedSignalCalled, true, TEST_LOCATION);
+ DALI_TEST_EQUALS(intervalReached, true, TEST_LOCATION);
END_TEST;
}
// Create a vertical scroll bar
ScrollBar scrollBar = ScrollBar::New(ScrollBar::VERTICAL);
- DALI_TEST_CHECK( scrollBar );
+ DALI_TEST_CHECK(scrollBar);
- scrollBar.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- scrollBar.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- scrollBar.SetProperty( Actor::Property::SIZE, Vector3(20.0f, 800.0f, 0.0f) );
+ scrollBar.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ scrollBar.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ scrollBar.SetProperty(Actor::Property::SIZE, Vector3(20.0f, 800.0f, 0.0f));
- application.GetScene().Add( scrollBar );
+ application.GetScene().Add(scrollBar);
// Connect to the ScrollPositionIntervalReached signal
- scrollBar.ScrollPositionIntervalReachedSignal().Connect( &OnScrollPositionIntervalReached );
+ scrollBar.ScrollPositionIntervalReachedSignal().Connect(&OnScrollPositionIntervalReached);
// Render and notify
application.SendNotification();
// Create a source actor that owns the scroll properties required by the scroll bar
Actor sourceActor = Actor::New();
- application.GetScene().Add( sourceActor );
+ application.GetScene().Add(sourceActor);
// Register the scroll properties
- Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "sourcePosition", 0.0f );
- Property::Index propertyMinScrollPosition = sourceActor.RegisterProperty( "sourcePositionMin", 0.0f );
- Property::Index propertyMaxScrollPosition = sourceActor.RegisterProperty( "sourcePositionMax", 800.0f );
- Property::Index propertyScrollContentSize = sourceActor.RegisterProperty( "sourceContentSize", 2000.0f );
+ Property::Index propertyScrollPosition = sourceActor.RegisterProperty("sourcePosition", 0.0f);
+ Property::Index propertyMinScrollPosition = sourceActor.RegisterProperty("sourcePositionMin", 0.0f);
+ Property::Index propertyMaxScrollPosition = sourceActor.RegisterProperty("sourcePositionMax", 800.0f);
+ Property::Index propertyScrollContentSize = sourceActor.RegisterProperty("sourceContentSize", 2000.0f);
- DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "sourcePosition" ), propertyScrollPosition, TEST_LOCATION );
- DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "sourcePositionMin" ), propertyMinScrollPosition, TEST_LOCATION );
- DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "sourcePositionMax" ), propertyMaxScrollPosition, TEST_LOCATION );
- DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "sourceContentSize" ), propertyScrollContentSize, TEST_LOCATION );
+ DALI_TEST_EQUALS(sourceActor.GetPropertyIndex("sourcePosition"), propertyScrollPosition, TEST_LOCATION);
+ DALI_TEST_EQUALS(sourceActor.GetPropertyIndex("sourcePositionMin"), propertyMinScrollPosition, TEST_LOCATION);
+ DALI_TEST_EQUALS(sourceActor.GetPropertyIndex("sourcePositionMax"), propertyMaxScrollPosition, TEST_LOCATION);
+ DALI_TEST_EQUALS(sourceActor.GetPropertyIndex("sourceContentSize"), propertyScrollContentSize, TEST_LOCATION);
// Set the source of the scroll position properties.
scrollBar.SetScrollPropertySource(sourceActor, propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
// Set the values to get notified when the scroll positions of the source actor goes above or below these values
Dali::Vector<float> positionIntervals;
- for( size_t i = 0; i != 10; ++i )
+ for(size_t i = 0; i != 10; ++i)
{
- positionIntervals.PushBack( -80.0f * i ); // should get notified for each 80 pixels
+ positionIntervals.PushBack(-80.0f * i); // should get notified for each 80 pixels
}
scrollBar.SetScrollPositionIntervals(positionIntervals);
// Animate the scroll position not to cross the specified value
Animation animation = Animation::New(0.1f);
- animation.AnimateTo( Property( sourceActor, propertyScrollPosition ), -70.0f );
+ animation.AnimateTo(Property(sourceActor, propertyScrollPosition), -70.0f);
animation.Play();
// Wait for 0.1 second
Wait(application, 100);
// Check that the signal callback is not called
- DALI_TEST_EQUALS( gOnScrollPositionIntervalReachedSignalCalled, false, TEST_LOCATION );
+ DALI_TEST_EQUALS(gOnScrollPositionIntervalReachedSignalCalled, false, TEST_LOCATION);
// Rest and clear the animation
animation.Clear();
// Animate the scroll position to cross another specified value
animation = Animation::New(0.1f);
- animation.AnimateTo( Property( sourceActor, propertyScrollPosition ), -85.0f );
+ animation.AnimateTo(Property(sourceActor, propertyScrollPosition), -85.0f);
animation.Play();
// Wait for 0.1 second
Wait(application, 100);
// Check that the signal callback is called
- DALI_TEST_EQUALS( gOnScrollPositionIntervalReachedSignalCalled, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(gOnScrollPositionIntervalReachedSignalCalled, true, TEST_LOCATION);
END_TEST;
}
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
-#include <stdlib.h>
#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/wheel-event-integ.h>
+#include <stdlib.h>
+#include <iostream>
using namespace Dali;
using namespace Toolkit;
struct CallbackFunctor
{
CallbackFunctor(bool* callbackFlag)
- : mCallbackFlag( callbackFlag )
+ : mCallbackFlag(callbackFlag)
{
}
bool* mCallbackFlag;
};
-const int RENDER_FRAME_INTERVAL = 16; ///< Duration of each frame in ms. (at approx 60FPS)
+const int RENDER_FRAME_INTERVAL = 16; ///< Duration of each frame in ms. (at approx 60FPS)
-const int RENDER_DELAY_SCROLL = 1000; ///< duration to wait for any scroll to complete.
+const int RENDER_DELAY_SCROLL = 1000; ///< duration to wait for any scroll to complete.
// For Clamp Signal testing...
-const float CLAMP_EXCESS_WIDTH = 200.0f; ///< Amount of width that can be panned outside scrollview
-const float CLAMP_EXCESS_HEIGHT = 200.0f; ///< Amount of height that can be panned outside scrollview
-const Vector2 CLAMP_START_SCROLL_POSITION(30.0f, 100.0f); ///< Scroll start position for the Clamping tests.
-const Vector2 CLAMP_TOUCH_START( 100.0f, 100.0f ); ///< Start point to touch from for the Clamping tests.
-const Vector2 CLAMP_TOUCH_MOVEMENT( 5.0f, -5.0f ); ///< Amount to move touch for each frame for the Clamping tests.
-const int CLAMP_GESTURE_FRAMES = 100; ///< Number of Frames to synthesize a gesture for the Clamping tests.
-const Vector3 TEST_ACTOR_POSITION(100.0f, 100.0f, 0.0f); ///< A Test actor position offset (arbitrary value)
-const Vector3 TEST_CONSTRAINT_OFFSET(1.0f, 2.0f, 0.0f); ///< A Test constraint offset (arbitrary value to test effects)
-
-const float DEFAULT_SNAP_OVERSHOOT_DURATION(0.5f); ///< Default overshoot snapping animation time.
-const float DEFAULT_MAX_OVERSHOOT(100.0f); ///< Default maximum allowed overshoot in pixels
-
-const int MAX_FRAMES_TO_TEST_OVERSHOOT = 600; ///< 10 seconds (at 60 frames per second).
-const Vector2 OVERSHOOT_START_SCROLL_POSITION(100.0f, 100.0f); ///< Scroll start position for the Overshoot tests.
-const float SCROLL_ANIMATION_DURATION(0.33f); ///< Duration of scroll animation in Overshoot tests (i.e. 100 pixels of overshoot in the speed of 500 pixels per 100 frames, 100/(500/(100/60)) = 0.33)
-const Vector2 SNAP_POSITION_WITH_DECELERATED_VELOCITY(74.0f, 74.0f); ///< the snap position for Overshoot tests with the decelerated velocity (i.e. Decelerated from 500 pixels per 100 frames).
-const float TEST_CUSTOM1_SNAP_OVERSHOOT_DURATION = 0.05f; ///< a Test duration
-const float TEST_CUSTOM2_SNAP_OVERSHOOT_DURATION = 1.5f; ///< another Test duration
-const float TEST_CUSTOM3_SNAP_OVERSHOOT_DURATION = TEST_CUSTOM2_SNAP_OVERSHOOT_DURATION * 0.5f; // Same as above, but different alpha function.
-const float TIME_TOLERANCE = 0.05f; ///< Allow testing tolerance between a 10th of second (+/- 3 frames)
-
+const float CLAMP_EXCESS_WIDTH = 200.0f; ///< Amount of width that can be panned outside scrollview
+const float CLAMP_EXCESS_HEIGHT = 200.0f; ///< Amount of height that can be panned outside scrollview
+const Vector2 CLAMP_START_SCROLL_POSITION(30.0f, 100.0f); ///< Scroll start position for the Clamping tests.
+const Vector2 CLAMP_TOUCH_START(100.0f, 100.0f); ///< Start point to touch from for the Clamping tests.
+const Vector2 CLAMP_TOUCH_MOVEMENT(5.0f, -5.0f); ///< Amount to move touch for each frame for the Clamping tests.
+const int CLAMP_GESTURE_FRAMES = 100; ///< Number of Frames to synthesize a gesture for the Clamping tests.
+const Vector3 TEST_ACTOR_POSITION(100.0f, 100.0f, 0.0f); ///< A Test actor position offset (arbitrary value)
+const Vector3 TEST_CONSTRAINT_OFFSET(1.0f, 2.0f, 0.0f); ///< A Test constraint offset (arbitrary value to test effects)
+
+const float DEFAULT_SNAP_OVERSHOOT_DURATION(0.5f); ///< Default overshoot snapping animation time.
+const float DEFAULT_MAX_OVERSHOOT(100.0f); ///< Default maximum allowed overshoot in pixels
+
+const int MAX_FRAMES_TO_TEST_OVERSHOOT = 600; ///< 10 seconds (at 60 frames per second).
+const Vector2 OVERSHOOT_START_SCROLL_POSITION(100.0f, 100.0f); ///< Scroll start position for the Overshoot tests.
+const float SCROLL_ANIMATION_DURATION(0.33f); ///< Duration of scroll animation in Overshoot tests (i.e. 100 pixels of overshoot in the speed of 500 pixels per 100 frames, 100/(500/(100/60)) = 0.33)
+const Vector2 SNAP_POSITION_WITH_DECELERATED_VELOCITY(74.0f, 74.0f); ///< the snap position for Overshoot tests with the decelerated velocity (i.e. Decelerated from 500 pixels per 100 frames).
+const float TEST_CUSTOM1_SNAP_OVERSHOOT_DURATION = 0.05f; ///< a Test duration
+const float TEST_CUSTOM2_SNAP_OVERSHOOT_DURATION = 1.5f; ///< another Test duration
+const float TEST_CUSTOM3_SNAP_OVERSHOOT_DURATION = TEST_CUSTOM2_SNAP_OVERSHOOT_DURATION * 0.5f; // Same as above, but different alpha function.
+const float TIME_TOLERANCE = 0.05f; ///< Allow testing tolerance between a 10th of second (+/- 3 frames)
/*
* Simulate time passed by.
{
int time = 0;
- for(int i = 0; i <= ( duration / RENDER_FRAME_INTERVAL); i++)
+ for(int i = 0; i <= (duration / RENDER_FRAME_INTERVAL); i++)
{
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
// Callback probes.
-static bool gOnScrollStartCalled; ///< Whether the OnScrollStart signal was invoked.
-static bool gOnScrollUpdateCalled; ///< Whether the OnScrollUpdate signal was invoked.
-static bool gOnScrollCompleteCalled; ///< Whether the OnScrollComplete signal was invoked.
-static bool gOnSnapStartCalled; ///< Whether the OnSnapStart signal was invoked.
-static bool gOnWheelEventCalled; ///< Whether the WheelEventSignal signal was invoked.
-static SnapType gLastSnapType; ///< Snaping information from SnapEvent.
-static Vector3 gConstraintResult; ///< Result from constraint.
+static bool gOnScrollStartCalled; ///< Whether the OnScrollStart signal was invoked.
+static bool gOnScrollUpdateCalled; ///< Whether the OnScrollUpdate signal was invoked.
+static bool gOnScrollCompleteCalled; ///< Whether the OnScrollComplete signal was invoked.
+static bool gOnSnapStartCalled; ///< Whether the OnSnapStart signal was invoked.
+static bool gOnWheelEventCalled; ///< Whether the WheelEventSignal signal was invoked.
+static SnapType gLastSnapType; ///< Snaping information from SnapEvent.
+static Vector3 gConstraintResult; ///< Result from constraint.
/**
* Invoked when scrolling starts.
*
* @param[in] position The current scroll position.
*/
-static void OnScrollStart( const Vector2& position )
+static void OnScrollStart(const Vector2& position)
{
gOnScrollStartCalled = true;
}
*
* @param[in] position The current scroll position.
*/
-static void OnScrollUpdate( const Vector2& position )
+static void OnScrollUpdate(const Vector2& position)
{
gOnScrollUpdateCalled = true;
}
*
* @param[in] position The current scroll position.
*/
-static void OnScrollComplete( const Vector2& position )
+static void OnScrollComplete(const Vector2& position)
{
gOnScrollCompleteCalled = true;
}
*
* @param[in] event The type of snap and the target position/scale/rotation.
*/
-static void OnSnapStart( const ScrollView::SnapEvent& event )
+static void OnSnapStart(const ScrollView::SnapEvent& event)
{
gOnSnapStartCalled = true;
- gLastSnapType = event.type;
+ gLastSnapType = event.type;
}
/**
* @param[in] event The wheel event
* @return True if the event should be consumed
*/
-static bool OnWheelEvent( Actor actor, const Dali::WheelEvent& wheelEvent )
+static bool OnWheelEvent(Actor actor, const Dali::WheelEvent& wheelEvent)
{
gOnWheelEventCalled = true;
return false;
* @param[in] offset The offset to be added to current.
*/
TestSumConstraint(const Vector3& offset)
- :mOffset(offset)
+ : mOffset(offset)
{
}
* @param[in] inputs Contains the property to be added to current.
* @return The new current Vector.
*/
- void operator()( Vector3& current, const PropertyInputContainer& inputs )
+ void operator()(Vector3& current, const PropertyInputContainer& inputs)
{
gConstraintResult = current + Vector3(inputs[0]->GetVector2()) + mOffset;
- current = gConstraintResult;
+ current = gConstraintResult;
}
Vector3 mOffset;
-
};
/**
* @param[in] scrollView The scrollView instance
* @return The time taken for the overshoot to reach origin (zero)
*/
-static float TestOvershootSnapDuration(ToolkitTestApplication &application, ScrollView scrollView)
+static float TestOvershootSnapDuration(ToolkitTestApplication& application, ScrollView scrollView)
{
int timeToReachOrigin = -1;
- for(int i = 0;i<MAX_FRAMES_TO_TEST_OVERSHOOT;i++)
+ for(int i = 0; i < MAX_FRAMES_TO_TEST_OVERSHOOT; i++)
{
- float overshootXValue = scrollView.GetCurrentProperty<float>( ScrollView::Property::OVERSHOOT_X );
- float overshootYValue = scrollView.GetCurrentProperty<float>( ScrollView::Property::OVERSHOOT_Y );
+ float overshootXValue = scrollView.GetCurrentProperty<float>(ScrollView::Property::OVERSHOOT_X);
+ float overshootYValue = scrollView.GetCurrentProperty<float>(ScrollView::Property::OVERSHOOT_Y);
if(overshootXValue == 0.0f && overshootYValue == 0.0f)
{
break;
*/
float TestAlphaFunction(float progress)
{
- return std::min( progress * 2.0f, 1.0f );
+ return std::min(progress * 2.0f, 1.0f);
}
/**
*/
static Vector2 PerformGestureSwipe(ToolkitTestApplication& application, Vector2 start, Vector2 direction, int frames, uint32_t& time, bool finish = true)
{
- gOnScrollStartCalled = false;
- gOnScrollUpdateCalled = false;
+ gOnScrollStartCalled = false;
+ gOnScrollUpdateCalled = false;
gOnScrollCompleteCalled = false;
- gOnSnapStartCalled = false;
+ gOnSnapStartCalled = false;
- Vector2 pos( start );
+ Vector2 pos(start);
// This is created to ensure a pan is started
- Vector2 pos_start_jump( start + Vector2(11.0f, 11.0f) );
- TestStartPan( application, start, pos_start_jump, time );
+ Vector2 pos_start_jump(start + Vector2(11.0f, 11.0f));
+ TestStartPan(application, start, pos_start_jump, time);
pos = pos_start_jump;
Wait(application);
- for(int i = 0;i<frames;i++)
+ for(int i = 0; i < frames; i++)
{
pos += direction; // Move in this direction
- TestMovePan(application, pos, time );
+ TestMovePan(application, pos, time);
time += Wait(application);
}
if(finish)
{
pos += direction; // Move in this direction.
- TestEndPan(application, pos, time );
+ TestEndPan(application, pos, time);
time += Wait(application, RENDER_DELAY_SCROLL);
}
return pos;
}
-
} // unnamed namespace
-
int UtcDaliToolkitScrollViewConstructorP(void)
{
ToolkitTestApplication application;
ScrollView scrollView;
- DALI_TEST_CHECK( !scrollView );
+ DALI_TEST_CHECK(!scrollView);
END_TEST;
}
ToolkitTestApplication application;
ScrollView scrollView = ScrollView::New();
- scrollView.SetProperty( ScrollView::Property::SCROLL_POSITION, Vector2(10.0f, 10.0f) );
+ scrollView.SetProperty(ScrollView::Property::SCROLL_POSITION, Vector2(10.0f, 10.0f));
- ScrollView copy( scrollView );
- DALI_TEST_CHECK( copy );
- DALI_TEST_CHECK( copy.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ) == scrollView.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ) );
+ ScrollView copy(scrollView);
+ DALI_TEST_CHECK(copy);
+ DALI_TEST_CHECK(copy.GetProperty<Vector2>(ScrollView::Property::SCROLL_POSITION) == scrollView.GetProperty<Vector2>(ScrollView::Property::SCROLL_POSITION));
END_TEST;
}
ToolkitTestApplication application;
ScrollView scrollView = ScrollView::New();
- DALI_TEST_EQUALS( 1, scrollView.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- scrollView.SetProperty( ScrollView::Property::SCROLL_POSITION, Vector2(10.0f, 10.0f) );
- DALI_TEST_EQUALS( scrollView.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ), Vector2(10.0f, 10.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(1, scrollView.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ scrollView.SetProperty(ScrollView::Property::SCROLL_POSITION, Vector2(10.0f, 10.0f));
+ DALI_TEST_EQUALS(scrollView.GetProperty<Vector2>(ScrollView::Property::SCROLL_POSITION), Vector2(10.0f, 10.0f), TEST_LOCATION);
- ScrollView moved = std::move( scrollView );
- DALI_TEST_CHECK( moved );
- DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_EQUALS( moved.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ), Vector2(10.0f, 10.0f), TEST_LOCATION );
- DALI_TEST_CHECK( !scrollView );
+ ScrollView moved = std::move(scrollView);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_EQUALS(moved.GetProperty<Vector2>(ScrollView::Property::SCROLL_POSITION), Vector2(10.0f, 10.0f), TEST_LOCATION);
+ DALI_TEST_CHECK(!scrollView);
END_TEST;
}
ToolkitTestApplication application;
ScrollView scrollView = ScrollView::New();
- scrollView.SetProperty( ScrollView::Property::SCROLL_POSITION, Vector2(10.0f, 10.0f) );
+ scrollView.SetProperty(ScrollView::Property::SCROLL_POSITION, Vector2(10.0f, 10.0f));
ScrollView copy;
copy = scrollView;
- DALI_TEST_CHECK( copy );
- DALI_TEST_CHECK( copy.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ) == scrollView.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ) );
+ DALI_TEST_CHECK(copy);
+ DALI_TEST_CHECK(copy.GetProperty<Vector2>(ScrollView::Property::SCROLL_POSITION) == scrollView.GetProperty<Vector2>(ScrollView::Property::SCROLL_POSITION));
END_TEST;
}
ToolkitTestApplication application;
ScrollView scrollView = ScrollView::New();
- DALI_TEST_EQUALS( 1, scrollView.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- scrollView.SetProperty( ScrollView::Property::SCROLL_POSITION, Vector2(10.0f, 10.0f) );
- DALI_TEST_EQUALS( scrollView.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ), Vector2(10.0f, 10.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(1, scrollView.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ scrollView.SetProperty(ScrollView::Property::SCROLL_POSITION, Vector2(10.0f, 10.0f));
+ DALI_TEST_EQUALS(scrollView.GetProperty<Vector2>(ScrollView::Property::SCROLL_POSITION), Vector2(10.0f, 10.0f), TEST_LOCATION);
ScrollView moved;
- moved = std::move( scrollView );
- DALI_TEST_CHECK( moved );
- DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_EQUALS( moved.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ), Vector2(10.0f, 10.0f), TEST_LOCATION );
- DALI_TEST_CHECK( !scrollView );
+ moved = std::move(scrollView);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_EQUALS(moved.GetProperty<Vector2>(ScrollView::Property::SCROLL_POSITION), Vector2(10.0f, 10.0f), TEST_LOCATION);
+ DALI_TEST_CHECK(!scrollView);
END_TEST;
}
ScrollView* scrollView = new ScrollView();
delete scrollView;
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
END_TEST;
}
ScrollView scrollView;
- DALI_TEST_CHECK( !scrollView );
+ DALI_TEST_CHECK(!scrollView);
scrollView = ScrollView::New();
- DALI_TEST_CHECK( scrollView );
+ DALI_TEST_CHECK(scrollView);
ScrollView scrollView2(scrollView);
- DALI_TEST_CHECK( scrollView2 == scrollView );
+ DALI_TEST_CHECK(scrollView2 == scrollView);
//Additional check to ensure object is created by checking if it's registered
ObjectRegistry registry = application.GetCore().GetObjectRegistry();
- DALI_TEST_CHECK( registry );
+ DALI_TEST_CHECK(registry);
gObjectCreatedCallBackCalled = false;
- registry.ObjectCreatedSignal().Connect( &TestCallback );
+ registry.ObjectCreatedSignal().Connect(&TestCallback);
{
ScrollView scrollView = ScrollView::New();
}
- DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
+ DALI_TEST_CHECK(gObjectCreatedCallBackCalled);
END_TEST;
}
tet_infoline(" UtcDaliToolkitScrollViewNewP2 - create thru type registry");
ScrollView scrollView;
- DALI_TEST_CHECK( !scrollView );
+ DALI_TEST_CHECK(!scrollView);
- TypeRegistry typeRegistry = TypeRegistry::Get();
- TypeInfo scrollViewType = typeRegistry.GetTypeInfo("ScrollView");
- BaseHandle handle = scrollViewType.CreateInstance();
- DALI_TEST_CHECK( handle );
+ TypeRegistry typeRegistry = TypeRegistry::Get();
+ TypeInfo scrollViewType = typeRegistry.GetTypeInfo("ScrollView");
+ BaseHandle handle = scrollViewType.CreateInstance();
+ DALI_TEST_CHECK(handle);
scrollView = ScrollView::DownCast(handle);
- DALI_TEST_CHECK( scrollView );
+ DALI_TEST_CHECK(scrollView);
END_TEST;
}
ScrollView scrollView = ScrollView::New();
BaseHandle handle(scrollView);
- ScrollView newScrollView = ScrollView::DownCast( handle );
- DALI_TEST_CHECK( scrollView );
- DALI_TEST_CHECK( newScrollView == scrollView );
+ ScrollView newScrollView = ScrollView::DownCast(handle);
+ DALI_TEST_CHECK(scrollView);
+ DALI_TEST_CHECK(newScrollView == scrollView);
END_TEST;
}
// Create the ScrollView actor
ScrollView scrollView = ScrollView::New();
- application.GetScene().Add( scrollView );
+ application.GetScene().Add(scrollView);
- const Vector2 target = Vector2(100.0f, 200.0f);
+ const Vector2 target = Vector2(100.0f, 200.0f);
const Vector2 target2 = Vector2(300.0f, 100.0f);
- scrollView.ScrollTo( target, 0.0f );
+ scrollView.ScrollTo(target, 0.0f);
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target, TEST_LOCATION );
- scrollView.ScrollTo( target2 );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), target, TEST_LOCATION);
+ scrollView.ScrollTo(target2);
Wait(application, RENDER_DELAY_SCROLL);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION);
END_TEST;
}
tet_infoline(" UtcDaliToolkitScrollViewScrollToPositionWithDirectionBiasP");
ScrollView scrollView = ScrollView::New();
- application.GetScene().Add( scrollView );
- RulerPtr rulerX = new FixedRuler( 100.0f );
- rulerX->SetDomain( RulerDomain(0.0f, 200.0f, true) );
- RulerPtr rulerY = new FixedRuler( 100.0f );
- rulerY->SetDomain( RulerDomain(0.0f, 200.0f, true) );
+ application.GetScene().Add(scrollView);
+ RulerPtr rulerX = new FixedRuler(100.0f);
+ rulerX->SetDomain(RulerDomain(0.0f, 200.0f, true));
+ RulerPtr rulerY = new FixedRuler(100.0f);
+ rulerY->SetDomain(RulerDomain(0.0f, 200.0f, true));
- scrollView.SetRulerX( rulerX );
- scrollView.SetRulerY( rulerY );
+ scrollView.SetRulerX(rulerX);
+ scrollView.SetRulerY(rulerY);
scrollView.SetWrapMode(true);
- Property::Value wrapMode = scrollView.GetProperty( Toolkit::ScrollView::Property::WRAP_ENABLED );
- DALI_TEST_EQUALS( wrapMode.Get<bool>(), true, TEST_LOCATION );
+ Property::Value wrapMode = scrollView.GetProperty(Toolkit::ScrollView::Property::WRAP_ENABLED);
+ DALI_TEST_EQUALS(wrapMode.Get<bool>(), true, TEST_LOCATION);
- const Vector2 target = Vector2(50.0f, 50.0f);
+ const Vector2 target = Vector2(50.0f, 50.0f);
const Vector2 target2 = Vector2(150.0f, 150.0f);
- scrollView.ScrollTo( target, 0.0f );
+ scrollView.ScrollTo(target, 0.0f);
Wait(application, RENDER_DELAY_SCROLL);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), target, TEST_LOCATION);
- scrollView.ScrollTo( target2, 0.25f, Dali::Toolkit::DIRECTION_BIAS_LEFT, Dali::Toolkit::DIRECTION_BIAS_LEFT );
+ scrollView.ScrollTo(target2, 0.25f, Dali::Toolkit::DIRECTION_BIAS_LEFT, Dali::Toolkit::DIRECTION_BIAS_LEFT);
Wait(application, RENDER_DELAY_SCROLL);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION);
- scrollView.ScrollTo( target, 0.0f );
+ scrollView.ScrollTo(target, 0.0f);
Wait(application, RENDER_DELAY_SCROLL);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), target, TEST_LOCATION);
- scrollView.ScrollTo( target2, 0.25f, Dali::Toolkit::DIRECTION_BIAS_RIGHT, Dali::Toolkit::DIRECTION_BIAS_RIGHT );
+ scrollView.ScrollTo(target2, 0.25f, Dali::Toolkit::DIRECTION_BIAS_RIGHT, Dali::Toolkit::DIRECTION_BIAS_RIGHT);
Wait(application, RENDER_DELAY_SCROLL);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION);
END_TEST;
}
// Create the ScrollView actor
ScrollView scrollView = ScrollView::New();
- application.GetScene().Add( scrollView );
+ application.GetScene().Add(scrollView);
- const Vector2 target = Vector2(100.0f, 200.0f);
+ const Vector2 target = Vector2(100.0f, 200.0f);
const Vector2 target2 = Vector2(300.0f, 100.0f);
- scrollView.ScrollTo( target, 0.5f, TestAlphaFunction );
+ scrollView.ScrollTo(target, 0.5f, TestAlphaFunction);
Wait(application, 250);
// Check that the scroll animation should finish within just half of the specified duration with the above alpha function
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), target, TEST_LOCATION);
- scrollView.ScrollTo( target2, 0.5f, AlphaFunction::LINEAR );
+ scrollView.ScrollTo(target2, 0.5f, AlphaFunction::LINEAR);
Wait(application, 250);
// Check that the scroll animation has not finished within half of the specified duration with the linear alpha function
- DALI_TEST_CHECK( scrollView.GetCurrentScrollPosition() != target2 );
+ DALI_TEST_CHECK(scrollView.GetCurrentScrollPosition() != target2);
// Wait till the end of the specified duration
Wait(application, 250);
// Check that the scroll animation has finished
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION);
END_TEST;
}
tet_infoline(" UtcDaliToolkitScrollViewScrollToPositionWithAlphaFunctionAndDirectionBiasP");
ScrollView scrollView = ScrollView::New();
- application.GetScene().Add( scrollView );
- RulerPtr rulerX = new FixedRuler( 100.0f );
- rulerX->SetDomain( RulerDomain(0.0f, 200.0f, true) );
- RulerPtr rulerY = new FixedRuler( 100.0f );
- rulerY->SetDomain( RulerDomain(0.0f, 200.0f, true) );
+ application.GetScene().Add(scrollView);
+ RulerPtr rulerX = new FixedRuler(100.0f);
+ rulerX->SetDomain(RulerDomain(0.0f, 200.0f, true));
+ RulerPtr rulerY = new FixedRuler(100.0f);
+ rulerY->SetDomain(RulerDomain(0.0f, 200.0f, true));
- scrollView.SetRulerX( rulerX );
- scrollView.SetRulerY( rulerY );
+ scrollView.SetRulerX(rulerX);
+ scrollView.SetRulerY(rulerY);
scrollView.SetWrapMode(true);
- const Vector2 target = Vector2(50.0f, 50.0f);
+ const Vector2 target = Vector2(50.0f, 50.0f);
const Vector2 target2 = Vector2(150.0f, 150.0f);
- scrollView.ScrollTo( target, 0.0f );
+ scrollView.ScrollTo(target, 0.0f);
Wait(application, RENDER_DELAY_SCROLL);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), target, TEST_LOCATION);
- scrollView.ScrollTo( target2, 0.25f, AlphaFunction::LINEAR, Dali::Toolkit::DIRECTION_BIAS_LEFT, Dali::Toolkit::DIRECTION_BIAS_LEFT );
+ scrollView.ScrollTo(target2, 0.25f, AlphaFunction::LINEAR, Dali::Toolkit::DIRECTION_BIAS_LEFT, Dali::Toolkit::DIRECTION_BIAS_LEFT);
Wait(application, RENDER_DELAY_SCROLL);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION);
- scrollView.ScrollTo( target, 0.0f );
+ scrollView.ScrollTo(target, 0.0f);
Wait(application, RENDER_DELAY_SCROLL);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), target, TEST_LOCATION);
- scrollView.ScrollTo( target2, 0.25f, AlphaFunction::LINEAR, Dali::Toolkit::DIRECTION_BIAS_RIGHT, Dali::Toolkit::DIRECTION_BIAS_RIGHT );
+ scrollView.ScrollTo(target2, 0.25f, AlphaFunction::LINEAR, Dali::Toolkit::DIRECTION_BIAS_RIGHT, Dali::Toolkit::DIRECTION_BIAS_RIGHT);
Wait(application, RENDER_DELAY_SCROLL);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION);
- scrollView.ScrollTo( target, 0.0f );
+ scrollView.ScrollTo(target, 0.0f);
Wait(application, RENDER_DELAY_SCROLL);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), target, TEST_LOCATION);
- scrollView.ScrollTo( target2, 0.25f, TestAlphaFunction, Dali::Toolkit::DIRECTION_BIAS_RIGHT, Dali::Toolkit::DIRECTION_BIAS_RIGHT );
+ scrollView.ScrollTo(target2, 0.25f, TestAlphaFunction, Dali::Toolkit::DIRECTION_BIAS_RIGHT, Dali::Toolkit::DIRECTION_BIAS_RIGHT);
Wait(application, 125);
// Check that the scroll animation should finish within just half of the specified duration with the above alpha function
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION);
END_TEST;
}
tet_infoline(" UtcDaliToolkitScrollViewScrollToPageP");
ScrollView scrollView = ScrollView::New();
- application.GetScene().Add( scrollView );
- RulerPtr rulerX = new FixedRuler( 100.0f );
- rulerX->SetDomain( RulerDomain(0.0f, 800.0f, true) );
- RulerPtr rulerY = new FixedRuler( 100.0f );
- rulerY->SetDomain( RulerDomain(0.0f, 400.0f, true) );
+ application.GetScene().Add(scrollView);
+ RulerPtr rulerX = new FixedRuler(100.0f);
+ rulerX->SetDomain(RulerDomain(0.0f, 800.0f, true));
+ RulerPtr rulerY = new FixedRuler(100.0f);
+ rulerY->SetDomain(RulerDomain(0.0f, 400.0f, true));
- scrollView.SetRulerX( rulerX );
- scrollView.SetRulerY( rulerY );
+ scrollView.SetRulerX(rulerX);
+ scrollView.SetRulerY(rulerY);
- scrollView.ScrollTo( 1, 0.0f );
+ scrollView.ScrollTo(1, 0.0f);
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(100.0f, 0.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), Vector2(100.0f, 0.0f), TEST_LOCATION);
- scrollView.ScrollTo( 5, 0.0f );
+ scrollView.ScrollTo(5, 0.0f);
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(500.0f, 0.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), Vector2(500.0f, 0.0f), TEST_LOCATION);
- scrollView.ScrollTo( 10, 0.0f );
+ scrollView.ScrollTo(10, 0.0f);
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(200.0f, 100.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), Vector2(200.0f, 100.0f), TEST_LOCATION);
- scrollView.ScrollTo( 15, 0.0f );
+ scrollView.ScrollTo(15, 0.0f);
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(700.0f, 100.0f), TEST_LOCATION );
- DALI_TEST_EQUALS( static_cast<int>(scrollView.GetCurrentPage()), 15, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), Vector2(700.0f, 100.0f), TEST_LOCATION);
+ DALI_TEST_EQUALS(static_cast<int>(scrollView.GetCurrentPage()), 15, TEST_LOCATION);
- scrollView.ScrollTo( 3 );
+ scrollView.ScrollTo(3);
Wait(application, RENDER_DELAY_SCROLL);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(300.0f, 0.0f), TEST_LOCATION );
- DALI_TEST_EQUALS( static_cast<int>(scrollView.GetCurrentPage()), 3, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), Vector2(300.0f, 0.0f), TEST_LOCATION);
+ DALI_TEST_EQUALS(static_cast<int>(scrollView.GetCurrentPage()), 3, TEST_LOCATION);
- scrollView.ScrollTo( 9 );
+ scrollView.ScrollTo(9);
Wait(application, RENDER_DELAY_SCROLL);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(100.0f, 100.0f), TEST_LOCATION );
- DALI_TEST_EQUALS( static_cast<int>(scrollView.GetCurrentPage()), 9, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), Vector2(100.0f, 100.0f), TEST_LOCATION);
+ DALI_TEST_EQUALS(static_cast<int>(scrollView.GetCurrentPage()), 9, TEST_LOCATION);
// Apply DefaultRulers instead and see what happens.
rulerX = new DefaultRuler();
- rulerX->SetDomain( RulerDomain(0.0f, 800.0f, true) );
+ rulerX->SetDomain(RulerDomain(0.0f, 800.0f, true));
rulerY = new DefaultRuler();
- rulerY->SetDomain( RulerDomain(0.0f, 400.0f, true) );
+ rulerY->SetDomain(RulerDomain(0.0f, 400.0f, true));
- scrollView.SetRulerX( rulerX );
- scrollView.SetRulerY( rulerY );
+ scrollView.SetRulerX(rulerX);
+ scrollView.SetRulerY(rulerY);
// This time should always scroll to origin (0.0f, 0.0f)
- scrollView.ScrollTo( 1, 0.0f );
+ scrollView.ScrollTo(1, 0.0f);
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(0.0f, 0.0f), TEST_LOCATION );
- DALI_TEST_EQUALS( static_cast<int>(scrollView.GetCurrentPage()), 0, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), Vector2(0.0f, 0.0f), TEST_LOCATION);
+ DALI_TEST_EQUALS(static_cast<int>(scrollView.GetCurrentPage()), 0, TEST_LOCATION);
END_TEST;
}
-
int UtcDaliToolkitScrollModeP1(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliToolkitScrollView ScrollMode property" );
+ tet_infoline(" UtcDaliToolkitScrollView ScrollMode property");
// Set up a scrollView.
ScrollView scrollView = ScrollView::New();
// Do not rely on stage size for UTC tests.
- Vector2 viewPageSize( 720.0f, 1280.0f );
- scrollView.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
- scrollView.SetProperty( Actor::Property::SIZE, viewPageSize );
- scrollView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- scrollView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
- scrollView.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, 0.0f, 0.0f ));
+ Vector2 viewPageSize(720.0f, 1280.0f);
+ scrollView.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
+ scrollView.SetProperty(Actor::Property::SIZE, viewPageSize);
+ scrollView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ scrollView.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+ scrollView.SetProperty(Actor::Property::POSITION, Vector3(0.0f, 0.0f, 0.0f));
// Position rulers.
Property::Map rulerMap;
- rulerMap.Add( ScrollMode::X_AXIS_SCROLL_ENABLED, true );
- rulerMap.Add( ScrollMode::X_AXIS_SNAP_TO_INTERVAL, viewPageSize.width );
- rulerMap.Add( ScrollMode::X_AXIS_SCROLL_BOUNDARY, viewPageSize.width*3 );
- rulerMap.Add( ScrollMode::Y_AXIS_SCROLL_ENABLED, false );
- scrollView.SetProperty( ScrollView::Property::SCROLL_MODE, rulerMap);
+ rulerMap.Add(ScrollMode::X_AXIS_SCROLL_ENABLED, true);
+ rulerMap.Add(ScrollMode::X_AXIS_SNAP_TO_INTERVAL, viewPageSize.width);
+ rulerMap.Add(ScrollMode::X_AXIS_SCROLL_BOUNDARY, viewPageSize.width * 3);
+ rulerMap.Add(ScrollMode::Y_AXIS_SCROLL_ENABLED, false);
+ scrollView.SetProperty(ScrollView::Property::SCROLL_MODE, rulerMap);
- scrollView.SetWrapMode( false );
- scrollView.SetScrollSensitive( true );
+ scrollView.SetWrapMode(false);
+ scrollView.SetScrollSensitive(true);
- application.GetScene().Add( scrollView );
+ application.GetScene().Add(scrollView);
// Set up a gesture to perform.
- Vector2 startPos( 50.0f, 0.0f );
- Vector2 direction( -5.0f, 0.0f );
- int frames = 200;
- uint32_t time = 0;
+ Vector2 startPos(50.0f, 0.0f);
+ Vector2 direction(-5.0f, 0.0f);
+ int frames = 200;
+ uint32_t time = 0;
// Force starting position.
- scrollView.ScrollTo( startPos, 0.0f );
- time += Wait( application );
+ scrollView.ScrollTo(startPos, 0.0f);
+ time += Wait(application);
// Deliberately skip the "Finished" part of the gesture, so we can read the coordinates before the snap begins.
- Vector2 currentPos( PerformGestureSwipe( application, startPos, direction, frames - 1, time, false ) );
+ Vector2 currentPos(PerformGestureSwipe(application, startPos, direction, frames - 1, time, false));
// Confirm the final X coord has not moved more than one page from the start X position.
- DALI_TEST_GREATER( ( startPos.x + viewPageSize.width ), scrollView.GetCurrentScrollPosition().x, TEST_LOCATION );
+ DALI_TEST_GREATER((startPos.x + viewPageSize.width), scrollView.GetCurrentScrollPosition().x, TEST_LOCATION);
// Finish the gesture and wait for the snap.
currentPos += direction;
- TestEndPan( application, currentPos, time );
+ TestEndPan(application, currentPos, time);
// We add RENDER_FRAME_INTERVAL on to wait for an extra frame (for the last "finished" gesture to complete first.
- time += Wait( application, RENDER_DELAY_SCROLL + RENDER_FRAME_INTERVAL );
+ time += Wait(application, RENDER_DELAY_SCROLL + RENDER_FRAME_INTERVAL);
// Confirm the final X coord has snapped to exactly one page ahead of the start page.
- DALI_TEST_EQUALS( viewPageSize.width, scrollView.GetCurrentScrollPosition().x, Math::MACHINE_EPSILON_0, TEST_LOCATION );
+ DALI_TEST_EQUALS(viewPageSize.width, scrollView.GetCurrentScrollPosition().x, Math::MACHINE_EPSILON_0, TEST_LOCATION);
// Change scroll mode during pan, should not crash
- PerformGestureSwipe( application, startPos, direction, frames - 1, time, false );
+ PerformGestureSwipe(application, startPos, direction, frames - 1, time, false);
try
{
scrollView.SetScrollSensitive(false);
int UtcDaliToolkitScrollModeP2(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliToolkitScrollView ScrollMode property" );
+ tet_infoline(" UtcDaliToolkitScrollView ScrollMode property");
// Set up a scrollView.
ScrollView scrollView = ScrollView::New();
// Do not rely on stage size for UTC tests.
- Vector2 viewPageSize( 720.0f, 1280.0f );
- scrollView.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
- scrollView.SetProperty( Actor::Property::SIZE, viewPageSize );
- scrollView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- scrollView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
- scrollView.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, 0.0f, 0.0f ));
+ Vector2 viewPageSize(720.0f, 1280.0f);
+ scrollView.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
+ scrollView.SetProperty(Actor::Property::SIZE, viewPageSize);
+ scrollView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ scrollView.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+ scrollView.SetProperty(Actor::Property::POSITION, Vector3(0.0f, 0.0f, 0.0f));
// Position rulers.
Property::Map rulerMap;
- rulerMap.Add( ScrollMode::X_AXIS_SCROLL_ENABLED, false );
- rulerMap.Add( ScrollMode::Y_AXIS_SCROLL_ENABLED, true );
- rulerMap.Add( ScrollMode::Y_AXIS_SNAP_TO_INTERVAL, viewPageSize.height );
- rulerMap.Add( ScrollMode::Y_AXIS_SCROLL_BOUNDARY, viewPageSize.height*3 );
- scrollView.SetProperty( ScrollView::Property::SCROLL_MODE, rulerMap);
+ rulerMap.Add(ScrollMode::X_AXIS_SCROLL_ENABLED, false);
+ rulerMap.Add(ScrollMode::Y_AXIS_SCROLL_ENABLED, true);
+ rulerMap.Add(ScrollMode::Y_AXIS_SNAP_TO_INTERVAL, viewPageSize.height);
+ rulerMap.Add(ScrollMode::Y_AXIS_SCROLL_BOUNDARY, viewPageSize.height * 3);
+ scrollView.SetProperty(ScrollView::Property::SCROLL_MODE, rulerMap);
- scrollView.SetWrapMode( false );
- scrollView.SetScrollSensitive( true );
+ scrollView.SetWrapMode(false);
+ scrollView.SetScrollSensitive(true);
- application.GetScene().Add( scrollView );
+ application.GetScene().Add(scrollView);
// Set up a gesture to perform.
- Vector2 startPos( 0.0f, 50.0f );
- Vector2 direction( 0.0f, -6.0f );
- int frames = 200;
- uint32_t time = 0;
+ Vector2 startPos(0.0f, 50.0f);
+ Vector2 direction(0.0f, -6.0f);
+ int frames = 200;
+ uint32_t time = 0;
// Force starting position.
- scrollView.ScrollTo( startPos, 0.0f );
- time += Wait( application );
+ scrollView.ScrollTo(startPos, 0.0f);
+ time += Wait(application);
// Deliberately skip the "Finished" part of the gesture, so we can read the coordinates before the snap begins.
- Vector2 currentPos( PerformGestureSwipe( application, startPos, direction, frames - 1, time, false ) );
+ Vector2 currentPos(PerformGestureSwipe(application, startPos, direction, frames - 1, time, false));
// Confirm the final X coord has not moved more than one page from the start X position.
- DALI_TEST_GREATER( ( startPos.y + viewPageSize.height ), scrollView.GetCurrentScrollPosition().y, TEST_LOCATION );
+ DALI_TEST_GREATER((startPos.y + viewPageSize.height), scrollView.GetCurrentScrollPosition().y, TEST_LOCATION);
// Finish the gesture and wait for the snap.
currentPos += direction;
- time += Wait( application );
- TestEndPan( application, currentPos, time );
+ time += Wait(application);
+ TestEndPan(application, currentPos, time);
// We add RENDER_FRAME_INTERVAL on to wait for an extra frame (for the last "finished" gesture to complete first.
- Wait( application, RENDER_DELAY_SCROLL + RENDER_FRAME_INTERVAL );
+ Wait(application, RENDER_DELAY_SCROLL + RENDER_FRAME_INTERVAL);
// Confirm the final Y coord has snapped to exactly one page ahead of the start page.
- DALI_TEST_EQUALS( viewPageSize.height, scrollView.GetCurrentScrollPosition().y, Math::MACHINE_EPSILON_0, TEST_LOCATION );
+ DALI_TEST_EQUALS(viewPageSize.height, scrollView.GetCurrentScrollPosition().y, Math::MACHINE_EPSILON_0, TEST_LOCATION);
END_TEST;
}
int UtcDaliToolkitScrollModeP3(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliToolkitScrollView ScrollMode property" );
+ tet_infoline(" UtcDaliToolkitScrollView ScrollMode property");
// Set up a scrollView.
ScrollView scrollView = ScrollView::New();
// Do not rely on stage size for UTC tests.
- Vector2 viewPageSize( 720.0f, 1280.0f );
- scrollView.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
- scrollView.SetProperty( Actor::Property::SIZE, viewPageSize );
- scrollView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- scrollView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
- scrollView.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, 0.0f, 0.0f ));
+ Vector2 viewPageSize(720.0f, 1280.0f);
+ scrollView.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
+ scrollView.SetProperty(Actor::Property::SIZE, viewPageSize);
+ scrollView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ scrollView.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+ scrollView.SetProperty(Actor::Property::POSITION, Vector3(0.0f, 0.0f, 0.0f));
// Position rulers.
Property::Map rulerMap;
- rulerMap.Add( ScrollMode::X_AXIS_SCROLL_ENABLED, false );
- rulerMap.Add( ScrollMode::Y_AXIS_SCROLL_ENABLED, true );
- rulerMap.Add( ScrollMode::Y_AXIS_SNAP_TO_INTERVAL, viewPageSize.height );
- rulerMap.Add( ScrollMode::Y_AXIS_SCROLL_BOUNDARY, viewPageSize.height*3 );
- scrollView.SetProperty( ScrollView::Property::SCROLL_MODE, rulerMap);
+ rulerMap.Add(ScrollMode::X_AXIS_SCROLL_ENABLED, false);
+ rulerMap.Add(ScrollMode::Y_AXIS_SCROLL_ENABLED, true);
+ rulerMap.Add(ScrollMode::Y_AXIS_SNAP_TO_INTERVAL, viewPageSize.height);
+ rulerMap.Add(ScrollMode::Y_AXIS_SCROLL_BOUNDARY, viewPageSize.height * 3);
+ scrollView.SetProperty(ScrollView::Property::SCROLL_MODE, rulerMap);
- scrollView.SetWrapMode( false );
- scrollView.SetScrollSensitive( true );
+ scrollView.SetWrapMode(false);
+ scrollView.SetScrollSensitive(true);
- application.GetScene().Add( scrollView );
+ application.GetScene().Add(scrollView);
// Set up a gesture to perform.
- Vector2 startPos( 0.0f, 50.0f );
- Vector2 direction( 0.0f, -6.0f );
- int frames = 200;
- uint32_t time = 0;
+ Vector2 startPos(0.0f, 50.0f);
+ Vector2 direction(0.0f, -6.0f);
+ int frames = 200;
+ uint32_t time = 0;
// Force starting position.
- scrollView.ScrollTo( startPos, 0.0f );
- time += Wait( application );
+ scrollView.ScrollTo(startPos, 0.0f);
+ time += Wait(application);
// Deliberately skip the "Finished" part of the gesture, so we can read the coordinates before the snap begins.
- Vector2 currentPos( PerformGestureSwipe( application, startPos, direction, frames - 1, time, false ) );
+ Vector2 currentPos(PerformGestureSwipe(application, startPos, direction, frames - 1, time, false));
// Confirm the final X coord has not moved more than one page from the start X position.
- DALI_TEST_GREATER( ( startPos.y + viewPageSize.height ), scrollView.GetCurrentScrollPosition().y, TEST_LOCATION );
+ DALI_TEST_GREATER((startPos.y + viewPageSize.height), scrollView.GetCurrentScrollPosition().y, TEST_LOCATION);
// Finish the gesture and wait for the snap.
currentPos += direction;
- TestEndPan( application, currentPos, time );
+ TestEndPan(application, currentPos, time);
// We add RENDER_FRAME_INTERVAL on to wait for an extra frame (for the last "finished" gesture to complete first.
- Wait( application, RENDER_DELAY_SCROLL + RENDER_FRAME_INTERVAL );
+ Wait(application, RENDER_DELAY_SCROLL + RENDER_FRAME_INTERVAL);
// Confirm the final Y coord has snapped to exactly one page ahead of the start page.
- DALI_TEST_EQUALS( viewPageSize.height, scrollView.GetCurrentScrollPosition().y, Math::MACHINE_EPSILON_0, TEST_LOCATION );
+ DALI_TEST_EQUALS(viewPageSize.height, scrollView.GetCurrentScrollPosition().y, Math::MACHINE_EPSILON_0, TEST_LOCATION);
END_TEST;
}
int UtcDaliToolkitScrollModeP4(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliToolkitScrollView ScrollMode property, DefaultRulers" );
+ tet_infoline(" UtcDaliToolkitScrollView ScrollMode property, DefaultRulers");
// Set up a scrollView.
ScrollView scrollView = ScrollView::New();
// Do not rely on stage size for UTC tests.
- Vector2 viewPageSize( 720.0f, 1280.0f );
- scrollView.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
- scrollView.SetProperty( Actor::Property::SIZE, viewPageSize );
- scrollView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- scrollView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- scrollView.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, 0.0f, 0.0f ));
+ Vector2 viewPageSize(720.0f, 1280.0f);
+ scrollView.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
+ scrollView.SetProperty(Actor::Property::SIZE, viewPageSize);
+ scrollView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ scrollView.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ scrollView.SetProperty(Actor::Property::POSITION, Vector3(0.0f, 0.0f, 0.0f));
// Position rulers - expect Default rulers to be used which don't snap
Property::Map rulerMap;
- rulerMap.Add( ScrollMode::X_AXIS_SCROLL_ENABLED, true );
- rulerMap.Add( ScrollMode::Y_AXIS_SCROLL_ENABLED, true );
- scrollView.SetProperty( ScrollView::Property::SCROLL_MODE, rulerMap);
+ rulerMap.Add(ScrollMode::X_AXIS_SCROLL_ENABLED, true);
+ rulerMap.Add(ScrollMode::Y_AXIS_SCROLL_ENABLED, true);
+ scrollView.SetProperty(ScrollView::Property::SCROLL_MODE, rulerMap);
- scrollView.SetWrapMode( false );
- scrollView.SetScrollSensitive( true );
+ scrollView.SetWrapMode(false);
+ scrollView.SetScrollSensitive(true);
- application.GetScene().Add( scrollView );
+ application.GetScene().Add(scrollView);
Vector2 START_POSITION = Vector2(10.0f, 10.0f);
// Try a vertical swipe.
// PerformGestureSwipe not used as a different initial direction was required
- Vector2 pos( START_POSITION + Vector2(0.0f, 15.0f) );
- Vector2 dir( 0.0f, 1.0f );
+ Vector2 pos(START_POSITION + Vector2(0.0f, 15.0f));
+ Vector2 dir(0.0f, 1.0f);
- TestStartPan( application, START_POSITION, pos, time );
+ TestStartPan(application, START_POSITION, pos, time);
Wait(application);
- for( int i = 0; i<45; i++ )
+ for(int i = 0; i < 45; i++)
{
pos += dir;
- TestMovePan( application, pos, time );
- time += Wait( application );
+ TestMovePan(application, pos, time);
+ time += Wait(application);
}
pos += dir;
- TestEndPan( application, pos, time );
- Wait( application, RENDER_DELAY_SCROLL );
+ TestEndPan(application, pos, time);
+ Wait(application, RENDER_DELAY_SCROLL);
// Take into account resampling done when prediction is off.
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition() - Vector2(0.0f, 0.5f), Vector2(10.0f, -50.0f), 0.25f, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition() - Vector2(0.0f, 0.5f), Vector2(10.0f, -50.0f), 0.25f, TEST_LOCATION);
END_TEST;
}
tet_infoline(" UtcDaliToolkitScrollViewScrollToPageWithDirectionBiasP");
ScrollView scrollView = ScrollView::New();
- application.GetScene().Add( scrollView );
- RulerPtr rulerX = new FixedRuler( 100.0f );
- rulerX->SetDomain( RulerDomain(0.0f, 200.0f, true) );
- RulerPtr rulerY = new FixedRuler( 100.0f );
- rulerY->SetDomain( RulerDomain(0.0f, 200.0f, true) );
+ application.GetScene().Add(scrollView);
+ RulerPtr rulerX = new FixedRuler(100.0f);
+ rulerX->SetDomain(RulerDomain(0.0f, 200.0f, true));
+ RulerPtr rulerY = new FixedRuler(100.0f);
+ rulerY->SetDomain(RulerDomain(0.0f, 200.0f, true));
- scrollView.SetRulerX( rulerX );
- scrollView.SetRulerY( rulerY );
+ scrollView.SetRulerX(rulerX);
+ scrollView.SetRulerY(rulerY);
scrollView.SetWrapMode(true);
- scrollView.ScrollTo( 0, 0.25, Dali::Toolkit::DIRECTION_BIAS_LEFT );
+ scrollView.ScrollTo(0, 0.25, Dali::Toolkit::DIRECTION_BIAS_LEFT);
Wait(application, RENDER_FRAME_INTERVAL); // Wait for one frame
// Check that the scroll position remains the same
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(0.0f, 0.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), Vector2(0.0f, 0.0f), TEST_LOCATION);
Wait(application, RENDER_DELAY_SCROLL); // Wait for one second
// Check that it stays at the same page (i.e. the same scroll position)
- DALI_TEST_EQUALS( static_cast<int>(scrollView.GetCurrentPage()), 0, TEST_LOCATION );
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(0.0f, 0.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(static_cast<int>(scrollView.GetCurrentPage()), 0, TEST_LOCATION);
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), Vector2(0.0f, 0.0f), TEST_LOCATION);
- scrollView.ScrollTo( 0, 0.25, Dali::Toolkit::DIRECTION_BIAS_RIGHT );
+ scrollView.ScrollTo(0, 0.25, Dali::Toolkit::DIRECTION_BIAS_RIGHT);
Wait(application, RENDER_FRAME_INTERVAL); // Wait for one frame
// Check that it scrolls towards the right
- DALI_TEST_CHECK( scrollView.GetCurrentScrollPosition().x > 0.0f );
+ DALI_TEST_CHECK(scrollView.GetCurrentScrollPosition().x > 0.0f);
Wait(application, RENDER_DELAY_SCROLL); // Wait for one second
// Check that it scrolls back to the same page (i.e. the same scroll position)
- DALI_TEST_EQUALS( static_cast<int>(scrollView.GetCurrentPage()), 0, TEST_LOCATION );
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(0.0f, 0.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(static_cast<int>(scrollView.GetCurrentPage()), 0, TEST_LOCATION);
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), Vector2(0.0f, 0.0f), TEST_LOCATION);
END_TEST;
}
tet_infoline(" UtcDaliToolkitScrollViewScrollToActorP");
ScrollView scrollView = ScrollView::New();
- application.GetScene().Add( scrollView );
+ application.GetScene().Add(scrollView);
- Actor actorA = Actor::New();
+ Actor actorA = Actor::New();
const Vector3 positionA = Vector3(100.0f, 400.0f, 0.0f);
- actorA.SetProperty( Actor::Property::POSITION, positionA );
+ actorA.SetProperty(Actor::Property::POSITION, positionA);
scrollView.Add(actorA);
- Actor actorB = Actor::New();
+ Actor actorB = Actor::New();
const Vector3 positionB = Vector3(500.0f, 200.0f, 0.0f);
- actorB.SetProperty( Actor::Property::POSITION, positionB );
+ actorB.SetProperty(Actor::Property::POSITION, positionB);
scrollView.Add(actorB);
Wait(application);
scrollView.ScrollTo(actorA, 0.0f);
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), positionA.GetVectorXY(), TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), positionA.GetVectorXY(), TEST_LOCATION);
Wait(application);
scrollView.ScrollTo(actorB, 0.0f);
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), positionB.GetVectorXY(), TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), positionB.GetVectorXY(), TEST_LOCATION);
scrollView.ScrollTo(actorA);
Wait(application, RENDER_DELAY_SCROLL);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), positionA.GetVectorXY(), TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), positionA.GetVectorXY(), TEST_LOCATION);
scrollView.ScrollTo(actorB);
Wait(application, RENDER_DELAY_SCROLL);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), positionB.GetVectorXY(), TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), positionB.GetVectorXY(), TEST_LOCATION);
END_TEST;
}
tet_infoline(" UtcDaliToolkitScrollViewScrollToSnapPointP");
ScrollView scrollView = ScrollView::New();
- application.GetScene().Add( scrollView );
- RulerPtr rulerX = new FixedRuler( 100.0f );
- rulerX->SetDomain( RulerDomain(0.0f, 800.0f, true) );
- RulerPtr rulerY = new FixedRuler( 100.0f );
- rulerY->SetDomain( RulerDomain(0.0f, 400.0f, true) );
+ application.GetScene().Add(scrollView);
+ RulerPtr rulerX = new FixedRuler(100.0f);
+ rulerX->SetDomain(RulerDomain(0.0f, 800.0f, true));
+ RulerPtr rulerY = new FixedRuler(100.0f);
+ rulerY->SetDomain(RulerDomain(0.0f, 400.0f, true));
- scrollView.SetRulerX( rulerX );
- scrollView.SetRulerY( rulerY );
+ scrollView.SetRulerX(rulerX);
+ scrollView.SetRulerY(rulerY);
- scrollView.ScrollTo( Vector2(120.0f, 190.0f), 0.0f );
+ scrollView.ScrollTo(Vector2(120.0f, 190.0f), 0.0f);
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(120.0f, 190.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), Vector2(120.0f, 190.0f), TEST_LOCATION);
scrollView.ScrollToSnapPoint();
Wait(application, RENDER_DELAY_SCROLL);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(100.0f, 200.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), Vector2(100.0f, 200.0f), TEST_LOCATION);
END_TEST;
}
ScrollView scrollView = ScrollView::New();
scrollView.SetScrollUpdateDistance(0);
- DALI_TEST_EQUALS( scrollView.GetScrollUpdateDistance(), 0, TEST_LOCATION);
+ DALI_TEST_EQUALS(scrollView.GetScrollUpdateDistance(), 0, TEST_LOCATION);
scrollView.SetScrollUpdateDistance(10);
- DALI_TEST_EQUALS( scrollView.GetScrollUpdateDistance(), 10, TEST_LOCATION);
+ DALI_TEST_EQUALS(scrollView.GetScrollUpdateDistance(), 10, TEST_LOCATION);
scrollView.SetScrollUpdateDistance(1000);
- DALI_TEST_EQUALS( scrollView.GetScrollUpdateDistance(), 1000, TEST_LOCATION);
+ DALI_TEST_EQUALS(scrollView.GetScrollUpdateDistance(), 1000, TEST_LOCATION);
END_TEST;
}
tet_infoline(" UtcDaliToolkitScrollViewSetWrapModeP");
ScrollView scrollView = ScrollView::New();
- application.GetScene().Add( scrollView );
+ application.GetScene().Add(scrollView);
Actor actor = Actor::New();
- scrollView.Add( actor );
+ scrollView.Add(actor);
// Position rulers. 4x4 grid.
RulerPtr rulerX = new FixedRuler(50.0f);
RulerPtr rulerY = new FixedRuler(50.0f);
- rulerX->SetDomain( RulerDomain(0.0f, 200.0f, false) );
- rulerY->SetDomain( RulerDomain(0.0f, 200.0f, false) );
+ rulerX->SetDomain(RulerDomain(0.0f, 200.0f, false));
+ rulerY->SetDomain(RulerDomain(0.0f, 200.0f, false));
scrollView.SetRulerX(rulerX);
scrollView.SetRulerY(rulerY);
scrollView.SetWrapMode(false);
scrollView.ScrollTo(Vector2(225.0f, 125.0f), 0.0f); // 5th (1st) page across, and 3rd (3rd) page down. (wrapped)
Wait(application);
- DALI_TEST_EQUALS( static_cast<int>(scrollView.GetCurrentPage()), 17, TEST_LOCATION );
+ DALI_TEST_EQUALS(static_cast<int>(scrollView.GetCurrentPage()), 17, TEST_LOCATION);
scrollView.SetWrapMode(true);
scrollView.ScrollTo(Vector2(230.0f, 130.0f), 0.0f); // 5th (1st) page across, and 3rd (3rd) page down. (wrapped)
Wait(application);
- DALI_TEST_EQUALS( static_cast<int>(scrollView.GetCurrentPage()), 13, TEST_LOCATION );
+ DALI_TEST_EQUALS(static_cast<int>(scrollView.GetCurrentPage()), 13, TEST_LOCATION);
END_TEST;
}
tet_infoline(" UtcDaliToolkitScrollViewActorAutoSnap");
ScrollView scrollView = ScrollView::New();
- application.GetScene().Add( scrollView );
+ application.GetScene().Add(scrollView);
// Position rulers.
RulerPtr rulerX = new DefaultRuler();
RulerPtr rulerY = new DefaultRuler();
- rulerX->SetDomain( RulerDomain(0.0f, 1000.0f, false) );
- rulerY->SetDomain( RulerDomain(0.0f, 1000.0f, false) );
+ rulerX->SetDomain(RulerDomain(0.0f, 1000.0f, false));
+ rulerY->SetDomain(RulerDomain(0.0f, 1000.0f, false));
scrollView.SetRulerX(rulerX);
scrollView.SetRulerY(rulerY);
const Vector3 aPosition = Vector3(200.0f, 50.0f, 0.0f);
- Actor a = Actor::New();
+ Actor a = Actor::New();
scrollView.Add(a);
- a.SetProperty( Actor::Property::POSITION, aPosition );
+ a.SetProperty(Actor::Property::POSITION, aPosition);
const Vector3 bPosition = Vector3(600.0f, 600.0f, 0.0f);
- Actor b = Actor::New();
+ Actor b = Actor::New();
scrollView.Add(b);
- b.SetProperty( Actor::Property::POSITION, bPosition );
+ b.SetProperty(Actor::Property::POSITION, bPosition);
// Goto a random position, and execute snap (should not move)
Vector2 targetScroll = Vector2(500.0f, 500.0f);
Wait(application);
scrollView.ScrollToSnapPoint();
Wait(application, RENDER_DELAY_SCROLL);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), targetScroll, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), targetScroll, TEST_LOCATION);
// Enable ActorAutoSnap, and now try snapping.
scrollView.SetActorAutoSnap(true);
scrollView.ScrollToSnapPoint();
Wait(application, RENDER_DELAY_SCROLL);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), bPosition.GetVectorXY(), TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), bPosition.GetVectorXY(), TEST_LOCATION);
scrollView.ScrollTo(Vector2(0.0f, 0.0f), 0.0f);
Wait(application);
scrollView.ScrollToSnapPoint();
Wait(application, RENDER_DELAY_SCROLL);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), aPosition.GetVectorXY(), TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), aPosition.GetVectorXY(), TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitScrollViewSignalsStartComplete");
- gOnScrollStartCalled = false;
+ gOnScrollStartCalled = false;
gOnScrollCompleteCalled = false;
ScrollView scrollView = ScrollView::New();
- application.GetScene().Add( scrollView );
+ application.GetScene().Add(scrollView);
// Position rulers.
RulerPtr rulerX = new DefaultRuler();
RulerPtr rulerY = new DefaultRuler();
- rulerX->SetDomain( RulerDomain(0.0f, 1000.0f, false) );
- rulerY->SetDomain( RulerDomain(0.0f, 1000.0f, false) );
+ rulerX->SetDomain(RulerDomain(0.0f, 1000.0f, false));
+ rulerY->SetDomain(RulerDomain(0.0f, 1000.0f, false));
scrollView.SetRulerX(rulerX);
scrollView.SetRulerY(rulerY);
- scrollView.ScrollStartedSignal().Connect( &OnScrollStart );
- scrollView.ScrollUpdatedSignal().Connect( &OnScrollUpdate );
- scrollView.ScrollCompletedSignal().Connect( &OnScrollComplete );
- scrollView.ScrollTo( Vector2(100.0f, 100.0f) );
+ scrollView.ScrollStartedSignal().Connect(&OnScrollStart);
+ scrollView.ScrollUpdatedSignal().Connect(&OnScrollUpdate);
+ scrollView.ScrollCompletedSignal().Connect(&OnScrollComplete);
+ scrollView.ScrollTo(Vector2(100.0f, 100.0f));
Wait(application, RENDER_DELAY_SCROLL);
DALI_TEST_CHECK(gOnScrollStartCalled);
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitScrollViewSignalsUpdate");
- gOnScrollStartCalled = false;
- gOnScrollUpdateCalled = false;
+ gOnScrollStartCalled = false;
+ gOnScrollUpdateCalled = false;
gOnScrollCompleteCalled = false;
ScrollView scrollView = ScrollView::New();
- application.GetScene().Add( scrollView );
+ application.GetScene().Add(scrollView);
Vector2 stageSize = application.GetScene().GetSize();
- scrollView.SetProperty( Actor::Property::SIZE, stageSize);
- scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+ scrollView.SetProperty(Actor::Property::SIZE, stageSize);
+ scrollView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ scrollView.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
// Position rulers.
RulerPtr rulerX = new DefaultRuler();
RulerPtr rulerY = new DefaultRuler();
- rulerX->SetDomain( RulerDomain(0.0f, 1000.0f, false) );
- rulerY->SetDomain( RulerDomain(0.0f, 1000.0f, false) );
+ rulerX->SetDomain(RulerDomain(0.0f, 1000.0f, false));
+ rulerY->SetDomain(RulerDomain(0.0f, 1000.0f, false));
scrollView.SetRulerX(rulerX);
scrollView.SetRulerY(rulerY);
- scrollView.ScrollStartedSignal().Connect( &OnScrollStart );
- scrollView.ScrollUpdatedSignal().Connect( &OnScrollUpdate );
- scrollView.ScrollCompletedSignal().Connect( &OnScrollComplete );
+ scrollView.ScrollStartedSignal().Connect(&OnScrollStart);
+ scrollView.ScrollUpdatedSignal().Connect(&OnScrollUpdate);
+ scrollView.ScrollCompletedSignal().Connect(&OnScrollComplete);
Actor image = Actor::New();
- image.SetProperty( Actor::Property::SIZE, stageSize);
- image.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- image.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+ image.SetProperty(Actor::Property::SIZE, stageSize);
+ image.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ image.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
scrollView.Add(image);
Wait(application);
// Do a pan starting from 100,100 and moving down diagonally.
- Vector2 pos(100.0f, 100.0f);
+ Vector2 pos(100.0f, 100.0f);
uint32_t time = 100;
- TestStartPan( application, pos, pos, time );
+ TestStartPan(application, pos, pos, time);
pos.x += 5.0f;
pos.y += 5.0f;
Wait(application, 100);
- for(int i = 0;i<20;i++)
+ for(int i = 0; i < 20; i++)
{
time += RENDER_FRAME_INTERVAL;
- TestMovePan( application, pos, time);
+ TestMovePan(application, pos, time);
pos.x += 5.0f;
pos.y += 5.0f;
Wait(application);
}
time += RENDER_FRAME_INTERVAL;
- TestEndPan(application, pos, time );
+ TestEndPan(application, pos, time);
Wait(application, RENDER_DELAY_SCROLL);
DALI_TEST_CHECK(gOnScrollStartCalled);
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitScrollViewSignalsUpdate");
- gOnScrollStartCalled = false;
- gOnScrollUpdateCalled = false;
+ gOnScrollStartCalled = false;
+ gOnScrollUpdateCalled = false;
gOnScrollCompleteCalled = false;
ScrollView scrollView = ScrollView::New();
- application.GetScene().Add( scrollView );
+ application.GetScene().Add(scrollView);
Vector2 stageSize = application.GetScene().GetSize();
- scrollView.SetProperty( Actor::Property::SIZE, stageSize);
- scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+ scrollView.SetProperty(Actor::Property::SIZE, stageSize);
+ scrollView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ scrollView.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
// Position rulers.
RulerPtr rulerX = new DefaultRuler();
RulerPtr rulerY = new DefaultRuler();
- rulerX->SetDomain( RulerDomain(0.0f, 1000.0f, false) );
- rulerY->SetDomain( RulerDomain(0.0f, 1000.0f, false) );
+ rulerX->SetDomain(RulerDomain(0.0f, 1000.0f, false));
+ rulerY->SetDomain(RulerDomain(0.0f, 1000.0f, false));
scrollView.SetRulerX(rulerX);
scrollView.SetRulerY(rulerY);
Dali::ConnectionTracker tracker;
- bool scrollStarted=false;
- bool scrollUpdated=false;
- bool scrollCompleted=false;
- DALI_TEST_CHECK(scrollView.ConnectSignal( &tracker, "scrollStarted", CallbackFunctor(&scrollStarted) ));
- DALI_TEST_CHECK(scrollView.ConnectSignal( &tracker, "scrollUpdated", CallbackFunctor(&scrollUpdated) ));
- DALI_TEST_CHECK(scrollView.ConnectSignal( &tracker, "scrollCompleted", CallbackFunctor(&scrollCompleted) ));
+ bool scrollStarted = false;
+ bool scrollUpdated = false;
+ bool scrollCompleted = false;
+ DALI_TEST_CHECK(scrollView.ConnectSignal(&tracker, "scrollStarted", CallbackFunctor(&scrollStarted)));
+ DALI_TEST_CHECK(scrollView.ConnectSignal(&tracker, "scrollUpdated", CallbackFunctor(&scrollUpdated)));
+ DALI_TEST_CHECK(scrollView.ConnectSignal(&tracker, "scrollCompleted", CallbackFunctor(&scrollCompleted)));
Actor image = Actor::New();
- image.SetProperty( Actor::Property::SIZE, stageSize);
- image.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- image.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+ image.SetProperty(Actor::Property::SIZE, stageSize);
+ image.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ image.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
scrollView.Add(image);
Wait(application);
// Do a pan starting from 100,100 and moving down diagonally.
- Vector2 pos(100.0f, 100.0f);
+ Vector2 pos(100.0f, 100.0f);
uint32_t time = 100;
- TestStartPan( application, pos, pos, time );
+ TestStartPan(application, pos, pos, time);
pos.x += 5.0f;
pos.y += 5.0f;
Wait(application, 100);
- for(int i = 0;i<20;i++)
+ for(int i = 0; i < 20; i++)
{
time += RENDER_FRAME_INTERVAL;
- TestMovePan( application, pos, time);
+ TestMovePan(application, pos, time);
pos.x += 5.0f;
pos.y += 5.0f;
Wait(application);
}
time += RENDER_FRAME_INTERVAL;
- TestEndPan(application, pos, time );
+ TestEndPan(application, pos, time);
Wait(application, RENDER_DELAY_SCROLL);
DALI_TEST_CHECK(scrollStarted);
DALI_TEST_CHECK(scrollUpdated);
DALI_TEST_CHECK(scrollCompleted);
- application.GetScene().Remove( scrollView );
+ application.GetScene().Remove(scrollView);
END_TEST;
}
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
scrollView.SetOvershootEnabled(true);
- application.GetScene().Add( scrollView );
+ application.GetScene().Add(scrollView);
Vector2 stageSize = application.GetScene().GetSize();
- scrollView.SetProperty( Actor::Property::SIZE, stageSize);
- scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+ scrollView.SetProperty(Actor::Property::SIZE, stageSize);
+ scrollView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ scrollView.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
// Position rulers.
RulerPtr rulerX = new DefaultRuler();
RulerPtr rulerY = new DefaultRuler();
- rulerX->SetDomain( RulerDomain(0.0f, stageSize.width + CLAMP_EXCESS_WIDTH, true) );
- rulerY->SetDomain( RulerDomain(0.0f, stageSize.height + CLAMP_EXCESS_HEIGHT, true) );
+ rulerX->SetDomain(RulerDomain(0.0f, stageSize.width + CLAMP_EXCESS_WIDTH, true));
+ rulerY->SetDomain(RulerDomain(0.0f, stageSize.height + CLAMP_EXCESS_HEIGHT, true));
scrollView.SetRulerX(rulerX);
scrollView.SetRulerY(rulerY);
- scrollView.ScrollStartedSignal().Connect( &OnScrollStart );
- scrollView.ScrollUpdatedSignal().Connect( &OnScrollUpdate );
- scrollView.ScrollCompletedSignal().Connect( &OnScrollComplete );
- scrollView.SnapStartedSignal().Connect( &OnSnapStart );
+ scrollView.ScrollStartedSignal().Connect(&OnScrollStart);
+ scrollView.ScrollUpdatedSignal().Connect(&OnScrollUpdate);
+ scrollView.ScrollCompletedSignal().Connect(&OnScrollComplete);
+ scrollView.SnapStartedSignal().Connect(&OnSnapStart);
scrollView.ScrollTo(CLAMP_START_SCROLL_POSITION, 0.0f); // move in a little.
uint32_t time = 0;
- time +=Wait(application);
+ time += Wait(application);
// First try insensitive swipe.
scrollView.SetScrollSensitive(false);
PerformGestureSwipe(application, CLAMP_TOUCH_START, CLAMP_TOUCH_MOVEMENT, CLAMP_GESTURE_FRAMES, time, true);
- DALI_TEST_CHECK( !gOnScrollStartCalled );
- DALI_TEST_CHECK( !gOnScrollCompleteCalled );
- DALI_TEST_CHECK( !gOnSnapStartCalled );
+ DALI_TEST_CHECK(!gOnScrollStartCalled);
+ DALI_TEST_CHECK(!gOnScrollCompleteCalled);
+ DALI_TEST_CHECK(!gOnSnapStartCalled);
// Second try sensitive swipe.
scrollView.SetScrollSensitive(true);
PerformGestureSwipe(application, CLAMP_TOUCH_START, CLAMP_TOUCH_MOVEMENT, CLAMP_GESTURE_FRAMES, time, true);
- DALI_TEST_CHECK( gOnScrollStartCalled );
- DALI_TEST_CHECK( gOnScrollCompleteCalled );
- DALI_TEST_CHECK( gOnSnapStartCalled );
+ DALI_TEST_CHECK(gOnScrollStartCalled);
+ DALI_TEST_CHECK(gOnScrollCompleteCalled);
+ DALI_TEST_CHECK(gOnSnapStartCalled);
END_TEST;
}
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
- application.GetScene().Add( scrollView );
+ application.GetScene().Add(scrollView);
Vector2 stageSize = application.GetScene().GetSize();
- scrollView.SetProperty( Actor::Property::SIZE, stageSize);
- scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+ scrollView.SetProperty(Actor::Property::SIZE, stageSize);
+ scrollView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ scrollView.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
// Position rulers.
RulerPtr rulerX = new DefaultRuler();
RulerPtr rulerY = new DefaultRuler();
- rulerX->SetDomain( RulerDomain(0.0f, stageSize.width + CLAMP_EXCESS_WIDTH, true) );
- rulerY->SetDomain( RulerDomain(0.0f, stageSize.height + CLAMP_EXCESS_HEIGHT, true) );
+ rulerX->SetDomain(RulerDomain(0.0f, stageSize.width + CLAMP_EXCESS_WIDTH, true));
+ rulerY->SetDomain(RulerDomain(0.0f, stageSize.height + CLAMP_EXCESS_HEIGHT, true));
scrollView.SetRulerX(rulerX);
scrollView.SetRulerY(rulerY);
- scrollView.ScrollStartedSignal().Connect( &OnScrollStart );
- scrollView.ScrollUpdatedSignal().Connect( &OnScrollUpdate );
- scrollView.ScrollCompletedSignal().Connect( &OnScrollComplete );
+ scrollView.ScrollStartedSignal().Connect(&OnScrollStart);
+ scrollView.ScrollUpdatedSignal().Connect(&OnScrollUpdate);
+ scrollView.ScrollCompletedSignal().Connect(&OnScrollComplete);
// Normal
scrollView.ScrollTo(Vector2(100.0f, 100.0f), 0.0f); // move in a little.
// PerformGestureSwipe not used as a different initial direction was required
- Vector2 pos( CLAMP_TOUCH_START + Vector2(15.0f, 3.0f) );
+ Vector2 pos(CLAMP_TOUCH_START + Vector2(15.0f, 3.0f));
- TestStartPan( application, CLAMP_TOUCH_START, pos, time );
+ TestStartPan(application, CLAMP_TOUCH_START, pos, time);
time += Wait(application);
- for( int i = 0; i<47; i++ )
+ for(int i = 0; i < 47; i++)
{
pos += dir;
- TestMovePan( application, pos, time );
- time += Wait( application );
+ TestMovePan(application, pos, time);
+ time += Wait(application);
}
pos += dir;
- TestEndPan( application, pos, time );
+ TestEndPan(application, pos, time);
const Vector2 positionAfterNormal = scrollView.GetCurrentScrollPosition();
scrollView.ScrollTo(Vector2(100.0f, 100.0f), 0.0f); // move in a little.
time += Wait(application);
- Vector2 pos2( CLAMP_TOUCH_START + Vector2(15.0f, 3.0f) );
+ Vector2 pos2(CLAMP_TOUCH_START + Vector2(15.0f, 3.0f));
- TestStartPan( application, CLAMP_TOUCH_START, pos2, time );
+ TestStartPan(application, CLAMP_TOUCH_START, pos2, time);
time += Wait(application);
- for( int i = 0; i<47; i++ )
+ for(int i = 0; i < 47; i++)
{
pos2 += dir;
- TestMovePan( application, pos2, time );
- time += Wait( application );
+ TestMovePan(application, pos2, time);
+ time += Wait(application);
}
pos2 += dir;
- TestEndPan( application, pos2, time );
+ TestEndPan(application, pos2, time);
const Vector2 positionAfterAutoLock = scrollView.GetCurrentScrollPosition();
// compare how much the Y position has deviated for normal and autolock.
- const float devianceNormal = fabsf(startPosition.y - positionAfterNormal.y);
+ const float devianceNormal = fabsf(startPosition.y - positionAfterNormal.y);
const float devianceAutoLock = fabsf(startPosition.y - positionAfterAutoLock.y);
// in auto-lock it should be a mostly horizontal pan (thus deviance should be much lower)
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
- application.GetScene().Add( scrollView );
+ application.GetScene().Add(scrollView);
Vector2 stageSize = application.GetScene().GetSize();
- scrollView.SetProperty( Actor::Property::SIZE, stageSize);
- scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+ scrollView.SetProperty(Actor::Property::SIZE, stageSize);
+ scrollView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ scrollView.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
// Position rulers.
RulerPtr rulerX = new DefaultRuler();
RulerPtr rulerY = new DefaultRuler();
- rulerX->SetDomain( RulerDomain(0.0f, stageSize.width + CLAMP_EXCESS_WIDTH, true) );
- rulerY->SetDomain( RulerDomain(0.0f, stageSize.height + CLAMP_EXCESS_HEIGHT, true) );
+ rulerX->SetDomain(RulerDomain(0.0f, stageSize.width + CLAMP_EXCESS_WIDTH, true));
+ rulerY->SetDomain(RulerDomain(0.0f, stageSize.height + CLAMP_EXCESS_HEIGHT, true));
scrollView.SetRulerX(rulerX);
scrollView.SetRulerY(rulerY);
// Add an Actor to ScrollView,
// Apply TestSumConstraint to ScrollView's children (includes this Actor)
gConstraintResult = Vector3::ZERO;
- Actor a = Actor::New();
+ Actor a = Actor::New();
scrollView.Add(a);
- a.SetProperty( Actor::Property::POSITION, TEST_ACTOR_POSITION);
+ a.SetProperty(Actor::Property::POSITION, TEST_ACTOR_POSITION);
Wait(application);
- Constraint constraint = Constraint::New<Vector3>( scrollView, Actor::Property::POSITION, TestSumConstraint( TEST_CONSTRAINT_OFFSET ) );
- constraint.AddSource( Source(scrollView, ScrollView::Property::SCROLL_POSITION) );
+ Constraint constraint = Constraint::New<Vector3>(scrollView, Actor::Property::POSITION, TestSumConstraint(TEST_CONSTRAINT_OFFSET));
+ constraint.AddSource(Source(scrollView, ScrollView::Property::SCROLL_POSITION));
constraint.SetRemoveAction(Constraint::DISCARD);
scrollView.ApplyConstraintToChildren(constraint);
Wait(application);
- DALI_TEST_EQUALS( gConstraintResult, TEST_ACTOR_POSITION + TEST_CONSTRAINT_OFFSET, TEST_LOCATION );
+ DALI_TEST_EQUALS(gConstraintResult, TEST_ACTOR_POSITION + TEST_CONSTRAINT_OFFSET, TEST_LOCATION);
gConstraintResult = Vector3::ZERO;
scrollView.RemoveConstraintsFromChildren();
Wait(application);
- DALI_TEST_EQUALS( gConstraintResult, Vector3::ZERO, TEST_LOCATION );
+ DALI_TEST_EQUALS(gConstraintResult, Vector3::ZERO, TEST_LOCATION);
END_TEST;
}
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
- application.GetScene().Add( scrollView );
+ application.GetScene().Add(scrollView);
Vector2 stageSize = application.GetScene().GetSize();
- scrollView.SetProperty( Actor::Property::SIZE, stageSize);
- scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+ scrollView.SetProperty(Actor::Property::SIZE, stageSize);
+ scrollView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ scrollView.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
// Position rulers.
RulerPtr rulerX = new DefaultRuler();
RulerPtr rulerY = new DefaultRuler();
- rulerX->SetDomain( RulerDomain(0.0f, stageSize.width + CLAMP_EXCESS_WIDTH, true) );
- rulerY->SetDomain( RulerDomain(0.0f, stageSize.height + CLAMP_EXCESS_HEIGHT, true) );
+ rulerX->SetDomain(RulerDomain(0.0f, stageSize.width + CLAMP_EXCESS_WIDTH, true));
+ rulerY->SetDomain(RulerDomain(0.0f, stageSize.height + CLAMP_EXCESS_HEIGHT, true));
scrollView.SetRulerX(rulerX);
scrollView.SetRulerY(rulerY);
// Apply TestSumConstraint to ScrollView's children (includes this Actor)
gConstraintResult = Vector3::ZERO;
- Actor a = Actor::New();
+ Actor a = Actor::New();
scrollView.Add(a);
- a.SetProperty( Actor::Property::POSITION, TEST_ACTOR_POSITION);
+ a.SetProperty(Actor::Property::POSITION, TEST_ACTOR_POSITION);
Wait(application);
// apply this constraint to scrollview
- Constraint constraint = Constraint::New<Vector3>( scrollView, Actor::Property::POSITION, TestSumConstraint( TEST_CONSTRAINT_OFFSET ) );
- constraint.AddSource( Source(scrollView, ScrollView::Property::SCROLL_POSITION) );
+ Constraint constraint = Constraint::New<Vector3>(scrollView, Actor::Property::POSITION, TestSumConstraint(TEST_CONSTRAINT_OFFSET));
+ constraint.AddSource(Source(scrollView, ScrollView::Property::SCROLL_POSITION));
constraint.SetRemoveAction(Constraint::DISCARD);
scrollView.ApplyConstraintToChildren(constraint);
Wait(application);
// Defaulty Bound.
- DALI_TEST_EQUALS( gConstraintResult, TEST_ACTOR_POSITION + TEST_CONSTRAINT_OFFSET, TEST_LOCATION );
+ DALI_TEST_EQUALS(gConstraintResult, TEST_ACTOR_POSITION + TEST_CONSTRAINT_OFFSET, TEST_LOCATION);
// UnBind
gConstraintResult = Vector3::ZERO;
- scrollView.UnbindActor( a );
+ scrollView.UnbindActor(a);
Wait(application);
- DALI_TEST_EQUALS( gConstraintResult, Vector3::ZERO, TEST_LOCATION );
+ DALI_TEST_EQUALS(gConstraintResult, Vector3::ZERO, TEST_LOCATION);
// Bind
gConstraintResult = Vector3::ZERO;
- scrollView.BindActor( a );
+ scrollView.BindActor(a);
Wait(application);
- DALI_TEST_EQUALS( gConstraintResult, TEST_ACTOR_POSITION + TEST_CONSTRAINT_OFFSET, TEST_LOCATION );
+ DALI_TEST_EQUALS(gConstraintResult, TEST_ACTOR_POSITION + TEST_CONSTRAINT_OFFSET, TEST_LOCATION);
END_TEST;
}
ScrollView scrollView = ScrollView::New();
scrollView.SetOvershootEnabled(true);
- uint32_t time = 0;
- Vector2 overshootSize = Vector2(100.0f,100.0f);
- scrollView.SetProperty( Scrollable::Property::OVERSHOOT_SIZE, overshootSize );
- DALI_TEST_EQUALS( scrollView.GetProperty(Scrollable::Property::OVERSHOOT_SIZE).Get<Vector2>(), overshootSize, TEST_LOCATION );
+ uint32_t time = 0;
+ Vector2 overshootSize = Vector2(100.0f, 100.0f);
+ scrollView.SetProperty(Scrollable::Property::OVERSHOOT_SIZE, overshootSize);
+ DALI_TEST_EQUALS(scrollView.GetProperty(Scrollable::Property::OVERSHOOT_SIZE).Get<Vector2>(), overshootSize, TEST_LOCATION);
- application.GetScene().Add( scrollView );
+ application.GetScene().Add(scrollView);
Vector2 stageSize = application.GetScene().GetSize();
- scrollView.SetProperty( Actor::Property::SIZE, stageSize);
- scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+ scrollView.SetProperty(Actor::Property::SIZE, stageSize);
+ scrollView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ scrollView.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
// Position rulers.
RulerPtr rulerX = new DefaultRuler();
RulerPtr rulerY = new DefaultRuler();
- rulerX->SetDomain( RulerDomain(0.0f, stageSize.width + CLAMP_EXCESS_WIDTH, true) );
- rulerY->SetDomain( RulerDomain(0.0f, stageSize.height + CLAMP_EXCESS_HEIGHT, true) );
+ rulerX->SetDomain(RulerDomain(0.0f, stageSize.width + CLAMP_EXCESS_WIDTH, true));
+ rulerY->SetDomain(RulerDomain(0.0f, stageSize.height + CLAMP_EXCESS_HEIGHT, true));
scrollView.SetRulerX(rulerX);
scrollView.SetRulerY(rulerY);
- scrollView.ScrollStartedSignal().Connect( &OnScrollStart );
- scrollView.ScrollUpdatedSignal().Connect( &OnScrollUpdate );
- scrollView.ScrollCompletedSignal().Connect( &OnScrollComplete );
+ scrollView.ScrollStartedSignal().Connect(&OnScrollStart);
+ scrollView.ScrollUpdatedSignal().Connect(&OnScrollUpdate);
+ scrollView.ScrollCompletedSignal().Connect(&OnScrollComplete);
scrollView.ScrollTo(OVERSHOOT_START_SCROLL_POSITION, 0.0f); // move in a little.
time += Wait(application);
// 1. Scroll page in NW (-500,-500 pixels), then inspect overshoot. (don't release touch)
- Vector2 currentPos = Vector2(100.0f, 100.0f);
- currentPos = PerformGestureSwipe(application, currentPos, Vector2(5.0f, 5.0f), 100, time, false);
- float overshootXValue = scrollView.GetCurrentProperty< float >( ScrollView::Property::OVERSHOOT_X );
- float overshootYValue = scrollView.GetCurrentProperty< float >( ScrollView::Property::OVERSHOOT_Y );
- Vector2 positionValue = scrollView.GetCurrentProperty< Vector2 >( ScrollView::Property::SCROLL_POSITION );
+ Vector2 currentPos = Vector2(100.0f, 100.0f);
+ currentPos = PerformGestureSwipe(application, currentPos, Vector2(5.0f, 5.0f), 100, time, false);
+ float overshootXValue = scrollView.GetCurrentProperty<float>(ScrollView::Property::OVERSHOOT_X);
+ float overshootYValue = scrollView.GetCurrentProperty<float>(ScrollView::Property::OVERSHOOT_Y);
+ Vector2 positionValue = scrollView.GetCurrentProperty<Vector2>(ScrollView::Property::SCROLL_POSITION);
DALI_TEST_EQUALS(overshootXValue, 1.0f, TEST_LOCATION);
DALI_TEST_EQUALS(overshootYValue, 1.0f, TEST_LOCATION);
DALI_TEST_EQUALS(positionValue, Vector2::ZERO, TEST_LOCATION);
float minTimeToReachOrigin = SCROLL_ANIMATION_DURATION + DEFAULT_SNAP_OVERSHOOT_DURATION * (SNAP_POSITION_WITH_DECELERATED_VELOCITY.x / DEFAULT_MAX_OVERSHOOT) - TIME_TOLERANCE;
float maxTimeToReachOrigin = SCROLL_ANIMATION_DURATION + DEFAULT_SNAP_OVERSHOOT_DURATION * (SNAP_POSITION_WITH_DECELERATED_VELOCITY.x / DEFAULT_MAX_OVERSHOOT) + TIME_TOLERANCE;
- DALI_TEST_CHECK( (timeToReachOrigin > minTimeToReachOrigin) &&
- (timeToReachOrigin < maxTimeToReachOrigin) );
+ DALI_TEST_CHECK((timeToReachOrigin > minTimeToReachOrigin) &&
+ (timeToReachOrigin < maxTimeToReachOrigin));
// 2. Repeat Scroll, but this time change overshoot snap duration to shorter time
scrollView.SetSnapOvershootDuration(TEST_CUSTOM1_SNAP_OVERSHOOT_DURATION);
minTimeToReachOrigin = SCROLL_ANIMATION_DURATION + TEST_CUSTOM1_SNAP_OVERSHOOT_DURATION * (SNAP_POSITION_WITH_DECELERATED_VELOCITY.x / DEFAULT_MAX_OVERSHOOT) - TIME_TOLERANCE;
maxTimeToReachOrigin = SCROLL_ANIMATION_DURATION + TEST_CUSTOM1_SNAP_OVERSHOOT_DURATION * (SNAP_POSITION_WITH_DECELERATED_VELOCITY.x / DEFAULT_MAX_OVERSHOOT) + TIME_TOLERANCE;
- DALI_TEST_CHECK( (timeToReachOrigin > minTimeToReachOrigin) &&
- (timeToReachOrigin < maxTimeToReachOrigin) );
+ DALI_TEST_CHECK((timeToReachOrigin > minTimeToReachOrigin) &&
+ (timeToReachOrigin < maxTimeToReachOrigin));
// 3. Repeat Scroll, but this time change overshoot snap duration to longer time.
scrollView.SetSnapOvershootDuration(TEST_CUSTOM2_SNAP_OVERSHOOT_DURATION);
minTimeToReachOrigin = SCROLL_ANIMATION_DURATION + TEST_CUSTOM2_SNAP_OVERSHOOT_DURATION * (SNAP_POSITION_WITH_DECELERATED_VELOCITY.x / DEFAULT_MAX_OVERSHOOT) - TIME_TOLERANCE;
maxTimeToReachOrigin = SCROLL_ANIMATION_DURATION + TEST_CUSTOM2_SNAP_OVERSHOOT_DURATION * (SNAP_POSITION_WITH_DECELERATED_VELOCITY.x / DEFAULT_MAX_OVERSHOOT) + TIME_TOLERANCE;
- DALI_TEST_CHECK( (timeToReachOrigin > minTimeToReachOrigin) &&
- (timeToReachOrigin < maxTimeToReachOrigin) );
+ DALI_TEST_CHECK((timeToReachOrigin > minTimeToReachOrigin) &&
+ (timeToReachOrigin < maxTimeToReachOrigin));
// 4. Repeat Scroll, but this time change overshoot function.
scrollView.SetSnapOvershootDuration(TEST_CUSTOM3_SNAP_OVERSHOOT_DURATION);
minTimeToReachOrigin = SCROLL_ANIMATION_DURATION + TEST_CUSTOM3_SNAP_OVERSHOOT_DURATION * (SNAP_POSITION_WITH_DECELERATED_VELOCITY.x / DEFAULT_MAX_OVERSHOOT) - TIME_TOLERANCE;
maxTimeToReachOrigin = SCROLL_ANIMATION_DURATION + TEST_CUSTOM3_SNAP_OVERSHOOT_DURATION * (SNAP_POSITION_WITH_DECELERATED_VELOCITY.x / DEFAULT_MAX_OVERSHOOT) + TIME_TOLERANCE;
- DALI_TEST_CHECK( (timeToReachOrigin > minTimeToReachOrigin) &&
- (timeToReachOrigin < maxTimeToReachOrigin) );
+ DALI_TEST_CHECK((timeToReachOrigin > minTimeToReachOrigin) &&
+ (timeToReachOrigin < maxTimeToReachOrigin));
END_TEST;
}
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
- scrollView.SetScrollSnapAlphaFunction( AlphaFunction::EASE_IN );
- DALI_TEST_CHECK( scrollView.GetScrollSnapAlphaFunction().GetBuiltinFunction() == AlphaFunction::EASE_IN );
- scrollView.SetScrollSnapAlphaFunction( AlphaFunction::EASE_OUT );
- DALI_TEST_CHECK( scrollView.GetScrollSnapAlphaFunction().GetBuiltinFunction() == AlphaFunction::EASE_OUT );
+ scrollView.SetScrollSnapAlphaFunction(AlphaFunction::EASE_IN);
+ DALI_TEST_CHECK(scrollView.GetScrollSnapAlphaFunction().GetBuiltinFunction() == AlphaFunction::EASE_IN);
+ scrollView.SetScrollSnapAlphaFunction(AlphaFunction::EASE_OUT);
+ DALI_TEST_CHECK(scrollView.GetScrollSnapAlphaFunction().GetBuiltinFunction() == AlphaFunction::EASE_OUT);
- scrollView.SetScrollFlickAlphaFunction( AlphaFunction::BOUNCE );
- DALI_TEST_CHECK( scrollView.GetScrollFlickAlphaFunction().GetBuiltinFunction() == AlphaFunction::BOUNCE );
+ scrollView.SetScrollFlickAlphaFunction(AlphaFunction::BOUNCE);
+ DALI_TEST_CHECK(scrollView.GetScrollFlickAlphaFunction().GetBuiltinFunction() == AlphaFunction::BOUNCE);
END_TEST;
}
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
- scrollView.SetScrollSnapDuration( 1.0f );
- DALI_TEST_EQUALS( scrollView.GetScrollSnapDuration(), 1.0f, TEST_LOCATION );
- scrollView.SetScrollSnapDuration( 0.5f );
- DALI_TEST_EQUALS( scrollView.GetScrollSnapDuration(), 0.5f, TEST_LOCATION );
+ scrollView.SetScrollSnapDuration(1.0f);
+ DALI_TEST_EQUALS(scrollView.GetScrollSnapDuration(), 1.0f, TEST_LOCATION);
+ scrollView.SetScrollSnapDuration(0.5f);
+ DALI_TEST_EQUALS(scrollView.GetScrollSnapDuration(), 0.5f, TEST_LOCATION);
- scrollView.SetScrollFlickDuration( 2.0f );
- DALI_TEST_EQUALS( scrollView.GetScrollFlickDuration(), 2.0f, TEST_LOCATION );
- scrollView.SetScrollFlickDuration( 1.5f );
- DALI_TEST_EQUALS( scrollView.GetScrollFlickDuration(), 1.5f, TEST_LOCATION );
+ scrollView.SetScrollFlickDuration(2.0f);
+ DALI_TEST_EQUALS(scrollView.GetScrollFlickDuration(), 2.0f, TEST_LOCATION);
+ scrollView.SetScrollFlickDuration(1.5f);
+ DALI_TEST_EQUALS(scrollView.GetScrollFlickDuration(), 1.5f, TEST_LOCATION);
END_TEST;
}
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
- application.GetScene().Add( scrollView );
+ application.GetScene().Add(scrollView);
Vector2 stageSize = application.GetScene().GetSize();
- scrollView.SetProperty( Actor::Property::SIZE, stageSize);
- scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+ scrollView.SetProperty(Actor::Property::SIZE, stageSize);
+ scrollView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ scrollView.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
// Position rulers.
RulerPtr rulerX = new DefaultRuler();
RulerPtr rulerY = new DefaultRuler();
- rulerX->SetDomain( RulerDomain(0.0f, stageSize.width + CLAMP_EXCESS_WIDTH, true) );
- rulerY->SetDomain( RulerDomain(0.0f, stageSize.height + CLAMP_EXCESS_HEIGHT, true) );
+ rulerX->SetDomain(RulerDomain(0.0f, stageSize.width + CLAMP_EXCESS_WIDTH, true));
+ rulerY->SetDomain(RulerDomain(0.0f, stageSize.height + CLAMP_EXCESS_HEIGHT, true));
scrollView.SetRulerX(rulerX);
scrollView.SetRulerY(rulerY);
- scrollView.SnapStartedSignal().Connect( &OnSnapStart );
+ scrollView.SnapStartedSignal().Connect(&OnSnapStart);
scrollView.ScrollTo(CLAMP_START_SCROLL_POSITION, 0.0f); // move in a little.
uint32_t time = 0;
// First try a snap.
PerformGestureSwipe(application, CLAMP_TOUCH_START, Vector2(0.5f, 0.0f), 60, time, true);
- DALI_TEST_CHECK( gOnSnapStartCalled );
- DALI_TEST_CHECK( gLastSnapType == Toolkit::SNAP );
+ DALI_TEST_CHECK(gOnSnapStartCalled);
+ DALI_TEST_CHECK(gLastSnapType == Toolkit::SNAP);
// Second try a swipe.
PerformGestureSwipe(application, CLAMP_TOUCH_START, Vector2(20.0f, 0.0f), 60, time, true);
- DALI_TEST_CHECK( gOnSnapStartCalled );
- DALI_TEST_CHECK( gLastSnapType == Toolkit::FLICK );
+ DALI_TEST_CHECK(gOnSnapStartCalled);
+ DALI_TEST_CHECK(gLastSnapType == Toolkit::FLICK);
END_TEST;
}
tet_infoline(" UtcDaliToolkitScrollViewGetCurrentPageP");
ScrollView scrollView = ScrollView::New();
- application.GetScene().Add( scrollView );
- RulerPtr rulerX = new FixedRuler( 100.0f );
- rulerX->SetDomain( RulerDomain(0.0f, 800.0f, true) );
- RulerPtr rulerY = new FixedRuler( 100.0f );
- rulerY->SetDomain( RulerDomain(0.0f, 400.0f, true) );
+ application.GetScene().Add(scrollView);
+ RulerPtr rulerX = new FixedRuler(100.0f);
+ rulerX->SetDomain(RulerDomain(0.0f, 800.0f, true));
+ RulerPtr rulerY = new FixedRuler(100.0f);
+ rulerY->SetDomain(RulerDomain(0.0f, 400.0f, true));
- scrollView.SetRulerX( rulerX );
- scrollView.SetRulerY( rulerY );
+ scrollView.SetRulerX(rulerX);
+ scrollView.SetRulerY(rulerY);
- scrollView.ScrollTo( 15 );
+ scrollView.ScrollTo(15);
Wait(application, RENDER_DELAY_SCROLL);
- DALI_TEST_EQUALS( static_cast<int>(scrollView.GetCurrentPage()), 15, TEST_LOCATION );
+ DALI_TEST_EQUALS(static_cast<int>(scrollView.GetCurrentPage()), 15, TEST_LOCATION);
- scrollView.ScrollTo( 3 );
+ scrollView.ScrollTo(3);
Wait(application, RENDER_DELAY_SCROLL);
- DALI_TEST_EQUALS( static_cast<int>(scrollView.GetCurrentPage()), 3, TEST_LOCATION );
+ DALI_TEST_EQUALS(static_cast<int>(scrollView.GetCurrentPage()), 3, TEST_LOCATION);
- scrollView.ScrollTo( 9 );
+ scrollView.ScrollTo(9);
Wait(application, RENDER_DELAY_SCROLL);
- DALI_TEST_EQUALS( static_cast<int>(scrollView.GetCurrentPage()), 9, TEST_LOCATION );
+ DALI_TEST_EQUALS(static_cast<int>(scrollView.GetCurrentPage()), 9, TEST_LOCATION);
END_TEST;
}
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
- application.GetScene().Add( scrollView );
+ application.GetScene().Add(scrollView);
Vector2 stageSize = application.GetScene().GetSize();
- scrollView.SetProperty( Actor::Property::SIZE, stageSize);
- scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+ scrollView.SetProperty(Actor::Property::SIZE, stageSize);
+ scrollView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ scrollView.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
// Position rulers.
RulerPtr rulerX = new DefaultRuler();
RulerPtr rulerY = new DefaultRuler();
- rulerX->SetDomain( RulerDomain(0.0f, stageSize.width + CLAMP_EXCESS_WIDTH, true) );
- rulerY->SetDomain( RulerDomain(0.0f, stageSize.height + CLAMP_EXCESS_HEIGHT, true) );
+ rulerX->SetDomain(RulerDomain(0.0f, stageSize.width + CLAMP_EXCESS_WIDTH, true));
+ rulerY->SetDomain(RulerDomain(0.0f, stageSize.height + CLAMP_EXCESS_HEIGHT, true));
scrollView.SetRulerX(rulerX);
scrollView.SetRulerY(rulerY);
time += Wait(application);
// Scroll page in NW (-20,-20 pixels), then check that overshoot should be 0. (don't release touch)
- Vector2 currentPos = PerformGestureSwipe(application, OVERSHOOT_START_SCROLL_POSITION, Vector2(1.0f, 1.0f), 10, time, false);
- float overshootXValue = scrollView.GetCurrentProperty< float >( ScrollView::Property::OVERSHOOT_X );
- float overshootYValue = scrollView.GetCurrentProperty< float >( ScrollView::Property::OVERSHOOT_Y );
+ Vector2 currentPos = PerformGestureSwipe(application, OVERSHOOT_START_SCROLL_POSITION, Vector2(1.0f, 1.0f), 10, time, false);
+ float overshootXValue = scrollView.GetCurrentProperty<float>(ScrollView::Property::OVERSHOOT_X);
+ float overshootYValue = scrollView.GetCurrentProperty<float>(ScrollView::Property::OVERSHOOT_Y);
DALI_TEST_EQUALS(overshootXValue, 0.0f, TEST_LOCATION);
DALI_TEST_EQUALS(overshootYValue, 0.0f, TEST_LOCATION);
time += Wait(application);
// Scroll page further in NW (-105,-105 pixels), then check that overshoot should be around 0.5. (don't release touch)
- for(int i = 0; i<106; i++)
+ for(int i = 0; i < 106; i++)
{
- TestMovePan(application, currentPos, time );
+ TestMovePan(application, currentPos, time);
currentPos += Vector2(1.0f, 1.0f);
time += Wait(application);
}
- overshootXValue = scrollView.GetCurrentProperty< float >( ScrollView::Property::OVERSHOOT_X );
- overshootYValue = scrollView.GetCurrentProperty< float >( ScrollView::Property::OVERSHOOT_Y );
+ overshootXValue = scrollView.GetCurrentProperty<float>(ScrollView::Property::OVERSHOOT_X);
+ overshootYValue = scrollView.GetCurrentProperty<float>(ScrollView::Property::OVERSHOOT_Y);
// The overshoot value is a 0.0f - 1.0f ranged value of the amount overshot related to the maximum overshoot.
// EG. If we move 105, max overshoot is 50, then we overshot 50 / 105.
- float correctOvershootValue = 0.508f; // This was measured and then set as the limit
- DALI_TEST_EQUALS( overshootXValue, correctOvershootValue, 0.001f, TEST_LOCATION );
- DALI_TEST_EQUALS( overshootYValue, correctOvershootValue, 0.001f, TEST_LOCATION );
+ float correctOvershootValue = 0.508f; // This was measured and then set as the limit
+ DALI_TEST_EQUALS(overshootXValue, correctOvershootValue, 0.001f, TEST_LOCATION);
+ DALI_TEST_EQUALS(overshootYValue, correctOvershootValue, 0.001f, TEST_LOCATION);
// Scroll page further in NW (-25,-25 pixels), then check that overshoot should be now 1.0. (don't release touch)
- for(int i = 0;i<25;i++)
+ for(int i = 0; i < 25; i++)
{
- TestMovePan(application, currentPos, time );
+ TestMovePan(application, currentPos, time);
currentPos += Vector2(1.0f, 1.0f); // Move in this direction
time += Wait(application);
}
- overshootXValue = scrollView.GetCurrentProperty< float >( ScrollView::Property::OVERSHOOT_X );
- overshootYValue = scrollView.GetCurrentProperty< float >( ScrollView::Property::OVERSHOOT_Y );
+ overshootXValue = scrollView.GetCurrentProperty<float>(ScrollView::Property::OVERSHOOT_X);
+ overshootYValue = scrollView.GetCurrentProperty<float>(ScrollView::Property::OVERSHOOT_Y);
DALI_TEST_EQUALS(overshootXValue, 1.0f, TEST_LOCATION);
DALI_TEST_EQUALS(overshootYValue, 1.0f, TEST_LOCATION);
time += Wait(application);
// Check that overshoot should be now around 0.8.
- overshootXValue = scrollView.GetCurrentProperty< float >( ScrollView::Property::OVERSHOOT_X );
- overshootYValue = scrollView.GetCurrentProperty< float >( ScrollView::Property::OVERSHOOT_Y );
+ overshootXValue = scrollView.GetCurrentProperty<float>(ScrollView::Property::OVERSHOOT_X);
+ overshootYValue = scrollView.GetCurrentProperty<float>(ScrollView::Property::OVERSHOOT_Y);
DALI_TEST_CHECK(overshootXValue > 0.79f && overshootXValue < 0.81f);
DALI_TEST_CHECK(overshootYValue > 0.79f && overshootYValue < 0.81f);
// Scroll page further in NW (-50,-50 pixels), then check that overshoot should be now 1.0. (don't release touch)
- for(int i = 0;i<50;i++)
+ for(int i = 0; i < 50; i++)
{
- TestMovePan(application, currentPos, time );
+ TestMovePan(application, currentPos, time);
currentPos += Vector2(1.0f, 1.0f); // Move in this direction
time += Wait(application);
}
- overshootXValue = scrollView.GetCurrentProperty< float >( ScrollView::Property::OVERSHOOT_X );
- overshootYValue = scrollView.GetCurrentProperty< float >( ScrollView::Property::OVERSHOOT_Y );
+ overshootXValue = scrollView.GetCurrentProperty<float>(ScrollView::Property::OVERSHOOT_X);
+ overshootYValue = scrollView.GetCurrentProperty<float>(ScrollView::Property::OVERSHOOT_Y);
DALI_TEST_EQUALS(overshootXValue, 1.0f, TEST_LOCATION);
DALI_TEST_EQUALS(overshootYValue, 1.0f, TEST_LOCATION);
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
- application.GetScene().Add( scrollView );
+ application.GetScene().Add(scrollView);
Vector2 stageSize = application.GetScene().GetSize();
- scrollView.SetProperty( Actor::Property::SIZE, stageSize);
- scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+ scrollView.SetProperty(Actor::Property::SIZE, stageSize);
+ scrollView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ scrollView.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
Vector2 START_POSITION = Vector2(10.0f, 10.0f);
// Try a vertical swipe.
// PerformGestureSwipe not used as a different initial direction was required
- Vector2 pos( START_POSITION + Vector2(0.0f, 15.0f) );
- TestStartPan( application, START_POSITION, pos, time );
+ Vector2 pos(START_POSITION + Vector2(0.0f, 15.0f));
+ TestStartPan(application, START_POSITION, pos, time);
time += Wait(application);
- for( int i = 0; i<45; i++ )
+ for(int i = 0; i < 45; i++)
{
pos += Vector2(0.0f, 1.0f);
- TestMovePan( application, pos, time );
- time += Wait( application );
+ TestMovePan(application, pos, time);
+ time += Wait(application);
}
pos += Vector2(0.0f, 1.0f);
- TestEndPan( application, pos, time );
- time += Wait( application );
+ TestEndPan(application, pos, time);
+ time += Wait(application);
// Take into account resampling done when prediction is off.
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition() - Vector2(0.0f, 0.5f), Vector2(10.0f, -50.0f), 0.25f, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition() - Vector2(0.0f, 0.5f), Vector2(10.0f, -50.0f), 0.25f, TEST_LOCATION);
scrollView.SetScrollingDirection(Dali::PanGestureDetector::DIRECTION_VERTICAL);
// Try a vertical swipe.
// PerformGestureSwipe not used as a different initial direction was required
- pos = ( START_POSITION + Vector2(0.0f, 15.0f) );
- TestStartPan( application, START_POSITION, pos, time );
+ pos = (START_POSITION + Vector2(0.0f, 15.0f));
+ TestStartPan(application, START_POSITION, pos, time);
time += Wait(application);
- for( int i = 0; i<45; i++ )
+ for(int i = 0; i < 45; i++)
{
pos += Vector2(0.0f, 1.0f);
- TestMovePan( application, pos, time );
- time += Wait( application );
+ TestMovePan(application, pos, time);
+ time += Wait(application);
}
pos += Vector2(0.0f, 1.0f);
- TestEndPan( application, pos, time );
- time += Wait( application );
+ TestEndPan(application, pos, time);
+ time += Wait(application);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition() - Vector2(0.0f, 0.5f), Vector2(10.0f, -50.0f), 0.25f, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition() - Vector2(0.0f, 0.5f), Vector2(10.0f, -50.0f), 0.25f, TEST_LOCATION);
scrollView.RemoveScrollingDirection(Dali::PanGestureDetector::DIRECTION_VERTICAL);
// Try a vertical swipe.
// PerformGestureSwipe not used as a different initial direction was required
- pos = ( START_POSITION + Vector2(0.0f, 15.0f) );
- TestStartPan( application, START_POSITION, pos, time );
+ pos = (START_POSITION + Vector2(0.0f, 15.0f));
+ TestStartPan(application, START_POSITION, pos, time);
time += Wait(application);
- for( int i = 0; i<45; i++ )
+ for(int i = 0; i < 45; i++)
{
pos += Vector2(0.0f, 1.0f);
- TestMovePan( application, pos, time );
- time += Wait( application );
+ TestMovePan(application, pos, time);
+ time += Wait(application);
}
pos += Vector2(0.0f, 1.0f);
- TestEndPan( application, pos, time );
- time += Wait( application );
+ TestEndPan(application, pos, time);
+ time += Wait(application);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition() - Vector2(0.0f, 0.5f), Vector2(10.0f, -50.0f), 0.25f, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition() - Vector2(0.0f, 0.5f), Vector2(10.0f, -50.0f), 0.25f, TEST_LOCATION);
END_TEST;
}
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
- application.GetScene().Add( scrollView );
+ application.GetScene().Add(scrollView);
Vector2 stageSize = application.GetScene().GetSize();
- scrollView.SetProperty( Actor::Property::SIZE, stageSize);
- scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+ scrollView.SetProperty(Actor::Property::SIZE, stageSize);
+ scrollView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ scrollView.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
- Vector2 START_POSITION = Vector2(10.0f, 10.0f);
- uint32_t time = 0;
+ Vector2 START_POSITION = Vector2(10.0f, 10.0f);
+ uint32_t time = 0;
scrollView.SetScrollingDirection(Dali::PanGestureDetector::DIRECTION_VERTICAL);
time += Wait(application);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), START_POSITION, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), START_POSITION, TEST_LOCATION);
// Try a vertical swipe.
// PerformGestureSwipe not used as a different initial direction was required
- Vector2 pos( START_POSITION + Vector2(0.0f, 15.0f) );
- TestStartPan( application, START_POSITION, pos, time );
+ Vector2 pos(START_POSITION + Vector2(0.0f, 15.0f));
+ TestStartPan(application, START_POSITION, pos, time);
time += Wait(application);
- for( int i = 0; i<45; i++ )
+ for(int i = 0; i < 45; i++)
{
pos += Vector2(0.0f, 1.0f);
- TestMovePan( application, pos, time );
- time += Wait( application );
+ TestMovePan(application, pos, time);
+ time += Wait(application);
}
pos += Vector2(0.0f, 1.0f);
- TestEndPan( application, pos, time );
- time += Wait( application );
+ TestEndPan(application, pos, time);
+ time += Wait(application);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition() - Vector2(0.0f, 0.5f), Vector2(10.0f, -50.0f), 0.25f, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition() - Vector2(0.0f, 0.5f), Vector2(10.0f, -50.0f), 0.25f, TEST_LOCATION);
scrollView.RemoveScrollingDirection(Dali::PanGestureDetector::DIRECTION_VERTICAL);
// When the horizontal direction is removed, there are no directions set and therefore all will work
time += Wait(application);
// Try a vertical swipe.
- Vector2 pos2( pos + Vector2(0.0f, 15.0f) );
- TestStartPan( application, pos, pos2, time );
+ Vector2 pos2(pos + Vector2(0.0f, 15.0f));
+ TestStartPan(application, pos, pos2, time);
time += Wait(application);
- for( int i = 0; i<45; i++ )
+ for(int i = 0; i < 45; i++)
{
pos2 += Vector2(0.0f, 1.0f);
- TestMovePan( application, pos2, time );
- time += Wait( application );
+ TestMovePan(application, pos2, time);
+ time += Wait(application);
}
pos2 += Vector2(0.0f, 1.0f);
- TestEndPan( application, pos2, time );
+ TestEndPan(application, pos2, time);
// The previous scroll should not have had any effect
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition() - Vector2(0.0f, 0.5f), Vector2(10.0f, -50.0f), 0.25f, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition() - Vector2(0.0f, 0.5f), Vector2(10.0f, -50.0f), 0.25f, TEST_LOCATION);
END_TEST;
}
tet_infoline(" UtcDaliToolkitScrollViewSetRulerXP");
ScrollView scrollView = ScrollView::New();
- application.GetScene().Add( scrollView );
- RulerPtr rulerX = new FixedRuler( 100.0f );
- rulerX->SetDomain( RulerDomain(0.0f, 800.0f, true) );
+ application.GetScene().Add(scrollView);
+ RulerPtr rulerX = new FixedRuler(100.0f);
+ rulerX->SetDomain(RulerDomain(0.0f, 800.0f, true));
- scrollView.SetRulerX( rulerX );
+ scrollView.SetRulerX(rulerX);
- scrollView.ScrollTo( 1, 0.0f );
+ scrollView.ScrollTo(1, 0.0f);
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(100.0f, 0.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), Vector2(100.0f, 0.0f), TEST_LOCATION);
- RulerPtr newRulerX = new FixedRuler( 200.0f );
- newRulerX->SetDomain( RulerDomain(0.0f, 800.0f, true) );
+ RulerPtr newRulerX = new FixedRuler(200.0f);
+ newRulerX->SetDomain(RulerDomain(0.0f, 800.0f, true));
- scrollView.SetRulerX( newRulerX );
+ scrollView.SetRulerX(newRulerX);
- scrollView.ScrollTo( 1, 0.0f );
+ scrollView.ScrollTo(1, 0.0f);
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(200.0f, 0.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), Vector2(200.0f, 0.0f), TEST_LOCATION);
END_TEST;
}
tet_infoline(" UtcDaliToolkitScrollViewSetRulerYP");
ScrollView scrollView = ScrollView::New();
- application.GetScene().Add( scrollView );
+ application.GetScene().Add(scrollView);
- RulerPtr rulerY = new FixedRuler( 200.0f );
- rulerY->SetDomain( RulerDomain(0.0f, 400.0f, true) );
+ RulerPtr rulerY = new FixedRuler(200.0f);
+ rulerY->SetDomain(RulerDomain(0.0f, 400.0f, true));
- scrollView.SetRulerY( rulerY );
+ scrollView.SetRulerY(rulerY);
- scrollView.ScrollTo( Vector2(0.0f, 350.0f), 0.0f );
+ scrollView.ScrollTo(Vector2(0.0f, 350.0f), 0.0f);
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(0.0f, 350.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), Vector2(0.0f, 350.0f), TEST_LOCATION);
- RulerPtr newRulerY = new FixedRuler( 100.0f );
- newRulerY->SetDomain( RulerDomain(0.0f, 200.0f, true) );
- scrollView.SetRulerY( newRulerY );
+ RulerPtr newRulerY = new FixedRuler(100.0f);
+ newRulerY->SetDomain(RulerDomain(0.0f, 200.0f, true));
+ scrollView.SetRulerY(newRulerY);
- scrollView.ScrollTo( Vector2(0.0f, 350.0f), 0.0f );
+ scrollView.ScrollTo(Vector2(0.0f, 350.0f), 0.0f);
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(0.0f, 200.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), Vector2(0.0f, 200.0f), TEST_LOCATION);
END_TEST;
}
ScrollView scrollView = ScrollView::New();
scrollView.SetMinimumSpeedForFlick(25.0f);
- DALI_TEST_EQUALS( scrollView.GetMinimumSpeedForFlick(), 25.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetMinimumSpeedForFlick(), 25.0f, TEST_LOCATION);
scrollView.SetMinimumSpeedForFlick(60.0f);
- DALI_TEST_EQUALS( scrollView.GetMinimumSpeedForFlick(), 60.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetMinimumSpeedForFlick(), 60.0f, TEST_LOCATION);
END_TEST;
}
ScrollView scrollView = ScrollView::New();
scrollView.SetMinimumDistanceForFlick(Vector2(30.0f, 15.0f));
- DALI_TEST_EQUALS( scrollView.GetMinimumDistanceForFlick(), Vector2(30.0f, 15.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetMinimumDistanceForFlick(), Vector2(30.0f, 15.0f), TEST_LOCATION);
scrollView.SetMinimumDistanceForFlick(Vector2(60.0f, 30.0f));
- DALI_TEST_EQUALS( scrollView.GetMinimumDistanceForFlick(), Vector2(60.0f, 30.0f), TEST_LOCATION);
+ DALI_TEST_EQUALS(scrollView.GetMinimumDistanceForFlick(), Vector2(60.0f, 30.0f), TEST_LOCATION);
END_TEST;
}
ScrollView scrollView = ScrollView::New();
// Disable Refresh signal (TET environment cannot use adaptor's Timer)
scrollView.SetWheelScrollDistanceStep(Vector2(30.0f, 15.0f));
- DALI_TEST_EQUALS( scrollView.GetWheelScrollDistanceStep(), Vector2(30.0f, 15.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetWheelScrollDistanceStep(), Vector2(30.0f, 15.0f), TEST_LOCATION);
scrollView.SetWheelScrollDistanceStep(Vector2(60.0f, 30.0f));
- DALI_TEST_EQUALS( scrollView.GetWheelScrollDistanceStep(), Vector2(60.0f, 30.0f), TEST_LOCATION);
+ DALI_TEST_EQUALS(scrollView.GetWheelScrollDistanceStep(), Vector2(60.0f, 30.0f), TEST_LOCATION);
END_TEST;
}
ScrollView scrollView = ScrollView::New();
// Create two scroll view effects
- Dali::Path path = Dali::Path::New();
- ScrollViewEffect effect = ScrollViewPagePathEffect::New(path, Vector3(-1.0f, 0.0f, 0.0f), Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3(100.0f, 100.0f, 0.0f), 2);
+ Dali::Path path = Dali::Path::New();
+ ScrollViewEffect effect = ScrollViewPagePathEffect::New(path, Vector3(-1.0f, 0.0f, 0.0f), Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3(100.0f, 100.0f, 0.0f), 2);
ScrollViewEffect newEffect = ScrollViewPagePathEffect::New(path, Vector3(-1.0f, 1.0f, 1.0f), Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3(200.0f, 150.0f, 0.0f), 5);
// Apply both effects
scrollView.ApplyEffect(effect);
scrollView.ApplyEffect(newEffect);
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
END_TEST;
}
ScrollView scrollView = ScrollView::New();
// Create two scroll view effects
- Dali::Path path = Dali::Path::New();
- ScrollViewEffect effect = ScrollViewPagePathEffect::New(path, Vector3(-1.0f, 0.0f, 0.0f), Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3(100.0f, 100.0f, 0.0f), 2);
+ Dali::Path path = Dali::Path::New();
+ ScrollViewEffect effect = ScrollViewPagePathEffect::New(path, Vector3(-1.0f, 0.0f, 0.0f), Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3(100.0f, 100.0f, 0.0f), 2);
ScrollViewEffect newEffect = ScrollViewPagePathEffect::New(path, Vector3(-1.0f, 1.0f, 1.0f), Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3(200.0f, 150.0f, 0.0f), 5);
// Apply both effects
try
{
scrollView.ApplyEffect(newEffect);
- tet_result( TET_FAIL );
+ tet_result(TET_FAIL);
}
- catch ( DaliException& e )
+ catch(DaliException& e)
{
- DALI_TEST_ASSERT( e, "!effectAlreadyExistsInScrollView", TEST_LOCATION );
+ DALI_TEST_ASSERT(e, "!effectAlreadyExistsInScrollView", TEST_LOCATION);
}
END_TEST;
ScrollView scrollView = ScrollView::New();
// Create two scroll view effects
- Dali::Path path = Dali::Path::New();
- ScrollViewEffect effect = ScrollViewPagePathEffect::New(path, Vector3(-1.0f, 0.0f, 0.0f), Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3(100.0f, 100.0f, 0.0f), 2);
+ Dali::Path path = Dali::Path::New();
+ ScrollViewEffect effect = ScrollViewPagePathEffect::New(path, Vector3(-1.0f, 0.0f, 0.0f), Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3(100.0f, 100.0f, 0.0f), 2);
ScrollViewEffect newEffect = ScrollViewPagePathEffect::New(path, Vector3(-1.0f, 1.0f, 1.0f), Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3(200.0f, 150.0f, 0.0f), 5);
// Apply both effects
scrollView.RemoveEffect(effect);
scrollView.RemoveEffect(newEffect);
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
END_TEST;
}
ScrollView scrollView = ScrollView::New();
// Create two scroll view effects
- Dali::Path path = Dali::Path::New();
- ScrollViewEffect effect = ScrollViewPagePathEffect::New(path, Vector3(-1.0f, 0.0f, 0.0f), Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3(100.0f, 100.0f, 0.0f), 2);
+ Dali::Path path = Dali::Path::New();
+ ScrollViewEffect effect = ScrollViewPagePathEffect::New(path, Vector3(-1.0f, 0.0f, 0.0f), Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3(100.0f, 100.0f, 0.0f), 2);
ScrollViewEffect newEffect = ScrollViewPagePathEffect::New(path, Vector3(-1.0f, 1.0f, 1.0f), Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3(200.0f, 150.0f, 0.0f), 5);
// Apply the first effect
try
{
scrollView.RemoveEffect(newEffect);
- tet_result( TET_FAIL );
+ tet_result(TET_FAIL);
}
- catch ( DaliException& e )
+ catch(DaliException& e)
{
- DALI_TEST_ASSERT( e, "effectExistedInScrollView", TEST_LOCATION );
+ DALI_TEST_ASSERT(e, "effectExistedInScrollView", TEST_LOCATION);
}
END_TEST;
ScrollView scrollView = ScrollView::New();
// Create two scroll view effects
- Dali::Path path = Dali::Path::New();
- ScrollViewEffect effect = ScrollViewPagePathEffect::New(path, Vector3(-1.0f, 0.0f, 0.0f), Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3(100.0f, 100.0f, 0.0f), 2);
+ Dali::Path path = Dali::Path::New();
+ ScrollViewEffect effect = ScrollViewPagePathEffect::New(path, Vector3(-1.0f, 0.0f, 0.0f), Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3(100.0f, 100.0f, 0.0f), 2);
ScrollViewEffect newEffect = ScrollViewPagePathEffect::New(path, Vector3(-1.0f, 1.0f, 1.0f), Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3(200.0f, 150.0f, 0.0f), 5);
// Apply both effects
try
{
scrollView.ApplyEffect(effect);
- tet_result( TET_FAIL );
+ tet_result(TET_FAIL);
}
- catch ( DaliException& e )
+ catch(DaliException& e)
{
- DALI_TEST_ASSERT( e, "!effectAlreadyExistsInScrollView", TEST_LOCATION );
+ DALI_TEST_ASSERT(e, "!effectAlreadyExistsInScrollView", TEST_LOCATION);
}
// Remove both effects
scrollView.ApplyEffect(effect);
scrollView.ApplyEffect(newEffect);
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
END_TEST;
}
// Remove effects when there is no effect applied previously
scrollView.RemoveAllEffects();
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
END_TEST;
}
ToolkitTestApplication application;
RulerDomain domainX = RulerDomain(0.0f, 200.0f, true);
- DALI_TEST_EQUALS( domainX.min, 0.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( domainX.max, 200.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( domainX.enabled, true, TEST_LOCATION);
+ DALI_TEST_EQUALS(domainX.min, 0.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(domainX.max, 200.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(domainX.enabled, true, TEST_LOCATION);
RulerDomain domainY = RulerDomain(100.0f, 500.0f, false);
- DALI_TEST_EQUALS( domainY.min, 100.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( domainY.max, 500.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( domainY.enabled, false, TEST_LOCATION);
+ DALI_TEST_EQUALS(domainY.min, 100.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(domainY.max, 500.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(domainY.enabled, false, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
RulerDomain domainX = RulerDomain(0.0f, 200.0f, true);
- DALI_TEST_EQUALS( domainX.GetSize(), 200.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(domainX.GetSize(), 200.0f, TEST_LOCATION);
RulerDomain domainY = RulerDomain(100.0f, 500.0f, false);
- DALI_TEST_EQUALS( domainY.GetSize(), 400.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(domainY.GetSize(), 400.0f, TEST_LOCATION);
END_TEST;
}
RulerDomain domainX = RulerDomain(0.0f, 200.0f, true);
float value = domainX.Clamp(50.0f, 100.0f, 1.0f);
- DALI_TEST_EQUALS( value, 50.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(value, 50.0f, TEST_LOCATION);
value = domainX.Clamp(300.0f, 20.0f, 1.0f);
- DALI_TEST_EQUALS( value, 180.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(value, 180.0f, TEST_LOCATION);
value = domainX.Clamp(300.0f, 20.0f, 0.5f);
- DALI_TEST_EQUALS( value, 80.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(value, 80.0f, TEST_LOCATION);
value = domainX.Clamp(250.0f, 200.0f, 2.0f);
- DALI_TEST_EQUALS( value, 200.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(value, 200.0f, TEST_LOCATION);
END_TEST;
}
RulerDomain domainX = RulerDomain(0.0f, 200.0f, true);
ClampState clamped;
- float value = domainX.Clamp(50.0f, 100.0f, 1.0f, clamped);
- DALI_TEST_EQUALS( value, 50.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( clamped, Dali::Toolkit::NOT_CLAMPED, TEST_LOCATION);
+ float value = domainX.Clamp(50.0f, 100.0f, 1.0f, clamped);
+ DALI_TEST_EQUALS(value, 50.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(clamped, Dali::Toolkit::NOT_CLAMPED, TEST_LOCATION);
value = domainX.Clamp(-100.0f, 200.0f, 1.0f, clamped);
- DALI_TEST_EQUALS( value, 0.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( clamped, Dali::Toolkit::CLAMPED_TO_MIN, TEST_LOCATION);
+ DALI_TEST_EQUALS(value, 0.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(clamped, Dali::Toolkit::CLAMPED_TO_MIN, TEST_LOCATION);
value = domainX.Clamp(300.0f, 20.0f, 1.0f, clamped);
- DALI_TEST_EQUALS( value, 180.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( clamped, Dali::Toolkit::CLAMPED_TO_MAX, TEST_LOCATION);
+ DALI_TEST_EQUALS(value, 180.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(clamped, Dali::Toolkit::CLAMPED_TO_MAX, TEST_LOCATION);
END_TEST;
}
tet_infoline(" UtcDaliToolkitScrollViewDefaultRulerConstructorP");
RulerPtr defaultRuler = new DefaultRuler();
- DALI_TEST_CHECK( defaultRuler );
+ DALI_TEST_CHECK(defaultRuler);
END_TEST;
}
RulerPtr defaultRuler = new DefaultRuler();
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitScrollViewFixedRulerConstructorP");
- RulerPtr fixedRuler = new FixedRuler( 100.0f );
- DALI_TEST_CHECK( fixedRuler );
+ RulerPtr fixedRuler = new FixedRuler(100.0f);
+ DALI_TEST_CHECK(fixedRuler);
- fixedRuler = new FixedRuler( 0.0f );
- DALI_TEST_CHECK( fixedRuler );
+ fixedRuler = new FixedRuler(0.0f);
+ DALI_TEST_CHECK(fixedRuler);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitScrollViewFixedRulerDestructorP");
- RulerPtr fixedRuler = new FixedRuler( 100.0f );
+ RulerPtr fixedRuler = new FixedRuler(100.0f);
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
END_TEST;
}
tet_infoline(" UtcDaliToolkitScrollViewRulerGetTypeP");
RulerPtr defaultRuler = new DefaultRuler();
- DALI_TEST_CHECK( defaultRuler );
- DALI_TEST_EQUALS( defaultRuler->GetType(), Dali::Toolkit::Ruler::FREE, TEST_LOCATION);
+ DALI_TEST_CHECK(defaultRuler);
+ DALI_TEST_EQUALS(defaultRuler->GetType(), Dali::Toolkit::Ruler::FREE, TEST_LOCATION);
- RulerPtr fixedRuler = new FixedRuler( 100.0f );
- DALI_TEST_CHECK( fixedRuler );
- DALI_TEST_EQUALS( fixedRuler->GetType(), Dali::Toolkit::Ruler::FIXED, TEST_LOCATION);
+ RulerPtr fixedRuler = new FixedRuler(100.0f);
+ DALI_TEST_CHECK(fixedRuler);
+ DALI_TEST_EQUALS(fixedRuler->GetType(), Dali::Toolkit::Ruler::FIXED, TEST_LOCATION);
END_TEST;
}
tet_infoline(" UtcDaliToolkitScrollViewRulerGetExtensionP");
RulerPtr defaultRuler = new DefaultRuler();
- DALI_TEST_CHECK( defaultRuler );
- DALI_TEST_CHECK( !defaultRuler->GetExtension() );
+ DALI_TEST_CHECK(defaultRuler);
+ DALI_TEST_CHECK(!defaultRuler->GetExtension());
- RulerPtr fixedRuler = new FixedRuler( 100.0f );
- DALI_TEST_CHECK( fixedRuler );
- DALI_TEST_CHECK( !fixedRuler->GetExtension() );
+ RulerPtr fixedRuler = new FixedRuler(100.0f);
+ DALI_TEST_CHECK(fixedRuler);
+ DALI_TEST_CHECK(!fixedRuler->GetExtension());
END_TEST;
}
RulerPtr ruler = new DefaultRuler();
- DALI_TEST_CHECK( ruler->IsEnabled() );
+ DALI_TEST_CHECK(ruler->IsEnabled());
ruler->Disable();
- DALI_TEST_CHECK( !ruler->IsEnabled() );
+ DALI_TEST_CHECK(!ruler->IsEnabled());
ruler->Enable();
- DALI_TEST_CHECK( ruler->IsEnabled() );
+ DALI_TEST_CHECK(ruler->IsEnabled());
END_TEST;
}
tet_infoline(" UtcDaliToolkitScrollViewRulerDomainEnableDisable");
RulerPtr ruler = new DefaultRuler();
- DALI_TEST_EQUALS( ruler->GetDomain().GetSize(), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(ruler->GetDomain().GetSize(), 1.0f, TEST_LOCATION);
- ruler->SetDomain( RulerDomain(0.0f, 100.0f, true) );
- DALI_TEST_EQUALS( ruler->GetDomain().GetSize(), 100.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( ruler->Clamp(-200.0f), 0.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( ruler->Clamp(200.0f), 100.0f, TEST_LOCATION );
+ ruler->SetDomain(RulerDomain(0.0f, 100.0f, true));
+ DALI_TEST_EQUALS(ruler->GetDomain().GetSize(), 100.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(ruler->Clamp(-200.0f), 0.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(ruler->Clamp(200.0f), 100.0f, TEST_LOCATION);
ruler->DisableDomain();
- DALI_TEST_EQUALS( ruler->GetDomain().GetSize(), 1.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( ruler->Clamp(-200.0f), -200.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( ruler->Clamp(200.0f), 200.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(ruler->GetDomain().GetSize(), 1.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(ruler->Clamp(-200.0f), -200.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(ruler->Clamp(200.0f), 200.0f, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitScrollViewRulerSnapAndClamp");
- RulerPtr ruler = new FixedRuler( 50.0f );
- ruler->SetDomain( RulerDomain(0.0f, 400.0f, true) );
+ RulerPtr ruler = new FixedRuler(50.0f);
+ ruler->SetDomain(RulerDomain(0.0f, 400.0f, true));
// default testing. (snap and clamp)
- DALI_TEST_EQUALS( ruler->SnapAndClamp(50.0f), 50.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( ruler->SnapAndClamp(30.0f), 50.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( ruler->SnapAndClamp(10.0f), 0.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( ruler->SnapAndClamp(-40.0f), 0.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( ruler->SnapAndClamp(390.0f), 400.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( ruler->SnapAndClamp(430.0f), 400.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(ruler->SnapAndClamp(50.0f), 50.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(ruler->SnapAndClamp(30.0f), 50.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(ruler->SnapAndClamp(10.0f), 0.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(ruler->SnapAndClamp(-40.0f), 0.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(ruler->SnapAndClamp(390.0f), 400.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(ruler->SnapAndClamp(430.0f), 400.0f, TEST_LOCATION);
// bias testing.
- DALI_TEST_EQUALS( ruler->SnapAndClamp(40.0f, 0.0f), 0.0f, TEST_LOCATION); // Flick Left
- DALI_TEST_EQUALS( ruler->SnapAndClamp(40.0f, 0.5f), 50.0f, TEST_LOCATION); // No Flick
- DALI_TEST_EQUALS( ruler->SnapAndClamp(40.0f, 1.0f), 50.0f, TEST_LOCATION); // Flick Right
+ DALI_TEST_EQUALS(ruler->SnapAndClamp(40.0f, 0.0f), 0.0f, TEST_LOCATION); // Flick Left
+ DALI_TEST_EQUALS(ruler->SnapAndClamp(40.0f, 0.5f), 50.0f, TEST_LOCATION); // No Flick
+ DALI_TEST_EQUALS(ruler->SnapAndClamp(40.0f, 1.0f), 50.0f, TEST_LOCATION); // Flick Right
- DALI_TEST_EQUALS( ruler->SnapAndClamp(20.0f, 0.0f), 0.0f, TEST_LOCATION); // Flick Left
- DALI_TEST_EQUALS( ruler->SnapAndClamp(20.0f, 0.5f), 0.0f, TEST_LOCATION); // No Flick
- DALI_TEST_EQUALS( ruler->SnapAndClamp(20.0f, 1.0f), 50.0f, TEST_LOCATION); // Flick Right
+ DALI_TEST_EQUALS(ruler->SnapAndClamp(20.0f, 0.0f), 0.0f, TEST_LOCATION); // Flick Left
+ DALI_TEST_EQUALS(ruler->SnapAndClamp(20.0f, 0.5f), 0.0f, TEST_LOCATION); // No Flick
+ DALI_TEST_EQUALS(ruler->SnapAndClamp(20.0f, 1.0f), 50.0f, TEST_LOCATION); // Flick Right
// length testing.
- DALI_TEST_EQUALS( ruler->SnapAndClamp(-10.0f, 0.5f, 10.0f), 0.0f, TEST_LOCATION); // 10 units long (over left boundary)
- DALI_TEST_EQUALS( ruler->SnapAndClamp(-5.0f, 0.5f, 10.0f), 0.0f, TEST_LOCATION); // 10 units long (slightly ovr left boundary)
- DALI_TEST_EQUALS( ruler->SnapAndClamp(300.0f, 0.5f, 10.0f), 300.0f, TEST_LOCATION); // 10 units long (not over a boundary)
- DALI_TEST_EQUALS( ruler->SnapAndClamp(395.0f, 0.5f, 10.0f), 390.0f, TEST_LOCATION); // 10 units long (slightly over right boundary)
- DALI_TEST_EQUALS( ruler->SnapAndClamp(500.0f, 0.5f, 10.0f), 390.0f, TEST_LOCATION); // 10 units long (over right boundary)
+ DALI_TEST_EQUALS(ruler->SnapAndClamp(-10.0f, 0.5f, 10.0f), 0.0f, TEST_LOCATION); // 10 units long (over left boundary)
+ DALI_TEST_EQUALS(ruler->SnapAndClamp(-5.0f, 0.5f, 10.0f), 0.0f, TEST_LOCATION); // 10 units long (slightly ovr left boundary)
+ DALI_TEST_EQUALS(ruler->SnapAndClamp(300.0f, 0.5f, 10.0f), 300.0f, TEST_LOCATION); // 10 units long (not over a boundary)
+ DALI_TEST_EQUALS(ruler->SnapAndClamp(395.0f, 0.5f, 10.0f), 390.0f, TEST_LOCATION); // 10 units long (slightly over right boundary)
+ DALI_TEST_EQUALS(ruler->SnapAndClamp(500.0f, 0.5f, 10.0f), 390.0f, TEST_LOCATION); // 10 units long (over right boundary)
// scale testing.
- DALI_TEST_EQUALS( ruler->SnapAndClamp(-100.0f, 0.5f, 0.0f, 2.0f), 0.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( ruler->SnapAndClamp(50.0f, 0.5f, 0.0f, 2.0f), 50.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( ruler->SnapAndClamp(700.0f, 0.5f, 0.0f, 2.0f), 700.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( ruler->SnapAndClamp(850.0f, 0.5f, 0.0f, 2.0f), 800.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(ruler->SnapAndClamp(-100.0f, 0.5f, 0.0f, 2.0f), 0.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(ruler->SnapAndClamp(50.0f, 0.5f, 0.0f, 2.0f), 50.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(ruler->SnapAndClamp(700.0f, 0.5f, 0.0f, 2.0f), 700.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(ruler->SnapAndClamp(850.0f, 0.5f, 0.0f, 2.0f), 800.0f, TEST_LOCATION);
// clamp state testing.
ClampState clamped;
- DALI_TEST_EQUALS( ruler->SnapAndClamp(50.0f, 0.5f, 0.0f, 1.0f, clamped), 50.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( clamped, NOT_CLAMPED, TEST_LOCATION );
- DALI_TEST_EQUALS( ruler->SnapAndClamp(30.0f, 0.5f, 0.0f, 1.0f, clamped), 50.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( clamped, NOT_CLAMPED, TEST_LOCATION );
- DALI_TEST_EQUALS( ruler->SnapAndClamp(10.0f, 0.5f, 0.0f, 1.0f, clamped), 0.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( clamped, NOT_CLAMPED, TEST_LOCATION );
- DALI_TEST_EQUALS( ruler->SnapAndClamp(-40.0f, 0.5f, 0.0f, 1.0f, clamped), 0.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( clamped, CLAMPED_TO_MIN, TEST_LOCATION );
- DALI_TEST_EQUALS( ruler->SnapAndClamp(390.0f, 0.5f, 0.0f, 1.0f, clamped), 400.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( clamped, NOT_CLAMPED, TEST_LOCATION );
- DALI_TEST_EQUALS( ruler->SnapAndClamp(430.0f, 0.5f, 0.0f, 1.0f, clamped), 400.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( clamped, CLAMPED_TO_MAX, TEST_LOCATION );
+ DALI_TEST_EQUALS(ruler->SnapAndClamp(50.0f, 0.5f, 0.0f, 1.0f, clamped), 50.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(clamped, NOT_CLAMPED, TEST_LOCATION);
+ DALI_TEST_EQUALS(ruler->SnapAndClamp(30.0f, 0.5f, 0.0f, 1.0f, clamped), 50.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(clamped, NOT_CLAMPED, TEST_LOCATION);
+ DALI_TEST_EQUALS(ruler->SnapAndClamp(10.0f, 0.5f, 0.0f, 1.0f, clamped), 0.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(clamped, NOT_CLAMPED, TEST_LOCATION);
+ DALI_TEST_EQUALS(ruler->SnapAndClamp(-40.0f, 0.5f, 0.0f, 1.0f, clamped), 0.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(clamped, CLAMPED_TO_MIN, TEST_LOCATION);
+ DALI_TEST_EQUALS(ruler->SnapAndClamp(390.0f, 0.5f, 0.0f, 1.0f, clamped), 400.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(clamped, NOT_CLAMPED, TEST_LOCATION);
+ DALI_TEST_EQUALS(ruler->SnapAndClamp(430.0f, 0.5f, 0.0f, 1.0f, clamped), 400.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(clamped, CLAMPED_TO_MAX, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitScrollViewFixedRulerGetPositionFromPageP");
- RulerPtr rulerNormal = new FixedRuler( 25.0f );
- rulerNormal->SetDomain( RulerDomain(10.0f, 90.0f, true) );
+ RulerPtr rulerNormal = new FixedRuler(25.0f);
+ rulerNormal->SetDomain(RulerDomain(10.0f, 90.0f, true));
unsigned int volume;
- float position;
+ float position;
position = rulerNormal->GetPositionFromPage(1, volume, true);
- DALI_TEST_EQUALS( position, 35.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( volume, 0u, TEST_LOCATION );
+ DALI_TEST_EQUALS(position, 35.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(volume, 0u, TEST_LOCATION);
position = rulerNormal->GetPositionFromPage(2, volume, true);
- DALI_TEST_EQUALS( position, 60.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( volume, 0u, TEST_LOCATION );
+ DALI_TEST_EQUALS(position, 60.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(volume, 0u, TEST_LOCATION);
// Disable the ruler
rulerNormal->Disable();
position = rulerNormal->GetPositionFromPage(1, volume, true);
- DALI_TEST_EQUALS( position, 10.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( volume, 1u, TEST_LOCATION );
+ DALI_TEST_EQUALS(position, 10.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(volume, 1u, TEST_LOCATION);
position = rulerNormal->GetPositionFromPage(2, volume, true);
- DALI_TEST_EQUALS( position, 10.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( volume, 2u, TEST_LOCATION );
+ DALI_TEST_EQUALS(position, 10.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(volume, 2u, TEST_LOCATION);
END_TEST;
}
tet_infoline(" UtcDaliToolkitScrollViewDefaultRulerGetTotalPagesP");
RulerPtr defaultRuler = new DefaultRuler();
- DALI_TEST_CHECK( defaultRuler );
- DALI_TEST_EQUALS( defaultRuler->GetTotalPages(), 1u, TEST_LOCATION);
+ DALI_TEST_CHECK(defaultRuler);
+ DALI_TEST_EQUALS(defaultRuler->GetTotalPages(), 1u, TEST_LOCATION);
END_TEST;
}
tet_infoline(" UtcDaliToolkitScrollViewDefaultRulerGetPageFromPositionP");
RulerPtr defaultRuler = new DefaultRuler();
- DALI_TEST_CHECK( defaultRuler );
- DALI_TEST_EQUALS( defaultRuler->GetPageFromPosition(100.0f, true), 0u, TEST_LOCATION);
- DALI_TEST_EQUALS( defaultRuler->GetPageFromPosition(-300.0f, false), 0u, TEST_LOCATION);
+ DALI_TEST_CHECK(defaultRuler);
+ DALI_TEST_EQUALS(defaultRuler->GetPageFromPosition(100.0f, true), 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(defaultRuler->GetPageFromPosition(-300.0f, false), 0u, TEST_LOCATION);
END_TEST;
}
tet_infoline(" UtcDaliToolkitScrollViewDefaultRulerGetPositionFromPageP");
RulerPtr defaultRuler = new DefaultRuler();
- DALI_TEST_CHECK( defaultRuler );
+ DALI_TEST_CHECK(defaultRuler);
unsigned int volume;
- DALI_TEST_EQUALS( defaultRuler->GetPositionFromPage(0, volume, true), 0.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( volume, 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(defaultRuler->GetPositionFromPage(0, volume, true), 0.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(volume, 0u, TEST_LOCATION);
- DALI_TEST_EQUALS( defaultRuler->GetPositionFromPage(3, volume, false), 0.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( volume, 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(defaultRuler->GetPositionFromPage(3, volume, false), 0.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(volume, 0u, TEST_LOCATION);
END_TEST;
}
tet_infoline(" UtcDaliToolkitScrollViewDefaultRulerSnapP");
RulerPtr defaultRuler = new DefaultRuler();
- DALI_TEST_CHECK( defaultRuler );
+ DALI_TEST_CHECK(defaultRuler);
- DALI_TEST_EQUALS( defaultRuler->Snap(50.0f, 0.5f), 50.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( defaultRuler->Snap(-120.0f, 1.0f), -120.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(defaultRuler->Snap(50.0f, 0.5f), 50.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(defaultRuler->Snap(-120.0f, 1.0f), -120.0f, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitScrollViewFixedRulerGetTotalPagesP");
- RulerPtr fixedRuler = new FixedRuler( 100.0f );
- fixedRuler->SetDomain( RulerDomain(0.0f, 400.0f, true) );
+ RulerPtr fixedRuler = new FixedRuler(100.0f);
+ fixedRuler->SetDomain(RulerDomain(0.0f, 400.0f, true));
fixedRuler->Enable();
- DALI_TEST_EQUALS( fixedRuler->GetTotalPages(), 4u, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->GetTotalPages(), 4u, TEST_LOCATION);
fixedRuler->Disable();
- DALI_TEST_EQUALS( fixedRuler->GetTotalPages(), 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->GetTotalPages(), 1u, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitScrollViewFixedRulerGetPageFromPositionP");
- RulerPtr fixedRuler = new FixedRuler( 100.0f );
- fixedRuler->SetDomain( RulerDomain(0.0f, 400.0f, true) );
+ RulerPtr fixedRuler = new FixedRuler(100.0f);
+ fixedRuler->SetDomain(RulerDomain(0.0f, 400.0f, true));
fixedRuler->Enable();
- DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(250.0f, true), 3u, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(250.0f, false), 3u, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(-350.0f, true), 1u, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(-350.0f, false), 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->GetPageFromPosition(250.0f, true), 3u, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->GetPageFromPosition(250.0f, false), 3u, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->GetPageFromPosition(-350.0f, true), 1u, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->GetPageFromPosition(-350.0f, false), 0u, TEST_LOCATION);
fixedRuler->Disable();
- DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(250.0f, true), 0u, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(250.0f, false), 0u, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(-350.0f, true), 0u, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(-350.0f, false), 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->GetPageFromPosition(250.0f, true), 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->GetPageFromPosition(250.0f, false), 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->GetPageFromPosition(-350.0f, true), 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->GetPageFromPosition(-350.0f, false), 0u, TEST_LOCATION);
// Set domain size to be smaller than the ruler space
- fixedRuler->SetDomain( RulerDomain(0.0f, 50.0f, true) );
+ fixedRuler->SetDomain(RulerDomain(0.0f, 50.0f, true));
fixedRuler->Enable();
- DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(250.0f, true), 0u, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(250.0f, false), 3u, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(-350.0f, true), 0u, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(-350.0f, false), 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->GetPageFromPosition(250.0f, true), 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->GetPageFromPosition(250.0f, false), 3u, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->GetPageFromPosition(-350.0f, true), 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->GetPageFromPosition(-350.0f, false), 0u, TEST_LOCATION);
fixedRuler->Disable();
- DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(250.0f, true), 0u, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(250.0f, false), 0u, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(-350.0f, true), 0u, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(-350.0f, false), 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->GetPageFromPosition(250.0f, true), 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->GetPageFromPosition(250.0f, false), 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->GetPageFromPosition(-350.0f, true), 0u, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->GetPageFromPosition(-350.0f, false), 0u, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitScrollViewFixedRulerSnapP");
- RulerPtr fixedRuler = new FixedRuler( 100.0f );
- fixedRuler->SetDomain( RulerDomain(0.0f, 400.0f, true) );
-
- DALI_TEST_EQUALS( fixedRuler->Snap(-30.0f, 0.0f), -100.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(-70.0f, 0.0f), -100.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(-120.0f, 0.0f), -200.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(-480.0f, 0.0f), -500.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(20.0f, 0.0f), 0.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(50.0f, 0.0f), 0.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(80.0f, 0.0f), 0.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(100.0f, 0.0f), 100.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(120.0f, 0.0f), 100.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(250.0f, 0.0f), 200.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(620.0f, 0.0f), 600.0f, TEST_LOCATION);
-
- DALI_TEST_EQUALS( fixedRuler->Snap(-30.0f, 0.5f), 0.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(-70.0f, 0.5f), -100.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(-120.0f, 0.5f), -100.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(-480.0f, 0.5f), -500.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(20.0f, 0.5f), 0.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(50.0f, 0.5f), 100.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(80.0f, 0.5f), 100.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(100.0f, 0.5f), 100.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(120.0f, 0.5f), 100.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(250.0f, 0.5f), 300.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(620.0f, 0.5f), 600.0f, TEST_LOCATION);
-
- DALI_TEST_EQUALS( fixedRuler->Snap(-30.0f, 1.0f), 0.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(-70.0f, 1.0f), 0.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(-120.0f, 1.0f), -100.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(-480.0f, 1.0f), -400.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(20.0f, 1.0f), 100.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(50.0f, 1.0f), 100.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(80.0f, 1.0f), 100.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(100.0f, 1.0f), 200.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(120.0f, 1.0f), 200.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(250.0f, 1.0f), 300.0f, TEST_LOCATION);
- DALI_TEST_EQUALS( fixedRuler->Snap(620.0f, 1.0f), 700.0f, TEST_LOCATION);
+ RulerPtr fixedRuler = new FixedRuler(100.0f);
+ fixedRuler->SetDomain(RulerDomain(0.0f, 400.0f, true));
+
+ DALI_TEST_EQUALS(fixedRuler->Snap(-30.0f, 0.0f), -100.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(-70.0f, 0.0f), -100.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(-120.0f, 0.0f), -200.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(-480.0f, 0.0f), -500.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(20.0f, 0.0f), 0.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(50.0f, 0.0f), 0.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(80.0f, 0.0f), 0.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(100.0f, 0.0f), 100.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(120.0f, 0.0f), 100.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(250.0f, 0.0f), 200.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(620.0f, 0.0f), 600.0f, TEST_LOCATION);
+
+ DALI_TEST_EQUALS(fixedRuler->Snap(-30.0f, 0.5f), 0.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(-70.0f, 0.5f), -100.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(-120.0f, 0.5f), -100.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(-480.0f, 0.5f), -500.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(20.0f, 0.5f), 0.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(50.0f, 0.5f), 100.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(80.0f, 0.5f), 100.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(100.0f, 0.5f), 100.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(120.0f, 0.5f), 100.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(250.0f, 0.5f), 300.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(620.0f, 0.5f), 600.0f, TEST_LOCATION);
+
+ DALI_TEST_EQUALS(fixedRuler->Snap(-30.0f, 1.0f), 0.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(-70.0f, 1.0f), 0.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(-120.0f, 1.0f), -100.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(-480.0f, 1.0f), -400.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(20.0f, 1.0f), 100.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(50.0f, 1.0f), 100.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(80.0f, 1.0f), 100.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(100.0f, 1.0f), 200.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(120.0f, 1.0f), 200.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(250.0f, 1.0f), 300.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(fixedRuler->Snap(620.0f, 1.0f), 700.0f, TEST_LOCATION);
END_TEST;
}
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
- application.GetScene().Add( scrollView );
+ application.GetScene().Add(scrollView);
Vector2 stageSize = application.GetScene().GetSize();
- scrollView.SetProperty( Actor::Property::SIZE, stageSize);
- scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+ scrollView.SetProperty(Actor::Property::SIZE, stageSize);
+ scrollView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ scrollView.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
// Position rulers.
RulerPtr rulerX = new DefaultRuler();
RulerPtr rulerY = new DefaultRuler();
- rulerX->SetDomain( RulerDomain(0.0f, stageSize.width + CLAMP_EXCESS_WIDTH, true) );
- rulerY->SetDomain( RulerDomain(0.0f, stageSize.height + CLAMP_EXCESS_HEIGHT, true) );
+ rulerX->SetDomain(RulerDomain(0.0f, stageSize.width + CLAMP_EXCESS_WIDTH, true));
+ rulerY->SetDomain(RulerDomain(0.0f, stageSize.height + CLAMP_EXCESS_HEIGHT, true));
scrollView.SetRulerX(rulerX);
scrollView.SetRulerY(rulerY);
// Add an Actor to ScrollView,
Actor a = Actor::New();
scrollView.Add(a);
- a.SetProperty( Actor::Property::POSITION, TEST_ACTOR_POSITION);
+ a.SetProperty(Actor::Property::POSITION, TEST_ACTOR_POSITION);
Wait(application);
- const Vector2 target = Vector2(100.0f, 100.0f);
+ const Vector2 target = Vector2(100.0f, 100.0f);
const Vector2 target2 = Vector2(200.0f, 200.0f);
- Constraint constraint = Constraint::New<Vector3>( scrollView, Actor::Property::POSITION, MoveActorConstraint );
- constraint.AddSource( Source(scrollView, ScrollView::Property::SCROLL_POSITION) );
+ Constraint constraint = Constraint::New<Vector3>(scrollView, Actor::Property::POSITION, MoveActorConstraint);
+ constraint.AddSource(Source(scrollView, ScrollView::Property::SCROLL_POSITION));
constraint.SetRemoveAction(Constraint::DISCARD);
scrollView.ApplyConstraintToChildren(constraint);
- scrollView.ScrollTo( target, 0.0f );
+ scrollView.ScrollTo(target, 0.0f);
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target, TEST_LOCATION );
- scrollView.ScrollTo( target2 );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), target, TEST_LOCATION);
+ scrollView.ScrollTo(target2);
Wait(application, RENDER_DELAY_SCROLL);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION);
END_TEST;
}
// Set up a scrollView...
ScrollView scrollView = ScrollView::New();
- application.GetScene().Add( scrollView );
+ application.GetScene().Add(scrollView);
Vector2 stageSize = application.GetScene().GetSize();
- scrollView.SetProperty( Actor::Property::SIZE, stageSize);
- scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+ scrollView.SetProperty(Actor::Property::SIZE, stageSize);
+ scrollView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ scrollView.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
// Position rulers.
RulerPtr rulerX = new DefaultRuler();
RulerPtr rulerY = new DefaultRuler();
- rulerX->SetDomain( RulerDomain(0.0f, stageSize.width + CLAMP_EXCESS_WIDTH, true) );
- rulerY->SetDomain( RulerDomain(0.0f, stageSize.height + CLAMP_EXCESS_HEIGHT, true) );
+ rulerX->SetDomain(RulerDomain(0.0f, stageSize.width + CLAMP_EXCESS_WIDTH, true));
+ rulerY->SetDomain(RulerDomain(0.0f, stageSize.height + CLAMP_EXCESS_HEIGHT, true));
scrollView.SetRulerX(rulerX);
scrollView.SetRulerY(rulerY);
// Add an Actor to ScrollView,
Actor a = Actor::New();
scrollView.Add(a);
- a.SetProperty( Actor::Property::POSITION, TEST_ACTOR_POSITION);
+ a.SetProperty(Actor::Property::POSITION, TEST_ACTOR_POSITION);
Wait(application);
- const Vector2 target = Vector2(100.0f, 100.0f);
+ const Vector2 target = Vector2(100.0f, 100.0f);
const Vector2 target2 = Vector2(200.0f, 200.0f);
- Constraint constraint = Constraint::New<Vector3>( scrollView, Actor::Property::POSITION, WrapActorConstraint );
- constraint.AddSource( LocalSource( Actor::Property::SCALE ) );
- constraint.AddSource( LocalSource( Actor::Property::ANCHOR_POINT ) );
- constraint.AddSource( LocalSource( Actor::Property::SIZE ) );
- constraint.AddSource( Source( scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) );
- constraint.AddSource( Source( scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) );
- constraint.AddSource( Source( scrollView, Toolkit::ScrollView::Property::WRAP ) );
+ Constraint constraint = Constraint::New<Vector3>(scrollView, Actor::Property::POSITION, WrapActorConstraint);
+ constraint.AddSource(LocalSource(Actor::Property::SCALE));
+ constraint.AddSource(LocalSource(Actor::Property::ANCHOR_POINT));
+ constraint.AddSource(LocalSource(Actor::Property::SIZE));
+ constraint.AddSource(Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN));
+ constraint.AddSource(Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX));
+ constraint.AddSource(Source(scrollView, Toolkit::ScrollView::Property::WRAP));
constraint.SetRemoveAction(Constraint::DISCARD);
scrollView.ApplyConstraintToChildren(constraint);
- scrollView.ScrollTo( target, 0.0f );
+ scrollView.ScrollTo(target, 0.0f);
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target, TEST_LOCATION );
- scrollView.ScrollTo( target2 );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), target, TEST_LOCATION);
+ scrollView.ScrollTo(target2);
Wait(application, RENDER_DELAY_SCROLL);
- DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION);
scrollView.Remove(a);
Wait(application);
int UtcDaliToolkitScrollViewGesturePageLimit(void)
{
ToolkitTestApplication application;
- tet_infoline( " UtcDaliToolkitScrollViewGesturePageLimit" );
+ tet_infoline(" UtcDaliToolkitScrollViewGesturePageLimit");
// Set up a scrollView.
ScrollView scrollView = ScrollView::New();
// Do not rely on stage size for UTC tests.
- Vector2 viewPageSize( 720.0f, 1280.0f );
- scrollView.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
- scrollView.SetProperty( Actor::Property::SIZE, viewPageSize );
- scrollView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- scrollView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
- scrollView.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, 0.0f, 0.0f ));
+ Vector2 viewPageSize(720.0f, 1280.0f);
+ scrollView.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
+ scrollView.SetProperty(Actor::Property::SIZE, viewPageSize);
+ scrollView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ scrollView.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+ scrollView.SetProperty(Actor::Property::POSITION, Vector3(0.0f, 0.0f, 0.0f));
// Position rulers.
// We set the X ruler to fixed to give us pages to snap to.
- Dali::Toolkit::FixedRuler* rulerX = new Dali::Toolkit::FixedRuler( viewPageSize.width );
+ Dali::Toolkit::FixedRuler* rulerX = new Dali::Toolkit::FixedRuler(viewPageSize.width);
// Note: The 3x page width is arbitary, but we need enough to show that we are
// capping page movement by the page limiter, and not the domain.
- rulerX->SetDomain( Dali::Toolkit::RulerDomain( 0.0f, viewPageSize.width * 3.0f, false ) );
+ rulerX->SetDomain(Dali::Toolkit::RulerDomain(0.0f, viewPageSize.width * 3.0f, false));
Dali::Toolkit::RulerPtr rulerY = new Dali::Toolkit::DefaultRuler();
rulerY->Disable();
- scrollView.SetRulerX( rulerX );
- scrollView.SetRulerY( rulerY );
+ scrollView.SetRulerX(rulerX);
+ scrollView.SetRulerY(rulerY);
- scrollView.SetWrapMode( false );
- scrollView.SetScrollSensitive( true );
+ scrollView.SetWrapMode(false);
+ scrollView.SetScrollSensitive(true);
- application.GetScene().Add( scrollView );
+ application.GetScene().Add(scrollView);
// Set up a gesture to perform.
- Vector2 startPos( 50.0f, 0.0f );
- Vector2 direction( -5.0f, 0.0f );
- int frames = 200;
+ Vector2 startPos(50.0f, 0.0f);
+ Vector2 direction(-5.0f, 0.0f);
+ int frames = 200;
// Force starting position.
- scrollView.ScrollTo( startPos, 0.0f );
+ scrollView.ScrollTo(startPos, 0.0f);
uint32_t time = 0;
- time += Wait( application );
+ time += Wait(application);
// Deliberately skip the "Finished" part of the gesture, so we can read the coordinates before the snap begins.
- Vector2 currentPos( PerformGestureSwipe( application, startPos, direction, frames - 1, time, false ) );
+ Vector2 currentPos(PerformGestureSwipe(application, startPos, direction, frames - 1, time, false));
// Confirm the final X coord has not moved more than one page from the start X position.
- DALI_TEST_GREATER( ( startPos.x + viewPageSize.width ), scrollView.GetCurrentScrollPosition().x, TEST_LOCATION );
+ DALI_TEST_GREATER((startPos.x + viewPageSize.width), scrollView.GetCurrentScrollPosition().x, TEST_LOCATION);
// Finish the gesture and wait for the snap.
currentPos += direction;
TestEndPan(application, currentPos, time);
// We add RENDER_FRAME_INTERVAL on to wait for an extra frame (for the last "finished" gesture to complete first.
- time += Wait( application, RENDER_DELAY_SCROLL + RENDER_FRAME_INTERVAL );
+ time += Wait(application, RENDER_DELAY_SCROLL + RENDER_FRAME_INTERVAL);
// Confirm the final X coord has snapped to exactly one page ahead of the start page.
- DALI_TEST_EQUALS( viewPageSize.width, scrollView.GetCurrentScrollPosition().x, Math::MACHINE_EPSILON_0, TEST_LOCATION );
+ DALI_TEST_EQUALS(viewPageSize.width, scrollView.GetCurrentScrollPosition().x, Math::MACHINE_EPSILON_0, TEST_LOCATION);
END_TEST;
}
// Event side properties
// Test "wrapEnabled" property
- DALI_TEST_CHECK( scrollView.GetPropertyIndex("wrapEnabled") == ScrollView::Property::WRAP_ENABLED );
- scrollView.SetProperty( ScrollView::Property::WRAP_ENABLED, true );
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::WRAP_ENABLED).Get<bool>(), true, TEST_LOCATION );
+ DALI_TEST_CHECK(scrollView.GetPropertyIndex("wrapEnabled") == ScrollView::Property::WRAP_ENABLED);
+ scrollView.SetProperty(ScrollView::Property::WRAP_ENABLED, true);
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::WRAP_ENABLED).Get<bool>(), true, TEST_LOCATION);
// Test "panningEnabled" property
- DALI_TEST_CHECK( scrollView.GetPropertyIndex("panningEnabled") == ScrollView::Property::PANNING_ENABLED );
- scrollView.SetProperty( ScrollView::Property::PANNING_ENABLED, false );
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::PANNING_ENABLED).Get<bool>(), false, TEST_LOCATION );
+ DALI_TEST_CHECK(scrollView.GetPropertyIndex("panningEnabled") == ScrollView::Property::PANNING_ENABLED);
+ scrollView.SetProperty(ScrollView::Property::PANNING_ENABLED, false);
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::PANNING_ENABLED).Get<bool>(), false, TEST_LOCATION);
// Test "axisAutoLockEnabled" property
- DALI_TEST_CHECK( scrollView.GetPropertyIndex("axisAutoLockEnabled") == ScrollView::Property::AXIS_AUTO_LOCK_ENABLED );
- scrollView.SetProperty( ScrollView::Property::AXIS_AUTO_LOCK_ENABLED, false );
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::AXIS_AUTO_LOCK_ENABLED).Get<bool>(), false, TEST_LOCATION );
+ DALI_TEST_CHECK(scrollView.GetPropertyIndex("axisAutoLockEnabled") == ScrollView::Property::AXIS_AUTO_LOCK_ENABLED);
+ scrollView.SetProperty(ScrollView::Property::AXIS_AUTO_LOCK_ENABLED, false);
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::AXIS_AUTO_LOCK_ENABLED).Get<bool>(), false, TEST_LOCATION);
// Test "wheelScrollDistanceStep" property
- DALI_TEST_CHECK( scrollView.GetPropertyIndex("wheelScrollDistanceStep") == ScrollView::Property::WHEEL_SCROLL_DISTANCE_STEP );
- scrollView.SetProperty( ScrollView::Property::WHEEL_SCROLL_DISTANCE_STEP, Vector2(100.0f, 50.0f) );
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::WHEEL_SCROLL_DISTANCE_STEP).Get<Vector2>(), Vector2(100.0f, 50.0f), TEST_LOCATION );
+ DALI_TEST_CHECK(scrollView.GetPropertyIndex("wheelScrollDistanceStep") == ScrollView::Property::WHEEL_SCROLL_DISTANCE_STEP);
+ scrollView.SetProperty(ScrollView::Property::WHEEL_SCROLL_DISTANCE_STEP, Vector2(100.0f, 50.0f));
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::WHEEL_SCROLL_DISTANCE_STEP).Get<Vector2>(), Vector2(100.0f, 50.0f), TEST_LOCATION);
// Test "overshootEnabled" property
- DALI_TEST_CHECK( scrollView.GetPropertyIndex("overshootEnabled") == Scrollable::Property::OVERSHOOT_ENABLED );
- DALI_TEST_EQUALS( scrollView.GetProperty(Scrollable::Property::OVERSHOOT_ENABLED).Get<bool>(), scrollView.IsOvershootEnabled(), TEST_LOCATION );
- scrollView.SetProperty( Scrollable::Property::OVERSHOOT_ENABLED, false );
- DALI_TEST_EQUALS( scrollView.GetProperty(Scrollable::Property::OVERSHOOT_ENABLED).Get<bool>(), false, TEST_LOCATION );
+ DALI_TEST_CHECK(scrollView.GetPropertyIndex("overshootEnabled") == Scrollable::Property::OVERSHOOT_ENABLED);
+ DALI_TEST_EQUALS(scrollView.GetProperty(Scrollable::Property::OVERSHOOT_ENABLED).Get<bool>(), scrollView.IsOvershootEnabled(), TEST_LOCATION);
+ scrollView.SetProperty(Scrollable::Property::OVERSHOOT_ENABLED, false);
+ DALI_TEST_EQUALS(scrollView.GetProperty(Scrollable::Property::OVERSHOOT_ENABLED).Get<bool>(), false, TEST_LOCATION);
// Animatable properties
// Test "scrollPosition" property
- DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollPosition") == ScrollView::Property::SCROLL_POSITION );
- scrollView.SetProperty( ScrollView::Property::SCROLL_POSITION, Vector2(320.0f, 550.0f) );
+ DALI_TEST_CHECK(scrollView.GetPropertyIndex("scrollPosition") == ScrollView::Property::SCROLL_POSITION);
+ scrollView.SetProperty(ScrollView::Property::SCROLL_POSITION, Vector2(320.0f, 550.0f));
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_POSITION).Get<Vector2>(), Vector2(320.0f, 550.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::SCROLL_POSITION).Get<Vector2>(), Vector2(320.0f, 550.0f), TEST_LOCATION);
// Test "scrollPrePosition", "scrollPrePositionX" and "scrollPrePositionY" properties
- DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollPrePosition") == ScrollView::Property::SCROLL_PRE_POSITION );
- scrollView.SetProperty( ScrollView::Property::SCROLL_PRE_POSITION, Vector2(300.0f, 500.0f) );
+ DALI_TEST_CHECK(scrollView.GetPropertyIndex("scrollPrePosition") == ScrollView::Property::SCROLL_PRE_POSITION);
+ scrollView.SetProperty(ScrollView::Property::SCROLL_PRE_POSITION, Vector2(300.0f, 500.0f));
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION).Get<Vector2>(), Vector2(300.0f, 500.0f), TEST_LOCATION );
-
- DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollPrePositionX") == ScrollView::Property::SCROLL_PRE_POSITION_X );
- DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollPrePositionY") == ScrollView::Property::SCROLL_PRE_POSITION_Y );
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_X).Get<float>(), 300.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_Y).Get<float>(), 500.0f, TEST_LOCATION );
- scrollView.SetProperty( ScrollView::Property::SCROLL_PRE_POSITION_X, 400.0f );
- scrollView.SetProperty( ScrollView::Property::SCROLL_PRE_POSITION_Y, 600.0f );
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION).Get<Vector2>(), Vector2(300.0f, 500.0f), TEST_LOCATION);
+
+ DALI_TEST_CHECK(scrollView.GetPropertyIndex("scrollPrePositionX") == ScrollView::Property::SCROLL_PRE_POSITION_X);
+ DALI_TEST_CHECK(scrollView.GetPropertyIndex("scrollPrePositionY") == ScrollView::Property::SCROLL_PRE_POSITION_Y);
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_X).Get<float>(), 300.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_Y).Get<float>(), 500.0f, TEST_LOCATION);
+ scrollView.SetProperty(ScrollView::Property::SCROLL_PRE_POSITION_X, 400.0f);
+ scrollView.SetProperty(ScrollView::Property::SCROLL_PRE_POSITION_Y, 600.0f);
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_X).Get<float>(), 400.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_Y).Get<float>(), 600.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION).Get<Vector2>(), Vector2(400.0f, 600.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_X).Get<float>(), 400.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_Y).Get<float>(), 600.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION).Get<Vector2>(), Vector2(400.0f, 600.0f), TEST_LOCATION);
// Test "scrollPrePositionMax", "scrollPrePositionMaxX" and "scrollPrePositionMaxY" properties
- DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollPrePositionMax") == ScrollView::Property::SCROLL_PRE_POSITION_MAX );
- scrollView.SetProperty( ScrollView::Property::SCROLL_PRE_POSITION_MAX, Vector2(100.0f, 200.0f) );
+ DALI_TEST_CHECK(scrollView.GetPropertyIndex("scrollPrePositionMax") == ScrollView::Property::SCROLL_PRE_POSITION_MAX);
+ scrollView.SetProperty(ScrollView::Property::SCROLL_PRE_POSITION_MAX, Vector2(100.0f, 200.0f));
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_MAX).Get<Vector2>(), Vector2(100.0f, 200.0f), TEST_LOCATION );
-
- DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollPrePositionMaxX") == ScrollView::Property::SCROLL_PRE_POSITION_MAX_X );
- DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollPrePositionMaxY") == ScrollView::Property::SCROLL_PRE_POSITION_MAX_Y );
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_MAX_X).Get<float>(), 100.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_MAX_Y).Get<float>(), 200.0f, TEST_LOCATION );
- scrollView.SetProperty( ScrollView::Property::SCROLL_PRE_POSITION_MAX_X, 300.0f );
- scrollView.SetProperty( ScrollView::Property::SCROLL_PRE_POSITION_MAX_Y, 400.0f );
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_MAX).Get<Vector2>(), Vector2(100.0f, 200.0f), TEST_LOCATION);
+
+ DALI_TEST_CHECK(scrollView.GetPropertyIndex("scrollPrePositionMaxX") == ScrollView::Property::SCROLL_PRE_POSITION_MAX_X);
+ DALI_TEST_CHECK(scrollView.GetPropertyIndex("scrollPrePositionMaxY") == ScrollView::Property::SCROLL_PRE_POSITION_MAX_Y);
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_MAX_X).Get<float>(), 100.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_MAX_Y).Get<float>(), 200.0f, TEST_LOCATION);
+ scrollView.SetProperty(ScrollView::Property::SCROLL_PRE_POSITION_MAX_X, 300.0f);
+ scrollView.SetProperty(ScrollView::Property::SCROLL_PRE_POSITION_MAX_Y, 400.0f);
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_MAX_X).Get<float>(), 300.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_MAX_Y).Get<float>(), 400.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_MAX).Get<Vector2>(), Vector2(300.0f, 400.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_MAX_X).Get<float>(), 300.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_MAX_Y).Get<float>(), 400.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::SCROLL_PRE_POSITION_MAX).Get<Vector2>(), Vector2(300.0f, 400.0f), TEST_LOCATION);
// Test "overshootX" property
- DALI_TEST_CHECK( scrollView.GetPropertyIndex("overshootX") == ScrollView::Property::OVERSHOOT_X );
- scrollView.SetProperty( ScrollView::Property::OVERSHOOT_X, 0.8f );
+ DALI_TEST_CHECK(scrollView.GetPropertyIndex("overshootX") == ScrollView::Property::OVERSHOOT_X);
+ scrollView.SetProperty(ScrollView::Property::OVERSHOOT_X, 0.8f);
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::OVERSHOOT_X).Get<float>(), 0.8f, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::OVERSHOOT_X).Get<float>(), 0.8f, TEST_LOCATION);
// Test "overshootY" property
- DALI_TEST_CHECK( scrollView.GetPropertyIndex("overshootY") == ScrollView::Property::OVERSHOOT_Y );
- scrollView.SetProperty( ScrollView::Property::OVERSHOOT_Y, 0.8f );
+ DALI_TEST_CHECK(scrollView.GetPropertyIndex("overshootY") == ScrollView::Property::OVERSHOOT_Y);
+ scrollView.SetProperty(ScrollView::Property::OVERSHOOT_Y, 0.8f);
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::OVERSHOOT_Y).Get<float>(), 0.8f, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::OVERSHOOT_Y).Get<float>(), 0.8f, TEST_LOCATION);
// Test "scrollFinal", "scrollFinalX" and "scrollFinalY" properties
- DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollFinal") == ScrollView::Property::SCROLL_FINAL );
- scrollView.SetProperty( ScrollView::Property::SCROLL_FINAL, Vector2(200.0f, 300.0f) );
+ DALI_TEST_CHECK(scrollView.GetPropertyIndex("scrollFinal") == ScrollView::Property::SCROLL_FINAL);
+ scrollView.SetProperty(ScrollView::Property::SCROLL_FINAL, Vector2(200.0f, 300.0f));
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_FINAL).Get<Vector2>(), Vector2(200.0f, 300.0f), TEST_LOCATION );
-
- DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollFinalX") == ScrollView::Property::SCROLL_FINAL_X );
- DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollFinalY") == ScrollView::Property::SCROLL_FINAL_Y );
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_FINAL_X).Get<float>(), 200.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_FINAL_Y).Get<float>(), 300.0f, TEST_LOCATION );
- scrollView.SetProperty( ScrollView::Property::SCROLL_FINAL_X, 500.0f );
- scrollView.SetProperty( ScrollView::Property::SCROLL_FINAL_Y, 600.0f );
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::SCROLL_FINAL).Get<Vector2>(), Vector2(200.0f, 300.0f), TEST_LOCATION);
+
+ DALI_TEST_CHECK(scrollView.GetPropertyIndex("scrollFinalX") == ScrollView::Property::SCROLL_FINAL_X);
+ DALI_TEST_CHECK(scrollView.GetPropertyIndex("scrollFinalY") == ScrollView::Property::SCROLL_FINAL_Y);
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::SCROLL_FINAL_X).Get<float>(), 200.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::SCROLL_FINAL_Y).Get<float>(), 300.0f, TEST_LOCATION);
+ scrollView.SetProperty(ScrollView::Property::SCROLL_FINAL_X, 500.0f);
+ scrollView.SetProperty(ScrollView::Property::SCROLL_FINAL_Y, 600.0f);
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_FINAL_X).Get<float>(), 500.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_FINAL_Y).Get<float>(), 600.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_FINAL).Get<Vector2>(), Vector2(500.0f, 600.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::SCROLL_FINAL_X).Get<float>(), 500.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::SCROLL_FINAL_Y).Get<float>(), 600.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::SCROLL_FINAL).Get<Vector2>(), Vector2(500.0f, 600.0f), TEST_LOCATION);
// Test "wrap" property
- DALI_TEST_CHECK( scrollView.GetPropertyIndex("wrap") == ScrollView::Property::WRAP );
- scrollView.SetProperty( ScrollView::Property::WRAP, false );
+ DALI_TEST_CHECK(scrollView.GetPropertyIndex("wrap") == ScrollView::Property::WRAP);
+ scrollView.SetProperty(ScrollView::Property::WRAP, false);
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::WRAP).Get<bool>(), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::WRAP).Get<bool>(), false, TEST_LOCATION);
// Test "panning" property
- DALI_TEST_CHECK( scrollView.GetPropertyIndex("panning") == ScrollView::Property::PANNING );
- scrollView.SetProperty( ScrollView::Property::PANNING, true );
+ DALI_TEST_CHECK(scrollView.GetPropertyIndex("panning") == ScrollView::Property::PANNING);
+ scrollView.SetProperty(ScrollView::Property::PANNING, true);
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::PANNING).Get<bool>(), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::PANNING).Get<bool>(), true, TEST_LOCATION);
// Test "scrolling" property
- DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrolling") == ScrollView::Property::SCROLLING );
- scrollView.SetProperty( ScrollView::Property::SCROLLING, false );
+ DALI_TEST_CHECK(scrollView.GetPropertyIndex("scrolling") == ScrollView::Property::SCROLLING);
+ scrollView.SetProperty(ScrollView::Property::SCROLLING, false);
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLLING).Get<bool>(), false, TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::SCROLLING).Get<bool>(), false, TEST_LOCATION);
// Test "scrollDomainSize", "scrollDomainSizeX" and "scrollDomainSizeY" properties
- DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollDomainSize") == ScrollView::Property::SCROLL_DOMAIN_SIZE );
- scrollView.SetProperty( ScrollView::Property::SCROLL_DOMAIN_SIZE, Vector2(1200.0f, 1300.0f) );
+ DALI_TEST_CHECK(scrollView.GetPropertyIndex("scrollDomainSize") == ScrollView::Property::SCROLL_DOMAIN_SIZE);
+ scrollView.SetProperty(ScrollView::Property::SCROLL_DOMAIN_SIZE, Vector2(1200.0f, 1300.0f));
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_DOMAIN_SIZE).Get<Vector2>(), Vector2(1200.0f, 1300.0f), TEST_LOCATION );
-
- DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollDomainSizeX") == ScrollView::Property::SCROLL_DOMAIN_SIZE_X );
- DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollDomainSizeY") == ScrollView::Property::SCROLL_DOMAIN_SIZE_Y );
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_DOMAIN_SIZE_X).Get<float>(), 1200.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_DOMAIN_SIZE_Y).Get<float>(), 1300.0f, TEST_LOCATION );
- scrollView.SetProperty( ScrollView::Property::SCROLL_DOMAIN_SIZE_X, 1500.0f );
- scrollView.SetProperty( ScrollView::Property::SCROLL_DOMAIN_SIZE_Y, 1600.0f );
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::SCROLL_DOMAIN_SIZE).Get<Vector2>(), Vector2(1200.0f, 1300.0f), TEST_LOCATION);
+
+ DALI_TEST_CHECK(scrollView.GetPropertyIndex("scrollDomainSizeX") == ScrollView::Property::SCROLL_DOMAIN_SIZE_X);
+ DALI_TEST_CHECK(scrollView.GetPropertyIndex("scrollDomainSizeY") == ScrollView::Property::SCROLL_DOMAIN_SIZE_Y);
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::SCROLL_DOMAIN_SIZE_X).Get<float>(), 1200.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::SCROLL_DOMAIN_SIZE_Y).Get<float>(), 1300.0f, TEST_LOCATION);
+ scrollView.SetProperty(ScrollView::Property::SCROLL_DOMAIN_SIZE_X, 1500.0f);
+ scrollView.SetProperty(ScrollView::Property::SCROLL_DOMAIN_SIZE_Y, 1600.0f);
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_DOMAIN_SIZE_X).Get<float>(), 1500.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_DOMAIN_SIZE_Y).Get<float>(), 1600.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_DOMAIN_SIZE).Get<Vector2>(), Vector2(1500.0f, 1600.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::SCROLL_DOMAIN_SIZE_X).Get<float>(), 1500.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::SCROLL_DOMAIN_SIZE_Y).Get<float>(), 1600.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::SCROLL_DOMAIN_SIZE).Get<Vector2>(), Vector2(1500.0f, 1600.0f), TEST_LOCATION);
// Test "scrollDomainOffset" property
- DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollDomainOffset") == ScrollView::Property::SCROLL_DOMAIN_OFFSET );
- scrollView.SetProperty( ScrollView::Property::SCROLL_DOMAIN_OFFSET, Vector2(500.0f, 200.0f) );
+ DALI_TEST_CHECK(scrollView.GetPropertyIndex("scrollDomainOffset") == ScrollView::Property::SCROLL_DOMAIN_OFFSET);
+ scrollView.SetProperty(ScrollView::Property::SCROLL_DOMAIN_OFFSET, Vector2(500.0f, 200.0f));
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_DOMAIN_OFFSET).Get<Vector2>(), Vector2(500.0f, 200.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::SCROLL_DOMAIN_OFFSET).Get<Vector2>(), Vector2(500.0f, 200.0f), TEST_LOCATION);
// Test "scrollPositionDelta" property
- DALI_TEST_CHECK( scrollView.GetPropertyIndex("scrollPositionDelta") == ScrollView::Property::SCROLL_POSITION_DELTA );
- scrollView.SetProperty( ScrollView::Property::SCROLL_POSITION_DELTA, Vector2(10.0f, 30.0f) );
+ DALI_TEST_CHECK(scrollView.GetPropertyIndex("scrollPositionDelta") == ScrollView::Property::SCROLL_POSITION_DELTA);
+ scrollView.SetProperty(ScrollView::Property::SCROLL_POSITION_DELTA, Vector2(10.0f, 30.0f));
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::SCROLL_POSITION_DELTA).Get<Vector2>(), Vector2(10.0f, 30.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::SCROLL_POSITION_DELTA).Get<Vector2>(), Vector2(10.0f, 30.0f), TEST_LOCATION);
// Test "startPagePosition" property
- DALI_TEST_CHECK( scrollView.GetPropertyIndex("startPagePosition") == ScrollView::Property::START_PAGE_POSITION );
- scrollView.SetProperty( ScrollView::Property::START_PAGE_POSITION, Vector3(50.0f, 100.0f, 20.0f) );
+ DALI_TEST_CHECK(scrollView.GetPropertyIndex("startPagePosition") == ScrollView::Property::START_PAGE_POSITION);
+ scrollView.SetProperty(ScrollView::Property::START_PAGE_POSITION, Vector3(50.0f, 100.0f, 20.0f));
Wait(application);
- DALI_TEST_EQUALS( scrollView.GetProperty(ScrollView::Property::START_PAGE_POSITION).Get<Vector3>(), Vector3(50.0f, 100.0f, 20.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(scrollView.GetProperty(ScrollView::Property::START_PAGE_POSITION).Get<Vector3>(), Vector3(50.0f, 100.0f, 20.0f), TEST_LOCATION);
END_TEST;
}
ScrollView scrollView = ScrollView::New();
// Do not rely on stage size for UTC tests.
- Vector2 viewPageSize( 720.0f, 1280.0f );
- scrollView.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
- scrollView.SetProperty( Actor::Property::SIZE, viewPageSize );
- scrollView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- scrollView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
- scrollView.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, 0.0f, 0.0f ));
+ Vector2 viewPageSize(720.0f, 1280.0f);
+ scrollView.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
+ scrollView.SetProperty(Actor::Property::SIZE, viewPageSize);
+ scrollView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ scrollView.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+ scrollView.SetProperty(Actor::Property::POSITION, Vector3(0.0f, 0.0f, 0.0f));
// Position rulers.
// We set the X ruler to fixed to give us pages to snap to.
- Dali::Toolkit::FixedRuler* rulerX = new Dali::Toolkit::FixedRuler( viewPageSize.width );
+ Dali::Toolkit::FixedRuler* rulerX = new Dali::Toolkit::FixedRuler(viewPageSize.width);
// Note: The 3x page width is arbitary, but we need enough to show that we are
// capping page movement by the page limiter, and not the domain.
- rulerX->SetDomain( Dali::Toolkit::RulerDomain( 0.0f, viewPageSize.width * 3.0f, false ) );
+ rulerX->SetDomain(Dali::Toolkit::RulerDomain(0.0f, viewPageSize.width * 3.0f, false));
Dali::Toolkit::RulerPtr rulerY = new Dali::Toolkit::DefaultRuler();
rulerY->Disable();
- scrollView.SetRulerX( rulerX );
- scrollView.SetRulerY( rulerY );
+ scrollView.SetRulerX(rulerX);
+ scrollView.SetRulerY(rulerY);
- scrollView.SetWrapMode( false );
+ scrollView.SetWrapMode(false);
- application.GetScene().Add( scrollView );
+ application.GetScene().Add(scrollView);
//Connect to wheel event signal
- scrollView.WheelEventSignal().Connect( &OnWheelEvent );
+ scrollView.WheelEventSignal().Connect(&OnWheelEvent);
- DALI_TEST_CHECK( !gOnWheelEventCalled );
+ DALI_TEST_CHECK(!gOnWheelEventCalled);
// Render and notify
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 );
+ 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);
// Set X ruler to free
Dali::Toolkit::DefaultRuler* defaultRuler = new Dali::Toolkit::DefaultRuler();
- scrollView.SetRulerX( defaultRuler );
+ scrollView.SetRulerX(defaultRuler);
// Perform a wheel event
gOnWheelEventCalled = false;
- application.ProcessEvent( wheelEvent );
- DALI_TEST_CHECK( gOnWheelEventCalled );
+ application.ProcessEvent(wheelEvent);
+ DALI_TEST_CHECK(gOnWheelEventCalled);
// Enable Y ruler
rulerY->Enable();
// Perform a wheel event
gOnWheelEventCalled = false;
- application.ProcessEvent( wheelEvent );
- DALI_TEST_CHECK( gOnWheelEventCalled );
+ application.ProcessEvent(wheelEvent);
+ DALI_TEST_CHECK(gOnWheelEventCalled);
// Wait until it finishes scrolling
Wait(application, RENDER_DELAY_SCROLL);
// Set Y ruler to fixed
- Dali::Toolkit::FixedRuler* fixedRulerY = new Dali::Toolkit::FixedRuler( viewPageSize.height );
- scrollView.SetRulerY( fixedRulerY );
+ Dali::Toolkit::FixedRuler* fixedRulerY = new Dali::Toolkit::FixedRuler(viewPageSize.height);
+ scrollView.SetRulerY(fixedRulerY);
// Perform a wheel event
gOnWheelEventCalled = false;
- application.ProcessEvent( wheelEvent );
- DALI_TEST_CHECK( gOnWheelEventCalled );
+ application.ProcessEvent(wheelEvent);
+ DALI_TEST_CHECK(gOnWheelEventCalled);
END_TEST;
}
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
#include <stdlib.h>
+#include <iostream>
// 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.h>
#include <dali-toolkit/dali-toolkit.h>
+#include <dali.h>
#include <dali/integration-api/events/touch-event-integ.h>
using namespace Dali;
namespace
{
-
-const int RENDER_FRAME_INTERVAL = 16; ///< Duration of each frame in ms. (at approx 60FPS)
+const int RENDER_FRAME_INTERVAL = 16; ///< Duration of each frame in ms. (at approx 60FPS)
/*
* Simulate time passed by.
{
int time = 0;
- for(int i = 0; i <= ( duration / RENDER_FRAME_INTERVAL); i++)
+ for(int i = 0; i <= (duration / RENDER_FRAME_INTERVAL); i++)
{
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
{
if(gridSize <= Math::MACHINE_EPSILON_0)
{
- return new DefaultRuler();
+ return new DefaultRuler();
}
return new FixedRuler(gridSize);
}
// Callback probes.
-static bool gOnScrollStartCalled; ///< Whether the OnScrollStart signal was invoked.
-static bool gOnScrollUpdateCalled; ///< Whether the OnScrollUpdate signal was invoked.
-static bool gOnScrollCompleteCalled; ///< Whether the OnScrollComplete signal was invoked.
-static Vector3 gConstraintResult; ///< Result from constraint.
+static bool gOnScrollStartCalled; ///< Whether the OnScrollStart signal was invoked.
+static bool gOnScrollUpdateCalled; ///< Whether the OnScrollUpdate signal was invoked.
+static bool gOnScrollCompleteCalled; ///< Whether the OnScrollComplete signal was invoked.
+static Vector3 gConstraintResult; ///< Result from constraint.
-static std::vector< Actor > gPages; ///< Keeps track of all the pages for applying effects.
-typedef std::vector< Actor >::iterator ActorIter;
+static std::vector<Actor> gPages; ///< Keeps track of all the pages for applying effects.
+typedef std::vector<Actor>::iterator ActorIter;
static void ResetScrollCallbackResults()
{
- gOnScrollStartCalled = false;
- gOnScrollUpdateCalled = false;
+ gOnScrollStartCalled = false;
+ gOnScrollUpdateCalled = false;
gOnScrollCompleteCalled = false;
}
*
* @param[in] position The current scroll position.
*/
-static void OnScrollStart( const Vector2& position )
+static void OnScrollStart(const Vector2& position)
{
gOnScrollStartCalled = true;
}
*
* @param[in] position The current scroll position.
*/
-static void OnScrollUpdate( const Vector2& position )
+static void OnScrollUpdate(const Vector2& position)
{
gOnScrollUpdateCalled = true;
}
*
* @param[in] position The current scroll position.
*/
-static void OnScrollComplete( const Vector2& position )
+static void OnScrollComplete(const Vector2& position)
{
gOnScrollCompleteCalled = true;
}
Constraint constraint;
ScrollView scrollView = ScrollView::New();
- scrollView.SetProperty( Actor::Property::SIZE, size);
- scrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
- scrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
+ scrollView.SetProperty(Actor::Property::SIZE, size);
+ scrollView.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+ scrollView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
- constraint = Constraint::New<Dali::Vector3>( scrollView, Dali::Actor::Property::SIZE, Dali::EqualToConstraint() );
- constraint.AddSource( Dali::ParentSource( Dali::Actor::Property::SIZE ) );
+ constraint = Constraint::New<Dali::Vector3>(scrollView, Dali::Actor::Property::SIZE, Dali::EqualToConstraint());
+ constraint.AddSource(Dali::ParentSource(Dali::Actor::Property::SIZE));
constraint.Apply();
scrollView.SetWrapMode(false);
- scrollView.ScrollStartedSignal().Connect( &OnScrollStart );
- scrollView.ScrollUpdatedSignal().Connect( &OnScrollUpdate );
- scrollView.ScrollCompletedSignal().Connect( &OnScrollComplete );
- scene.Add( scrollView );
+ scrollView.ScrollStartedSignal().Connect(&OnScrollStart);
+ scrollView.ScrollUpdatedSignal().Connect(&OnScrollUpdate);
+ scrollView.ScrollCompletedSignal().Connect(&OnScrollComplete);
+ scene.Add(scrollView);
RulerPtr rulerX = CreateRuler(size.width);
RulerPtr rulerY = CreateRuler(size.height);
if(columns > 1)
rulerY->Disable();
}
- scrollView.SetRulerX( rulerX );
- scrollView.SetRulerY( rulerY );
- scene.Add( scrollView );
+ scrollView.SetRulerX(rulerX);
+ scrollView.SetRulerY(rulerY);
+ scene.Add(scrollView);
Actor container = Actor::New();
- container.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- container.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
- container.SetProperty( Actor::Property::SIZE, size );
- scrollView.Add( container );
+ container.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ container.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+ container.SetProperty(Actor::Property::SIZE, size);
+ scrollView.Add(container);
- constraint = Constraint::New<Vector3>( container, Actor::Property::SIZE, EqualToConstraint() );
- constraint.AddSource( Dali::ParentSource( Dali::Actor::Property::SIZE ) );
+ constraint = Constraint::New<Vector3>(container, Actor::Property::SIZE, EqualToConstraint());
+ constraint.AddSource(Dali::ParentSource(Dali::Actor::Property::SIZE));
constraint.Apply();
gPages.clear();
- for(int row = 0;row<rows;row++)
+ for(int row = 0; row < rows; row++)
{
- for(int column = 0;column<columns;column++)
+ for(int column = 0; column < columns; column++)
{
Actor page = Actor::New();
- constraint = Constraint::New<Vector3>( page, Actor::Property::SIZE, EqualToConstraint() );
- constraint.AddSource( Dali::ParentSource( Dali::Actor::Property::SIZE ) );
+ constraint = Constraint::New<Vector3>(page, Actor::Property::SIZE, EqualToConstraint());
+ constraint.AddSource(Dali::ParentSource(Dali::Actor::Property::SIZE));
constraint.Apply();
- page.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- page.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
- page.SetProperty( Actor::Property::POSITION, Vector2( column * size.x, row * size.y ));
+ page.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ page.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+ page.SetProperty(Actor::Property::POSITION, Vector2(column * size.x, row * size.y));
container.Add(page);
gPages.push_back(page);
ScrollViewPagePathEffect effect;
- DALI_TEST_CHECK( !effect );
+ DALI_TEST_CHECK(!effect);
- BaseHandle handle = ScrollViewPagePathEffect::New(Dali::Path::New(), Vector3::ZERO,Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3::ZERO,0);
+ BaseHandle handle = ScrollViewPagePathEffect::New(Dali::Path::New(), Vector3::ZERO, Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3::ZERO, 0);
- DALI_TEST_CHECK( handle );
+ DALI_TEST_CHECK(handle);
effect = ScrollViewPagePathEffect::DownCast(handle);
- DALI_TEST_CHECK( effect );
+ DALI_TEST_CHECK(effect);
END_TEST;
}
Vector2 size = application.GetScene().GetSize();
ScrollView scrollView = SetupTestScrollView(application.GetScene(), 1, 3, size);
- Actor testPage = gPages[2];
+ Actor testPage = gPages[2];
Wait(application, 500);
//Create path
- float xHalfSize( size.x * 0.5f);
+ float xHalfSize(size.x * 0.5f);
- Dali::Path path = Dali::Path::New();
+ Dali::Path path = Dali::Path::New();
Dali::Property::Array points;
points.Resize(3);
- points[0] = Vector3( xHalfSize, 0.0f, -xHalfSize);
- points[1] = Vector3( 0.0f, 0.0f, 0.0f );
- points[2] = Vector3( -xHalfSize, 0.0f, -xHalfSize);
- path.SetProperty( Path::Property::POINTS, points );
+ points[0] = Vector3(xHalfSize, 0.0f, -xHalfSize);
+ points[1] = Vector3(0.0f, 0.0f, 0.0f);
+ points[2] = Vector3(-xHalfSize, 0.0f, -xHalfSize);
+ path.SetProperty(Path::Property::POINTS, points);
Dali::Property::Array controlPoints;
controlPoints.Resize(4);
- controlPoints[0] = Vector3( xHalfSize, 0.0f, 0.0f );
- controlPoints[1] = Vector3( xHalfSize, 0.0f, 0.0f );
- controlPoints[2] = Vector3(-xHalfSize, 0.0f, 0.0f );
- controlPoints[3] = Vector3(-xHalfSize, 0.0f, 0.0f );
- path.SetProperty( Path::Property::CONTROL_POINTS, controlPoints );
+ controlPoints[0] = Vector3(xHalfSize, 0.0f, 0.0f);
+ controlPoints[1] = Vector3(xHalfSize, 0.0f, 0.0f);
+ controlPoints[2] = Vector3(-xHalfSize, 0.0f, 0.0f);
+ controlPoints[3] = Vector3(-xHalfSize, 0.0f, 0.0f);
+ path.SetProperty(Path::Property::CONTROL_POINTS, controlPoints);
ScrollViewPagePathEffect effect = ScrollViewPagePathEffect::New(path,
Vector3::ZERO,
Toolkit::ScrollView::Property::SCROLL_FINAL_X,
- Vector3(size.x,size.y,0.0f),
+ Vector3(size.x, size.y, 0.0f),
3);
scrollView.ApplyEffect(effect);
{
Actor page = *pageIter;
page.RemoveConstraints();
- Constraint constraint = Constraint::New<Vector3>( page, Actor::Property::SIZE, EqualToConstraint() );
- constraint.AddSource( ParentSource( Actor::Property::SIZE ) );
+ Constraint constraint = Constraint::New<Vector3>(page, Actor::Property::SIZE, EqualToConstraint());
+ constraint.AddSource(ParentSource(Actor::Property::SIZE));
constraint.Apply();
effect.ApplyToPage(page, pageCounter++);
}
}
// test that the test page has reached centre of screen
- Vector3 pagePos = testPage.GetCurrentProperty< Vector3 >( Actor::Property::POSITION );
+ Vector3 pagePos = testPage.GetCurrentProperty<Vector3>(Actor::Property::POSITION);
DALI_TEST_EQUALS(pagePos, Vector3::ZERO, Math::MACHINE_EPSILON_0, TEST_LOCATION);
CleanupTest();
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
-#include <stdlib.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
+#include <stdlib.h>
+#include <iostream>
#include <dali-toolkit/devel-api/shader-effects/alpha-discard-effect.h>
#include <dali-toolkit/devel-api/shader-effects/dissolve-effect.h>
ToolkitTestApplication application;
Property::Map effect = Toolkit::CreateAlphaDiscardEffect();
- DALI_TEST_CHECK( !effect.Empty() );
+ DALI_TEST_CHECK(!effect.Empty());
- Property::Value* customShaderValue = effect.Find( Toolkit::Visual::Property::SHADER );
- DALI_TEST_CHECK( customShaderValue );
+ Property::Value* customShaderValue = effect.Find(Toolkit::Visual::Property::SHADER);
+ DALI_TEST_CHECK(customShaderValue);
Property::Map customShader;
- DALI_TEST_CHECK( customShaderValue->Get( customShader ) );
+ DALI_TEST_CHECK(customShaderValue->Get(customShader));
- Property::Value* vertexShaderValue = customShader.Find( Visual::Shader::Property::VERTEX_SHADER );
- DALI_TEST_CHECK( !vertexShaderValue );
+ Property::Value* vertexShaderValue = customShader.Find(Visual::Shader::Property::VERTEX_SHADER);
+ DALI_TEST_CHECK(!vertexShaderValue);
- Property::Value* fragmentShaderValue = customShader.Find( Visual::Shader::Property::FRAGMENT_SHADER );
- DALI_TEST_CHECK( fragmentShaderValue );
+ Property::Value* fragmentShaderValue = customShader.Find(Visual::Shader::Property::FRAGMENT_SHADER);
+ DALI_TEST_CHECK(fragmentShaderValue);
std::string fragmentShader;
- DALI_TEST_CHECK( fragmentShaderValue->Get( fragmentShader ) );
- DALI_TEST_CHECK( !fragmentShader.empty() );
+ DALI_TEST_CHECK(fragmentShaderValue->Get(fragmentShader));
+ DALI_TEST_CHECK(!fragmentShader.empty());
- Property::Value* gridXValue = customShader.Find( Visual::Shader::Property::SUBDIVIDE_GRID_X );
- DALI_TEST_CHECK( !gridXValue );
+ Property::Value* gridXValue = customShader.Find(Visual::Shader::Property::SUBDIVIDE_GRID_X);
+ DALI_TEST_CHECK(!gridXValue);
- Property::Value* gridYValue = customShader.Find( Visual::Shader::Property::SUBDIVIDE_GRID_Y );
- DALI_TEST_CHECK( !gridYValue );
+ Property::Value* gridYValue = customShader.Find(Visual::Shader::Property::SUBDIVIDE_GRID_Y);
+ DALI_TEST_CHECK(!gridYValue);
- Property::Value* hintsValue = customShader.Find( Visual::Shader::Property::HINTS );
- DALI_TEST_CHECK( !hintsValue );
+ Property::Value* hintsValue = customShader.Find(Visual::Shader::Property::HINTS);
+ DALI_TEST_CHECK(!hintsValue);
END_TEST;
}
-int UtcDaliCreateDissolveEffect( bool highPrecision )
+int UtcDaliCreateDissolveEffect(bool highPrecision)
{
ToolkitTestApplication application;
- Property::Map effect = Toolkit::CreateDissolveEffect( highPrecision );
- DALI_TEST_CHECK( !effect.Empty() );
+ Property::Map effect = Toolkit::CreateDissolveEffect(highPrecision);
+ DALI_TEST_CHECK(!effect.Empty());
- Property::Value* customShaderValue = effect.Find( Toolkit::Visual::Property::SHADER );
- DALI_TEST_CHECK( customShaderValue );
+ Property::Value* customShaderValue = effect.Find(Toolkit::Visual::Property::SHADER);
+ DALI_TEST_CHECK(customShaderValue);
Property::Map customShader;
- DALI_TEST_CHECK( customShaderValue->Get( customShader ) );
+ DALI_TEST_CHECK(customShaderValue->Get(customShader));
- Property::Value* vertexShaderValue = customShader.Find( Visual::Shader::Property::VERTEX_SHADER );
- DALI_TEST_CHECK( vertexShaderValue );
+ Property::Value* vertexShaderValue = customShader.Find(Visual::Shader::Property::VERTEX_SHADER);
+ DALI_TEST_CHECK(vertexShaderValue);
std::string vertexShader;
- DALI_TEST_CHECK( vertexShaderValue->Get( vertexShader ) );
- DALI_TEST_CHECK( !vertexShader.empty() );
+ DALI_TEST_CHECK(vertexShaderValue->Get(vertexShader));
+ DALI_TEST_CHECK(!vertexShader.empty());
- Property::Value* fragmentShaderValue = customShader.Find( Visual::Shader::Property::FRAGMENT_SHADER );
- DALI_TEST_CHECK( fragmentShaderValue );
+ Property::Value* fragmentShaderValue = customShader.Find(Visual::Shader::Property::FRAGMENT_SHADER);
+ DALI_TEST_CHECK(fragmentShaderValue);
std::string fragmentShader;
- DALI_TEST_CHECK( fragmentShaderValue->Get( fragmentShader ) );
- DALI_TEST_CHECK( !fragmentShader.empty() );
+ DALI_TEST_CHECK(fragmentShaderValue->Get(fragmentShader));
+ DALI_TEST_CHECK(!fragmentShader.empty());
- Property::Value* gridXValue = customShader.Find( Visual::Shader::Property::SUBDIVIDE_GRID_X );
- DALI_TEST_CHECK( gridXValue );
+ Property::Value* gridXValue = customShader.Find(Visual::Shader::Property::SUBDIVIDE_GRID_X);
+ DALI_TEST_CHECK(gridXValue);
int gridX = 0;
- DALI_TEST_CHECK( gridXValue->Get( gridX ) );
- DALI_TEST_CHECK( gridX > 1 );
+ DALI_TEST_CHECK(gridXValue->Get(gridX));
+ DALI_TEST_CHECK(gridX > 1);
- Property::Value* gridYValue = customShader.Find( Visual::Shader::Property::SUBDIVIDE_GRID_Y );
- DALI_TEST_CHECK( gridYValue );
+ Property::Value* gridYValue = customShader.Find(Visual::Shader::Property::SUBDIVIDE_GRID_Y);
+ DALI_TEST_CHECK(gridYValue);
int gridY = 0;
- DALI_TEST_CHECK( gridYValue->Get( gridY ) );
- DALI_TEST_CHECK( gridY > 1 );
+ DALI_TEST_CHECK(gridYValue->Get(gridY));
+ DALI_TEST_CHECK(gridY > 1);
- Property::Value* hintsValue = customShader.Find( Visual::Shader::Property::HINTS );
- DALI_TEST_CHECK( hintsValue );
+ Property::Value* hintsValue = customShader.Find(Visual::Shader::Property::HINTS);
+ DALI_TEST_CHECK(hintsValue);
- int hints;;
- DALI_TEST_CHECK( hintsValue->Get( hints ) );
- DALI_TEST_CHECK( hints == Shader::Hint::OUTPUT_IS_TRANSPARENT );
+ int hints;
+ ;
+ DALI_TEST_CHECK(hintsValue->Get(hints));
+ DALI_TEST_CHECK(hints == Shader::Hint::OUTPUT_IS_TRANSPARENT);
Actor actor = Actor::New();
- Toolkit::DissolveEffectSetCentralLine( actor, Vector2::ONE, Vector2::ONE, 0.0f );
- DALI_TEST_CHECK( actor.GetPropertyIndex( "uPercentage" ) != Property::INVALID_INDEX );
+ Toolkit::DissolveEffectSetCentralLine(actor, Vector2::ONE, Vector2::ONE, 0.0f);
+ DALI_TEST_CHECK(actor.GetPropertyIndex("uPercentage") != Property::INVALID_INDEX);
END_TEST;
}
ToolkitTestApplication application;
Property::Map effect = Toolkit::CreateDistanceFieldEffect();
- DALI_TEST_CHECK( !effect.Empty() );
+ DALI_TEST_CHECK(!effect.Empty());
- Property::Value* customShaderValue = effect.Find( Toolkit::Visual::Property::SHADER );
- DALI_TEST_CHECK( customShaderValue );
+ Property::Value* customShaderValue = effect.Find(Toolkit::Visual::Property::SHADER);
+ DALI_TEST_CHECK(customShaderValue);
Property::Map customShader;
- DALI_TEST_CHECK( customShaderValue->Get( customShader ) );
+ DALI_TEST_CHECK(customShaderValue->Get(customShader));
- Property::Value* vertexShaderValue = customShader.Find( Visual::Shader::Property::VERTEX_SHADER );
- DALI_TEST_CHECK( !vertexShaderValue );
+ Property::Value* vertexShaderValue = customShader.Find(Visual::Shader::Property::VERTEX_SHADER);
+ DALI_TEST_CHECK(!vertexShaderValue);
- Property::Value* fragmentShaderValue = customShader.Find( Visual::Shader::Property::FRAGMENT_SHADER );
- DALI_TEST_CHECK( fragmentShaderValue );
+ Property::Value* fragmentShaderValue = customShader.Find(Visual::Shader::Property::FRAGMENT_SHADER);
+ DALI_TEST_CHECK(fragmentShaderValue);
std::string fragmentShader;
- DALI_TEST_CHECK( fragmentShaderValue->Get( fragmentShader ) );
- DALI_TEST_CHECK( !fragmentShader.empty() );
+ DALI_TEST_CHECK(fragmentShaderValue->Get(fragmentShader));
+ DALI_TEST_CHECK(!fragmentShader.empty());
- Property::Value* gridXValue = customShader.Find( Visual::Shader::Property::SUBDIVIDE_GRID_X );
- DALI_TEST_CHECK( !gridXValue );
+ Property::Value* gridXValue = customShader.Find(Visual::Shader::Property::SUBDIVIDE_GRID_X);
+ DALI_TEST_CHECK(!gridXValue);
- Property::Value* hintsValue = customShader.Find( Visual::Shader::Property::HINTS );
- DALI_TEST_CHECK( hintsValue );
+ Property::Value* hintsValue = customShader.Find(Visual::Shader::Property::HINTS);
+ DALI_TEST_CHECK(hintsValue);
- int hints;;
- DALI_TEST_CHECK( hintsValue->Get( hints ) );
- DALI_TEST_CHECK( hints == Shader::Hint::OUTPUT_IS_TRANSPARENT );
+ int hints;
+ ;
+ DALI_TEST_CHECK(hintsValue->Get(hints));
+ DALI_TEST_CHECK(hints == Shader::Hint::OUTPUT_IS_TRANSPARENT);
END_TEST;
}
ToolkitTestApplication application;
Property::Map effect = Toolkit::CreateImageRegionEffect();
- DALI_TEST_CHECK( !effect.Empty() );
+ DALI_TEST_CHECK(!effect.Empty());
- Property::Value* customShaderValue = effect.Find( Toolkit::Visual::Property::SHADER );
- DALI_TEST_CHECK( customShaderValue );
+ Property::Value* customShaderValue = effect.Find(Toolkit::Visual::Property::SHADER);
+ DALI_TEST_CHECK(customShaderValue);
Property::Map customShader;
- DALI_TEST_CHECK( customShaderValue->Get( customShader ) );
+ DALI_TEST_CHECK(customShaderValue->Get(customShader));
- Property::Value* vertexShaderValue = customShader.Find( Visual::Shader::Property::VERTEX_SHADER );
- DALI_TEST_CHECK( vertexShaderValue );
+ Property::Value* vertexShaderValue = customShader.Find(Visual::Shader::Property::VERTEX_SHADER);
+ DALI_TEST_CHECK(vertexShaderValue);
std::string vertexShader;
- DALI_TEST_CHECK( vertexShaderValue->Get( vertexShader ) );
- DALI_TEST_CHECK( !vertexShader.empty() );
+ DALI_TEST_CHECK(vertexShaderValue->Get(vertexShader));
+ DALI_TEST_CHECK(!vertexShader.empty());
- Property::Value* fragmentShaderValue = customShader.Find( Visual::Shader::Property::FRAGMENT_SHADER );
- DALI_TEST_CHECK( !fragmentShaderValue );
+ Property::Value* fragmentShaderValue = customShader.Find(Visual::Shader::Property::FRAGMENT_SHADER);
+ DALI_TEST_CHECK(!fragmentShaderValue);
- Property::Value* gridXValue = customShader.Find( Visual::Shader::Property::SUBDIVIDE_GRID_X );
- DALI_TEST_CHECK( !gridXValue );
+ Property::Value* gridXValue = customShader.Find(Visual::Shader::Property::SUBDIVIDE_GRID_X);
+ DALI_TEST_CHECK(!gridXValue);
- Property::Value* gridYValue = customShader.Find( Visual::Shader::Property::SUBDIVIDE_GRID_Y );
- DALI_TEST_CHECK( !gridYValue );
+ Property::Value* gridYValue = customShader.Find(Visual::Shader::Property::SUBDIVIDE_GRID_Y);
+ DALI_TEST_CHECK(!gridYValue);
- Property::Value* hintsValue = customShader.Find( Visual::Shader::Property::HINTS );
- DALI_TEST_CHECK( !hintsValue );
+ Property::Value* hintsValue = customShader.Find(Visual::Shader::Property::HINTS);
+ DALI_TEST_CHECK(!hintsValue);
END_TEST;
}
ToolkitTestApplication application;
Property::Map effect = Toolkit::CreateMotionBlurEffect();
- DALI_TEST_CHECK( !effect.Empty() );
+ DALI_TEST_CHECK(!effect.Empty());
- Property::Value* customShaderValue = effect.Find( Toolkit::Visual::Property::SHADER );
- DALI_TEST_CHECK( customShaderValue );
+ Property::Value* customShaderValue = effect.Find(Toolkit::Visual::Property::SHADER);
+ DALI_TEST_CHECK(customShaderValue);
Property::Map customShader;
- DALI_TEST_CHECK( customShaderValue->Get( customShader ) );
+ DALI_TEST_CHECK(customShaderValue->Get(customShader));
- Property::Value* vertexShaderValue = customShader.Find( Visual::Shader::Property::VERTEX_SHADER );
- DALI_TEST_CHECK( vertexShaderValue );
+ Property::Value* vertexShaderValue = customShader.Find(Visual::Shader::Property::VERTEX_SHADER);
+ DALI_TEST_CHECK(vertexShaderValue);
std::string vertexShader;
- DALI_TEST_CHECK( vertexShaderValue->Get( vertexShader ) );
- DALI_TEST_CHECK( !vertexShader.empty() );
+ DALI_TEST_CHECK(vertexShaderValue->Get(vertexShader));
+ DALI_TEST_CHECK(!vertexShader.empty());
- Property::Value* fragmentShaderValue = customShader.Find( Visual::Shader::Property::FRAGMENT_SHADER );
- DALI_TEST_CHECK( fragmentShaderValue );
+ Property::Value* fragmentShaderValue = customShader.Find(Visual::Shader::Property::FRAGMENT_SHADER);
+ DALI_TEST_CHECK(fragmentShaderValue);
std::string fragmentShader;
- DALI_TEST_CHECK( fragmentShaderValue->Get( fragmentShader ) );
- DALI_TEST_CHECK( !fragmentShader.empty() );
+ DALI_TEST_CHECK(fragmentShaderValue->Get(fragmentShader));
+ DALI_TEST_CHECK(!fragmentShader.empty());
- Property::Value* gridXValue = customShader.Find( Visual::Shader::Property::SUBDIVIDE_GRID_X );
- DALI_TEST_CHECK( gridXValue );
+ Property::Value* gridXValue = customShader.Find(Visual::Shader::Property::SUBDIVIDE_GRID_X);
+ DALI_TEST_CHECK(gridXValue);
int gridX = 0;
- DALI_TEST_CHECK( gridXValue->Get( gridX ) );
- DALI_TEST_CHECK( gridX > 1 );
+ DALI_TEST_CHECK(gridXValue->Get(gridX));
+ DALI_TEST_CHECK(gridX > 1);
- Property::Value* gridYValue = customShader.Find( Visual::Shader::Property::SUBDIVIDE_GRID_Y );
- DALI_TEST_CHECK( gridYValue );
+ Property::Value* gridYValue = customShader.Find(Visual::Shader::Property::SUBDIVIDE_GRID_Y);
+ DALI_TEST_CHECK(gridYValue);
int gridY = 0;
- DALI_TEST_CHECK( gridYValue->Get( gridY ) );
- DALI_TEST_CHECK( gridY > 1 );
-
- Property::Value* hintsValue = customShader.Find( Visual::Shader::Property::HINTS );
- DALI_TEST_CHECK( hintsValue );
-
- int hints;;
- DALI_TEST_CHECK( hintsValue->Get( hints ) );
- DALI_TEST_CHECK( hints == Shader::Hint::OUTPUT_IS_TRANSPARENT );
-
- unsigned int sampleCount( 4 );
- Actor actor = Actor::New();
- Toolkit::SetMotionBlurProperties( actor, sampleCount );
- DALI_TEST_CHECK( actor.GetPropertyIndex( "uBlurTexCoordScale" ) != Property::INVALID_INDEX );
- DALI_TEST_CHECK( actor.GetPropertyIndex( "uGeometryStretchFactor" ) != Property::INVALID_INDEX );
- DALI_TEST_CHECK( actor.GetPropertyIndex( "uSpeedScalingFactor" ) != Property::INVALID_INDEX );
- DALI_TEST_CHECK( actor.GetPropertyIndex( "uObjectFadeStart" ) != Property::INVALID_INDEX );
- DALI_TEST_CHECK( actor.GetPropertyIndex( "uObjectFadeEnd" ) != Property::INVALID_INDEX );
- DALI_TEST_CHECK( actor.GetPropertyIndex( "uAlphaScale" ) != Property::INVALID_INDEX );
- DALI_TEST_CHECK( actor.GetPropertyIndex( "uNumSamples" ) != Property::INVALID_INDEX );
- DALI_TEST_CHECK( actor.GetPropertyIndex( "uModelLastFrame" ) != Property::INVALID_INDEX );
+ DALI_TEST_CHECK(gridYValue->Get(gridY));
+ DALI_TEST_CHECK(gridY > 1);
+
+ Property::Value* hintsValue = customShader.Find(Visual::Shader::Property::HINTS);
+ DALI_TEST_CHECK(hintsValue);
+
+ int hints;
+ ;
+ DALI_TEST_CHECK(hintsValue->Get(hints));
+ DALI_TEST_CHECK(hints == Shader::Hint::OUTPUT_IS_TRANSPARENT);
+
+ unsigned int sampleCount(4);
+ Actor actor = Actor::New();
+ Toolkit::SetMotionBlurProperties(actor, sampleCount);
+ DALI_TEST_CHECK(actor.GetPropertyIndex("uBlurTexCoordScale") != Property::INVALID_INDEX);
+ DALI_TEST_CHECK(actor.GetPropertyIndex("uGeometryStretchFactor") != Property::INVALID_INDEX);
+ DALI_TEST_CHECK(actor.GetPropertyIndex("uSpeedScalingFactor") != Property::INVALID_INDEX);
+ DALI_TEST_CHECK(actor.GetPropertyIndex("uObjectFadeStart") != Property::INVALID_INDEX);
+ DALI_TEST_CHECK(actor.GetPropertyIndex("uObjectFadeEnd") != Property::INVALID_INDEX);
+ DALI_TEST_CHECK(actor.GetPropertyIndex("uAlphaScale") != Property::INVALID_INDEX);
+ DALI_TEST_CHECK(actor.GetPropertyIndex("uNumSamples") != Property::INVALID_INDEX);
+ DALI_TEST_CHECK(actor.GetPropertyIndex("uModelLastFrame") != Property::INVALID_INDEX);
END_TEST;
}
ToolkitTestApplication application;
Property::Map effect = Toolkit::CreateMotionStretchEffect();
- DALI_TEST_CHECK( !effect.Empty() );
+ DALI_TEST_CHECK(!effect.Empty());
- Property::Value* customShaderValue = effect.Find( Toolkit::Visual::Property::SHADER );
- DALI_TEST_CHECK( customShaderValue );
+ Property::Value* customShaderValue = effect.Find(Toolkit::Visual::Property::SHADER);
+ DALI_TEST_CHECK(customShaderValue);
Property::Map customShader;
- DALI_TEST_CHECK( customShaderValue->Get( customShader ) );
+ DALI_TEST_CHECK(customShaderValue->Get(customShader));
- Property::Value* vertexShaderValue = customShader.Find( Visual::Shader::Property::VERTEX_SHADER );
- DALI_TEST_CHECK( vertexShaderValue );
+ Property::Value* vertexShaderValue = customShader.Find(Visual::Shader::Property::VERTEX_SHADER);
+ DALI_TEST_CHECK(vertexShaderValue);
std::string vertexShader;
- DALI_TEST_CHECK( vertexShaderValue->Get( vertexShader ) );
- DALI_TEST_CHECK( !vertexShader.empty() );
+ DALI_TEST_CHECK(vertexShaderValue->Get(vertexShader));
+ DALI_TEST_CHECK(!vertexShader.empty());
- Property::Value* fragmentShaderValue = customShader.Find( Visual::Shader::Property::FRAGMENT_SHADER );
- DALI_TEST_CHECK( fragmentShaderValue );
+ Property::Value* fragmentShaderValue = customShader.Find(Visual::Shader::Property::FRAGMENT_SHADER);
+ DALI_TEST_CHECK(fragmentShaderValue);
std::string fragmentShader;
- DALI_TEST_CHECK( fragmentShaderValue->Get( fragmentShader ) );
- DALI_TEST_CHECK( !fragmentShader.empty() );
+ DALI_TEST_CHECK(fragmentShaderValue->Get(fragmentShader));
+ DALI_TEST_CHECK(!fragmentShader.empty());
- Property::Value* gridXValue = customShader.Find( Visual::Shader::Property::SUBDIVIDE_GRID_X );
- DALI_TEST_CHECK( gridXValue );
+ Property::Value* gridXValue = customShader.Find(Visual::Shader::Property::SUBDIVIDE_GRID_X);
+ DALI_TEST_CHECK(gridXValue);
int gridX = 0;
- DALI_TEST_CHECK( gridXValue->Get( gridX ) );
- DALI_TEST_CHECK( gridX > 1 );
+ DALI_TEST_CHECK(gridXValue->Get(gridX));
+ DALI_TEST_CHECK(gridX > 1);
- Property::Value* gridYValue = customShader.Find( Visual::Shader::Property::SUBDIVIDE_GRID_Y );
- DALI_TEST_CHECK( gridYValue );
+ Property::Value* gridYValue = customShader.Find(Visual::Shader::Property::SUBDIVIDE_GRID_Y);
+ DALI_TEST_CHECK(gridYValue);
int gridY = 0;
- DALI_TEST_CHECK( gridYValue->Get( gridY ) );
- DALI_TEST_CHECK( gridY > 1 );
+ DALI_TEST_CHECK(gridYValue->Get(gridY));
+ DALI_TEST_CHECK(gridY > 1);
- Property::Value* hintsValue = customShader.Find( Visual::Shader::Property::HINTS );
- DALI_TEST_CHECK( hintsValue );
+ Property::Value* hintsValue = customShader.Find(Visual::Shader::Property::HINTS);
+ DALI_TEST_CHECK(hintsValue);
- int hints;;
- DALI_TEST_CHECK( hintsValue->Get( hints ) );
- DALI_TEST_CHECK( hints == Shader::Hint::OUTPUT_IS_TRANSPARENT );
+ int hints;
+ ;
+ DALI_TEST_CHECK(hintsValue->Get(hints));
+ DALI_TEST_CHECK(hints == Shader::Hint::OUTPUT_IS_TRANSPARENT);
Actor actor = Actor::New();
- Toolkit::SetMotionStretchProperties( actor );
- DALI_TEST_CHECK( actor.GetPropertyIndex( "uGeometryStretchFactor" ) != Property::INVALID_INDEX );
- DALI_TEST_CHECK( actor.GetPropertyIndex( "uSpeedScalingFactor" ) != Property::INVALID_INDEX );
- DALI_TEST_CHECK( actor.GetPropertyIndex( "uObjectFadeStart" ) != Property::INVALID_INDEX );
- DALI_TEST_CHECK( actor.GetPropertyIndex( "uObjectFadeEnd" ) != Property::INVALID_INDEX );
- DALI_TEST_CHECK( actor.GetPropertyIndex( "uAlphaScale" ) != Property::INVALID_INDEX );
- DALI_TEST_CHECK( actor.GetPropertyIndex( "uModelLastFrame" ) != Property::INVALID_INDEX );
+ Toolkit::SetMotionStretchProperties(actor);
+ DALI_TEST_CHECK(actor.GetPropertyIndex("uGeometryStretchFactor") != Property::INVALID_INDEX);
+ DALI_TEST_CHECK(actor.GetPropertyIndex("uSpeedScalingFactor") != Property::INVALID_INDEX);
+ DALI_TEST_CHECK(actor.GetPropertyIndex("uObjectFadeStart") != Property::INVALID_INDEX);
+ DALI_TEST_CHECK(actor.GetPropertyIndex("uObjectFadeEnd") != Property::INVALID_INDEX);
+ DALI_TEST_CHECK(actor.GetPropertyIndex("uAlphaScale") != Property::INVALID_INDEX);
+ DALI_TEST_CHECK(actor.GetPropertyIndex("uModelLastFrame") != Property::INVALID_INDEX);
END_TEST;
}
*
*/
-#include <iostream>
-#include <stdlib.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/controls/shadow-view/shadow-view.h>
-
+#include <stdlib.h>
+#include <iostream>
using namespace Dali;
using namespace Dali::Toolkit;
test_return_value = TET_PASS;
}
-
// Negative test case for a method
int UtcDaliShadowViewUninitialized(void)
{
{
// New() must be called to create a GaussianBlurView or it wont be valid.
Actor a = Actor::New();
- view.Add( a );
- DALI_TEST_CHECK( false );
+ view.Add(a);
+ DALI_TEST_CHECK(false);
}
- catch (Dali::DaliException& e)
+ catch(Dali::DaliException& e)
{
// Tests that a negative test of an assertion succeeds
- DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_PRINT_ASSERT(e);
DALI_TEST_CHECK(!view);
}
END_TEST;
tet_infoline("UtcDaliShadowViewNew");
Toolkit::ShadowView view = Toolkit::ShadowView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Toolkit::ShadowView view2 = Toolkit::ShadowView::New(1.0f, 1.0f);
- DALI_TEST_CHECK( view2 );
+ DALI_TEST_CHECK(view2);
END_TEST;
}
tet_infoline("UtcDaliShadowViewDownCast");
Toolkit::ShadowView view = Toolkit::ShadowView::New();
- BaseHandle handle(view);
+ BaseHandle handle(view);
- Toolkit::ShadowView shadowView = Toolkit::ShadowView::DownCast( handle );
- DALI_TEST_CHECK( view );
- DALI_TEST_CHECK( shadowView );
- DALI_TEST_CHECK( shadowView == view );
+ Toolkit::ShadowView shadowView = Toolkit::ShadowView::DownCast(handle);
+ DALI_TEST_CHECK(view);
+ DALI_TEST_CHECK(shadowView);
+ DALI_TEST_CHECK(shadowView == view);
END_TEST;
}
tet_infoline("UtcDaliShadowViewPropertyNames");
Toolkit::ShadowView view = Toolkit::ShadowView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
// Check the names, this names are used in the shader code,
// if they change in the shader code, then it has to be updated here.
- DALI_TEST_EQUALS( view.GetBlurStrengthPropertyIndex(), view.GetPropertyIndex("BlurStrengthProperty"), TEST_LOCATION );
- DALI_TEST_EQUALS( view.GetShadowColorPropertyIndex(), view.GetPropertyIndex("ShadowColorProperty"), TEST_LOCATION );
+ DALI_TEST_EQUALS(view.GetBlurStrengthPropertyIndex(), view.GetPropertyIndex("BlurStrengthProperty"), TEST_LOCATION);
+ DALI_TEST_EQUALS(view.GetShadowColorPropertyIndex(), view.GetPropertyIndex("ShadowColorProperty"), TEST_LOCATION);
END_TEST;
}
tet_infoline("UtcDaliShadowViewAddRemove");
Toolkit::ShadowView view = Toolkit::ShadowView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Actor actor = Actor::New();
- DALI_TEST_CHECK( !actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
-
+ DALI_TEST_CHECK(!actor.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE));
- view.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- view.SetProperty( Actor::Property::SIZE, application.GetScene().GetSize());
+ view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ view.SetProperty(Actor::Property::SIZE, application.GetScene().GetSize());
view.Add(actor);
application.GetScene().Add(view);
- DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
+ DALI_TEST_CHECK(actor.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE));
view.Remove(actor);
- DALI_TEST_CHECK( !actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
+ DALI_TEST_CHECK(!actor.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE));
END_TEST;
}
tet_infoline("UtcDaliShadowViewActivateDeactivate");
Toolkit::ShadowView view = Toolkit::ShadowView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
RenderTaskList taskList = application.GetScene().GetRenderTaskList();
- DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
+ DALI_TEST_CHECK(1u == taskList.GetTaskCount());
- view.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- view.SetProperty( Actor::Property::SIZE, application.GetScene().GetSize());
+ view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ view.SetProperty(Actor::Property::SIZE, application.GetScene().GetSize());
view.Add(Actor::New());
application.GetScene().Add(view);
view.Activate();
RenderTaskList taskList2 = application.GetScene().GetRenderTaskList();
- DALI_TEST_CHECK( 1u != taskList2.GetTaskCount() );
+ DALI_TEST_CHECK(1u != taskList2.GetTaskCount());
view.Deactivate();
RenderTaskList taskList3 = application.GetScene().GetRenderTaskList();
- DALI_TEST_CHECK( 1u == taskList3.GetTaskCount() );
+ DALI_TEST_CHECK(1u == taskList3.GetTaskCount());
END_TEST;
}
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
-#include <stdlib.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
-#include <dali/devel-api/actors/actor-devel.h>
#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
-#include <dali-toolkit/public-api/transition/transition-set.h>
-#include <dali-toolkit/public-api/transition/transition-base.h>
#include <dali-toolkit/public-api/transition/slide-transition.h>
+#include <dali-toolkit/public-api/transition/transition-base.h>
+#include <dali-toolkit/public-api/transition/transition-set.h>
+#include <dali/devel-api/actors/actor-devel.h>
+#include <stdlib.h>
+#include <iostream>
using namespace Dali;
using namespace Dali::Toolkit;
transitionSet.AddTransition(slide);
transitionSet.Play();
- bool signalReceived(false);
+ bool signalReceived(false);
TransitionFinishCheck finishCheck(signalReceived);
transitionSet.FinishedSignal().Connect(&application, finishCheck);
DALI_TEST_EQUALS(Vector2(0, 0), control.GetCurrentProperty<Vector2>(Actor::Property::POSITION), TEST_LOCATION);
- Vector2 windowSize = application.GetScene().GetSize();
- SlideTransition slide = SlideTransition::New(control, Dali::Toolkit::SlideTransitionDirection::BOTTOM, TimePeriod(0.5f));
+ Vector2 windowSize = application.GetScene().GetSize();
+ SlideTransition slide = SlideTransition::New(control, Dali::Toolkit::SlideTransitionDirection::BOTTOM, TimePeriod(0.5f));
slide.SetAppearingTransition(false);
TransitionSet transitionSet = TransitionSet::New();
transitionSet.AddTransition(slide);
transitionSet.Play();
- bool signalReceived(false);
+ bool signalReceived(false);
TransitionFinishCheck finishCheck(signalReceived);
transitionSet.FinishedSignal().Connect(&application, finishCheck);
transitionSet.AddTransition(slide);
transitionSet.Play();
- bool signalReceived(false);
+ bool signalReceived(false);
TransitionFinishCheck finishCheck(signalReceived);
transitionSet.FinishedSignal().Connect(&application, finishCheck);
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
-#include <stdlib.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali/integration-api/events/touch-event-integ.h>
+#include <stdlib.h>
+#include <iostream>
using namespace Dali;
using namespace Dali::Toolkit;
namespace
{
-
static bool gObjectCreatedCallBackCalled;
static void TestCallback(BaseHandle handle)
gObjectCreatedCallBackCalled = true;
}
-}
+} // namespace
int UtcDaliSliderNew(void)
{
// Create the Slider actor
Slider slider;
- DALI_TEST_CHECK( !slider );
+ DALI_TEST_CHECK(!slider);
slider = Slider::New();
- DALI_TEST_CHECK( slider );
+ DALI_TEST_CHECK(slider);
Slider slider2(slider);
- DALI_TEST_CHECK( slider2 == slider );
+ DALI_TEST_CHECK(slider2 == slider);
//Additional check to ensure object is created by checking if it's registered
ObjectRegistry registry = application.GetCore().GetObjectRegistry();
- DALI_TEST_CHECK( registry );
+ DALI_TEST_CHECK(registry);
gObjectCreatedCallBackCalled = false;
- registry.ObjectCreatedSignal().Connect( &TestCallback );
+ registry.ObjectCreatedSignal().Connect(&TestCallback);
{
Slider slider = Slider::New();
}
- DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
+ DALI_TEST_CHECK(gObjectCreatedCallBackCalled);
END_TEST;
}
ToolkitTestApplication application;
Slider slider = Slider::New();
- DALI_TEST_CHECK( slider );
+ DALI_TEST_CHECK(slider);
- Slider copy( slider );
- DALI_TEST_CHECK( copy );
+ Slider copy(slider);
+ DALI_TEST_CHECK(copy);
END_TEST;
}
ToolkitTestApplication application;
Slider slider = Slider::New();
- DALI_TEST_CHECK( slider );
+ DALI_TEST_CHECK(slider);
Slider copy;
copy = slider;
- DALI_TEST_CHECK( copy );
- DALI_TEST_EQUALS( slider, copy, TEST_LOCATION );
+ DALI_TEST_CHECK(copy);
+ DALI_TEST_EQUALS(slider, copy, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
Slider slider = Slider::New();
- DALI_TEST_EQUALS( 1, slider.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- slider.SetProperty( Actor::Property::SENSITIVE, false );
- DALI_TEST_CHECK( false == slider.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+ DALI_TEST_EQUALS(1, slider.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ slider.SetProperty(Actor::Property::SENSITIVE, false);
+ DALI_TEST_CHECK(false == slider.GetProperty<bool>(Actor::Property::SENSITIVE));
- Slider moved = std::move( slider );
- 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( !slider );
+ Slider moved = std::move(slider);
+ 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(!slider);
END_TEST;
}
ToolkitTestApplication application;
Slider slider = Slider::New();
- DALI_TEST_EQUALS( 1, slider.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- slider.SetProperty( Actor::Property::SENSITIVE, false );
- DALI_TEST_CHECK( false == slider.GetProperty< bool >( Actor::Property::SENSITIVE ) );
+ DALI_TEST_EQUALS(1, slider.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ slider.SetProperty(Actor::Property::SENSITIVE, false);
+ DALI_TEST_CHECK(false == slider.GetProperty<bool>(Actor::Property::SENSITIVE));
Slider moved;
- moved = std::move( slider );
- 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( !slider );
+ moved = std::move(slider);
+ 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(!slider);
END_TEST;
}
Slider* slider = new Slider();
delete slider;
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
END_TEST;
}
Handle handle = Slider::New();
- Slider slider = Slider::DownCast( handle );
+ Slider slider = Slider::DownCast(handle);
- DALI_TEST_CHECK( slider == handle );
+ DALI_TEST_CHECK(slider == handle);
END_TEST;
}
-static bool gSliderValueChangedCallBackCalled=false;
-static bool OnSliderValueChanged( Slider slider, float value )
+static bool gSliderValueChangedCallBackCalled = false;
+static bool OnSliderValueChanged(Slider slider, float value)
{
gSliderValueChangedCallBackCalled = true;
return true;
}
-static bool gSliderMarkCallBackCalled=false;
-static bool OnSliderMark( Slider slider, int value )
+static bool gSliderMarkCallBackCalled = false;
+static bool OnSliderMark(Slider slider, int value)
{
gSliderMarkCallBackCalled = true;
return true;
}
-static bool gSliderSlidingFinishedCallBackCalled=false;
-static bool OnSlidingFinished( Slider slider, float value )
+static bool gSliderSlidingFinishedCallBackCalled = false;
+static bool OnSlidingFinished(Slider slider, float value)
{
gSliderSlidingFinishedCallBackCalled = true;
return true;
int UtcDaliSliderSignals1(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
tet_infoline(" UtcDaliSliderSignals1");
// Create the Popup actor
Slider slider = Slider::New();
- application.GetScene().Add( slider );
- slider.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- slider.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
- slider.SetProperty( Actor::Property::SIZE, Vector2( application.GetScene().GetSize().x, 20.0f ) );
- slider.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
-
- const float MIN_BOUND = 0.0f;
- const float MAX_BOUND = 1.0f;
- const int NUM_MARKS = 5;
+ application.GetScene().Add(slider);
+ slider.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ slider.SetProperty(Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_LEFT);
+ slider.SetProperty(Actor::Property::SIZE, Vector2(application.GetScene().GetSize().x, 20.0f));
+ slider.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 0.0f));
+
+ const float MIN_BOUND = 0.0f;
+ const float MAX_BOUND = 1.0f;
+ const int NUM_MARKS = 5;
Property::Array marks;
- for( int i = 0; i < NUM_MARKS; ++i )
+ for(int i = 0; i < NUM_MARKS; ++i)
{
- marks.PushBack( MIN_BOUND + ( static_cast<float>(i) / ( NUM_MARKS - 1) ) * ( MAX_BOUND - MIN_BOUND ) );
+ marks.PushBack(MIN_BOUND + (static_cast<float>(i) / (NUM_MARKS - 1)) * (MAX_BOUND - MIN_BOUND));
}
- slider.SetProperty( Slider::Property::MARKS, marks );
- slider.SetProperty( Slider::Property::MARK_TOLERANCE, 0.1f );
+ slider.SetProperty(Slider::Property::MARKS, marks);
+ slider.SetProperty(Slider::Property::MARK_TOLERANCE, 0.1f);
- slider.ValueChangedSignal().Connect( &OnSliderValueChanged );
- slider.MarkReachedSignal().Connect( &OnSliderMark );
- slider.SlidingFinishedSignal().Connect( &OnSlidingFinished );
+ slider.ValueChangedSignal().Connect(&OnSliderValueChanged);
+ slider.MarkReachedSignal().Connect(&OnSliderMark);
+ slider.SlidingFinishedSignal().Connect(&OnSlidingFinished);
application.SendNotification();
application.Render();
- gSliderValueChangedCallBackCalled = false;
- gSliderMarkCallBackCalled = false;
+ gSliderValueChangedCallBackCalled = false;
+ gSliderMarkCallBackCalled = false;
gSliderSlidingFinishedCallBackCalled = false;
{
Dali::Integration::TouchEvent event = Dali::Integration::TouchEvent();
- Integration::Point pointDown;
- pointDown.SetState( PointState::DOWN );
- pointDown.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
- event.AddPoint( pointDown );
+ Integration::Point pointDown;
+ pointDown.SetState(PointState::DOWN);
+ pointDown.SetScreenPosition(Vector2(10.0f, 10.0f));
+ event.AddPoint(pointDown);
- application.ProcessEvent( event );
+ application.ProcessEvent(event);
application.SendNotification();
application.Render();
}
- for( int i = 0; i < 5; ++i )
+ for(int i = 0; i < 5; ++i)
{
Dali::Integration::TouchEvent event = Dali::Integration::TouchEvent();
- Integration::Point pointMotion;
- pointMotion.SetState( PointState::MOTION );
- pointMotion.SetScreenPosition( Vector2( 10.0f + i * 10.0f, 10.0f ) );
- event.AddPoint( pointMotion );
+ Integration::Point pointMotion;
+ pointMotion.SetState(PointState::MOTION);
+ pointMotion.SetScreenPosition(Vector2(10.0f + i * 10.0f, 10.0f));
+ event.AddPoint(pointMotion);
- application.ProcessEvent( event );
+ application.ProcessEvent(event);
application.SendNotification();
application.Render();
}
{
Dali::Integration::TouchEvent event = Dali::Integration::TouchEvent();
- Integration::Point pointUp;
- pointUp.SetState( PointState::UP );
- pointUp.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
- event.AddPoint( pointUp );
+ Integration::Point pointUp;
+ pointUp.SetState(PointState::UP);
+ pointUp.SetScreenPosition(Vector2(10.0f, 10.0f));
+ event.AddPoint(pointUp);
- application.ProcessEvent( event );
+ application.ProcessEvent(event);
application.SendNotification();
application.Render();
}
END_TEST;
}
-
namespace
{
-bool gSliderSignal=false;
+bool gSliderSignal = false;
struct SliderSignalFunctor
{
SliderSignalFunctor()
gSliderSignal = true;
}
};
-} // anonymous
-
-
+} // namespace
int UtcDaliSliderSignals2(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
tet_infoline(" UtcDaliSliderSignals1");
// Create the Popup actor
Slider slider = Slider::New();
- application.GetScene().Add( slider );
- slider.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- slider.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
- slider.SetProperty( Actor::Property::SIZE, Vector2( application.GetScene().GetSize().x, 20.0f ) );
- slider.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
-
- const float MIN_BOUND = 0.0f;
- const float MAX_BOUND = 1.0f;
- const int NUM_MARKS = 5;
+ application.GetScene().Add(slider);
+ slider.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ slider.SetProperty(Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_LEFT);
+ slider.SetProperty(Actor::Property::SIZE, Vector2(application.GetScene().GetSize().x, 20.0f));
+ slider.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 0.0f));
+
+ const float MIN_BOUND = 0.0f;
+ const float MAX_BOUND = 1.0f;
+ const int NUM_MARKS = 5;
Property::Array marks;
- for( int i = 0; i < NUM_MARKS; ++i )
+ for(int i = 0; i < NUM_MARKS; ++i)
{
- marks.PushBack( MIN_BOUND + ( static_cast<float>(i) / ( NUM_MARKS - 1) ) * ( MAX_BOUND - MIN_BOUND ) );
+ marks.PushBack(MIN_BOUND + (static_cast<float>(i) / (NUM_MARKS - 1)) * (MAX_BOUND - MIN_BOUND));
}
- slider.SetProperty( Slider::Property::MARKS, marks );
- slider.SetProperty( Slider::Property::MARK_TOLERANCE, 0.1f );
+ slider.SetProperty(Slider::Property::MARKS, marks);
+ slider.SetProperty(Slider::Property::MARK_TOLERANCE, 0.1f);
- gSliderSignal = false;
+ gSliderSignal = false;
ConnectionTracker* testTracker = new ConnectionTracker();
- slider.ConnectSignal( testTracker, "valueChanged", SliderSignalFunctor() );
+ slider.ConnectSignal(testTracker, "valueChanged", SliderSignalFunctor());
application.SendNotification();
application.Render();
gSliderValueChangedCallBackCalled = false;
- gSliderMarkCallBackCalled = false;
+ gSliderMarkCallBackCalled = false;
Dali::Integration::TouchEvent event;
event = Dali::Integration::TouchEvent();
Integration::Point pointDown;
- pointDown.SetState( PointState::DOWN );
- pointDown.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
- event.AddPoint( pointDown );
+ pointDown.SetState(PointState::DOWN);
+ pointDown.SetScreenPosition(Vector2(10.0f, 10.0f));
+ event.AddPoint(pointDown);
- for( int i = 0; i < 5; ++i )
+ for(int i = 0; i < 5; ++i)
{
Integration::Point pointMotion;
- pointMotion.SetState( PointState::MOTION );
- pointMotion.SetScreenPosition( Vector2( 10.0f + i * 10.0f, 10.0f ) );
- event.AddPoint( pointMotion );
+ pointMotion.SetState(PointState::MOTION);
+ pointMotion.SetScreenPosition(Vector2(10.0f + i * 10.0f, 10.0f));
+ event.AddPoint(pointMotion);
}
Integration::Point pointUp;
- pointUp.SetState( PointState::UP );
- pointUp.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
- event.AddPoint( pointUp );
+ pointUp.SetState(PointState::UP);
+ pointUp.SetScreenPosition(Vector2(10.0f, 10.0f));
+ event.AddPoint(pointUp);
- application.ProcessEvent( event );
+ application.ProcessEvent(event);
application.SendNotification();
application.Render();
int UtcDaliSetPropertyP(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliSetPropertyP" );
+ tet_infoline("UtcDaliSetPropertyP");
Slider slider = Slider::New();
- slider.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- slider.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
- slider.SetProperty( Actor::Property::SIZE, Vector2( application.GetScene().GetSize().x, 20.0f ) );
- slider.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
+ slider.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ slider.SetProperty(Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_LEFT);
+ slider.SetProperty(Actor::Property::SIZE, Vector2(application.GetScene().GetSize().x, 20.0f));
+ slider.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 0.0f));
application.GetScene().Add(slider);
application.SendNotification();
application.Render();
- slider.SetProperty(Slider::Property::LOWER_BOUND, 1.0f);
- slider.SetProperty(Slider::Property::UPPER_BOUND, 5.0f);
- slider.SetProperty(Slider::Property::VALUE, 3.0f);
- slider.SetProperty(Slider::Property::DISABLED_COLOR, Color::BLACK);
- slider.SetProperty(Slider::Property::VALUE_PRECISION, 4);
- slider.SetProperty(Slider::Property::SHOW_POPUP, true);
- slider.SetProperty(Slider::Property::SHOW_VALUE, true);
- slider.SetProperty(Slider::Property::MARKS, false);
- slider.SetProperty(Slider::Property::SNAP_TO_MARKS, false);
- slider.SetProperty(Slider::Property::MARK_TOLERANCE, 0.5f);
+ slider.SetProperty(Slider::Property::LOWER_BOUND, 1.0f);
+ slider.SetProperty(Slider::Property::UPPER_BOUND, 5.0f);
+ slider.SetProperty(Slider::Property::VALUE, 3.0f);
+ slider.SetProperty(Slider::Property::DISABLED_COLOR, Color::BLACK);
+ slider.SetProperty(Slider::Property::VALUE_PRECISION, 4);
+ slider.SetProperty(Slider::Property::SHOW_POPUP, true);
+ slider.SetProperty(Slider::Property::SHOW_VALUE, true);
+ slider.SetProperty(Slider::Property::MARKS, false);
+ slider.SetProperty(Slider::Property::SNAP_TO_MARKS, false);
+ slider.SetProperty(Slider::Property::MARK_TOLERANCE, 0.5f);
float lb = slider.GetProperty<float>(Slider::Property::LOWER_BOUND);
DALI_TEST_EQUALS(lb, 1.0f, TEST_LOCATION);
float val = slider.GetProperty<float>(Slider::Property::VALUE);
DALI_TEST_EQUALS(val, 3.0f, TEST_LOCATION);
Vector4 color = slider.GetProperty<Vector4>(Slider::Property::DISABLED_COLOR);
- DALI_TEST_EQUALS( color, Color::BLACK, TEST_LOCATION );
+ DALI_TEST_EQUALS(color, Color::BLACK, TEST_LOCATION);
int precision = slider.GetProperty<int>(Slider::Property::VALUE_PRECISION);
- DALI_TEST_EQUALS( precision, 4, TEST_LOCATION);
+ DALI_TEST_EQUALS(precision, 4, TEST_LOCATION);
bool showPopup = slider.GetProperty<bool>(Slider::Property::SHOW_POPUP);
- DALI_TEST_EQUALS( showPopup, true , TEST_LOCATION);
+ DALI_TEST_EQUALS(showPopup, true, TEST_LOCATION);
bool showValue = slider.GetProperty<bool>(Slider::Property::SHOW_VALUE);
- DALI_TEST_EQUALS( showValue, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(showValue, true, TEST_LOCATION);
bool marks = slider.GetProperty<bool>(Slider::Property::MARKS);
- DALI_TEST_EQUALS( marks, false, TEST_LOCATION );
+ DALI_TEST_EQUALS(marks, false, TEST_LOCATION);
bool snapToMarks = slider.GetProperty<bool>(Slider::Property::SNAP_TO_MARKS);
- DALI_TEST_EQUALS( snapToMarks, false, TEST_LOCATION );
+ DALI_TEST_EQUALS(snapToMarks, false, TEST_LOCATION);
float tolerance = slider.GetProperty<float>(Slider::Property::MARK_TOLERANCE);
- DALI_TEST_EQUALS( tolerance, 0.5f, TEST_LOCATION );
+ DALI_TEST_EQUALS(tolerance, 0.5f, TEST_LOCATION);
{
Property::Map map;
map["visualType"] = "IMAGE";
- map["size"] = Vector2(200, 200);
- map["url"] = "track2.png";
- slider.SetProperty(Slider::Property::TRACK_VISUAL, map);
+ map["size"] = Vector2(200, 200);
+ map["url"] = "track2.png";
+ slider.SetProperty(Slider::Property::TRACK_VISUAL, map);
map["url"] = "handle2.png";
- slider.SetProperty(Slider::Property::HANDLE_VISUAL, map);
+ slider.SetProperty(Slider::Property::HANDLE_VISUAL, map);
map["url"] = "progress2.png";
- slider.SetProperty(Slider::Property::PROGRESS_VISUAL, map);
+ slider.SetProperty(Slider::Property::PROGRESS_VISUAL, map);
map["url"] = "popup2.png";
- slider.SetProperty(Slider::Property::POPUP_VISUAL, map);
+ slider.SetProperty(Slider::Property::POPUP_VISUAL, map);
map["url"] = "popupArrow2.png";
slider.SetProperty(Slider::Property::POPUP_ARROW_VISUAL, map);
- Property::Value value = slider.GetProperty(Slider::Property::TRACK_VISUAL);
- Property::Map* resultMap = value.GetMap();
- DALI_TEST_CHECK( resultMap );
+ Property::Value value = slider.GetProperty(Slider::Property::TRACK_VISUAL);
+ Property::Map* resultMap = value.GetMap();
+ DALI_TEST_CHECK(resultMap);
Property::Value* url = resultMap->Find("url");
- DALI_TEST_CHECK( url ) ;
- DALI_TEST_EQUALS( *url, "track2.png", TEST_LOCATION );
+ DALI_TEST_CHECK(url);
+ DALI_TEST_EQUALS(*url, "track2.png", TEST_LOCATION);
- value = slider.GetProperty(Slider::Property::HANDLE_VISUAL);
+ value = slider.GetProperty(Slider::Property::HANDLE_VISUAL);
resultMap = value.GetMap();
- DALI_TEST_CHECK( resultMap );
+ DALI_TEST_CHECK(resultMap);
url = resultMap->Find("url");
- DALI_TEST_CHECK( url ) ;
- DALI_TEST_EQUALS( *url, "handle2.png", TEST_LOCATION );
+ DALI_TEST_CHECK(url);
+ DALI_TEST_EQUALS(*url, "handle2.png", TEST_LOCATION);
- value = slider.GetProperty(Slider::Property::PROGRESS_VISUAL);
+ value = slider.GetProperty(Slider::Property::PROGRESS_VISUAL);
resultMap = value.GetMap();
- DALI_TEST_CHECK( resultMap );
+ DALI_TEST_CHECK(resultMap);
url = resultMap->Find("url");
- DALI_TEST_CHECK( url ) ;
- DALI_TEST_EQUALS( *url, "progress2.png", TEST_LOCATION );
+ DALI_TEST_CHECK(url);
+ DALI_TEST_EQUALS(*url, "progress2.png", TEST_LOCATION);
- value = slider.GetProperty(Slider::Property::POPUP_VISUAL);
+ value = slider.GetProperty(Slider::Property::POPUP_VISUAL);
resultMap = value.GetMap();
- DALI_TEST_CHECK( resultMap );
+ DALI_TEST_CHECK(resultMap);
url = resultMap->Find("url");
- DALI_TEST_CHECK( url ) ;
- DALI_TEST_EQUALS( *url, "popup2.png", TEST_LOCATION );
+ DALI_TEST_CHECK(url);
+ DALI_TEST_EQUALS(*url, "popup2.png", TEST_LOCATION);
- value = slider.GetProperty(Slider::Property::POPUP_ARROW_VISUAL);
+ value = slider.GetProperty(Slider::Property::POPUP_ARROW_VISUAL);
resultMap = value.GetMap();
- DALI_TEST_CHECK( resultMap );
+ DALI_TEST_CHECK(resultMap);
url = resultMap->Find("url");
- DALI_TEST_CHECK( url ) ;
- DALI_TEST_EQUALS( *url, "popupArrow2.png", TEST_LOCATION );
+ DALI_TEST_CHECK(url);
+ DALI_TEST_EQUALS(*url, "popupArrow2.png", TEST_LOCATION);
}
UnparentAndReset(slider);
END_TEST;
}
-
// DestroyHandleVisualDisplay
// CreateValueDisplay
// SlidingFinishedSignal()
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
#include <stdlib.h>
+#include <iostream>
// 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.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/controls/super-blur-view/super-blur-view.h>
+#include <dali.h>
using namespace Dali;
using namespace Dali::Toolkit;
test_return_value = TET_PASS;
}
-
namespace
{
-const int BLUR_LEVELS = 3;
-const int RENDER_FRAME_INTERVAL = 16;
-static const char* TEST_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/gallery-small-1.jpg";
-static bool gObjectCreatedCallBackCalled;
-static void TestCallback(BaseHandle handle)
+const int BLUR_LEVELS = 3;
+const int RENDER_FRAME_INTERVAL = 16;
+static const char* TEST_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/gallery-small-1.jpg";
+static bool gObjectCreatedCallBackCalled;
+static void TestCallback(BaseHandle handle)
{
gObjectCreatedCallBackCalled = true;
}
{
int time = 0;
- for(int i = 0; i <= ( duration / RENDER_FRAME_INTERVAL); i++)
+ for(int i = 0; i <= (duration / RENDER_FRAME_INTERVAL); i++)
{
application.SendNotification();
application.Render(RENDER_FRAME_INTERVAL);
return time;
}
-Texture CreateSolidColorTexture( ToolkitTestApplication& application, const Vector4& color, unsigned int width, unsigned int height )
+Texture CreateSolidColorTexture(ToolkitTestApplication& application, const Vector4& color, unsigned int width, unsigned int height)
{
- unsigned int size = width * height;
- uint8_t* pixbuf = new uint8_t[size*4];
+ unsigned int size = width * height;
+ uint8_t* pixbuf = new uint8_t[size * 4];
- for( size_t i = 0; i < size; i++ )
+ for(size_t i = 0; i < size; i++)
{
- pixbuf[i*4+0] = 0xFF * color.r;
- pixbuf[i*4+1] = 0xFF * color.g;
- pixbuf[i*4+2] = 0xFF * color.b;
- pixbuf[i*4+3] = 0xFF * color.a;
+ pixbuf[i * 4 + 0] = 0xFF * color.r;
+ pixbuf[i * 4 + 1] = 0xFF * color.g;
+ pixbuf[i * 4 + 2] = 0xFF * color.b;
+ pixbuf[i * 4 + 3] = 0xFF * color.a;
}
- PixelData pixels = PixelData::New( pixbuf, size, width, height, Pixel::RGBA8888, PixelData::ReleaseFunction::DELETE_ARRAY );
+ PixelData pixels = PixelData::New(pixbuf, size, width, height, Pixel::RGBA8888, PixelData::ReleaseFunction::DELETE_ARRAY);
- Texture texture = Texture::New( TextureType::TEXTURE_2D, pixels.GetPixelFormat(), pixels.GetWidth(), pixels.GetHeight() );
- texture.Upload( pixels, 0, 0, 0, 0, pixels.GetWidth(), pixels.GetHeight() );
+ Texture texture = Texture::New(TextureType::TEXTURE_2D, pixels.GetPixelFormat(), pixels.GetWidth(), pixels.GetHeight());
+ texture.Upload(pixels, 0, 0, 0, 0, pixels.GetWidth(), pixels.GetHeight());
return texture;
}
class SignalHandler : public Dali::ConnectionTracker
{
public:
- SignalHandler() :
- mCalls( 0 )
+ SignalHandler()
+ : mCalls(0)
{
}
- void Callback( SuperBlurView handle )
+ void Callback(SuperBlurView handle)
{
mCalls++;
- tet_infoline( "Signal called" );
+ tet_infoline("Signal called");
}
unsigned int GetCalls() const
}
private:
- unsigned int mCalls; ///< Keeps track of how many times the signal has been called.
+ unsigned int mCalls; ///< Keeps track of how many times the signal has been called.
};
-}//namespace
-
+} //namespace
int UtcDaliSuperBlurViewNew(void)
{
// Test default constructor.
SuperBlurView blurView;
- DALI_TEST_CHECK( !blurView );
+ DALI_TEST_CHECK(!blurView);
// Test object creation
- blurView = SuperBlurView::New( BLUR_LEVELS );
- DALI_TEST_CHECK( blurView );
+ blurView = SuperBlurView::New(BLUR_LEVELS);
+ DALI_TEST_CHECK(blurView);
//Additional check to ensure object is created by checking if it's registered
ObjectRegistry registry = application.GetCore().GetObjectRegistry();
- DALI_TEST_CHECK( registry );
+ DALI_TEST_CHECK(registry);
gObjectCreatedCallBackCalled = false;
- registry.ObjectCreatedSignal().Connect( &TestCallback );
+ registry.ObjectCreatedSignal().Connect(&TestCallback);
{
- SuperBlurView blurView = SuperBlurView::New( BLUR_LEVELS );
+ SuperBlurView blurView = SuperBlurView::New(BLUR_LEVELS);
}
- DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
+ DALI_TEST_CHECK(gObjectCreatedCallBackCalled);
// Test copy constructor
- SuperBlurView blurViewCopy2( blurView );
- DALI_TEST_CHECK( blurViewCopy2 );
+ SuperBlurView blurViewCopy2(blurView);
+ DALI_TEST_CHECK(blurViewCopy2);
// Test down cast
Actor actorView;
- actorView = blurView;
- SuperBlurView downCastView = SuperBlurView::DownCast( actorView );
- DALI_TEST_CHECK( downCastView );
+ actorView = blurView;
+ SuperBlurView downCastView = SuperBlurView::DownCast(actorView);
+ DALI_TEST_CHECK(downCastView);
END_TEST;
}
// Test default constructor.
SuperBlurView blurView;
- DALI_TEST_CHECK( !blurView );
+ DALI_TEST_CHECK(!blurView);
// Test object creation
TypeInfo type = TypeRegistry::Get().GetTypeInfo("SuperBlurView");
- if( type )
+ if(type)
{
Dali::BaseHandle handle = type.CreateInstance();
- if( handle )
+ if(handle)
{
- blurView = Dali::Toolkit::SuperBlurView::DownCast( handle );
+ blurView = Dali::Toolkit::SuperBlurView::DownCast(handle);
}
}
- DALI_TEST_CHECK( blurView );
+ DALI_TEST_CHECK(blurView);
END_TEST;
}
-
int UtcDaliSuperBlurViewSetTexture(void)
{
ToolkitTestApplication application;
tet_infoline(" UtcDaliSuperBlurViewSetTexture ");
- SuperBlurView blurView = SuperBlurView::New( BLUR_LEVELS );
- blurView.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
+ SuperBlurView blurView = SuperBlurView::New(BLUR_LEVELS);
+ blurView.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
- Texture inputTexture = CreateSolidColorTexture( application, Color::GREEN, 50, 50 );
- blurView.SetTexture( inputTexture );
+ Texture inputTexture = CreateSolidColorTexture(application, Color::GREEN, 50, 50);
+ blurView.SetTexture(inputTexture);
// start multiple guassian blur call, each guassian blur creates two render tasks
- DALI_TEST_CHECK( application.GetScene().GetRenderTaskList().GetTaskCount() == 1+BLUR_LEVELS*2);
+ DALI_TEST_CHECK(application.GetScene().GetRenderTaskList().GetTaskCount() == 1 + BLUR_LEVELS * 2);
{
// create renderers for the original image and each blurred image
- application.GetScene().Add( blurView );
+ application.GetScene().Add(blurView);
Wait(application);
- DALI_TEST_EQUALS(blurView.GetRendererCount(), BLUR_LEVELS+1, TEST_LOCATION );
+ DALI_TEST_EQUALS(blurView.GetRendererCount(), BLUR_LEVELS + 1, TEST_LOCATION);
Wait(application);
- application.GetScene().Remove( blurView );
+ application.GetScene().Remove(blurView);
}
END_TEST;
int UtcDaliSuperBlurViewSetTexture2(void)
{
ToolkitTestApplication application;
- Integration::Scene stage = application.GetScene();
+ Integration::Scene stage = application.GetScene();
tet_infoline(" UtcDaliSuperBlurViewSetTexture2 - test setting a second texture ");
- SuperBlurView blurView = SuperBlurView::New( BLUR_LEVELS );
- blurView.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
+ SuperBlurView blurView = SuperBlurView::New(BLUR_LEVELS);
+ blurView.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
tet_infoline("Call SetTexture and add blurview to stage");
- Texture inputTexture = CreateSolidColorTexture( application, Color::GREEN, 50, 50 );
- blurView.SetTexture( inputTexture );
+ Texture inputTexture = CreateSolidColorTexture(application, Color::GREEN, 50, 50);
+ blurView.SetTexture(inputTexture);
// start multiple guassian blur call, each guassian blur creates two render tasks
- DALI_TEST_CHECK( application.GetScene().GetRenderTaskList().GetTaskCount() == 1+BLUR_LEVELS*2);
+ DALI_TEST_CHECK(application.GetScene().GetRenderTaskList().GetTaskCount() == 1 + BLUR_LEVELS * 2);
{
// create renderers for the original image and each blurred image
- stage.Add( blurView );
+ stage.Add(blurView);
Wait(application);
- DALI_TEST_EQUALS(blurView.GetRendererCount(), BLUR_LEVELS+1, TEST_LOCATION );
+ DALI_TEST_EQUALS(blurView.GetRendererCount(), BLUR_LEVELS + 1, TEST_LOCATION);
tet_infoline("Wait for a second to allow blur to finish");
Wait(application, 1000);
tet_infoline("Remove from stage");
- application.GetScene().Remove( blurView );
+ application.GetScene().Remove(blurView);
}
tet_infoline("Test that there are no render tasks remaining");
- DALI_TEST_EQUALS(blurView.GetRendererCount(), 0, TEST_LOCATION );
+ DALI_TEST_EQUALS(blurView.GetRendererCount(), 0, TEST_LOCATION);
tet_infoline("Call SetTexture a second time and add blurview back to stage");
- Texture inputTexture2 = CreateSolidColorTexture( application, Color::CYAN, 50, 50 );
- blurView.SetTexture( inputTexture2 );
+ Texture inputTexture2 = CreateSolidColorTexture(application, Color::CYAN, 50, 50);
+ blurView.SetTexture(inputTexture2);
// start multiple guassian blur call, each guassian blur creates two render tasks
- DALI_TEST_CHECK( application.GetScene().GetRenderTaskList().GetTaskCount() == 1+BLUR_LEVELS*2);
+ DALI_TEST_CHECK(application.GetScene().GetRenderTaskList().GetTaskCount() == 1 + BLUR_LEVELS * 2);
{
// create renderers for the original image and each blurred image
- application.GetScene().Add( blurView );
+ application.GetScene().Add(blurView);
Wait(application);
- DALI_TEST_EQUALS(blurView.GetRendererCount(), BLUR_LEVELS+1, TEST_LOCATION );
+ DALI_TEST_EQUALS(blurView.GetRendererCount(), BLUR_LEVELS + 1, TEST_LOCATION);
tet_infoline("Wait for a second to allow blur to finish");
Wait(application, 1000);
tet_infoline("Remove from stage");
- application.GetScene().Remove( blurView );
+ application.GetScene().Remove(blurView);
}
tet_infoline("Test that there are no render tasks remaining");
- DALI_TEST_EQUALS(blurView.GetRendererCount(), 0, TEST_LOCATION );
+ DALI_TEST_EQUALS(blurView.GetRendererCount(), 0, TEST_LOCATION);
END_TEST;
}
-
int UtcDaliSuperBlurViewSetProperty(void)
{
ToolkitTestApplication application;
tet_infoline(" UtcDaliSuperBlurViewSetProperty ");
- SuperBlurView blurView = SuperBlurView::New( BLUR_LEVELS );
+ SuperBlurView blurView = SuperBlurView::New(BLUR_LEVELS);
// create renderers for the original image and each blurred image
- application.GetScene().Add( blurView );
- blurView.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
+ application.GetScene().Add(blurView);
+ blurView.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
// Will create ResourceImage
blurView.SetProperty(SuperBlurView::Property::IMAGE_URL, TEST_IMAGE_FILE_NAME);
// start multiple guassian blur call, each guassian blur creates two render tasks
unsigned int count = application.GetScene().GetRenderTaskList().GetTaskCount();
- DALI_TEST_CHECK( count == 1+BLUR_LEVELS*2 );
+ DALI_TEST_CHECK(count == 1 + BLUR_LEVELS * 2);
Wait(application);
END_TEST;
}
-
int UtcDaliSuperBlurViewGetProperty(void)
{
ToolkitTestApplication application;
tet_infoline(" UtcDaliSuperBlurViewSetProperty ");
- SuperBlurView blurView = SuperBlurView::New( BLUR_LEVELS );
- blurView.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
+ SuperBlurView blurView = SuperBlurView::New(BLUR_LEVELS);
+ blurView.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
blurView.SetProperty(SuperBlurView::Property::IMAGE_URL, TEST_IMAGE_FILE_NAME);
Wait(application);
// create renderers for the original image and each blurred image
- application.GetScene().Add( blurView );
+ application.GetScene().Add(blurView);
- std::string imageUrl = blurView.GetProperty<std::string>( SuperBlurView::Property::IMAGE_URL );
- DALI_TEST_EQUALS( imageUrl, TEST_IMAGE_FILE_NAME, TEST_LOCATION );
+ std::string imageUrl = blurView.GetProperty<std::string>(SuperBlurView::Property::IMAGE_URL);
+ DALI_TEST_EQUALS(imageUrl, TEST_IMAGE_FILE_NAME, TEST_LOCATION);
END_TEST;
}
-
int UtcDaliSuperBlurViewSetGetBlurStrength(void)
{
ToolkitTestApplication application;
tet_infoline(" UtcDaliSuperBlurViewSetGetBlurStrength ");
- SuperBlurView blurView = SuperBlurView::New( BLUR_LEVELS );
- DALI_TEST_EQUALS(blurView.GetCurrentBlurStrength(), 0.f, TEST_LOCATION );
+ SuperBlurView blurView = SuperBlurView::New(BLUR_LEVELS);
+ DALI_TEST_EQUALS(blurView.GetCurrentBlurStrength(), 0.f, TEST_LOCATION);
- blurView.SetBlurStrength( 0.65f );
+ blurView.SetBlurStrength(0.65f);
Wait(application);
- DALI_TEST_EQUALS(blurView.GetCurrentBlurStrength(), 0.65f, TEST_LOCATION );
+ DALI_TEST_EQUALS(blurView.GetCurrentBlurStrength(), 0.65f, TEST_LOCATION);
END_TEST;
}
tet_infoline(" UtcDaliSuperBlurViewGetBlurStrengthPropertyIndex ");
- SuperBlurView blurView = SuperBlurView::New( BLUR_LEVELS );
+ SuperBlurView blurView = SuperBlurView::New(BLUR_LEVELS);
Property::Index blurPropertyIdx = blurView.GetBlurStrengthPropertyIndex();
float blurStrength;
- (blurView.GetProperty( blurPropertyIdx )).Get(blurStrength);
- DALI_TEST_EQUALS(blurStrength, 0.f, TEST_LOCATION );
+ (blurView.GetProperty(blurPropertyIdx)).Get(blurStrength);
+ DALI_TEST_EQUALS(blurStrength, 0.f, TEST_LOCATION);
- blurView.SetBlurStrength( 0.65f );
+ blurView.SetBlurStrength(0.65f);
Wait(application);
- (blurView.GetProperty( blurPropertyIdx )).Get(blurStrength);
- DALI_TEST_EQUALS(blurStrength, 0.65f, TEST_LOCATION );
+ (blurView.GetProperty(blurPropertyIdx)).Get(blurStrength);
+ DALI_TEST_EQUALS(blurStrength, 0.65f, TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliSuperBlurViewGetBlurredTexture" );
+ tet_infoline("UtcDaliSuperBlurViewGetBlurredTexture");
- SuperBlurView blurView = SuperBlurView::New( BLUR_LEVELS );
- blurView.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
- Texture inputTexture = CreateSolidColorTexture( application, Color::GREEN, 100, 100 );
- blurView.SetTexture( inputTexture );
+ SuperBlurView blurView = SuperBlurView::New(BLUR_LEVELS);
+ blurView.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ Texture inputTexture = CreateSolidColorTexture(application, Color::GREEN, 100, 100);
+ blurView.SetTexture(inputTexture);
Wait(application, 200); // Make sure all the gaussian blur finished
- Texture texture1 = blurView.GetBlurredTexture( 1 );
- DALI_TEST_CHECK( texture1 );
+ Texture texture1 = blurView.GetBlurredTexture(1);
+ DALI_TEST_CHECK(texture1);
- Texture texture2 = blurView.GetBlurredTexture( 2 );
- DALI_TEST_EQUALS( texture2.GetWidth(), 25u, TEST_LOCATION );
- DALI_TEST_EQUALS( texture2.GetHeight(), 25u, TEST_LOCATION );
+ Texture texture2 = blurView.GetBlurredTexture(2);
+ DALI_TEST_EQUALS(texture2.GetWidth(), 25u, TEST_LOCATION);
+ DALI_TEST_EQUALS(texture2.GetHeight(), 25u, TEST_LOCATION);
- Texture texture3 = blurView.GetBlurredTexture( 3 );
- DALI_TEST_CHECK( texture3 );
+ Texture texture3 = blurView.GetBlurredTexture(3);
+ DALI_TEST_CHECK(texture3);
END_TEST;
}
tet_infoline(" UtcDaliSuperBlurViewSignal ");
- SuperBlurView blurView = SuperBlurView::New( BLUR_LEVELS );
- blurView.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
+ SuperBlurView blurView = SuperBlurView::New(BLUR_LEVELS);
+ blurView.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
- Texture inputTexture = CreateSolidColorTexture( application, Color::GREEN, 50, 50 );
- blurView.SetTexture( inputTexture );
+ Texture inputTexture = CreateSolidColorTexture(application, Color::GREEN, 50, 50);
+ blurView.SetTexture(inputTexture);
// start multiple guassian blur call, each guassian blur creates two render tasks
- DALI_TEST_CHECK( application.GetScene().GetRenderTaskList().GetTaskCount() == 1+BLUR_LEVELS*2);
+ DALI_TEST_CHECK(application.GetScene().GetRenderTaskList().GetTaskCount() == 1 + BLUR_LEVELS * 2);
SignalHandler signalHandler;
blurView.BlurFinishedSignal().Connect(&signalHandler, &SignalHandler::Callback);
// create renderers for the original image and each blurred image
- application.GetScene().Add( blurView );
+ application.GetScene().Add(blurView);
Wait(application, 1000);
- DALI_TEST_EQUALS(blurView.GetRendererCount(), BLUR_LEVELS+1, TEST_LOCATION );
+ DALI_TEST_EQUALS(blurView.GetRendererCount(), BLUR_LEVELS + 1, TEST_LOCATION);
//DALI_TEST_EQUALS(signalHandler.GetCalls(), 1, TEST_LOCATION);
END_TEST;
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <stdlib.h>
-#include <unistd.h>
-#include <dali/dali.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
+#include <dali/dali.h>
+#include <stdlib.h>
+#include <unistd.h>
using namespace Dali;
using namespace Dali::Toolkit;
namespace
{
-
// Resolution: 50*50, pixel format: RGBA8888
static const char* gImage_50_RGBA = TEST_RESOURCE_DIR "/icon-delete.png";
// Resolution: 128*128, pixel format: RGB888
static const char* gImage_128_RGB = TEST_RESOURCE_DIR "/gallery-small-1.jpg";
-
-void VerifyLoad( PixelData pixelData, uint32_t width, uint32_t height )
+void VerifyLoad(PixelData pixelData, uint32_t width, uint32_t height)
{
- DALI_TEST_CHECK( pixelData );
- DALI_TEST_EQUALS<unsigned int>( pixelData.GetWidth(), width, TEST_LOCATION );
- DALI_TEST_EQUALS<unsigned int>( pixelData.GetHeight(), height, TEST_LOCATION );
+ DALI_TEST_CHECK(pixelData);
+ DALI_TEST_EQUALS<unsigned int>(pixelData.GetWidth(), width, TEST_LOCATION);
+ DALI_TEST_EQUALS<unsigned int>(pixelData.GetHeight(), height, TEST_LOCATION);
}
} // anonymous namespace
-
int UtcDaliSyncImageLoaderLoad(void)
{
- PixelData pixelData = Toolkit::SyncImageLoader::Load( gImage_50_RGBA );
+ PixelData pixelData = Toolkit::SyncImageLoader::Load(gImage_50_RGBA);
- DALI_TEST_CHECK( pixelData );
+ DALI_TEST_CHECK(pixelData);
END_TEST;
}
int UtcDaliSyncImageLoaderLoadWithDimensions(void)
{
- PixelData pixelData = Toolkit::SyncImageLoader::Load( gImage_50_RGBA, ImageDimensions( 25, 25 ) );
+ PixelData pixelData = Toolkit::SyncImageLoader::Load(gImage_50_RGBA, ImageDimensions(25, 25));
- VerifyLoad( pixelData, 25u, 25u );
+ VerifyLoad(pixelData, 25u, 25u);
END_TEST;
}
int UtcDaliSyncImageLoaderLoadWithAllOptions(void)
{
- PixelData pixelData = Toolkit::SyncImageLoader::Load( gImage_128_RGB, ImageDimensions( 100, 100 ), FittingMode::SCALE_TO_FILL, SamplingMode::BOX_THEN_LINEAR, true );
+ PixelData pixelData = Toolkit::SyncImageLoader::Load(gImage_128_RGB, ImageDimensions(100, 100), FittingMode::SCALE_TO_FILL, SamplingMode::BOX_THEN_LINEAR, true);
- VerifyLoad( pixelData, 100u, 100u );
+ VerifyLoad(pixelData, 100u, 100u);
END_TEST;
}
*
*/
-#include <iostream>
-#include <stdlib.h>
-#include <sstream>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/controls/table-view/table-view.h>
+#include <stdlib.h>
+#include <iostream>
+#include <sstream>
using namespace Dali;
using namespace Toolkit;
namespace
{
-
-const char* const PROPERTY_NAME_ROWS = "rows";
-const char* const PROPERTY_NAME_COLUMNS = "columns";
-const char* const PROPERTY_NAME_CELL_PADDING = "cellPadding";
-const char* const PROPERTY_NAME_LAYOUT_ROWS = "layoutRows";
+const char* const PROPERTY_NAME_ROWS = "rows";
+const char* const PROPERTY_NAME_COLUMNS = "columns";
+const char* const PROPERTY_NAME_CELL_PADDING = "cellPadding";
+const char* const PROPERTY_NAME_LAYOUT_ROWS = "layoutRows";
const char* const PROPERTY_NAME_LAYOUT_COLUMNS = "layoutColumns";
-const Vector2 CELL_SIZE( 10, 10 );
+const Vector2 CELL_SIZE(10, 10);
static bool gObjectCreatedCallBackCalled;
struct Constraint100
{
- Constraint100( )
+ Constraint100()
{
}
/**
* function operator to apply the parent size
*/
- void operator()( Dali::Vector3& current, const PropertyInputContainer& /* inputs */ )
+ void operator()(Dali::Vector3& current, const PropertyInputContainer& /* inputs */)
{
current.x = current.y = current.z = 100.0f;
}
// Convenience function to quickly set up a 10x10 table with each cell being 10x10 pixels in size by default.
static void SetupTableViewAndActors(Integration::Scene scene, TableView& tableView, Actor& actor1, Actor& actor2, Actor& actor3)
{
- tableView = TableView::New( 10, 10 ); // 10 by 10 grid.
- DALI_TEST_CHECK( tableView );
+ tableView = TableView::New(10, 10); // 10 by 10 grid.
+ DALI_TEST_CHECK(tableView);
- scene.Add( tableView );
- tableView.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
+ scene.Add(tableView);
+ tableView.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
actor1 = Actor::New();
actor2 = Actor::New();
actor3 = Actor::New();
- actor1.SetProperty( Actor::Property::SIZE, CELL_SIZE );
- actor2.SetProperty( Actor::Property::SIZE, CELL_SIZE );
- actor3.SetProperty( Actor::Property::SIZE, CELL_SIZE );
+ actor1.SetProperty(Actor::Property::SIZE, CELL_SIZE);
+ actor2.SetProperty(Actor::Property::SIZE, CELL_SIZE);
+ actor3.SetProperty(Actor::Property::SIZE, CELL_SIZE);
- tableView.AddChild( actor1, TableView::CellPosition( 0, 0 ) );
- tableView.AddChild( actor2, TableView::CellPosition( 0, 1 ) );
- tableView.AddChild( actor3, TableView::CellPosition( 1, 0 ) );
+ tableView.AddChild(actor1, TableView::CellPosition(0, 0));
+ tableView.AddChild(actor2, TableView::CellPosition(0, 1));
+ tableView.AddChild(actor3, TableView::CellPosition(1, 0));
}
} // namespace
{
ToolkitTestApplication application;
- TableView actor1 = TableView::New(10,10);
- TableView actor2( actor1 );
+ TableView actor1 = TableView::New(10, 10);
+ TableView actor2(actor1);
- DALI_TEST_EQUALS( actor1, actor2, TEST_LOCATION );
+ DALI_TEST_EQUALS(actor1, actor2, TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- TableView tableView = TableView::New(10,10);
+ TableView tableView = TableView::New(10, 10);
DALI_TEST_CHECK(tableView);
//Additional check to ensure object is created by checking if it's registered
ObjectRegistry registry = application.GetCore().GetObjectRegistry();
- DALI_TEST_CHECK( registry );
+ DALI_TEST_CHECK(registry);
gObjectCreatedCallBackCalled = false;
registry.ObjectCreatedSignal().Connect(&TestCallback);
{
- TableView tableView = TableView::New(10,10);
+ TableView tableView = TableView::New(10, 10);
}
- DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
+ DALI_TEST_CHECK(gObjectCreatedCallBackCalled);
END_TEST;
}
tet_infoline("UtcDaliTableViewMetricsPadding");
TableView tableView;
- Actor actor1;
- Actor actor2;
- Actor actor3;
+ Actor actor1;
+ Actor actor2;
+ Actor actor3;
SetupTableViewAndActors(application.GetScene(), tableView, actor1, actor2, actor3);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( tableView.GetCellPadding(), Size(0.0f, 0.0f), TEST_LOCATION );
- DALI_TEST_EQUALS( actor1.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
- DALI_TEST_EQUALS( actor2.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION );
- DALI_TEST_EQUALS( actor3.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(tableView.GetCellPadding(), Size(0.0f, 0.0f), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor1.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor3.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION);
// 1. check that padding works. some padding:
tableView.SetCellPadding(Size(5.0f, 10.0f));
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( tableView.GetCellPadding(), Size(5.0f, 10.0f), TEST_LOCATION );
- DALI_TEST_EQUALS( actor1.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(5.0f, 10.0f, 0.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(tableView.GetCellPadding(), Size(5.0f, 10.0f), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor1.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(5.0f, 10.0f, 0.0f), TEST_LOCATION);
END_TEST;
}
tet_infoline("UtcDaliTableViewMetricsFit");
TableView tableView;
- Actor actor1;
- Actor actor2;
- Actor actor3;
+ Actor actor1;
+ Actor actor2;
+ Actor actor3;
SetupTableViewAndActors(application.GetScene(), tableView, actor1, actor2, actor3);
application.SendNotification();
application.Render();
// 1. check that with no fixed width/heights, actors are in default position.
- DALI_TEST_EQUALS( actor1.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
- DALI_TEST_EQUALS( actor2.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION );
- DALI_TEST_EQUALS( actor3.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(actor1.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor3.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION);
// 2. check that with a fixed width & height, actors to the right and below are offsetted.
tableView.SetFitHeight(0);
tableView.SetFitWidth(0);
- DALI_TEST_EQUALS( tableView.IsFitHeight(0), true, TEST_LOCATION );
- DALI_TEST_EQUALS( tableView.IsFitWidth(0), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(tableView.IsFitHeight(0), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(tableView.IsFitWidth(0), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( actor1.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
- DALI_TEST_EQUALS( actor2.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION );
- DALI_TEST_EQUALS( actor3.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(actor1.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor3.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION);
- tableView.SetProperty( Dali::Actor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::RIGHT_TO_LEFT );
+ tableView.SetProperty(Dali::Actor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::RIGHT_TO_LEFT);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( actor1.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(90.0f, 0.0f, 0.0f), TEST_LOCATION );
- DALI_TEST_EQUALS( actor2.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(80.0f, 0.0f, 0.0f), TEST_LOCATION );
- DALI_TEST_EQUALS( actor3.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(90.0f, 10.0f, 0.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(actor1.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(90.0f, 0.0f, 0.0f), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(80.0f, 0.0f, 0.0f), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor3.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(90.0f, 10.0f, 0.0f), TEST_LOCATION);
- tableView.SetProperty( Dali::Actor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::LEFT_TO_RIGHT );
+ tableView.SetProperty(Dali::Actor::Property::LAYOUT_DIRECTION, Dali::LayoutDirection::LEFT_TO_RIGHT);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( actor1.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
- DALI_TEST_EQUALS( actor2.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION );
- DALI_TEST_EQUALS( actor3.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(actor1.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor3.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION);
END_TEST;
}
tet_infoline("UtcDaliTableViewMetricsFixed");
TableView tableView;
- Actor actor1;
- Actor actor2;
- Actor actor3;
+ Actor actor1;
+ Actor actor2;
+ Actor actor3;
SetupTableViewAndActors(application.GetScene(), tableView, actor1, actor2, actor3);
application.SendNotification();
application.Render();
// 1. check that with no fixed width/heights, actors are in default position.
- DALI_TEST_EQUALS( actor1.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
- DALI_TEST_EQUALS( actor2.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION );
- DALI_TEST_EQUALS( actor3.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(actor1.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor3.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION);
// 2. check that with a fixed width & height, actors to the right and below are offsetted.
tableView.SetFixedWidth(0, 20.0f);
tableView.SetFixedHeight(0, 50.0f);
- DALI_TEST_EQUALS( tableView.GetFixedWidth(0), 20.0f, TEST_LOCATION );
- DALI_TEST_EQUALS( tableView.GetFixedHeight(0), 50.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(tableView.GetFixedWidth(0), 20.0f, TEST_LOCATION);
+ DALI_TEST_EQUALS(tableView.GetFixedHeight(0), 50.0f, TEST_LOCATION);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( actor1.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
- DALI_TEST_EQUALS( actor2.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(20.0f, 0.0f, 0.0f), TEST_LOCATION );
- DALI_TEST_EQUALS( actor3.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 50.0f, 0.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(actor1.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(20.0f, 0.0f, 0.0f), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor3.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 50.0f, 0.0f), TEST_LOCATION);
END_TEST;
}
tet_infoline("UtcDaliTableViewMetricsRelative");
TableView tableView;
- Actor actor1;
- Actor actor2;
- Actor actor3;
+ Actor actor1;
+ Actor actor2;
+ Actor actor3;
SetupTableViewAndActors(application.GetScene(), tableView, actor1, actor2, actor3);
application.SendNotification();
application.Render();
// 1. check that with no relative width/heights, actors are in default position.
- DALI_TEST_EQUALS( actor1.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
- DALI_TEST_EQUALS( actor2.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION );
- DALI_TEST_EQUALS( actor3.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(actor1.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor3.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION);
// 2. check that with a relative width & height, actors to the right and below are offsetted.
tableView.SetRelativeWidth(0, 0.3f); // cell 0,0 occupies 30%x50% of the grid (i.e. 30x50 pixels)
tableView.SetRelativeHeight(0, 0.5f);
- DALI_TEST_EQUALS( tableView.GetRelativeWidth(0), 0.3f, TEST_LOCATION );
- DALI_TEST_EQUALS( tableView.GetRelativeHeight(0), 0.5f, TEST_LOCATION );
+ DALI_TEST_EQUALS(tableView.GetRelativeWidth(0), 0.3f, TEST_LOCATION);
+ DALI_TEST_EQUALS(tableView.GetRelativeHeight(0), 0.5f, TEST_LOCATION);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( actor1.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
- DALI_TEST_EQUALS( actor2.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(30.0f, 0.0f, 0.0f), TEST_LOCATION );
- DALI_TEST_EQUALS( actor3.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(0.0f, 50.0f, 0.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(actor1.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(30.0f, 0.0f, 0.0f), TEST_LOCATION);
+ DALI_TEST_EQUALS(actor3.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(0.0f, 50.0f, 0.0f), TEST_LOCATION);
END_TEST;
}
-
// Test Adding/Removing/Finding Children.
int UtcDaliTableViewChild(void)
{
tet_infoline("UtcDaliTableViewChild");
// Create a 10x10 table-view
- TableView tableView = TableView::New(10,10);
- DALI_TEST_CHECK( tableView );
+ TableView tableView = TableView::New(10, 10);
+ DALI_TEST_CHECK(tableView);
// Check if actor doesn't exist.
- DALI_TEST_CHECK( !tableView.GetChildAt(TableView::CellPosition(0,0)) );
+ DALI_TEST_CHECK(!tableView.GetChildAt(TableView::CellPosition(0, 0)));
// Add an actor to it at 0,0
Actor actor = Actor::New();
tableView.AddChild(actor, TableView::CellPosition());
// Check if exists.
- DALI_TEST_CHECK( tableView.GetChildAt(TableView::CellPosition(0,0)) );
+ DALI_TEST_CHECK(tableView.GetChildAt(TableView::CellPosition(0, 0)));
// Remove this actor
tableView.RemoveChildAt(TableView::CellPosition());
// Check if actor no longer exists.
- DALI_TEST_CHECK( !tableView.GetChildAt(TableView::CellPosition(0,0)) );
+ DALI_TEST_CHECK(!tableView.GetChildAt(TableView::CellPosition(0, 0)));
// Add actor to it again, but at 2,5
- tableView.AddChild(actor, TableView::CellPosition(2,5));
+ tableView.AddChild(actor, TableView::CellPosition(2, 5));
// Add another actor somewhere else 7,8
Actor actor2 = Actor::New();
- tableView.AddChild(actor2, TableView::CellPosition(7,8));
+ tableView.AddChild(actor2, TableView::CellPosition(7, 8));
Actor searchActor;
// Check that no actor exists in a few random places.
- DALI_TEST_CHECK( !tableView.GetChildAt(TableView::CellPosition(0,0)) );
- DALI_TEST_CHECK( !tableView.GetChildAt(TableView::CellPosition(2,1)) );
- DALI_TEST_CHECK( !tableView.GetChildAt(TableView::CellPosition(6,3)) );
- DALI_TEST_CHECK( !tableView.GetChildAt(TableView::CellPosition(9,5)) );
+ DALI_TEST_CHECK(!tableView.GetChildAt(TableView::CellPosition(0, 0)));
+ DALI_TEST_CHECK(!tableView.GetChildAt(TableView::CellPosition(2, 1)));
+ DALI_TEST_CHECK(!tableView.GetChildAt(TableView::CellPosition(6, 3)));
+ DALI_TEST_CHECK(!tableView.GetChildAt(TableView::CellPosition(9, 5)));
// Check for actors at actual positions.
- searchActor = tableView.GetChildAt(TableView::CellPosition(2,5));
- DALI_TEST_CHECK( searchActor == actor);
+ searchActor = tableView.GetChildAt(TableView::CellPosition(2, 5));
+ DALI_TEST_CHECK(searchActor == actor);
- searchActor = tableView.GetChildAt(TableView::CellPosition(7,8));
- DALI_TEST_CHECK( searchActor == actor2);
+ searchActor = tableView.GetChildAt(TableView::CellPosition(7, 8));
+ DALI_TEST_CHECK(searchActor == actor2);
// Create a second table, and add already added Child to new one.
- TableView tableView2 = TableView::New(5,5);
- tableView2.AddChild(actor, TableView::CellPosition(2,2));
- DALI_TEST_CHECK( tableView2.GetChildAt(TableView::CellPosition(2,2)) );
+ TableView tableView2 = TableView::New(5, 5);
+ tableView2.AddChild(actor, TableView::CellPosition(2, 2));
+ DALI_TEST_CHECK(tableView2.GetChildAt(TableView::CellPosition(2, 2)));
END_TEST;
}
tet_infoline("UtcDaliTableViewAdd");
// Create a 4x1 table-view, and just keep adding.
- TableView tableView = TableView::New(1,4);
- DALI_TEST_CHECK( tableView );
+ TableView tableView = TableView::New(1, 4);
+ DALI_TEST_CHECK(tableView);
- for(unsigned int i = 0;i<16;i++)
+ for(unsigned int i = 0; i < 16; i++)
{
- Actor currentActor = Actor::New();
- TableView::CellPosition position = TableView::CellPosition();
- tableView.Add( currentActor );
+ Actor currentActor = Actor::New();
+ TableView::CellPosition position = TableView::CellPosition();
+ tableView.Add(currentActor);
tableView.FindChildPosition(currentActor, position);
tet_printf("%dx%d (%d,%d)\n", tableView.GetColumns(), tableView.GetRows(), position.columnIndex, position.rowIndex);
tet_infoline("UtcDaliTableViewCells");
// Create a 10x10 table-view
- TableView tableView = TableView::New(10,10);
- DALI_TEST_CHECK( tableView );
+ TableView tableView = TableView::New(10, 10);
+ DALI_TEST_CHECK(tableView);
// Add a few actors to the table.
Actor actor1 = Actor::New();
Actor actor2 = Actor::New();
Actor actor3 = Actor::New();
- actor1.SetProperty( Dali::Actor::Property::NAME,"Actor1");
- actor2.SetProperty( Dali::Actor::Property::NAME,"Actor2");
- actor3.SetProperty( Dali::Actor::Property::NAME,"Actor3");
+ actor1.SetProperty(Dali::Actor::Property::NAME, "Actor1");
+ actor2.SetProperty(Dali::Actor::Property::NAME, "Actor2");
+ actor3.SetProperty(Dali::Actor::Property::NAME, "Actor3");
// note: positions are specified in reversed cartesian coords - row,col (i.e. y,x)
- tableView.AddChild(actor1, TableView::CellPosition(0,0));
- tableView.AddChild(actor2, TableView::CellPosition(5,5));
- tableView.AddChild(actor3, TableView::CellPosition(7,2));
+ tableView.AddChild(actor1, TableView::CellPosition(0, 0));
+ tableView.AddChild(actor2, TableView::CellPosition(5, 5));
+ tableView.AddChild(actor3, TableView::CellPosition(7, 2));
- DALI_TEST_CHECK( tableView.GetRows() == 10 && tableView.GetColumns() == 10 );
+ DALI_TEST_CHECK(tableView.GetRows() == 10 && tableView.GetColumns() == 10);
// Add a row between actor1 and actor2 | insert column on actor1 and see what happens...
tableView.InsertRow(3);
tableView.InsertColumn(0);
- DALI_TEST_CHECK( tableView.GetRows() == 11 && tableView.GetColumns() == 11 );
+ DALI_TEST_CHECK(tableView.GetRows() == 11 && tableView.GetColumns() == 11);
TableView::CellPosition cellPosition;
- bool result;
+ bool result;
result = tableView.FindChildPosition(actor1, cellPosition);
- DALI_TEST_CHECK( result && cellPosition.rowIndex == 0 && cellPosition.columnIndex == 1);
+ DALI_TEST_CHECK(result && cellPosition.rowIndex == 0 && cellPosition.columnIndex == 1);
result = tableView.FindChildPosition(actor2, cellPosition);
- DALI_TEST_CHECK( result && cellPosition.rowIndex == 6 && cellPosition.columnIndex == 6);
+ DALI_TEST_CHECK(result && cellPosition.rowIndex == 6 && cellPosition.columnIndex == 6);
result = tableView.FindChildPosition(actor3, cellPosition);
- DALI_TEST_CHECK( result && cellPosition.rowIndex == 8 && cellPosition.columnIndex == 3);
+ DALI_TEST_CHECK(result && cellPosition.rowIndex == 8 && cellPosition.columnIndex == 3);
// Delete a row between actor2 and actor3 | delete column on actor2 and see what happens...
tableView.DeleteRow(7);
tableView.DeleteColumn(6);
- DALI_TEST_CHECK( tableView.GetRows() == 10 && tableView.GetColumns() == 10 );
+ DALI_TEST_CHECK(tableView.GetRows() == 10 && tableView.GetColumns() == 10);
result = tableView.FindChildPosition(actor1, cellPosition);
- DALI_TEST_CHECK( result && cellPosition.rowIndex == 0 && cellPosition.columnIndex == 1);
+ DALI_TEST_CHECK(result && cellPosition.rowIndex == 0 && cellPosition.columnIndex == 1);
result = tableView.FindChildPosition(actor2, cellPosition);
- DALI_TEST_CHECK( !result );
+ DALI_TEST_CHECK(!result);
result = tableView.FindChildPosition(actor3, cellPosition);
- DALI_TEST_CHECK( result && cellPosition.rowIndex == 7 && cellPosition.columnIndex == 3);
+ DALI_TEST_CHECK(result && cellPosition.rowIndex == 7 && cellPosition.columnIndex == 3);
// Delete the other two remaining actors by a row delete and a column delete.
std::vector<Actor> actorsRemoved;
tableView.DeleteRow(0, actorsRemoved);
tet_printf("Row Delete >> Actors Removed: %d {", actorsRemoved.size());
- for(size_t i = 0;i<actorsRemoved.size();i++) tet_printf("%d => %s, ", i, actorsRemoved[i].GetProperty< std::string >( Dali::Actor::Property::NAME ).c_str());
+ for(size_t i = 0; i < actorsRemoved.size(); i++) tet_printf("%d => %s, ", i, actorsRemoved[i].GetProperty<std::string>(Dali::Actor::Property::NAME).c_str());
tet_printf("}\n");
- DALI_TEST_EQUALS( static_cast<int>(actorsRemoved.size()), 1, TEST_LOCATION );
- DALI_TEST_CHECK( actorsRemoved[0] == actor1 );
+ DALI_TEST_EQUALS(static_cast<int>(actorsRemoved.size()), 1, TEST_LOCATION);
+ DALI_TEST_CHECK(actorsRemoved[0] == actor1);
actorsRemoved.clear();
tableView.DeleteColumn(3, actorsRemoved);
tet_printf("Column Delete >> Actors Removed: %d {", actorsRemoved.size());
- for(size_t i = 0;i<actorsRemoved.size();i++) tet_printf("%d => %s, ", i, actorsRemoved[i].GetProperty< std::string >( Dali::Actor::Property::NAME ).c_str());
+ for(size_t i = 0; i < actorsRemoved.size(); i++) tet_printf("%d => %s, ", i, actorsRemoved[i].GetProperty<std::string>(Dali::Actor::Property::NAME).c_str());
tet_printf("}\n");
- DALI_TEST_EQUALS( static_cast<int>(actorsRemoved.size()), 1, TEST_LOCATION );
- DALI_TEST_CHECK( actorsRemoved[0] == actor3 );
+ DALI_TEST_EQUALS(static_cast<int>(actorsRemoved.size()), 1, TEST_LOCATION);
+ DALI_TEST_CHECK(actorsRemoved[0] == actor3);
- DALI_TEST_CHECK( tableView.GetRows() == 9 && tableView.GetColumns() == 9 );
+ DALI_TEST_CHECK(tableView.GetRows() == 9 && tableView.GetColumns() == 9);
- tableView.AddChild(actor1, TableView::CellPosition(5,8));
- tableView.Resize(100,100);
- DALI_TEST_CHECK( tableView.GetRows() == 100 && tableView.GetColumns() == 100 );
+ tableView.AddChild(actor1, TableView::CellPosition(5, 8));
+ tableView.Resize(100, 100);
+ DALI_TEST_CHECK(tableView.GetRows() == 100 && tableView.GetColumns() == 100);
- tableView.AddChild(actor2, TableView::CellPosition(69,57));
- DALI_TEST_CHECK( tableView.FindChildPosition(actor1, cellPosition) && tableView.FindChildPosition(actor2, cellPosition) );
+ tableView.AddChild(actor2, TableView::CellPosition(69, 57));
+ DALI_TEST_CHECK(tableView.FindChildPosition(actor1, cellPosition) && tableView.FindChildPosition(actor2, cellPosition));
- tableView.Resize(20,20);
- DALI_TEST_CHECK( tableView.FindChildPosition(actor1, cellPosition) && !tableView.FindChildPosition(actor2, cellPosition) );
+ tableView.Resize(20, 20);
+ DALI_TEST_CHECK(tableView.FindChildPosition(actor1, cellPosition) && !tableView.FindChildPosition(actor2, cellPosition));
actorsRemoved.clear();
- tableView.Resize(1,1, actorsRemoved);
- DALI_TEST_CHECK( !tableView.FindChildPosition(actor1, cellPosition) && !tableView.FindChildPosition(actor2, cellPosition) );
- DALI_TEST_EQUALS( static_cast<int>(actorsRemoved.size()), 1, TEST_LOCATION );
- DALI_TEST_CHECK( actorsRemoved[0] == actor1 );
+ tableView.Resize(1, 1, actorsRemoved);
+ DALI_TEST_CHECK(!tableView.FindChildPosition(actor1, cellPosition) && !tableView.FindChildPosition(actor2, cellPosition));
+ DALI_TEST_EQUALS(static_cast<int>(actorsRemoved.size()), 1, TEST_LOCATION);
+ DALI_TEST_CHECK(actorsRemoved[0] == actor1);
// Add child outside table size, forcing a resize.
tableView.AddChild(actor1, TableView::CellPosition(100, 100, 1, 1));
- DALI_TEST_CHECK( tableView.GetRows() == 101 && tableView.GetColumns() == 101 );
+ DALI_TEST_CHECK(tableView.GetRows() == 101 && tableView.GetColumns() == 101);
// Add child outside table size, forcing a resize.
tableView.AddChild(actor1, TableView::CellPosition(110, 110, 5, 5));
- DALI_TEST_CHECK( tableView.GetRows() == 115 && tableView.GetColumns() == 115 );
+ DALI_TEST_CHECK(tableView.GetRows() == 115 && tableView.GetColumns() == 115);
// Set the alignment of the cell
- tableView.SetCellAlignment( TableView::CellPosition(100, 100, 1, 1), HorizontalAlignment::CENTER, VerticalAlignment::CENTER );
- tableView.SetCellAlignment( TableView::CellPosition(110, 110, 5, 5), HorizontalAlignment::LEFT, VerticalAlignment::TOP );
+ tableView.SetCellAlignment(TableView::CellPosition(100, 100, 1, 1), HorizontalAlignment::CENTER, VerticalAlignment::CENTER);
+ tableView.SetCellAlignment(TableView::CellPosition(110, 110, 5, 5), HorizontalAlignment::LEFT, VerticalAlignment::TOP);
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
END_TEST;
}
tet_infoline("UtcDaliTableViewChildAssert");
// Create a 10x10 table-view
- TableView tableView = TableView::New(10,10);
- DALI_TEST_CHECK( tableView );
+ TableView tableView = TableView::New(10, 10);
+ DALI_TEST_CHECK(tableView);
Actor childActor;
try
{
- tableView.AddChild( childActor, TableView::CellPosition(0,0,5,5) );
+ tableView.AddChild(childActor, TableView::CellPosition(0, 0, 5, 5));
// should assert
tet_result(TET_FAIL);
}
- catch( Dali::DaliException& e )
+ catch(Dali::DaliException& e)
{
- DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_PRINT_ASSERT(e);
DALI_TEST_EQUALS(e.condition, "child", TEST_LOCATION);
}
END_TEST;
tet_infoline("UtcDaliTableViewChildAssert");
// Create a 10x10 table-view
- TableView tableView = TableView::New(10,10);
- DALI_TEST_CHECK( tableView );
+ TableView tableView = TableView::New(10, 10);
+ DALI_TEST_CHECK(tableView);
// fixeds...
try
{
- tableView.SetFixedHeight( 10, 1.0f );
+ tableView.SetFixedHeight(10, 1.0f);
tet_result(TET_FAIL);
}
- catch( Dali::DaliException& e )
+ catch(Dali::DaliException& e)
{
- DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_PRINT_ASSERT(e);
DALI_TEST_EQUALS(e.condition, "rowIndex < mRowData.Size()", TEST_LOCATION);
}
try
{
- tableView.GetFixedHeight( 10 );
+ tableView.GetFixedHeight(10);
tet_result(TET_FAIL);
}
- catch( Dali::DaliException& e )
+ catch(Dali::DaliException& e)
{
- DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_PRINT_ASSERT(e);
DALI_TEST_EQUALS(e.condition, "rowIndex < mRowData.Size()", TEST_LOCATION);
}
try
{
- tableView.SetFixedWidth( 10, 1.0f );
+ tableView.SetFixedWidth(10, 1.0f);
tet_result(TET_FAIL);
}
- catch( Dali::DaliException& e )
+ catch(Dali::DaliException& e)
{
- DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_PRINT_ASSERT(e);
DALI_TEST_EQUALS(e.condition, "columnIndex < mColumnData.Size()", TEST_LOCATION);
}
try
{
- tableView.GetFixedWidth( 10 );
+ tableView.GetFixedWidth(10);
tet_result(TET_FAIL);
}
- catch( Dali::DaliException& e )
+ catch(Dali::DaliException& e)
{
- DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_PRINT_ASSERT(e);
DALI_TEST_EQUALS(e.condition, "columnIndex < mColumnData.Size()", TEST_LOCATION);
}
try
{
- tableView.SetRelativeHeight( 10, 0.1f );
+ tableView.SetRelativeHeight(10, 0.1f);
tet_result(TET_FAIL);
}
- catch( Dali::DaliException& e )
+ catch(Dali::DaliException& e)
{
- DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_PRINT_ASSERT(e);
DALI_TEST_EQUALS(e.condition, "rowIndex < mRowData.Size()", TEST_LOCATION);
}
try
{
- tableView.GetRelativeHeight( 10 );
+ tableView.GetRelativeHeight(10);
tet_result(TET_FAIL);
}
- catch( Dali::DaliException& e )
+ catch(Dali::DaliException& e)
{
- DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_PRINT_ASSERT(e);
DALI_TEST_EQUALS(e.condition, "rowIndex < mRowData.Size()", TEST_LOCATION);
}
try
{
- tableView.SetRelativeWidth( 10, 0.1f );
+ tableView.SetRelativeWidth(10, 0.1f);
tet_result(TET_FAIL);
}
- catch( Dali::DaliException& e )
+ catch(Dali::DaliException& e)
{
- DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_PRINT_ASSERT(e);
DALI_TEST_EQUALS(e.condition, "columnIndex < mColumnData.Size()", TEST_LOCATION);
}
try
{
- tableView.GetRelativeWidth( 10 );
+ tableView.GetRelativeWidth(10);
tet_result(TET_FAIL);
}
- catch( Dali::DaliException& e )
+ catch(Dali::DaliException& e)
{
- DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_PRINT_ASSERT(e);
DALI_TEST_EQUALS(e.condition, "columnIndex < mColumnData.Size()", TEST_LOCATION);
}
END_TEST;
tet_infoline("UtcDaliTableViewSetGetProperty");
// Create a 1x1 table-view
- TableView tableView = TableView::New(1,1);
- tableView.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
- DALI_TEST_CHECK( tableView );
+ TableView tableView = TableView::New(1, 1);
+ tableView.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+ DALI_TEST_CHECK(tableView);
// Test "rows" property
- DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_ROWS ) == TableView::Property::ROWS );
+ DALI_TEST_CHECK(tableView.GetPropertyIndex(PROPERTY_NAME_ROWS) == TableView::Property::ROWS);
- tableView.SetProperty( TableView::Property::ROWS, 4 );
+ tableView.SetProperty(TableView::Property::ROWS, 4);
- DALI_TEST_CHECK( tableView.GetRows() == 4u );
- DALI_TEST_CHECK( tableView.GetProperty(TableView::Property::ROWS).Get<int>() == 4 );
+ DALI_TEST_CHECK(tableView.GetRows() == 4u);
+ DALI_TEST_CHECK(tableView.GetProperty(TableView::Property::ROWS).Get<int>() == 4);
// Test "columns" property
- DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_COLUMNS ) == TableView::Property::COLUMNS );
+ DALI_TEST_CHECK(tableView.GetPropertyIndex(PROPERTY_NAME_COLUMNS) == TableView::Property::COLUMNS);
- tableView.SetProperty( TableView::Property::COLUMNS, 5 );
+ tableView.SetProperty(TableView::Property::COLUMNS, 5);
- DALI_TEST_CHECK( tableView.GetColumns() == 5u );
- DALI_TEST_CHECK( tableView.GetProperty(TableView::Property::COLUMNS).Get<int>() == 5 );
+ DALI_TEST_CHECK(tableView.GetColumns() == 5u);
+ DALI_TEST_CHECK(tableView.GetProperty(TableView::Property::COLUMNS).Get<int>() == 5);
// Test "cellPadding" property
- DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_CELL_PADDING ) == TableView::Property::CELL_PADDING );
+ DALI_TEST_CHECK(tableView.GetPropertyIndex(PROPERTY_NAME_CELL_PADDING) == TableView::Property::CELL_PADDING);
- tableView.SetProperty( TableView::Property::CELL_PADDING, Size( 6.f, 8.f ) );
+ tableView.SetProperty(TableView::Property::CELL_PADDING, Size(6.f, 8.f));
- DALI_TEST_EQUALS( tableView.GetCellPadding(), Size(6.f, 8.f), TEST_LOCATION );
- DALI_TEST_EQUALS( tableView.GetProperty(TableView::Property::CELL_PADDING).Get<Vector2>(), Vector2(6.f,8.f), TEST_LOCATION );
+ DALI_TEST_EQUALS(tableView.GetCellPadding(), Size(6.f, 8.f), TEST_LOCATION);
+ DALI_TEST_EQUALS(tableView.GetProperty(TableView::Property::CELL_PADDING).Get<Vector2>(), Vector2(6.f, 8.f), TEST_LOCATION);
//{ "policy": "fixed", "value": 30.0 },
Property::Map item1;
- item1[ "policy" ] = "fixed";
- item1[ "value" ] = 30.f;
+ item1["policy"] = "fixed";
+ item1["value"] = 30.f;
//{ "policy": "relative", "value": 0.2 },
Property::Map item2;
- item2[ "policy" ] = "relative";
- item2[ "value" ] = 0.2f;
+ item2["policy"] = "relative";
+ item2["value"] = 0.2f;
// Test "layoutRows" property
- DALI_TEST_CHECK( tableView.GetPropertyIndex(PROPERTY_NAME_LAYOUT_ROWS) == TableView::Property::LAYOUT_ROWS );
+ DALI_TEST_CHECK(tableView.GetPropertyIndex(PROPERTY_NAME_LAYOUT_ROWS) == TableView::Property::LAYOUT_ROWS);
/*
* "layoutRows":
* }
*/
Property::Map layoutRows;
- layoutRows[ "1" ] = item1;
- layoutRows[ "3" ] = item2;
- tableView.SetProperty( TableView::Property::LAYOUT_ROWS, layoutRows );
+ layoutRows["1"] = item1;
+ layoutRows["3"] = item2;
+ tableView.SetProperty(TableView::Property::LAYOUT_ROWS, layoutRows);
- DALI_TEST_EQUALS( tableView.GetFixedHeight( 1u ), 30.f, TEST_LOCATION );
- DALI_TEST_EQUALS( tableView.GetRelativeHeight( 3u ), 0.2f, TEST_LOCATION );
+ DALI_TEST_EQUALS(tableView.GetFixedHeight(1u), 30.f, TEST_LOCATION);
+ DALI_TEST_EQUALS(tableView.GetRelativeHeight(3u), 0.2f, TEST_LOCATION);
Property::Map layoutRowsGet = tableView.GetProperty(TableView::Property::LAYOUT_ROWS).Get<Property::Map>();
- DALI_TEST_EQUALS( layoutRowsGet.GetKey(1).compare(layoutRows.GetKey(0)), 0, TEST_LOCATION );
- Property::Map* childMap =layoutRowsGet.GetValue(1).GetMap();
- DALI_TEST_CHECK( childMap->Find( "policy" )->Get<std::string>().compare("fixed") == 0 );
- DALI_TEST_EQUALS( childMap->Find( "value" )->Get<float>(), 30.f, TEST_LOCATION );
+ DALI_TEST_EQUALS(layoutRowsGet.GetKey(1).compare(layoutRows.GetKey(0)), 0, TEST_LOCATION);
+ Property::Map* childMap = layoutRowsGet.GetValue(1).GetMap();
+ DALI_TEST_CHECK(childMap->Find("policy")->Get<std::string>().compare("fixed") == 0);
+ DALI_TEST_EQUALS(childMap->Find("value")->Get<float>(), 30.f, TEST_LOCATION);
- childMap =layoutRowsGet.GetValue(3).GetMap();
- DALI_TEST_CHECK( layoutRowsGet.GetKey(3).compare(layoutRows.GetKey(1)) == 0 );
- DALI_TEST_CHECK( childMap->Find( "policy" )->Get<std::string>().compare("relative") == 0 );
- DALI_TEST_EQUALS( childMap->Find( "value" )->Get<float>(), 0.2f, TEST_LOCATION );
+ childMap = layoutRowsGet.GetValue(3).GetMap();
+ DALI_TEST_CHECK(layoutRowsGet.GetKey(3).compare(layoutRows.GetKey(1)) == 0);
+ DALI_TEST_CHECK(childMap->Find("policy")->Get<std::string>().compare("relative") == 0);
+ DALI_TEST_EQUALS(childMap->Find("value")->Get<float>(), 0.2f, TEST_LOCATION);
// Test "layoutColumns" property
- DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_LAYOUT_COLUMNS ) == TableView::Property::LAYOUT_COLUMNS );
+ DALI_TEST_CHECK(tableView.GetPropertyIndex(PROPERTY_NAME_LAYOUT_COLUMNS) == TableView::Property::LAYOUT_COLUMNS);
/*
* "layoutColumns":
* }
*/
Property::Map layoutColumns;
- layoutColumns[ "2" ] = item2;
- layoutColumns[ "3" ] = item1;
- tableView.SetProperty( TableView::Property::LAYOUT_COLUMNS, layoutColumns );
+ layoutColumns["2"] = item2;
+ layoutColumns["3"] = item1;
+ tableView.SetProperty(TableView::Property::LAYOUT_COLUMNS, layoutColumns);
- DALI_TEST_EQUALS( tableView.GetRelativeWidth( 2u ), 0.2f, TEST_LOCATION );
- DALI_TEST_EQUALS( tableView.GetFixedWidth( 3u ), 30.f, TEST_LOCATION );
+ DALI_TEST_EQUALS(tableView.GetRelativeWidth(2u), 0.2f, TEST_LOCATION);
+ DALI_TEST_EQUALS(tableView.GetFixedWidth(3u), 30.f, TEST_LOCATION);
Property::Map layoutColumnsGet = tableView.GetProperty(TableView::Property::LAYOUT_COLUMNS).Get<Property::Map>();
- DALI_TEST_CHECK( layoutColumnsGet.GetKey(2).compare(layoutColumns.GetKey(0)) == 0 );
- childMap =layoutColumnsGet.GetValue(2).GetMap();
- DALI_TEST_CHECK( childMap->Find( "policy" )->Get<std::string>().compare("relative") == 0 );
- DALI_TEST_EQUALS( childMap->Find( "value" )->Get<float>(), 0.2f, TEST_LOCATION );
- childMap =layoutColumnsGet.GetValue(3).GetMap();
- DALI_TEST_CHECK( layoutColumnsGet.GetKey(3).compare(layoutColumns.GetKey(1)) == 0 );
- DALI_TEST_CHECK( childMap->Find( "policy" )->Get<std::string>().compare("fixed") == 0 );
- DALI_TEST_EQUALS( childMap->Find( "value" )->Get<float>(),30.f, TEST_LOCATION );
+ DALI_TEST_CHECK(layoutColumnsGet.GetKey(2).compare(layoutColumns.GetKey(0)) == 0);
+ childMap = layoutColumnsGet.GetValue(2).GetMap();
+ DALI_TEST_CHECK(childMap->Find("policy")->Get<std::string>().compare("relative") == 0);
+ DALI_TEST_EQUALS(childMap->Find("value")->Get<float>(), 0.2f, TEST_LOCATION);
+ childMap = layoutColumnsGet.GetValue(3).GetMap();
+ DALI_TEST_CHECK(layoutColumnsGet.GetKey(3).compare(layoutColumns.GetKey(1)) == 0);
+ DALI_TEST_CHECK(childMap->Find("policy")->Get<std::string>().compare("fixed") == 0);
+ DALI_TEST_EQUALS(childMap->Find("value")->Get<float>(), 30.f, TEST_LOCATION);
END_TEST;
}
tet_infoline("UtcDaliTableViewChildProperties");
// Create a 10x10 table-view
- TableView tableView = TableView::New(10,10);
- application.GetScene().Add( tableView );
- tableView.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f) );
+ TableView tableView = TableView::New(10, 10);
+ application.GetScene().Add(tableView);
+ tableView.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
- DALI_TEST_CHECK( tableView );
+ DALI_TEST_CHECK(tableView);
// Create a child actor with the custom properties
Actor child1 = Actor::New();
- child1.SetProperty( TableView::ChildProperty::CELL_INDEX, Vector2( 3, 4 ) );
- tableView.Add( child1 );
+ child1.SetProperty(TableView::ChildProperty::CELL_INDEX, Vector2(3, 4));
+ tableView.Add(child1);
// Check for actors at actual positions.
- DALI_TEST_CHECK( tableView.GetChildAt(TableView::CellPosition(3,4)) == child1);
+ DALI_TEST_CHECK(tableView.GetChildAt(TableView::CellPosition(3, 4)) == child1);
// Create a second child actor with the custom properties
- Actor child2 = Actor::New();
- float rowSpan = 3.f;
+ Actor child2 = Actor::New();
+ float rowSpan = 3.f;
float columnSpan = 2.f;
- child2.SetProperty( TableView::ChildProperty::CELL_INDEX, Vector2( 6, 1 ) );
- child2.SetProperty( TableView::ChildProperty::ROW_SPAN, rowSpan );
- child2.SetProperty( TableView::ChildProperty::COLUMN_SPAN, columnSpan );
- tableView.Add( child2 );
+ child2.SetProperty(TableView::ChildProperty::CELL_INDEX, Vector2(6, 1));
+ child2.SetProperty(TableView::ChildProperty::ROW_SPAN, rowSpan);
+ child2.SetProperty(TableView::ChildProperty::COLUMN_SPAN, columnSpan);
+ tableView.Add(child2);
// Check for actors at actual positions.
- for( int i=0; i<rowSpan; i++ )
+ for(int i = 0; i < rowSpan; i++)
{
- for(int j=0; j<columnSpan; j++)
+ for(int j = 0; j < columnSpan; j++)
{
- DALI_TEST_CHECK( tableView.GetChildAt(TableView::CellPosition(6+i,1+j)) == child2);
+ DALI_TEST_CHECK(tableView.GetChildAt(TableView::CellPosition(6 + i, 1 + j)) == child2);
}
}
// Create a third child actor with the cell alignment properties
Actor child3 = Actor::New();
- child3.SetProperty( Actor::Property::SIZE, Vector2( 5.f, 5.f ) );
- child3.SetProperty( TableView::ChildProperty::CELL_HORIZONTAL_ALIGNMENT, "center" );
- child3.SetProperty( TableView::ChildProperty::CELL_VERTICAL_ALIGNMENT, "bottom" );
- tableView.Add( child3 );
+ child3.SetProperty(Actor::Property::SIZE, Vector2(5.f, 5.f));
+ child3.SetProperty(TableView::ChildProperty::CELL_HORIZONTAL_ALIGNMENT, "center");
+ child3.SetProperty(TableView::ChildProperty::CELL_VERTICAL_ALIGNMENT, "bottom");
+ tableView.Add(child3);
// store the actor in the first available cell
- DALI_TEST_CHECK( tableView.GetChildAt(TableView::CellPosition(0,0)) == child3)
+ DALI_TEST_CHECK(tableView.GetChildAt(TableView::CellPosition(0, 0)) == child3)
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( child3.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ), AnchorPoint::TOP_LEFT, TEST_LOCATION );
- DALI_TEST_EQUALS( child3.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ), ParentOrigin::TOP_LEFT, TEST_LOCATION );
- DALI_TEST_EQUALS( child3.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(2.5f, 5.0f, 0.0f), TEST_LOCATION );
+ DALI_TEST_EQUALS(child3.GetCurrentProperty<Vector3>(Actor::Property::ANCHOR_POINT), AnchorPoint::TOP_LEFT, TEST_LOCATION);
+ DALI_TEST_EQUALS(child3.GetCurrentProperty<Vector3>(Actor::Property::PARENT_ORIGIN), ParentOrigin::TOP_LEFT, TEST_LOCATION);
+ DALI_TEST_EQUALS(child3.GetCurrentProperty<Vector3>(Actor::Property::POSITION), Vector3(2.5f, 5.0f, 0.0f), TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- TableView tableView = TableView::New(10,10);
+ TableView tableView = TableView::New(10, 10);
- Actor actor = tableView.GetChildAt( TableView::CellPosition( 200, 200 ) );
- DALI_TEST_CHECK( !actor );
+ Actor actor = tableView.GetChildAt(TableView::CellPosition(200, 200));
+ DALI_TEST_CHECK(!actor);
END_TEST;
}
{
ToolkitTestApplication application;
- TableView tableView = TableView::New(10,10);
- DALI_TEST_CHECK( tableView.AddChild( Actor::New(), TableView::CellPosition( 0, 0 ) ) );
- DALI_TEST_CHECK( ! tableView.AddChild( Actor::New(), TableView::CellPosition( 0, 0 ) ) );
+ TableView tableView = TableView::New(10, 10);
+ DALI_TEST_CHECK(tableView.AddChild(Actor::New(), TableView::CellPosition(0, 0)));
+ DALI_TEST_CHECK(!tableView.AddChild(Actor::New(), TableView::CellPosition(0, 0)));
END_TEST;
}
{
ToolkitTestApplication application;
- TableView tableView = TableView::New(10,10);
- DALI_TEST_CHECK( tableView.AddChild( Actor::New(), TableView::CellPosition( 0, 0 , 10, 10 ) ) );
+ TableView tableView = TableView::New(10, 10);
+ DALI_TEST_CHECK(tableView.AddChild(Actor::New(), TableView::CellPosition(0, 0, 10, 10)));
tableView.InsertRow(0);
- DALI_TEST_CHECK( tableView.GetRows() == 11 );
+ DALI_TEST_CHECK(tableView.GetRows() == 11);
END_TEST;
}
{
ToolkitTestApplication application;
- TableView tableView = TableView::New(10,10);
- DALI_TEST_CHECK( tableView.AddChild( Actor::New(), TableView::CellPosition( 0, 0 , 10, 10 ) ) );
+ TableView tableView = TableView::New(10, 10);
+ DALI_TEST_CHECK(tableView.AddChild(Actor::New(), TableView::CellPosition(0, 0, 10, 10)));
tableView.DeleteRow(0);
- DALI_TEST_CHECK( tableView.GetRows() == 9 );
+ DALI_TEST_CHECK(tableView.GetRows() == 9);
END_TEST;
}
{
ToolkitTestApplication application;
- TableView tableView = TableView::New(10,10);
- DALI_TEST_CHECK( tableView.AddChild( Actor::New(), TableView::CellPosition( 0, 0 , 10, 10 ) ) );
+ TableView tableView = TableView::New(10, 10);
+ DALI_TEST_CHECK(tableView.AddChild(Actor::New(), TableView::CellPosition(0, 0, 10, 10)));
tableView.InsertColumn(0);
- DALI_TEST_CHECK( tableView.GetColumns() == 11 );
+ DALI_TEST_CHECK(tableView.GetColumns() == 11);
END_TEST;
}
{
ToolkitTestApplication application;
- TableView tableView = TableView::New(10,10);
- DALI_TEST_CHECK( tableView.AddChild( Actor::New(), TableView::CellPosition( 0, 0 , 10, 10 ) ) );
+ TableView tableView = TableView::New(10, 10);
+ DALI_TEST_CHECK(tableView.AddChild(Actor::New(), TableView::CellPosition(0, 0, 10, 10)));
tableView.DeleteColumn(0);
- DALI_TEST_CHECK( tableView.GetColumns() == 9 );
+ DALI_TEST_CHECK(tableView.GetColumns() == 9);
END_TEST;
}
ToolkitTestApplication application;
TypeRegistry typeRegistry = TypeRegistry::Get();
- DALI_TEST_CHECK( typeRegistry );
+ DALI_TEST_CHECK(typeRegistry);
- TypeInfo typeInfo = typeRegistry.GetTypeInfo( "TableView" );
- DALI_TEST_CHECK( typeInfo );
+ TypeInfo typeInfo = typeRegistry.GetTypeInfo("TableView");
+ DALI_TEST_CHECK(typeInfo);
BaseHandle handle = typeInfo.CreateInstance();
- DALI_TEST_CHECK( handle );
+ DALI_TEST_CHECK(handle);
- TableView view = TableView::DownCast( handle );
- DALI_TEST_CHECK( view );
+ TableView view = TableView::DownCast(handle);
+ DALI_TEST_CHECK(view);
END_TEST;
}
{
ToolkitTestApplication application;
- TableView tableView = TableView::New(4,4);
- tableView.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true );
- tableView.SetProperty( Dali::Actor::Property::NAME, "TableView");
+ TableView tableView = TableView::New(4, 4);
+ tableView.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
+ tableView.SetProperty(Dali::Actor::Property::NAME, "TableView");
- for ( int row = 0; row < 4; ++row )
+ for(int row = 0; row < 4; ++row)
{
- for ( int col = 0; col < 4; ++col )
+ for(int col = 0; col < 4; ++col)
{
- Control control = Control::New();
+ Control control = Control::New();
std::ostringstream str;
str << row << "-" << col;
- control.SetProperty( Dali::Actor::Property::NAME, str.str() );
- control.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true );
- tableView.AddChild( control, TableView::CellPosition( row, col ) );
+ control.SetProperty(Dali::Actor::Property::NAME, str.str());
+ control.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
+ tableView.AddChild(control, TableView::CellPosition(row, col));
}
}
- application.GetScene().Add( tableView );
+ application.GetScene().Add(tableView);
application.SendNotification();
application.Render();
- Actor firstFocusActor = Toolkit::Internal::GetImplementation( tableView ).GetNextKeyboardFocusableActor( Actor(), Control::KeyboardFocus::RIGHT, true );
- DALI_TEST_CHECK( firstFocusActor );
- DALI_TEST_CHECK( firstFocusActor.GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-0" );
+ Actor firstFocusActor = Toolkit::Internal::GetImplementation(tableView).GetNextKeyboardFocusableActor(Actor(), Control::KeyboardFocus::RIGHT, true);
+ DALI_TEST_CHECK(firstFocusActor);
+ DALI_TEST_CHECK(firstFocusActor.GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-0");
KeyboardFocusManager manager = KeyboardFocusManager::Get();
- manager.SetFocusGroupLoop( true );
- manager.SetCurrentFocusActor( firstFocusActor );
-
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-0" );
- manager.MoveFocus( Control::KeyboardFocus::RIGHT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-1" );
- manager.MoveFocus( Control::KeyboardFocus::RIGHT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-2" );
- manager.MoveFocus( Control::KeyboardFocus::RIGHT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-3" );
- manager.MoveFocus( Control::KeyboardFocus::RIGHT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-0" );
-
- manager.MoveFocus( Control::KeyboardFocus::LEFT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-3" );
- manager.MoveFocus( Control::KeyboardFocus::LEFT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-2" );
- manager.MoveFocus( Control::KeyboardFocus::LEFT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-1" );
- manager.MoveFocus( Control::KeyboardFocus::LEFT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-0" );
- manager.MoveFocus( Control::KeyboardFocus::LEFT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "3-3" );
-
- manager.MoveFocus( Control::KeyboardFocus::RIGHT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-0" );
- manager.MoveFocus( Control::KeyboardFocus::RIGHT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-1" );
-
- manager.MoveFocus( Control::KeyboardFocus::DOWN );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-1" );
- manager.MoveFocus( Control::KeyboardFocus::DOWN );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "2-1" );
- manager.MoveFocus( Control::KeyboardFocus::DOWN );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "3-1" );
- manager.MoveFocus( Control::KeyboardFocus::DOWN );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-1" );
-
- manager.MoveFocus( Control::KeyboardFocus::UP );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "3-1" );
- manager.MoveFocus( Control::KeyboardFocus::UP );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "2-1" );
- manager.MoveFocus( Control::KeyboardFocus::UP );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-1" );
- manager.MoveFocus( Control::KeyboardFocus::UP );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-1" );
+ manager.SetFocusGroupLoop(true);
+ manager.SetCurrentFocusActor(firstFocusActor);
+
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-0");
+ manager.MoveFocus(Control::KeyboardFocus::RIGHT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-1");
+ manager.MoveFocus(Control::KeyboardFocus::RIGHT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-2");
+ manager.MoveFocus(Control::KeyboardFocus::RIGHT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-3");
+ manager.MoveFocus(Control::KeyboardFocus::RIGHT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-0");
+
+ manager.MoveFocus(Control::KeyboardFocus::LEFT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-3");
+ manager.MoveFocus(Control::KeyboardFocus::LEFT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-2");
+ manager.MoveFocus(Control::KeyboardFocus::LEFT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-1");
+ manager.MoveFocus(Control::KeyboardFocus::LEFT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-0");
+ manager.MoveFocus(Control::KeyboardFocus::LEFT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "3-3");
+
+ manager.MoveFocus(Control::KeyboardFocus::RIGHT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-0");
+ manager.MoveFocus(Control::KeyboardFocus::RIGHT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-1");
+
+ manager.MoveFocus(Control::KeyboardFocus::DOWN);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-1");
+ manager.MoveFocus(Control::KeyboardFocus::DOWN);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "2-1");
+ manager.MoveFocus(Control::KeyboardFocus::DOWN);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "3-1");
+ manager.MoveFocus(Control::KeyboardFocus::DOWN);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-1");
+
+ manager.MoveFocus(Control::KeyboardFocus::UP);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "3-1");
+ manager.MoveFocus(Control::KeyboardFocus::UP);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "2-1");
+ manager.MoveFocus(Control::KeyboardFocus::UP);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-1");
+ manager.MoveFocus(Control::KeyboardFocus::UP);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-1");
END_TEST;
}
ToolkitTestApplication application;
TableView tableView = TableView::New(3, 3);
- tableView.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true );
- tableView.SetProperty( Dali::Actor::Property::NAME, "TableView");
+ tableView.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
+ tableView.SetProperty(Dali::Actor::Property::NAME, "TableView");
- for ( int row = 0; row < 3; ++row )
+ for(int row = 0; row < 3; ++row)
{
- for ( int col = 0; col < 3; ++col )
+ for(int col = 0; col < 3; ++col)
{
std::ostringstream str;
str << row << "-" << col;
- if (row == 1 && col ==1)
+ if(row == 1 && col == 1)
{
// Add a nested 2x2 table view in the middle cell of the parent table view
TableView childTableView = TableView::New(2, 2);
- childTableView.SetProperty( Dali::Actor::Property::NAME, str.str() );
+ childTableView.SetProperty(Dali::Actor::Property::NAME, str.str());
for(int childRow = 0; childRow < 2; childRow++)
{
for(int childCol = 0; childCol < 2; childCol++)
{
- Control control = Control::New();
+ Control control = Control::New();
std::ostringstream nameStr;
nameStr << row << "-" << col << "-" << childRow << "-" << childCol;
- control.SetProperty( Dali::Actor::Property::NAME, nameStr.str() );
- control.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true );
- childTableView.AddChild( control, TableView::CellPosition( childRow, childCol ) );
+ control.SetProperty(Dali::Actor::Property::NAME, nameStr.str());
+ control.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
+ childTableView.AddChild(control, TableView::CellPosition(childRow, childCol));
}
}
- tableView.AddChild( childTableView, TableView::CellPosition( row, col ) );
+ tableView.AddChild(childTableView, TableView::CellPosition(row, col));
}
else
{
Control control = Control::New();
- control.SetProperty( Dali::Actor::Property::NAME, str.str() );
- control.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true );
- tableView.AddChild( control, TableView::CellPosition( row, col ) );
+ control.SetProperty(Dali::Actor::Property::NAME, str.str());
+ control.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
+ tableView.AddChild(control, TableView::CellPosition(row, col));
}
}
}
- application.GetScene().Add( tableView );
+ application.GetScene().Add(tableView);
application.SendNotification();
application.Render();
- Actor firstFocusActor = Toolkit::Internal::GetImplementation( tableView ).GetNextKeyboardFocusableActor( Actor(), Control::KeyboardFocus::RIGHT, true );
- DALI_TEST_CHECK( firstFocusActor );
- DALI_TEST_CHECK( firstFocusActor.GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-0" );
+ Actor firstFocusActor = Toolkit::Internal::GetImplementation(tableView).GetNextKeyboardFocusableActor(Actor(), Control::KeyboardFocus::RIGHT, true);
+ DALI_TEST_CHECK(firstFocusActor);
+ DALI_TEST_CHECK(firstFocusActor.GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-0");
KeyboardFocusManager manager = KeyboardFocusManager::Get();
- manager.SetFocusGroupLoop( false );
- manager.SetCurrentFocusActor( firstFocusActor );
-
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-0" );
- manager.MoveFocus( Control::KeyboardFocus::RIGHT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-1" );
- manager.MoveFocus( Control::KeyboardFocus::RIGHT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-2" );
- manager.MoveFocus( Control::KeyboardFocus::RIGHT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-0" );
- manager.MoveFocus( Control::KeyboardFocus::RIGHT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-1-0-0" );
- manager.MoveFocus( Control::KeyboardFocus::RIGHT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-1-0-1" );
- manager.MoveFocus( Control::KeyboardFocus::RIGHT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-1-1-0" );
- manager.MoveFocus( Control::KeyboardFocus::RIGHT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-1-1-1" );
- manager.MoveFocus( Control::KeyboardFocus::RIGHT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-2" );
- manager.MoveFocus( Control::KeyboardFocus::RIGHT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "2-0" );
- manager.MoveFocus( Control::KeyboardFocus::RIGHT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "2-1" );
- manager.MoveFocus( Control::KeyboardFocus::RIGHT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "2-2" );
-
- manager.MoveFocus( Control::KeyboardFocus::LEFT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "2-1" );
- manager.MoveFocus( Control::KeyboardFocus::LEFT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "2-0" );
- manager.MoveFocus( Control::KeyboardFocus::LEFT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-2" );
- manager.MoveFocus( Control::KeyboardFocus::LEFT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-1-1-1" );
- manager.MoveFocus( Control::KeyboardFocus::LEFT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-1-1-0" );
- manager.MoveFocus( Control::KeyboardFocus::LEFT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-1-0-1" );
- manager.MoveFocus( Control::KeyboardFocus::LEFT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-1-0-0" );
- manager.MoveFocus( Control::KeyboardFocus::LEFT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-0" );
- manager.MoveFocus( Control::KeyboardFocus::LEFT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-2" );
- manager.MoveFocus( Control::KeyboardFocus::LEFT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-1" );
- manager.MoveFocus( Control::KeyboardFocus::LEFT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-0" );
-
- manager.MoveFocus( Control::KeyboardFocus::RIGHT );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-1" );
- manager.MoveFocus( Control::KeyboardFocus::DOWN );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-1-0-0" );
- manager.MoveFocus( Control::KeyboardFocus::DOWN );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-1-1-0" );
- manager.MoveFocus( Control::KeyboardFocus::DOWN );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "2-1" );
-
- manager.MoveFocus( Control::KeyboardFocus::UP );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-1-1-1" );
- manager.MoveFocus( Control::KeyboardFocus::UP );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "1-1-0-1" );
- manager.MoveFocus( Control::KeyboardFocus::UP );
- DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetProperty< std::string >( Dali::Actor::Property::NAME ) == "0-1" );
+ manager.SetFocusGroupLoop(false);
+ manager.SetCurrentFocusActor(firstFocusActor);
+
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-0");
+ manager.MoveFocus(Control::KeyboardFocus::RIGHT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-1");
+ manager.MoveFocus(Control::KeyboardFocus::RIGHT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-2");
+ manager.MoveFocus(Control::KeyboardFocus::RIGHT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-0");
+ manager.MoveFocus(Control::KeyboardFocus::RIGHT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-1-0-0");
+ manager.MoveFocus(Control::KeyboardFocus::RIGHT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-1-0-1");
+ manager.MoveFocus(Control::KeyboardFocus::RIGHT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-1-1-0");
+ manager.MoveFocus(Control::KeyboardFocus::RIGHT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-1-1-1");
+ manager.MoveFocus(Control::KeyboardFocus::RIGHT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-2");
+ manager.MoveFocus(Control::KeyboardFocus::RIGHT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "2-0");
+ manager.MoveFocus(Control::KeyboardFocus::RIGHT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "2-1");
+ manager.MoveFocus(Control::KeyboardFocus::RIGHT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "2-2");
+
+ manager.MoveFocus(Control::KeyboardFocus::LEFT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "2-1");
+ manager.MoveFocus(Control::KeyboardFocus::LEFT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "2-0");
+ manager.MoveFocus(Control::KeyboardFocus::LEFT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-2");
+ manager.MoveFocus(Control::KeyboardFocus::LEFT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-1-1-1");
+ manager.MoveFocus(Control::KeyboardFocus::LEFT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-1-1-0");
+ manager.MoveFocus(Control::KeyboardFocus::LEFT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-1-0-1");
+ manager.MoveFocus(Control::KeyboardFocus::LEFT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-1-0-0");
+ manager.MoveFocus(Control::KeyboardFocus::LEFT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-0");
+ manager.MoveFocus(Control::KeyboardFocus::LEFT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-2");
+ manager.MoveFocus(Control::KeyboardFocus::LEFT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-1");
+ manager.MoveFocus(Control::KeyboardFocus::LEFT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-0");
+
+ manager.MoveFocus(Control::KeyboardFocus::RIGHT);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-1");
+ manager.MoveFocus(Control::KeyboardFocus::DOWN);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-1-0-0");
+ manager.MoveFocus(Control::KeyboardFocus::DOWN);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-1-1-0");
+ manager.MoveFocus(Control::KeyboardFocus::DOWN);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "2-1");
+
+ manager.MoveFocus(Control::KeyboardFocus::UP);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-1-1-1");
+ manager.MoveFocus(Control::KeyboardFocus::UP);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "1-1-0-1");
+ manager.MoveFocus(Control::KeyboardFocus::UP);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor().GetProperty<std::string>(Dali::Actor::Property::NAME) == "0-1");
END_TEST;
}
*
*/
-#include <iostream>
-#include <stdlib.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup.h>
#include <dali-toolkit/devel-api/controls/text-controls/text-selection-toolbar.h>
+#include <stdlib.h>
+#include <iostream>
using namespace Dali;
using namespace Toolkit;
namespace
{
-
const char* TEST_IMAGE_FILE_NAME = "selection-popup-border.9.png";
}
int UtcDaliToolkitTextSelectionPopupNewP(void)
{
ToolkitTestApplication application;
- TextSelectionPopup textSelectionPopup;
+ TextSelectionPopup textSelectionPopup;
- DALI_TEST_CHECK( !textSelectionPopup );
+ DALI_TEST_CHECK(!textSelectionPopup);
- textSelectionPopup = TextSelectionPopup::New( NULL );
+ textSelectionPopup = TextSelectionPopup::New(NULL);
- DALI_TEST_CHECK( textSelectionPopup );
+ DALI_TEST_CHECK(textSelectionPopup);
END_TEST;
}
{
TextSelectionPopup textSelectionPopup;
- DALI_TEST_CHECK( !textSelectionPopup );
+ DALI_TEST_CHECK(!textSelectionPopup);
END_TEST;
}
int UtcDaliToolkitTextSelectionPopupCopyConstructorP(void)
{
ToolkitTestApplication application;
- TextSelectionPopup textSelectionPopup;
+ TextSelectionPopup textSelectionPopup;
- textSelectionPopup = TextSelectionPopup::New( NULL );
- TextSelectionPopup copy( textSelectionPopup );
+ textSelectionPopup = TextSelectionPopup::New(NULL);
+ TextSelectionPopup copy(textSelectionPopup);
- DALI_TEST_CHECK( copy == textSelectionPopup );
+ DALI_TEST_CHECK(copy == textSelectionPopup);
END_TEST;
}
-
int UtcDaliToolkitTextSelectionPopupDestructorP(void)
{
ToolkitTestApplication application;
- TextSelectionPopup* textSelectionPopup = new TextSelectionPopup;
+ TextSelectionPopup* textSelectionPopup = new TextSelectionPopup;
delete textSelectionPopup;
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
END_TEST;
}
int UtcDaliToolkitTextSelectionPopupAssignmentOperatorP(void)
{
ToolkitTestApplication application;
- TextSelectionPopup textSelectionPopup;
- textSelectionPopup = TextSelectionPopup::New( NULL );
+ TextSelectionPopup textSelectionPopup;
+ textSelectionPopup = TextSelectionPopup::New(NULL);
TextSelectionPopup copy;
copy = textSelectionPopup;
- DALI_TEST_CHECK( copy == textSelectionPopup );
+ DALI_TEST_CHECK(copy == textSelectionPopup);
END_TEST;
}
int UtcDaliToolkitTextSelectionPopupDownCastP(void)
{
ToolkitTestApplication application;
- TextSelectionPopup textSelectionPopup;
- textSelectionPopup = TextSelectionPopup::New( NULL );
+ TextSelectionPopup textSelectionPopup;
+ textSelectionPopup = TextSelectionPopup::New(NULL);
- TextSelectionPopup cast = TextSelectionPopup::DownCast( textSelectionPopup );
+ TextSelectionPopup cast = TextSelectionPopup::DownCast(textSelectionPopup);
- DALI_TEST_CHECK( cast );
+ DALI_TEST_CHECK(cast);
END_TEST;
}
int UtcDaliToolkitTextSelectionPopupBackgroundBorderP(void)
{
ToolkitTestApplication application;
- TextSelectionPopup textSelectionPopup;
- textSelectionPopup = TextSelectionPopup::New( NULL );
+ TextSelectionPopup textSelectionPopup;
+ textSelectionPopup = TextSelectionPopup::New(NULL);
- textSelectionPopup.SetProperty( TextSelectionPopup::Property::BACKGROUND_BORDER,
- Property::Map().Add( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME ) );
+ textSelectionPopup.SetProperty(TextSelectionPopup::Property::BACKGROUND_BORDER,
+ Property::Map().Add(ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME));
- Property::Value value = textSelectionPopup.GetProperty( TextSelectionPopup::Property::BACKGROUND_BORDER );
+ Property::Value value = textSelectionPopup.GetProperty(TextSelectionPopup::Property::BACKGROUND_BORDER);
Property::Map map;
- value.Get( map );
+ value.Get(map);
- Property::Value* returnValue = map.Find( Dali::Toolkit::ImageVisual::Property::URL );
- DALI_TEST_CHECK( NULL != returnValue );
+ Property::Value* returnValue = map.Find(Dali::Toolkit::ImageVisual::Property::URL);
+ DALI_TEST_CHECK(NULL != returnValue);
- if( returnValue )
+ if(returnValue)
{
std::string url;
- returnValue->Get( url );
- DALI_TEST_EQUALS( TEST_IMAGE_FILE_NAME, url, TEST_LOCATION );
+ returnValue->Get(url);
+ DALI_TEST_EQUALS(TEST_IMAGE_FILE_NAME, url, TEST_LOCATION);
}
END_TEST;
TextSelectionToolbar toolbar = TextSelectionToolbar::New();
- toolbar.SetProperty( Toolkit::TextSelectionToolbar::Property::MAX_SIZE, Size( 100.0f, 60.0f) );
+ toolbar.SetProperty(Toolkit::TextSelectionToolbar::Property::MAX_SIZE, Size(100.0f, 60.0f));
Toolkit::PushButton option = Toolkit::PushButton::New();
- option.SetProperty( Dali::Actor::Property::NAME, "test-option" );
- option.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
- toolbar.AddOption( option );
+ option.SetProperty(Dali::Actor::Property::NAME, "test-option");
+ option.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS);
+ toolbar.AddOption(option);
Toolkit::Control divider = Toolkit::Control::New();
- divider.SetProperty( Actor::Property::SIZE, Vector2( 2.0f, 0.0f ) );
- divider.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT );
- toolbar.AddDivider( divider );
+ divider.SetProperty(Actor::Property::SIZE, Vector2(2.0f, 0.0f));
+ divider.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT);
+ toolbar.AddDivider(divider);
Toolkit::PushButton option2 = Toolkit::PushButton::New();
- option2.SetProperty( Dali::Actor::Property::NAME, "test-option-2" );
- option2.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
- toolbar.AddOption( option2 );
+ option2.SetProperty(Dali::Actor::Property::NAME, "test-option-2");
+ option2.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS);
+ toolbar.AddOption(option2);
- Size newSize = Size(3.0f, 0.0f);
- toolbar.ResizeDividers( newSize );
+ Size newSize = Size(3.0f, 0.0f);
+ toolbar.ResizeDividers(newSize);
- DALI_TEST_CHECK( toolbar );
+ DALI_TEST_CHECK(toolbar);
END_TEST;
}
TextSelectionToolbar toolbar = TextSelectionToolbar::New();
- toolbar.SetProperty( Toolkit::TextSelectionToolbar::Property::MAX_SIZE, Size( 100.0f, 60.0f) );
+ toolbar.SetProperty(Toolkit::TextSelectionToolbar::Property::MAX_SIZE, Size(100.0f, 60.0f));
Toolkit::PushButton option = Toolkit::PushButton::New();
- option.SetProperty( Dali::Actor::Property::NAME, "test-option" );
- option.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
- toolbar.AddOption( option );
+ option.SetProperty(Dali::Actor::Property::NAME, "test-option");
+ option.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS);
+ toolbar.AddOption(option);
// Add a scroll-bar
- toolbar.SetProperty( Toolkit::TextSelectionToolbar::Property::ENABLE_SCROLL_BAR, true );
+ toolbar.SetProperty(Toolkit::TextSelectionToolbar::Property::ENABLE_SCROLL_BAR, true);
- bool enabled = toolbar.GetProperty<bool>( Toolkit::TextSelectionToolbar::Property::ENABLE_SCROLL_BAR );
- DALI_TEST_CHECK( enabled );
+ bool enabled = toolbar.GetProperty<bool>(Toolkit::TextSelectionToolbar::Property::ENABLE_SCROLL_BAR);
+ DALI_TEST_CHECK(enabled);
- DALI_TEST_CHECK( toolbar );
+ DALI_TEST_CHECK(toolbar);
END_TEST;
}
ToolkitTestApplication application;
TextSelectionToolbar toolbar = TextSelectionToolbar::New();
- DALI_TEST_CHECK( toolbar );
- application.GetScene().Add( toolbar );
+ DALI_TEST_CHECK(toolbar);
+ application.GetScene().Add(toolbar);
Property::Map map;
map["overshootEffectColor"] = Color::RED;
- map["overshootSize"] = Vector2(50.0f, 50.f);
- toolbar.SetProperty( Toolkit::TextSelectionToolbar::Property::SCROLL_VIEW, map );
+ map["overshootSize"] = Vector2(50.0f, 50.f);
+ toolbar.SetProperty(Toolkit::TextSelectionToolbar::Property::SCROLL_VIEW, map);
application.SendNotification();
application.Render();
Actor actor = toolbar.FindChildByName("TextSelectionScrollView");
- DALI_TEST_CHECK( actor );
+ DALI_TEST_CHECK(actor);
- ScrollView scrollView = ScrollView::DownCast( actor );
- DALI_TEST_CHECK( scrollView );
+ ScrollView scrollView = ScrollView::DownCast(actor);
+ DALI_TEST_CHECK(scrollView);
- Vector4 color = scrollView.GetProperty<Vector4>( Toolkit::Scrollable::Property::OVERSHOOT_EFFECT_COLOR );
- DALI_TEST_EQUALS( color, Color::RED, TEST_LOCATION );
+ Vector4 color = scrollView.GetProperty<Vector4>(Toolkit::Scrollable::Property::OVERSHOOT_EFFECT_COLOR);
+ DALI_TEST_EQUALS(color, Color::RED, TEST_LOCATION);
- Vector2 size = scrollView.GetProperty<Vector2>( Toolkit::Scrollable::Property::OVERSHOOT_SIZE );
- DALI_TEST_EQUALS( size, Vector2(50.0f, 50.f), TEST_LOCATION );
+ Vector2 size = scrollView.GetProperty<Vector2>(Toolkit::Scrollable::Property::OVERSHOOT_SIZE);
+ DALI_TEST_EQUALS(size, Vector2(50.0f, 50.f), TEST_LOCATION);
END_TEST;
}
int UtcDaliToolkitTextSelectionPopupIconProperties(void)
{
ToolkitTestApplication application;
- TextSelectionPopup popup = TextSelectionPopup::New(nullptr);
+ TextSelectionPopup popup = TextSelectionPopup::New(nullptr);
popup.SetProperty(TextSelectionPopup::Property::POPUP_CLIPBOARD_BUTTON_ICON_IMAGE, "POPUP_CLIPBOARD_BUTTON_ICON_IMAGE");
popup.SetProperty(TextSelectionPopup::Property::POPUP_CUT_BUTTON_ICON_IMAGE, "POPUP_CUT_BUTTON_ICON_IMAGE");
popup.SetProperty(TextSelectionPopup::Property::POPUP_COPY_BUTTON_ICON_IMAGE, "POPUP_COPY_BUTTON_ICON_IMAGE");
popup.SetProperty(TextSelectionPopup::Property::POPUP_SELECT_BUTTON_ICON_IMAGE, "POPUP_SELECT_BUTTON_ICON_IMAGE");
popup.SetProperty(TextSelectionPopup::Property::POPUP_SELECT_ALL_BUTTON_ICON_IMAGE, "POPUP_SELECT_ALL_BUTTON_ICON_IMAGE");
- DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::POPUP_CLIPBOARD_BUTTON_ICON_IMAGE).Get<std::string>(), "POPUP_CLIPBOARD_BUTTON_ICON_IMAGE", TEST_LOCATION);
- DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::POPUP_CUT_BUTTON_ICON_IMAGE).Get<std::string>(), "POPUP_CUT_BUTTON_ICON_IMAGE", TEST_LOCATION);
- DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::POPUP_COPY_BUTTON_ICON_IMAGE).Get<std::string>(), "POPUP_COPY_BUTTON_ICON_IMAGE", TEST_LOCATION);
- DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::POPUP_PASTE_BUTTON_ICON_IMAGE).Get<std::string>(), "POPUP_PASTE_BUTTON_ICON_IMAGE", TEST_LOCATION);
- DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::POPUP_SELECT_BUTTON_ICON_IMAGE).Get<std::string>(), "POPUP_SELECT_BUTTON_ICON_IMAGE", TEST_LOCATION);
- DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::POPUP_SELECT_ALL_BUTTON_ICON_IMAGE).Get<std::string>(), "POPUP_SELECT_ALL_BUTTON_ICON_IMAGE", TEST_LOCATION);
+ DALI_TEST_EQUALS(popup.GetProperty(TextSelectionPopup::Property::POPUP_CLIPBOARD_BUTTON_ICON_IMAGE).Get<std::string>(), "POPUP_CLIPBOARD_BUTTON_ICON_IMAGE", TEST_LOCATION);
+ DALI_TEST_EQUALS(popup.GetProperty(TextSelectionPopup::Property::POPUP_CUT_BUTTON_ICON_IMAGE).Get<std::string>(), "POPUP_CUT_BUTTON_ICON_IMAGE", TEST_LOCATION);
+ DALI_TEST_EQUALS(popup.GetProperty(TextSelectionPopup::Property::POPUP_COPY_BUTTON_ICON_IMAGE).Get<std::string>(), "POPUP_COPY_BUTTON_ICON_IMAGE", TEST_LOCATION);
+ DALI_TEST_EQUALS(popup.GetProperty(TextSelectionPopup::Property::POPUP_PASTE_BUTTON_ICON_IMAGE).Get<std::string>(), "POPUP_PASTE_BUTTON_ICON_IMAGE", TEST_LOCATION);
+ DALI_TEST_EQUALS(popup.GetProperty(TextSelectionPopup::Property::POPUP_SELECT_BUTTON_ICON_IMAGE).Get<std::string>(), "POPUP_SELECT_BUTTON_ICON_IMAGE", TEST_LOCATION);
+ DALI_TEST_EQUALS(popup.GetProperty(TextSelectionPopup::Property::POPUP_SELECT_ALL_BUTTON_ICON_IMAGE).Get<std::string>(), "POPUP_SELECT_ALL_BUTTON_ICON_IMAGE", TEST_LOCATION);
END_TEST;
}
int UtcDaliToolkitTextSelectionPopupSizeProperties(void)
{
ToolkitTestApplication application;
- TextSelectionPopup popup = TextSelectionPopup::New(nullptr);
+ TextSelectionPopup popup = TextSelectionPopup::New(nullptr);
const Vector2 popupMaxSize(200.0f, 300.0f);
const Vector2 optionMaxSize(50.0f, 100.0f);
popup.SetProperty(TextSelectionPopup::Property::OPTION_DIVIDER_SIZE, optionDividerSize);
popup.SetProperty(TextSelectionPopup::Property::OPTION_DIVIDER_PADDING, optionDividerPadding);
- DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::POPUP_MAX_SIZE).Get<Vector2>(), popupMaxSize, TEST_LOCATION);
- DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::OPTION_MAX_SIZE).Get<Vector2>(), optionMaxSize, TEST_LOCATION);
- DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::OPTION_MIN_SIZE).Get<Vector2>(), optionMinSize, TEST_LOCATION);
- DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::OPTION_DIVIDER_SIZE).Get<Vector2>(), optionDividerSize, TEST_LOCATION);
- DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::OPTION_DIVIDER_PADDING).Get<Vector4>(), optionDividerPadding, TEST_LOCATION);
+ DALI_TEST_EQUALS(popup.GetProperty(TextSelectionPopup::Property::POPUP_MAX_SIZE).Get<Vector2>(), popupMaxSize, TEST_LOCATION);
+ DALI_TEST_EQUALS(popup.GetProperty(TextSelectionPopup::Property::OPTION_MAX_SIZE).Get<Vector2>(), optionMaxSize, TEST_LOCATION);
+ DALI_TEST_EQUALS(popup.GetProperty(TextSelectionPopup::Property::OPTION_MIN_SIZE).Get<Vector2>(), optionMinSize, TEST_LOCATION);
+ DALI_TEST_EQUALS(popup.GetProperty(TextSelectionPopup::Property::OPTION_DIVIDER_SIZE).Get<Vector2>(), optionDividerSize, TEST_LOCATION);
+ DALI_TEST_EQUALS(popup.GetProperty(TextSelectionPopup::Property::OPTION_DIVIDER_PADDING).Get<Vector4>(), optionDividerPadding, TEST_LOCATION);
END_TEST;
}
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
-#include <fstream>
-#include <stdlib.h>
-#include <locale.h>
-#include <libintl.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup.h>
+#include <libintl.h>
+#include <locale.h>
+#include <stdlib.h>
+#include <fstream>
+#include <iostream>
using namespace Dali;
using namespace Toolkit;
namespace
{
-
-const char* DEFAULT_LOCALE_DIR = "/tmp/locale/";
+const char* DEFAULT_LOCALE_DIR = "/tmp/locale/";
static std::string gLocaleLang;
static std::string gLocaleLanguage;
-}
+} // namespace
void dali_textselectionpopupmirroringltr_startup(void)
{
// Keep the current locale environment.
- char* langPtr = getenv( "LANG" );
- gLocaleLang = std::string( langPtr );
+ char* langPtr = getenv("LANG");
+ gLocaleLang = std::string(langPtr);
- char* languagePtr = getenv( "LANGUAGE" );
- gLocaleLanguage = std::string( languagePtr );
+ char* languagePtr = getenv("LANGUAGE");
+ gLocaleLanguage = std::string(languagePtr);
// Set the locale environment to Arabic.
- setenv( "LANG", "en_GB.UTF-8", 1 );
- setenv( "LANGUAGE", "en_GB:en", 1 );
+ setenv("LANG", "en_GB.UTF-8", 1);
+ setenv("LANGUAGE", "en_GB:en", 1);
test_return_value = TET_UNDEF;
}
void dali_textselectionpopupmirroringltr_cleanup(void)
{
// Restore the locale environment.
- setenv( "LANG", gLocaleLang.c_str(), 1 );
- setenv( "LANGUAGE", gLocaleLanguage.c_str(), 1 );
+ setenv("LANG", gLocaleLang.c_str(), 1);
+ setenv("LANGUAGE", gLocaleLanguage.c_str(), 1);
test_return_value = TET_PASS;
}
int UtcDaliToolkitTextSelectionPopupMirroringLTR(void)
{
// Test the popup mirroring.
- const std::string CUT( "optionCut" );
- const std::string COPY( "optionCopy" );
- const std::string PASTE( "optionPaste" );
+ const std::string CUT("optionCut");
+ const std::string COPY("optionCopy");
+ const std::string PASTE("optionPaste");
ToolkitTestApplication application;
- setlocale( LC_ALL, "en_GB.UTF-8" );
+ setlocale(LC_ALL, "en_GB.UTF-8");
textdomain("dali-toolkit");
- bindtextdomain("dali-toolkit", DEFAULT_LOCALE_DIR );
+ bindtextdomain("dali-toolkit", DEFAULT_LOCALE_DIR);
- TextSelectionPopup textSelectionPopup = TextSelectionPopup::New( NULL );
+ TextSelectionPopup textSelectionPopup = TextSelectionPopup::New(NULL);
// Enable some buttons.
- TextSelectionPopup::Buttons buttons = static_cast<TextSelectionPopup::Buttons>( TextSelectionPopup::COPY | TextSelectionPopup::CUT | TextSelectionPopup::PASTE );
- textSelectionPopup.EnableButtons( buttons );
+ TextSelectionPopup::Buttons buttons = static_cast<TextSelectionPopup::Buttons>(TextSelectionPopup::COPY | TextSelectionPopup::CUT | TextSelectionPopup::PASTE);
+ textSelectionPopup.EnableButtons(buttons);
// Show the popup.
textSelectionPopup.ShowPopup();
- Actor cutActor = textSelectionPopup.FindChildByName( CUT );
- if( !cutActor )
+ Actor cutActor = textSelectionPopup.FindChildByName(CUT);
+ if(!cutActor)
{
tet_result(TET_FAIL);
}
Actor tableOfButtons = cutActor.GetParent();
- if( !tableOfButtons )
+ if(!tableOfButtons)
{
tet_result(TET_FAIL);
}
// The order should be COPY, CUT, PASTE
- DALI_TEST_EQUALS( COPY, tableOfButtons.GetChildAt( 0 ).GetProperty< std::string >( Dali::Actor::Property::NAME ), TEST_LOCATION );
- DALI_TEST_EQUALS( CUT, tableOfButtons.GetChildAt( 2 ).GetProperty< std::string >( Dali::Actor::Property::NAME ), TEST_LOCATION );
- DALI_TEST_EQUALS( PASTE, tableOfButtons.GetChildAt( 4 ).GetProperty< std::string >( Dali::Actor::Property::NAME ), TEST_LOCATION );
+ DALI_TEST_EQUALS(COPY, tableOfButtons.GetChildAt(0).GetProperty<std::string>(Dali::Actor::Property::NAME), TEST_LOCATION);
+ DALI_TEST_EQUALS(CUT, tableOfButtons.GetChildAt(2).GetProperty<std::string>(Dali::Actor::Property::NAME), TEST_LOCATION);
+ DALI_TEST_EQUALS(PASTE, tableOfButtons.GetChildAt(4).GetProperty<std::string>(Dali::Actor::Property::NAME), TEST_LOCATION);
tet_result(TET_PASS);
END_TEST;
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
-#include <fstream>
-#include <stdlib.h>
-#include <locale.h>
-#include <libintl.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup.h>
+#include <libintl.h>
+#include <locale.h>
+#include <stdlib.h>
+#include <fstream>
+#include <iostream>
using namespace Dali;
using namespace Toolkit;
namespace
{
-
-const char* DEFAULT_LOCALE_DIR = "/tmp/locale/";
+const char* DEFAULT_LOCALE_DIR = "/tmp/locale/";
static std::string gLocaleLang;
static std::string gLocaleLanguage;
-}
+} // namespace
void dali_textselectionpopupmirroringrtl_startup(void)
{
// Keep the current locale environment.
- char* langPtr = getenv( "LANG" );
- gLocaleLang = std::string( langPtr );
+ char* langPtr = getenv("LANG");
+ gLocaleLang = std::string(langPtr);
- char* languagePtr = getenv( "LANGUAGE" );
- gLocaleLanguage = std::string( languagePtr );
+ char* languagePtr = getenv("LANGUAGE");
+ gLocaleLanguage = std::string(languagePtr);
// Set the locale environment to Arabic.
- setenv( "LANG", "ar_AE.UTF-8", 1 );
- setenv( "LANGUAGE", "ar_AE:ar", 1 );
+ setenv("LANG", "ar_AE.UTF-8", 1);
+ setenv("LANGUAGE", "ar_AE:ar", 1);
test_return_value = TET_UNDEF;
}
void dali_textselectionpopupmirroringrtl_cleanup(void)
{
// Restore the locale environment.
- setenv( "LANG", gLocaleLang.c_str(), 1 );
- setenv( "LANGUAGE", gLocaleLanguage.c_str(), 1 );
+ setenv("LANG", gLocaleLang.c_str(), 1);
+ setenv("LANGUAGE", gLocaleLanguage.c_str(), 1);
test_return_value = TET_PASS;
}
int UtcDaliToolkitTextSelectionPopupMirroringRTL(void)
{
// Test the popup mirroring.
- const std::string CUT( "optionCut" );
- const std::string COPY( "optionCopy" );
- const std::string PASTE( "optionPaste" );
+ const std::string CUT("optionCut");
+ const std::string COPY("optionCopy");
+ const std::string PASTE("optionPaste");
ToolkitTestApplication application;
- setlocale( LC_ALL, "ar_AE.UTF-8" );
+ setlocale(LC_ALL, "ar_AE.UTF-8");
textdomain("dali-toolkit");
- bindtextdomain("dali-toolkit", DEFAULT_LOCALE_DIR );
+ bindtextdomain("dali-toolkit", DEFAULT_LOCALE_DIR);
- TextSelectionPopup textSelectionPopup = TextSelectionPopup::New( NULL );
+ TextSelectionPopup textSelectionPopup = TextSelectionPopup::New(NULL);
// Enable some buttons.
- TextSelectionPopup::Buttons buttons = static_cast<TextSelectionPopup::Buttons>( TextSelectionPopup::COPY | TextSelectionPopup::CUT | TextSelectionPopup::PASTE );
- textSelectionPopup.EnableButtons( buttons );
+ TextSelectionPopup::Buttons buttons = static_cast<TextSelectionPopup::Buttons>(TextSelectionPopup::COPY | TextSelectionPopup::CUT | TextSelectionPopup::PASTE);
+ textSelectionPopup.EnableButtons(buttons);
// Show the popup.
textSelectionPopup.ShowPopup();
- Actor cutActor = textSelectionPopup.FindChildByName( CUT );
- if( !cutActor )
+ Actor cutActor = textSelectionPopup.FindChildByName(CUT);
+ if(!cutActor)
{
tet_result(TET_FAIL);
}
Actor tableOfButtons = cutActor.GetParent();
- if( !tableOfButtons )
+ if(!tableOfButtons)
{
tet_result(TET_FAIL);
}
// The order should be PASTE, CUT, COPY
- DALI_TEST_EQUALS( PASTE, tableOfButtons.GetChildAt( 0 ).GetProperty< std::string >( Dali::Actor::Property::NAME ), TEST_LOCATION );
- DALI_TEST_EQUALS( CUT, tableOfButtons.GetChildAt( 2 ).GetProperty< std::string >( Dali::Actor::Property::NAME ), TEST_LOCATION );
- DALI_TEST_EQUALS( COPY, tableOfButtons.GetChildAt( 4 ).GetProperty< std::string >( Dali::Actor::Property::NAME ), TEST_LOCATION );
+ DALI_TEST_EQUALS(PASTE, tableOfButtons.GetChildAt(0).GetProperty<std::string>(Dali::Actor::Property::NAME), TEST_LOCATION);
+ DALI_TEST_EQUALS(CUT, tableOfButtons.GetChildAt(2).GetProperty<std::string>(Dali::Actor::Property::NAME), TEST_LOCATION);
+ DALI_TEST_EQUALS(COPY, tableOfButtons.GetChildAt(4).GetProperty<std::string>(Dali::Actor::Property::NAME), TEST_LOCATION);
tet_result(TET_PASS);
END_TEST;
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
* limitations under the License.
*/
-#include <iostream>
-#include <stdlib.h>
#include <dali-toolkit-test-suite-utils.h>
+#include <dali-toolkit/devel-api/image-loader/texture-manager.h>
#include <dali/public-api/rendering/texture-set.h>
#include <dali/public-api/rendering/texture.h>
-#include <dali-toolkit/devel-api/image-loader/texture-manager.h>
+#include <stdlib.h>
+#include <iostream>
using namespace Dali;
using namespace Dali::Toolkit;
{
} // namespace
-
void dali_texture_manager_startup(void)
{
test_return_value = TET_UNDEF;
int UtcDaliTextureManagerAddRemoveP(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliTextureManager" );
+ tet_infoline("UtcDaliTextureManager");
std::string url;
std::string url2;
std::string url4;
// scope to ensure texturesets are kept alive by texture manager
{
- auto texture = Texture::New( Dali::TextureType::TEXTURE_2D, Pixel::RGBA8888, 88, 99 );
- url = TextureManager::AddTexture( texture );
- DALI_TEST_CHECK( url.size() > 0u );
+ auto texture = Texture::New(Dali::TextureType::TEXTURE_2D, Pixel::RGBA8888, 88, 99);
+ url = TextureManager::AddTexture(texture);
+ DALI_TEST_CHECK(url.size() > 0u);
auto textureSet = TextureSet::New();
- textureSet.SetTexture( 0u, texture );
- url2 = TextureManager::AddTexture( textureSet );
- DALI_TEST_CHECK( url2.size() > 0u );
- DALI_TEST_CHECK( url2 != url );
+ textureSet.SetTexture(0u, texture);
+ url2 = TextureManager::AddTexture(textureSet);
+ DALI_TEST_CHECK(url2.size() > 0u);
+ DALI_TEST_CHECK(url2 != url);
// add same texture again, should give new Url
- url3 = TextureManager::AddTexture( texture );
- DALI_TEST_CHECK( url3.size() > 0u );
- DALI_TEST_CHECK( url3 != url );
- DALI_TEST_CHECK( url3 != url2 );
+ url3 = TextureManager::AddTexture(texture);
+ DALI_TEST_CHECK(url3.size() > 0u);
+ DALI_TEST_CHECK(url3 != url);
+ DALI_TEST_CHECK(url3 != url2);
textureSet = TextureSet::New();
- url4 = TextureManager::AddTexture( textureSet );
- DALI_TEST_CHECK( url4.size() > 0u );
- DALI_TEST_CHECK( url4 != url );
- DALI_TEST_CHECK( url4 != url2 );
- DALI_TEST_CHECK( url4 != url3 );
+ url4 = TextureManager::AddTexture(textureSet);
+ DALI_TEST_CHECK(url4.size() > 0u);
+ DALI_TEST_CHECK(url4 != url);
+ DALI_TEST_CHECK(url4 != url2);
+ DALI_TEST_CHECK(url4 != url3);
}
- auto textureSet = TextureManager::RemoveTexture( url );
- DALI_TEST_CHECK( textureSet && "Texture needs to be non empty handle" );
- auto texture = textureSet.GetTexture( 0u );
- DALI_TEST_EQUAL( texture.GetWidth(), 88u );
- DALI_TEST_EQUAL( texture.GetHeight(), 99u );
- textureSet = TextureManager::RemoveTexture( url );
- DALI_TEST_CHECK( !textureSet && "Texture needs to be removed from texture manager" );
-
- textureSet = TextureManager::RemoveTexture( url2 );
- DALI_TEST_CHECK( textureSet && "Texture needs to be non empty handle" );
- texture = textureSet.GetTexture( 0u );
- DALI_TEST_EQUAL( texture.GetWidth(), 88u );
- DALI_TEST_EQUAL( texture.GetHeight(), 99u );
- textureSet = TextureManager::RemoveTexture( url2 );
- DALI_TEST_CHECK( !textureSet && "Texture needs to be removed from texture manager" );
-
- textureSet = TextureManager::RemoveTexture( url3 );
- DALI_TEST_CHECK( textureSet && "Texture needs to be non empty handle" );
- texture = textureSet.GetTexture( 0u );
- DALI_TEST_EQUAL( texture.GetWidth(), 88u );
- DALI_TEST_EQUAL( texture.GetHeight(), 99u );
- textureSet = TextureManager::RemoveTexture( url3 );
- DALI_TEST_CHECK( !textureSet && "Texture needs to be removed from texture manager" );
-
- textureSet = TextureManager::RemoveTexture( url4 );
- DALI_TEST_CHECK( textureSet && "Texture needs to be non empty handle" );
- textureSet = TextureManager::RemoveTexture( url4 );
- DALI_TEST_CHECK( !textureSet && "Texture needs to be removed from texture manager" );
+ auto textureSet = TextureManager::RemoveTexture(url);
+ DALI_TEST_CHECK(textureSet && "Texture needs to be non empty handle");
+ auto texture = textureSet.GetTexture(0u);
+ DALI_TEST_EQUAL(texture.GetWidth(), 88u);
+ DALI_TEST_EQUAL(texture.GetHeight(), 99u);
+ textureSet = TextureManager::RemoveTexture(url);
+ DALI_TEST_CHECK(!textureSet && "Texture needs to be removed from texture manager");
+
+ textureSet = TextureManager::RemoveTexture(url2);
+ DALI_TEST_CHECK(textureSet && "Texture needs to be non empty handle");
+ texture = textureSet.GetTexture(0u);
+ DALI_TEST_EQUAL(texture.GetWidth(), 88u);
+ DALI_TEST_EQUAL(texture.GetHeight(), 99u);
+ textureSet = TextureManager::RemoveTexture(url2);
+ DALI_TEST_CHECK(!textureSet && "Texture needs to be removed from texture manager");
+
+ textureSet = TextureManager::RemoveTexture(url3);
+ DALI_TEST_CHECK(textureSet && "Texture needs to be non empty handle");
+ texture = textureSet.GetTexture(0u);
+ DALI_TEST_EQUAL(texture.GetWidth(), 88u);
+ DALI_TEST_EQUAL(texture.GetHeight(), 99u);
+ textureSet = TextureManager::RemoveTexture(url3);
+ DALI_TEST_CHECK(!textureSet && "Texture needs to be removed from texture manager");
+
+ textureSet = TextureManager::RemoveTexture(url4);
+ DALI_TEST_CHECK(textureSet && "Texture needs to be non empty handle");
+ textureSet = TextureManager::RemoveTexture(url4);
+ DALI_TEST_CHECK(!textureSet && "Texture needs to be removed from texture manager");
END_TEST;
}
int UtcDaliTextureManagerAddN(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliTextureManager" );
+ tet_infoline("UtcDaliTextureManager");
// empty texture is ok, though pointless from app point of view
- TextureSet empty;
- std::string url = TextureManager::AddTexture( empty );
- DALI_TEST_CHECK( url.size() > 0u );
+ TextureSet empty;
+ std::string url = TextureManager::AddTexture(empty);
+ DALI_TEST_CHECK(url.size() > 0u);
END_TEST;
}
int UtcDaliTextureManagerRemoveN(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliTextureManager" );
+ tet_infoline("UtcDaliTextureManager");
// removing empty texture returns empty handle
- auto texture = TextureManager::RemoveTexture( "" );
- DALI_TEST_CHECK( !texture && "Texture should not be found" );
+ auto texture = TextureManager::RemoveTexture("");
+ DALI_TEST_CHECK(!texture && "Texture should not be found");
// removing empty texture returns empty handle
- texture = TextureManager::RemoveTexture( "dali://" );
- DALI_TEST_CHECK( !texture && "Texture should not be found" );
+ texture = TextureManager::RemoveTexture("dali://");
+ DALI_TEST_CHECK(!texture && "Texture should not be found");
// empty texture is ok, though pointless from app point of view
- TextureSet empty;
- std::string url = TextureManager::AddTexture( empty );
- DALI_TEST_CHECK( url.size() > 0u );
+ TextureSet empty;
+ std::string url = TextureManager::AddTexture(empty);
+ DALI_TEST_CHECK(url.size() > 0u);
// removing texture with wrong URL returns empty handle
- texture = TextureManager::RemoveTexture( "dali://" );
- DALI_TEST_CHECK( !texture && "Texture should not be found" );
+ texture = TextureManager::RemoveTexture("dali://");
+ DALI_TEST_CHECK(!texture && "Texture should not be found");
// removing ftp texture returns empty handle
- texture = TextureManager::RemoveTexture( "ftp://foobar" );
- DALI_TEST_CHECK( !texture && "Texture should not be found" );
+ texture = TextureManager::RemoveTexture("ftp://foobar");
+ DALI_TEST_CHECK(!texture && "Texture should not be found");
// add a texture
- url = TextureManager::AddTexture( texture );
- texture = TextureManager::RemoveTexture( url + "foo" );
- DALI_TEST_CHECK( !texture && "Texture should not be found" );
+ url = TextureManager::AddTexture(texture);
+ texture = TextureManager::RemoveTexture(url + "foo");
+ DALI_TEST_CHECK(!texture && "Texture should not be found");
END_TEST;
}
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
-#include <stdlib.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
-#include <dali/integration-api/events/touch-event-integ.h>
#include <dali-toolkit/devel-api/controls/buttons/toggle-button.h>
-
+#include <dali/integration-api/events/touch-event-integ.h>
+#include <stdlib.h>
+#include <iostream>
using namespace Dali;
using namespace Dali::Toolkit;
static const char* TEST_IMAGE_THREE = TEST_RESOURCE_DIR "/popup_tail_down.png";
static const char* TEST_IMAGE_FOUR = TEST_RESOURCE_DIR "/popup_tail_up.png";
-static const Vector2 INSIDE_TOUCH_POINT_POSITON = Vector2( 240, 400 );
-static const Vector3 BUTTON_POSITON_TO_GET_INSIDE_TOUCH_EVENTS = Vector3( 200, 360, 0 );
-static const Size BUTTON_SIZE_TO_GET_INSIDE_TOUCH_EVENTS = Size( 100, 100 );
+static const Vector2 INSIDE_TOUCH_POINT_POSITON = Vector2(240, 400);
+static const Vector3 BUTTON_POSITON_TO_GET_INSIDE_TOUCH_EVENTS = Vector3(200, 360, 0);
+static const Size BUTTON_SIZE_TO_GET_INSIDE_TOUCH_EVENTS = Size(100, 100);
static bool gObjectCreatedCallBackCalled;
Dali::Integration::Point GetPointDownInside()
{
Dali::Integration::Point point;
- point.SetState( PointState::DOWN );
- point.SetScreenPosition( INSIDE_TOUCH_POINT_POSITON );
+ point.SetState(PointState::DOWN);
+ point.SetScreenPosition(INSIDE_TOUCH_POINT_POSITON);
return point;
}
Dali::Integration::Point GetPointUpInside()
{
Dali::Integration::Point point;
- point.SetState( PointState::UP );
- point.SetScreenPosition( INSIDE_TOUCH_POINT_POSITON );
+ point.SetState(PointState::UP);
+ point.SetScreenPosition(INSIDE_TOUCH_POINT_POSITON);
return point;
}
-}
+} // namespace
int UtcDaliToggleButtonConstructorP(void)
{
tet_infoline(" UtcDaliToggleButtonConstructorP");
ToggleButton button;
- DALI_TEST_CHECK( !button );
+ DALI_TEST_CHECK(!button);
END_TEST;
}
// Initialize an object, ref count == 1
ToggleButton button = ToggleButton::New();
- ToggleButton copy( button );
- DALI_TEST_CHECK( copy );
+ ToggleButton copy(button);
+ DALI_TEST_CHECK(copy);
END_TEST;
}
ToggleButton button = ToggleButton::New();
- ToggleButton copy( button );
- DALI_TEST_CHECK( copy );
+ ToggleButton copy(button);
+ DALI_TEST_CHECK(copy);
- DALI_TEST_CHECK( button == copy );
+ DALI_TEST_CHECK(button == copy);
END_TEST;
}
// Create the Slider actor
ToggleButton toggleButton;
- DALI_TEST_CHECK( !toggleButton );
+ DALI_TEST_CHECK(!toggleButton);
toggleButton = ToggleButton::New();
- DALI_TEST_CHECK( toggleButton );
+ DALI_TEST_CHECK(toggleButton);
ToggleButton toggleButton2(toggleButton);
- DALI_TEST_CHECK( toggleButton2 == toggleButton );
+ DALI_TEST_CHECK(toggleButton2 == toggleButton);
//Additional check to ensure object is created by checking if it's registered
ObjectRegistry registry = application.GetCore().GetObjectRegistry();
- DALI_TEST_CHECK( registry );
+ DALI_TEST_CHECK(registry);
gObjectCreatedCallBackCalled = false;
- registry.ObjectCreatedSignal().Connect( &TestCallback );
+ registry.ObjectCreatedSignal().Connect(&TestCallback);
{
ToggleButton toggleButton = ToggleButton::New();
}
- DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
+ DALI_TEST_CHECK(gObjectCreatedCallBackCalled);
END_TEST;
}
ToggleButton* toggleButton = new ToggleButton();
delete toggleButton;
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline("UtcDaliToggleButtonDownCast");
- Handle handle = ToggleButton::New();
- ToggleButton toggleButton = ToggleButton::DownCast( handle );
+ Handle handle = ToggleButton::New();
+ ToggleButton toggleButton = ToggleButton::DownCast(handle);
- DALI_TEST_CHECK( toggleButton == handle );
+ DALI_TEST_CHECK(toggleButton == handle);
END_TEST;
}
int UtcDaliToggleButtonToggleStatesProperty(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
tet_infoline(" UtcDaliToggleButtonToggleStatesProperty");
// Create the ToggleButton actor
ToggleButton toggleButton = ToggleButton::New();
- application.GetScene().Add( toggleButton );
- toggleButton.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- toggleButton.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
- toggleButton.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
+ application.GetScene().Add(toggleButton);
+ toggleButton.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ toggleButton.SetProperty(Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_LEFT);
+ toggleButton.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 0.0f));
- {// Check empty array
+ { // Check empty array
Property::Array toggleIcons;
- toggleButton.SetProperty( Toolkit::ToggleButton::Property::STATE_VISUALS, toggleIcons );
+ toggleButton.SetProperty(Toolkit::ToggleButton::Property::STATE_VISUALS, toggleIcons);
application.SendNotification();
application.Render();
Property::Array resultIcons;
- resultIcons = toggleButton.GetProperty( Toolkit::ToggleButton::Property::STATE_VISUALS ).Get<Property::Array>();
- DALI_TEST_CHECK( resultIcons.Count() == 0 );
+ resultIcons = toggleButton.GetProperty(Toolkit::ToggleButton::Property::STATE_VISUALS).Get<Property::Array>();
+ DALI_TEST_CHECK(resultIcons.Count() == 0);
}
- {// Check non-empty Array
+ { // Check non-empty Array
Property::Array toggleIcons;
- toggleIcons.PushBack( TEST_IMAGE_ONE ); //Icons path
- toggleIcons.PushBack( TEST_IMAGE_TWO );
- toggleIcons.PushBack( TEST_IMAGE_THREE );
- toggleIcons.PushBack( TEST_IMAGE_FOUR );
- toggleButton.SetProperty( Toolkit::ToggleButton::Property::STATE_VISUALS, toggleIcons );
+ toggleIcons.PushBack(TEST_IMAGE_ONE); //Icons path
+ toggleIcons.PushBack(TEST_IMAGE_TWO);
+ toggleIcons.PushBack(TEST_IMAGE_THREE);
+ toggleIcons.PushBack(TEST_IMAGE_FOUR);
+ toggleButton.SetProperty(Toolkit::ToggleButton::Property::STATE_VISUALS, toggleIcons);
application.SendNotification();
application.Render();
Property::Array resultIcons;
- resultIcons = toggleButton.GetProperty( Toolkit::ToggleButton::Property::STATE_VISUALS ).Get<Property::Array>();
+ resultIcons = toggleButton.GetProperty(Toolkit::ToggleButton::Property::STATE_VISUALS).Get<Property::Array>();
// Check that the result is the same as
- DALI_TEST_EQUALS( toggleIcons.Count(), resultIcons.Count(), TEST_LOCATION );
- DALI_TEST_CHECK( toggleIcons[0].Get<std::string>() == resultIcons[0].Get<std::string>() );
- DALI_TEST_CHECK( toggleIcons[1].Get<std::string>() == resultIcons[1].Get<std::string>() );
- DALI_TEST_CHECK( toggleIcons[2].Get<std::string>() == resultIcons[2].Get<std::string>() );
- DALI_TEST_CHECK( toggleIcons[3].Get<std::string>() == resultIcons[3].Get<std::string>() );
+ DALI_TEST_EQUALS(toggleIcons.Count(), resultIcons.Count(), TEST_LOCATION);
+ DALI_TEST_CHECK(toggleIcons[0].Get<std::string>() == resultIcons[0].Get<std::string>());
+ DALI_TEST_CHECK(toggleIcons[1].Get<std::string>() == resultIcons[1].Get<std::string>());
+ DALI_TEST_CHECK(toggleIcons[2].Get<std::string>() == resultIcons[2].Get<std::string>());
+ DALI_TEST_CHECK(toggleIcons[3].Get<std::string>() == resultIcons[3].Get<std::string>());
}
- {// Check property::map
+ { // Check property::map
Property::Map propertyMap1;
- Vector4 testColor1( 1.f, 0.5f, 0.3f, 0.2f );
- propertyMap1.Insert( Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
- propertyMap1.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, testColor1);
+ Vector4 testColor1(1.f, 0.5f, 0.3f, 0.2f);
+ propertyMap1.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
+ propertyMap1.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, testColor1);
Property::Map propertyMap2;
- Vector4 testColor2( 0.5f, 1.f, 0.3f, 0.2f );
- propertyMap2.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
- propertyMap2.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, testColor2);
+ Vector4 testColor2(0.5f, 1.f, 0.3f, 0.2f);
+ propertyMap2.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
+ propertyMap2.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, testColor2);
Property::Map propertyMap3;
- Vector4 testColor3( 1.f, 0.5f, 1.f, 0.2f );
- propertyMap3.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
- propertyMap3.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, testColor3);
+ Vector4 testColor3(1.f, 0.5f, 1.f, 0.2f);
+ propertyMap3.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
+ propertyMap3.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, testColor3);
Property::Array toggleMaps;
- toggleMaps.Add( propertyMap1 );
- toggleMaps.Add( propertyMap2 );
- toggleMaps.Add( propertyMap3 );
- toggleButton.SetProperty( Toolkit::ToggleButton::Property::STATE_VISUALS, toggleMaps );
+ toggleMaps.Add(propertyMap1);
+ toggleMaps.Add(propertyMap2);
+ toggleMaps.Add(propertyMap3);
+ toggleButton.SetProperty(Toolkit::ToggleButton::Property::STATE_VISUALS, toggleMaps);
application.SendNotification();
application.Render();
Property::Array resultMaps;
- resultMaps = toggleButton.GetProperty( Toolkit::ToggleButton::Property::STATE_VISUALS ).Get<Property::Array>();
+ resultMaps = toggleButton.GetProperty(Toolkit::ToggleButton::Property::STATE_VISUALS).Get<Property::Array>();
// Check that the result
- DALI_TEST_EQUALS( toggleMaps.Count(), resultMaps.Count(), TEST_LOCATION );
+ DALI_TEST_EQUALS(toggleMaps.Count(), resultMaps.Count(), TEST_LOCATION);
}
END_TEST;
}
-int UtcDaliToggleButtonToggleTipsProperty( void )
+int UtcDaliToggleButtonToggleTipsProperty(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
tet_infoline(" UtcDaliToggleButtonToggleTipsProperty");
// Create the ToggleButton actor
ToggleButton toggleButton = ToggleButton::New();
- application.GetScene().Add( toggleButton );
- toggleButton.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- toggleButton.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
- toggleButton.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
+ application.GetScene().Add(toggleButton);
+ toggleButton.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ toggleButton.SetProperty(Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_LEFT);
+ toggleButton.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 0.0f));
{ // Check empty tip array
Property::Array toggleIcons;
- toggleIcons.PushBack( TEST_IMAGE_ONE ); //Icons path
- toggleIcons.PushBack( TEST_IMAGE_TWO );
- toggleIcons.PushBack( TEST_IMAGE_THREE );
- toggleButton.SetProperty( Toolkit::ToggleButton::Property::STATE_VISUALS, toggleIcons );
+ toggleIcons.PushBack(TEST_IMAGE_ONE); //Icons path
+ toggleIcons.PushBack(TEST_IMAGE_TWO);
+ toggleIcons.PushBack(TEST_IMAGE_THREE);
+ toggleButton.SetProperty(Toolkit::ToggleButton::Property::STATE_VISUALS, toggleIcons);
Property::Array toggleTips;
- toggleButton.SetProperty( Toolkit::ToggleButton::Property::TOOLTIPS, toggleTips );
+ toggleButton.SetProperty(Toolkit::ToggleButton::Property::TOOLTIPS, toggleTips);
application.SendNotification();
application.Render();
Property::Array resultTips;
- resultTips = toggleButton.GetProperty( Toolkit::ToggleButton::Property::TOOLTIPS ).Get<Property::Array>();
- DALI_TEST_CHECK( resultTips.Count() == 0 );
+ resultTips = toggleButton.GetProperty(Toolkit::ToggleButton::Property::TOOLTIPS).Get<Property::Array>();
+ DALI_TEST_CHECK(resultTips.Count() == 0);
}
{ // Check non-empty tip array
Property::Array toggleIcons;
- toggleIcons.PushBack( TEST_IMAGE_ONE ); //Icons path
- toggleIcons.PushBack( TEST_IMAGE_TWO );
- toggleIcons.PushBack( TEST_IMAGE_THREE );
- toggleButton.SetProperty( Toolkit::ToggleButton::Property::STATE_VISUALS, toggleIcons );
+ toggleIcons.PushBack(TEST_IMAGE_ONE); //Icons path
+ toggleIcons.PushBack(TEST_IMAGE_TWO);
+ toggleIcons.PushBack(TEST_IMAGE_THREE);
+ toggleButton.SetProperty(Toolkit::ToggleButton::Property::STATE_VISUALS, toggleIcons);
Property::Array toggleTips;
- toggleTips.PushBack( "Button State A" ); //Tooltip string
- toggleTips.PushBack( "Button State B" );
- toggleTips.PushBack( "Button State C" );
- toggleButton.SetProperty( Toolkit::ToggleButton::Property::TOOLTIPS, toggleTips );
+ toggleTips.PushBack("Button State A"); //Tooltip string
+ toggleTips.PushBack("Button State B");
+ toggleTips.PushBack("Button State C");
+ toggleButton.SetProperty(Toolkit::ToggleButton::Property::TOOLTIPS, toggleTips);
application.SendNotification();
application.Render();
Property::Array resultTips;
- resultTips = toggleButton.GetProperty( Toolkit::ToggleButton::Property::TOOLTIPS ).Get<Property::Array>();
+ resultTips = toggleButton.GetProperty(Toolkit::ToggleButton::Property::TOOLTIPS).Get<Property::Array>();
//Check that the result is the same as
- DALI_TEST_EQUALS( toggleTips.Count(), resultTips.Count(), TEST_LOCATION );
- DALI_TEST_CHECK( toggleTips[0].Get<std::string>() == resultTips[0].Get<std::string>() );
- DALI_TEST_CHECK( toggleTips[1].Get<std::string>() == resultTips[1].Get<std::string>() );
- DALI_TEST_CHECK( toggleTips[2].Get<std::string>() == resultTips[2].Get<std::string>() );
- DALI_TEST_CHECK( toggleTips[3].Get<std::string>() == resultTips[3].Get<std::string>() );
+ DALI_TEST_EQUALS(toggleTips.Count(), resultTips.Count(), TEST_LOCATION);
+ DALI_TEST_CHECK(toggleTips[0].Get<std::string>() == resultTips[0].Get<std::string>());
+ DALI_TEST_CHECK(toggleTips[1].Get<std::string>() == resultTips[1].Get<std::string>());
+ DALI_TEST_CHECK(toggleTips[2].Get<std::string>() == resultTips[2].Get<std::string>());
+ DALI_TEST_CHECK(toggleTips[3].Get<std::string>() == resultTips[3].Get<std::string>());
}
END_TEST;
}
int UtcDaliToggleButtonStateChange(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
tet_infoline(" UtcDaliToggleButtonStateChange");
// Create the ToggleButton actor
ToggleButton toggleButton = ToggleButton::New();
- application.GetScene().Add( toggleButton );
- toggleButton.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
- toggleButton.SetProperty( Actor::Property::ANCHOR_POINT,ParentOrigin::TOP_LEFT);
- toggleButton.SetProperty( Actor::Property::POSITION, BUTTON_POSITON_TO_GET_INSIDE_TOUCH_EVENTS );
- toggleButton.SetProperty( Actor::Property::SIZE, BUTTON_SIZE_TO_GET_INSIDE_TOUCH_EVENTS );
+ application.GetScene().Add(toggleButton);
+ toggleButton.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ toggleButton.SetProperty(Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_LEFT);
+ toggleButton.SetProperty(Actor::Property::POSITION, BUTTON_POSITON_TO_GET_INSIDE_TOUCH_EVENTS);
+ toggleButton.SetProperty(Actor::Property::SIZE, BUTTON_SIZE_TO_GET_INSIDE_TOUCH_EVENTS);
Property::Array toggleIcons;
- toggleIcons.PushBack( TEST_IMAGE_ONE ); //Icons path
- toggleIcons.PushBack( TEST_IMAGE_TWO );
- toggleIcons.PushBack( TEST_IMAGE_THREE );
- toggleButton.SetProperty( Toolkit::ToggleButton::Property::STATE_VISUALS, toggleIcons );
+ toggleIcons.PushBack(TEST_IMAGE_ONE); //Icons path
+ toggleIcons.PushBack(TEST_IMAGE_TWO);
+ toggleIcons.PushBack(TEST_IMAGE_THREE);
+ toggleButton.SetProperty(Toolkit::ToggleButton::Property::STATE_VISUALS, toggleIcons);
Property::Array toggleTips;
- toggleTips.PushBack( "Button State A" ); //Tooltip string
- toggleTips.PushBack( "Button State B" );
- toggleTips.PushBack( "Button State C" );
- toggleButton.SetProperty( Toolkit::ToggleButton::Property::TOOLTIPS, toggleTips );
+ toggleTips.PushBack("Button State A"); //Tooltip string
+ toggleTips.PushBack("Button State B");
+ toggleTips.PushBack("Button State C");
+ toggleButton.SetProperty(Toolkit::ToggleButton::Property::TOOLTIPS, toggleTips);
application.SendNotification();
application.Render();
Property::Array resultIcons;
- resultIcons = toggleButton.GetProperty( Toolkit::ToggleButton::Property::STATE_VISUALS ).Get<Property::Array>();
- DALI_TEST_EQUALS( toggleIcons.Count(), resultIcons.Count(), TEST_LOCATION );
+ resultIcons = toggleButton.GetProperty(Toolkit::ToggleButton::Property::STATE_VISUALS).Get<Property::Array>();
+ DALI_TEST_EQUALS(toggleIcons.Count(), resultIcons.Count(), TEST_LOCATION);
Property::Array resultTips;
- resultTips = toggleButton.GetProperty( Toolkit::ToggleButton::Property::TOOLTIPS ).Get<Property::Array>();
- DALI_TEST_EQUALS( toggleTips.Count(), resultTips.Count(), TEST_LOCATION );
+ resultTips = toggleButton.GetProperty(Toolkit::ToggleButton::Property::TOOLTIPS).Get<Property::Array>();
+ DALI_TEST_EQUALS(toggleTips.Count(), resultTips.Count(), TEST_LOCATION);
int index;
- DALI_TEST_CHECK( toggleButton.GetProperty( Toolkit::ToggleButton::Property::CURRENT_STATE_INDEX ).Get( index ) );
- DALI_TEST_EQUALS( index, 0, TEST_LOCATION );
+ DALI_TEST_CHECK(toggleButton.GetProperty(Toolkit::ToggleButton::Property::CURRENT_STATE_INDEX).Get(index));
+ DALI_TEST_EQUALS(index, 0, TEST_LOCATION);
Dali::Integration::TouchEvent event;
// Touch point down and up inside the button 3 times.
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointDownInside() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointDownInside());
+ application.ProcessEvent(event);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointUpInside() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointUpInside());
+ application.ProcessEvent(event);
- DALI_TEST_CHECK( toggleButton.GetProperty( Toolkit::ToggleButton::Property::CURRENT_STATE_INDEX ).Get( index ) );
- DALI_TEST_EQUALS( index, 1, TEST_LOCATION );
+ DALI_TEST_CHECK(toggleButton.GetProperty(Toolkit::ToggleButton::Property::CURRENT_STATE_INDEX).Get(index));
+ DALI_TEST_EQUALS(index, 1, TEST_LOCATION);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointDownInside() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointDownInside());
+ application.ProcessEvent(event);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointUpInside() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointUpInside());
+ application.ProcessEvent(event);
- DALI_TEST_CHECK( toggleButton.GetProperty( Toolkit::ToggleButton::Property::CURRENT_STATE_INDEX ).Get( index ) );
- DALI_TEST_EQUALS( index, 2, TEST_LOCATION );
+ DALI_TEST_CHECK(toggleButton.GetProperty(Toolkit::ToggleButton::Property::CURRENT_STATE_INDEX).Get(index));
+ DALI_TEST_EQUALS(index, 2, TEST_LOCATION);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointDownInside() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointDownInside());
+ application.ProcessEvent(event);
event = Dali::Integration::TouchEvent();
- event.AddPoint( GetPointUpInside() );
- application.ProcessEvent( event );
+ event.AddPoint(GetPointUpInside());
+ application.ProcessEvent(event);
- DALI_TEST_CHECK( toggleButton.GetProperty( Toolkit::ToggleButton::Property::CURRENT_STATE_INDEX ).Get( index ) );
- DALI_TEST_EQUALS( index, 0, TEST_LOCATION );
+ DALI_TEST_CHECK(toggleButton.GetProperty(Toolkit::ToggleButton::Property::CURRENT_STATE_INDEX).Get(index));
+ DALI_TEST_EQUALS(index, 0, TEST_LOCATION);
END_TEST;
}
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
-#include <stdlib.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
-#include <dali/integration-api/events/touch-event-integ.h>
#include <dali-toolkit/devel-api/controls/tool-bar/tool-bar.h>
#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
+#include <dali/integration-api/events/touch-event-integ.h>
+#include <stdlib.h>
+#include <iostream>
#include "dummy-control.h"
using namespace Dali;
gObjectCreatedCallBackCalled = true;
}
-Actor CreateColorActor( const Vector4& color )
+Actor CreateColorActor(const Vector4& color)
{
- DummyControl solidColorActor = DummyControl::New();
- DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(solidColorActor.GetImplementation());
+ DummyControl solidColorActor = DummyControl::New();
+ DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(solidColorActor.GetImplementation());
- VisualFactory factory = VisualFactory::Get();
+ VisualFactory factory = VisualFactory::Get();
Dali::Property::Map map;
- map[ Toolkit::Visual::Property::TYPE ] = Visual::COLOR;
- map[ ColorVisual::Property::MIX_COLOR ] = color;
- Visual::Base colorVisual = factory.CreateVisual( map );
- dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, colorVisual );
+ map[Toolkit::Visual::Property::TYPE] = Visual::COLOR;
+ map[ColorVisual::Property::MIX_COLOR] = color;
+ Visual::Base colorVisual = factory.CreateVisual(map);
+ dummyImpl.RegisterVisual(Control::CONTROL_PROPERTY_END_INDEX + 1, colorVisual);
return solidColorActor;
}
test_return_value = TET_PASS;
}
-
int UtcDaliToolBarNew(void)
{
ToolkitTestApplication application;
ToolBar toolbar;
- DALI_TEST_CHECK( !toolbar );
+ DALI_TEST_CHECK(!toolbar);
toolbar = ToolBar::New();
- DALI_TEST_CHECK( toolbar );
+ DALI_TEST_CHECK(toolbar);
ToolBar toolbar2(toolbar);
- DALI_TEST_CHECK( toolbar2 == toolbar );
+ DALI_TEST_CHECK(toolbar2 == toolbar);
//Additional check to ensure object is created by checking if it's registered
ObjectRegistry registry = application.GetCore().GetObjectRegistry();
- DALI_TEST_CHECK( registry );
+ DALI_TEST_CHECK(registry);
gObjectCreatedCallBackCalled = false;
registry.ObjectCreatedSignal().Connect(&TestCallback);
{
ToolBar toolbar = ToolBar::New();
}
- DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
+ DALI_TEST_CHECK(gObjectCreatedCallBackCalled);
Actor actor = toolbar;
- toolbar = ToolBar::DownCast( actor );
+ toolbar = ToolBar::DownCast(actor);
- DALI_TEST_CHECK( toolbar );
+ DALI_TEST_CHECK(toolbar);
END_TEST;
}
try
{
- Actor control1 = CreateColorActor( Color::RED );
- control1.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
- Actor control2 = CreateColorActor( Color::RED );
- control2.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
- Actor control3 = CreateColorActor( Color::RED );
- control3.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
- Actor control4 = CreateColorActor( Color::RED );
- control4.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
- Actor control5 = CreateColorActor( Color::RED );
- control5.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
+ Actor control1 = CreateColorActor(Color::RED);
+ control1.SetProperty(Actor::Property::SIZE, Vector2(100.f, 100.f));
+ Actor control2 = CreateColorActor(Color::RED);
+ control2.SetProperty(Actor::Property::SIZE, Vector2(100.f, 100.f));
+ Actor control3 = CreateColorActor(Color::RED);
+ control3.SetProperty(Actor::Property::SIZE, Vector2(100.f, 100.f));
+ Actor control4 = CreateColorActor(Color::RED);
+ control4.SetProperty(Actor::Property::SIZE, Vector2(100.f, 100.f));
+ Actor control5 = CreateColorActor(Color::RED);
+ control5.SetProperty(Actor::Property::SIZE, Vector2(100.f, 100.f));
ToolBar toolbar = ToolBar::New();
- toolbar.SetProperty( Actor::Property::SIZE, Vector2( 600.f, 100.f ) );
+ toolbar.SetProperty(Actor::Property::SIZE, Vector2(600.f, 100.f));
application.Render();
application.SendNotification();
application.Render();
application.SendNotification();
- toolbar.Add( control1 );
- toolbar.AddControl( control2, 0.1f, Alignment::HORIZONTAL_LEFT, Alignment::Padding( 1.f, 1.f, 1.f, 1.f ) );
- toolbar.AddControl( control3, 0.1f, Alignment::HORIZONTAL_CENTER, Alignment::Padding( 1.f, 1.f, 1.f, 1.f ) );
- toolbar.AddControl( control4, 0.1f, Alignment::HORIZONTAL_CENTER, Alignment::Padding( 1.f, 1.f, 1.f, 1.f ) );
- toolbar.AddControl( control5, 0.1f, Alignment::HORIZONTAL_RIGHT, Alignment::Padding( 1.f, 1.f, 1.f, 1.f ) );
+ toolbar.Add(control1);
+ toolbar.AddControl(control2, 0.1f, Alignment::HORIZONTAL_LEFT, Alignment::Padding(1.f, 1.f, 1.f, 1.f));
+ toolbar.AddControl(control3, 0.1f, Alignment::HORIZONTAL_CENTER, Alignment::Padding(1.f, 1.f, 1.f, 1.f));
+ toolbar.AddControl(control4, 0.1f, Alignment::HORIZONTAL_CENTER, Alignment::Padding(1.f, 1.f, 1.f, 1.f));
+ toolbar.AddControl(control5, 0.1f, Alignment::HORIZONTAL_RIGHT, Alignment::Padding(1.f, 1.f, 1.f, 1.f));
- Actor control6 = CreateColorActor( Color::RED );
- control6.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
- Actor control7 = CreateColorActor( Color::RED );
- control7.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
- Actor control8 = CreateColorActor( Color::RED );
- control8.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
+ Actor control6 = CreateColorActor(Color::RED);
+ control6.SetProperty(Actor::Property::SIZE, Vector2(100.f, 100.f));
+ Actor control7 = CreateColorActor(Color::RED);
+ control7.SetProperty(Actor::Property::SIZE, Vector2(100.f, 100.f));
+ Actor control8 = CreateColorActor(Color::RED);
+ control8.SetProperty(Actor::Property::SIZE, Vector2(100.f, 100.f));
application.Render();
application.SendNotification();
application.Render();
application.SendNotification();
- toolbar.AddControl( control6, 0.4f, Alignment::HORIZONTAL_LEFT, Alignment::Padding( 1.f, 1.f, 1.f, 1.f ) );
- toolbar.AddControl( control7, 0.2f, Alignment::HORIZONTAL_CENTER, Alignment::Padding( 1.f, 1.f, 1.f, 1.f ) );
- toolbar.AddControl( control8, 0.2f, Alignment::HORIZONTAL_RIGHT, Alignment::Padding( 1.f, 1.f, 1.f, 1.f ) );
+ toolbar.AddControl(control6, 0.4f, Alignment::HORIZONTAL_LEFT, Alignment::Padding(1.f, 1.f, 1.f, 1.f));
+ toolbar.AddControl(control7, 0.2f, Alignment::HORIZONTAL_CENTER, Alignment::Padding(1.f, 1.f, 1.f, 1.f));
+ toolbar.AddControl(control8, 0.2f, Alignment::HORIZONTAL_RIGHT, Alignment::Padding(1.f, 1.f, 1.f, 1.f));
}
- catch( ... )
+ catch(...)
{
tet_result(TET_FAIL);
}
try
{
- Actor control = CreateColorActor( Color::RED );
+ Actor control = CreateColorActor(Color::RED);
ToolBar toolbar = ToolBar::New();
- toolbar.AddControl( control, 0.1f, static_cast<Alignment::Type>( 99 ), Alignment::Padding( 1.f, 1.f, 1.f, 1.f ) );
+ toolbar.AddControl(control, 0.1f, static_cast<Alignment::Type>(99), Alignment::Padding(1.f, 1.f, 1.f, 1.f));
}
- catch( DaliException e )
+ catch(DaliException e)
{
daliAssert = true;
tet_result(TET_PASS);
}
- catch( ... )
+ catch(...)
{
tet_result(TET_FAIL);
}
- if( !daliAssert )
+ if(!daliAssert)
{
tet_result(TET_FAIL);
}
try
{
- Actor control = CreateColorActor( Color::RED );
+ Actor control = CreateColorActor(Color::RED);
ToolBar toolbar = ToolBar::New();
- toolbar.AddControl( control, 0.1f, Alignment::HORIZONTAL_LEFT );
+ toolbar.AddControl(control, 0.1f, Alignment::HORIZONTAL_LEFT);
- toolbar.RemoveControl( control );
+ toolbar.RemoveControl(control);
}
- catch( ... )
+ catch(...)
{
tet_result(TET_FAIL);
}
try
{
- Actor control01 = CreateColorActor( Color::RED );
- Actor control02 = CreateColorActor( Color::RED );
+ Actor control01 = CreateColorActor(Color::RED);
+ Actor control02 = CreateColorActor(Color::RED);
ToolBar toolbar01 = ToolBar::New();
ToolBar toolbar02 = ToolBar::New();
- toolbar01.AddControl( control01, 0.1f, Alignment::HORIZONTAL_LEFT );
- toolbar02.AddControl( control02, 0.1f, Alignment::HORIZONTAL_LEFT );
+ toolbar01.AddControl(control01, 0.1f, Alignment::HORIZONTAL_LEFT);
+ toolbar02.AddControl(control02, 0.1f, Alignment::HORIZONTAL_LEFT);
- toolbar02.RemoveControl( control01 );
+ toolbar02.RemoveControl(control01);
}
- catch( Dali::DaliException& e )
+ catch(Dali::DaliException& e)
{
- DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_PRINT_ASSERT(e);
DALI_TEST_EQUALS(e.condition, "false", TEST_LOCATION);
}
- catch( ... )
+ catch(...)
{
tet_result(TET_FAIL);
}
try
{
- Actor control = CreateColorActor( Color::RED );
+ Actor control = CreateColorActor(Color::RED);
ToolBar toolbar = ToolBar::New();
- toolbar.AddControl( control, 0.1f, Alignment::HORIZONTAL_LEFT );
+ toolbar.AddControl(control, 0.1f, Alignment::HORIZONTAL_LEFT);
- toolbar.RemoveControl( control );
- toolbar.RemoveControl( control );
+ toolbar.RemoveControl(control);
+ toolbar.RemoveControl(control);
}
- catch( ... )
+ catch(...)
{
tet_result(TET_FAIL);
}
*
*/
-#include <iostream>
-#include <stdlib.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
+#include <stdlib.h>
+#include <iostream>
using namespace Dali;
using namespace Toolkit;
tet_infoline(" UtcToolkitIsVertical");
bRet = IsVertical(ControlOrientation::Up);
- DALI_TEST_EQUALS( bRet, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(bRet, true, TEST_LOCATION);
bRet = IsVertical(ControlOrientation::Down);
- DALI_TEST_EQUALS( bRet, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(bRet, true, TEST_LOCATION);
END_TEST;
}
tet_infoline(" UtcToolkitIsHorizontal");
bRet = IsHorizontal(ControlOrientation::Left);
- DALI_TEST_EQUALS( bRet, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(bRet, true, TEST_LOCATION);
bRet = IsHorizontal(ControlOrientation::Right);
- DALI_TEST_EQUALS( bRet, true, TEST_LOCATION );
+ DALI_TEST_EQUALS(bRet, true, TEST_LOCATION);
END_TEST;
}
-
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
#include <stdlib.h>
+#include <iostream>
// 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 <toolkit-timer.h>
-#include <dali.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/controls/control-devel.h>
#include <dali-toolkit/devel-api/controls/popup/popup.h>
#include <dali-toolkit/devel-api/controls/tooltip/tooltip-properties.h>
+#include <dali.h>
#include <dali/integration-api/events/hover-event-integ.h>
using namespace Dali;
namespace
{
-
-Integration::HoverEvent GenerateSingleHover( PointState::Type state, const Vector2& screenPosition )
+Integration::HoverEvent GenerateSingleHover(PointState::Type state, const Vector2& screenPosition)
{
Integration::HoverEvent hoverEvent;
- Integration::Point point;
- point.SetState( static_cast< PointState::Type >( state ) );
- point.SetScreenPosition( screenPosition );
- hoverEvent.points.push_back( point );
+ Integration::Point point;
+ point.SetState(static_cast<PointState::Type>(state));
+ point.SetScreenPosition(screenPosition);
+ hoverEvent.points.push_back(point);
return hoverEvent;
}
int UtcDaliTooltipGetWithoutSetting(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
Control control = Control::New();
- tet_infoline( "Check if Property::MAP is returned" );
- Property::Value value = control.GetProperty( DevelControl::Property::TOOLTIP );
- DALI_TEST_EQUALS( value.GetType(), Property::MAP, TEST_LOCATION );
+ tet_infoline("Check if Property::MAP is returned");
+ Property::Value value = control.GetProperty(DevelControl::Property::TOOLTIP);
+ DALI_TEST_EQUALS(value.GetType(), Property::MAP, TEST_LOCATION);
- tet_infoline( "Ensure map is valid" );
+ tet_infoline("Ensure map is valid");
Property::Map* map = value.GetMap();
- DALI_TEST_CHECK( map );
+ DALI_TEST_CHECK(map);
- tet_infoline( "Ensure map is empty" );
- DALI_TEST_EQUALS( true, map->Empty(), TEST_LOCATION );
+ tet_infoline("Ensure map is empty");
+ DALI_TEST_EQUALS(true, map->Empty(), TEST_LOCATION);
END_TEST;
}
int UtcDaliTooltipCreateWithString(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
Control control = Control::New();
- control.SetProperty( DevelControl::Property::TOOLTIP, "Hello Test" );
+ control.SetProperty(DevelControl::Property::TOOLTIP, "Hello Test");
- tet_infoline( "Check if Property::MAP is returned" );
- Property::Value value = control.GetProperty( DevelControl::Property::TOOLTIP );
- DALI_TEST_EQUALS( value.GetType(), Property::MAP, TEST_LOCATION );
+ tet_infoline("Check if Property::MAP is returned");
+ Property::Value value = control.GetProperty(DevelControl::Property::TOOLTIP);
+ DALI_TEST_EQUALS(value.GetType(), Property::MAP, TEST_LOCATION);
- tet_infoline( "Ensure map is valid" );
+ tet_infoline("Ensure map is valid");
Property::Map* map = value.GetMap();
- DALI_TEST_CHECK( map );
+ DALI_TEST_CHECK(map);
- tet_infoline( "Ensure map contains the content" );
- Property::Value* contentValue = map->Find( Tooltip::Property::CONTENT );
- DALI_TEST_CHECK( contentValue );
+ tet_infoline("Ensure map contains the content");
+ Property::Value* contentValue = map->Find(Tooltip::Property::CONTENT);
+ DALI_TEST_CHECK(contentValue);
- tet_infoline( "Check content is a property map" );
+ tet_infoline("Check content is a property map");
Property::Map* contentMap = contentValue->GetMap();
- DALI_TEST_CHECK( contentMap );
+ DALI_TEST_CHECK(contentMap);
- tet_infoline( "Check that the map contains the text item" );
- Property::Value* textStringValue = contentMap->Find( TextVisual::Property::TEXT );
- DALI_TEST_CHECK( textStringValue );
+ tet_infoline("Check that the map contains the text item");
+ Property::Value* textStringValue = contentMap->Find(TextVisual::Property::TEXT);
+ DALI_TEST_CHECK(textStringValue);
- tet_infoline( "Ensure it matches what we set" );
- DALI_TEST_EQUALS( "Hello Test", textStringValue->Get< std::string >(), TEST_LOCATION );
+ tet_infoline("Ensure it matches what we set");
+ DALI_TEST_EQUALS("Hello Test", textStringValue->Get<std::string>(), TEST_LOCATION);
- tet_infoline( "We sent valid text, so ensure the hover signal has been connected to" );
- DALI_TEST_EQUALS( control.HoveredSignal().GetConnectionCount(), 1u, TEST_LOCATION );
+ tet_infoline("We sent valid text, so ensure the hover signal has been connected to");
+ DALI_TEST_EQUALS(control.HoveredSignal().GetConnectionCount(), 1u, TEST_LOCATION);
END_TEST;
}
int UtcDaliTooltipCreateWithTextVisualMap(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
Control control = Control::New();
- control.SetProperty( DevelControl::Property::TOOLTIP,
- Property::Map().Add( Tooltip::Property::CONTENT,
- Property::Map().Add( Toolkit::Visual::Property::TYPE, Visual::TEXT )
- .Add( TextVisual::Property::TEXT, "Hello TextVisual Test" ) )
- );
+ control.SetProperty(DevelControl::Property::TOOLTIP,
+ Property::Map().Add(Tooltip::Property::CONTENT,
+ Property::Map().Add(Toolkit::Visual::Property::TYPE, Visual::TEXT).Add(TextVisual::Property::TEXT, "Hello TextVisual Test")));
- tet_infoline( "Check if Property::MAP is returned" );
- Property::Value value = control.GetProperty( DevelControl::Property::TOOLTIP );
- DALI_TEST_EQUALS( value.GetType(), Property::MAP, TEST_LOCATION );
+ tet_infoline("Check if Property::MAP is returned");
+ Property::Value value = control.GetProperty(DevelControl::Property::TOOLTIP);
+ DALI_TEST_EQUALS(value.GetType(), Property::MAP, TEST_LOCATION);
- tet_infoline( "Ensure map is valid" );
+ tet_infoline("Ensure map is valid");
Property::Map* map = value.GetMap();
- DALI_TEST_CHECK( map );
+ DALI_TEST_CHECK(map);
- tet_infoline( "Ensure map contains the content" );
- Property::Value* contentValue = map->Find( Tooltip::Property::CONTENT );
- DALI_TEST_CHECK( contentValue );
+ tet_infoline("Ensure map contains the content");
+ Property::Value* contentValue = map->Find(Tooltip::Property::CONTENT);
+ DALI_TEST_CHECK(contentValue);
- tet_infoline( "Check content is a property map" );
+ tet_infoline("Check content is a property map");
Property::Map* contentMap = contentValue->GetMap();
- DALI_TEST_CHECK( contentMap );
+ DALI_TEST_CHECK(contentMap);
- tet_infoline( "Check that the map contains the text item" );
- Property::Value* textStringValue = contentMap->Find( TextVisual::Property::TEXT );
- DALI_TEST_CHECK( textStringValue );
+ tet_infoline("Check that the map contains the text item");
+ Property::Value* textStringValue = contentMap->Find(TextVisual::Property::TEXT);
+ DALI_TEST_CHECK(textStringValue);
- tet_infoline( "Ensure it matches what we set" );
- DALI_TEST_EQUALS( "Hello TextVisual Test", textStringValue->Get< std::string >(), TEST_LOCATION );
+ tet_infoline("Ensure it matches what we set");
+ DALI_TEST_EQUALS("Hello TextVisual Test", textStringValue->Get<std::string>(), TEST_LOCATION);
- tet_infoline( "We sent a text visual with TEXT property set, so ensure the hover signal has been connected to" );
- DALI_TEST_EQUALS( control.HoveredSignal().GetConnectionCount(), 1u, TEST_LOCATION );
+ tet_infoline("We sent a text visual with TEXT property set, so ensure the hover signal has been connected to");
+ DALI_TEST_EQUALS(control.HoveredSignal().GetConnectionCount(), 1u, TEST_LOCATION);
END_TEST;
}
int UtcDaliTooltipCreateWithTextVisualMapWithoutString(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
Control control = Control::New();
- control.SetProperty( DevelControl::Property::TOOLTIP,
- Property::Map().Add( Tooltip::Property::CONTENT,
- Property::Map().Add( Toolkit::Visual::Property::TYPE, Visual::TEXT )
- .Add( TextVisual::Property::POINT_SIZE, 20 ) )
- );
+ control.SetProperty(DevelControl::Property::TOOLTIP,
+ Property::Map().Add(Tooltip::Property::CONTENT,
+ Property::Map().Add(Toolkit::Visual::Property::TYPE, Visual::TEXT).Add(TextVisual::Property::POINT_SIZE, 20)));
- tet_infoline( "Check if Property::MAP is returned" );
- Property::Value value = control.GetProperty( DevelControl::Property::TOOLTIP );
- DALI_TEST_EQUALS( value.GetType(), Property::MAP, TEST_LOCATION );
+ tet_infoline("Check if Property::MAP is returned");
+ Property::Value value = control.GetProperty(DevelControl::Property::TOOLTIP);
+ DALI_TEST_EQUALS(value.GetType(), Property::MAP, TEST_LOCATION);
- tet_infoline( "Ensure map is valid" );
+ tet_infoline("Ensure map is valid");
Property::Map* map = value.GetMap();
- DALI_TEST_CHECK( map );
+ DALI_TEST_CHECK(map);
- tet_infoline( "Ensure map contains the content" );
- Property::Value* contentValue = map->Find( Tooltip::Property::CONTENT );
- DALI_TEST_CHECK( contentValue );
+ tet_infoline("Ensure map contains the content");
+ Property::Value* contentValue = map->Find(Tooltip::Property::CONTENT);
+ DALI_TEST_CHECK(contentValue);
- tet_infoline( "Check content is a property map" );
+ tet_infoline("Check content is a property map");
Property::Map* contentMap = contentValue->GetMap();
- DALI_TEST_CHECK( contentMap );
+ DALI_TEST_CHECK(contentMap);
- tet_infoline( "Check that the map contains the point-size item" );
- Property::Value* pointSizeValue = contentMap->Find( TextVisual::Property::POINT_SIZE );
- DALI_TEST_CHECK( pointSizeValue );
+ tet_infoline("Check that the map contains the point-size item");
+ Property::Value* pointSizeValue = contentMap->Find(TextVisual::Property::POINT_SIZE);
+ DALI_TEST_CHECK(pointSizeValue);
- tet_infoline( "Ensure it matches what we set" );
- DALI_TEST_EQUALS( 20, pointSizeValue->Get< int >(), TEST_LOCATION );
+ tet_infoline("Ensure it matches what we set");
+ DALI_TEST_EQUALS(20, pointSizeValue->Get<int>(), TEST_LOCATION);
- tet_infoline( "We sent a text visual without a TEXT property set, so ensure the hover signal has NOT been connected to" );
- DALI_TEST_EQUALS( control.HoveredSignal().GetConnectionCount(), 0u, TEST_LOCATION );
+ tet_infoline("We sent a text visual without a TEXT property set, so ensure the hover signal has NOT been connected to");
+ DALI_TEST_EQUALS(control.HoveredSignal().GetConnectionCount(), 0u, TEST_LOCATION);
END_TEST;
}
int UtcDaliTooltipCreateWithImageVisualMap(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
Control control = Control::New();
- control.SetProperty( DevelControl::Property::TOOLTIP,
- Property::Map().Add( Tooltip::Property::CONTENT,
- Property::Map().Add( Toolkit::Visual::Property::TYPE, Visual::IMAGE )
- .Add( ImageVisual::Property::URL, "dummy-url.png" ) )
- );
+ control.SetProperty(DevelControl::Property::TOOLTIP,
+ Property::Map().Add(Tooltip::Property::CONTENT,
+ Property::Map().Add(Toolkit::Visual::Property::TYPE, Visual::IMAGE).Add(ImageVisual::Property::URL, "dummy-url.png")));
- tet_infoline( "Check if Property::MAP is returned" );
- Property::Value value = control.GetProperty( DevelControl::Property::TOOLTIP );
- DALI_TEST_EQUALS( value.GetType(), Property::MAP, TEST_LOCATION );
+ tet_infoline("Check if Property::MAP is returned");
+ Property::Value value = control.GetProperty(DevelControl::Property::TOOLTIP);
+ DALI_TEST_EQUALS(value.GetType(), Property::MAP, TEST_LOCATION);
- tet_infoline( "Ensure map is valid" );
+ tet_infoline("Ensure map is valid");
Property::Map* map = value.GetMap();
- DALI_TEST_CHECK( map );
+ DALI_TEST_CHECK(map);
- tet_infoline( "Ensure map contains the content" );
- Property::Value* contentValue = map->Find( Tooltip::Property::CONTENT );
- DALI_TEST_CHECK( contentValue );
+ tet_infoline("Ensure map contains the content");
+ Property::Value* contentValue = map->Find(Tooltip::Property::CONTENT);
+ DALI_TEST_CHECK(contentValue);
- tet_infoline( "Check content is a property map" );
+ tet_infoline("Check content is a property map");
Property::Map* contentMap = contentValue->GetMap();
- DALI_TEST_CHECK( contentMap );
+ DALI_TEST_CHECK(contentMap);
- tet_infoline( "Check that the map contains the url item" );
- Property::Value* urlValue = contentMap->Find( ImageVisual::Property::URL );
- DALI_TEST_CHECK( urlValue );
+ tet_infoline("Check that the map contains the url item");
+ Property::Value* urlValue = contentMap->Find(ImageVisual::Property::URL);
+ DALI_TEST_CHECK(urlValue);
- tet_infoline( "Ensure it matches what we set" );
- DALI_TEST_EQUALS( "dummy-url.png", urlValue->Get< std::string >(), TEST_LOCATION );
+ tet_infoline("Ensure it matches what we set");
+ DALI_TEST_EQUALS("dummy-url.png", urlValue->Get<std::string>(), TEST_LOCATION);
- tet_infoline( "We sent an ImageVisual, so ensure the hover signal has been connected to" );
- DALI_TEST_EQUALS( control.HoveredSignal().GetConnectionCount(), 1u, TEST_LOCATION );
+ tet_infoline("We sent an ImageVisual, so ensure the hover signal has been connected to");
+ DALI_TEST_EQUALS(control.HoveredSignal().GetConnectionCount(), 1u, TEST_LOCATION);
END_TEST;
}
int UtcDaliTooltipCreateWithArray(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
Control control = Control::New();
- control.SetProperty( DevelControl::Property::TOOLTIP,
- Property::Array().Add( Property::Map().Add( Toolkit::Visual::Property::TYPE, Visual::IMAGE )
- .Add( ImageVisual::Property::URL, "dummy-url.png" ) )
- .Add( Property::Map().Add( Toolkit::Visual::Property::TYPE, Visual::TEXT )
- .Add( TextVisual::Property::TEXT, "Hello Array Test" ) )
- );
-
- tet_infoline( "Check if Property::MAP is returned" );
- Property::Value value = control.GetProperty( DevelControl::Property::TOOLTIP );
- DALI_TEST_EQUALS( value.GetType(), Property::MAP, TEST_LOCATION );
-
- tet_infoline( "Ensure map is valid" );
+ control.SetProperty(DevelControl::Property::TOOLTIP,
+ Property::Array().Add(Property::Map().Add(Toolkit::Visual::Property::TYPE, Visual::IMAGE).Add(ImageVisual::Property::URL, "dummy-url.png")).Add(Property::Map().Add(Toolkit::Visual::Property::TYPE, Visual::TEXT).Add(TextVisual::Property::TEXT, "Hello Array Test")));
+
+ tet_infoline("Check if Property::MAP is returned");
+ Property::Value value = control.GetProperty(DevelControl::Property::TOOLTIP);
+ DALI_TEST_EQUALS(value.GetType(), Property::MAP, TEST_LOCATION);
+
+ tet_infoline("Ensure map is valid");
Property::Map* map = value.GetMap();
- DALI_TEST_CHECK( map );
+ DALI_TEST_CHECK(map);
- tet_infoline( "Ensure map contains the content" );
- Property::Value* contentValue = map->Find( Tooltip::Property::CONTENT );
- DALI_TEST_CHECK( contentValue );
+ tet_infoline("Ensure map contains the content");
+ Property::Value* contentValue = map->Find(Tooltip::Property::CONTENT);
+ DALI_TEST_CHECK(contentValue);
- tet_infoline( "Check content is a property array" );
+ tet_infoline("Check content is a property array");
Property::Array* contentArray = contentValue->GetArray();
- DALI_TEST_CHECK( contentArray );
-
- tet_infoline( "Ensure the array contains two items" );
- DALI_TEST_EQUALS( 2u, contentArray->Count(), TEST_LOCATION );
-
- tet_infoline( "Ensure first value is a map and contains the right item" );
- const Property::Value mapValue1 = contentArray->GetElementAt( 0 );
- const Property::Map* map1 = mapValue1.GetMap();
- DALI_TEST_CHECK( map1 );
- Property::Value* urlValue = map1->Find( ImageVisual::Property::URL );
- DALI_TEST_CHECK( urlValue );
- DALI_TEST_EQUALS( "dummy-url.png", urlValue->Get< std::string >(), TEST_LOCATION );
-
- tet_infoline( "Ensure second value is a map and contains the right item" );
- const Property::Value mapValue2 = contentArray->GetElementAt( 1 );
- const Property::Map* map2 = mapValue2.GetMap();
- DALI_TEST_CHECK( map2 );
- Property::Value* textValue = map2->Find( TextVisual::Property::TEXT );
- DALI_TEST_CHECK( textValue );
- DALI_TEST_EQUALS( "Hello Array Test", textValue->Get< std::string >(), TEST_LOCATION );
-
- tet_infoline( "We sent an array, so ensure the hover signal has been connected to" );
- DALI_TEST_EQUALS( control.HoveredSignal().GetConnectionCount(), 1u, TEST_LOCATION );
+ DALI_TEST_CHECK(contentArray);
+
+ tet_infoline("Ensure the array contains two items");
+ DALI_TEST_EQUALS(2u, contentArray->Count(), TEST_LOCATION);
+
+ tet_infoline("Ensure first value is a map and contains the right item");
+ const Property::Value mapValue1 = contentArray->GetElementAt(0);
+ const Property::Map* map1 = mapValue1.GetMap();
+ DALI_TEST_CHECK(map1);
+ Property::Value* urlValue = map1->Find(ImageVisual::Property::URL);
+ DALI_TEST_CHECK(urlValue);
+ DALI_TEST_EQUALS("dummy-url.png", urlValue->Get<std::string>(), TEST_LOCATION);
+
+ tet_infoline("Ensure second value is a map and contains the right item");
+ const Property::Value mapValue2 = contentArray->GetElementAt(1);
+ const Property::Map* map2 = mapValue2.GetMap();
+ DALI_TEST_CHECK(map2);
+ Property::Value* textValue = map2->Find(TextVisual::Property::TEXT);
+ DALI_TEST_CHECK(textValue);
+ DALI_TEST_EQUALS("Hello Array Test", textValue->Get<std::string>(), TEST_LOCATION);
+
+ tet_infoline("We sent an array, so ensure the hover signal has been connected to");
+ DALI_TEST_EQUALS(control.HoveredSignal().GetConnectionCount(), 1u, TEST_LOCATION);
END_TEST;
}
int UtcDaliTooltipCreateWithFullMap(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
Control control = Control::New();
- control.SetProperty( DevelControl::Property::TOOLTIP,
- Property::Map().Add( Tooltip::Property::CONTENT,
- Property::Map().Add( Toolkit::Visual::Property::TYPE, Visual::TEXT )
- .Add( TextVisual::Property::TEXT, "Hello TextVisual Test" ) )
- .Add( Tooltip::Property::LAYOUT, Vector2( 1.0f, 2.0f ) )
- .Add( Tooltip::Property::WAIT_TIME, 2.5f )
- .Add( Tooltip::Property::BACKGROUND, "tooltip-background.png" )
- .Add( Tooltip::Property::TAIL, true )
- .Add( Tooltip::Property::POSITION, Tooltip::Position::HOVER_POINT )
- .Add( Tooltip::Property::HOVER_POINT_OFFSET, Vector2( 100.0f, 50.f ) )
- .Add( Tooltip::Property::MOVEMENT_THRESHOLD, 50 )
- .Add( Tooltip::Property::DISAPPEAR_ON_MOVEMENT, true )
- );
-
- tet_infoline( "Check if Property::MAP is returned" );
- Property::Value value = control.GetProperty( DevelControl::Property::TOOLTIP );
- DALI_TEST_EQUALS( value.GetType(), Property::MAP, TEST_LOCATION );
-
- tet_infoline( "Ensure map is valid" );
+ control.SetProperty(DevelControl::Property::TOOLTIP,
+ Property::Map().Add(Tooltip::Property::CONTENT,
+ Property::Map().Add(Toolkit::Visual::Property::TYPE, Visual::TEXT).Add(TextVisual::Property::TEXT, "Hello TextVisual Test"))
+ .Add(Tooltip::Property::LAYOUT, Vector2(1.0f, 2.0f))
+ .Add(Tooltip::Property::WAIT_TIME, 2.5f)
+ .Add(Tooltip::Property::BACKGROUND, "tooltip-background.png")
+ .Add(Tooltip::Property::TAIL, true)
+ .Add(Tooltip::Property::POSITION, Tooltip::Position::HOVER_POINT)
+ .Add(Tooltip::Property::HOVER_POINT_OFFSET, Vector2(100.0f, 50.f))
+ .Add(Tooltip::Property::MOVEMENT_THRESHOLD, 50)
+ .Add(Tooltip::Property::DISAPPEAR_ON_MOVEMENT, true));
+
+ tet_infoline("Check if Property::MAP is returned");
+ Property::Value value = control.GetProperty(DevelControl::Property::TOOLTIP);
+ DALI_TEST_EQUALS(value.GetType(), Property::MAP, TEST_LOCATION);
+
+ tet_infoline("Ensure map is valid");
Property::Map* map = value.GetMap();
- DALI_TEST_CHECK( map );
+ DALI_TEST_CHECK(map);
- tet_infoline( "Check content" );
- Property::Value* contentValue = map->Find( Tooltip::Property::CONTENT );
- DALI_TEST_CHECK( contentValue );
+ tet_infoline("Check content");
+ Property::Value* contentValue = map->Find(Tooltip::Property::CONTENT);
+ DALI_TEST_CHECK(contentValue);
Property::Map* contentMap = contentValue->GetMap();
- DALI_TEST_CHECK( contentMap );
+ DALI_TEST_CHECK(contentMap);
- tet_infoline( "Check layout" );
- Property::Value* layoutValue = map->Find( Tooltip::Property::LAYOUT );
- DALI_TEST_CHECK( layoutValue );
- DALI_TEST_EQUALS( layoutValue->Get< Vector2 >(), Vector2( 1.0f, 2.0f ), TEST_LOCATION );
+ tet_infoline("Check layout");
+ Property::Value* layoutValue = map->Find(Tooltip::Property::LAYOUT);
+ DALI_TEST_CHECK(layoutValue);
+ DALI_TEST_EQUALS(layoutValue->Get<Vector2>(), Vector2(1.0f, 2.0f), TEST_LOCATION);
- tet_infoline( "Check wait time" );
- Property::Value* waitTimeValue = map->Find( Tooltip::Property::WAIT_TIME );
- DALI_TEST_CHECK( waitTimeValue );
- DALI_TEST_EQUALS( waitTimeValue->Get< float >(), 2.5f, TEST_LOCATION );
+ tet_infoline("Check wait time");
+ Property::Value* waitTimeValue = map->Find(Tooltip::Property::WAIT_TIME);
+ DALI_TEST_CHECK(waitTimeValue);
+ DALI_TEST_EQUALS(waitTimeValue->Get<float>(), 2.5f, TEST_LOCATION);
- tet_infoline( "Check background" );
- Property::Value* backgroundMapValue = map->Find( Tooltip::Property::BACKGROUND );
- DALI_TEST_CHECK( backgroundMapValue );
+ tet_infoline("Check background");
+ Property::Value* backgroundMapValue = map->Find(Tooltip::Property::BACKGROUND);
+ DALI_TEST_CHECK(backgroundMapValue);
Property::Map* backgroundMap = backgroundMapValue->GetMap();
- DALI_TEST_CHECK( backgroundMap );
- Property::Value* backgroundStringValue = backgroundMap->Find( Tooltip::Background::Property::VISUAL );
- DALI_TEST_CHECK( backgroundStringValue );
- DALI_TEST_EQUALS( backgroundStringValue->Get< std::string >(), "tooltip-background.png", TEST_LOCATION );
-
- tet_infoline( "Check Tail" );
- Property::Value* tailMapValue = map->Find( Tooltip::Property::TAIL );
- DALI_TEST_CHECK( tailMapValue );
+ DALI_TEST_CHECK(backgroundMap);
+ Property::Value* backgroundStringValue = backgroundMap->Find(Tooltip::Background::Property::VISUAL);
+ DALI_TEST_CHECK(backgroundStringValue);
+ DALI_TEST_EQUALS(backgroundStringValue->Get<std::string>(), "tooltip-background.png", TEST_LOCATION);
+
+ tet_infoline("Check Tail");
+ Property::Value* tailMapValue = map->Find(Tooltip::Property::TAIL);
+ DALI_TEST_CHECK(tailMapValue);
Property::Map* tailMap = tailMapValue->GetMap();
- DALI_TEST_CHECK( tailMap );
- Property::Value* tailVisibilityValue = tailMap->Find( Tooltip::Tail::Property::VISIBILITY );
- DALI_TEST_CHECK( tailVisibilityValue );
- DALI_TEST_EQUALS( tailVisibilityValue->Get< bool >(), true, TEST_LOCATION );
-
- tet_infoline( "Check position" );
- Property::Value* positionValue = map->Find( Tooltip::Property::POSITION );
- DALI_TEST_CHECK( positionValue );
- DALI_TEST_EQUALS( positionValue->Get< int >(), static_cast< int >( Tooltip::Position::HOVER_POINT ), TEST_LOCATION );
-
- tet_infoline( "Check hover point offset" );
- Property::Value* hoverPointOffsetValue = map->Find( Tooltip::Property::HOVER_POINT_OFFSET );
- DALI_TEST_CHECK( hoverPointOffsetValue );
- DALI_TEST_EQUALS( hoverPointOffsetValue->Get< Vector2 >(), Vector2( 100.0f, 50.f ), TEST_LOCATION );
-
- tet_infoline( "Check movement threshold" );
- Property::Value* movementThresholdValue = map->Find( Tooltip::Property::MOVEMENT_THRESHOLD );
- DALI_TEST_CHECK( movementThresholdValue );
- DALI_TEST_EQUALS( movementThresholdValue->Get< int >(), 50, TEST_LOCATION );
-
- tet_infoline( "Check disappear on movement" );
- Property::Value* disappearOnMovementValue = map->Find( Tooltip::Property::DISAPPEAR_ON_MOVEMENT );
- DALI_TEST_CHECK( disappearOnMovementValue );
- DALI_TEST_EQUALS( disappearOnMovementValue->Get< bool >(), true, TEST_LOCATION );
-
- tet_infoline( "We sent a text visual with TEXT property set, so ensure the hover signal has been connected to" );
- DALI_TEST_EQUALS( control.HoveredSignal().GetConnectionCount(), 1u, TEST_LOCATION );
+ DALI_TEST_CHECK(tailMap);
+ Property::Value* tailVisibilityValue = tailMap->Find(Tooltip::Tail::Property::VISIBILITY);
+ DALI_TEST_CHECK(tailVisibilityValue);
+ DALI_TEST_EQUALS(tailVisibilityValue->Get<bool>(), true, TEST_LOCATION);
+
+ tet_infoline("Check position");
+ Property::Value* positionValue = map->Find(Tooltip::Property::POSITION);
+ DALI_TEST_CHECK(positionValue);
+ DALI_TEST_EQUALS(positionValue->Get<int>(), static_cast<int>(Tooltip::Position::HOVER_POINT), TEST_LOCATION);
+
+ tet_infoline("Check hover point offset");
+ Property::Value* hoverPointOffsetValue = map->Find(Tooltip::Property::HOVER_POINT_OFFSET);
+ DALI_TEST_CHECK(hoverPointOffsetValue);
+ DALI_TEST_EQUALS(hoverPointOffsetValue->Get<Vector2>(), Vector2(100.0f, 50.f), TEST_LOCATION);
+
+ tet_infoline("Check movement threshold");
+ Property::Value* movementThresholdValue = map->Find(Tooltip::Property::MOVEMENT_THRESHOLD);
+ DALI_TEST_CHECK(movementThresholdValue);
+ DALI_TEST_EQUALS(movementThresholdValue->Get<int>(), 50, TEST_LOCATION);
+
+ tet_infoline("Check disappear on movement");
+ Property::Value* disappearOnMovementValue = map->Find(Tooltip::Property::DISAPPEAR_ON_MOVEMENT);
+ DALI_TEST_CHECK(disappearOnMovementValue);
+ DALI_TEST_EQUALS(disappearOnMovementValue->Get<bool>(), true, TEST_LOCATION);
+
+ tet_infoline("We sent a text visual with TEXT property set, so ensure the hover signal has been connected to");
+ DALI_TEST_EQUALS(control.HoveredSignal().GetConnectionCount(), 1u, TEST_LOCATION);
END_TEST;
}
int UtcDaliTooltipCreateWithBackgroundMap(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
Control control = Control::New();
- control.SetProperty( DevelControl::Property::TOOLTIP,
- Property::Map().Add( Tooltip::Property::CONTENT, "Hello TextVisual Test" )
- .Add( Tooltip::Property::BACKGROUND,
- Property::Map().Add( Tooltip::Background::Property::VISUAL, "tooltip-background.png" )
- .Add( Tooltip::Background::Property::BORDER, Rect< int >( 10, 20, 30, 40 ) ) )
- );
-
- tet_infoline( "Check if Property::MAP is returned" );
- Property::Value value = control.GetProperty( DevelControl::Property::TOOLTIP );
- DALI_TEST_EQUALS( value.GetType(), Property::MAP, TEST_LOCATION );
-
- tet_infoline( "Ensure map is valid" );
+ control.SetProperty(DevelControl::Property::TOOLTIP,
+ Property::Map().Add(Tooltip::Property::CONTENT, "Hello TextVisual Test").Add(Tooltip::Property::BACKGROUND, Property::Map().Add(Tooltip::Background::Property::VISUAL, "tooltip-background.png").Add(Tooltip::Background::Property::BORDER, Rect<int>(10, 20, 30, 40))));
+
+ tet_infoline("Check if Property::MAP is returned");
+ Property::Value value = control.GetProperty(DevelControl::Property::TOOLTIP);
+ DALI_TEST_EQUALS(value.GetType(), Property::MAP, TEST_LOCATION);
+
+ tet_infoline("Ensure map is valid");
Property::Map* map = value.GetMap();
- DALI_TEST_CHECK( map );
+ DALI_TEST_CHECK(map);
- tet_infoline( "Check background map" );
- Property::Value* backgroundMapValue = map->Find( Tooltip::Property::BACKGROUND );
- DALI_TEST_CHECK( backgroundMapValue );
+ tet_infoline("Check background map");
+ Property::Value* backgroundMapValue = map->Find(Tooltip::Property::BACKGROUND);
+ DALI_TEST_CHECK(backgroundMapValue);
Property::Map* backgroundMap = backgroundMapValue->GetMap();
- DALI_TEST_CHECK( backgroundMap );
+ DALI_TEST_CHECK(backgroundMap);
- tet_infoline( "Check visual" );
- Property::Value* backgroundStringValue = backgroundMap->Find( Tooltip::Background::Property::VISUAL );
- DALI_TEST_CHECK( backgroundStringValue );
- DALI_TEST_EQUALS( backgroundStringValue->Get< std::string >(), "tooltip-background.png", TEST_LOCATION );
+ tet_infoline("Check visual");
+ Property::Value* backgroundStringValue = backgroundMap->Find(Tooltip::Background::Property::VISUAL);
+ DALI_TEST_CHECK(backgroundStringValue);
+ DALI_TEST_EQUALS(backgroundStringValue->Get<std::string>(), "tooltip-background.png", TEST_LOCATION);
- tet_infoline( "Check border" );
- Property::Value* borderValue = backgroundMap->Find( Tooltip::Background::Property::BORDER );
- DALI_TEST_CHECK( borderValue );
- DALI_TEST_EQUALS( borderValue->Get< Rect< int > >(), Rect< int >( 10, 20, 30, 40 ), TEST_LOCATION );
+ tet_infoline("Check border");
+ Property::Value* borderValue = backgroundMap->Find(Tooltip::Background::Property::BORDER);
+ DALI_TEST_CHECK(borderValue);
+ DALI_TEST_EQUALS(borderValue->Get<Rect<int> >(), Rect<int>(10, 20, 30, 40), TEST_LOCATION);
END_TEST;
}
int UtcDaliTooltipCreateWithBackgroundMapVector4(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
Control control = Control::New();
- control.SetProperty( DevelControl::Property::TOOLTIP,
- Property::Map().Add( Tooltip::Property::CONTENT, "Hello TextVisual Test" )
- .Add( Tooltip::Property::BACKGROUND,
- Property::Map().Add( Tooltip::Background::Property::VISUAL, "tooltip-background.png" )
- .Add( Tooltip::Background::Property::BORDER, Vector4( 40.0f, 30.0f, 20.0f, 10.0f ) ) )
- );
-
- tet_infoline( "Check if Property::MAP is returned" );
- Property::Value value = control.GetProperty( DevelControl::Property::TOOLTIP );
- DALI_TEST_EQUALS( value.GetType(), Property::MAP, TEST_LOCATION );
-
- tet_infoline( "Ensure map is valid" );
+ control.SetProperty(DevelControl::Property::TOOLTIP,
+ Property::Map().Add(Tooltip::Property::CONTENT, "Hello TextVisual Test").Add(Tooltip::Property::BACKGROUND, Property::Map().Add(Tooltip::Background::Property::VISUAL, "tooltip-background.png").Add(Tooltip::Background::Property::BORDER, Vector4(40.0f, 30.0f, 20.0f, 10.0f))));
+
+ tet_infoline("Check if Property::MAP is returned");
+ Property::Value value = control.GetProperty(DevelControl::Property::TOOLTIP);
+ DALI_TEST_EQUALS(value.GetType(), Property::MAP, TEST_LOCATION);
+
+ tet_infoline("Ensure map is valid");
Property::Map* map = value.GetMap();
- DALI_TEST_CHECK( map );
+ DALI_TEST_CHECK(map);
- tet_infoline( "Check background map" );
- Property::Value* backgroundMapValue = map->Find( Tooltip::Property::BACKGROUND );
- DALI_TEST_CHECK( backgroundMapValue );
+ tet_infoline("Check background map");
+ Property::Value* backgroundMapValue = map->Find(Tooltip::Property::BACKGROUND);
+ DALI_TEST_CHECK(backgroundMapValue);
Property::Map* backgroundMap = backgroundMapValue->GetMap();
- DALI_TEST_CHECK( backgroundMap );
+ DALI_TEST_CHECK(backgroundMap);
- tet_infoline( "Check visual" );
- Property::Value* backgroundStringValue = backgroundMap->Find( Tooltip::Background::Property::VISUAL );
- DALI_TEST_CHECK( backgroundStringValue );
- DALI_TEST_EQUALS( backgroundStringValue->Get< std::string >(), "tooltip-background.png", TEST_LOCATION );
+ tet_infoline("Check visual");
+ Property::Value* backgroundStringValue = backgroundMap->Find(Tooltip::Background::Property::VISUAL);
+ DALI_TEST_CHECK(backgroundStringValue);
+ DALI_TEST_EQUALS(backgroundStringValue->Get<std::string>(), "tooltip-background.png", TEST_LOCATION);
- tet_infoline( "Check border" );
- Property::Value* borderValue = backgroundMap->Find( Tooltip::Background::Property::BORDER );
- DALI_TEST_CHECK( borderValue );
- DALI_TEST_EQUALS( borderValue->Get< Rect< int > >(), Rect< int >( 40, 30, 20, 10 ), TEST_LOCATION );
+ tet_infoline("Check border");
+ Property::Value* borderValue = backgroundMap->Find(Tooltip::Background::Property::BORDER);
+ DALI_TEST_CHECK(borderValue);
+ DALI_TEST_EQUALS(borderValue->Get<Rect<int> >(), Rect<int>(40, 30, 20, 10), TEST_LOCATION);
END_TEST;
}
int UtcDaliTooltipCreateWithTailMap(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
Control control = Control::New();
- control.SetProperty( DevelControl::Property::TOOLTIP,
- Property::Map().Add( Tooltip::Property::CONTENT, "Hello TextVisual Test" )
- .Add( Tooltip::Property::TAIL,
- Property::Map().Add( Tooltip::Tail::Property::VISIBILITY, true )
- .Add( Tooltip::Tail::Property::ABOVE_VISUAL, "above-visual.png" )
- .Add( Tooltip::Tail::Property::BELOW_VISUAL, "below-visual.png" ))
- );
-
- tet_infoline( "Check if Property::MAP is returned" );
- Property::Value value = control.GetProperty( DevelControl::Property::TOOLTIP );
- DALI_TEST_EQUALS( value.GetType(), Property::MAP, TEST_LOCATION );
-
- tet_infoline( "Ensure map is valid" );
+ control.SetProperty(DevelControl::Property::TOOLTIP,
+ Property::Map().Add(Tooltip::Property::CONTENT, "Hello TextVisual Test").Add(Tooltip::Property::TAIL, Property::Map().Add(Tooltip::Tail::Property::VISIBILITY, true).Add(Tooltip::Tail::Property::ABOVE_VISUAL, "above-visual.png").Add(Tooltip::Tail::Property::BELOW_VISUAL, "below-visual.png")));
+
+ tet_infoline("Check if Property::MAP is returned");
+ Property::Value value = control.GetProperty(DevelControl::Property::TOOLTIP);
+ DALI_TEST_EQUALS(value.GetType(), Property::MAP, TEST_LOCATION);
+
+ tet_infoline("Ensure map is valid");
Property::Map* map = value.GetMap();
- DALI_TEST_CHECK( map );
+ DALI_TEST_CHECK(map);
- tet_infoline( "Check Tail" );
- Property::Value* tailMapValue = map->Find( Tooltip::Property::TAIL );
- DALI_TEST_CHECK( tailMapValue );
+ tet_infoline("Check Tail");
+ Property::Value* tailMapValue = map->Find(Tooltip::Property::TAIL);
+ DALI_TEST_CHECK(tailMapValue);
Property::Map* tailMap = tailMapValue->GetMap();
- DALI_TEST_CHECK( tailMap );
+ DALI_TEST_CHECK(tailMap);
- tet_infoline( "Check visibility" );
- Property::Value* tailVisibilityValue = tailMap->Find( Tooltip::Tail::Property::VISIBILITY );
- DALI_TEST_CHECK( tailVisibilityValue );
- DALI_TEST_EQUALS( tailVisibilityValue->Get< bool >(), true, TEST_LOCATION );
+ tet_infoline("Check visibility");
+ Property::Value* tailVisibilityValue = tailMap->Find(Tooltip::Tail::Property::VISIBILITY);
+ DALI_TEST_CHECK(tailVisibilityValue);
+ DALI_TEST_EQUALS(tailVisibilityValue->Get<bool>(), true, TEST_LOCATION);
- tet_infoline( "Check above visual" );
- Property::Value* aboveVisualValue = tailMap->Find( Tooltip::Tail::Property::ABOVE_VISUAL );
- DALI_TEST_CHECK( aboveVisualValue );
- DALI_TEST_EQUALS( aboveVisualValue->Get< std::string >(), "above-visual.png", TEST_LOCATION );
+ tet_infoline("Check above visual");
+ Property::Value* aboveVisualValue = tailMap->Find(Tooltip::Tail::Property::ABOVE_VISUAL);
+ DALI_TEST_CHECK(aboveVisualValue);
+ DALI_TEST_EQUALS(aboveVisualValue->Get<std::string>(), "above-visual.png", TEST_LOCATION);
- tet_infoline( "Check below visual" );
- Property::Value* belowVisualValue = tailMap->Find( Tooltip::Tail::Property::BELOW_VISUAL );
- DALI_TEST_CHECK( belowVisualValue );
- DALI_TEST_EQUALS( belowVisualValue->Get< std::string >(), "below-visual.png", TEST_LOCATION );
+ tet_infoline("Check below visual");
+ Property::Value* belowVisualValue = tailMap->Find(Tooltip::Tail::Property::BELOW_VISUAL);
+ DALI_TEST_CHECK(belowVisualValue);
+ DALI_TEST_EQUALS(belowVisualValue->Get<std::string>(), "below-visual.png", TEST_LOCATION);
END_TEST;
}
int UtcDaliTooltipDisplay(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
Control control = Control::New();
- control.SetProperty( DevelControl::Property::TOOLTIP, "Test" );
- control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
- control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
+ control.SetProperty(DevelControl::Property::TOOLTIP, "Test");
+ control.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+ control.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ control.SetProperty(Actor::Property::SIZE, Vector2(100.f, 100.f));
Actor rootActor = application.GetScene().GetRootLayer();
- rootActor.Add( control );
+ rootActor.Add(control);
application.SendNotification();
application.Render();
int rootChildCount = rootActor.GetChildCount();
Vector2 centerPoint = application.GetScene().GetSize() * 0.5f;
- application.ProcessEvent( GenerateSingleHover( PointState::STARTED, centerPoint ) );
+ application.ProcessEvent(GenerateSingleHover(PointState::STARTED, centerPoint));
- Dali::Timer timer = Timer::New( 1u );
+ Dali::Timer timer = Timer::New(1u);
timer.MockEmitSignal();
application.SendNotification();
application.Render();
- tet_infoline( "Get number of actors on the Stage, they should have incremented by one" );
+ tet_infoline("Get number of actors on the Stage, they should have incremented by one");
++rootChildCount;
- DALI_TEST_EQUALS( rootActor.GetChildCount(), rootChildCount, TEST_LOCATION );
+ DALI_TEST_EQUALS(rootActor.GetChildCount(), rootChildCount, TEST_LOCATION);
- application.ProcessEvent( GenerateSingleHover( PointState::STATIONARY, centerPoint ) ); // Emit for code coverage, will have no effect
+ application.ProcessEvent(GenerateSingleHover(PointState::STATIONARY, centerPoint)); // Emit for code coverage, will have no effect
END_TEST;
}
int UtcDaliTooltipDisplayWithTail(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
Control control = Control::New();
- control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
- control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
- control.SetProperty( DevelControl::Property::TOOLTIP,
- Property::Map().Add( Tooltip::Property::CONTENT, "Test" )
- .Add( Tooltip::Property::TAIL,
- Property::Map().Add( Tooltip::Tail::Property::VISIBILITY, true )
- .Add( Tooltip::Tail::Property::ABOVE_VISUAL, "above-visual.png" )
- .Add( Tooltip::Tail::Property::BELOW_VISUAL, "below-visual.png" ))
- );
+ control.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+ control.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ control.SetProperty(Actor::Property::SIZE, Vector2(100.f, 100.f));
+ control.SetProperty(DevelControl::Property::TOOLTIP,
+ Property::Map().Add(Tooltip::Property::CONTENT, "Test").Add(Tooltip::Property::TAIL, Property::Map().Add(Tooltip::Tail::Property::VISIBILITY, true).Add(Tooltip::Tail::Property::ABOVE_VISUAL, "above-visual.png").Add(Tooltip::Tail::Property::BELOW_VISUAL, "below-visual.png")));
Actor rootActor = application.GetScene().GetRootLayer();
- rootActor.Add( control );
+ rootActor.Add(control);
application.SendNotification();
application.Render();
int rootChildCount = rootActor.GetChildCount();
Vector2 centerPoint = application.GetScene().GetSize() * 0.5f;
- application.ProcessEvent( GenerateSingleHover( PointState::STARTED, centerPoint ) );
+ application.ProcessEvent(GenerateSingleHover(PointState::STARTED, centerPoint));
- Dali::Timer timer = Timer::New( 1u );
+ Dali::Timer timer = Timer::New(1u);
timer.MockEmitSignal();
application.SendNotification();
application.Render();
- tet_infoline( "Get number of actors on the Stage, they should have incremented by one" );
+ tet_infoline("Get number of actors on the Stage, they should have incremented by one");
++rootChildCount;
- DALI_TEST_EQUALS( rootActor.GetChildCount(), rootChildCount, TEST_LOCATION );
+ DALI_TEST_EQUALS(rootActor.GetChildCount(), rootChildCount, TEST_LOCATION);
END_TEST;
}
int UtcDaliTooltipDisplayWithContentArray(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
Control control = Control::New();
- control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
- control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
- control.SetProperty( DevelControl::Property::TOOLTIP,
- Property::Map().Add( Tooltip::Property::CONTENT,
- Property::Array().Add( Property::Map().Add( Toolkit::Visual::Property::TYPE, Visual::IMAGE )
- .Add( ImageVisual::Property::URL, "dummy-url.png" ) )
- .Add( Property::Map().Add( Toolkit::Visual::Property::TYPE, Visual::TEXT )
- .Add( TextVisual::Property::TEXT, "Hello Array Test" ) ))
- .Add( Tooltip::Property::TAIL,
- Property::Map().Add( Tooltip::Tail::Property::VISIBILITY, true )
- .Add( Tooltip::Tail::Property::ABOVE_VISUAL, "above-visual.png" )
- .Add( Tooltip::Tail::Property::BELOW_VISUAL, "below-visual.png" ))
- );
+ control.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+ control.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ control.SetProperty(Actor::Property::SIZE, Vector2(100.f, 100.f));
+ control.SetProperty(DevelControl::Property::TOOLTIP,
+ Property::Map().Add(Tooltip::Property::CONTENT,
+ Property::Array().Add(Property::Map().Add(Toolkit::Visual::Property::TYPE, Visual::IMAGE).Add(ImageVisual::Property::URL, "dummy-url.png")).Add(Property::Map().Add(Toolkit::Visual::Property::TYPE, Visual::TEXT).Add(TextVisual::Property::TEXT, "Hello Array Test")))
+ .Add(Tooltip::Property::TAIL,
+ Property::Map().Add(Tooltip::Tail::Property::VISIBILITY, true).Add(Tooltip::Tail::Property::ABOVE_VISUAL, "above-visual.png").Add(Tooltip::Tail::Property::BELOW_VISUAL, "below-visual.png")));
Actor rootActor = application.GetScene().GetRootLayer();
- rootActor.Add( control );
+ rootActor.Add(control);
application.SendNotification();
application.Render();
int rootChildCount = rootActor.GetChildCount();
Vector2 centerPoint = application.GetScene().GetSize() * 0.5f;
- application.ProcessEvent( GenerateSingleHover( PointState::STARTED, centerPoint ) );
+ application.ProcessEvent(GenerateSingleHover(PointState::STARTED, centerPoint));
- Dali::Timer timer = Timer::New( 1u );
+ Dali::Timer timer = Timer::New(1u);
timer.MockEmitSignal();
application.SendNotification();
application.Render();
- tet_infoline( "Get number of actors on the Stage, they should have incremented by one" );
+ tet_infoline("Get number of actors on the Stage, they should have incremented by one");
++rootChildCount;
- DALI_TEST_EQUALS( rootActor.GetChildCount(), rootChildCount, TEST_LOCATION );
+ DALI_TEST_EQUALS(rootActor.GetChildCount(), rootChildCount, TEST_LOCATION);
END_TEST;
}
int UtcDaliTooltipDisplayBelow(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
Control control = Control::New();
- control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
- control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
- control.SetProperty( DevelControl::Property::TOOLTIP,
- Property::Map().Add( Tooltip::Property::CONTENT, "Test" )
- .Add( Tooltip::Property::POSITION, Tooltip::Position::BELOW )
- );
+ control.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+ control.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ control.SetProperty(Actor::Property::SIZE, Vector2(100.f, 100.f));
+ control.SetProperty(DevelControl::Property::TOOLTIP,
+ Property::Map().Add(Tooltip::Property::CONTENT, "Test").Add(Tooltip::Property::POSITION, Tooltip::Position::BELOW));
Actor rootActor = application.GetScene().GetRootLayer();
- rootActor.Add( control );
+ rootActor.Add(control);
application.SendNotification();
application.Render();
Vector2 centerPoint = application.GetScene().GetSize() * 0.5f;
- application.ProcessEvent( GenerateSingleHover( PointState::STARTED, centerPoint ) );
+ application.ProcessEvent(GenerateSingleHover(PointState::STARTED, centerPoint));
- Dali::Timer timer = Timer::New( 1u );
+ Dali::Timer timer = Timer::New(1u);
timer.MockEmitSignal();
application.SendNotification();
application.Render();
- Actor tooltip = rootActor.GetChildAt( rootActor.GetChildCount() - 1 ); // Last actor added will be our tooltip
+ Actor tooltip = rootActor.GetChildAt(rootActor.GetChildCount() - 1); // Last actor added will be our tooltip
- tet_infoline( "Ensure tooltip is below control" );
- DALI_TEST_CHECK( ( control.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).y + 50.0f /* Half Size */) < tooltip.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).y );
+ tet_infoline("Ensure tooltip is below control");
+ DALI_TEST_CHECK((control.GetCurrentProperty<Vector3>(Actor::Property::WORLD_POSITION).y + 50.0f /* Half Size */) < tooltip.GetCurrentProperty<Vector3>(Actor::Property::WORLD_POSITION).y);
END_TEST;
}
int UtcDaliTooltipDisplayAbove(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
Control control = Control::New();
- control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
- control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
- control.SetProperty( DevelControl::Property::TOOLTIP,
- Property::Map().Add( Tooltip::Property::CONTENT, "Test" )
- .Add( Tooltip::Property::POSITION, Tooltip::Position::ABOVE )
- );
+ control.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+ control.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ control.SetProperty(Actor::Property::SIZE, Vector2(100.f, 100.f));
+ control.SetProperty(DevelControl::Property::TOOLTIP,
+ Property::Map().Add(Tooltip::Property::CONTENT, "Test").Add(Tooltip::Property::POSITION, Tooltip::Position::ABOVE));
Actor rootActor = application.GetScene().GetRootLayer();
- rootActor.Add( control );
+ rootActor.Add(control);
application.SendNotification();
application.Render();
Vector2 centerPoint = application.GetScene().GetSize() * 0.5f;
- application.ProcessEvent( GenerateSingleHover( PointState::STARTED, centerPoint ) );
+ application.ProcessEvent(GenerateSingleHover(PointState::STARTED, centerPoint));
- Dali::Timer timer = Timer::New( 1u );
+ Dali::Timer timer = Timer::New(1u);
timer.MockEmitSignal();
application.SendNotification();
application.Render();
- Actor tooltip = rootActor.GetChildAt( rootActor.GetChildCount() - 1 ); // Last actor added will be our tooltip
+ Actor tooltip = rootActor.GetChildAt(rootActor.GetChildCount() - 1); // Last actor added will be our tooltip
- tet_infoline( "Ensure tooltip is above control" );
- DALI_TEST_CHECK( ( control.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).y - 50.0f /* Half Size */) >= ( tooltip.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).y + 0.5f * tooltip.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).height ) );
+ tet_infoline("Ensure tooltip is above control");
+ DALI_TEST_CHECK((control.GetCurrentProperty<Vector3>(Actor::Property::WORLD_POSITION).y - 50.0f /* Half Size */) >= (tooltip.GetCurrentProperty<Vector3>(Actor::Property::WORLD_POSITION).y + 0.5f * tooltip.GetCurrentProperty<Vector3>(Actor::Property::SIZE).height));
END_TEST;
}
int UtcDaliTooltipDisplayAtHoverPoint(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
Control control = Control::New();
- control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
- control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
- control.SetProperty( DevelControl::Property::TOOLTIP,
- Property::Map().Add( Tooltip::Property::CONTENT, "Test" )
- .Add( Tooltip::Property::POSITION, Tooltip::Position::HOVER_POINT )
- );
+ control.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+ control.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ control.SetProperty(Actor::Property::SIZE, Vector2(100.f, 100.f));
+ control.SetProperty(DevelControl::Property::TOOLTIP,
+ Property::Map().Add(Tooltip::Property::CONTENT, "Test").Add(Tooltip::Property::POSITION, Tooltip::Position::HOVER_POINT));
Actor rootActor = application.GetScene().GetRootLayer();
- rootActor.Add( control );
+ rootActor.Add(control);
application.SendNotification();
application.Render();
- const Vector2 stageSize = application.GetScene().GetSize();
- Vector2 hoverPoint = stageSize * 0.5f;
+ const Vector2 stageSize = application.GetScene().GetSize();
+ Vector2 hoverPoint = stageSize * 0.5f;
hoverPoint.x -= 10.0f;
hoverPoint.y -= 10.0f;
- application.ProcessEvent( GenerateSingleHover( PointState::STARTED, hoverPoint ) );
+ application.ProcessEvent(GenerateSingleHover(PointState::STARTED, hoverPoint));
- Dali::Timer timer = Timer::New( 1u );
+ Dali::Timer timer = Timer::New(1u);
timer.MockEmitSignal();
application.SendNotification();
application.Render();
- Actor tooltip = rootActor.GetChildAt( rootActor.GetChildCount() - 1 ); // Last actor added will be our tooltip
+ Actor tooltip = rootActor.GetChildAt(rootActor.GetChildCount() - 1); // Last actor added will be our tooltip
- tet_infoline( "Ensure tooltip is below and to the right of control" );
- DALI_TEST_CHECK( ( hoverPoint.y - stageSize.height * 0.5f ) < tooltip.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).y );
- DALI_TEST_CHECK( ( hoverPoint.x - stageSize.width * 0.5f ) < tooltip.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).x );
+ tet_infoline("Ensure tooltip is below and to the right of control");
+ DALI_TEST_CHECK((hoverPoint.y - stageSize.height * 0.5f) < tooltip.GetCurrentProperty<Vector3>(Actor::Property::WORLD_POSITION).y);
+ DALI_TEST_CHECK((hoverPoint.x - stageSize.width * 0.5f) < tooltip.GetCurrentProperty<Vector3>(Actor::Property::WORLD_POSITION).x);
END_TEST;
}
int UtcDaliTooltipExceedThreshold(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
Control control = Control::New();
- control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
- control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
- control.SetProperty( DevelControl::Property::TOOLTIP,
- Property::Map().Add( Tooltip::Property::CONTENT, "Test" )
- .Add( Tooltip::Property::MOVEMENT_THRESHOLD, 5 )
- );
+ control.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+ control.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ control.SetProperty(Actor::Property::SIZE, Vector2(100.f, 100.f));
+ control.SetProperty(DevelControl::Property::TOOLTIP,
+ Property::Map().Add(Tooltip::Property::CONTENT, "Test").Add(Tooltip::Property::MOVEMENT_THRESHOLD, 5));
Actor rootActor = application.GetScene().GetRootLayer();
- rootActor.Add( control );
+ rootActor.Add(control);
application.SendNotification();
application.Render();
int rootChildCount = rootActor.GetChildCount();
- tet_infoline( "Start hover" );
+ tet_infoline("Start hover");
Vector2 hoverPoint = application.GetScene().GetSize() * 0.5f;
- application.ProcessEvent( GenerateSingleHover( PointState::STARTED, hoverPoint ) );
+ application.ProcessEvent(GenerateSingleHover(PointState::STARTED, hoverPoint));
application.SendNotification();
application.Render();
- tet_infoline( "Emit a value which exceeds threshold, timer should start again" );
+ tet_infoline("Emit a value which exceeds threshold, timer should start again");
hoverPoint.x += 10.0f;
- application.ProcessEvent( GenerateSingleHover( PointState::MOTION, hoverPoint ) );
+ application.ProcessEvent(GenerateSingleHover(PointState::MOTION, hoverPoint));
application.SendNotification();
application.Render();
- tet_infoline( "Emit Timer signal - timeout at new point which is still within bounds" );
- Dali::Timer timer = Timer::New( 1u );
+ tet_infoline("Emit Timer signal - timeout at new point which is still within bounds");
+ Dali::Timer timer = Timer::New(1u);
timer.MockEmitSignal();
application.SendNotification();
application.Render();
- tet_infoline( "Get number of actors on the Stage, they should have incremented by one" );
+ tet_infoline("Get number of actors on the Stage, they should have incremented by one");
++rootChildCount;
- DALI_TEST_EQUALS( rootActor.GetChildCount(), rootChildCount, TEST_LOCATION );
+ DALI_TEST_EQUALS(rootActor.GetChildCount(), rootChildCount, TEST_LOCATION);
END_TEST;
}
int UtcDaliTooltipGoOutOfBounds(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
Control control = Control::New();
- control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
- control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
- control.SetProperty( DevelControl::Property::TOOLTIP, "Test" );
+ control.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+ control.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ control.SetProperty(Actor::Property::SIZE, Vector2(100.f, 100.f));
+ control.SetProperty(DevelControl::Property::TOOLTIP, "Test");
Actor rootActor = application.GetScene().GetRootLayer();
- rootActor.Add( control );
+ rootActor.Add(control);
application.SendNotification();
application.Render();
int rootChildCount = rootActor.GetChildCount();
- tet_infoline( "Start hover" );
+ tet_infoline("Start hover");
Vector2 hoverPoint = application.GetScene().GetSize() * 0.5f;
- application.ProcessEvent( GenerateSingleHover( PointState::STARTED, hoverPoint ) );
+ application.ProcessEvent(GenerateSingleHover(PointState::STARTED, hoverPoint));
application.SendNotification();
application.Render();
- tet_infoline( "Emit a value which goes out of bounds" );
+ tet_infoline("Emit a value which goes out of bounds");
hoverPoint.x += 100.0f;
- application.ProcessEvent( GenerateSingleHover( PointState::MOTION, hoverPoint ) );
+ application.ProcessEvent(GenerateSingleHover(PointState::MOTION, hoverPoint));
application.SendNotification();
application.Render();
- tet_infoline( "Emit Timer signal - nothing should happen" );
- Dali::Timer timer = Timer::New( 1u );
+ tet_infoline("Emit Timer signal - nothing should happen");
+ Dali::Timer timer = Timer::New(1u);
timer.MockEmitSignal();
application.SendNotification();
application.Render();
- tet_infoline( "Get number of actors on the Stage, they should be the same as before" );
- DALI_TEST_EQUALS( rootActor.GetChildCount(), rootChildCount, TEST_LOCATION );
+ tet_infoline("Get number of actors on the Stage, they should be the same as before");
+ DALI_TEST_EQUALS(rootActor.GetChildCount(), rootChildCount, TEST_LOCATION);
END_TEST;
}
int UtcDaliTooltipHideTooltipWhenOutOfBounds(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
Control control = Control::New();
- control.SetProperty( DevelControl::Property::TOOLTIP, "Test" );
- control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
- control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
+ control.SetProperty(DevelControl::Property::TOOLTIP, "Test");
+ control.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+ control.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ control.SetProperty(Actor::Property::SIZE, Vector2(100.f, 100.f));
Actor rootActor = application.GetScene().GetRootLayer();
- rootActor.Add( control );
+ rootActor.Add(control);
application.SendNotification();
application.Render();
int rootChildCount = rootActor.GetChildCount();
Vector2 hoverPoint = application.GetScene().GetSize() * 0.5f;
- application.ProcessEvent( GenerateSingleHover( PointState::STARTED, hoverPoint ) );
+ application.ProcessEvent(GenerateSingleHover(PointState::STARTED, hoverPoint));
- Dali::Timer timer = Timer::New( 1u );
+ Dali::Timer timer = Timer::New(1u);
timer.MockEmitSignal();
application.SendNotification();
application.Render();
- tet_infoline( "Get number of actors on the Stage, they should have incremented by one" );
+ tet_infoline("Get number of actors on the Stage, they should have incremented by one");
++rootChildCount;
- DALI_TEST_EQUALS( rootActor.GetChildCount(), rootChildCount, TEST_LOCATION );
+ DALI_TEST_EQUALS(rootActor.GetChildCount(), rootChildCount, TEST_LOCATION);
hoverPoint.x += 100.0f;
- application.ProcessEvent( GenerateSingleHover( PointState::MOTION, hoverPoint ) );
+ application.ProcessEvent(GenerateSingleHover(PointState::MOTION, hoverPoint));
application.SendNotification();
application.Render();
- tet_infoline( "Get number of actors on the Stage, they should be back to what was there before the tooltip was shown" );
+ tet_infoline("Get number of actors on the Stage, they should be back to what was there before the tooltip was shown");
--rootChildCount;
- DALI_TEST_EQUALS( rootActor.GetChildCount(), rootChildCount, TEST_LOCATION );
+ DALI_TEST_EQUALS(rootActor.GetChildCount(), rootChildCount, TEST_LOCATION);
END_TEST;
}
int UtcDaliTooltipHideTooltipWhenSetToDisapperOnMovement(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
Control control = Control::New();
- control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
- control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
- control.SetProperty( DevelControl::Property::TOOLTIP,
- Property::Map().Add( Tooltip::Property::CONTENT, "Test" )
- .Add( Tooltip::Property::DISAPPEAR_ON_MOVEMENT, true )
- .Add( Tooltip::Property::MOVEMENT_THRESHOLD, 5 )
- );
+ control.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+ control.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ control.SetProperty(Actor::Property::SIZE, Vector2(100.f, 100.f));
+ control.SetProperty(DevelControl::Property::TOOLTIP,
+ Property::Map().Add(Tooltip::Property::CONTENT, "Test").Add(Tooltip::Property::DISAPPEAR_ON_MOVEMENT, true).Add(Tooltip::Property::MOVEMENT_THRESHOLD, 5));
Actor rootActor = application.GetScene().GetRootLayer();
- rootActor.Add( control );
+ rootActor.Add(control);
application.SendNotification();
application.Render();
int rootChildCount = rootActor.GetChildCount();
Vector2 hoverPoint = application.GetScene().GetSize() * 0.5f;
- application.ProcessEvent( GenerateSingleHover( PointState::STARTED, hoverPoint ) );
+ application.ProcessEvent(GenerateSingleHover(PointState::STARTED, hoverPoint));
- Dali::Timer timer = Timer::New( 1u );
+ Dali::Timer timer = Timer::New(1u);
timer.MockEmitSignal();
application.SendNotification();
application.Render();
- tet_infoline( "Get number of actors on the Stage, they should have incremented by one" );
+ tet_infoline("Get number of actors on the Stage, they should have incremented by one");
++rootChildCount;
- DALI_TEST_EQUALS( rootActor.GetChildCount(), rootChildCount, TEST_LOCATION );
+ DALI_TEST_EQUALS(rootActor.GetChildCount(), rootChildCount, TEST_LOCATION);
hoverPoint.x += 10.0f; // Stay within bounds but exceed threshold
- application.ProcessEvent( GenerateSingleHover( PointState::MOTION, hoverPoint ) );
+ application.ProcessEvent(GenerateSingleHover(PointState::MOTION, hoverPoint));
application.SendNotification();
application.Render();
- tet_infoline( "Get number of actors on the Stage, they should be back to what was there before the tooltip was shown" );
+ tet_infoline("Get number of actors on the Stage, they should be back to what was there before the tooltip was shown");
--rootChildCount;
- DALI_TEST_EQUALS( rootActor.GetChildCount(), rootChildCount, TEST_LOCATION );
+ DALI_TEST_EQUALS(rootActor.GetChildCount(), rootChildCount, TEST_LOCATION);
END_TEST;
}
int UtcDaliTooltipChangeContent(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
Control control = Control::New();
- control.SetProperty( DevelControl::Property::TOOLTIP, "Test" );
- control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
- control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- control.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
+ control.SetProperty(DevelControl::Property::TOOLTIP, "Test");
+ control.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+ control.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ control.SetProperty(Actor::Property::SIZE, Vector2(100.f, 100.f));
Actor rootActor = application.GetScene().GetRootLayer();
- rootActor.Add( control );
+ rootActor.Add(control);
application.SendNotification();
application.Render();
int rootChildCount = rootActor.GetChildCount();
Vector2 centerPoint = application.GetScene().GetSize() * 0.5f;
- application.ProcessEvent( GenerateSingleHover( PointState::STARTED, centerPoint ) );
+ application.ProcessEvent(GenerateSingleHover(PointState::STARTED, centerPoint));
- tet_infoline( "Change content while timer is running and ensure it matches the new value" );
- control.SetProperty( DevelControl::Property::TOOLTIP, "Second Value" );
+ tet_infoline("Change content while timer is running and ensure it matches the new value");
+ control.SetProperty(DevelControl::Property::TOOLTIP, "Second Value");
- Property::Value value = control.GetProperty( DevelControl::Property::TOOLTIP );
- DALI_TEST_EQUALS( value.GetType(), Property::MAP, TEST_LOCATION );
+ Property::Value value = control.GetProperty(DevelControl::Property::TOOLTIP);
+ DALI_TEST_EQUALS(value.GetType(), Property::MAP, TEST_LOCATION);
Property::Map* map = value.GetMap();
- DALI_TEST_CHECK( map );
- Property::Value* contentValue = map->Find( Tooltip::Property::CONTENT );
- DALI_TEST_CHECK( contentValue );
+ DALI_TEST_CHECK(map);
+ Property::Value* contentValue = map->Find(Tooltip::Property::CONTENT);
+ DALI_TEST_CHECK(contentValue);
Property::Map* contentMap = contentValue->GetMap();
- DALI_TEST_CHECK( contentMap );
- Property::Value* textStringValue = contentMap->Find( TextVisual::Property::TEXT );
- DALI_TEST_CHECK( textStringValue );
- DALI_TEST_EQUALS( "Second Value", textStringValue->Get< std::string >(), TEST_LOCATION );
+ DALI_TEST_CHECK(contentMap);
+ Property::Value* textStringValue = contentMap->Find(TextVisual::Property::TEXT);
+ DALI_TEST_CHECK(textStringValue);
+ DALI_TEST_EQUALS("Second Value", textStringValue->Get<std::string>(), TEST_LOCATION);
- tet_infoline( "Emit signal, nothing should happen as everything has been reset" );
- Dali::Timer timer = Timer::New( 1u );
+ tet_infoline("Emit signal, nothing should happen as everything has been reset");
+ Dali::Timer timer = Timer::New(1u);
timer.MockEmitSignal();
application.SendNotification();
application.Render();
- tet_infoline( "Get number of actors on the Stage, there should NOT be any new actors" );
- DALI_TEST_EQUALS( rootActor.GetChildCount(), rootChildCount, TEST_LOCATION );
+ tet_infoline("Get number of actors on the Stage, there should NOT be any new actors");
+ DALI_TEST_EQUALS(rootActor.GetChildCount(), rootChildCount, TEST_LOCATION);
- tet_infoline( "More movement at same point, and emit signal, we should get the tooltip" );
- application.ProcessEvent( GenerateSingleHover( PointState::MOTION, centerPoint ) );
+ tet_infoline("More movement at same point, and emit signal, we should get the tooltip");
+ application.ProcessEvent(GenerateSingleHover(PointState::MOTION, centerPoint));
timer.MockEmitSignal();
application.SendNotification();
application.Render();
- tet_infoline( "Get number of actors on the Stage, they should have incremented by one" );
+ tet_infoline("Get number of actors on the Stage, they should have incremented by one");
++rootChildCount;
- DALI_TEST_EQUALS( rootActor.GetChildCount(), rootChildCount, TEST_LOCATION );
+ DALI_TEST_EQUALS(rootActor.GetChildCount(), rootChildCount, TEST_LOCATION);
- tet_infoline( "Change content while tooltip is showing, current one should be removed from the stage and ensure it matches new value" );
- control.SetProperty( DevelControl::Property::TOOLTIP, "Third Value" );
+ tet_infoline("Change content while tooltip is showing, current one should be removed from the stage and ensure it matches new value");
+ control.SetProperty(DevelControl::Property::TOOLTIP, "Third Value");
- value = control.GetProperty( DevelControl::Property::TOOLTIP );
- DALI_TEST_EQUALS( value.GetType(), Property::MAP, TEST_LOCATION );
+ value = control.GetProperty(DevelControl::Property::TOOLTIP);
+ DALI_TEST_EQUALS(value.GetType(), Property::MAP, TEST_LOCATION);
map = value.GetMap();
- DALI_TEST_CHECK( map );
- contentValue = map->Find( Tooltip::Property::CONTENT );
- DALI_TEST_CHECK( contentValue );
+ DALI_TEST_CHECK(map);
+ contentValue = map->Find(Tooltip::Property::CONTENT);
+ DALI_TEST_CHECK(contentValue);
contentMap = contentValue->GetMap();
- DALI_TEST_CHECK( contentMap );
- textStringValue = contentMap->Find( TextVisual::Property::TEXT );
- DALI_TEST_CHECK( textStringValue );
- DALI_TEST_EQUALS( "Third Value", textStringValue->Get< std::string >(), TEST_LOCATION );
+ DALI_TEST_CHECK(contentMap);
+ textStringValue = contentMap->Find(TextVisual::Property::TEXT);
+ DALI_TEST_CHECK(textStringValue);
+ DALI_TEST_EQUALS("Third Value", textStringValue->Get<std::string>(), TEST_LOCATION);
- tet_infoline( "Emit signal, nothing should happen as everything has been reset" );
+ tet_infoline("Emit signal, nothing should happen as everything has been reset");
timer.MockEmitSignal();
application.SendNotification();
application.Render();
- tet_infoline( "Get number of actors on the Stage, there should be one less actor on the stage" );
+ tet_infoline("Get number of actors on the Stage, there should be one less actor on the stage");
--rootChildCount;
- DALI_TEST_EQUALS( rootActor.GetChildCount(), rootChildCount, TEST_LOCATION );
+ DALI_TEST_EQUALS(rootActor.GetChildCount(), rootChildCount, TEST_LOCATION);
END_TEST;
}
int UtcDaliTooltipEnsureRemainsOnStage1(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
Vector2 stageSize = application.GetScene().GetSize();
- tet_infoline( "Create a control and place it at the bottom of the screen, setting the tooltip to appear below" );
+ tet_infoline("Create a control and place it at the bottom of the screen, setting the tooltip to appear below");
Control control = Control::New();
- control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
- control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
- control.SetProperty( Actor::Property::SIZE, stageSize );
- control.SetProperty( DevelControl::Property::TOOLTIP,
- Property::Map().Add( Tooltip::Property::CONTENT, "Test" )
- .Add( Tooltip::Property::TAIL,
- Property::Map().Add( Tooltip::Tail::Property::VISIBILITY, true )
- .Add( Tooltip::Tail::Property::ABOVE_VISUAL, "above-visual.png" )
- .Add( Tooltip::Tail::Property::BELOW_VISUAL, "below-visual.png" ) )
- .Add( Tooltip::Property::POSITION, Tooltip::Position::BELOW )
- );
+ control.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER);
+ control.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER);
+ control.SetProperty(Actor::Property::SIZE, stageSize);
+ control.SetProperty(DevelControl::Property::TOOLTIP,
+ Property::Map().Add(Tooltip::Property::CONTENT, "Test").Add(Tooltip::Property::TAIL, Property::Map().Add(Tooltip::Tail::Property::VISIBILITY, true).Add(Tooltip::Tail::Property::ABOVE_VISUAL, "above-visual.png").Add(Tooltip::Tail::Property::BELOW_VISUAL, "below-visual.png")).Add(Tooltip::Property::POSITION, Tooltip::Position::BELOW));
Actor rootActor = application.GetScene().GetRootLayer();
- rootActor.Add( control );
+ rootActor.Add(control);
application.SendNotification();
application.Render();
Vector2 centerPoint = stageSize * 0.5f;
- application.ProcessEvent( GenerateSingleHover( PointState::STARTED, centerPoint ) );
+ application.ProcessEvent(GenerateSingleHover(PointState::STARTED, centerPoint));
- Dali::Timer timer = Timer::New( 1u );
+ Dali::Timer timer = Timer::New(1u);
timer.MockEmitSignal();
application.SendNotification();
application.Render();
- tet_infoline( "Ensure tooltip is still on the screen" );
- Actor tooltip = rootActor.GetChildAt( rootActor.GetChildCount() - 1 ); // Last actor added will be our tooltip
- DALI_TEST_CHECK( ( tooltip.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).y + tooltip.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).height * 0.5f ) <= centerPoint.height );
+ tet_infoline("Ensure tooltip is still on the screen");
+ Actor tooltip = rootActor.GetChildAt(rootActor.GetChildCount() - 1); // Last actor added will be our tooltip
+ DALI_TEST_CHECK((tooltip.GetCurrentProperty<Vector3>(Actor::Property::WORLD_POSITION).y + tooltip.GetCurrentProperty<Vector3>(Actor::Property::SIZE).height * 0.5f) <= centerPoint.height);
END_TEST;
}
int UtcDaliTooltipEnsureRemainsOnStage2(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
Vector2 stageSize = application.GetScene().GetSize();
- tet_infoline( "Create a control and place it at the top of the screen, setting the tooltip to appear above" );
+ tet_infoline("Create a control and place it at the top of the screen, setting the tooltip to appear above");
Control control = Control::New();
- control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
- control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
- control.SetProperty( Actor::Property::SIZE, stageSize );
- control.SetProperty( DevelControl::Property::TOOLTIP,
- Property::Map().Add( Tooltip::Property::CONTENT, "Test" )
- .Add( Tooltip::Property::TAIL,
- Property::Map().Add( Tooltip::Tail::Property::VISIBILITY, true )
- .Add( Tooltip::Tail::Property::ABOVE_VISUAL, "above-visual.png" )
- .Add( Tooltip::Tail::Property::BELOW_VISUAL, "below-visual.png" ) )
- .Add( Tooltip::Property::POSITION, Tooltip::Position::ABOVE )
- );
+ control.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER);
+ control.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER);
+ control.SetProperty(Actor::Property::SIZE, stageSize);
+ control.SetProperty(DevelControl::Property::TOOLTIP,
+ Property::Map().Add(Tooltip::Property::CONTENT, "Test").Add(Tooltip::Property::TAIL, Property::Map().Add(Tooltip::Tail::Property::VISIBILITY, true).Add(Tooltip::Tail::Property::ABOVE_VISUAL, "above-visual.png").Add(Tooltip::Tail::Property::BELOW_VISUAL, "below-visual.png")).Add(Tooltip::Property::POSITION, Tooltip::Position::ABOVE));
Actor rootActor = application.GetScene().GetRootLayer();
- rootActor.Add( control );
+ rootActor.Add(control);
application.SendNotification();
application.Render();
Vector2 centerPoint = stageSize * 0.5f;
- application.ProcessEvent( GenerateSingleHover( PointState::STARTED, centerPoint ) );
+ application.ProcessEvent(GenerateSingleHover(PointState::STARTED, centerPoint));
- Dali::Timer timer = Timer::New( 1u );
+ Dali::Timer timer = Timer::New(1u);
timer.MockEmitSignal();
application.SendNotification();
application.Render();
- tet_infoline( "Ensure tooltip is still on the screen" );
- Actor tooltip = rootActor.GetChildAt( rootActor.GetChildCount() - 1 ); // Last actor added will be our tooltip
- DALI_TEST_CHECK( ( tooltip.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).y - tooltip.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).height * 0.5f ) >= -centerPoint.height );
+ tet_infoline("Ensure tooltip is still on the screen");
+ Actor tooltip = rootActor.GetChildAt(rootActor.GetChildCount() - 1); // Last actor added will be our tooltip
+ DALI_TEST_CHECK((tooltip.GetCurrentProperty<Vector3>(Actor::Property::WORLD_POSITION).y - tooltip.GetCurrentProperty<Vector3>(Actor::Property::SIZE).height * 0.5f) >= -centerPoint.height);
END_TEST;
}
int UtcDaliTooltipEnsureRemainsOnStage3(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
- Vector2 stageSize = application.GetScene().GetSize();
+ Vector2 stageSize = application.GetScene().GetSize();
Vector2 centerPoint = stageSize * 0.5f;
- tet_infoline( "Create a control and adjust it's position so that the tooltip will attempt to appear to the left of the screen" );
+ tet_infoline("Create a control and adjust it's position so that the tooltip will attempt to appear to the left of the screen");
Control control = Control::New();
- control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
- control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
- control.SetProperty( Actor::Property::SIZE, stageSize );
- control.SetProperty( DevelControl::Property::TOOLTIP,
- Property::Map().Add( Tooltip::Property::CONTENT, "Test" )
- .Add( Tooltip::Property::TAIL,
- Property::Map().Add( Tooltip::Tail::Property::VISIBILITY, true )
- .Add( Tooltip::Tail::Property::ABOVE_VISUAL, "above-visual.png" )
- .Add( Tooltip::Tail::Property::BELOW_VISUAL, "below-visual.png" ) )
- .Add( Tooltip::Property::POSITION, Tooltip::Position::BELOW )
- );
- control.SetProperty( Actor::Property::POSITION_X, -centerPoint.x );
+ control.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER);
+ control.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER);
+ control.SetProperty(Actor::Property::SIZE, stageSize);
+ control.SetProperty(DevelControl::Property::TOOLTIP,
+ Property::Map().Add(Tooltip::Property::CONTENT, "Test").Add(Tooltip::Property::TAIL, Property::Map().Add(Tooltip::Tail::Property::VISIBILITY, true).Add(Tooltip::Tail::Property::ABOVE_VISUAL, "above-visual.png").Add(Tooltip::Tail::Property::BELOW_VISUAL, "below-visual.png")).Add(Tooltip::Property::POSITION, Tooltip::Position::BELOW));
+ control.SetProperty(Actor::Property::POSITION_X, -centerPoint.x);
Actor rootActor = application.GetScene().GetRootLayer();
- rootActor.Add( control );
+ rootActor.Add(control);
application.SendNotification();
application.Render();
- Vector2 hoverPoint( centerPoint );
+ Vector2 hoverPoint(centerPoint);
hoverPoint.x = 1.0f;
- application.ProcessEvent( GenerateSingleHover( PointState::STARTED, centerPoint ) );
+ application.ProcessEvent(GenerateSingleHover(PointState::STARTED, centerPoint));
- Dali::Timer timer = Timer::New( 1u );
+ Dali::Timer timer = Timer::New(1u);
timer.MockEmitSignal();
application.SendNotification();
application.Render();
- tet_infoline( "Ensure tooltip is still on the screen" );
- Actor tooltip = rootActor.GetChildAt( rootActor.GetChildCount() - 1 ); // Last actor added will be our tooltip
- DALI_TEST_CHECK( ( tooltip.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).x - tooltip.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).width * 0.5f ) >= -centerPoint.width );
+ tet_infoline("Ensure tooltip is still on the screen");
+ Actor tooltip = rootActor.GetChildAt(rootActor.GetChildCount() - 1); // Last actor added will be our tooltip
+ DALI_TEST_CHECK((tooltip.GetCurrentProperty<Vector3>(Actor::Property::WORLD_POSITION).x - tooltip.GetCurrentProperty<Vector3>(Actor::Property::SIZE).width * 0.5f) >= -centerPoint.width);
END_TEST;
}
int UtcDaliTooltipEnsureRemainsOnStage4(void)
{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
+ ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
- Vector2 stageSize = application.GetScene().GetSize();
+ Vector2 stageSize = application.GetScene().GetSize();
Vector2 centerPoint = stageSize * 0.5f;
- tet_infoline( "Create a control and adjust it's position so that the tooltip will attempt to appear to the right of the screen" );
+ tet_infoline("Create a control and adjust it's position so that the tooltip will attempt to appear to the right of the screen");
Control control = Control::New();
- control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
- control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
- control.SetProperty( Actor::Property::SIZE, stageSize );
- control.SetProperty( DevelControl::Property::TOOLTIP,
- Property::Map().Add( Tooltip::Property::CONTENT, "Test" )
- .Add( Tooltip::Property::TAIL,
- Property::Map().Add( Tooltip::Tail::Property::VISIBILITY, true )
- .Add( Tooltip::Tail::Property::ABOVE_VISUAL, "above-visual.png" )
- .Add( Tooltip::Tail::Property::BELOW_VISUAL, "below-visual.png" ) )
- .Add( Tooltip::Property::POSITION, Tooltip::Position::BELOW )
- );
- control.SetProperty( Actor::Property::POSITION_X, centerPoint.x );
+ control.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER);
+ control.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER);
+ control.SetProperty(Actor::Property::SIZE, stageSize);
+ control.SetProperty(DevelControl::Property::TOOLTIP,
+ Property::Map().Add(Tooltip::Property::CONTENT, "Test").Add(Tooltip::Property::TAIL, Property::Map().Add(Tooltip::Tail::Property::VISIBILITY, true).Add(Tooltip::Tail::Property::ABOVE_VISUAL, "above-visual.png").Add(Tooltip::Tail::Property::BELOW_VISUAL, "below-visual.png")).Add(Tooltip::Property::POSITION, Tooltip::Position::BELOW));
+ control.SetProperty(Actor::Property::POSITION_X, centerPoint.x);
Actor rootActor = application.GetScene().GetRootLayer();
- rootActor.Add( control );
+ rootActor.Add(control);
application.SendNotification();
application.Render();
- Vector2 hoverPoint( centerPoint );
+ Vector2 hoverPoint(centerPoint);
hoverPoint.x = 1.0f;
- application.ProcessEvent( GenerateSingleHover( PointState::STARTED, centerPoint ) );
+ application.ProcessEvent(GenerateSingleHover(PointState::STARTED, centerPoint));
- Dali::Timer timer = Timer::New( 1u );
+ Dali::Timer timer = Timer::New(1u);
timer.MockEmitSignal();
application.SendNotification();
application.Render();
- tet_infoline( "Ensure tooltip is still on the screen" );
- Actor tooltip = rootActor.GetChildAt( rootActor.GetChildCount() - 1 ); // Last actor added will be our tooltip
- DALI_TEST_CHECK( ( tooltip.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).x + tooltip.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).width * 0.5f ) <= centerPoint.width );
+ tet_infoline("Ensure tooltip is still on the screen");
+ Actor tooltip = rootActor.GetChildAt(rootActor.GetChildCount() - 1); // Last actor added will be our tooltip
+ DALI_TEST_CHECK((tooltip.GetCurrentProperty<Vector3>(Actor::Property::WORLD_POSITION).x + tooltip.GetCurrentProperty<Vector3>(Actor::Property::SIZE).width * 0.5f) <= centerPoint.width);
END_TEST;
}
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
-#include <stdlib.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
-#include <dali/devel-api/actors/actor-devel.h>
#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
-#include <dali-toolkit/public-api/transition/transition-set.h>
-#include <dali-toolkit/public-api/transition/transition-base.h>
-#include <dali-toolkit/public-api/transition/transition.h>
#include <dali-toolkit/public-api/transition/fade-transition.h>
#include <dali-toolkit/public-api/transition/slide-transition.h>
+#include <dali-toolkit/public-api/transition/transition-base.h>
+#include <dali-toolkit/public-api/transition/transition-set.h>
+#include <dali-toolkit/public-api/transition/transition.h>
+#include <dali/devel-api/actors/actor-devel.h>
+#include <stdlib.h>
+#include <iostream>
using namespace Dali;
using namespace Dali::Toolkit;
namespace
{
-
const char* TEST_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/gallery-small-1.jpg";
}
Vector3 destinationSize(120, 120, 0);
Vector3 destinationScale(2, 1, 0);
Vector4 destinationColor(1.0f, 0.5f, 1.0f, 0.8f);
- float destinationOpacity(0.8f);
- float destinationRadius(50.f);
- float destinationBorderlineWidth(80.0f);
+ float destinationOpacity(0.8f);
+ float destinationRadius(50.f);
+ float destinationBorderlineWidth(80.0f);
Vector4 destinationBorderlineColor(0.5f, 1.0f, 0.5f, 0.3f);
- float destinationBorderlineOffset(-1.0f);
+ float destinationBorderlineOffset(-1.0f);
Vector4 destinationRadiusV4 = Vector4(destinationRadius, destinationRadius, destinationRadius, destinationRadius);
Control control1 = Control::New();
DALI_TEST_EQUALS(destinationPosition, control2.GetProperty<Vector3>(Actor::Property::POSITION), TEST_LOCATION);
Property::Map backgroundMap = control2.GetProperty<Property::Map>(Toolkit::Control::Property::BACKGROUND);
- Vector4 cornerRadius = backgroundMap.Find(Toolkit::DevelVisual::Property::CORNER_RADIUS)->Get<Vector4>();
+ Vector4 cornerRadius = backgroundMap.Find(Toolkit::DevelVisual::Property::CORNER_RADIUS)->Get<Vector4>();
DALI_TEST_EQUALS(destinationRadiusV4, cornerRadius, TEST_LOCATION);
float borderlineWidth = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH)->Get<float>();
DALI_TEST_EQUALS(destinationBorderlineWidth, borderlineWidth, TEST_LOCATION);
application.SendNotification();
application.Render(20);
- Transition transition = Transition::New(control1, control2, true, TimePeriod(0.5f));
+ Transition transition = Transition::New(control1, control2, true, TimePeriod(0.5f));
TransitionSet transitionSet = TransitionSet::New();
transitionSet.AddTransition(transition);
transitionSet.Play();
- bool signalReceived(false);
+ bool signalReceived(false);
TransitionFinishCheck finishCheck(signalReceived);
transitionSet.FinishedSignal().Connect(&application, finishCheck);
DALI_TEST_NOT_EQUALS(destinationPosition, control2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), 0.00001f, TEST_LOCATION);
DALI_TEST_EQUALS(1, control2.GetRendererCount(), TEST_LOCATION);
- Dali::Renderer renderer = control2.GetRendererAt(0);
- Property::Index index = renderer.GetPropertyIndex(DevelVisual::Property::CORNER_RADIUS);
- cornerRadius = renderer.GetCurrentProperty<Vector4>(index);
+ Dali::Renderer renderer = control2.GetRendererAt(0);
+ Property::Index index = renderer.GetPropertyIndex(DevelVisual::Property::CORNER_RADIUS);
+ cornerRadius = renderer.GetCurrentProperty<Vector4>(index);
DALI_TEST_NOT_EQUALS(destinationRadiusV4, cornerRadius, 0.00001f, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_WIDTH);
+ index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_WIDTH);
borderlineWidth = renderer.GetCurrentProperty<float>(index);
DALI_TEST_NOT_EQUALS(destinationBorderlineWidth, borderlineWidth, 0.00001f, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_COLOR);
+ index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_COLOR);
borderlineColor = renderer.GetCurrentProperty<Vector4>(index);
DALI_TEST_NOT_EQUALS(destinationBorderlineColor, borderlineColor, 0.00001f, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_OFFSET);
+ index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_OFFSET);
borderlineOffset = renderer.GetCurrentProperty<float>(index);
DALI_TEST_NOT_EQUALS(destinationBorderlineOffset, borderlineOffset, 0.00001f, TEST_LOCATION);
DALI_TEST_EQUALS(destinationColor, control2.GetCurrentProperty<Vector4>(Actor::Property::COLOR), TEST_LOCATION);
DALI_TEST_EQUALS(destinationOpacity, control2.GetCurrentProperty<float>(Actor::Property::OPACITY), TEST_LOCATION);
DALI_TEST_EQUALS(1, control2.GetRendererCount(), TEST_LOCATION);
- renderer = control2.GetRendererAt(0);
- index = renderer.GetPropertyIndex(DevelVisual::Property::CORNER_RADIUS);
+ renderer = control2.GetRendererAt(0);
+ index = renderer.GetPropertyIndex(DevelVisual::Property::CORNER_RADIUS);
cornerRadius = renderer.GetCurrentProperty<Vector4>(index);
DALI_TEST_EQUALS(destinationRadiusV4, cornerRadius, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_WIDTH);
+ index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_WIDTH);
borderlineWidth = renderer.GetCurrentProperty<float>(index);
DALI_TEST_EQUALS(destinationBorderlineWidth, borderlineWidth, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_COLOR);
+ index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_COLOR);
borderlineColor = renderer.GetCurrentProperty<Vector4>(index);
DALI_TEST_EQUALS(destinationBorderlineColor, borderlineColor, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_OFFSET);
+ index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_OFFSET);
borderlineOffset = renderer.GetCurrentProperty<float>(index);
DALI_TEST_EQUALS(destinationBorderlineOffset, borderlineOffset, TEST_LOCATION);
Vector3 sourceSize(150, 150, 0);
Vector3 sourceScale(1, 2, 0);
Vector4 sourceColor(1.0f, 1.0f, 1.0f, 0.5f);
- float sourceOpacity(0.5f);
- float sourceRadius(30.f);
- float sourceBorderlineWidth(60.0f);
+ float sourceOpacity(0.5f);
+ float sourceRadius(30.f);
+ float sourceBorderlineWidth(60.0f);
Vector4 sourceBorderlineColor(1.0f, 0.0f, 0.0f, 1.0f);
- float sourceBorderlineOffset(1.f);
+ float sourceBorderlineOffset(1.f);
Vector4 sourceRadiusV4 = Vector4(sourceRadius, sourceRadius, sourceRadius, sourceRadius);
Vector3 destinationPosition(50, 50, 0);
Vector3 destinationSize(120, 120, 0);
Vector3 destinationScale(2, 1, 0);
Vector4 destinationColor(1.0f, 0.5f, 1.0f, 0.8f);
- float destinationOpacity(0.8f);
- float destinationRadius(50.f);
- float destinationBorderlineWidth(80.0f);
+ float destinationOpacity(0.8f);
+ float destinationRadius(50.f);
+ float destinationBorderlineWidth(80.0f);
Vector4 destinationBorderlineColor(0.5f, 1.0f, 0.5f, 0.3f);
- float destinationBorderlineOffset(-1.0f);
+ float destinationBorderlineOffset(-1.0f);
Vector4 destinationRadiusV4 = Vector4(destinationRadius, destinationRadius, destinationRadius, destinationRadius);
Control control1 = Control::New();
DALI_TEST_EQUALS(destinationPosition, control2.GetProperty<Vector3>(Actor::Property::POSITION), TEST_LOCATION);
Property::Map backgroundMap = control2.GetProperty<Property::Map>(Toolkit::Control::Property::BACKGROUND);
- Vector4 cornerRadius = backgroundMap.Find(Toolkit::DevelVisual::Property::CORNER_RADIUS)->Get<Vector4>();
+ Vector4 cornerRadius = backgroundMap.Find(Toolkit::DevelVisual::Property::CORNER_RADIUS)->Get<Vector4>();
DALI_TEST_EQUALS(destinationRadiusV4, cornerRadius, TEST_LOCATION);
float borderlineWidth = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH)->Get<float>();
DALI_TEST_EQUALS(destinationBorderlineWidth, borderlineWidth, TEST_LOCATION);
application.SendNotification();
application.Render(20);
- Transition transition = Transition::New(control1, control2, false, TimePeriod(0.5f));
+ Transition transition = Transition::New(control1, control2, false, TimePeriod(0.5f));
TransitionSet transitionSet = TransitionSet::New();
transitionSet.AddTransition(transition);
transitionSet.Play();
- bool signalReceived(false);
+ bool signalReceived(false);
TransitionFinishCheck finishCheck(signalReceived);
transitionSet.FinishedSignal().Connect(&application, finishCheck);
DALI_TEST_NOT_EQUALS(destinationPosition, control1.GetCurrentProperty<Vector3>(Actor::Property::POSITION), 0.00001f, TEST_LOCATION);
DALI_TEST_EQUALS(1, control1.GetRendererCount(), TEST_LOCATION);
- Dali::Renderer renderer = control1.GetRendererAt(0);
- Property::Index index = renderer.GetPropertyIndex(DevelVisual::Property::CORNER_RADIUS);
- cornerRadius = renderer.GetCurrentProperty<Vector4>(index);
+ Dali::Renderer renderer = control1.GetRendererAt(0);
+ Property::Index index = renderer.GetPropertyIndex(DevelVisual::Property::CORNER_RADIUS);
+ cornerRadius = renderer.GetCurrentProperty<Vector4>(index);
DALI_TEST_NOT_EQUALS(destinationRadiusV4, cornerRadius, 0.00001f, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_WIDTH);
+ index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_WIDTH);
borderlineWidth = renderer.GetCurrentProperty<float>(index);
DALI_TEST_NOT_EQUALS(destinationBorderlineWidth, borderlineWidth, 0.00001f, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_COLOR);
+ index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_COLOR);
borderlineColor = renderer.GetCurrentProperty<Vector4>(index);
DALI_TEST_NOT_EQUALS(destinationBorderlineColor, borderlineColor, 0.00001f, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_OFFSET);
+ index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_OFFSET);
borderlineOffset = renderer.GetCurrentProperty<float>(index);
DALI_TEST_NOT_EQUALS(destinationBorderlineOffset, borderlineOffset, 0.00001f, TEST_LOCATION);
DALI_TEST_EQUALS(destinationOpacity, control1.GetCurrentProperty<float>(Actor::Property::OPACITY), TEST_LOCATION);
DALI_TEST_EQUALS(1, control1.GetRendererCount(), TEST_LOCATION);
- renderer = control1.GetRendererAt(0);
- index = renderer.GetPropertyIndex(DevelVisual::Property::CORNER_RADIUS);
+ renderer = control1.GetRendererAt(0);
+ index = renderer.GetPropertyIndex(DevelVisual::Property::CORNER_RADIUS);
cornerRadius = renderer.GetCurrentProperty<Vector4>(index);
DALI_TEST_EQUALS(destinationRadiusV4, cornerRadius, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_WIDTH);
+ index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_WIDTH);
borderlineWidth = renderer.GetCurrentProperty<float>(index);
DALI_TEST_EQUALS(destinationBorderlineWidth, borderlineWidth, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_COLOR);
+ index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_COLOR);
borderlineColor = renderer.GetCurrentProperty<Vector4>(index);
DALI_TEST_EQUALS(destinationBorderlineColor, borderlineColor, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_OFFSET);
+ index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_OFFSET);
borderlineOffset = renderer.GetCurrentProperty<float>(index);
DALI_TEST_EQUALS(destinationBorderlineOffset, borderlineOffset, TEST_LOCATION);
// after next update, renderer properties are returned to the source properties.
DALI_TEST_EQUALS(1, control1.GetRendererCount(), TEST_LOCATION);
- renderer = control1.GetRendererAt(0);
- index = renderer.GetPropertyIndex(DevelVisual::Property::CORNER_RADIUS);
+ renderer = control1.GetRendererAt(0);
+ index = renderer.GetPropertyIndex(DevelVisual::Property::CORNER_RADIUS);
cornerRadius = renderer.GetCurrentProperty<Vector4>(index);
DALI_TEST_EQUALS(sourceRadiusV4, cornerRadius, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_WIDTH);
+ index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_WIDTH);
borderlineWidth = renderer.GetCurrentProperty<float>(index);
DALI_TEST_EQUALS(sourceBorderlineWidth, borderlineWidth, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_COLOR);
+ index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_COLOR);
borderlineColor = renderer.GetCurrentProperty<Vector4>(index);
DALI_TEST_EQUALS(sourceBorderlineColor, borderlineColor, TEST_LOCATION);
- index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_OFFSET);
+ index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_OFFSET);
borderlineOffset = renderer.GetCurrentProperty<float>(index);
DALI_TEST_EQUALS(sourceBorderlineOffset, borderlineOffset, TEST_LOCATION);
control2.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty2);
Property::Map backgroundMap = control2.GetProperty<Property::Map>(Toolkit::Control::Property::BACKGROUND);
- Vector4 cornerRadius = backgroundMap.Find(Toolkit::DevelVisual::Property::CORNER_RADIUS)->Get<Vector4>();
+ Vector4 cornerRadius = backgroundMap.Find(Toolkit::DevelVisual::Property::CORNER_RADIUS)->Get<Vector4>();
DALI_TEST_EQUALS(destinationRadius, cornerRadius, TEST_LOCATION);
float borderlineWidth = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH)->Get<float>();
DALI_TEST_EQUALS(destinationBorderlineWidth, borderlineWidth, TEST_LOCATION);
application.SendNotification();
application.Render(20);
- Transition transition = Transition::New(control1, control2, true, TimePeriod(0.5f));
+ Transition transition = Transition::New(control1, control2, true, TimePeriod(0.5f));
TransitionSet transitionSet = TransitionSet::New();
transitionSet.AddTransition(transition);
transitionSet.Play();
- bool signalReceived(false);
+ bool signalReceived(false);
TransitionFinishCheck finishCheck(signalReceived);
transitionSet.FinishedSignal().Connect(&application, finishCheck);
finishCheck.CheckSignalNotReceived();
backgroundMap = control2.GetProperty<Property::Map>(Toolkit::Control::Property::BACKGROUND);
- cornerRadius = backgroundMap.Find(Toolkit::DevelVisual::Property::CORNER_RADIUS)->Get<Vector4>();
+ cornerRadius = backgroundMap.Find(Toolkit::DevelVisual::Property::CORNER_RADIUS)->Get<Vector4>();
DALI_TEST_EQUALS(destinationRadius, cornerRadius, TEST_LOCATION);
borderlineWidth = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH)->Get<float>();
DALI_TEST_EQUALS(destinationBorderlineWidth, borderlineWidth, TEST_LOCATION);
application.Render(20);
backgroundMap = control2.GetProperty<Property::Map>(Toolkit::Control::Property::BACKGROUND);
- cornerRadius = backgroundMap.Find(Toolkit::DevelVisual::Property::CORNER_RADIUS)->Get<Vector4>();
+ cornerRadius = backgroundMap.Find(Toolkit::DevelVisual::Property::CORNER_RADIUS)->Get<Vector4>();
DALI_TEST_EQUALS(destinationRadius, cornerRadius, TEST_LOCATION);
borderlineWidth = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH)->Get<float>();
DALI_TEST_EQUALS(destinationBorderlineWidth, borderlineWidth, TEST_LOCATION);
application.SendNotification();
application.Render(20);
- Vector3 startWorldPosition = control1.GetProperty<Vector3>(Actor::Property::WORLD_POSITION);
+ Vector3 startWorldPosition = control1.GetProperty<Vector3>(Actor::Property::WORLD_POSITION);
Vector3 finishWorldPosition = control2.GetProperty<Vector3>(Actor::Property::WORLD_POSITION);
- Transition transition = Transition::New(control1, control2, true, TimePeriod(0.5f));
+ Transition transition = Transition::New(control1, control2, true, TimePeriod(0.5f));
TransitionSet transitionSet = TransitionSet::New();
transitionSet.AddTransition(transition);
transitionSet.Play();
- bool signalReceived(false);
+ bool signalReceived(false);
TransitionFinishCheck finishCheck(signalReceived);
transitionSet.FinishedSignal().Connect(&application, finishCheck);
finishCheck.CheckSignalNotReceived();
// control2 moved about 80%
- Vector3 currentPosition = control2.GetCurrentProperty<Vector3>(Actor::Property::POSITION);
+ Vector3 currentPosition = control2.GetCurrentProperty<Vector3>(Actor::Property::POSITION);
Vector3 expectedPosition_0_7 = startWorldPosition + (finishWorldPosition - startWorldPosition) * 0.7;
Vector3 expectedPosition_0_9 = startWorldPosition + (finishWorldPosition - startWorldPosition) * 0.9;
DALI_TEST_CHECK(currentPosition.x <= expectedPosition_0_7.x && currentPosition.x >= expectedPosition_0_9.x);
application.SendNotification();
application.Render(20);
- Vector3 startWorldPosition = control1.GetProperty<Vector3>(Actor::Property::WORLD_POSITION);
+ Vector3 startWorldPosition = control1.GetProperty<Vector3>(Actor::Property::WORLD_POSITION);
Vector3 finishWorldPosition = control2.GetProperty<Vector3>(Actor::Property::WORLD_POSITION);
- Transition transition = Transition::New(control1, control2, true, TimePeriod(0.5f, 0.5f));
+ Transition transition = Transition::New(control1, control2, true, TimePeriod(0.5f, 0.5f));
TransitionSet transitionSet = TransitionSet::New();
transitionSet.AddTransition(transition);
transitionSet.Play();
- bool signalReceived(false);
+ bool signalReceived(false);
TransitionFinishCheck finishCheck(signalReceived);
transitionSet.FinishedSignal().Connect(&application, finishCheck);
finishCheck.CheckSignalNotReceived();
// control2 moved about 60% (800ms)
- Vector3 currentPosition = control2.GetCurrentProperty<Vector3>(Actor::Property::POSITION);
+ Vector3 currentPosition = control2.GetCurrentProperty<Vector3>(Actor::Property::POSITION);
Vector3 expectedPosition_0_5 = startWorldPosition + (finishWorldPosition - startWorldPosition) * 0.5;
Vector3 expectedPosition_0_7 = startWorldPosition + (finishWorldPosition - startWorldPosition) * 0.7;
DALI_TEST_CHECK(currentPosition.x <= expectedPosition_0_5.x && currentPosition.x >= expectedPosition_0_7.x);
application.SendNotification();
application.Render(20);
- Transition transition = Transition::New(control1, control2, true, TimePeriod(0.5f));
+ Transition transition = Transition::New(control1, control2, true, TimePeriod(0.5f));
TransitionSet transitionSet = TransitionSet::New();
transitionSet.AddTransition(transition);
transitionSet.Play();
- bool signalReceived(false);
+ bool signalReceived(false);
TransitionFinishCheck finishCheck(signalReceived);
transitionSet.FinishedSignal().Connect(&application, finishCheck);
transitionSet.AddTransition(transition);
transitionSet.Play();
- bool signalReceived(false);
+ bool signalReceived(false);
TransitionFinishCheck finishCheck(signalReceived);
transitionSet.FinishedSignal().Connect(&application, finishCheck);
application.SendNotification();
application.Render(20);
- Transition transition;
- TransitionSet transitionSet;
- bool signalReceived(false);
+ Transition transition;
+ TransitionSet transitionSet;
+ bool signalReceived(false);
TransitionFinishCheck finishCheck(signalReceived);
// not inherit Position.
control3.SetProperty(Actor::Property::INHERIT_ORIENTATION, true);
control3.SetProperty(Actor::Property::INHERIT_SCALE, true);
- transition = Transition::New(control1, control3, true, TimePeriod(0.5f));
+ transition = Transition::New(control1, control3, true, TimePeriod(0.5f));
transitionSet = TransitionSet::New();
transitionSet.AddTransition(transition);
transitionSet.Play();
ToolkitTestApplication application;
tet_infoline(" UtcDaliTransitionBetweenControlPairWithTreeWithoutOrientationInheritance");
- Radian sourceAngle(1.0f);
- Radian destinationAngle(2.0f);
+ Radian sourceAngle(1.0f);
+ Radian destinationAngle(2.0f);
Quaternion sourceOrientation(sourceAngle, Vector3::XAXIS);
Quaternion destinationOrientation(destinationAngle, Vector3::XAXIS);
control3.SetProperty(Actor::Property::INHERIT_SCALE, true);
Vector3 currentAxis;
- Radian currentRadian;
+ Radian currentRadian;
application.GetScene().Add(control1);
application.GetScene().Add(control2);
Quaternion currentOrientation = control3.GetProperty<Quaternion>(Actor::Property::WORLD_ORIENTATION);
DALI_TEST_EQUALS(currentOrientation, destinationOrientation, 0.0001f, TEST_LOCATION);
- Transition transition;
- TransitionSet transitionSet;
- bool signalReceived(false);
+ Transition transition;
+ TransitionSet transitionSet;
+ bool signalReceived(false);
TransitionFinishCheck finishCheck(signalReceived);
- transition = Transition::New(control1, control3, true, TimePeriod(0.5f));
+ transition = Transition::New(control1, control3, true, TimePeriod(0.5f));
transitionSet = TransitionSet::New();
transitionSet.AddTransition(transition);
transitionSet.Play();
Vector3 currentScale = control3.GetProperty<Vector3>(Actor::Property::WORLD_SCALE);
DALI_TEST_EQUALS(currentScale, destinationScale, 0.0001f, TEST_LOCATION);
- Transition transition;
- TransitionSet transitionSet;
- bool signalReceived(false);
+ Transition transition;
+ TransitionSet transitionSet;
+ bool signalReceived(false);
TransitionFinishCheck finishCheck(signalReceived);
- transition = Transition::New(control1, control3, true, TimePeriod(0.5f));
+ transition = Transition::New(control1, control3, true, TimePeriod(0.5f));
transitionSet = TransitionSet::New();
transitionSet.AddTransition(transition);
transitionSet.Play();
END_TEST;
}
-
int UtcDaliMultipleTransitionAppearing(void)
{
ToolkitTestApplication application;
DALI_TEST_EQUALS(1.0f, control.GetCurrentProperty<float>(Actor::Property::OPACITY), TEST_LOCATION);
- TransitionSet transitionSet = TransitionSet::New();
- FadeTransition fade = FadeTransition::New(control, 0.5, TimePeriod(1.0f, 1.0f));
+ TransitionSet transitionSet = TransitionSet::New();
+ FadeTransition fade = FadeTransition::New(control, 0.5, TimePeriod(1.0f, 1.0f));
fade.SetAppearingTransition(true); // set fade in
transitionSet.AddTransition(fade);
SlideTransition slide = SlideTransition::New(control, Dali::Toolkit::SlideTransitionDirection::BOTTOM, TimePeriod(0.5f, 1.0f));
transitionSet.AddTransition(slide);
transitionSet.Play();
- bool signalReceived(false);
+ bool signalReceived(false);
TransitionFinishCheck finishCheck(signalReceived);
transitionSet.FinishedSignal().Connect(&application, finishCheck);
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
-#include <stdlib.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
-#include <dali-toolkit/public-api/controls/video-view/video-view.h>
#include <dali-toolkit/devel-api/controls/video-view/video-view-devel.h>
-#include <dali/devel-api/adaptor-framework/window-devel.h>
+#include <dali-toolkit/public-api/controls/video-view/video-view.h>
#include <dali/devel-api/adaptor-framework/video-sync-mode.h>
+#include <dali/devel-api/adaptor-framework/window-devel.h>
+#include <stdlib.h>
+#include <iostream>
using namespace Dali;
using namespace Dali::Toolkit;
namespace
{
-const char* const TEST_FILE( "test.mp4" );
-const char* const VOLUME_LEFT( "volumeLeft" );
-const char* const VOLUME_RIGHT( "volumeRight" );
-const char* const RENDERING_TYPE( "renderingTarget" );
-const char* const DUMMY_STRING( "dummy string" );
+const char* const TEST_FILE("test.mp4");
+const char* const VOLUME_LEFT("volumeLeft");
+const char* const VOLUME_RIGHT("volumeRight");
+const char* const RENDERING_TYPE("renderingTarget");
+const char* const DUMMY_STRING("dummy string");
+// clang-format off
const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
- attribute mediump vec2 aPosition;\n
- varying mediump vec2 vTexCoord;\n
- uniform mediump mat4 uMvpMatrix;\n
+ attribute mediump vec2 aPosition;\n
+ varying mediump vec2 vTexCoord;\n
+ uniform mediump mat4 uMvpMatrix;\n
uniform mediump vec3 uSize;\n
\n
void main()\n
mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0);\n
vertexPosition.xyz *= uSize;\n
vertexPosition = uMvpMatrix * vertexPosition;\n
- \n
vTexCoord = aPosition + vec2(0.5);\n
gl_Position = vertexPosition;\n
- }\n
-);
+ }\n);
-const char* fragmentShaderPrefix( "#extension GL_OES_EGL_image_external:require\n" );
+const char* fragmentShaderPrefix("#extension GL_OES_EGL_image_external:require\n");
const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
varying mediump vec2 vTexCoord;\n
uniform samplerExternalOES sTexture;\n
\n
void main()\n
{\n
- gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor;\n
- }\n
-);
+ gl_FragColor = texture2D(sTexture, vTexCoord) * uColor;\n
+ }\n);
-}
+// clang-format on
+
+} // namespace
void video_view_startup(void)
{
{
// New() must be called to create a VideoView or it wont be valid.
Actor a = Actor::New();
- view.Add( a );
- DALI_TEST_CHECK( false );
+ view.Add(a);
+ DALI_TEST_CHECK(false);
}
- catch (Dali::DaliException& e)
+ catch(Dali::DaliException& e)
{
// Tests that a negative test of an assertion succeeds
- DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_PRINT_ASSERT(e);
DALI_TEST_CHECK(!view);
}
END_TEST;
tet_infoline(" UtcDaliVideoViewNew");
Toolkit::VideoView view = Toolkit::VideoView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- const std::string url( DUMMY_STRING );
- Toolkit::VideoView view2 = Toolkit::VideoView::New( url );
- DALI_TEST_CHECK( view2 );
+ const std::string url(DUMMY_STRING);
+ Toolkit::VideoView view2 = Toolkit::VideoView::New(url);
+ DALI_TEST_CHECK(view2);
END_TEST;
}
tet_infoline(" UtcDaliVideoViewDownCast");
Toolkit::VideoView view = Toolkit::VideoView::New();
- BaseHandle handle(view);
+ BaseHandle handle(view);
- Toolkit::VideoView view2 = Toolkit::VideoView::DownCast( handle );
- DALI_TEST_CHECK( view );
- DALI_TEST_CHECK( view2 );
- DALI_TEST_CHECK( view == view2 );
+ Toolkit::VideoView view2 = Toolkit::VideoView::DownCast(handle);
+ DALI_TEST_CHECK(view);
+ DALI_TEST_CHECK(view2);
+ DALI_TEST_CHECK(view == view2);
END_TEST;
}
tet_infoline(" UtcDaliVideoViewProperty1");
Toolkit::VideoView view = Toolkit::VideoView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
std::string file;
- view.SetProperty( VideoView::Property::VIDEO, TEST_FILE );
- Property::Value val = view.GetProperty( VideoView::Property::VIDEO );
- DALI_TEST_CHECK( val.Get( file ) );
- DALI_TEST_CHECK( file == TEST_FILE );
+ view.SetProperty(VideoView::Property::VIDEO, TEST_FILE);
+ Property::Value val = view.GetProperty(VideoView::Property::VIDEO);
+ DALI_TEST_CHECK(val.Get(file));
+ DALI_TEST_CHECK(file == TEST_FILE);
END_TEST;
}
tet_infoline(" UtcDaliVideoViewProperty1");
Toolkit::VideoView view = Toolkit::VideoView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Integration::Scene stage = application.GetScene();
- std::string file;
+ std::string file;
Property::Map map;
- view.SetProperty( VideoView::Property::VIDEO, Property::Map()
- .Add("rendererType", "IMAGE")
- .Add("url", "video.mpg") // Note, videoView doesn't use this url
- .Add("RENDERING_TARGET", "windowSurfaceTarget" )
- .Add("width", 100)
- .Add("height", 100) );
+ view.SetProperty(VideoView::Property::VIDEO,
+ Property::Map()
+ .Add("rendererType", "IMAGE")
+ .Add("url", "video.mpg") // Note, videoView doesn't use this url
+ .Add("RENDERING_TARGET", "windowSurfaceTarget")
+ .Add("width", 100)
+ .Add("height", 100));
- stage.Add( view );
+ stage.Add(view);
- Property::Value val = view.GetProperty( VideoView::Property::VIDEO );
- Property::Map* resultMap = val.GetMap();
+ Property::Value val = view.GetProperty(VideoView::Property::VIDEO);
+ Property::Map* resultMap = val.GetMap();
- DALI_TEST_CHECK( resultMap );
+ DALI_TEST_CHECK(resultMap);
Property::Value* value = resultMap->Find("url");
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<std::string>(), "video.mpg", TEST_LOCATION );
+ DALI_TEST_CHECK(value);
+ DALI_TEST_EQUALS(value->Get<std::string>(), "video.mpg", TEST_LOCATION);
- stage.Remove( view );
+ stage.Remove(view);
END_TEST;
}
tet_infoline(" UtcDaliVideoViewProperty2");
Toolkit::VideoView view = Toolkit::VideoView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- bool looping;
- Property::Value val = view.GetProperty( VideoView::Property::LOOPING );
- DALI_TEST_CHECK( val.Get( looping ) );
- DALI_TEST_CHECK( !looping );
+ bool looping;
+ Property::Value val = view.GetProperty(VideoView::Property::LOOPING);
+ DALI_TEST_CHECK(val.Get(looping));
+ DALI_TEST_CHECK(!looping);
- view.SetProperty( VideoView::Property::LOOPING, true );
- val = view.GetProperty( VideoView::Property::LOOPING );
- DALI_TEST_CHECK( val.Get( looping ) );
- DALI_TEST_CHECK( looping );
+ view.SetProperty(VideoView::Property::LOOPING, true);
+ val = view.GetProperty(VideoView::Property::LOOPING);
+ DALI_TEST_CHECK(val.Get(looping));
+ DALI_TEST_CHECK(looping);
END_TEST;
}
tet_infoline(" UtcDaliVideoViewProperty3");
Toolkit::VideoView view = Toolkit::VideoView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- bool muted;
- Property::Value val = view.GetProperty( VideoView::Property::MUTED );
- DALI_TEST_CHECK( val.Get( muted ) );
- DALI_TEST_CHECK( !muted );
+ bool muted;
+ Property::Value val = view.GetProperty(VideoView::Property::MUTED);
+ DALI_TEST_CHECK(val.Get(muted));
+ DALI_TEST_CHECK(!muted);
- view.SetProperty( VideoView::Property::MUTED, true );
- val = view.GetProperty( VideoView::Property::MUTED );
- DALI_TEST_CHECK( val.Get( muted ) );
- DALI_TEST_CHECK( muted );
+ view.SetProperty(VideoView::Property::MUTED, true);
+ val = view.GetProperty(VideoView::Property::MUTED);
+ DALI_TEST_CHECK(val.Get(muted));
+ DALI_TEST_CHECK(muted);
END_TEST;
}
tet_infoline(" UtcDaliVideoViewProperty4");
Toolkit::VideoView view = Toolkit::VideoView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
float left, right;
left = right = 0.f;
Property::Map map;
- map.Insert( VOLUME_LEFT, 0.5f );
- map.Insert( VOLUME_RIGHT, 0.5f );
+ map.Insert(VOLUME_LEFT, 0.5f);
+ map.Insert(VOLUME_RIGHT, 0.5f);
- view.SetProperty( VideoView::Property::VOLUME, map );
- Property::Value val = view.GetProperty( VideoView::Property::VOLUME );
+ view.SetProperty(VideoView::Property::VOLUME, map);
+ Property::Value val = view.GetProperty(VideoView::Property::VOLUME);
Property::Map map2;
- DALI_TEST_CHECK( val.Get( map2 ) );
+ DALI_TEST_CHECK(val.Get(map2));
- Property::Value* volumeLeft = map2.Find( VOLUME_LEFT );
- Property::Value* volumeRight = map2.Find( VOLUME_RIGHT );
+ Property::Value* volumeLeft = map2.Find(VOLUME_LEFT);
+ Property::Value* volumeRight = map2.Find(VOLUME_RIGHT);
- DALI_TEST_CHECK( volumeLeft && volumeLeft->Get( left ) );
- DALI_TEST_CHECK( volumeRight && volumeRight->Get( right ) );
- DALI_TEST_CHECK( left == 0.5f );
- DALI_TEST_CHECK( right == 0.5f );
+ DALI_TEST_CHECK(volumeLeft && volumeLeft->Get(left));
+ DALI_TEST_CHECK(volumeRight && volumeRight->Get(right));
+ DALI_TEST_CHECK(left == 0.5f);
+ DALI_TEST_CHECK(right == 0.5f);
END_TEST;
}
ToolkitTestApplication application;
VideoView view = Toolkit::VideoView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- VideoView copy( view );
- DALI_TEST_CHECK( view == copy );
+ VideoView copy(view);
+ DALI_TEST_CHECK(view == copy);
VideoView assign;
- DALI_TEST_CHECK( !assign );
+ DALI_TEST_CHECK(!assign);
assign = copy;
- DALI_TEST_CHECK( assign == view );
+ DALI_TEST_CHECK(assign == view);
END_TEST;
}
ToolkitTestApplication application;
VideoView view = Toolkit::VideoView::New();
- DALI_TEST_EQUALS( 1, view.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- view.SetProperty( VideoView::Property::LOOPING, true );
- DALI_TEST_CHECK( view.GetProperty<bool>( VideoView::Property::LOOPING ) );
+ DALI_TEST_EQUALS(1, view.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ view.SetProperty(VideoView::Property::LOOPING, true);
+ DALI_TEST_CHECK(view.GetProperty<bool>(VideoView::Property::LOOPING));
- VideoView moved = std::move( view );
- DALI_TEST_CHECK( moved );
- DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_CHECK( moved.GetProperty<bool>( VideoView::Property::LOOPING ) );
- DALI_TEST_CHECK( !view );
+ VideoView moved = std::move(view);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_CHECK(moved.GetProperty<bool>(VideoView::Property::LOOPING));
+ DALI_TEST_CHECK(!view);
END_TEST;
}
ToolkitTestApplication application;
VideoView view = Toolkit::VideoView::New();
- DALI_TEST_EQUALS( 1, view.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- view.SetProperty( VideoView::Property::LOOPING, true );
- DALI_TEST_CHECK( view.GetProperty<bool>( VideoView::Property::LOOPING ) );
+ DALI_TEST_EQUALS(1, view.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ view.SetProperty(VideoView::Property::LOOPING, true);
+ DALI_TEST_CHECK(view.GetProperty<bool>(VideoView::Property::LOOPING));
VideoView moved;
- moved = std::move( view );
- DALI_TEST_CHECK( moved );
- DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
- DALI_TEST_CHECK( moved.GetProperty<bool>( VideoView::Property::LOOPING ) );
- DALI_TEST_CHECK( !view );
+ moved = std::move(view);
+ DALI_TEST_CHECK(moved);
+ DALI_TEST_EQUALS(1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION);
+ DALI_TEST_CHECK(moved.GetProperty<bool>(VideoView::Property::LOOPING));
+ DALI_TEST_CHECK(!view);
END_TEST;
}
ToolkitTestApplication application;
TypeRegistry typeRegistry = TypeRegistry::Get();
- DALI_TEST_CHECK( typeRegistry );
+ DALI_TEST_CHECK(typeRegistry);
- TypeInfo typeInfo = typeRegistry.GetTypeInfo( "VideoView" );
- DALI_TEST_CHECK( typeInfo );
+ TypeInfo typeInfo = typeRegistry.GetTypeInfo("VideoView");
+ DALI_TEST_CHECK(typeInfo);
BaseHandle handle = typeInfo.CreateInstance();
- DALI_TEST_CHECK( handle );
+ DALI_TEST_CHECK(handle);
- VideoView view = VideoView::DownCast( handle );
- DALI_TEST_CHECK( view );
+ VideoView view = VideoView::DownCast(handle);
+ DALI_TEST_CHECK(view);
END_TEST;
}
ToolkitTestApplication application;
VideoView videoView = VideoView::New();
- DALI_TEST_CHECK( videoView );
+ DALI_TEST_CHECK(videoView);
videoView.Play();
videoView.Pause();
videoView.Forward(10);
videoView.Backward(10);
- Toolkit::DevelVideoView::GetMediaPlayer( videoView );
+ Toolkit::DevelVideoView::GetMediaPlayer(videoView);
VideoView::VideoViewSignalType& signal = videoView.FinishedSignal();
- DALI_TEST_EQUALS( 0, signal.GetConnectionCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS(0, signal.GetConnectionCount(), TEST_LOCATION);
END_TEST;
}
int UtcDaliVideoViewMethodsForRenderType(void)
{
ToolkitTestApplication application;
- VideoView videoView = VideoView::New();
- DALI_TEST_CHECK( videoView );
+ VideoView videoView = VideoView::New();
+ DALI_TEST_CHECK(videoView);
Property::Map windowSurfaceTarget;
Property::Map nativeImageTarget;
- windowSurfaceTarget.Insert( RENDERING_TYPE, "windowSurfaceTarget" );
- nativeImageTarget.Insert( RENDERING_TYPE, "nativeImageTarget" );
+ windowSurfaceTarget.Insert(RENDERING_TYPE, "windowSurfaceTarget");
+ nativeImageTarget.Insert(RENDERING_TYPE, "nativeImageTarget");
- Property::Map map;
+ Property::Map map;
Property::Value value;
- videoView.SetProperty( VideoView::Property::VIDEO, windowSurfaceTarget );
+ videoView.SetProperty(VideoView::Property::VIDEO, windowSurfaceTarget);
- value = videoView.GetProperty( VideoView::Property::VIDEO );
- DALI_TEST_CHECK( value.Get( map ) );
+ value = videoView.GetProperty(VideoView::Property::VIDEO);
+ DALI_TEST_CHECK(value.Get(map));
- Property::Value* type = map.Find( RENDERING_TYPE );
- DALI_TEST_CHECK( type );
- DALI_TEST_EQUALS( "windowSurfaceTarget", type->Get<std::string>(), TEST_LOCATION );
+ Property::Value* type = map.Find(RENDERING_TYPE);
+ DALI_TEST_CHECK(type);
+ DALI_TEST_EQUALS("windowSurfaceTarget", type->Get<std::string>(), TEST_LOCATION);
- videoView.SetProperty( VideoView::Property::VIDEO, nativeImageTarget );
+ videoView.SetProperty(VideoView::Property::VIDEO, nativeImageTarget);
- value = videoView.GetProperty( VideoView::Property::VIDEO );
- DALI_TEST_CHECK( value.Get( map ) );
- type = map.Find( RENDERING_TYPE );
+ value = videoView.GetProperty(VideoView::Property::VIDEO);
+ DALI_TEST_CHECK(value.Get(map));
+ type = map.Find(RENDERING_TYPE);
- DALI_TEST_CHECK( type );
- DALI_TEST_EQUALS( "nativeImageTarget", type->Get<std::string>(), TEST_LOCATION );
+ DALI_TEST_CHECK(type);
+ DALI_TEST_EQUALS("nativeImageTarget", type->Get<std::string>(), TEST_LOCATION);
END_TEST;
}
int UtcDaliVideoViewCustomShaderForCoverage(void)
{
ToolkitTestApplication application;
- VideoView videoView = VideoView::New();
- DALI_TEST_CHECK( videoView );
+ VideoView videoView = VideoView::New();
+ DALI_TEST_CHECK(videoView);
ToolkitApplication::DECODED_IMAGES_SUPPORTED = true;
- videoView.SetProperty( Toolkit::VideoView::Property::UNDERLAY, false );
- bool isUnderlay = videoView.GetProperty( Toolkit::VideoView::Property::UNDERLAY ).Get< bool >();
- DALI_TEST_CHECK( !isUnderlay );
+ videoView.SetProperty(Toolkit::VideoView::Property::UNDERLAY, false);
+ bool isUnderlay = videoView.GetProperty(Toolkit::VideoView::Property::UNDERLAY).Get<bool>();
+ DALI_TEST_CHECK(!isUnderlay);
- application.GetScene().Add( videoView );
- videoView.SetProperty( VideoView::Property::VIDEO, "testvideo" );
+ application.GetScene().Add(videoView);
+ videoView.SetProperty(VideoView::Property::VIDEO, "testvideo");
Property::Map customShader;
- customShader.Insert( "vertexShader", VERTEX_SHADER );
- customShader.Insert( "fragmentShader", FRAGMENT_SHADER );
+ customShader.Insert("vertexShader", VERTEX_SHADER);
+ customShader.Insert("fragmentShader", FRAGMENT_SHADER);
Property::Map map;
- map.Insert( "shader", customShader );
+ map.Insert("shader", customShader);
- videoView.SetProperty( VideoView::Property::VIDEO, map );
+ videoView.SetProperty(VideoView::Property::VIDEO, map);
- Property::Map map2;
- Property::Value value = videoView.GetProperty( VideoView::Property::VIDEO );
+ Property::Map map2;
+ Property::Value value = videoView.GetProperty(VideoView::Property::VIDEO);
- DALI_TEST_CHECK( !value.Get( map2 ) );
+ DALI_TEST_CHECK(!value.Get(map2));
END_TEST;
}
int UtcDaliVideoViewMethodsForCoverage2(void)
{
ToolkitTestApplication application;
- VideoView videoView = VideoView::New();
- DALI_TEST_CHECK( videoView );
+ VideoView videoView = VideoView::New();
+ DALI_TEST_CHECK(videoView);
Property::Map windowSurfaceTarget;
- windowSurfaceTarget.Insert( RENDERING_TYPE, "windowSurfaceTarget" );
+ windowSurfaceTarget.Insert(RENDERING_TYPE, "windowSurfaceTarget");
- application.GetScene().Add( videoView );
+ application.GetScene().Add(videoView);
application.SendNotification();
application.Render();
- Property::Map map;
+ Property::Map map;
Property::Value value;
- videoView.SetProperty( VideoView::Property::VIDEO, windowSurfaceTarget );
+ videoView.SetProperty(VideoView::Property::VIDEO, windowSurfaceTarget);
- value = videoView.GetProperty( VideoView::Property::VIDEO );
- DALI_TEST_CHECK( value.Get( map ) );
+ value = videoView.GetProperty(VideoView::Property::VIDEO);
+ DALI_TEST_CHECK(value.Get(map));
- Property::Value* type = map.Find( RENDERING_TYPE );
- DALI_TEST_CHECK( type );
- DALI_TEST_EQUALS( "windowSurfaceTarget", type->Get<std::string>(), TEST_LOCATION );
+ Property::Value* type = map.Find(RENDERING_TYPE);
+ DALI_TEST_CHECK(type);
+ DALI_TEST_EQUALS("windowSurfaceTarget", type->Get<std::string>(), TEST_LOCATION);
Vector3 vector(100.0f, 100.0f, 0.0f);
- DALI_TEST_CHECK(vector != videoView.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ));
- videoView.SetProperty( Actor::Property::SIZE, vector );
+ DALI_TEST_CHECK(vector != videoView.GetCurrentProperty<Vector3>(Actor::Property::SIZE));
+ videoView.SetProperty(Actor::Property::SIZE, vector);
application.SendNotification();
application.Render();
// Check the size in the new frame
- DALI_TEST_CHECK(vector == videoView.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ));
+ DALI_TEST_CHECK(vector == videoView.GetCurrentProperty<Vector3>(Actor::Property::SIZE));
END_TEST;
}
int UtcDaliVideoViewCustomShaderForCoverage3(void)
{
ToolkitTestApplication application;
- VideoView videoView = VideoView::New();
- DALI_TEST_CHECK( videoView );
+ VideoView videoView = VideoView::New();
+ DALI_TEST_CHECK(videoView);
ToolkitApplication::DECODED_IMAGES_SUPPORTED = true;
- videoView.SetProperty( Toolkit::VideoView::Property::UNDERLAY, false );
- bool isUnderlay = videoView.GetProperty( Toolkit::VideoView::Property::UNDERLAY ).Get< bool >();
- DALI_TEST_CHECK( !isUnderlay );
+ videoView.SetProperty(Toolkit::VideoView::Property::UNDERLAY, false);
+ bool isUnderlay = videoView.GetProperty(Toolkit::VideoView::Property::UNDERLAY).Get<bool>();
+ DALI_TEST_CHECK(!isUnderlay);
- application.GetScene().Add( videoView );
- videoView.SetProperty( VideoView::Property::VIDEO, "testvideo" );
+ application.GetScene().Add(videoView);
+ videoView.SetProperty(VideoView::Property::VIDEO, "testvideo");
Property::Map customShader;
- customShader.Insert( "vertexShader", VERTEX_SHADER );
+ customShader.Insert("vertexShader", VERTEX_SHADER);
Property::Map map;
- map.Insert( "shader", customShader );
+ map.Insert("shader", customShader);
- videoView.SetProperty( VideoView::Property::VIDEO, map );
+ videoView.SetProperty(VideoView::Property::VIDEO, map);
- Property::Map map2;
- Property::Value value = videoView.GetProperty( VideoView::Property::VIDEO );
+ Property::Map map2;
+ Property::Value value = videoView.GetProperty(VideoView::Property::VIDEO);
- DALI_TEST_CHECK( !value.Get( map2 ) );
+ DALI_TEST_CHECK(!value.Get(map2));
END_TEST;
}
ToolkitApplication::DECODED_IMAGES_SUPPORTED = true;
VideoView view = VideoView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- application.GetScene().Add( view );
+ application.GetScene().Add(view);
view.Play();
application.SendNotification();
application.Render();
- bool isUnderlay = view.GetProperty( Toolkit::VideoView::Property::UNDERLAY ).Get< bool >();
- DALI_TEST_CHECK( isUnderlay );
+ bool isUnderlay = view.GetProperty(Toolkit::VideoView::Property::UNDERLAY).Get<bool>();
+ DALI_TEST_CHECK(isUnderlay);
view.Play();
- view.SetProperty( Toolkit::VideoView::Property::UNDERLAY, false );
- isUnderlay = view.GetProperty( Toolkit::VideoView::Property::UNDERLAY ).Get< bool >();
- DALI_TEST_CHECK( !isUnderlay );
+ view.SetProperty(Toolkit::VideoView::Property::UNDERLAY, false);
+ isUnderlay = view.GetProperty(Toolkit::VideoView::Property::UNDERLAY).Get<bool>();
+ DALI_TEST_CHECK(!isUnderlay);
view.Play();
- view.SetProperty( Toolkit::VideoView::Property::UNDERLAY, true );
- isUnderlay = view.GetProperty( Toolkit::VideoView::Property::UNDERLAY ).Get< bool >();
- DALI_TEST_CHECK( isUnderlay );
+ view.SetProperty(Toolkit::VideoView::Property::UNDERLAY, true);
+ isUnderlay = view.GetProperty(Toolkit::VideoView::Property::UNDERLAY).Get<bool>();
+ DALI_TEST_CHECK(isUnderlay);
// If platform api doesn't provide any API or feature for decoded images of video,
// UNDERLAY should be true
ToolkitApplication::DECODED_IMAGES_SUPPORTED = false;
- view.SetProperty( Toolkit::VideoView::Property::UNDERLAY, false );
- isUnderlay = view.GetProperty( Toolkit::VideoView::Property::UNDERLAY ).Get< bool >();
- DALI_TEST_CHECK( isUnderlay );
+ view.SetProperty(Toolkit::VideoView::Property::UNDERLAY, false);
+ isUnderlay = view.GetProperty(Toolkit::VideoView::Property::UNDERLAY).Get<bool>();
+ DALI_TEST_CHECK(isUnderlay);
// For coverage
ToolkitApplication::DECODED_IMAGES_SUPPORTED = true;
- view.SetProperty( Toolkit::VideoView::Property::UNDERLAY, true );
- view.SetProperty( Toolkit::VideoView::Property::UNDERLAY, false );
- isUnderlay = view.GetProperty( Toolkit::VideoView::Property::UNDERLAY ).Get< bool >();
- DALI_TEST_CHECK( !isUnderlay );
+ view.SetProperty(Toolkit::VideoView::Property::UNDERLAY, true);
+ view.SetProperty(Toolkit::VideoView::Property::UNDERLAY, false);
+ isUnderlay = view.GetProperty(Toolkit::VideoView::Property::UNDERLAY).Get<bool>();
+ DALI_TEST_CHECK(!isUnderlay);
view.Stop();
tet_infoline("UtcDaliVideoViewPropertyPlayPosition");
VideoView view = VideoView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- application.GetScene().Add( view );
+ application.GetScene().Add(view);
view.Play();
application.SendNotification();
application.Render();
- int playPos = view.GetProperty( Toolkit::VideoView::Property::PLAY_POSITION ).Get< int >();
- DALI_TEST_CHECK( playPos == 0 );
+ int playPos = view.GetProperty(Toolkit::VideoView::Property::PLAY_POSITION).Get<int>();
+ DALI_TEST_CHECK(playPos == 0);
- view.SetProperty( Toolkit::VideoView::Property::PLAY_POSITION, 10 );
- playPos = view.GetProperty( Toolkit::VideoView::Property::PLAY_POSITION ).Get< int >();
+ view.SetProperty(Toolkit::VideoView::Property::PLAY_POSITION, 10);
+ playPos = view.GetProperty(Toolkit::VideoView::Property::PLAY_POSITION).Get<int>();
// Actually setting play position will be async
// Actual platform result may be different.
- DALI_TEST_CHECK( playPos == 10 );
+ DALI_TEST_CHECK(playPos == 10);
END_TEST;
}
ToolkitTestApplication application;
tet_infoline("UtcDaliVideoViewNew2");
- VideoView view = VideoView::New( true );
- DALI_TEST_CHECK( view );
+ VideoView view = VideoView::New(true);
+ DALI_TEST_CHECK(view);
- application.GetScene().Add( view );
+ application.GetScene().Add(view);
view.Play();
application.SendNotification();
application.Render();
- VideoView view2 = VideoView::New( "", false );
- DALI_TEST_CHECK( view2 );
+ VideoView view2 = VideoView::New("", false);
+ DALI_TEST_CHECK(view2);
- application.GetScene().Add( view2 );
+ application.GetScene().Add(view2);
view2.Play();
application.SendNotification();
ToolkitTestApplication application;
tet_infoline("UtcDaliVideoViewRaiseAboveLowerBelow");
- VideoView view = VideoView::New( true );
- DALI_TEST_CHECK( view );
+ VideoView view = VideoView::New(true);
+ DALI_TEST_CHECK(view);
- application.GetScene().Add( view );
+ application.GetScene().Add(view);
view.Play();
application.SendNotification();
application.Render();
- VideoView view2 = VideoView::New( "", false );
- DALI_TEST_CHECK( view2 );
+ VideoView view2 = VideoView::New("", false);
+ DALI_TEST_CHECK(view2);
- application.GetScene().Add( view2 );
+ application.GetScene().Add(view2);
view2.Play();
application.SendNotification();
ToolkitTestApplication application;
tet_infoline("UtcDaliVideoViewRaiseTopLowerBottom");
- VideoView view = VideoView::New( true );
- DALI_TEST_CHECK( view );
+ VideoView view = VideoView::New(true);
+ DALI_TEST_CHECK(view);
- application.GetScene().Add( view );
+ application.GetScene().Add(view);
view.Play();
application.SendNotification();
application.Render();
- VideoView view2 = VideoView::New( "", false );
- DALI_TEST_CHECK( view2 );
+ VideoView view2 = VideoView::New("", false);
+ DALI_TEST_CHECK(view2);
- application.GetScene().Add( view2 );
+ application.GetScene().Add(view2);
view2.Play();
application.SendNotification();
END_TEST;
}
-
int UtcDaliVideoViewPropertyDisplayMode(void)
{
ToolkitTestApplication application;
tet_infoline("UtcDaliVideoViewPropertyDisplayMode");
VideoView view = VideoView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- application.GetScene().Add( view );
+ application.GetScene().Add(view);
view.Play();
application.SendNotification();
application.Render();
- view.SetProperty( Toolkit::VideoView::Property::DISPLAY_MODE, Toolkit::VideoView::DisplayMode::DST_ROI );
- int displayMode = view.GetProperty( Toolkit::VideoView::Property::DISPLAY_MODE ).Get< int >();
- DALI_TEST_CHECK( displayMode == Toolkit::VideoView::DisplayMode::DST_ROI );
+ view.SetProperty(Toolkit::VideoView::Property::DISPLAY_MODE, Toolkit::VideoView::DisplayMode::DST_ROI);
+ int displayMode = view.GetProperty(Toolkit::VideoView::Property::DISPLAY_MODE).Get<int>();
+ DALI_TEST_CHECK(displayMode == Toolkit::VideoView::DisplayMode::DST_ROI);
END_TEST;
}
-
int UtcDaliVideoViewCustomShader(void)
{
ToolkitTestApplication application;
- tet_infoline( "VideoView with custom shader" );
+ tet_infoline("VideoView with custom shader");
- VideoView view = VideoView::New( false );
- DALI_TEST_CHECK( view );
+ VideoView view = VideoView::New(false);
+ DALI_TEST_CHECK(view);
ToolkitApplication::DECODED_IMAGES_SUPPORTED = true;
- view.SetProperty( Toolkit::VideoView::Property::UNDERLAY, false );
- bool isUnderlay = view.GetProperty( Toolkit::VideoView::Property::UNDERLAY ).Get< bool >();
- DALI_TEST_CHECK( !isUnderlay );
+ view.SetProperty(Toolkit::VideoView::Property::UNDERLAY, false);
+ bool isUnderlay = view.GetProperty(Toolkit::VideoView::Property::UNDERLAY).Get<bool>();
+ DALI_TEST_CHECK(!isUnderlay);
- application.GetScene().Add( view );
- view.SetProperty( VideoView::Property::VIDEO, "testvideo" );
+ application.GetScene().Add(view);
+ view.SetProperty(VideoView::Property::VIDEO, "testvideo");
/* insert custom shader */
Property::Map customShader;
- std::string fragmentShaderString;
- fragmentShaderString.reserve( strlen( fragmentShaderPrefix ) + strlen( FRAGMENT_SHADER ) );
- fragmentShaderString.append( fragmentShaderPrefix );
- fragmentShaderString.append( FRAGMENT_SHADER );
- customShader.Insert( "vertexShader", VERTEX_SHADER );
- customShader.Insert( "fragmentShader", fragmentShaderString );
+ std::string fragmentShaderString;
+ fragmentShaderString.reserve(strlen(fragmentShaderPrefix) + strlen(FRAGMENT_SHADER));
+ fragmentShaderString.append(fragmentShaderPrefix);
+ fragmentShaderString.append(FRAGMENT_SHADER);
+ customShader.Insert("vertexShader", VERTEX_SHADER);
+ customShader.Insert("fragmentShader", fragmentShaderString);
Property::Map map;
- map.Insert( "shader", customShader );
+ map.Insert("shader", customShader);
- view.SetProperty( VideoView::Property::VIDEO, map );
+ view.SetProperty(VideoView::Property::VIDEO, map);
/* do render for check custom shader */
- application.GetScene().Add( view );
+ application.GetScene().Add(view);
view.Play();
application.SendNotification();
application.Render();
/* get renderer */
- DALI_TEST_CHECK( view.GetRendererCount() == 1u );
- Renderer renderer = view.GetRendererAt( 0 );
- Shader shader = renderer.GetShader();
- DALI_TEST_CHECK( shader );
+ DALI_TEST_CHECK(view.GetRendererCount() == 1u);
+ Renderer renderer = view.GetRendererAt(0);
+ Shader shader = renderer.GetShader();
+ DALI_TEST_CHECK(shader);
- Property::Value value = shader.GetProperty(Shader::Property::PROGRAM);
- Property::Map* shaderMap = value.GetMap();
- DALI_TEST_CHECK( shaderMap );
+ Property::Value value = shader.GetProperty(Shader::Property::PROGRAM);
+ Property::Map* shaderMap = value.GetMap();
+ DALI_TEST_CHECK(shaderMap);
- Property::Value* fragment = shaderMap->Find( "fragment" ); // fragment key name from shader-impl.cpp
- DALI_TEST_EQUALS( fragmentShaderString, fragment->Get<std::string>(), TEST_LOCATION );
+ Property::Value* fragment = shaderMap->Find("fragment"); // fragment key name from shader-impl.cpp
+ DALI_TEST_EQUALS(fragmentShaderString, fragment->Get<std::string>(), TEST_LOCATION);
- Property::Value* vertex = shaderMap->Find( "vertex" ); // vertex key name from shader-impl.cpp
- DALI_TEST_EQUALS( VERTEX_SHADER, vertex->Get<std::string>(), TEST_LOCATION );
+ Property::Value* vertex = shaderMap->Find("vertex"); // vertex key name from shader-impl.cpp
+ DALI_TEST_EQUALS(VERTEX_SHADER, vertex->Get<std::string>(), TEST_LOCATION);
END_TEST;
}
void CheckSignalReceived()
{
- if (!mSignalReceived)
+ if(!mSignalReceived)
{
tet_printf("Expected Finish signal was not received\n");
tet_result(TET_FAIL);
void CheckSignalNotReceived()
{
- if (mSignalReceived)
+ if(mSignalReceived)
{
tet_printf("Unexpected Finish signal was received\n");
tet_result(TET_FAIL);
{
ToolkitTestApplication application;
- VideoView videoView = DevelVideoView::New( Dali::VideoSyncMode::ENABLED );
- DALI_TEST_CHECK( videoView );
+ VideoView videoView = DevelVideoView::New(Dali::VideoSyncMode::ENABLED);
+ DALI_TEST_CHECK(videoView);
- application.GetScene().Add( videoView );
+ application.GetScene().Add(videoView);
// Build the animation
- float durationSeconds(1.0f);
+ float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
// Start the animation
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
animation.AnimateTo(Property(videoView, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
- DevelVideoView::PlayAnimation( videoView, animation );
+ DevelVideoView::PlayAnimation(videoView, animation);
- bool signalReceived(false);
+ bool signalReceived(false);
AnimationFinishCheck finishCheck(signalReceived);
animation.FinishedSignal().Connect(&application, finishCheck);
application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*1000.0f) - 1u/*just less than the animation duration*/);
+ application.Render(static_cast<unsigned int>(durationSeconds * 1000.0f) - 1u /*just less than the animation duration*/);
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- application.Render(2u/*just beyond the animation duration*/);
+ application.Render(2u /*just beyond the animation duration*/);
// We did expect the animation to finish
application.SendNotification();
finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( targetPosition, videoView.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION );
+ DALI_TEST_EQUALS(targetPosition, videoView.GetCurrentProperty<Vector3>(Actor::Property::POSITION), TEST_LOCATION);
// Restart the animation, with a different duration
finishCheck.Reset();
{
ToolkitTestApplication application;
- VideoView videoView = DevelVideoView::New( Dali::VideoSyncMode::DISABLED );
- DALI_TEST_CHECK( videoView );
+ VideoView videoView = DevelVideoView::New(Dali::VideoSyncMode::DISABLED);
+ DALI_TEST_CHECK(videoView);
- application.GetScene().Add( videoView );
+ application.GetScene().Add(videoView);
// Build the animation
- float durationSeconds(1.0f);
+ float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
// Start the animation
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
animation.AnimateTo(Property(videoView, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
- DevelVideoView::PlayAnimation( videoView, animation );
+ DevelVideoView::PlayAnimation(videoView, animation);
- bool signalReceived(false);
+ bool signalReceived(false);
AnimationFinishCheck finishCheck(signalReceived);
animation.FinishedSignal().Connect(&application, finishCheck);
application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*1000.0f) - 1u/*just less than the animation duration*/);
+ application.Render(static_cast<unsigned int>(durationSeconds * 1000.0f) - 1u /*just less than the animation duration*/);
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- application.Render(2u/*just beyond the animation duration*/);
+ application.Render(2u /*just beyond the animation duration*/);
// We did expect the animation to finish
application.SendNotification();
finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( targetPosition, videoView.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION );
+ DALI_TEST_EQUALS(targetPosition, videoView.GetCurrentProperty<Vector3>(Actor::Property::POSITION), TEST_LOCATION);
// Restart the animation, with a different duration
finishCheck.Reset();
int UtcDaliVideoViewResizeWithSynchronization(void)
{
ToolkitTestApplication application;
- VideoView videoView = DevelVideoView::New( Dali::VideoSyncMode::ENABLED );
- DALI_TEST_CHECK( videoView );
+ VideoView videoView = DevelVideoView::New(Dali::VideoSyncMode::ENABLED);
+ DALI_TEST_CHECK(videoView);
- application.GetScene().Add( videoView );
+ application.GetScene().Add(videoView);
Vector3 vector(50.0f, 200.0f, 0.0f);
- videoView.SetProperty( Actor::Property::SIZE, vector );
+ videoView.SetProperty(Actor::Property::SIZE, vector);
application.SendNotification();
application.Render();
- DALI_TEST_CHECK(vector == videoView.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ));
+ DALI_TEST_CHECK(vector == videoView.GetCurrentProperty<Vector3>(Actor::Property::SIZE));
END_TEST;
}
ToolkitTestApplication application;
tet_infoline("UtcDaliVideoViewSynchronizationForWindowRotation");
- Window window = Window::New(PositionSize(0,0,100,100) ,"", false);
- DALI_TEST_CHECK( window );
+ Window window = Window::New(PositionSize(0, 0, 100, 100), "", false);
+ DALI_TEST_CHECK(window);
- VideoView view = VideoView::New( true );
- DALI_TEST_CHECK( view );
+ VideoView view = VideoView::New(true);
+ DALI_TEST_CHECK(view);
- window.Add( view );
+ window.Add(view);
view.Play();
- DevelWindow::SetPositionSize(window,PositionSize(0,0,480, 240));
+ DevelWindow::SetPositionSize(window, PositionSize(0, 0, 480, 240));
application.SendNotification();
application.Render();
int UtcDaliVisualUpdatePropertyChangeShader04(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualUpdatePropertyChangeShader04: Test update property by DoAction during Animation. Change the shader case" );
+ tet_infoline("UtcDaliVisualUpdatePropertyChangeShader04: Test update property by DoAction during Animation. Change the shader case");
TraceCallStack& callStack = application.GetGraphicsController().mCallStack;
VisualFactory factory = VisualFactory::Get();
Property::Map propertyMap;
// Case ImageVisual
- propertyMap[Visual::Property::TYPE] = Visual::Type::IMAGE;
- propertyMap[ImageVisual::Property::URL] = TEST_IMAGE_FILE_NAME;
+ propertyMap[Visual::Property::TYPE] = Visual::Type::IMAGE;
+ propertyMap[ImageVisual::Property::URL] = TEST_IMAGE_FILE_NAME;
propertyMap[DevelVisual::Property::CORNER_RADIUS] = 10.0f;
Visual::Base imageVisual = factory.CreateVisual(propertyMap);
- DummyControl dummyControl = DummyControl::New(true);
- Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+ DummyControl dummyControl = DummyControl::New(true);
+ Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, imageVisual);
dummyControl[Actor::Property::SIZE] = Vector2(200.f, 200.f);
application.GetScene().Add(dummyControl);
// Get shader
{
- Renderer renderer = dummyControl.GetRendererAt( 0 );
- Shader shader = renderer.GetShader();
- Property::Value value = shader.GetProperty( Shader::Property::PROGRAM );
- Property::Map* map = value.GetMap();
- DALI_TEST_CHECK( map );
-
- Property::Value* fragment = map->Find( "fragment" ); // fragment key name from shader-impl.cpp
- DALI_TEST_CHECK( fragment );
+ Renderer renderer = dummyControl.GetRendererAt(0);
+ Shader shader = renderer.GetShader();
+ Property::Value value = shader.GetProperty(Shader::Property::PROGRAM);
+ Property::Map* map = value.GetMap();
+ DALI_TEST_CHECK(map);
+
+ Property::Value* fragment = map->Find("fragment"); // fragment key name from shader-impl.cpp
+ DALI_TEST_CHECK(fragment);
std::string fragmentShader;
- DALI_TEST_CHECK( fragment->Get(fragmentShader) );
- DALI_TEST_CHECK( fragmentShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos );
- DALI_TEST_CHECK( fragmentShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos );
-
- Property::Value* vertex = map->Find( "vertex" ); // vertex key name from shader-impl.cpp
- std::string vertexShader;
- DALI_TEST_CHECK( vertex->Get(vertexShader) );
- DALI_TEST_CHECK( vertexShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos );
- DALI_TEST_CHECK( vertexShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos );
+ DALI_TEST_CHECK(fragment->Get(fragmentShader));
+ DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos);
+ DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos);
+
+ Property::Value* vertex = map->Find("vertex"); // vertex key name from shader-impl.cpp
+ std::string vertexShader;
+ DALI_TEST_CHECK(vertex->Get(vertexShader));
+ DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos);
+ DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos);
}
callStack.Reset();
callStack.Enable(true);
// Get shader
{
- Renderer renderer = dummyControl.GetRendererAt( 0 );
- Shader shader = renderer.GetShader();
- Property::Value value = shader.GetProperty( Shader::Property::PROGRAM );
- Property::Map* map = value.GetMap();
- DALI_TEST_CHECK( map );
-
- Property::Value* fragment = map->Find( "fragment" ); // fragment key name from shader-impl.cpp
- DALI_TEST_CHECK( fragment );
+ Renderer renderer = dummyControl.GetRendererAt(0);
+ Shader shader = renderer.GetShader();
+ Property::Value value = shader.GetProperty(Shader::Property::PROGRAM);
+ Property::Map* map = value.GetMap();
+ DALI_TEST_CHECK(map);
+
+ Property::Value* fragment = map->Find("fragment"); // fragment key name from shader-impl.cpp
+ DALI_TEST_CHECK(fragment);
std::string fragmentShader;
- DALI_TEST_CHECK( fragment->Get(fragmentShader) );
- DALI_TEST_CHECK( fragmentShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos );
+ DALI_TEST_CHECK(fragment->Get(fragmentShader));
+ DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos);
// Note : mAlwaysUsingCornerRadius is true.
- DALI_TEST_CHECK( fragmentShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos );
+ DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos);
- Property::Value* vertex = map->Find( "vertex" ); // vertex key name from shader-impl.cpp
- std::string vertexShader;
- DALI_TEST_CHECK( vertex->Get(vertexShader) );
- DALI_TEST_CHECK( vertexShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos );
+ Property::Value* vertex = map->Find("vertex"); // vertex key name from shader-impl.cpp
+ std::string vertexShader;
+ DALI_TEST_CHECK(vertex->Get(vertexShader));
+ DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos);
// Note : mAlwaysUsingCornerRadius is true.
- DALI_TEST_CHECK( vertexShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos );
+ DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos);
}
callStack.Enable(false);
// Shader not changed
- DALI_TEST_CHECK( !callStack.FindMethod("CreateShader") );
+ DALI_TEST_CHECK(!callStack.FindMethod("CreateShader"));
callStack.Reset();
callStack.Enable(true);
DevelControl::DoAction(dummyControl, DummyControl::Property::TEST_VISUAL, DevelVisual::Action::UPDATE_PROPERTY, targetPropertyMap);
Property::Map resultMap;
- imageVisual.CreatePropertyMap( resultMap );
+ imageVisual.CreatePropertyMap(resultMap);
// Test property values: they should be updated
Property::Value* cornerRadiusValue = resultMap.Find(DevelVisual::Property::CORNER_RADIUS, Property::VECTOR4);
// Get shader
{
- Renderer renderer = dummyControl.GetRendererAt( 0 );
- Shader shader = renderer.GetShader();
- Property::Value value = shader.GetProperty( Shader::Property::PROGRAM );
- Property::Map* map = value.GetMap();
- DALI_TEST_CHECK( map );
-
- Property::Value* fragment = map->Find( "fragment" ); // fragment key name from shader-impl.cpp
- DALI_TEST_CHECK( fragment );
+ Renderer renderer = dummyControl.GetRendererAt(0);
+ Shader shader = renderer.GetShader();
+ Property::Value value = shader.GetProperty(Shader::Property::PROGRAM);
+ Property::Map* map = value.GetMap();
+ DALI_TEST_CHECK(map);
+
+ Property::Value* fragment = map->Find("fragment"); // fragment key name from shader-impl.cpp
+ DALI_TEST_CHECK(fragment);
std::string fragmentShader;
- DALI_TEST_CHECK( fragment->Get(fragmentShader) );
- DALI_TEST_CHECK( fragmentShader.find("#define IS_REQUIRED_BORDERLINE 1") != std::string::npos );
+ DALI_TEST_CHECK(fragment->Get(fragmentShader));
+ DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_BORDERLINE 1") != std::string::npos);
// Note : mAlwaysUsingCornerRadius is true.
- DALI_TEST_CHECK( fragmentShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos );
+ DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos);
- Property::Value* vertex = map->Find( "vertex" ); // vertex key name from shader-impl.cpp
- std::string vertexShader;
- DALI_TEST_CHECK( vertex->Get(vertexShader) );
- DALI_TEST_CHECK( vertexShader.find("#define IS_REQUIRED_BORDERLINE 1") != std::string::npos );
+ Property::Value* vertex = map->Find("vertex"); // vertex key name from shader-impl.cpp
+ std::string vertexShader;
+ DALI_TEST_CHECK(vertex->Get(vertexShader));
+ DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_BORDERLINE 1") != std::string::npos);
// Note : mAlwaysUsingCornerRadius is true.
- DALI_TEST_CHECK( vertexShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos );
+ DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos);
}
// Send shader compile signal
callStack.Enable(false);
// Shader changed
- DALI_TEST_CHECK( callStack.FindMethod("CreateShader") );
+ DALI_TEST_CHECK(callStack.FindMethod("CreateShader"));
END_TEST;
}
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
* limitations under the License.
*/
-#include <iostream>
#include <stdlib.h>
-#include <dali-toolkit-test-suite-utils.h>
-#include <toolkit-timer.h>
+#include <iostream>
+
#include <toolkit-event-thread-callback.h>
+#include <toolkit-timer.h>
+#include "dummy-control.h"
+
+#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/utility/npatch-utilities.h>
#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
#include <dali-toolkit/internal/visuals/npatch-loader.h>
#include <dali/devel-api/adaptor-framework/image-loading.h>
-#include <dali-toolkit/devel-api/utility/npatch-utilities.h>
-#include "dummy-control.h"
-
#include <dali/integration-api/debug.h>
using namespace Dali;
{
typedef Toolkit::NPatchUtility::StretchRanges StretchRanges;
-const char* TEST_9_PATCH_FILE_NAME = TEST_RESOURCE_DIR "/demo-tile-texture-focused.9.png";
-const char* TEST_NPATCH_FILE_NAME = TEST_RESOURCE_DIR "/heartsframe.9.png";
-const char* TEST_SVG_FILE_NAME = TEST_RESOURCE_DIR "/svg1.svg";
-const char* TEST_OBJ_FILE_NAME = TEST_RESOURCE_DIR "/Cube.obj";
-const char* TEST_MTL_FILE_NAME = TEST_RESOURCE_DIR "/ToyRobot-Metal.mtl";
+const char* TEST_9_PATCH_FILE_NAME = TEST_RESOURCE_DIR "/demo-tile-texture-focused.9.png";
+const char* TEST_NPATCH_FILE_NAME = TEST_RESOURCE_DIR "/heartsframe.9.png";
+const char* TEST_SVG_FILE_NAME = TEST_RESOURCE_DIR "/svg1.svg";
+const char* TEST_OBJ_FILE_NAME = TEST_RESOURCE_DIR "/Cube.obj";
+const char* TEST_MTL_FILE_NAME = TEST_RESOURCE_DIR "/ToyRobot-Metal.mtl";
const char* TEST_SIMPLE_OBJ_FILE_NAME = TEST_RESOURCE_DIR "/Cube-Points-Only.obj";
const char* TEST_SIMPLE_MTL_FILE_NAME = TEST_RESOURCE_DIR "/ToyRobot-Metal-Simple.mtl";
-const char* TEST_AUX_IMAGE = TEST_RESOURCE_DIR "/folder_appicon_empty_bg.png";
-const char* TEST_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/gallery-small-1.jpg";
+const char* TEST_AUX_IMAGE = TEST_RESOURCE_DIR "/folder_appicon_empty_bg.png";
+const char* TEST_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/gallery-small-1.jpg";
// resolution: 50*50, frame count: 4, frame delay: 0.2 second for each frame
const char* TEST_GIF_FILE_NAME = TEST_RESOURCE_DIR "/anim.gif";
// resolution: 34*34, pixel format: RGBA8888
static const char* gImage_34_RGBA = TEST_RESOURCE_DIR "/icon-edit.png";
-
Property::Map DefaultTransform()
{
Property::Map transformMap;
transformMap
- .Add( Toolkit::Visual::Transform::Property::OFFSET, Vector2(0.0f, 0.0f) )
- .Add( Toolkit::Visual::Transform::Property::SIZE, Vector2(1.0f, 1.0f) )
- .Add( Toolkit::Visual::Transform::Property::ORIGIN, Toolkit::Align::CENTER )
- .Add( Toolkit::Visual::Transform::Property::ANCHOR_POINT, Toolkit::Align::CENTER )
- .Add( Toolkit::Visual::Transform::Property::OFFSET_POLICY, Vector2( Toolkit::Visual::Transform::Policy::RELATIVE, Toolkit::Visual::Transform::Policy::RELATIVE ) )
- .Add( Toolkit::Visual::Transform::Property::SIZE_POLICY, Vector2( Toolkit::Visual::Transform::Policy::RELATIVE, Toolkit::Visual::Transform::Policy::RELATIVE ) );
+ .Add(Toolkit::Visual::Transform::Property::OFFSET, Vector2(0.0f, 0.0f))
+ .Add(Toolkit::Visual::Transform::Property::SIZE, Vector2(1.0f, 1.0f))
+ .Add(Toolkit::Visual::Transform::Property::ORIGIN, Toolkit::Align::CENTER)
+ .Add(Toolkit::Visual::Transform::Property::ANCHOR_POINT, Toolkit::Align::CENTER)
+ .Add(Toolkit::Visual::Transform::Property::OFFSET_POLICY, Vector2(Toolkit::Visual::Transform::Policy::RELATIVE, Toolkit::Visual::Transform::Policy::RELATIVE))
+ .Add(Toolkit::Visual::Transform::Property::SIZE_POLICY, Vector2(Toolkit::Visual::Transform::Policy::RELATIVE, Toolkit::Visual::Transform::Policy::RELATIVE));
return transformMap;
}
-void TestVisualRender( ToolkitTestApplication& application,
- DummyControl& actor,
- Visual::Base& visual )
+void TestVisualRender(ToolkitTestApplication& application,
+ DummyControl& actor,
+ Visual::Base& visual)
{
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
+ actor.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 0u, TEST_LOCATION);
- application.GetScene().Add( actor );
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render();
application.Render();
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION);
}
-void TestVisualAsynchronousRender( ToolkitTestApplication& application,
- DummyControl& actor,
- Visual::Base& visual )
+void TestVisualAsynchronousRender(ToolkitTestApplication& application,
+ DummyControl& actor,
+ Visual::Base& visual)
{
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
+ actor.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 0u, TEST_LOCATION);
- application.GetScene().Add( actor );
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION);
}
} // namespace
-
void dali_visual_factory_startup(void)
{
test_return_value = TET_UNDEF;
int UtcDaliVisualFactoryGet(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactory" );
+ tet_infoline("UtcDaliVisualFactory");
//Register type
TypeInfo type;
- type = TypeRegistry::Get().GetTypeInfo( "VisualFactory" );
- DALI_TEST_CHECK( type );
+ type = TypeRegistry::Get().GetTypeInfo("VisualFactory");
+ DALI_TEST_CHECK(type);
BaseHandle handle = type.CreateInstance();
- DALI_TEST_CHECK( handle );
+ DALI_TEST_CHECK(handle);
VisualFactory factory;
factory = VisualFactory::Get();
- DALI_TEST_CHECK( factory );
+ DALI_TEST_CHECK(factory);
VisualFactory newFactory = VisualFactory::Get();
- DALI_TEST_CHECK( newFactory );
+ DALI_TEST_CHECK(newFactory);
// Check that visual factory is a singleton
DALI_TEST_CHECK(factory == newFactory);
int UtcDaliVisualFactoryCopyAndAssignment(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryCopyAndAssignment" );
+ tet_infoline("UtcDaliVisualFactoryCopyAndAssignment");
VisualFactory factory = VisualFactory::Get();
- VisualFactory factoryCopy( factory );
+ VisualFactory factoryCopy(factory);
DALI_TEST_CHECK(factory == factoryCopy);
VisualFactory emptyFactory;
- VisualFactory emptyFactoryCopy( emptyFactory );
+ VisualFactory emptyFactoryCopy(emptyFactory);
DALI_TEST_CHECK(emptyFactory == emptyFactoryCopy);
VisualFactory factoryEquals;
VisualFactory emptyFactoryEquals;
emptyFactoryEquals = emptyFactory;
- DALI_TEST_CHECK( emptyFactory == emptyFactoryEquals );
+ DALI_TEST_CHECK(emptyFactory == emptyFactoryEquals);
//self assignment
factory = factory;
- DALI_TEST_CHECK( factory = factoryCopy );
+ DALI_TEST_CHECK(factory = factoryCopy);
END_TEST;
}
int UtcDaliVisualFactoryGetColorVisual1(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetColorVisual1: Request color visual with a Property::Map" );
+ tet_infoline("UtcDaliVisualFactoryGetColorVisual1: Request color visual with a Property::Map");
static std::vector<UniformData> customUniforms =
- {
- UniformData("mixColor", Property::Type::VECTOR3),
- };
+ {
+ UniformData("mixColor", Property::Type::VECTOR3),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
VisualFactory factory = VisualFactory::Get();
- DALI_TEST_CHECK( factory );
+ DALI_TEST_CHECK(factory);
Property::Map propertyMap;
- Vector4 testColor( 1.f, 0.5f, 0.3f, 0.2f );
- propertyMap.Insert(Visual::Property::TYPE, Visual::COLOR);
- propertyMap.Insert(ColorVisual::Property::MIX_COLOR, testColor);
+ Vector4 testColor(1.f, 0.5f, 0.3f, 0.2f);
+ propertyMap.Insert(Visual::Property::TYPE, Visual::COLOR);
+ propertyMap.Insert(ColorVisual::Property::MIX_COLOR, testColor);
Visual::Base visual = factory.CreateVisual(propertyMap);
- DALI_TEST_CHECK( visual );
+ DALI_TEST_CHECK(visual);
DummyControl actor = DummyControl::New(true);
- TestVisualRender( application, actor, visual );
+ TestVisualRender(application, actor, visual);
- Vector3 actualValue(Vector4::ZERO);
- Vector4 actualColor(Vector4::ZERO);
+ Vector3 actualValue(Vector4::ZERO);
+ Vector4 actualColor(Vector4::ZERO);
TestGlAbstraction& gl = application.GetGlAbstraction();
- DALI_TEST_CHECK( gl.GetUniformValue<Vector3>( "mixColor", actualValue ) );
- DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uColor", actualColor ) );
- DALI_TEST_EQUALS( actualValue, Vector3(testColor), TEST_LOCATION );
- DALI_TEST_EQUALS( actualColor.a, testColor.a, TEST_LOCATION );
+ DALI_TEST_CHECK(gl.GetUniformValue<Vector3>("mixColor", actualValue));
+ DALI_TEST_CHECK(gl.GetUniformValue<Vector4>("uColor", actualColor));
+ DALI_TEST_EQUALS(actualValue, Vector3(testColor), TEST_LOCATION);
+ DALI_TEST_EQUALS(actualColor.a, testColor.a, TEST_LOCATION);
END_TEST;
}
int UtcDaliVisualFactoryGetColorVisual2(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetColorVisual2: Request color visual with a Vector4" );
+ tet_infoline("UtcDaliVisualFactoryGetColorVisual2: Request color visual with a Vector4");
static std::vector<UniformData> customUniforms =
- {
- UniformData("mixColor", Property::Type::VECTOR3),
- };
+ {
+ UniformData("mixColor", Property::Type::VECTOR3),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
VisualFactory factory = VisualFactory::Get();
- DALI_TEST_CHECK( factory );
+ DALI_TEST_CHECK(factory);
- Vector4 testColor( 1.f, 0.5f, 0.3f, 0.2f );
+ Vector4 testColor(1.f, 0.5f, 0.3f, 0.2f);
Dali::Property::Map map;
- map[ Toolkit::Visual::Property::TYPE ] = Visual::COLOR;
- map[ ColorVisual::Property::MIX_COLOR ] = testColor;
- Visual::Base visual = factory.CreateVisual( map );
- DALI_TEST_CHECK( visual );
+ map[Toolkit::Visual::Property::TYPE] = Visual::COLOR;
+ map[ColorVisual::Property::MIX_COLOR] = testColor;
+ Visual::Base visual = factory.CreateVisual(map);
+ DALI_TEST_CHECK(visual);
DummyControl actor = DummyControl::New(true);
- TestVisualRender( application, actor, visual );
+ TestVisualRender(application, actor, visual);
- Vector3 actualValue;
- Vector4 actualColor;
+ Vector3 actualValue;
+ Vector4 actualColor;
TestGlAbstraction& gl = application.GetGlAbstraction();
- DALI_TEST_CHECK( gl.GetUniformValue<Vector3>( "mixColor", actualValue ) );
- DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uColor", actualColor ) );
- DALI_TEST_EQUALS( actualValue, Vector3(testColor), TEST_LOCATION );
- DALI_TEST_EQUALS( actualColor.a, testColor.a, TEST_LOCATION );
+ DALI_TEST_CHECK(gl.GetUniformValue<Vector3>("mixColor", actualValue));
+ DALI_TEST_CHECK(gl.GetUniformValue<Vector4>("uColor", actualColor));
+ DALI_TEST_EQUALS(actualValue, Vector3(testColor), TEST_LOCATION);
+ DALI_TEST_EQUALS(actualColor.a, testColor.a, TEST_LOCATION);
application.GetScene().Remove(actor);
- DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
+ DALI_TEST_CHECK(actor.GetRendererCount() == 0u);
END_TEST;
}
int UtcDaliVisualFactoryGetBorderVisual1(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetBorderVisual1: Request border visual with a Property::Map" );
+ tet_infoline("UtcDaliVisualFactoryGetBorderVisual1: Request border visual with a Property::Map");
static std::vector<UniformData> customUniforms =
- {
- UniformData("borderColor", Property::Type::VECTOR4),
- UniformData("borderSize", Property::Type::FLOAT),
- };
+ {
+ UniformData("borderColor", Property::Type::VECTOR4),
+ UniformData("borderSize", Property::Type::FLOAT),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
VisualFactory factory = VisualFactory::Get();
- DALI_TEST_CHECK( factory );
+ DALI_TEST_CHECK(factory);
Property::Map propertyMap;
- Vector4 testColor( 1.f, 0.5f, 0.3f, 0.2f );
- float testSize = 5.f;
- propertyMap.Insert(Visual::Property::TYPE, Visual::BORDER);
- propertyMap.Insert(BorderVisual::Property::COLOR, testColor);
- propertyMap.Insert(BorderVisual::Property::SIZE, testSize);
+ Vector4 testColor(1.f, 0.5f, 0.3f, 0.2f);
+ float testSize = 5.f;
+ propertyMap.Insert(Visual::Property::TYPE, Visual::BORDER);
+ propertyMap.Insert(BorderVisual::Property::COLOR, testColor);
+ propertyMap.Insert(BorderVisual::Property::SIZE, testSize);
Visual::Base visual = factory.CreateVisual(propertyMap);
- DALI_TEST_CHECK( visual );
+ DALI_TEST_CHECK(visual);
- DummyControl actor = DummyControl::New(true);
+ DummyControl actor = DummyControl::New(true);
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- application.GetScene().Add( actor );
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
+ actor.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+ application.GetScene().Add(actor);
visual.SetTransformAndSize(DefaultTransform(), Vector2(200.f, 200.f));
- DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
- int blendMode = actor.GetRendererAt(0u).GetProperty<int>( Renderer::Property::BLEND_MODE );
- DALI_TEST_EQUALS( static_cast<BlendMode::Type>(blendMode), BlendMode::ON, TEST_LOCATION );
+ DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
+ int blendMode = actor.GetRendererAt(0u).GetProperty<int>(Renderer::Property::BLEND_MODE);
+ DALI_TEST_EQUALS(static_cast<BlendMode::Type>(blendMode), BlendMode::ON, TEST_LOCATION);
TestGlAbstraction& gl = application.GetGlAbstraction();
application.Render(0);
Vector4 actualColor(Vector4::ZERO);
- DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "borderColor", actualColor ) );
- DALI_TEST_EQUALS( actualColor, testColor, TEST_LOCATION );
+ DALI_TEST_CHECK(gl.GetUniformValue<Vector4>("borderColor", actualColor));
+ DALI_TEST_EQUALS(actualColor, testColor, TEST_LOCATION);
float actualSize = 0.f;
- DALI_TEST_CHECK( gl.GetUniformValue<float>( "borderSize", actualSize ) );
- DALI_TEST_EQUALS( actualSize, testSize, TEST_LOCATION );
+ DALI_TEST_CHECK(gl.GetUniformValue<float>("borderSize", actualSize));
+ DALI_TEST_EQUALS(actualSize, testSize, TEST_LOCATION);
actor.Unparent();
- DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
+ DALI_TEST_CHECK(actor.GetRendererCount() == 0u);
END_TEST;
}
int UtcDaliVisualFactoryGetBorderVisual2(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetBorderVisual2: Request border visual with a borderSize and a borderColor" );
+ tet_infoline("UtcDaliVisualFactoryGetBorderVisual2: Request border visual with a borderSize and a borderColor");
static std::vector<UniformData> customUniforms =
- {
- UniformData("borderColor", Property::Type::VECTOR4),
- UniformData("borderSize", Property::Type::FLOAT),
- };
+ {
+ UniformData("borderColor", Property::Type::VECTOR4),
+ UniformData("borderSize", Property::Type::FLOAT),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
VisualFactory factory = VisualFactory::Get();
- DALI_TEST_CHECK( factory );
+ DALI_TEST_CHECK(factory);
- Vector4 testColor( 1.f, 0.5f, 0.3f, 1.f );
- float testSize = 5.f;
+ Vector4 testColor(1.f, 0.5f, 0.3f, 1.f);
+ float testSize = 5.f;
Dali::Property::Map propertyMap;
- propertyMap[ Toolkit::Visual::Property::TYPE ] = Visual::BORDER;
- propertyMap[ BorderVisual::Property::COLOR ] = testColor;
- propertyMap[ BorderVisual::Property::SIZE ] = testSize;
- Visual::Base visual = factory.CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ propertyMap[Toolkit::Visual::Property::TYPE] = Visual::BORDER;
+ propertyMap[BorderVisual::Property::COLOR] = testColor;
+ propertyMap[BorderVisual::Property::SIZE] = testSize;
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- DummyControl actor = DummyControl::New(true);
+ DummyControl actor = DummyControl::New(true);
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- application.GetScene().Add( actor );
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
+ actor.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+ application.GetScene().Add(actor);
visual.SetTransformAndSize(DefaultTransform(), Vector2(200.f, 200.f));
- DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
+ DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
TestGlAbstraction& gl = application.GetGlAbstraction();
application.SendNotification();
application.Render(0);
- int blendMode = actor.GetRendererAt(0u).GetProperty<int>( Renderer::Property::BLEND_MODE );
- DALI_TEST_EQUALS( static_cast<BlendMode::Type>(blendMode), BlendMode::AUTO, TEST_LOCATION );
+ int blendMode = actor.GetRendererAt(0u).GetProperty<int>(Renderer::Property::BLEND_MODE);
+ DALI_TEST_EQUALS(static_cast<BlendMode::Type>(blendMode), BlendMode::AUTO, TEST_LOCATION);
Vector4 actualColor(Vector4::ZERO);
- DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "borderColor", actualColor ) );
- DALI_TEST_EQUALS( actualColor, testColor, TEST_LOCATION );
+ DALI_TEST_CHECK(gl.GetUniformValue<Vector4>("borderColor", actualColor));
+ DALI_TEST_EQUALS(actualColor, testColor, TEST_LOCATION);
float actualSize = 0.f;
- DALI_TEST_CHECK( gl.GetUniformValue<float>( "borderSize", actualSize ) );
- DALI_TEST_EQUALS( actualSize, testSize, TEST_LOCATION );
+ DALI_TEST_CHECK(gl.GetUniformValue<float>("borderSize", actualSize));
+ DALI_TEST_EQUALS(actualSize, testSize, TEST_LOCATION);
actor.Unparent();
// enable the anti-aliasing
Dali::Property::Map map;
- map[ Toolkit::Visual::Property::TYPE ] = Visual::BORDER;
- map[ BorderVisual::Property::COLOR ] = testColor;
- map[ BorderVisual::Property::SIZE ] = testSize;
- map[ BorderVisual::Property::ANTI_ALIASING ] = true;
- visual = factory.CreateVisual( map );
+ map[Toolkit::Visual::Property::TYPE] = Visual::BORDER;
+ map[BorderVisual::Property::COLOR] = testColor;
+ map[BorderVisual::Property::SIZE] = testSize;
+ map[BorderVisual::Property::ANTI_ALIASING] = true;
+ visual = factory.CreateVisual(map);
- dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual );
- application.GetScene().Add( actor );
+ dummyImpl.RegisterVisual(Control::CONTROL_PROPERTY_END_INDEX + 1, visual);
+ application.GetScene().Add(actor);
- blendMode = actor.GetRendererAt(0u).GetProperty<int>( Renderer::Property::BLEND_MODE );
- DALI_TEST_EQUALS( static_cast<BlendMode::Type>(blendMode), BlendMode::ON, TEST_LOCATION );
+ blendMode = actor.GetRendererAt(0u).GetProperty<int>(Renderer::Property::BLEND_MODE);
+ DALI_TEST_EQUALS(static_cast<BlendMode::Type>(blendMode), BlendMode::ON, TEST_LOCATION);
END_TEST;
}
tet_infoline("UtcDaliVisualFactoryGetRadialGradientVisual");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uAlignmentMatrix", Property::Type::MATRIX),
- };
+ {
+ UniformData("uAlignmentMatrix", Property::Type::MATRIX),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
VisualFactory factory = VisualFactory::Get();
- DALI_TEST_CHECK( factory );
+ DALI_TEST_CHECK(factory);
Property::Map propertyMap;
- propertyMap.Insert(Visual::Property::TYPE, Visual::GRADIENT);
+ propertyMap.Insert(Visual::Property::TYPE, Visual::GRADIENT);
Vector2 start(-1.f, -1.f);
Vector2 end(1.f, 1.f);
propertyMap.Insert(GradientVisual::Property::SPREAD_METHOD, GradientVisual::SpreadMethod::REPEAT);
Property::Array stopOffsets;
- stopOffsets.PushBack( 0.2f );
- stopOffsets.PushBack( 0.8f );
+ stopOffsets.PushBack(0.2f);
+ stopOffsets.PushBack(0.8f);
propertyMap.Insert(GradientVisual::Property::STOP_OFFSET, stopOffsets);
Property::Array stopColors;
- stopColors.PushBack( Color::RED );
- stopColors.PushBack( Color::GREEN );
+ stopColors.PushBack(Color::RED);
+ stopColors.PushBack(Color::GREEN);
propertyMap.Insert(GradientVisual::Property::STOP_COLOR, stopColors);
Visual::Base visual = factory.CreateVisual(propertyMap);
- DALI_TEST_CHECK( visual );
+ DALI_TEST_CHECK(visual);
// A lookup texture is generated and pass to shader as sampler
DummyControl actor = DummyControl::New(true);
- TestVisualRender( application, actor, visual );
+ TestVisualRender(application, actor, visual);
END_TEST;
}
tet_infoline("UtcDaliVisualFactoryGetRadialGradientVisual");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uAlignmentMatrix", Property::Type::MATRIX3),
- };
+ {
+ UniformData("uAlignmentMatrix", Property::Type::MATRIX3),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
VisualFactory factory = VisualFactory::Get();
- DALI_TEST_CHECK( factory );
+ DALI_TEST_CHECK(factory);
Property::Map propertyMap;
- propertyMap.Insert(Visual::Property::TYPE, Visual::GRADIENT);
+ propertyMap.Insert(Visual::Property::TYPE, Visual::GRADIENT);
Vector2 center(100.f, 100.f);
- float radius = 100.f;
- propertyMap.Insert(GradientVisual::Property::UNITS, GradientVisual::Units::USER_SPACE);
- propertyMap.Insert(GradientVisual::Property::CENTER, center);
- propertyMap.Insert(GradientVisual::Property::RADIUS, radius);
+ float radius = 100.f;
+ propertyMap.Insert(GradientVisual::Property::UNITS, GradientVisual::Units::USER_SPACE);
+ propertyMap.Insert(GradientVisual::Property::CENTER, center);
+ propertyMap.Insert(GradientVisual::Property::RADIUS, radius);
Property::Array stopOffsets;
- stopOffsets.PushBack( 0.0f );
- stopOffsets.PushBack( 1.f );
- propertyMap.Insert(GradientVisual::Property::STOP_OFFSET, stopOffsets);
+ stopOffsets.PushBack(0.0f);
+ stopOffsets.PushBack(1.f);
+ propertyMap.Insert(GradientVisual::Property::STOP_OFFSET, stopOffsets);
Property::Array stopColors;
- stopColors.PushBack( Color::RED );
- stopColors.PushBack( Color::GREEN );
- propertyMap.Insert(GradientVisual::Property::STOP_COLOR, stopColors);
+ stopColors.PushBack(Color::RED);
+ stopColors.PushBack(Color::GREEN);
+ propertyMap.Insert(GradientVisual::Property::STOP_COLOR, stopColors);
Visual::Base visual = factory.CreateVisual(propertyMap);
- DALI_TEST_CHECK( visual );
+ DALI_TEST_CHECK(visual);
// A lookup texture is generated and pass to shader as sampler
DummyControl actor = DummyControl::New(true);
- TestVisualRender( application, actor, visual );
+ TestVisualRender(application, actor, visual);
- Matrix3 alignMatrix( radius, 0.f, 0.f, 0.f, radius, 0.f, center.x, center.y, 1.f );
+ Matrix3 alignMatrix(radius, 0.f, 0.f, 0.f, radius, 0.f, center.x, center.y, 1.f);
alignMatrix.Invert();
- Matrix3 actualValue( Matrix3::IDENTITY );
+ Matrix3 actualValue(Matrix3::IDENTITY);
TestGlAbstraction& gl = application.GetGlAbstraction();
- DALI_TEST_CHECK( gl.GetUniformValue<Matrix3>( "uAlignmentMatrix", actualValue ) );
- DALI_TEST_EQUALS( actualValue, alignMatrix, Math::MACHINE_EPSILON_100, TEST_LOCATION );
+ DALI_TEST_CHECK(gl.GetUniformValue<Matrix3>("uAlignmentMatrix", actualValue));
+ DALI_TEST_EQUALS(actualValue, alignMatrix, Math::MACHINE_EPSILON_100, TEST_LOCATION);
END_TEST;
}
tet_infoline("UtcDaliVisualFactoryGetRadialGradientVisual");
VisualFactory factory = VisualFactory::Get();
- DALI_TEST_CHECK( factory );
+ DALI_TEST_CHECK(factory);
Property::Map propertyMap;
- propertyMap.Insert(Visual::Property::TYPE, Visual::GRADIENT);
+ propertyMap.Insert(Visual::Property::TYPE, Visual::GRADIENT);
Vector2 start(-1.f, -1.f);
Vector2 end(1.f, 1.f);
propertyMap.Insert(GradientVisual::Property::SPREAD_METHOD, GradientVisual::SpreadMethod::REPEAT);
Property::Array stopColors;
- stopColors.PushBack( Color::RED );
- stopColors.PushBack( Color::GREEN );
+ stopColors.PushBack(Color::RED);
+ stopColors.PushBack(Color::GREEN);
propertyMap.Insert(GradientVisual::Property::STOP_COLOR, stopColors);
Visual::Base visual = factory.CreateVisual(propertyMap);
- DALI_TEST_CHECK( visual );
+ DALI_TEST_CHECK(visual);
// A lookup texture is generated and pass to shader as sampler
DummyControl actor = DummyControl::New(true);
- TestVisualRender( application, actor, visual );
+ TestVisualRender(application, actor, visual);
- application.GetScene().Remove( actor );
- DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
+ application.GetScene().Remove(actor);
+ DALI_TEST_CHECK(actor.GetRendererCount() == 0u);
END_TEST;
}
int UtcDaliVisualFactoryGetNPatchVisualSynchronousLoad1(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetNPatchVisualSynchronousLoad1: Request 9-patch visual with a Property::Map" );
+ tet_infoline("UtcDaliVisualFactoryGetNPatchVisualSynchronousLoad1: Request 9-patch visual with a Property::Map");
VisualFactory factory = VisualFactory::Get();
- DALI_TEST_CHECK( factory );
+ DALI_TEST_CHECK(factory);
// Get actual size of test image
- ImageDimensions imageSize = Dali::GetClosestImageSize( TEST_9_PATCH_FILE_NAME );
+ ImageDimensions imageSize = Dali::GetClosestImageSize(TEST_9_PATCH_FILE_NAME);
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::N_PATCH );
- propertyMap.Insert( ImageVisual::Property::URL, TEST_9_PATCH_FILE_NAME );
- propertyMap.Insert( ImageVisual::Property::SYNCHRONOUS_LOADING, true );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::N_PATCH);
+ propertyMap.Insert(ImageVisual::Property::URL, TEST_9_PATCH_FILE_NAME);
+ propertyMap.Insert(ImageVisual::Property::SYNCHRONOUS_LOADING, true);
{
- tet_infoline( "whole grid" );
- Visual::Base visual = factory.CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ tet_infoline("whole grid");
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
DummyControl actor = DummyControl::New(true);
- TestVisualRender( application, actor, visual );
+ TestVisualRender(application, actor, visual);
- DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
- Vector2 naturalSize( 0.0f, 0.0f );
- visual.GetNaturalSize( naturalSize );
- DALI_TEST_EQUALS( naturalSize, Vector2( imageSize.GetWidth() - 2.0f, imageSize.GetHeight() - 2.0f ), TEST_LOCATION );
+ Vector2 naturalSize(0.0f, 0.0f);
+ visual.GetNaturalSize(naturalSize);
+ DALI_TEST_EQUALS(naturalSize, Vector2(imageSize.GetWidth() - 2.0f, imageSize.GetHeight() - 2.0f), TEST_LOCATION);
}
- propertyMap.Insert( ImageVisual::Property::BORDER_ONLY, true );
+ propertyMap.Insert(ImageVisual::Property::BORDER_ONLY, true);
{
- tet_infoline( "border only" );
- Visual::Base visual = factory.CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ tet_infoline("border only");
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
DummyControl actor = DummyControl::New(true);
- TestVisualRender( application, actor, visual );
+ TestVisualRender(application, actor, visual);
- DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
- Vector2 naturalSize( 0.0f, 0.0f );
- visual.GetNaturalSize( naturalSize );
- DALI_TEST_EQUALS( naturalSize, Vector2( imageSize.GetWidth() - 2.0f, imageSize.GetHeight() - 2.0f ), TEST_LOCATION );
+ Vector2 naturalSize(0.0f, 0.0f);
+ visual.GetNaturalSize(naturalSize);
+ DALI_TEST_EQUALS(naturalSize, Vector2(imageSize.GetWidth() - 2.0f, imageSize.GetHeight() - 2.0f), TEST_LOCATION);
}
END_TEST;
int UtcDaliVisualFactoryGetNPatchVisualSynchronousLoad2(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetNPatchVisualSynchronousLoad2: Request 9-patch visual with a Property::Map including border" );
+ tet_infoline("UtcDaliVisualFactoryGetNPatchVisualSynchronousLoad2: Request 9-patch visual with a Property::Map including border");
VisualFactory factory = VisualFactory::Get();
- DALI_TEST_CHECK( factory );
+ DALI_TEST_CHECK(factory);
// Get actual size of test image
- ImageDimensions imageSize = Dali::GetClosestImageSize( gImage_34_RGBA );
+ ImageDimensions imageSize = Dali::GetClosestImageSize(gImage_34_RGBA);
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::N_PATCH );
- propertyMap.Insert( ImageVisual::Property::URL, gImage_34_RGBA );
- propertyMap.Insert( ImageVisual::Property::BORDER, Rect< int >( 2, 2, 2, 2 ) );
- propertyMap.Insert( ImageVisual::Property::SYNCHRONOUS_LOADING, true );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::N_PATCH);
+ propertyMap.Insert(ImageVisual::Property::URL, gImage_34_RGBA);
+ propertyMap.Insert(ImageVisual::Property::BORDER, Rect<int>(2, 2, 2, 2));
+ propertyMap.Insert(ImageVisual::Property::SYNCHRONOUS_LOADING, true);
{
- tet_infoline( "whole grid" );
- Visual::Base visual = factory.CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ tet_infoline("whole grid");
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
DummyControl actor = DummyControl::New(true);
- TestVisualRender( application, actor, visual );
+ TestVisualRender(application, actor, visual);
- DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
- Vector2 naturalSize( 0.0f, 0.0f );
- visual.GetNaturalSize( naturalSize );
- DALI_TEST_EQUALS( naturalSize, Vector2( imageSize.GetWidth(), imageSize.GetHeight() ), TEST_LOCATION );
+ Vector2 naturalSize(0.0f, 0.0f);
+ visual.GetNaturalSize(naturalSize);
+ DALI_TEST_EQUALS(naturalSize, Vector2(imageSize.GetWidth(), imageSize.GetHeight()), TEST_LOCATION);
}
- propertyMap.Insert( ImageVisual::Property::BORDER_ONLY, true );
+ propertyMap.Insert(ImageVisual::Property::BORDER_ONLY, true);
{
- tet_infoline( "border only" );
- Visual::Base visual = factory.CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ tet_infoline("border only");
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
DummyControl actor = DummyControl::New(true);
- TestVisualRender( application, actor, visual );
+ TestVisualRender(application, actor, visual);
- DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
- Vector2 naturalSize( 0.0f, 0.0f );
- visual.GetNaturalSize( naturalSize );
- DALI_TEST_EQUALS( naturalSize, Vector2( imageSize.GetWidth(), imageSize.GetHeight() ), TEST_LOCATION );
+ Vector2 naturalSize(0.0f, 0.0f);
+ visual.GetNaturalSize(naturalSize);
+ DALI_TEST_EQUALS(naturalSize, Vector2(imageSize.GetWidth(), imageSize.GetHeight()), TEST_LOCATION);
}
propertyMap.Clear();
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::N_PATCH );
- propertyMap.Insert( ImageVisual::Property::URL, gImage_34_RGBA );
- propertyMap.Insert( ImageVisual::Property::BORDER, Rect< int >( 1, 1, 1, 1 ) );
- propertyMap.Insert( ImageVisual::Property::SYNCHRONOUS_LOADING, true );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::N_PATCH);
+ propertyMap.Insert(ImageVisual::Property::URL, gImage_34_RGBA);
+ propertyMap.Insert(ImageVisual::Property::BORDER, Rect<int>(1, 1, 1, 1));
+ propertyMap.Insert(ImageVisual::Property::SYNCHRONOUS_LOADING, true);
{
- tet_infoline( "whole grid" );
- Visual::Base visual = factory.CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ tet_infoline("whole grid");
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
DummyControl actor = DummyControl::New(true);
- TestVisualRender( application, actor, visual );
+ TestVisualRender(application, actor, visual);
- DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
- Vector2 naturalSize( 0.0f, 0.0f );
- visual.GetNaturalSize( naturalSize );
- DALI_TEST_EQUALS( naturalSize, Vector2( imageSize.GetWidth(), imageSize.GetHeight() ), TEST_LOCATION );
+ Vector2 naturalSize(0.0f, 0.0f);
+ visual.GetNaturalSize(naturalSize);
+ DALI_TEST_EQUALS(naturalSize, Vector2(imageSize.GetWidth(), imageSize.GetHeight()), TEST_LOCATION);
}
END_TEST;
int UtcDaliVisualFactoryGetNPatchVisual1(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetNPatchVisual1: Request 9-patch visual with a Property::Map" );
+ tet_infoline("UtcDaliVisualFactoryGetNPatchVisual1: Request 9-patch visual with a Property::Map");
VisualFactory factory = VisualFactory::Get();
- DALI_TEST_CHECK( factory );
+ DALI_TEST_CHECK(factory);
// Get actual size of test image
- ImageDimensions imageSize = Dali::GetClosestImageSize( TEST_9_PATCH_FILE_NAME );
+ ImageDimensions imageSize = Dali::GetClosestImageSize(TEST_9_PATCH_FILE_NAME);
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::N_PATCH );
- propertyMap.Insert( ImageVisual::Property::URL, TEST_9_PATCH_FILE_NAME );
- propertyMap.Insert( ImageVisual::Property::SYNCHRONOUS_LOADING, false );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::N_PATCH);
+ propertyMap.Insert(ImageVisual::Property::URL, TEST_9_PATCH_FILE_NAME);
+ propertyMap.Insert(ImageVisual::Property::SYNCHRONOUS_LOADING, false);
{
- tet_infoline( "whole grid" );
- Visual::Base visual = factory.CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ tet_infoline("whole grid");
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- Vector2 naturalSize( 0.0f, 0.0f );
- visual.GetNaturalSize( naturalSize );
- DALI_TEST_EQUALS( naturalSize, Vector2( imageSize.GetWidth(), imageSize.GetHeight() ), TEST_LOCATION );
+ Vector2 naturalSize(0.0f, 0.0f);
+ visual.GetNaturalSize(naturalSize);
+ DALI_TEST_EQUALS(naturalSize, Vector2(imageSize.GetWidth(), imageSize.GetHeight()), TEST_LOCATION);
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
DummyControl actor = DummyControl::New(true);
- TestVisualAsynchronousRender( application, actor, visual );
+ TestVisualAsynchronousRender(application, actor, visual);
- DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
- visual.GetNaturalSize( naturalSize );
- DALI_TEST_EQUALS( naturalSize, Vector2( imageSize.GetWidth() - 2.0f, imageSize.GetHeight() - 2.0f ), TEST_LOCATION );
+ visual.GetNaturalSize(naturalSize);
+ DALI_TEST_EQUALS(naturalSize, Vector2(imageSize.GetWidth() - 2.0f, imageSize.GetHeight() - 2.0f), TEST_LOCATION);
}
- propertyMap.Insert( ImageVisual::Property::BORDER_ONLY, true );
+ propertyMap.Insert(ImageVisual::Property::BORDER_ONLY, true);
{
- tet_infoline( "border only" );
- Visual::Base visual = factory.CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ tet_infoline("border only");
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
DummyControl actor = DummyControl::New(true);
- TestVisualRender( application, actor, visual );
+ TestVisualRender(application, actor, visual);
- DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
- Vector2 naturalSize( 0.0f, 0.0f );
- visual.GetNaturalSize( naturalSize );
- DALI_TEST_EQUALS( naturalSize, Vector2( imageSize.GetWidth() - 2.0f, imageSize.GetHeight() - 2.0f ), TEST_LOCATION );
+ Vector2 naturalSize(0.0f, 0.0f);
+ visual.GetNaturalSize(naturalSize);
+ DALI_TEST_EQUALS(naturalSize, Vector2(imageSize.GetWidth() - 2.0f, imageSize.GetHeight() - 2.0f), TEST_LOCATION);
}
END_TEST;
int UtcDaliVisualFactoryGetNPatchVisual2(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetNPatchVisual2: Request 9-patch visual with a Property::Map including border" );
+ tet_infoline("UtcDaliVisualFactoryGetNPatchVisual2: Request 9-patch visual with a Property::Map including border");
VisualFactory factory = VisualFactory::Get();
- DALI_TEST_CHECK( factory );
+ DALI_TEST_CHECK(factory);
// Get actual size of test image
- ImageDimensions imageSize = Dali::GetClosestImageSize( gImage_34_RGBA );
+ ImageDimensions imageSize = Dali::GetClosestImageSize(gImage_34_RGBA);
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::N_PATCH );
- propertyMap.Insert( ImageVisual::Property::URL, gImage_34_RGBA );
- propertyMap.Insert( ImageVisual::Property::BORDER, Rect< int >( 2, 2, 2, 2 ) );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::N_PATCH);
+ propertyMap.Insert(ImageVisual::Property::URL, gImage_34_RGBA);
+ propertyMap.Insert(ImageVisual::Property::BORDER, Rect<int>(2, 2, 2, 2));
{
- tet_infoline( "whole grid" );
- Visual::Base visual = factory.CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ tet_infoline("whole grid");
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
DummyControl actor = DummyControl::New(true);
- TestVisualAsynchronousRender( application, actor, visual );
+ TestVisualAsynchronousRender(application, actor, visual);
- DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
- Vector2 naturalSize( 0.0f, 0.0f );
- visual.GetNaturalSize( naturalSize );
- DALI_TEST_EQUALS( naturalSize, Vector2( imageSize.GetWidth(), imageSize.GetHeight() ), TEST_LOCATION );
+ Vector2 naturalSize(0.0f, 0.0f);
+ visual.GetNaturalSize(naturalSize);
+ DALI_TEST_EQUALS(naturalSize, Vector2(imageSize.GetWidth(), imageSize.GetHeight()), TEST_LOCATION);
}
- propertyMap.Insert( ImageVisual::Property::BORDER_ONLY, true );
+ propertyMap.Insert(ImageVisual::Property::BORDER_ONLY, true);
{
- tet_infoline( "border only" );
- Visual::Base visual = factory.CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ tet_infoline("border only");
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
DummyControl actor = DummyControl::New(true);
- TestVisualRender( application, actor, visual );
+ TestVisualRender(application, actor, visual);
- DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
- Vector2 naturalSize( 0.0f, 0.0f );
- visual.GetNaturalSize( naturalSize );
- DALI_TEST_EQUALS( naturalSize, Vector2( imageSize.GetWidth(), imageSize.GetHeight() ), TEST_LOCATION );
+ Vector2 naturalSize(0.0f, 0.0f);
+ visual.GetNaturalSize(naturalSize);
+ DALI_TEST_EQUALS(naturalSize, Vector2(imageSize.GetWidth(), imageSize.GetHeight()), TEST_LOCATION);
}
propertyMap.Clear();
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::N_PATCH );
- propertyMap.Insert( ImageVisual::Property::URL, gImage_34_RGBA );
- propertyMap.Insert( ImageVisual::Property::BORDER, Rect< int >( 1, 1, 1, 1 ) );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::N_PATCH);
+ propertyMap.Insert(ImageVisual::Property::URL, gImage_34_RGBA);
+ propertyMap.Insert(ImageVisual::Property::BORDER, Rect<int>(1, 1, 1, 1));
{
- tet_infoline( "whole grid" );
- Visual::Base visual = factory.CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ tet_infoline("whole grid");
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
DummyControl actor = DummyControl::New(true);
- TestVisualRender( application, actor, visual );
+ TestVisualRender(application, actor, visual);
- DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
- Vector2 naturalSize( 0.0f, 0.0f );
- visual.GetNaturalSize( naturalSize );
- DALI_TEST_EQUALS( naturalSize, Vector2( imageSize.GetWidth(), imageSize.GetHeight() ), TEST_LOCATION );
+ Vector2 naturalSize(0.0f, 0.0f);
+ visual.GetNaturalSize(naturalSize);
+ DALI_TEST_EQUALS(naturalSize, Vector2(imageSize.GetWidth(), imageSize.GetHeight()), TEST_LOCATION);
}
END_TEST;
int UtcDaliVisualFactoryGetNPatchVisual3(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetNPatchVisual3: Request n-patch visual with a Property::Map" );
+ tet_infoline("UtcDaliVisualFactoryGetNPatchVisual3: Request n-patch visual with a Property::Map");
VisualFactory factory = VisualFactory::Get();
- DALI_TEST_CHECK( factory );
+ DALI_TEST_CHECK(factory);
// Get actual size of test image
- ImageDimensions imageSize = Dali::GetClosestImageSize( TEST_NPATCH_FILE_NAME );
+ ImageDimensions imageSize = Dali::GetClosestImageSize(TEST_NPATCH_FILE_NAME);
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::N_PATCH );
- propertyMap.Insert( ImageVisual::Property::URL, TEST_NPATCH_FILE_NAME );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::N_PATCH);
+ propertyMap.Insert(ImageVisual::Property::URL, TEST_NPATCH_FILE_NAME);
{
- Visual::Base visual = factory.CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
DummyControl actor = DummyControl::New(true);
- TestVisualAsynchronousRender( application, actor, visual );
+ TestVisualAsynchronousRender(application, actor, visual);
- DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
- Vector2 naturalSize( 0.0f, 0.0f );
- visual.GetNaturalSize( naturalSize );
- DALI_TEST_EQUALS( naturalSize, Vector2( imageSize.GetWidth() - 2.0f, imageSize.GetHeight() - 2.0f ), TEST_LOCATION );
+ Vector2 naturalSize(0.0f, 0.0f);
+ visual.GetNaturalSize(naturalSize);
+ DALI_TEST_EQUALS(naturalSize, Vector2(imageSize.GetWidth() - 2.0f, imageSize.GetHeight() - 2.0f), TEST_LOCATION);
}
- propertyMap.Insert( ImageVisual::Property::BORDER_ONLY, true );
+ propertyMap.Insert(ImageVisual::Property::BORDER_ONLY, true);
{
- tet_infoline( "border only" );
- Visual::Base visual = factory.CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ tet_infoline("border only");
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
DummyControl actor = DummyControl::New(true);
- TestVisualRender( application, actor, visual );
+ TestVisualRender(application, actor, visual);
- DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
- Vector2 naturalSize( 0.0f, 0.0f );
- visual.GetNaturalSize( naturalSize );
- DALI_TEST_EQUALS( naturalSize, Vector2( imageSize.GetWidth() - 2.0f, imageSize.GetHeight() - 2.0f ), TEST_LOCATION );
+ Vector2 naturalSize(0.0f, 0.0f);
+ visual.GetNaturalSize(naturalSize);
+ DALI_TEST_EQUALS(naturalSize, Vector2(imageSize.GetWidth() - 2.0f, imageSize.GetHeight() - 2.0f), TEST_LOCATION);
- application.GetScene().Remove( actor );
- DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
+ application.GetScene().Remove(actor);
+ DALI_TEST_CHECK(actor.GetRendererCount() == 0u);
}
END_TEST;
int UtcDaliVisualFactoryGetNPatchVisual4(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetNPatchVisual4: Request 9-patch visual with an image url" );
+ tet_infoline("UtcDaliVisualFactoryGetNPatchVisual4: Request 9-patch visual with an image url");
// Get actual size of test image
- ImageDimensions imageSize = Dali::GetClosestImageSize( TEST_9_PATCH_FILE_NAME );
+ ImageDimensions imageSize = Dali::GetClosestImageSize(TEST_9_PATCH_FILE_NAME);
VisualFactory factory = VisualFactory::Get();
- DALI_TEST_CHECK( factory );
+ DALI_TEST_CHECK(factory);
- Visual::Base visual = factory.CreateVisual( TEST_9_PATCH_FILE_NAME, ImageDimensions() );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = factory.CreateVisual(TEST_9_PATCH_FILE_NAME, ImageDimensions());
+ DALI_TEST_CHECK(visual);
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
DummyControl actor = DummyControl::New(true);
- TestVisualAsynchronousRender( application, actor, visual );
+ TestVisualAsynchronousRender(application, actor, visual);
- DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
- Vector2 naturalSize( 0.0f, 0.0f );
- visual.GetNaturalSize( naturalSize );
- DALI_TEST_EQUALS( naturalSize, Vector2( imageSize.GetWidth() - 2.0f, imageSize.GetHeight() - 2.0f ), TEST_LOCATION );
+ Vector2 naturalSize(0.0f, 0.0f);
+ visual.GetNaturalSize(naturalSize);
+ DALI_TEST_EQUALS(naturalSize, Vector2(imageSize.GetWidth() - 2.0f, imageSize.GetHeight() - 2.0f), TEST_LOCATION);
textureTrace.Reset();
int UtcDaliVisualFactoryGetNPatchVisual5(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetNPatchVisual5: Request n-patch visual with an image url" );
+ tet_infoline("UtcDaliVisualFactoryGetNPatchVisual5: Request n-patch visual with an image url");
// Get actual size of test image
- ImageDimensions imageSize = Dali::GetClosestImageSize( TEST_NPATCH_FILE_NAME );
+ ImageDimensions imageSize = Dali::GetClosestImageSize(TEST_NPATCH_FILE_NAME);
VisualFactory factory = VisualFactory::Get();
- DALI_TEST_CHECK( factory );
+ DALI_TEST_CHECK(factory);
- Visual::Base visual = factory.CreateVisual( TEST_NPATCH_FILE_NAME, ImageDimensions() );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = factory.CreateVisual(TEST_NPATCH_FILE_NAME, ImageDimensions());
+ DALI_TEST_CHECK(visual);
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
DummyControl actor = DummyControl::New(true);
- TestVisualAsynchronousRender( application, actor, visual );
+ TestVisualAsynchronousRender(application, actor, visual);
- DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
- Vector2 naturalSize( 0.0f, 0.0f );
- visual.GetNaturalSize( naturalSize );
- DALI_TEST_EQUALS( naturalSize, Vector2( imageSize.GetWidth() - 2.0f, imageSize.GetHeight() - 2.0f ), TEST_LOCATION );
+ Vector2 naturalSize(0.0f, 0.0f);
+ visual.GetNaturalSize(naturalSize);
+ DALI_TEST_EQUALS(naturalSize, Vector2(imageSize.GetWidth() - 2.0f, imageSize.GetHeight() - 2.0f), TEST_LOCATION);
END_TEST;
}
int UtcDaliVisualFactoryGetNPatchVisual6(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetNPatchVisual6: Request n-patch visual with a general image" );
+ tet_infoline("UtcDaliVisualFactoryGetNPatchVisual6: Request n-patch visual with a general image");
VisualFactory factory = VisualFactory::Get();
- DALI_TEST_CHECK( factory );
+ DALI_TEST_CHECK(factory);
{
// Get actual size of test image
- ImageDimensions imageSize = Dali::GetClosestImageSize( gImage_34_RGBA );
+ ImageDimensions imageSize = Dali::GetClosestImageSize(gImage_34_RGBA);
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::N_PATCH );
- propertyMap.Insert( ImageVisual::Property::URL, gImage_34_RGBA );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::N_PATCH);
+ propertyMap.Insert(ImageVisual::Property::URL, gImage_34_RGBA);
- Visual::Base visual = factory.CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
DummyControl actor = DummyControl::New(true);
- TestVisualAsynchronousRender( application, actor, visual );
+ TestVisualAsynchronousRender(application, actor, visual);
- DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
- Vector2 naturalSize( 0.0f, 0.0f );
- visual.GetNaturalSize( naturalSize );
- DALI_TEST_EQUALS( naturalSize, Vector2( imageSize.GetWidth() - 2.0f, imageSize.GetHeight() - 2.0f ), TEST_LOCATION );
+ Vector2 naturalSize(0.0f, 0.0f);
+ visual.GetNaturalSize(naturalSize);
+ DALI_TEST_EQUALS(naturalSize, Vector2(imageSize.GetWidth() - 2.0f, imageSize.GetHeight() - 2.0f), TEST_LOCATION);
- application.GetScene().Remove( actor );
- DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
+ application.GetScene().Remove(actor);
+ DALI_TEST_CHECK(actor.GetRendererCount() == 0u);
}
{
// Get actual size of test image
- ImageDimensions imageSize = Dali::GetClosestImageSize( TEST_IMAGE_FILE_NAME );
+ ImageDimensions imageSize = Dali::GetClosestImageSize(TEST_IMAGE_FILE_NAME);
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::N_PATCH );
- propertyMap.Insert( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::N_PATCH);
+ propertyMap.Insert(ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME);
- Visual::Base visual = factory.CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
DummyControl actor = DummyControl::New(true);
- TestVisualAsynchronousRender( application, actor, visual );
+ TestVisualAsynchronousRender(application, actor, visual);
- DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
- Vector2 naturalSize( 0.0f, 0.0f );
- visual.GetNaturalSize( naturalSize );
- DALI_TEST_EQUALS( naturalSize, Vector2( imageSize.GetWidth() - 2.0f, imageSize.GetHeight() - 2.0f ), TEST_LOCATION );
+ Vector2 naturalSize(0.0f, 0.0f);
+ visual.GetNaturalSize(naturalSize);
+ DALI_TEST_EQUALS(naturalSize, Vector2(imageSize.GetWidth() - 2.0f, imageSize.GetHeight() - 2.0f), TEST_LOCATION);
- application.GetScene().Remove( actor );
- DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
+ application.GetScene().Remove(actor);
+ DALI_TEST_CHECK(actor.GetRendererCount() == 0u);
}
END_TEST;
int UtcDaliVisualFactoryGetNPatchVisual7(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetNPatchVisual7: Add 9-patch visual on stage and instantly remove it." );
+ tet_infoline("UtcDaliVisualFactoryGetNPatchVisual7: Add 9-patch visual on stage and instantly remove it.");
VisualFactory factory = VisualFactory::Get();
- DALI_TEST_CHECK( factory );
+ DALI_TEST_CHECK(factory);
// Get actual size of test image
- ImageDimensions imageSize = Dali::GetClosestImageSize( TEST_9_PATCH_FILE_NAME );
+ ImageDimensions imageSize = Dali::GetClosestImageSize(TEST_9_PATCH_FILE_NAME);
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::N_PATCH );
- propertyMap.Insert( ImageVisual::Property::URL, TEST_9_PATCH_FILE_NAME );
- propertyMap.Insert( ImageVisual::Property::SYNCHRONOUS_LOADING, false );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::N_PATCH);
+ propertyMap.Insert(ImageVisual::Property::URL, TEST_9_PATCH_FILE_NAME);
+ propertyMap.Insert(ImageVisual::Property::SYNCHRONOUS_LOADING, false);
{
- Visual::Base visual = factory.CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- Vector2 naturalSize( 0.0f, 0.0f );
- visual.GetNaturalSize( naturalSize );
- DALI_TEST_EQUALS( naturalSize, Vector2( imageSize.GetWidth(), imageSize.GetHeight() ), TEST_LOCATION );
+ Vector2 naturalSize(0.0f, 0.0f);
+ visual.GetNaturalSize(naturalSize);
+ DALI_TEST_EQUALS(naturalSize, Vector2(imageSize.GetWidth(), imageSize.GetHeight()), TEST_LOCATION);
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
DummyControl actor = DummyControl::New(true);
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
+ actor.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 0u, TEST_LOCATION);
- application.GetScene().Add( actor );
+ application.GetScene().Add(actor);
actor.Unparent();
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger(1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 0u, TEST_LOCATION);
}
END_TEST;
int UtcDaliVisualFactoryGetNPatchVisual8(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetNPatchVisual8: Add 9-patch visual on stage, instantly remove it and add new 9-patch visual with same propertyMap" );
+ tet_infoline("UtcDaliVisualFactoryGetNPatchVisual8: Add 9-patch visual on stage, instantly remove it and add new 9-patch visual with same propertyMap");
VisualFactory factory = VisualFactory::Get();
- DALI_TEST_CHECK( factory );
+ DALI_TEST_CHECK(factory);
// Get actual size of test image
- ImageDimensions imageSize = Dali::GetClosestImageSize( TEST_9_PATCH_FILE_NAME );
+ ImageDimensions imageSize = Dali::GetClosestImageSize(TEST_9_PATCH_FILE_NAME);
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::N_PATCH );
- propertyMap.Insert( ImageVisual::Property::URL, TEST_9_PATCH_FILE_NAME );
- propertyMap.Insert( ImageVisual::Property::SYNCHRONOUS_LOADING, false );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::N_PATCH);
+ propertyMap.Insert(ImageVisual::Property::URL, TEST_9_PATCH_FILE_NAME);
+ propertyMap.Insert(ImageVisual::Property::SYNCHRONOUS_LOADING, false);
{
- Visual::Base visual = factory.CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- Vector2 naturalSize( 0.0f, 0.0f );
- visual.GetNaturalSize( naturalSize );
- DALI_TEST_EQUALS( naturalSize, Vector2( imageSize.GetWidth(), imageSize.GetHeight() ), TEST_LOCATION );
+ Vector2 naturalSize(0.0f, 0.0f);
+ visual.GetNaturalSize(naturalSize);
+ DALI_TEST_EQUALS(naturalSize, Vector2(imageSize.GetWidth(), imageSize.GetHeight()), TEST_LOCATION);
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
DummyControl actor = DummyControl::New(true);
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
+ actor.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 0u, TEST_LOCATION);
- application.GetScene().Add( actor );
+ application.GetScene().Add(actor);
actor.Unparent();
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- visual = factory.CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- visual.GetNaturalSize( naturalSize );
- DALI_TEST_EQUALS( naturalSize, Vector2( imageSize.GetWidth(), imageSize.GetHeight() ), TEST_LOCATION );
+ visual.GetNaturalSize(naturalSize);
+ DALI_TEST_EQUALS(naturalSize, Vector2(imageSize.GetWidth(), imageSize.GetHeight()), TEST_LOCATION);
actor = DummyControl::New(true);
DummyControlImpl& dummyImpl2 = static_cast<DummyControlImpl&>(actor.GetImplementation());
- dummyImpl2.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ dummyImpl2.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
+ actor.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 0u, TEST_LOCATION);
- application.GetScene().Add( actor );
+ application.GetScene().Add(actor);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger(1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- Renderer renderer = actor.GetRendererAt( 0 );
- auto textures = renderer.GetTextures();
+ Renderer renderer = actor.GetRendererAt(0);
+ auto textures = renderer.GetTextures();
- DALI_TEST_EQUALS( textures.GetTextureCount(), 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(textures.GetTextureCount(), 1, TEST_LOCATION);
}
END_TEST;
int UtcDaliNPatchVisualAuxiliaryImage01(void)
{
ToolkitTestApplication application;
- tet_infoline( "NPatchVisual with aux image" );
+ tet_infoline("NPatchVisual with aux image");
VisualFactory factory = VisualFactory::Get();
Property::Map properties;
Property::Map shader;
Property::Map transformMap;
- transformMap["size"] = Vector2( 0.5f, 0.5f ) ;
- transformMap["offset"] = Vector2( 20.0f, 0.0f ) ;
- transformMap["offsetPolicy"] = Vector2( Visual::Transform::Policy::ABSOLUTE, Visual::Transform::Policy::ABSOLUTE );
- transformMap["anchorPoint"] = Align::CENTER;
- transformMap["origin"] = Align::CENTER;
+ transformMap["size"] = Vector2(0.5f, 0.5f);
+ transformMap["offset"] = Vector2(20.0f, 0.0f);
+ transformMap["offsetPolicy"] = Vector2(Visual::Transform::Policy::ABSOLUTE, Visual::Transform::Policy::ABSOLUTE);
+ transformMap["anchorPoint"] = Align::CENTER;
+ transformMap["origin"] = Align::CENTER;
properties[Visual::Property::TRANSFORM] = transformMap;
- properties[Visual::Property::TYPE] = Visual::IMAGE;
- properties[Visual::Property::MIX_COLOR] = Color::BLUE;
- properties[Visual::Property::SHADER]=shader;
- properties[ImageVisual::Property::URL] = TEST_9_PATCH_FILE_NAME;
- properties[DevelImageVisual::Property::AUXILIARY_IMAGE] = TEST_AUX_IMAGE;
+ properties[Visual::Property::TYPE] = Visual::IMAGE;
+ properties[Visual::Property::MIX_COLOR] = Color::BLUE;
+ properties[Visual::Property::SHADER] = shader;
+ properties[ImageVisual::Property::URL] = TEST_9_PATCH_FILE_NAME;
+ properties[DevelImageVisual::Property::AUXILIARY_IMAGE] = TEST_AUX_IMAGE;
properties[DevelImageVisual::Property::AUXILIARY_IMAGE_ALPHA] = 0.9f;
- Visual::Base visual = factory.CreateVisual( properties );
+ Visual::Base visual = factory.CreateVisual(properties);
// trigger creation through setting on stage
- DummyControl dummy = DummyControl::New(true);
+ DummyControl dummy = DummyControl::New(true);
Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummy.GetImplementation());
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- dummyImpl.SetLayout( DummyControl::Property::TEST_VISUAL, transformMap );
- dummy.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
- dummy.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
+ dummyImpl.SetLayout(DummyControl::Property::TEST_VISUAL, transformMap);
+ dummy.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS);
+ dummy.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
application.GetScene().Add(dummy);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- Renderer renderer = dummy.GetRendererAt( 0 );
- auto textures = renderer.GetTextures();
- DALI_TEST_EQUALS( textures.GetTextureCount(), 2, TEST_LOCATION );
+ Renderer renderer = dummy.GetRendererAt(0);
+ auto textures = renderer.GetTextures();
+ DALI_TEST_EQUALS(textures.GetTextureCount(), 2, TEST_LOCATION);
UnparentAndReset(dummy);
END_TEST;
int UtcDaliNPatchVisualAuxiliaryImage02(void)
{
ToolkitTestApplication application;
- tet_infoline( "Multiple NPatchVisual with aux image coincidentally" );
+ tet_infoline("Multiple NPatchVisual with aux image coincidentally");
const Property::Value NPATCH_TEST{
{ImageVisual::Property::URL, TEST_9_PATCH_FILE_NAME},
{DevelImageVisual::Property::AUXILIARY_IMAGE, TEST_AUX_IMAGE}};
- ImageView imageView1 = ImageView::New();
+ ImageView imageView1 = ImageView::New();
imageView1[ImageView::Property::IMAGE] = NPATCH_TEST;
- application.GetScene().Add( imageView1 );
+ application.GetScene().Add(imageView1);
- ImageView imageView2 = ImageView::New();
+ ImageView imageView2 = ImageView::New();
imageView2[ImageView::Property::IMAGE] = NPATCH_TEST;
- application.GetScene().Add( imageView2 );
+ application.GetScene().Add(imageView2);
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 3 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(3), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- Renderer renderer1 = imageView1.GetRendererAt( 0 );
- auto textureSet1 = renderer1.GetTextures();
+ Renderer renderer1 = imageView1.GetRendererAt(0);
+ auto textureSet1 = renderer1.GetTextures();
- Renderer renderer2 = imageView2.GetRendererAt( 0 );
- auto textureSet2 = renderer2.GetTextures();
- DALI_TEST_EQUALS( textureSet1 != textureSet2, true, TEST_LOCATION );
+ Renderer renderer2 = imageView2.GetRendererAt(0);
+ auto textureSet2 = renderer2.GetTextures();
+ DALI_TEST_EQUALS(textureSet1 != textureSet2, true, TEST_LOCATION);
END_TEST;
}
-
int UtcDaliVisualFactoryGetNPatchVisualN1(void)
{
//This should still load but display an error image
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetNPatchVisualN: Request n-patch visual with an invalid image url" );
+ tet_infoline("UtcDaliVisualFactoryGetNPatchVisualN: Request n-patch visual with an invalid image url");
VisualFactory factory = VisualFactory::Get();
- DALI_TEST_CHECK( factory );
+ DALI_TEST_CHECK(factory);
- Visual::Base visual = factory.CreateVisual( "ERROR.9.jpg", ImageDimensions() );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = factory.CreateVisual("ERROR.9.jpg", ImageDimensions());
+ DALI_TEST_CHECK(visual);
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
{
DummyControl actor = DummyControl::New(true);
- TestVisualAsynchronousRender( application, actor, visual );
+ TestVisualAsynchronousRender(application, actor, visual);
- DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
UnparentAndReset(actor);
}
//This should still load but display an error image
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetNPatchVisualN: Request n-patch visual with an invalid URL" );
+ tet_infoline("UtcDaliVisualFactoryGetNPatchVisualN: Request n-patch visual with an invalid URL");
VisualFactory factory = VisualFactory::Get();
- DALI_TEST_CHECK( factory );
+ DALI_TEST_CHECK(factory);
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::N_PATCH );
- propertyMap.Insert( ImageVisual::Property::URL, "ERROR.9.jpg" );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::N_PATCH);
+ propertyMap.Insert(ImageVisual::Property::URL, "ERROR.9.jpg");
- Visual::Base visual = factory.CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
TraceCallStack& drawTrace = gl.GetDrawTrace();
drawTrace.Enable(true);
DummyControl actor = DummyControl::New(true);
- TestVisualAsynchronousRender( application, actor, visual );
+ TestVisualAsynchronousRender(application, actor, visual);
- DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
END_TEST;
}
// Passing in an invalid visual type so we should not get a visual
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetNPatchVisualN: Request n-patch visual with an invalid visual type" );
+ tet_infoline("UtcDaliVisualFactoryGetNPatchVisualN: Request n-patch visual with an invalid visual type");
VisualFactory factory = VisualFactory::Get();
- DALI_TEST_CHECK( factory );
+ DALI_TEST_CHECK(factory);
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, 111 );
- propertyMap.Insert( ImageVisual::Property::URL, "ERROR.9.jpg" );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, 111);
+ propertyMap.Insert(ImageVisual::Property::URL, "ERROR.9.jpg");
- Visual::Base visual = factory.CreateVisual( propertyMap );
- DALI_TEST_CHECK( !visual );
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(!visual);
END_TEST;
}
int UtcDaliVisualFactoryGetSvgVisual(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetSvgVisual: Request svg visual with a svg url" );
+ tet_infoline("UtcDaliVisualFactoryGetSvgVisual: Request svg visual with a svg url");
VisualFactory factory = VisualFactory::Get();
- Visual::Base visual = factory.CreateVisual( TEST_SVG_FILE_NAME, ImageDimensions() );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = factory.CreateVisual(TEST_SVG_FILE_NAME, ImageDimensions());
+ DALI_TEST_CHECK(visual);
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
- DummyControl actor = DummyControl::New(true);
+ DummyControl actor = DummyControl::New(true);
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- application.GetScene().Add( actor );
- visual.SetTransformAndSize(DefaultTransform(), Vector2(200.f, 200.f) );
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
+ actor.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+ application.GetScene().Add(actor);
+ visual.SetTransformAndSize(DefaultTransform(), Vector2(200.f, 200.f));
// Either application.SendNotification() or the trigger can now complete the task.
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
// renderer is added to actor
- DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
+ DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
// waiting for the resource uploading
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
END_TEST;
}
int UtcDaliVisualFactoryGetSvgVisualLarge(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetSvgVisual: Request svg visual with a svg url" );
+ tet_infoline("UtcDaliVisualFactoryGetSvgVisual: Request svg visual with a svg url");
VisualFactory factory = VisualFactory::Get();
- Visual::Base visual = factory.CreateVisual( TEST_SVG_FILE_NAME, ImageDimensions( 2000, 2000 ) );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = factory.CreateVisual(TEST_SVG_FILE_NAME, ImageDimensions(2000, 2000));
+ DALI_TEST_CHECK(visual);
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
- DummyControl actor = DummyControl::New(true);
+ DummyControl actor = DummyControl::New(true);
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
- actor.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); // Only rasterizes when it knows control size.
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- application.GetScene().Add( actor );
+ actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS); // Only rasterizes when it knows control size.
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
+ application.GetScene().Add(actor);
// Either application.SendNotification() or the trigger can now complete the task.
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
// renderer is added to actor
- DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
+ DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
// waiting for the resource uploading
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
END_TEST;
}
int UtcDaliVisualFactoryGetSvgVisualAtlas(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetSvgVisual: Request svg visual with enabled atlas" );
+ tet_infoline("UtcDaliVisualFactoryGetSvgVisual: Request svg visual with enabled atlas");
VisualFactory factory = VisualFactory::Get();
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::SVG );
- propertyMap.Insert( ImageVisual::Property::URL, TEST_SVG_FILE_NAME );
- propertyMap.Insert( ImageVisual::Property::ATLASING, true );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::SVG);
+ propertyMap.Insert(ImageVisual::Property::URL, TEST_SVG_FILE_NAME);
+ propertyMap.Insert(ImageVisual::Property::ATLASING, true);
- Visual::Base visual = factory.CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
- DummyControl actor = DummyControl::New(true);
+ DummyControl actor = DummyControl::New(true);
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- application.GetScene().Add( actor );
- visual.SetTransformAndSize(DefaultTransform(), Vector2(200.f, 200.f) );
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
+ actor.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+ application.GetScene().Add(actor);
+ visual.SetTransformAndSize(DefaultTransform(), Vector2(200.f, 200.f));
// Either application.SendNotification() or the trigger can now complete the task.
- DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
+ DALI_TEST_CHECK(actor.GetRendererCount() == 0u);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
// renderer is added to actor
- DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
+ DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
// waiting for the resource uploading
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
END_TEST;
}
//Creates a mesh visual from the given propertyMap and tries to load it on stage in the given application.
//This is expected to succeed, which will then pass the test.
-void MeshVisualLoadsCorrectlyTest( Property::Map& propertyMap, ToolkitTestApplication& application )
+void MeshVisualLoadsCorrectlyTest(Property::Map& propertyMap, ToolkitTestApplication& application)
{
VisualFactory factory = VisualFactory::Get();
- DALI_TEST_CHECK( factory );
+ DALI_TEST_CHECK(factory);
//Create a mesh visual.
- Visual::Base visual = factory.CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
//Create an actor on stage to house the visual.
- DummyControl actor = DummyControl::New(true);
+ DummyControl actor = DummyControl::New(true);
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- application.GetScene().Add( actor );
- visual.SetTransformAndSize(DefaultTransform(), Vector2( 200.f, 200.f ) );
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
+ actor.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+ application.GetScene().Add(actor);
+ visual.SetTransformAndSize(DefaultTransform(), Vector2(200.f, 200.f));
//Ensure set on stage.
- DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION);
//Attempt to render to queue resource load requests.
application.SendNotification();
- application.Render( 0 );
+ application.Render(0);
//Render again to upload the now-loaded textures.
application.SendNotification();
- application.Render( 0 );
+ application.Render(0);
Matrix testScaleMatrix;
- testScaleMatrix.SetIdentityAndScale( Vector3( 1.0, -1.0, 1.0 ) );
+ testScaleMatrix.SetIdentityAndScale(Vector3(1.0, -1.0, 1.0));
Matrix actualScaleMatrix;
//Test to see if the object has been successfully loaded.
- DALI_TEST_CHECK( application.GetGlAbstraction().GetUniformValue<Matrix>( "uObjectMatrix", actualScaleMatrix ) );
- DALI_TEST_EQUALS( actualScaleMatrix, testScaleMatrix, Math::MACHINE_EPSILON_100, TEST_LOCATION );
+ DALI_TEST_CHECK(application.GetGlAbstraction().GetUniformValue<Matrix>("uObjectMatrix", actualScaleMatrix));
+ DALI_TEST_EQUALS(actualScaleMatrix, testScaleMatrix, Math::MACHINE_EPSILON_100, TEST_LOCATION);
//Finish by setting off stage, and ensuring this was successful.
actor.Unparent();
- DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 0u, TEST_LOCATION);
}
//Creates a mesh visual from the given propertyMap and tries to load it on stage in the given application.
//This is expected to fail, which will then pass the test.
-void MeshVisualDoesNotLoadCorrectlyTest( Property::Map& propertyMap, ToolkitTestApplication& application )
+void MeshVisualDoesNotLoadCorrectlyTest(Property::Map& propertyMap, ToolkitTestApplication& application)
{
VisualFactory factory = VisualFactory::Get();
- DALI_TEST_CHECK( factory );
+ DALI_TEST_CHECK(factory);
//Create a mesh visual.
- Visual::Base visual = factory.CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
//Create an actor on stage to house the visual.
- DummyControl actor = DummyControl::New(true);
+ DummyControl actor = DummyControl::New(true);
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- application.GetScene().Add( actor );
- visual.SetTransformAndSize(DefaultTransform(), Vector2( 200.f, 200.f ) );
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
+ actor.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+ application.GetScene().Add(actor);
+ visual.SetTransformAndSize(DefaultTransform(), Vector2(200.f, 200.f));
//Ensure set on stage.
- DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION);
//Attempt to render to queue resource load requests.
application.SendNotification();
- application.Render( 0 );
+ application.Render(0);
//Render again to upload the now-loaded textures.
application.SendNotification();
- application.Render( 0 );
+ application.Render(0);
//Test to see if the object has not been loaded, as expected.
Matrix scaleMatrix;
- DALI_TEST_CHECK( !application.GetGlAbstraction().GetUniformValue<Matrix>( "uObjectMatrix", scaleMatrix ) );
+ DALI_TEST_CHECK(!application.GetGlAbstraction().GetUniformValue<Matrix>("uObjectMatrix", scaleMatrix));
//Finish by setting off stage, and ensuring this was successful.
actor.Unparent();
- DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 0u, TEST_LOCATION);
}
//Test if mesh loads correctly when supplied with only the bare minimum requirements, an object file.
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetMeshVisual1: Request mesh visual with a valid object file only" );
+ tet_infoline("UtcDaliVisualFactoryGetMeshVisual1: Request mesh visual with a valid object file only");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uObjectMatrix", Property::Type::MATRIX),
- };
+ {
+ UniformData("uObjectMatrix", Property::Type::MATRIX),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::MESH );
- propertyMap.Insert( MeshVisual::Property::OBJECT_URL, TEST_OBJ_FILE_NAME );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::MESH);
+ propertyMap.Insert(MeshVisual::Property::OBJECT_URL, TEST_OBJ_FILE_NAME);
//Test to see if mesh loads correctly.
- MeshVisualLoadsCorrectlyTest( propertyMap, application );
+ MeshVisualLoadsCorrectlyTest(propertyMap, application);
END_TEST;
}
-
//Test if mesh loads correctly when supplied with an object file as well as a blank material file and images directory.
int UtcDaliVisualFactoryGetMeshVisual2(void)
{
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetMeshVisual2: Request mesh visual with blank material file and images directory" );
+ tet_infoline("UtcDaliVisualFactoryGetMeshVisual2: Request mesh visual with blank material file and images directory");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uObjectMatrix", Property::Type::MATRIX),
- };
+ {
+ UniformData("uObjectMatrix", Property::Type::MATRIX),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::MESH );
- propertyMap.Insert( MeshVisual::Property::OBJECT_URL, TEST_OBJ_FILE_NAME );
- propertyMap.Insert( MeshVisual::Property::MATERIAL_URL, "" );
- propertyMap.Insert( MeshVisual::Property::TEXTURES_PATH, "" );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::MESH);
+ propertyMap.Insert(MeshVisual::Property::OBJECT_URL, TEST_OBJ_FILE_NAME);
+ propertyMap.Insert(MeshVisual::Property::MATERIAL_URL, "");
+ propertyMap.Insert(MeshVisual::Property::TEXTURES_PATH, "");
//Test to see if mesh loads correctly.
- MeshVisualLoadsCorrectlyTest( propertyMap, application );
+ MeshVisualLoadsCorrectlyTest(propertyMap, application);
END_TEST;
}
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetMeshVisual3: Request mesh visual with all parameters correct" );
+ tet_infoline("UtcDaliVisualFactoryGetMeshVisual3: Request mesh visual with all parameters correct");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uObjectMatrix", Property::Type::MATRIX),
- };
+ {
+ UniformData("uObjectMatrix", Property::Type::MATRIX),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::MESH );
- propertyMap.Insert( MeshVisual::Property::OBJECT_URL, TEST_OBJ_FILE_NAME );
- propertyMap.Insert( MeshVisual::Property::MATERIAL_URL, TEST_MTL_FILE_NAME );
- propertyMap.Insert( MeshVisual::Property::USE_MIPMAPPING, Color::GREEN ); // Test that wrong property types don't prevent the object load
- propertyMap.Insert( MeshVisual::Property::USE_SOFT_NORMALS, 1.0f );
- propertyMap.Insert( MeshVisual::Property::LIGHT_POSITION, 1.0f );
- propertyMap.Insert( MeshVisual::Property::TEXTURES_PATH, TEST_RESOURCE_DIR "/" );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::MESH);
+ propertyMap.Insert(MeshVisual::Property::OBJECT_URL, TEST_OBJ_FILE_NAME);
+ propertyMap.Insert(MeshVisual::Property::MATERIAL_URL, TEST_MTL_FILE_NAME);
+ propertyMap.Insert(MeshVisual::Property::USE_MIPMAPPING, Color::GREEN); // Test that wrong property types don't prevent the object load
+ propertyMap.Insert(MeshVisual::Property::USE_SOFT_NORMALS, 1.0f);
+ propertyMap.Insert(MeshVisual::Property::LIGHT_POSITION, 1.0f);
+ propertyMap.Insert(MeshVisual::Property::TEXTURES_PATH, TEST_RESOURCE_DIR "/");
//Test to see if mesh loads correctly.
- MeshVisualLoadsCorrectlyTest( propertyMap, application );
+ MeshVisualLoadsCorrectlyTest(propertyMap, application);
END_TEST;
}
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetMeshVisual3: Request mesh visual with all parameters correct" );
+ tet_infoline("UtcDaliVisualFactoryGetMeshVisual3: Request mesh visual with all parameters correct");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uObjectMatrix", Property::Type::MATRIX),
- };
+ {
+ UniformData("uObjectMatrix", Property::Type::MATRIX),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::MESH );
- propertyMap.Insert( MeshVisual::Property::OBJECT_URL, TEST_OBJ_FILE_NAME );
- propertyMap.Insert( MeshVisual::Property::MATERIAL_URL, TEST_MTL_FILE_NAME );
- propertyMap.Insert( MeshVisual::Property::USE_MIPMAPPING, false );
- propertyMap.Insert( MeshVisual::Property::USE_SOFT_NORMALS, false );
- propertyMap.Insert( MeshVisual::Property::LIGHT_POSITION, Vector3::XAXIS );
- propertyMap.Insert( MeshVisual::Property::TEXTURES_PATH, TEST_RESOURCE_DIR "/" );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::MESH);
+ propertyMap.Insert(MeshVisual::Property::OBJECT_URL, TEST_OBJ_FILE_NAME);
+ propertyMap.Insert(MeshVisual::Property::MATERIAL_URL, TEST_MTL_FILE_NAME);
+ propertyMap.Insert(MeshVisual::Property::USE_MIPMAPPING, false);
+ propertyMap.Insert(MeshVisual::Property::USE_SOFT_NORMALS, false);
+ propertyMap.Insert(MeshVisual::Property::LIGHT_POSITION, Vector3::XAXIS);
+ propertyMap.Insert(MeshVisual::Property::TEXTURES_PATH, TEST_RESOURCE_DIR "/");
//Test to see if mesh loads correctly.
- MeshVisualLoadsCorrectlyTest( propertyMap, application );
+ MeshVisualLoadsCorrectlyTest(propertyMap, application);
END_TEST;
}
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetMeshVisual4: Request mesh visual with diffuse texture but not normal or gloss." );
+ tet_infoline("UtcDaliVisualFactoryGetMeshVisual4: Request mesh visual with diffuse texture but not normal or gloss.");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uObjectMatrix", Property::Type::MATRIX),
- };
+ {
+ UniformData("uObjectMatrix", Property::Type::MATRIX),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::MESH );
- propertyMap.Insert( MeshVisual::Property::OBJECT_URL, TEST_OBJ_FILE_NAME );
- propertyMap.Insert( MeshVisual::Property::MATERIAL_URL, TEST_SIMPLE_MTL_FILE_NAME );
- propertyMap.Insert( MeshVisual::Property::TEXTURES_PATH, TEST_RESOURCE_DIR "/" );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::MESH);
+ propertyMap.Insert(MeshVisual::Property::OBJECT_URL, TEST_OBJ_FILE_NAME);
+ propertyMap.Insert(MeshVisual::Property::MATERIAL_URL, TEST_SIMPLE_MTL_FILE_NAME);
+ propertyMap.Insert(MeshVisual::Property::TEXTURES_PATH, TEST_RESOURCE_DIR "/");
//Test to see if mesh loads correctly.
- MeshVisualLoadsCorrectlyTest( propertyMap, application );
+ MeshVisualLoadsCorrectlyTest(propertyMap, application);
END_TEST;
}
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetMeshVisual5: Request mesh visual and make it only use diffuse textures." );
+ tet_infoline("UtcDaliVisualFactoryGetMeshVisual5: Request mesh visual and make it only use diffuse textures.");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uObjectMatrix", Property::Type::MATRIX),
- };
+ {
+ UniformData("uObjectMatrix", Property::Type::MATRIX),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::MESH );
- propertyMap.Insert( "objectUrl", TEST_OBJ_FILE_NAME );
- propertyMap.Insert( "materialUrl", TEST_MTL_FILE_NAME );
- propertyMap.Insert( "texturesPath", TEST_RESOURCE_DIR "/" );
- propertyMap.Insert( "useMipmapping", false );
- propertyMap.Insert( "useSoftNormals", false );
- propertyMap.Insert( "lightPosition", Vector3::ZAXIS );
- propertyMap.Insert( "shadingMode", MeshVisual::ShadingMode::TEXTURED_WITH_SPECULAR_LIGHTING );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::MESH);
+ propertyMap.Insert("objectUrl", TEST_OBJ_FILE_NAME);
+ propertyMap.Insert("materialUrl", TEST_MTL_FILE_NAME);
+ propertyMap.Insert("texturesPath", TEST_RESOURCE_DIR "/");
+ propertyMap.Insert("useMipmapping", false);
+ propertyMap.Insert("useSoftNormals", false);
+ propertyMap.Insert("lightPosition", Vector3::ZAXIS);
+ propertyMap.Insert("shadingMode", MeshVisual::ShadingMode::TEXTURED_WITH_SPECULAR_LIGHTING);
//Test to see if mesh loads correctly.
- MeshVisualLoadsCorrectlyTest( propertyMap, application );
-
+ MeshVisualLoadsCorrectlyTest(propertyMap, application);
END_TEST;
}
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetMeshVisual6: Request mesh visual and make it not use any textures." );
+ tet_infoline("UtcDaliVisualFactoryGetMeshVisual6: Request mesh visual and make it not use any textures.");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uObjectMatrix", Property::Type::MATRIX),
- };
+ {
+ UniformData("uObjectMatrix", Property::Type::MATRIX),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::MESH );
- propertyMap.Insert( MeshVisual::Property::OBJECT_URL, TEST_OBJ_FILE_NAME );
- propertyMap.Insert( MeshVisual::Property::MATERIAL_URL, TEST_MTL_FILE_NAME );
- propertyMap.Insert( MeshVisual::Property::TEXTURES_PATH, TEST_RESOURCE_DIR "/" );
- propertyMap.Insert( MeshVisual::Property::SHADING_MODE, MeshVisual::ShadingMode::TEXTURELESS_WITH_DIFFUSE_LIGHTING );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::MESH);
+ propertyMap.Insert(MeshVisual::Property::OBJECT_URL, TEST_OBJ_FILE_NAME);
+ propertyMap.Insert(MeshVisual::Property::MATERIAL_URL, TEST_MTL_FILE_NAME);
+ propertyMap.Insert(MeshVisual::Property::TEXTURES_PATH, TEST_RESOURCE_DIR "/");
+ propertyMap.Insert(MeshVisual::Property::SHADING_MODE, MeshVisual::ShadingMode::TEXTURELESS_WITH_DIFFUSE_LIGHTING);
//Test to see if mesh loads correctly.
- MeshVisualLoadsCorrectlyTest( propertyMap, application );
+ MeshVisualLoadsCorrectlyTest(propertyMap, application);
END_TEST;
}
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetMeshVisual7: Request mesh visual with custom light position." );
+ tet_infoline("UtcDaliVisualFactoryGetMeshVisual7: Request mesh visual with custom light position.");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uObjectMatrix", Property::Type::MATRIX),
- };
+ {
+ UniformData("uObjectMatrix", Property::Type::MATRIX),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::MESH );
- propertyMap.Insert( MeshVisual::Property::OBJECT_URL, TEST_OBJ_FILE_NAME );
- propertyMap.Insert( MeshVisual::Property::MATERIAL_URL, TEST_MTL_FILE_NAME );
- propertyMap.Insert( MeshVisual::Property::TEXTURES_PATH, TEST_RESOURCE_DIR "/" );
- propertyMap.Insert( MeshVisual::Property::LIGHT_POSITION, Vector3( 0.0, 1.0, 2.0 ) );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::MESH);
+ propertyMap.Insert(MeshVisual::Property::OBJECT_URL, TEST_OBJ_FILE_NAME);
+ propertyMap.Insert(MeshVisual::Property::MATERIAL_URL, TEST_MTL_FILE_NAME);
+ propertyMap.Insert(MeshVisual::Property::TEXTURES_PATH, TEST_RESOURCE_DIR "/");
+ propertyMap.Insert(MeshVisual::Property::LIGHT_POSITION, Vector3(0.0, 1.0, 2.0));
//Test to see if mesh loads correctly.
- MeshVisualLoadsCorrectlyTest( propertyMap, application );
+ MeshVisualLoadsCorrectlyTest(propertyMap, application);
END_TEST;
}
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetMeshVisual5: Request mesh visual with normal-less object file." );
+ tet_infoline("UtcDaliVisualFactoryGetMeshVisual5: Request mesh visual with normal-less object file.");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uObjectMatrix", Property::Type::MATRIX),
- };
+ {
+ UniformData("uObjectMatrix", Property::Type::MATRIX),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::MESH );
- propertyMap.Insert( MeshVisual::Property::OBJECT_URL, TEST_SIMPLE_OBJ_FILE_NAME );
- propertyMap.Insert( MeshVisual::Property::MATERIAL_URL, TEST_MTL_FILE_NAME );
- propertyMap.Insert( MeshVisual::Property::TEXTURES_PATH, TEST_RESOURCE_DIR "/" );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::MESH);
+ propertyMap.Insert(MeshVisual::Property::OBJECT_URL, TEST_SIMPLE_OBJ_FILE_NAME);
+ propertyMap.Insert(MeshVisual::Property::MATERIAL_URL, TEST_MTL_FILE_NAME);
+ propertyMap.Insert(MeshVisual::Property::TEXTURES_PATH, TEST_RESOURCE_DIR "/");
//Test to see if mesh loads correctly.
- MeshVisualLoadsCorrectlyTest( propertyMap, application );
+ MeshVisualLoadsCorrectlyTest(propertyMap, application);
END_TEST;
}
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetMeshVisualN1: Request mesh visual without object file" );
+ tet_infoline("UtcDaliVisualFactoryGetMeshVisualN1: Request mesh visual without object file");
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::MESH );
- propertyMap.Insert( MeshVisual::Property::MATERIAL_URL, TEST_MTL_FILE_NAME );
- propertyMap.Insert( MeshVisual::Property::TEXTURES_PATH, TEST_RESOURCE_DIR "/" );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::MESH);
+ propertyMap.Insert(MeshVisual::Property::MATERIAL_URL, TEST_MTL_FILE_NAME);
+ propertyMap.Insert(MeshVisual::Property::TEXTURES_PATH, TEST_RESOURCE_DIR "/");
//Test to see if mesh doesn't load with these properties, as expected.
- MeshVisualDoesNotLoadCorrectlyTest( propertyMap, application );
-
+ MeshVisualDoesNotLoadCorrectlyTest(propertyMap, application);
END_TEST;
}
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetMeshVisualN2: Request mesh visual with invalid material and images urls" );
+ tet_infoline("UtcDaliVisualFactoryGetMeshVisualN2: Request mesh visual with invalid material and images urls");
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::MESH );
- propertyMap.Insert( MeshVisual::Property::OBJECT_URL, TEST_OBJ_FILE_NAME );
- propertyMap.Insert( MeshVisual::Property::MATERIAL_URL, "invalid" );
- propertyMap.Insert( MeshVisual::Property::TEXTURES_PATH, "also invalid" );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::MESH);
+ propertyMap.Insert(MeshVisual::Property::OBJECT_URL, TEST_OBJ_FILE_NAME);
+ propertyMap.Insert(MeshVisual::Property::MATERIAL_URL, "invalid");
+ propertyMap.Insert(MeshVisual::Property::TEXTURES_PATH, "also invalid");
//Test to see if mesh doesn't load with these properties, as expected.
- MeshVisualDoesNotLoadCorrectlyTest( propertyMap, application );
-
+ MeshVisualDoesNotLoadCorrectlyTest(propertyMap, application);
END_TEST;
}
{
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetMeshVisualN3: Request mesh visual with invalid object url" );
-
+ tet_infoline("UtcDaliVisualFactoryGetMeshVisualN3: Request mesh visual with invalid object url");
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::MESH );
- propertyMap.Insert( MeshVisual::Property::OBJECT_URL, "invalid" );
- propertyMap.Insert( MeshVisual::Property::MATERIAL_URL, TEST_MTL_FILE_NAME );
- propertyMap.Insert( MeshVisual::Property::TEXTURES_PATH, TEST_RESOURCE_DIR "/" );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::MESH);
+ propertyMap.Insert(MeshVisual::Property::OBJECT_URL, "invalid");
+ propertyMap.Insert(MeshVisual::Property::MATERIAL_URL, TEST_MTL_FILE_NAME);
+ propertyMap.Insert(MeshVisual::Property::TEXTURES_PATH, TEST_RESOURCE_DIR "/");
//Test to see if mesh doesn't load with these properties, as expected.
- MeshVisualDoesNotLoadCorrectlyTest( propertyMap, application );
+ MeshVisualDoesNotLoadCorrectlyTest(propertyMap, application);
END_TEST;
}
//Creates a primitive visual with the given property map and tests to see if it correctly loads in the given application.
-void TestPrimitiveVisualWithProperties( Property::Map& propertyMap, ToolkitTestApplication& application )
+void TestPrimitiveVisualWithProperties(Property::Map& propertyMap, ToolkitTestApplication& application)
{
VisualFactory factory = VisualFactory::Get();
- DALI_TEST_CHECK( factory );
+ DALI_TEST_CHECK(factory);
//Create a primitive visual.
- Visual::Base visual = factory.CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = factory.CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
//Create an actor on stage to house the visual.
- DummyControl actor = DummyControl::New(true);
+ DummyControl actor = DummyControl::New(true);
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
- actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- application.GetScene().Add( actor );
- visual.SetTransformAndSize(DefaultTransform(), Vector2( 200.f, 200.f ) );
+ actor.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+ application.GetScene().Add(actor);
+ visual.SetTransformAndSize(DefaultTransform(), Vector2(200.f, 200.f));
//Ensure set on stage.
- DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION);
//Tell test application to load the visual.
application.SendNotification();
application.Render(0);
Matrix testScaleMatrix;
- testScaleMatrix.SetIdentityAndScale( Vector3( 1.0, -1.0, 1.0 ) );
+ testScaleMatrix.SetIdentityAndScale(Vector3(1.0, -1.0, 1.0));
Matrix actualScaleMatrix;
//Test to see if the object has been successfully loaded.
- DALI_TEST_CHECK( application.GetGlAbstraction().GetUniformValue<Matrix>( "uObjectMatrix", actualScaleMatrix ) );
- DALI_TEST_EQUALS( actualScaleMatrix, testScaleMatrix, Math::MACHINE_EPSILON_100, TEST_LOCATION );
+ DALI_TEST_CHECK(application.GetGlAbstraction().GetUniformValue<Matrix>("uObjectMatrix", actualScaleMatrix));
+ DALI_TEST_EQUALS(actualScaleMatrix, testScaleMatrix, Math::MACHINE_EPSILON_100, TEST_LOCATION);
//Finish by setting off stage, and ensuring this was successful.
actor.Unparent();
- DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
+ DALI_TEST_EQUALS(actor.GetRendererCount(), 0u, TEST_LOCATION);
}
//Test if primitive shape loads correctly when supplied with only the bare minimum requirements, the shape to use.
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual1: Request primitive visual with a shape only" );
+ tet_infoline("UtcDaliVisualFactoryGetPrimitiveVisual1: Request primitive visual with a shape only");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uObjectMatrix", Property::Type::MATRIX),
- };
+ {
+ UniformData("uObjectMatrix", Property::Type::MATRIX),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE );
- propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::CUBE );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE);
+ propertyMap.Insert(PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::CUBE);
//Test to see if shape loads correctly.
- TestPrimitiveVisualWithProperties( propertyMap, application );
+ TestPrimitiveVisualWithProperties(propertyMap, application);
END_TEST;
}
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual2: Request primitive visual with everything" );
+ tet_infoline("UtcDaliVisualFactoryGetPrimitiveVisual2: Request primitive visual with everything");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uObjectMatrix", Property::Type::MATRIX),
- };
+ {
+ UniformData("uObjectMatrix", Property::Type::MATRIX),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE );
- propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::CUBE );
- propertyMap.Insert( PrimitiveVisual::Property::MIX_COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) );
- propertyMap.Insert( PrimitiveVisual::Property::SLICES, 10 );
- propertyMap.Insert( PrimitiveVisual::Property::STACKS, 20 );
- propertyMap.Insert( PrimitiveVisual::Property::SCALE_TOP_RADIUS, 30.0f );
- propertyMap.Insert( PrimitiveVisual::Property::SCALE_BOTTOM_RADIUS, 40.0f );
- propertyMap.Insert( PrimitiveVisual::Property::SCALE_HEIGHT, 50.0f );
- propertyMap.Insert( PrimitiveVisual::Property::SCALE_RADIUS, 60.0f );
- propertyMap.Insert( PrimitiveVisual::Property::BEVEL_PERCENTAGE, 0.7f );
- propertyMap.Insert( PrimitiveVisual::Property::BEVEL_SMOOTHNESS, 0.8f );
- propertyMap.Insert( MeshVisual::Property::LIGHT_POSITION, Vector3( 0.9, 1.0, 1.1 ) );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE);
+ propertyMap.Insert(PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::CUBE);
+ propertyMap.Insert(PrimitiveVisual::Property::MIX_COLOR, Vector4(0.5, 0.5, 0.5, 1.0));
+ propertyMap.Insert(PrimitiveVisual::Property::SLICES, 10);
+ propertyMap.Insert(PrimitiveVisual::Property::STACKS, 20);
+ propertyMap.Insert(PrimitiveVisual::Property::SCALE_TOP_RADIUS, 30.0f);
+ propertyMap.Insert(PrimitiveVisual::Property::SCALE_BOTTOM_RADIUS, 40.0f);
+ propertyMap.Insert(PrimitiveVisual::Property::SCALE_HEIGHT, 50.0f);
+ propertyMap.Insert(PrimitiveVisual::Property::SCALE_RADIUS, 60.0f);
+ propertyMap.Insert(PrimitiveVisual::Property::BEVEL_PERCENTAGE, 0.7f);
+ propertyMap.Insert(PrimitiveVisual::Property::BEVEL_SMOOTHNESS, 0.8f);
+ propertyMap.Insert(MeshVisual::Property::LIGHT_POSITION, Vector3(0.9, 1.0, 1.1));
//Test to see if shape loads correctly.
- TestPrimitiveVisualWithProperties( propertyMap, application );
+ TestPrimitiveVisualWithProperties(propertyMap, application);
END_TEST;
}
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual3: Request primitive visual to display a sphere" );
+ tet_infoline("UtcDaliVisualFactoryGetPrimitiveVisual3: Request primitive visual to display a sphere");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uObjectMatrix", Property::Type::MATRIX),
- };
+ {
+ UniformData("uObjectMatrix", Property::Type::MATRIX),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE );
- propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE );
- propertyMap.Insert( PrimitiveVisual::Property::MIX_COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) );
- propertyMap.Insert( PrimitiveVisual::Property::SLICES, 10 );
- propertyMap.Insert( PrimitiveVisual::Property::STACKS, 20 );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE);
+ propertyMap.Insert(PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE);
+ propertyMap.Insert(PrimitiveVisual::Property::MIX_COLOR, Vector4(0.5, 0.5, 0.5, 1.0));
+ propertyMap.Insert(PrimitiveVisual::Property::SLICES, 10);
+ propertyMap.Insert(PrimitiveVisual::Property::STACKS, 20);
//Test to see if shape loads correctly.
- TestPrimitiveVisualWithProperties( propertyMap, application );
+ TestPrimitiveVisualWithProperties(propertyMap, application);
END_TEST;
}
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual4: Request primitive visual to display a conic section" );
+ tet_infoline("UtcDaliVisualFactoryGetPrimitiveVisual4: Request primitive visual to display a conic section");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uObjectMatrix", Property::Type::MATRIX),
- };
+ {
+ UniformData("uObjectMatrix", Property::Type::MATRIX),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE );
- propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::CONICAL_FRUSTUM );
- propertyMap.Insert( PrimitiveVisual::Property::MIX_COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) );
- propertyMap.Insert( PrimitiveVisual::Property::SLICES, 10 );
- propertyMap.Insert( PrimitiveVisual::Property::SCALE_TOP_RADIUS, 30.0f );
- propertyMap.Insert( PrimitiveVisual::Property::SCALE_BOTTOM_RADIUS, 40.0f );
- propertyMap.Insert( PrimitiveVisual::Property::SCALE_HEIGHT, 50.0f );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE);
+ propertyMap.Insert(PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::CONICAL_FRUSTUM);
+ propertyMap.Insert(PrimitiveVisual::Property::MIX_COLOR, Vector4(0.5, 0.5, 0.5, 1.0));
+ propertyMap.Insert(PrimitiveVisual::Property::SLICES, 10);
+ propertyMap.Insert(PrimitiveVisual::Property::SCALE_TOP_RADIUS, 30.0f);
+ propertyMap.Insert(PrimitiveVisual::Property::SCALE_BOTTOM_RADIUS, 40.0f);
+ propertyMap.Insert(PrimitiveVisual::Property::SCALE_HEIGHT, 50.0f);
//Test to see if shape loads correctly.
- TestPrimitiveVisualWithProperties( propertyMap, application );
+ TestPrimitiveVisualWithProperties(propertyMap, application);
END_TEST;
}
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual5: Request primitive visual to display a bevelled cube" );
+ tet_infoline("UtcDaliVisualFactoryGetPrimitiveVisual5: Request primitive visual to display a bevelled cube");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uObjectMatrix", Property::Type::MATRIX),
- };
+ {
+ UniformData("uObjectMatrix", Property::Type::MATRIX),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE );
- propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::BEVELLED_CUBE );
- propertyMap.Insert( PrimitiveVisual::Property::MIX_COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) );
- propertyMap.Insert( PrimitiveVisual::Property::BEVEL_PERCENTAGE, 0.7f );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE);
+ propertyMap.Insert(PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::BEVELLED_CUBE);
+ propertyMap.Insert(PrimitiveVisual::Property::MIX_COLOR, Vector4(0.5, 0.5, 0.5, 1.0));
+ propertyMap.Insert(PrimitiveVisual::Property::BEVEL_PERCENTAGE, 0.7f);
//Test to see if shape loads correctly.
- TestPrimitiveVisualWithProperties( propertyMap, application );
+ TestPrimitiveVisualWithProperties(propertyMap, application);
END_TEST;
}
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual6: Request primitive visual to display an octahedron" );
+ tet_infoline("UtcDaliVisualFactoryGetPrimitiveVisual6: Request primitive visual to display an octahedron");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uObjectMatrix", Property::Type::MATRIX),
- };
+ {
+ UniformData("uObjectMatrix", Property::Type::MATRIX),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE );
- propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::OCTAHEDRON );
- propertyMap.Insert( PrimitiveVisual::Property::MIX_COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE);
+ propertyMap.Insert(PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::OCTAHEDRON);
+ propertyMap.Insert(PrimitiveVisual::Property::MIX_COLOR, Vector4(0.5, 0.5, 0.5, 1.0));
//Test to see if shape loads correctly.
- TestPrimitiveVisualWithProperties( propertyMap, application );
+ TestPrimitiveVisualWithProperties(propertyMap, application);
END_TEST;
}
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual7: Request primitive visual to display a cone" );
+ tet_infoline("UtcDaliVisualFactoryGetPrimitiveVisual7: Request primitive visual to display a cone");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uObjectMatrix", Property::Type::MATRIX),
- };
+ {
+ UniformData("uObjectMatrix", Property::Type::MATRIX),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE );
- propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::CONE );
- propertyMap.Insert( PrimitiveVisual::Property::MIX_COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) );
- propertyMap.Insert( PrimitiveVisual::Property::SLICES, 10 );
- propertyMap.Insert( PrimitiveVisual::Property::SCALE_TOP_RADIUS, 30.0f );
- propertyMap.Insert( PrimitiveVisual::Property::SCALE_HEIGHT, 50.0f );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE);
+ propertyMap.Insert(PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::CONE);
+ propertyMap.Insert(PrimitiveVisual::Property::MIX_COLOR, Vector4(0.5, 0.5, 0.5, 1.0));
+ propertyMap.Insert(PrimitiveVisual::Property::SLICES, 10);
+ propertyMap.Insert(PrimitiveVisual::Property::SCALE_TOP_RADIUS, 30.0f);
+ propertyMap.Insert(PrimitiveVisual::Property::SCALE_HEIGHT, 50.0f);
//Test to see if shape loads correctly.
- TestPrimitiveVisualWithProperties( propertyMap, application );
+ TestPrimitiveVisualWithProperties(propertyMap, application);
END_TEST;
}
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual8: Request primitive visual with set light position" );
+ tet_infoline("UtcDaliVisualFactoryGetPrimitiveVisual8: Request primitive visual with set light position");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uObjectMatrix", Property::Type::MATRIX),
- };
+ {
+ UniformData("uObjectMatrix", Property::Type::MATRIX),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE );
- propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE );
- propertyMap.Insert( PrimitiveVisual::Property::MIX_COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) );
- propertyMap.Insert( MeshVisual::Property::LIGHT_POSITION, Vector3( 0.0, 1.0, 2.0 ) );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE);
+ propertyMap.Insert(PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE);
+ propertyMap.Insert(PrimitiveVisual::Property::MIX_COLOR, Vector4(0.5, 0.5, 0.5, 1.0));
+ propertyMap.Insert(MeshVisual::Property::LIGHT_POSITION, Vector3(0.0, 1.0, 2.0));
//Test to see if shape loads correctly.
- TestPrimitiveVisualWithProperties( propertyMap, application );
+ TestPrimitiveVisualWithProperties(propertyMap, application);
END_TEST;
}
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual9: Request primitive visual with above-cap slices." );
+ tet_infoline("UtcDaliVisualFactoryGetPrimitiveVisual9: Request primitive visual with above-cap slices.");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uObjectMatrix", Property::Type::MATRIX),
- };
+ {
+ UniformData("uObjectMatrix", Property::Type::MATRIX),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE );
- propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE );
- propertyMap.Insert( PrimitiveVisual::Property::SLICES, Property::Value( 1000000 ) );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE);
+ propertyMap.Insert(PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE);
+ propertyMap.Insert(PrimitiveVisual::Property::SLICES, Property::Value(1000000));
//Test to see if shape loads correctly.
- TestPrimitiveVisualWithProperties( propertyMap, application );
+ TestPrimitiveVisualWithProperties(propertyMap, application);
END_TEST;
}
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual10: Request primitive visual with too few slices." );
+ tet_infoline("UtcDaliVisualFactoryGetPrimitiveVisual10: Request primitive visual with too few slices.");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uObjectMatrix", Property::Type::MATRIX),
- };
+ {
+ UniformData("uObjectMatrix", Property::Type::MATRIX),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE );
- propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE );
- propertyMap.Insert( PrimitiveVisual::Property::SLICES, Property::Value( 2 ) );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE);
+ propertyMap.Insert(PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE);
+ propertyMap.Insert(PrimitiveVisual::Property::SLICES, Property::Value(2));
//Test to see if shape loads correctly.
- TestPrimitiveVisualWithProperties( propertyMap, application );
+ TestPrimitiveVisualWithProperties(propertyMap, application);
END_TEST;
}
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual11: Request primitive visual with too many stacks." );
+ tet_infoline("UtcDaliVisualFactoryGetPrimitiveVisual11: Request primitive visual with too many stacks.");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uObjectMatrix", Property::Type::MATRIX),
- };
+ {
+ UniformData("uObjectMatrix", Property::Type::MATRIX),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE );
- propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE );
- propertyMap.Insert( PrimitiveVisual::Property::STACKS, Property::Value( 1000000 ) );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE);
+ propertyMap.Insert(PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE);
+ propertyMap.Insert(PrimitiveVisual::Property::STACKS, Property::Value(1000000));
//Test to see if shape loads correctly.
- TestPrimitiveVisualWithProperties( propertyMap, application );
+ TestPrimitiveVisualWithProperties(propertyMap, application);
END_TEST;
}
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual12: Request primitive visual with too few stacks." );
+ tet_infoline("UtcDaliVisualFactoryGetPrimitiveVisual12: Request primitive visual with too few stacks.");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uObjectMatrix", Property::Type::MATRIX),
- };
+ {
+ UniformData("uObjectMatrix", Property::Type::MATRIX),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE );
- propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE );
- propertyMap.Insert( PrimitiveVisual::Property::STACKS, Property::Value( 1 ) );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE);
+ propertyMap.Insert(PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE);
+ propertyMap.Insert(PrimitiveVisual::Property::STACKS, Property::Value(1));
//Test to see if shape loads correctly.
- TestPrimitiveVisualWithProperties( propertyMap, application );
+ TestPrimitiveVisualWithProperties(propertyMap, application);
END_TEST;
}
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual13: Request primitive visual with invalid scale dimensions." );
+ tet_infoline("UtcDaliVisualFactoryGetPrimitiveVisual13: Request primitive visual with invalid scale dimensions.");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uObjectMatrix", Property::Type::MATRIX),
- };
+ {
+ UniformData("uObjectMatrix", Property::Type::MATRIX),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE );
- propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE );
- propertyMap.Insert( PrimitiveVisual::Property::SCALE_DIMENSIONS, Vector3::ZERO );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE);
+ propertyMap.Insert(PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE);
+ propertyMap.Insert(PrimitiveVisual::Property::SCALE_DIMENSIONS, Vector3::ZERO);
//Test to see if shape loads correctly.
- TestPrimitiveVisualWithProperties( propertyMap, application );
+ TestPrimitiveVisualWithProperties(propertyMap, application);
END_TEST;
}
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual14: Request primitive visual with too low a bevel percentage." );
+ tet_infoline("UtcDaliVisualFactoryGetPrimitiveVisual14: Request primitive visual with too low a bevel percentage.");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uObjectMatrix", Property::Type::MATRIX),
- };
+ {
+ UniformData("uObjectMatrix", Property::Type::MATRIX),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE );
- propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE );
- propertyMap.Insert( PrimitiveVisual::Property::BEVEL_PERCENTAGE, Property::Value( -1.0f ) );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE);
+ propertyMap.Insert(PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE);
+ propertyMap.Insert(PrimitiveVisual::Property::BEVEL_PERCENTAGE, Property::Value(-1.0f));
//Test to see if shape loads correctly.
- TestPrimitiveVisualWithProperties( propertyMap, application );
+ TestPrimitiveVisualWithProperties(propertyMap, application);
END_TEST;
}
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual15: Request primitive visual with too high a bevel percentage." );
+ tet_infoline("UtcDaliVisualFactoryGetPrimitiveVisual15: Request primitive visual with too high a bevel percentage.");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uObjectMatrix", Property::Type::MATRIX),
- };
+ {
+ UniformData("uObjectMatrix", Property::Type::MATRIX),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE );
- propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE );
- propertyMap.Insert( PrimitiveVisual::Property::BEVEL_PERCENTAGE, Property::Value( 2.0f ) );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE);
+ propertyMap.Insert(PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE);
+ propertyMap.Insert(PrimitiveVisual::Property::BEVEL_PERCENTAGE, Property::Value(2.0f));
//Test to see if shape loads correctly.
- TestPrimitiveVisualWithProperties( propertyMap, application );
+ TestPrimitiveVisualWithProperties(propertyMap, application);
END_TEST;
}
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual16: Request primitive visual with too low a bevel smoothness." );
+ tet_infoline("UtcDaliVisualFactoryGetPrimitiveVisual16: Request primitive visual with too low a bevel smoothness.");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uObjectMatrix", Property::Type::MATRIX),
- };
+ {
+ UniformData("uObjectMatrix", Property::Type::MATRIX),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE );
- propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE );
- propertyMap.Insert( PrimitiveVisual::Property::BEVEL_SMOOTHNESS, Property::Value( -1.0f ) );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE);
+ propertyMap.Insert(PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE);
+ propertyMap.Insert(PrimitiveVisual::Property::BEVEL_SMOOTHNESS, Property::Value(-1.0f));
//Test to see if shape loads correctly.
- TestPrimitiveVisualWithProperties( propertyMap, application );
+ TestPrimitiveVisualWithProperties(propertyMap, application);
END_TEST;
}
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual17: Request primitive visual with too high a bevel smoothness." );
+ tet_infoline("UtcDaliVisualFactoryGetPrimitiveVisual17: Request primitive visual with too high a bevel smoothness.");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uObjectMatrix", Property::Type::MATRIX),
- };
+ {
+ UniformData("uObjectMatrix", Property::Type::MATRIX),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE );
- propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE );
- propertyMap.Insert( PrimitiveVisual::Property::BEVEL_SMOOTHNESS, Property::Value( 2.0f ) );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE);
+ propertyMap.Insert(PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE);
+ propertyMap.Insert(PrimitiveVisual::Property::BEVEL_SMOOTHNESS, Property::Value(2.0f));
//Test to see if shape loads correctly.
- TestPrimitiveVisualWithProperties( propertyMap, application );
+ TestPrimitiveVisualWithProperties(propertyMap, application);
END_TEST;
}
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual18: Request primitive visual to display a conic section" );
+ tet_infoline("UtcDaliVisualFactoryGetPrimitiveVisual18: Request primitive visual to display a conic section");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uObjectMatrix", Property::Type::MATRIX),
- };
+ {
+ UniformData("uObjectMatrix", Property::Type::MATRIX),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
//Set up visual properties.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE );
- propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::CONICAL_FRUSTUM );
- propertyMap.Insert( PrimitiveVisual::Property::MIX_COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) );
- propertyMap.Insert( PrimitiveVisual::Property::SLICES, 10 );
- propertyMap.Insert( PrimitiveVisual::Property::SCALE_TOP_RADIUS, 30.0f );
- propertyMap.Insert( PrimitiveVisual::Property::SCALE_BOTTOM_RADIUS, 40.0f );
- propertyMap.Insert( PrimitiveVisual::Property::SCALE_HEIGHT, 50.0f );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE);
+ propertyMap.Insert(PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::CONICAL_FRUSTUM);
+ propertyMap.Insert(PrimitiveVisual::Property::MIX_COLOR, Vector4(0.5, 0.5, 0.5, 1.0));
+ propertyMap.Insert(PrimitiveVisual::Property::SLICES, 10);
+ propertyMap.Insert(PrimitiveVisual::Property::SCALE_TOP_RADIUS, 30.0f);
+ propertyMap.Insert(PrimitiveVisual::Property::SCALE_BOTTOM_RADIUS, 40.0f);
+ propertyMap.Insert(PrimitiveVisual::Property::SCALE_HEIGHT, 50.0f);
//Test to see if shape loads correctly.
- TestPrimitiveVisualWithProperties( propertyMap, application );
+ TestPrimitiveVisualWithProperties(propertyMap, application);
END_TEST;
}
//Set up test application first, so everything else can be handled.
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisualN1: Request primitive visual without shape" );
+ tet_infoline("UtcDaliVisualFactoryGetPrimitiveVisualN1: Request primitive visual without shape");
static std::vector<UniformData> customUniforms =
- {
- UniformData("uObjectMatrix", Property::Type::MATRIX),
- };
+ {
+ UniformData("uObjectMatrix", Property::Type::MATRIX),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
//Set up visual properties, without supplying shape.
Property::Map propertyMap;
- propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE );
+ propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE);
//Test to see if shape loads regardless of missing input.
- TestPrimitiveVisualWithProperties( propertyMap, application );
+ TestPrimitiveVisualWithProperties(propertyMap, application);
END_TEST;
}
int UtcDaliVisualFactoryGetAnimatedImageVisual1(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetAnimatedImageVisual1: Request animated image visual with a gif url" );
+ tet_infoline("UtcDaliVisualFactoryGetAnimatedImageVisual1: Request animated image visual with a gif url");
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
VisualFactory factory = VisualFactory::Get();
- Visual::Base visual = factory.CreateVisual( TEST_GIF_FILE_NAME, ImageDimensions() );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = factory.CreateVisual(TEST_GIF_FILE_NAME, ImageDimensions());
+ DALI_TEST_CHECK(visual);
- DummyControl actor = DummyControl::New(true);
+ DummyControl actor = DummyControl::New(true);
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
- dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
- actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- application.GetScene().Add( actor );
+ dummyImpl.RegisterVisual(DummyControl::Property::TEST_VISUAL, visual);
+ actor.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
application.SendNotification();
application.Render();
// renderer is added to actor
- DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
- Renderer renderer = actor.GetRendererAt( 0u );
- DALI_TEST_CHECK( renderer );
+ DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
+ Renderer renderer = actor.GetRendererAt(0u);
+ DALI_TEST_CHECK(renderer);
- DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION);
textureTrace.Reset();
// Force the timer used by the animatedImageVisual to tick,
- Dali::Timer timer = Timer::New( 0 );
+ Dali::Timer timer = Timer::New(0);
timer.MockEmitSignal();
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION);
textureTrace.Reset();
// Force the timer used by the animatedImageVisual to tick,
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION);
textureTrace.Reset();
// Force the timer used by the animatedImageVisual to tick,
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION);
textureTrace.Reset();
// Test SetOffScene().
actor.Unparent();
- DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
+ DALI_TEST_CHECK(actor.GetRendererCount() == 0u);
END_TEST;
}
int UtcDaliVisualFactoryGetAnimatedImageVisual2(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualFactoryGetAnimatedImageVisual2: Request animated image visual with a Property::Map, test custom wrap mode and pixel area" );
+ tet_infoline("UtcDaliVisualFactoryGetAnimatedImageVisual2: Request animated image visual with a Property::Map, test custom wrap mode and pixel area");
static std::vector<UniformData> customUniforms =
- {
- UniformData("pixelArea", Property::Type::VECTOR4),
- UniformData("wrapMode", Property::Type::VECTOR2),
- };
+ {
+ UniformData("pixelArea", Property::Type::VECTOR4),
+ UniformData("wrapMode", Property::Type::VECTOR2),
+ };
TestGraphicsController& graphics = application.GetGraphicsController();
graphics.AddCustomUniforms(customUniforms);
const Vector4 pixelArea(-0.5f, -0.5f, 2.f, 2.f);
Property::Map propertyMap;
- propertyMap.Add( Toolkit::Visual::Property::TYPE, Visual::IMAGE )
- .Add( ImageVisual::Property::URL, TEST_GIF_FILE_NAME )
- .Add( ImageVisual::Property::PIXEL_AREA, pixelArea )
- .Add( ImageVisual::Property::WRAP_MODE_U, WrapMode::MIRRORED_REPEAT )
- .Add( ImageVisual::Property::WRAP_MODE_V, WrapMode::REPEAT );
+ propertyMap.Add(Toolkit::Visual::Property::TYPE, Visual::IMAGE)
+ .Add(ImageVisual::Property::URL, TEST_GIF_FILE_NAME)
+ .Add(ImageVisual::Property::PIXEL_AREA, pixelArea)
+ .Add(ImageVisual::Property::WRAP_MODE_U, WrapMode::MIRRORED_REPEAT)
+ .Add(ImageVisual::Property::WRAP_MODE_V, WrapMode::REPEAT);
- Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
- DALI_TEST_CHECK( visual );
+ Visual::Base visual = VisualFactory::Get().CreateVisual(propertyMap);
+ DALI_TEST_CHECK(visual);
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
+ TestGlAbstraction& gl = application.GetGlAbstraction();
+ TraceCallStack& textureTrace = gl.GetTextureTrace();
textureTrace.Enable(true);
TraceCallStack& texParameterTrace = gl.GetTexParameterTrace();
- texParameterTrace.Enable( true );
+ texParameterTrace.Enable(true);
- DummyControl actor = DummyControl::New(true);
+ DummyControl actor = DummyControl::New(true);
DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
- dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual );
- actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
- application.GetScene().Add( actor );
+ dummyImpl.RegisterVisual(Control::CONTROL_PROPERTY_END_INDEX + 1, visual);
+ actor.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f));
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION);
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
+ DALI_TEST_CHECK(actor.GetRendererCount() == 1u);
- DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
+ DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
// For animated image visual, the wrapping is handled manually in shader, so the following gl function should not be called
std::stringstream out;
out << GL_TEXTURE_2D << ", " << GL_TEXTURE_WRAP_S << ", " << GL_MIRRORED_REPEAT;
- DALI_TEST_CHECK( !texParameterTrace.FindMethodAndParams("TexParameteri", out.str()) );
+ DALI_TEST_CHECK(!texParameterTrace.FindMethodAndParams("TexParameteri", out.str()));
out.str("");
out << GL_TEXTURE_2D << ", " << GL_TEXTURE_WRAP_T << ", " << GL_REPEAT;
- DALI_TEST_CHECK( !texParameterTrace.FindMethodAndParams("TexParameteri", out.str()) );
+ DALI_TEST_CHECK(!texParameterTrace.FindMethodAndParams("TexParameteri", out.str()));
// test the uniforms which used to handle the wrap mode
- Renderer renderer = actor.GetRendererAt( 0u );
- DALI_TEST_CHECK( renderer );
+ Renderer renderer = actor.GetRendererAt(0u);
+ DALI_TEST_CHECK(renderer);
- Property::Value pixelAreaValue = renderer.GetProperty( renderer.GetPropertyIndex( "pixelArea" ) );
- DALI_TEST_EQUALS( pixelAreaValue.Get<Vector4>(), pixelArea, TEST_LOCATION );
+ Property::Value pixelAreaValue = renderer.GetProperty(renderer.GetPropertyIndex("pixelArea"));
+ DALI_TEST_EQUALS(pixelAreaValue.Get<Vector4>(), pixelArea, TEST_LOCATION);
Vector4 pixelAreaUniform;
- DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "pixelArea", pixelAreaUniform ) );
- DALI_TEST_EQUALS( pixelArea, pixelAreaUniform, Math::MACHINE_EPSILON_100, TEST_LOCATION );
+ DALI_TEST_CHECK(gl.GetUniformValue<Vector4>("pixelArea", pixelAreaUniform));
+ DALI_TEST_EQUALS(pixelArea, pixelAreaUniform, Math::MACHINE_EPSILON_100, TEST_LOCATION);
- Property::Value wrapModeValue = renderer.GetProperty( renderer.GetPropertyIndex( "wrapMode" ) );
- Vector2 wrapMode( WrapMode::MIRRORED_REPEAT-1, WrapMode::REPEAT-1 );
- DALI_TEST_EQUALS( wrapModeValue.Get<Vector2>(), wrapMode, TEST_LOCATION );
+ Property::Value wrapModeValue = renderer.GetProperty(renderer.GetPropertyIndex("wrapMode"));
+ Vector2 wrapMode(WrapMode::MIRRORED_REPEAT - 1, WrapMode::REPEAT - 1);
+ DALI_TEST_EQUALS(wrapModeValue.Get<Vector2>(), wrapMode, TEST_LOCATION);
Vector2 wrapModeUniform;
- DALI_TEST_CHECK( gl.GetUniformValue<Vector2>( "wrapMode", wrapModeUniform ) );
- DALI_TEST_EQUALS( wrapMode, wrapModeUniform, Math::MACHINE_EPSILON_100, TEST_LOCATION );
+ DALI_TEST_CHECK(gl.GetUniformValue<Vector2>("wrapMode", wrapModeUniform));
+ DALI_TEST_EQUALS(wrapMode, wrapModeUniform, Math::MACHINE_EPSILON_100, TEST_LOCATION);
- actor.Unparent( );
- DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
+ actor.Unparent();
+ DALI_TEST_CHECK(actor.GetRendererCount() == 0u);
END_TEST;
}
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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 <iostream>
#include <stdlib.h>
+#include <iostream>
#include <dali-toolkit-test-suite-utils.h>
#include "dali-toolkit-test-utils/toolkit-timer.h"
+#include <dali-toolkit/devel-api/controls/web-view/web-back-forward-list.h>
+#include <dali-toolkit/devel-api/controls/web-view/web-context.h>
+#include <dali-toolkit/devel-api/controls/web-view/web-cookie-manager.h>
+#include <dali-toolkit/devel-api/controls/web-view/web-settings.h>
+#include <dali-toolkit/devel-api/controls/web-view/web-view.h>
+#include <dali-toolkit/public-api/controls/image-view/image-view.h>
+#include <dali-toolkit/public-api/focus-manager/keyboard-focus-manager.h>
#include <dali.h>
#include <dali/devel-api/adaptor-framework/web-engine-certificate.h>
#include <dali/devel-api/adaptor-framework/web-engine-console-message.h>
-#include <dali/devel-api/adaptor-framework/web-engine-context-menu.h>
#include <dali/devel-api/adaptor-framework/web-engine-context-menu-item.h>
+#include <dali/devel-api/adaptor-framework/web-engine-context-menu.h>
+#include <dali/devel-api/adaptor-framework/web-engine-context.h>
#include <dali/devel-api/adaptor-framework/web-engine-form-repost-decision.h>
#include <dali/devel-api/adaptor-framework/web-engine-frame.h>
#include <dali/devel-api/adaptor-framework/web-engine-hit-test.h>
#include <dali/devel-api/adaptor-framework/web-engine-load-error.h>
#include <dali/devel-api/adaptor-framework/web-engine-policy-decision.h>
#include <dali/devel-api/adaptor-framework/web-engine-request-interceptor.h>
-#include <dali/devel-api/adaptor-framework/web-engine-context.h>
#include <dali/devel-api/adaptor-framework/web-engine-security-origin.h>
#include <dali/integration-api/events/hover-event-integ.h>
#include <dali/integration-api/events/key-event-integ.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali/integration-api/events/wheel-event-integ.h>
#include <dali/public-api/images/pixel-data.h>
-#include <dali-toolkit/public-api/controls/image-view/image-view.h>
-#include <dali-toolkit/public-api/focus-manager/keyboard-focus-manager.h>
-#include <dali-toolkit/devel-api/controls/web-view/web-back-forward-list.h>
-#include <dali-toolkit/devel-api/controls/web-view/web-context.h>
-#include <dali-toolkit/devel-api/controls/web-view/web-cookie-manager.h>
-#include <dali-toolkit/devel-api/controls/web-view/web-settings.h>
-#include <dali-toolkit/devel-api/controls/web-view/web-view.h>
using namespace Dali;
using namespace Toolkit;
namespace
{
-
-const char* const TEST_URL1( "http://www.somewhere.valid1.com" );
-const char* const TEST_URL2( "http://www.somewhere.valid2.com" );
-
-static int gPageLoadStartedCallbackCalled = 0;
-static int gPageLoadInProgressCallbackCalled = 0;
-static int gPageLoadFinishedCallbackCalled = 0;
-static int gPageLoadErrorCallbackCalled = 0;
-static std::unique_ptr<Dali::WebEngineLoadError> gPageLoadErrorInstance = nullptr;
-static int gScrollEdgeReachedCallbackCalled = 0;
-static int gUrlChangedCallbackCalled = 0;
-static int gEvaluateJavaScriptCallbackCalled = 0;
-static int gJavaScriptAlertCallbackCalled = 0;
-static int gJavaScriptConfirmCallbackCalled = 0;
-static int gJavaScriptPromptCallbackCalled = 0;
-static int gScreenshotCapturedCallbackCalled = 0;
-static int gVideoPlayingCallbackCalled = 0;
-static int gGeolocationPermissionCallbackCalled = 0;
-static bool gTouched = false;
-static bool gHovered = false;
-static bool gWheelEventHandled = false;
-static int gFormRepostDecidedCallbackCalled = 0;
-static std::unique_ptr<Dali::WebEngineFormRepostDecision> gFormRepostDecidedInstance = nullptr;
-static int gFrameRenderedCallbackCalled = 0;
-static int gConsoleMessageCallbackCalled = 0;
-static std::unique_ptr<Dali::WebEngineConsoleMessage> gConsoleMessageInstance = nullptr;
-static int gResponsePolicyDecidedCallbackCalled = 0;
-static int gNavigationPolicyDecidedCallbackCalled = 0;
-static std::unique_ptr<Dali::WebEnginePolicyDecision> gResponsePolicyDecisionInstance = nullptr;
-static int gCertificateConfirmCallbackCalled = 0;
-static std::unique_ptr<Dali::WebEngineCertificate> gCertificateConfirmInstance = nullptr;
-static int gSslCertificateChangedCallbackCalled = 0;
-static std::unique_ptr<Dali::WebEngineCertificate> gSslCertificateInstance = nullptr;
-static int gHttpAuthHandlerCallbackCalled = 0;
-static std::unique_ptr<Dali::WebEngineHttpAuthHandler> gHttpAuthInstance = nullptr;
-static int gSecurityOriginsAcquiredCallbackCalled = 0;
-static int gStorageUsageAcquiredCallbackCalled = 0;
-static int gFormPasswordsAcquiredCallbackCalled = 0;
-static int gDownloadStartedCallbackCalled = 0;
-static int gMimeOverriddenCallbackCalled = 0;
-static int gRequestInterceptedCallbackCalled = 0;
-static Dali::WebEngineRequestInterceptorPtr gRequestInterceptorInstance = nullptr;
-static std::vector<std::unique_ptr<Dali::WebEngineSecurityOrigin>> gSecurityOriginList;
+const char* const TEST_URL1("http://www.somewhere.valid1.com");
+const char* const TEST_URL2("http://www.somewhere.valid2.com");
+
+static int gPageLoadStartedCallbackCalled = 0;
+static int gPageLoadInProgressCallbackCalled = 0;
+static int gPageLoadFinishedCallbackCalled = 0;
+static int gPageLoadErrorCallbackCalled = 0;
+static std::unique_ptr<Dali::WebEngineLoadError> gPageLoadErrorInstance = nullptr;
+static int gScrollEdgeReachedCallbackCalled = 0;
+static int gUrlChangedCallbackCalled = 0;
+static int gEvaluateJavaScriptCallbackCalled = 0;
+static int gJavaScriptAlertCallbackCalled = 0;
+static int gJavaScriptConfirmCallbackCalled = 0;
+static int gJavaScriptPromptCallbackCalled = 0;
+static int gScreenshotCapturedCallbackCalled = 0;
+static int gVideoPlayingCallbackCalled = 0;
+static int gGeolocationPermissionCallbackCalled = 0;
+static bool gTouched = false;
+static bool gHovered = false;
+static bool gWheelEventHandled = false;
+static int gFormRepostDecidedCallbackCalled = 0;
+static std::unique_ptr<Dali::WebEngineFormRepostDecision> gFormRepostDecidedInstance = nullptr;
+static int gFrameRenderedCallbackCalled = 0;
+static int gConsoleMessageCallbackCalled = 0;
+static std::unique_ptr<Dali::WebEngineConsoleMessage> gConsoleMessageInstance = nullptr;
+static int gResponsePolicyDecidedCallbackCalled = 0;
+static int gNavigationPolicyDecidedCallbackCalled = 0;
+static std::unique_ptr<Dali::WebEnginePolicyDecision> gResponsePolicyDecisionInstance = nullptr;
+static int gCertificateConfirmCallbackCalled = 0;
+static std::unique_ptr<Dali::WebEngineCertificate> gCertificateConfirmInstance = nullptr;
+static int gSslCertificateChangedCallbackCalled = 0;
+static std::unique_ptr<Dali::WebEngineCertificate> gSslCertificateInstance = nullptr;
+static int gHttpAuthHandlerCallbackCalled = 0;
+static std::unique_ptr<Dali::WebEngineHttpAuthHandler> gHttpAuthInstance = nullptr;
+static int gSecurityOriginsAcquiredCallbackCalled = 0;
+static int gStorageUsageAcquiredCallbackCalled = 0;
+static int gFormPasswordsAcquiredCallbackCalled = 0;
+static int gDownloadStartedCallbackCalled = 0;
+static int gMimeOverriddenCallbackCalled = 0;
+static int gRequestInterceptedCallbackCalled = 0;
+static Dali::WebEngineRequestInterceptorPtr gRequestInterceptorInstance = nullptr;
+static std::vector<std::unique_ptr<Dali::WebEngineSecurityOrigin>> gSecurityOriginList;
static std::vector<std::unique_ptr<Dali::WebEngineContext::PasswordData>> gPasswordDataList;
-static int gContextMenuShownCallbackCalled = 0;
-static std::unique_ptr<Dali::WebEngineContextMenu> gContextMenuShownInstance = nullptr;
-static int gContextMenuHiddenCallbackCalled = 0;
-static std::unique_ptr<Dali::WebEngineContextMenu> gContextMenuHiddenInstance = nullptr;
-static int gHitTestCreatedCallbackCalled = 0;
-static int gCookieManagerChangsWatchCallbackCalled = 0;
-static int gPlainTextReceivedCallbackCalled = 0;
+static int gContextMenuShownCallbackCalled = 0;
+static std::unique_ptr<Dali::WebEngineContextMenu> gContextMenuShownInstance = nullptr;
+static int gContextMenuHiddenCallbackCalled = 0;
+static std::unique_ptr<Dali::WebEngineContextMenu> gContextMenuHiddenInstance = nullptr;
+static int gHitTestCreatedCallbackCalled = 0;
+static int gCookieManagerChangsWatchCallbackCalled = 0;
+static int gPlainTextReceivedCallbackCalled = 0;
struct CallbackFunctor
{
CallbackFunctor(bool* callbackFlag)
- : mCallbackFlag( callbackFlag )
+ : mCallbackFlag(callbackFlag)
{
}
return true;
}
-static bool OnTouched( Actor actor, const Dali::TouchEvent& touch )
+static bool OnTouched(Actor actor, const Dali::TouchEvent& touch)
{
gTouched = true;
return true;
ToolkitTestApplication application;
// Copy and Assignment Test
- tet_infoline( "UtcDaliWebViewBasic Copy and Assignment Test" );
+ tet_infoline("UtcDaliWebViewBasic Copy and Assignment Test");
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- WebView copy( view );
- DALI_TEST_CHECK( view == copy );
+ WebView copy(view);
+ DALI_TEST_CHECK(view == copy);
WebView assign;
- DALI_TEST_CHECK( !assign );
+ DALI_TEST_CHECK(!assign);
assign = copy;
- DALI_TEST_CHECK( assign == view );
+ DALI_TEST_CHECK(assign == view);
// DownCast Test
- tet_infoline( "UtcDaliWebViewBasic DownCast Test" );
+ tet_infoline("UtcDaliWebViewBasic DownCast Test");
BaseHandle handle(view);
- WebView view2 = WebView::DownCast( handle );
- DALI_TEST_CHECK( view );
- DALI_TEST_CHECK( view2 );
- DALI_TEST_CHECK( view == view2 );
+ WebView view2 = WebView::DownCast(handle);
+ DALI_TEST_CHECK(view);
+ DALI_TEST_CHECK(view2);
+ DALI_TEST_CHECK(view == view2);
// TypeRegistry Test
- tet_infoline( "UtcDaliWebViewBasic TypeRegistry Test" );
+ tet_infoline("UtcDaliWebViewBasic TypeRegistry Test");
TypeRegistry typeRegistry = TypeRegistry::Get();
- DALI_TEST_CHECK( typeRegistry );
+ DALI_TEST_CHECK(typeRegistry);
- TypeInfo typeInfo = typeRegistry.GetTypeInfo( "WebView" );
- DALI_TEST_CHECK( typeInfo );
+ TypeInfo typeInfo = typeRegistry.GetTypeInfo("WebView");
+ DALI_TEST_CHECK(typeInfo);
BaseHandle handle2 = typeInfo.CreateInstance();
- DALI_TEST_CHECK( handle2 );
+ DALI_TEST_CHECK(handle2);
- WebView view3 = WebView::DownCast( handle2 );
- DALI_TEST_CHECK( view3 );
+ WebView view3 = WebView::DownCast(handle2);
+ DALI_TEST_CHECK(view3);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- view.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- view.SetProperty( Actor::Property::POSITION, Vector2( 0, 0 ));
- view.SetProperty( Actor::Property::SIZE, Vector2( 800, 600 ) );
- application.GetScene().Add( view );
+ view.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ view.SetProperty(Actor::Property::POSITION, Vector2(0, 0));
+ view.SetProperty(Actor::Property::SIZE, Vector2(800, 600));
+ application.GetScene().Add(view);
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( view );
-
- view.RegisterPageLoadStartedCallback( &OnPageLoadStarted );
- view.RegisterPageLoadInProgressCallback( &OnPageLoadInProgress );
- view.RegisterPageLoadFinishedCallback( &OnPageLoadFinished );
- view.RegisterUrlChangedCallback( &OnUrlChanged );
- DALI_TEST_EQUALS( gPageLoadStartedCallbackCalled, 0, TEST_LOCATION );
- DALI_TEST_EQUALS( gPageLoadInProgressCallbackCalled, 0, TEST_LOCATION );
- DALI_TEST_EQUALS( gPageLoadFinishedCallbackCalled, 0, TEST_LOCATION );
- DALI_TEST_EQUALS( gUrlChangedCallbackCalled, 0, TEST_LOCATION );
-
- view.LoadUrl( TEST_URL1 );
+ DALI_TEST_CHECK(view);
+
+ view.RegisterPageLoadStartedCallback(&OnPageLoadStarted);
+ view.RegisterPageLoadInProgressCallback(&OnPageLoadInProgress);
+ view.RegisterPageLoadFinishedCallback(&OnPageLoadFinished);
+ view.RegisterUrlChangedCallback(&OnUrlChanged);
+ DALI_TEST_EQUALS(gPageLoadStartedCallbackCalled, 0, TEST_LOCATION);
+ DALI_TEST_EQUALS(gPageLoadInProgressCallbackCalled, 0, TEST_LOCATION);
+ DALI_TEST_EQUALS(gPageLoadFinishedCallbackCalled, 0, TEST_LOCATION);
+ DALI_TEST_EQUALS(gUrlChangedCallbackCalled, 0, TEST_LOCATION);
+
+ view.LoadUrl(TEST_URL1);
view.GetNaturalSize();
Test::EmitGlobalTimerSignal();
- DALI_TEST_EQUALS( view.CanGoBack(), false, TEST_LOCATION );
- DALI_TEST_EQUALS( gPageLoadStartedCallbackCalled, 1, TEST_LOCATION );
- DALI_TEST_EQUALS( gPageLoadInProgressCallbackCalled, 1, TEST_LOCATION );
- DALI_TEST_EQUALS( gPageLoadFinishedCallbackCalled, 1, TEST_LOCATION );
- DALI_TEST_EQUALS( gUrlChangedCallbackCalled, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(view.CanGoBack(), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(gPageLoadStartedCallbackCalled, 1, TEST_LOCATION);
+ DALI_TEST_EQUALS(gPageLoadInProgressCallbackCalled, 1, TEST_LOCATION);
+ DALI_TEST_EQUALS(gPageLoadFinishedCallbackCalled, 1, TEST_LOCATION);
+ DALI_TEST_EQUALS(gUrlChangedCallbackCalled, 1, TEST_LOCATION);
- view.LoadUrl( TEST_URL2 );
+ view.LoadUrl(TEST_URL2);
view.Suspend();
- view.SetProperty( Actor::Property::SIZE, Vector2( 400, 300 ) );
+ view.SetProperty(Actor::Property::SIZE, Vector2(400, 300));
application.SendNotification();
application.Render();
Test::EmitGlobalTimerSignal();
view.Resume();
- DALI_TEST_EQUALS( view.CanGoBack(), true, TEST_LOCATION );
- DALI_TEST_EQUALS( view.CanGoForward(), false, TEST_LOCATION );
- DALI_TEST_EQUALS( gPageLoadStartedCallbackCalled, 2, TEST_LOCATION );
- DALI_TEST_EQUALS( gPageLoadInProgressCallbackCalled, 2, TEST_LOCATION );
- DALI_TEST_EQUALS( gPageLoadFinishedCallbackCalled, 2, TEST_LOCATION );
- DALI_TEST_EQUALS( gUrlChangedCallbackCalled, 2, TEST_LOCATION );
+ DALI_TEST_EQUALS(view.CanGoBack(), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(view.CanGoForward(), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(gPageLoadStartedCallbackCalled, 2, TEST_LOCATION);
+ DALI_TEST_EQUALS(gPageLoadInProgressCallbackCalled, 2, TEST_LOCATION);
+ DALI_TEST_EQUALS(gPageLoadFinishedCallbackCalled, 2, TEST_LOCATION);
+ DALI_TEST_EQUALS(gUrlChangedCallbackCalled, 2, TEST_LOCATION);
view.GoBack();
Test::EmitGlobalTimerSignal();
- DALI_TEST_CHECK( !view.CanGoBack() );
- DALI_TEST_CHECK( view.CanGoForward() );
+ DALI_TEST_CHECK(!view.CanGoBack());
+ DALI_TEST_CHECK(view.CanGoForward());
view.GoForward();
Test::EmitGlobalTimerSignal();
- DALI_TEST_CHECK( view.CanGoBack() );
- DALI_TEST_CHECK( !view.CanGoForward() );
+ DALI_TEST_CHECK(view.CanGoBack());
+ DALI_TEST_CHECK(!view.CanGoForward());
view.Reload();
view.StopLoading();
view.ClearHistory();
Test::EmitGlobalTimerSignal();
- DALI_TEST_CHECK( !view.CanGoBack() );
- DALI_TEST_CHECK( !view.CanGoForward() );
+ DALI_TEST_CHECK(!view.CanGoBack());
+ DALI_TEST_CHECK(!view.CanGoForward());
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- view.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- view.SetProperty( Actor::Property::POSITION, Vector2( 0, 0 ));
- view.SetProperty( Actor::Property::SIZE, Vector2( 800, 600 ) );
- application.GetScene().Add( view );
+ view.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ view.SetProperty(Actor::Property::POSITION, Vector2(0, 0));
+ view.SetProperty(Actor::Property::SIZE, Vector2(800, 600));
+ application.GetScene().Add(view);
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- view.RegisterPageLoadErrorCallback( &OnPageLoadError );
- view.RegisterConsoleMessageReceivedCallback( &OnConsoleMessage );
- DALI_TEST_EQUALS( gPageLoadErrorCallbackCalled, 0, TEST_LOCATION );
- DALI_TEST_EQUALS( gConsoleMessageCallbackCalled, 0, TEST_LOCATION );
+ view.RegisterPageLoadErrorCallback(&OnPageLoadError);
+ view.RegisterConsoleMessageReceivedCallback(&OnConsoleMessage);
+ DALI_TEST_EQUALS(gPageLoadErrorCallbackCalled, 0, TEST_LOCATION);
+ DALI_TEST_EQUALS(gConsoleMessageCallbackCalled, 0, TEST_LOCATION);
- view.LoadUrl( TEST_URL1 );
+ view.LoadUrl(TEST_URL1);
Test::EmitGlobalTimerSignal();
- DALI_TEST_EQUALS( gPageLoadErrorCallbackCalled, 1, TEST_LOCATION );
- DALI_TEST_EQUALS( gConsoleMessageCallbackCalled, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(gPageLoadErrorCallbackCalled, 1, TEST_LOCATION);
+ DALI_TEST_EQUALS(gConsoleMessageCallbackCalled, 1, TEST_LOCATION);
// error code.
DALI_TEST_CHECK(gPageLoadErrorInstance);
DALI_TEST_EQUALS(gConsoleMessageInstance->GetText(), testConsoleText, TEST_LOCATION);
// reset
- gPageLoadErrorInstance = nullptr;
+ gPageLoadErrorInstance = nullptr;
gConsoleMessageInstance = nullptr;
END_TEST;
ToolkitTestApplication application;
WebView view = WebView::New();
- view.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- view.SetProperty( Actor::Property::POSITION, Vector2( 0, 0 ));
- view.SetProperty( Actor::Property::SIZE, Vector2( 800, 600 ) );
+ view.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ view.SetProperty(Actor::Property::POSITION, Vector2(0, 0));
+ view.SetProperty(Actor::Property::SIZE, Vector2(800, 600));
- application.GetScene().Add( view );
+ application.GetScene().Add(view);
application.SendNotification();
application.Render();
view.GetNaturalSize();
- view.TouchedSignal().Connect( &OnTouched );
+ view.TouchedSignal().Connect(&OnTouched);
// Touch event
Dali::Integration::TouchEvent event;
- Dali::Integration::Point pointDown, pointUp;
+ Dali::Integration::Point pointDown, pointUp;
event = Dali::Integration::TouchEvent();
- pointDown.SetState( PointState::DOWN );
- pointDown.SetScreenPosition( Vector2( 10, 10 ) );
- event.AddPoint( pointDown );
- application.ProcessEvent( event );
+ pointDown.SetState(PointState::DOWN);
+ pointDown.SetScreenPosition(Vector2(10, 10));
+ event.AddPoint(pointDown);
+ application.ProcessEvent(event);
event = Dali::Integration::TouchEvent();
- pointUp.SetState( PointState::UP );
- pointUp.SetScreenPosition( Vector2( 10, 10 ) );
- event.AddPoint( pointUp );
- application.ProcessEvent( event );
+ pointUp.SetState(PointState::UP);
+ pointUp.SetScreenPosition(Vector2(10, 10));
+ event.AddPoint(pointUp);
+ application.ProcessEvent(event);
// Key event
- Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor( view );
- application.ProcessEvent( Integration::KeyEvent( "", "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::DOWN, "", "", Device::Class::NONE, Device::Subclass::NONE ) );
+ Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor(view);
+ application.ProcessEvent(Integration::KeyEvent("", "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::DOWN, "", "", Device::Class::NONE, Device::Subclass::NONE));
application.SendNotification();
- DALI_TEST_CHECK( gTouched );
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(gTouched);
+ DALI_TEST_CHECK(view);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- view.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- view.SetProperty( Actor::Property::POSITION, Vector2( 0, 0 ));
- view.SetProperty( Actor::Property::SIZE, Vector2( 800, 600 ) );
+ view.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ view.SetProperty(Actor::Property::POSITION, Vector2(0, 0));
+ view.SetProperty(Actor::Property::SIZE, Vector2(800, 600));
- application.GetScene().Add( view );
+ application.GetScene().Add(view);
application.SendNotification();
application.Render();
view.SetKeyInputFocus();
- DALI_TEST_CHECK( view.HasKeyInputFocus() );
+ DALI_TEST_CHECK(view.HasKeyInputFocus());
// reset
view.ClearKeyInputFocus();
- DALI_TEST_CHECK( !view.HasKeyInputFocus() );
+ DALI_TEST_CHECK(!view.HasKeyInputFocus());
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- view.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- view.SetProperty( Actor::Property::POSITION, Vector2( 0, 0 ));
- view.SetProperty( Actor::Property::SIZE, Vector2( 800, 600 ) );
+ view.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ view.SetProperty(Actor::Property::POSITION, Vector2(0, 0));
+ view.SetProperty(Actor::Property::SIZE, Vector2(800, 600));
- application.GetScene().Add( view );
+ application.GetScene().Add(view);
application.SendNotification();
application.Render();
- view.SetProperty( WebView::Property::PAGE_ZOOM_FACTOR, 1.5f);
- float zoomFactor = view.GetProperty<float>( WebView::Property::PAGE_ZOOM_FACTOR );
- DALI_TEST_EQUALS( zoomFactor, 1.5f, TEST_LOCATION );
+ view.SetProperty(WebView::Property::PAGE_ZOOM_FACTOR, 1.5f);
+ float zoomFactor = view.GetProperty<float>(WebView::Property::PAGE_ZOOM_FACTOR);
+ DALI_TEST_EQUALS(zoomFactor, 1.5f, TEST_LOCATION);
- view.SetProperty( WebView::Property::PAGE_ZOOM_FACTOR, 1.0f);
- zoomFactor = view.GetProperty<float>( WebView::Property::PAGE_ZOOM_FACTOR );
- DALI_TEST_EQUALS( zoomFactor, 1.0f, TEST_LOCATION );
+ view.SetProperty(WebView::Property::PAGE_ZOOM_FACTOR, 1.0f);
+ zoomFactor = view.GetProperty<float>(WebView::Property::PAGE_ZOOM_FACTOR);
+ DALI_TEST_EQUALS(zoomFactor, 1.0f, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- view.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- view.SetProperty( Actor::Property::POSITION, Vector2( 0, 0 ));
- view.SetProperty( Actor::Property::SIZE, Vector2( 800, 600 ) );
+ view.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ view.SetProperty(Actor::Property::POSITION, Vector2(0, 0));
+ view.SetProperty(Actor::Property::SIZE, Vector2(800, 600));
- application.GetScene().Add( view );
+ application.GetScene().Add(view);
application.SendNotification();
application.Render();
- view.SetProperty( WebView::Property::TEXT_ZOOM_FACTOR, 1.5f);
- float zoomFactor = view.GetProperty<float>( WebView::Property::TEXT_ZOOM_FACTOR );
- DALI_TEST_EQUALS( zoomFactor, 1.5f, TEST_LOCATION );
+ view.SetProperty(WebView::Property::TEXT_ZOOM_FACTOR, 1.5f);
+ float zoomFactor = view.GetProperty<float>(WebView::Property::TEXT_ZOOM_FACTOR);
+ DALI_TEST_EQUALS(zoomFactor, 1.5f, TEST_LOCATION);
- view.SetProperty( WebView::Property::TEXT_ZOOM_FACTOR, 1.0f);
- zoomFactor = view.GetProperty<float>( WebView::Property::TEXT_ZOOM_FACTOR );
- DALI_TEST_EQUALS( zoomFactor, 1.0f, TEST_LOCATION );
+ view.SetProperty(WebView::Property::TEXT_ZOOM_FACTOR, 1.0f);
+ zoomFactor = view.GetProperty<float>(WebView::Property::TEXT_ZOOM_FACTOR);
+ DALI_TEST_EQUALS(zoomFactor, 1.0f, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- view.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- view.SetProperty( Actor::Property::POSITION, Vector2( 0, 0 ));
- view.SetProperty( Actor::Property::SIZE, Vector2( 800, 600 ) );
+ view.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ view.SetProperty(Actor::Property::POSITION, Vector2(0, 0));
+ view.SetProperty(Actor::Property::SIZE, Vector2(800, 600));
- application.GetScene().Add( view );
+ application.GetScene().Add(view);
application.SendNotification();
application.Render();
- float percentage = view.GetProperty<float>( WebView::Property::LOAD_PROGRESS_PERCENTAGE );
- DALI_TEST_EQUALS( percentage, 0.5f, TEST_LOCATION );
+ float percentage = view.GetProperty<float>(WebView::Property::LOAD_PROGRESS_PERCENTAGE);
+ DALI_TEST_EQUALS(percentage, 0.5f, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- view.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- view.SetProperty( Actor::Property::POSITION, Vector2( 0, 0 ));
- view.SetProperty( Actor::Property::SIZE, Vector2( 800, 600 ) );
+ view.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ view.SetProperty(Actor::Property::POSITION, Vector2(0, 0));
+ view.SetProperty(Actor::Property::SIZE, Vector2(800, 600));
- application.GetScene().Add( view );
+ application.GetScene().Add(view);
application.SendNotification();
application.Render();
- view.SetProperty( Actor::Property::POSITION, Vector2( 100, 100 ));
- Vector3 viewPos = view.GetProperty<Vector3>( Actor::Property::POSITION );
- DALI_TEST_EQUALS( viewPos, Vector3( 100, 100, 0 ), TEST_LOCATION );
+ view.SetProperty(Actor::Property::POSITION, Vector2(100, 100));
+ Vector3 viewPos = view.GetProperty<Vector3>(Actor::Property::POSITION);
+ DALI_TEST_EQUALS(viewPos, Vector3(100, 100, 0), TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
const bool kDefaultValue = false;
- const bool kTestValue = true;
+ const bool kTestValue = true;
// Check default value
- bool output;
- Property::Value value = view.GetProperty( WebView::Property::VIDEO_HOLE_ENABLED );
- DALI_TEST_CHECK( value.Get( output ) );
- DALI_TEST_EQUALS( output, kDefaultValue, TEST_LOCATION );
+ bool output;
+ Property::Value value = view.GetProperty(WebView::Property::VIDEO_HOLE_ENABLED);
+ DALI_TEST_CHECK(value.Get(output));
+ DALI_TEST_EQUALS(output, kDefaultValue, TEST_LOCATION);
// Check Set/GetProperty
- view.SetProperty( WebView::Property::VIDEO_HOLE_ENABLED, kTestValue );
- value = view.GetProperty( WebView::Property::VIDEO_HOLE_ENABLED );
- DALI_TEST_CHECK( value.Get( output ) );
- DALI_TEST_EQUALS( output, kTestValue, TEST_LOCATION );
+ view.SetProperty(WebView::Property::VIDEO_HOLE_ENABLED, kTestValue);
+ value = view.GetProperty(WebView::Property::VIDEO_HOLE_ENABLED);
+ DALI_TEST_CHECK(value.Get(output));
+ DALI_TEST_EQUALS(output, kTestValue, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
const bool kDefaultValue = true;
- const bool kTestValue = false;
+ const bool kTestValue = false;
// Check default value
- bool output;
- Property::Value value = view.GetProperty( WebView::Property::MOUSE_EVENTS_ENABLED );
- DALI_TEST_CHECK( value.Get( output ) );
- DALI_TEST_EQUALS( output, kDefaultValue, TEST_LOCATION );
+ bool output;
+ Property::Value value = view.GetProperty(WebView::Property::MOUSE_EVENTS_ENABLED);
+ DALI_TEST_CHECK(value.Get(output));
+ DALI_TEST_EQUALS(output, kDefaultValue, TEST_LOCATION);
// Check Set/GetProperty
- view.SetProperty( WebView::Property::MOUSE_EVENTS_ENABLED, kTestValue );
- value = view.GetProperty( WebView::Property::MOUSE_EVENTS_ENABLED );
- DALI_TEST_CHECK( value.Get( output ) );
- DALI_TEST_EQUALS( output, kTestValue, TEST_LOCATION );
+ view.SetProperty(WebView::Property::MOUSE_EVENTS_ENABLED, kTestValue);
+ value = view.GetProperty(WebView::Property::MOUSE_EVENTS_ENABLED);
+ DALI_TEST_CHECK(value.Get(output));
+ DALI_TEST_EQUALS(output, kTestValue, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
const bool kDefaultValue = true;
- const bool kTestValue = false;
+ const bool kTestValue = false;
// Check default value
- bool output;
- Property::Value value = view.GetProperty( WebView::Property::KEY_EVENTS_ENABLED );
- DALI_TEST_CHECK( value.Get( output ) );
- DALI_TEST_EQUALS( output, kDefaultValue, TEST_LOCATION );
+ bool output;
+ Property::Value value = view.GetProperty(WebView::Property::KEY_EVENTS_ENABLED);
+ DALI_TEST_CHECK(value.Get(output));
+ DALI_TEST_EQUALS(output, kDefaultValue, TEST_LOCATION);
// Check Set/GetProperty
- view.SetProperty( WebView::Property::KEY_EVENTS_ENABLED, kTestValue );
- value = view.GetProperty( WebView::Property::KEY_EVENTS_ENABLED );
- DALI_TEST_CHECK( value.Get( output ) );
- DALI_TEST_EQUALS( output, kTestValue, TEST_LOCATION );
+ view.SetProperty(WebView::Property::KEY_EVENTS_ENABLED, kTestValue);
+ value = view.GetProperty(WebView::Property::KEY_EVENTS_ENABLED);
+ DALI_TEST_CHECK(value.Get(output));
+ DALI_TEST_EQUALS(output, kTestValue, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
- view.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- view.SetProperty( Actor::Property::POSITION, Vector2( 0, 0 ));
- view.SetProperty( Actor::Property::SIZE, Vector2( 800, 600 ) );
+ DALI_TEST_CHECK(view);
+ view.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ view.SetProperty(Actor::Property::POSITION, Vector2(0, 0));
+ view.SetProperty(Actor::Property::SIZE, Vector2(800, 600));
- application.GetScene().Add( view );
+ application.GetScene().Add(view);
application.SendNotification();
application.Render();
view.GetNaturalSize();
- view.HoveredSignal().Connect( &OnHovered );
- view.WheelEventSignal().Connect( &OnWheelEvent );
+ view.HoveredSignal().Connect(&OnHovered);
+ view.WheelEventSignal().Connect(&OnWheelEvent);
// Hover event
Dali::Integration::HoverEvent event = Dali::Integration::HoverEvent();
- Dali::Integration::Point pointDown;
- pointDown.SetState( PointState::DOWN );
- pointDown.SetScreenPosition( Vector2( 10, 10 ) );
- event.AddPoint( pointDown );
- application.ProcessEvent( event );
+ Dali::Integration::Point pointDown;
+ pointDown.SetState(PointState::DOWN);
+ pointDown.SetScreenPosition(Vector2(10, 10));
+ event.AddPoint(pointDown);
+ application.ProcessEvent(event);
event = Dali::Integration::HoverEvent();
Dali::Integration::Point pointUp;
- pointUp.SetState( PointState::UP );
- pointUp.SetScreenPosition( Vector2( 10, 10 ) );
- event.AddPoint( pointUp );
- application.ProcessEvent( event );
+ pointUp.SetState(PointState::UP);
+ pointUp.SetScreenPosition(Vector2(10, 10));
+ event.AddPoint(pointUp);
+ application.ProcessEvent(event);
event = Dali::Integration::HoverEvent();
Dali::Integration::Point pointMotion;
- pointUp.SetState( PointState::MOTION );
- pointUp.SetScreenPosition( Vector2( 10, 10 ) );
- event.AddPoint( pointMotion );
- application.ProcessEvent( event );
+ pointUp.SetState(PointState::MOTION);
+ pointUp.SetScreenPosition(Vector2(10, 10));
+ event.AddPoint(pointMotion);
+ application.ProcessEvent(event);
// Wheel event
Dali::Integration::WheelEvent wheelEvent;
- wheelEvent.type = Dali::Integration::WheelEvent::Type::MOUSE_WHEEL;
+ wheelEvent.type = Dali::Integration::WheelEvent::Type::MOUSE_WHEEL;
wheelEvent.direction = 0;
- wheelEvent.point = Vector2( 20, 20 );
- wheelEvent.delta = 10;
- application.ProcessEvent( wheelEvent );
+ wheelEvent.point = Vector2(20, 20);
+ wheelEvent.delta = 10;
+ application.ProcessEvent(wheelEvent);
application.SendNotification();
- DALI_TEST_CHECK( gHovered );
- DALI_TEST_CHECK( gWheelEventHandled );
+ DALI_TEST_CHECK(gHovered);
+ DALI_TEST_CHECK(gWheelEventHandled);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- view.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- view.SetProperty( Actor::Property::POSITION, Vector2( 0, 0 ));
- view.SetProperty( Actor::Property::SIZE, Vector2( 800, 600 ) );
- application.GetScene().Add( view );
+ view.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ view.SetProperty(Actor::Property::POSITION, Vector2(0, 0));
+ view.SetProperty(Actor::Property::SIZE, Vector2(800, 600));
+ application.GetScene().Add(view);
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
view.RegisterFormRepostDecidedCallback(&OnFormRepostDecided);
view.RegisterFrameRenderedCallback(&OnFrameRendered);
- DALI_TEST_EQUALS( gFormRepostDecidedCallbackCalled, 0, TEST_LOCATION );
- DALI_TEST_EQUALS( gFrameRenderedCallbackCalled, 0, TEST_LOCATION );
+ DALI_TEST_EQUALS(gFormRepostDecidedCallbackCalled, 0, TEST_LOCATION);
+ DALI_TEST_EQUALS(gFrameRenderedCallbackCalled, 0, TEST_LOCATION);
- view.LoadUrl( TEST_URL1 );
+ view.LoadUrl(TEST_URL1);
Test::EmitGlobalTimerSignal();
- DALI_TEST_EQUALS( gFormRepostDecidedCallbackCalled, 1, TEST_LOCATION );
- DALI_TEST_EQUALS( gFrameRenderedCallbackCalled, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(gFormRepostDecidedCallbackCalled, 1, TEST_LOCATION);
+ DALI_TEST_EQUALS(gFrameRenderedCallbackCalled, 1, TEST_LOCATION);
// form repost decision.
DALI_TEST_CHECK(gFormRepostDecidedInstance);
ToolkitTestApplication application;
WebView view = WebView::New();
- view.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- view.SetProperty( Actor::Property::POSITION, Vector2( 0, 0 ));
- view.SetProperty( Actor::Property::SIZE, Vector2( 800, 600 ) );
- application.GetScene().Add( view );
+ view.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ view.SetProperty(Actor::Property::POSITION, Vector2(0, 0));
+ view.SetProperty(Actor::Property::SIZE, Vector2(800, 600));
+ application.GetScene().Add(view);
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
view.RegisterCertificateConfirmedCallback(&OnCertificateConfirm);
view.RegisterSslCertificateChangedCallback(&OnSslCertificateChanged);
view.RegisterHttpAuthHandlerCallback(&OnHttpAuthHandler);
- DALI_TEST_EQUALS( gCertificateConfirmCallbackCalled, 0, TEST_LOCATION );
- DALI_TEST_EQUALS( gSslCertificateChangedCallbackCalled, 0, TEST_LOCATION );
- DALI_TEST_EQUALS( gHttpAuthHandlerCallbackCalled, 0, TEST_LOCATION );
+ DALI_TEST_EQUALS(gCertificateConfirmCallbackCalled, 0, TEST_LOCATION);
+ DALI_TEST_EQUALS(gSslCertificateChangedCallbackCalled, 0, TEST_LOCATION);
+ DALI_TEST_EQUALS(gHttpAuthHandlerCallbackCalled, 0, TEST_LOCATION);
- view.LoadUrl( TEST_URL1 );
+ view.LoadUrl(TEST_URL1);
Test::EmitGlobalTimerSignal();
- DALI_TEST_EQUALS( gCertificateConfirmCallbackCalled, 1, TEST_LOCATION );
- DALI_TEST_EQUALS( gSslCertificateChangedCallbackCalled, 1, TEST_LOCATION );
- DALI_TEST_EQUALS( gHttpAuthHandlerCallbackCalled, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(gCertificateConfirmCallbackCalled, 1, TEST_LOCATION);
+ DALI_TEST_EQUALS(gSslCertificateChangedCallbackCalled, 1, TEST_LOCATION);
+ DALI_TEST_EQUALS(gHttpAuthHandlerCallbackCalled, 1, TEST_LOCATION);
// certificate.
DALI_TEST_CHECK(gCertificateConfirmInstance);
// reset
gCertificateConfirmInstance = nullptr;
- gSslCertificateInstance = nullptr;
- gHttpAuthInstance = nullptr;
+ gSslCertificateInstance = nullptr;
+ gHttpAuthInstance = nullptr;
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebBackForwardList* bfList = view.GetBackForwardList();
- DALI_TEST_CHECK( bfList != 0 );
+ DALI_TEST_CHECK(bfList != 0);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebContext* context = view.GetContext();
- DALI_TEST_CHECK( context != 0 );
+ DALI_TEST_CHECK(context != 0);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebCookieManager* cookieManager = view.GetCookieManager();
- DALI_TEST_CHECK( cookieManager != 0 );
+ DALI_TEST_CHECK(cookieManager != 0);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebSettings* settings = view.GetSettings();
- DALI_TEST_CHECK( settings != 0 );
+ DALI_TEST_CHECK(settings != 0);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
std::string local;
- view.SetProperty( WebView::Property::URL, TEST_URL1 );
- Property::Value val = view.GetProperty( WebView::Property::URL );
- DALI_TEST_CHECK( val.Get( local ) );
- DALI_TEST_EQUALS( local, TEST_URL1, TEST_LOCATION );
+ view.SetProperty(WebView::Property::URL, TEST_URL1);
+ Property::Value val = view.GetProperty(WebView::Property::URL);
+ DALI_TEST_CHECK(val.Get(local));
+ DALI_TEST_EQUALS(local, TEST_URL1, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
const std::string kDefaultValue;
const std::string kTestValue = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36";
// Check default value
- std::string output;
- Property::Value value = view.GetProperty( WebView::Property::USER_AGENT );
- DALI_TEST_CHECK( value.Get( output ) );
- DALI_TEST_EQUALS( output, kDefaultValue, TEST_LOCATION );
+ std::string output;
+ Property::Value value = view.GetProperty(WebView::Property::USER_AGENT);
+ DALI_TEST_CHECK(value.Get(output));
+ DALI_TEST_EQUALS(output, kDefaultValue, TEST_LOCATION);
// Check Set/GetProperty
- view.SetProperty( WebView::Property::USER_AGENT, kTestValue );
- value = view.GetProperty( WebView::Property::USER_AGENT );
- DALI_TEST_CHECK( value.Get( output ) );
- DALI_TEST_EQUALS( output, kTestValue, TEST_LOCATION );
+ view.SetProperty(WebView::Property::USER_AGENT, kTestValue);
+ value = view.GetProperty(WebView::Property::USER_AGENT);
+ DALI_TEST_CHECK(value.Get(output));
+ DALI_TEST_EQUALS(output, kTestValue, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
// Check default value
Dali::Vector2 output = Dali::Vector2::ONE;
- view.GetProperty( WebView::Property::SCROLL_POSITION ).Get( output );
- DALI_TEST_CHECK( output.x == 0 && output.y == 0 );
+ view.GetProperty(WebView::Property::SCROLL_POSITION).Get(output);
+ DALI_TEST_CHECK(output.x == 0 && output.y == 0);
// Check Set/GetProperty
- Dali::Vector2 testValue = Dali::Vector2( 100, 100 );
- view.SetProperty( WebView::Property::SCROLL_POSITION, testValue );
- view.GetProperty( WebView::Property::SCROLL_POSITION ).Get( output );
- DALI_TEST_EQUALS( output, testValue, TEST_LOCATION );
+ Dali::Vector2 testValue = Dali::Vector2(100, 100);
+ view.SetProperty(WebView::Property::SCROLL_POSITION, testValue);
+ view.GetProperty(WebView::Property::SCROLL_POSITION).Get(output);
+ DALI_TEST_EQUALS(output, testValue, TEST_LOCATION);
// Check default value of scroll size
output = Dali::Vector2::ONE;
- view.GetProperty( WebView::Property::SCROLL_SIZE ).Get( output );
- DALI_TEST_CHECK( output.x == 500 && output.y == 500 );
+ view.GetProperty(WebView::Property::SCROLL_SIZE).Get(output);
+ DALI_TEST_CHECK(output.x == 500 && output.y == 500);
// Check default value of content size
output = Dali::Vector2::ONE;
- view.GetProperty( WebView::Property::CONTENT_SIZE ).Get( output );
- DALI_TEST_CHECK( output.x == 500 && output.y == 500 );
+ view.GetProperty(WebView::Property::CONTENT_SIZE).Get(output);
+ DALI_TEST_CHECK(output.x == 500 && output.y == 500);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Vector4 testValue = Dali::Vector4(0.0f, 0.0f, 0.0f, 0.0f);
view.SetProperty(WebView::Property::DOCUMENT_BACKGROUND_COLOR, testValue);
{
ToolkitTestApplication application;
- char argv[] = "--test";
- WebView view = WebView::New( 1, (char**)&argv );
- DALI_TEST_CHECK( view );
+ char argv[] = "--test";
+ WebView view = WebView::New(1, (char**)&argv);
+ DALI_TEST_CHECK(view);
// reset something
view.ClearAllTilesResources();
// Check default value of title
std::string testValue("title");
std::string output;
- view.GetProperty( WebView::Property::TITLE ).Get( output );
- DALI_TEST_EQUALS( output, testValue, TEST_LOCATION );
+ view.GetProperty(WebView::Property::TITLE).Get(output);
+ DALI_TEST_EQUALS(output, testValue, TEST_LOCATION);
// Check the case that favicon is not null.
Dali::Toolkit::ImageView favicon = view.GetFavicon();
- DALI_TEST_CHECK( favicon );
- Dali::Vector3 iconsize = favicon.GetProperty< Vector3 >( Dali::Actor::Property::SIZE );
- DALI_TEST_CHECK( ( int )iconsize.width == 2 && ( int )iconsize.height == 2 );
+ DALI_TEST_CHECK(favicon);
+ Dali::Vector3 iconsize = favicon.GetProperty<Vector3>(Dali::Actor::Property::SIZE);
+ DALI_TEST_CHECK((int)iconsize.width == 2 && (int)iconsize.height == 2);
// Check the case that favicon is null.
favicon = view.GetFavicon();
- DALI_TEST_CHECK( !favicon );
+ DALI_TEST_CHECK(!favicon);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
// load url.
- view.RegisterContextMenuShownCallback( &OnContextMenuShown );
- view.RegisterContextMenuHiddenCallback( &OnContextMenuHidden );
- DALI_TEST_EQUALS( gContextMenuShownCallbackCalled, 0, TEST_LOCATION );
- DALI_TEST_EQUALS( gContextMenuHiddenCallbackCalled, 0, TEST_LOCATION );
+ view.RegisterContextMenuShownCallback(&OnContextMenuShown);
+ view.RegisterContextMenuHiddenCallback(&OnContextMenuHidden);
+ DALI_TEST_EQUALS(gContextMenuShownCallbackCalled, 0, TEST_LOCATION);
+ DALI_TEST_EQUALS(gContextMenuHiddenCallbackCalled, 0, TEST_LOCATION);
DALI_TEST_CHECK(gContextMenuShownInstance == 0);
DALI_TEST_CHECK(gContextMenuHiddenInstance == 0);
- view.LoadUrl( TEST_URL1 );
+ view.LoadUrl(TEST_URL1);
Test::EmitGlobalTimerSignal();
- DALI_TEST_EQUALS( gContextMenuShownCallbackCalled, 1, TEST_LOCATION );
- DALI_TEST_EQUALS( gContextMenuHiddenCallbackCalled, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(gContextMenuShownCallbackCalled, 1, TEST_LOCATION);
+ DALI_TEST_EQUALS(gContextMenuHiddenCallbackCalled, 1, TEST_LOCATION);
// check context meun & its items.
DALI_TEST_CHECK(gContextMenuShownInstance != 0);
DALI_TEST_CHECK(gContextMenuHiddenInstance != 0);
- gContextMenuShownInstance = nullptr;
+ gContextMenuShownInstance = nullptr;
gContextMenuHiddenInstance = nullptr;
END_TEST;
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
// load url.
- view.RegisterScrollEdgeReachedCallback( &OnScrollEdgeReached );
- DALI_TEST_EQUALS( gScrollEdgeReachedCallbackCalled, 0, TEST_LOCATION );
+ view.RegisterScrollEdgeReachedCallback(&OnScrollEdgeReached);
+ DALI_TEST_EQUALS(gScrollEdgeReachedCallbackCalled, 0, TEST_LOCATION);
- view.LoadUrl( TEST_URL1 );
+ view.LoadUrl(TEST_URL1);
Test::EmitGlobalTimerSignal();
// set scroll position.
- Dali::Vector2 output = Dali::Vector2::ONE;
- Dali::Vector2 testValue = Dali::Vector2( 100, 100 );
- view.SetProperty( WebView::Property::SCROLL_POSITION, testValue );
- view.GetProperty( WebView::Property::SCROLL_POSITION ).Get( output );
- DALI_TEST_EQUALS( output, testValue, TEST_LOCATION );
+ Dali::Vector2 output = Dali::Vector2::ONE;
+ Dali::Vector2 testValue = Dali::Vector2(100, 100);
+ view.SetProperty(WebView::Property::SCROLL_POSITION, testValue);
+ view.GetProperty(WebView::Property::SCROLL_POSITION).Get(output);
+ DALI_TEST_EQUALS(output, testValue, TEST_LOCATION);
// scroll by and trigger scrollEdgeReached event.
- view.ScrollBy( 50, 50 );
+ view.ScrollBy(50, 50);
Test::EmitGlobalTimerSignal();
- view.GetProperty( WebView::Property::SCROLL_POSITION ).Get( output );
- DALI_TEST_CHECK( output.x == 150 && output.y == 150 );
- DALI_TEST_EQUALS( gScrollEdgeReachedCallbackCalled, 1, TEST_LOCATION );
+ view.GetProperty(WebView::Property::SCROLL_POSITION).Get(output);
+ DALI_TEST_CHECK(output.x == 150 && output.y == 150);
+ DALI_TEST_EQUALS(gScrollEdgeReachedCallbackCalled, 1, TEST_LOCATION);
// scroll by and trigger scrollEdgeReached event.
- bool result = view.ScrollEdgeBy( 50, 50 );
- DALI_TEST_CHECK( result );
+ bool result = view.ScrollEdgeBy(50, 50);
+ DALI_TEST_CHECK(result);
Test::EmitGlobalTimerSignal();
- view.GetProperty( WebView::Property::SCROLL_POSITION ).Get( output );
- DALI_TEST_CHECK( output.x == 200 && output.y == 200 );
- DALI_TEST_EQUALS( gScrollEdgeReachedCallbackCalled, 2, TEST_LOCATION );
+ view.GetProperty(WebView::Property::SCROLL_POSITION).Get(output);
+ DALI_TEST_CHECK(output.x == 200 && output.y == 200);
+ DALI_TEST_EQUALS(gScrollEdgeReachedCallbackCalled, 2, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- view.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- view.SetProperty( Actor::Property::POSITION, Vector2( 0, 0 ));
- view.SetProperty( Actor::Property::SIZE, Vector2( 800, 600 ) );
+ view.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ view.SetProperty(Actor::Property::POSITION, Vector2(0, 0));
+ view.SetProperty(Actor::Property::SIZE, Vector2(800, 600));
- application.GetScene().Add( view );
+ application.GetScene().Add(view);
application.SendNotification();
application.Render();
view.ActivateAccessibility(true);
view.AddDynamicCertificatePath("host", "test/to/path");
bool found = view.HighlightText("test", Dali::WebEnginePlugin::FindOption::CASE_INSENSITIVE, 2);
- DALI_TEST_CHECK( found );
+ DALI_TEST_CHECK(found);
view.SetScaleFactor(1.5f, Dali::Vector2(0.0f, 0.0f));
float result = view.GetScaleFactor();
- DALI_TEST_EQUALS( result, 1.5f, TEST_LOCATION );
+ DALI_TEST_EQUALS(result, 1.5f, TEST_LOCATION);
view.SetScaleFactor(1.0f, Dali::Vector2(0.0f, 0.0f));
result = view.GetScaleFactor();
- DALI_TEST_EQUALS( result, 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(result, 1.0f, TEST_LOCATION);
END_TEST;
}
// SCROLL_POSITION
ToolkitTestApplication application;
- char argv[] = "--test";
- WebView view = WebView::New( 1, (char**)&argv );
- DALI_TEST_CHECK( view );
+ char argv[] = "--test";
+ WebView view = WebView::New(1, (char**)&argv);
+ DALI_TEST_CHECK(view);
// Check GetScreenshot
Dali::Rect<int> viewArea;
- viewArea.x = 100;
- viewArea.y = 100;
- viewArea.width = 10;
- viewArea.height = 10;
+ viewArea.x = 100;
+ viewArea.y = 100;
+ viewArea.width = 10;
+ viewArea.height = 10;
Dali::Toolkit::ImageView screenshot = view.GetScreenshot(viewArea, 1.0f);
- DALI_TEST_CHECK( screenshot );
- Dali::Vector3 shotsize = screenshot.GetProperty< Vector3 >( Dali::Actor::Property::SIZE );
- DALI_TEST_CHECK( ( int )shotsize.width == viewArea.width && ( int )shotsize.height == viewArea.height );
+ DALI_TEST_CHECK(screenshot);
+ Dali::Vector3 shotsize = screenshot.GetProperty<Vector3>(Dali::Actor::Property::SIZE);
+ DALI_TEST_CHECK((int)shotsize.width == viewArea.width && (int)shotsize.height == viewArea.height);
// Check GetScreenshotAsynchronously
- viewArea.x = 100;
- viewArea.y = 100;
- viewArea.width = 100;
+ viewArea.x = 100;
+ viewArea.y = 100;
+ viewArea.width = 100;
viewArea.height = 100;
- bool result = view.GetScreenshotAsynchronously(viewArea, 1.0f, &OnScreenshotCaptured);
- DALI_TEST_CHECK( result );
+ bool result = view.GetScreenshotAsynchronously(viewArea, 1.0f, &OnScreenshotCaptured);
+ DALI_TEST_CHECK(result);
Test::EmitGlobalTimerSignal();
Test::EmitGlobalTimerSignal();
- DALI_TEST_EQUALS( gScreenshotCapturedCallbackCalled, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(gScreenshotCapturedCallbackCalled, 1, TEST_LOCATION);
END_TEST;
}
// SCROLL_POSITION
ToolkitTestApplication application;
- char argv[] = "--test";
- WebView view = WebView::New( 1, (char**)&argv );
- DALI_TEST_CHECK( view );
+ char argv[] = "--test";
+ WebView view = WebView::New(1, (char**)&argv);
+ DALI_TEST_CHECK(view);
// Check CheckVideoPlayingAsynchronously
bool result = view.CheckVideoPlayingAsynchronously(&OnVideoPlaying);
- DALI_TEST_CHECK( result );
+ DALI_TEST_CHECK(result);
Test::EmitGlobalTimerSignal();
- DALI_TEST_EQUALS( gVideoPlayingCallbackCalled, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(gVideoPlayingCallbackCalled, 1, TEST_LOCATION);
// Check RegisterGeolocationPermissionCallback
view.RegisterGeolocationPermissionCallback(&OnGeolocationPermission);
Test::EmitGlobalTimerSignal();
- DALI_TEST_EQUALS( gGeolocationPermissionCallbackCalled, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(gGeolocationPermissionCallbackCalled, 1, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
// load url.
- view.RegisterResponsePolicyDecidedCallback( &OnResponsePolicyDecided );
- DALI_TEST_EQUALS( gResponsePolicyDecidedCallbackCalled, 0, TEST_LOCATION );
+ view.RegisterResponsePolicyDecidedCallback(&OnResponsePolicyDecided);
+ DALI_TEST_EQUALS(gResponsePolicyDecidedCallbackCalled, 0, TEST_LOCATION);
DALI_TEST_CHECK(gResponsePolicyDecisionInstance == 0);
- view.LoadUrl( TEST_URL1 );
+ view.LoadUrl(TEST_URL1);
Test::EmitGlobalTimerSignal();
- DALI_TEST_EQUALS( gResponsePolicyDecidedCallbackCalled, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(gResponsePolicyDecidedCallbackCalled, 1, TEST_LOCATION);
// check response policy decision & its frame.
DALI_TEST_CHECK(gResponsePolicyDecisionInstance != 0);
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
// load url.
- view.LoadUrl( TEST_URL1 );
+ view.LoadUrl(TEST_URL1);
// sync hit test.
std::unique_ptr<Dali::WebEngineHitTest> hitTest = view.CreateHitTest(100, 100, Dali::WebEngineHitTest::HitTestMode::DEFAULT);
bool result = view.CreateHitTestAsynchronously(100, 100, Dali::WebEngineHitTest::HitTestMode::DEFAULT, &OnHitTestCreated);
DALI_TEST_CHECK(result);
Test::EmitGlobalTimerSignal();
- DALI_TEST_EQUALS( gHitTestCreatedCallbackCalled, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(gHitTestCreatedCallbackCalled, 1, TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- WebView view = WebView::New( "ko-KR", "Asia/Seoul" );
+ WebView view = WebView::New("ko-KR", "Asia/Seoul");
- view.LoadHtmlString( "<body>Hello World!</body>" );
- view.EvaluateJavaScript( "jsObject.postMessage('Hello')" );
- view.EvaluateJavaScript( "jsObject.postMessage('World')", OnEvaluateJavaScript );
+ view.LoadHtmlString("<body>Hello World!</body>");
+ view.EvaluateJavaScript("jsObject.postMessage('Hello')");
+ view.EvaluateJavaScript("jsObject.postMessage('World')", OnEvaluateJavaScript);
Test::EmitGlobalTimerSignal();
- DALI_TEST_EQUALS( gEvaluateJavaScriptCallbackCalled, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(gEvaluateJavaScriptCallbackCalled, 1, TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- WebView view = WebView::New( "ko-KR", "Asia/Seoul" );
+ WebView view = WebView::New("ko-KR", "Asia/Seoul");
- view.RegisterJavaScriptAlertCallback( &OnJavaScriptAlert );
- view.LoadHtmlString( "<head><script type='text/javascript'>alert('this is an alert popup.');</script></head><body>Hello World!</body>" );
+ view.RegisterJavaScriptAlertCallback(&OnJavaScriptAlert);
+ view.LoadHtmlString("<head><script type='text/javascript'>alert('this is an alert popup.');</script></head><body>Hello World!</body>");
view.JavaScriptAlertReply();
Test::EmitGlobalTimerSignal();
- DALI_TEST_EQUALS( gJavaScriptAlertCallbackCalled, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(gJavaScriptAlertCallbackCalled, 1, TEST_LOCATION);
- view.RegisterJavaScriptConfirmCallback( &OnJavaScriptConfirm );
- view.LoadHtmlString( "<head><script type='text/javascript'>confirm('this is a confirm popup.');</script></head><body>Hello World!</body>" );
- view.JavaScriptConfirmReply( true );
+ view.RegisterJavaScriptConfirmCallback(&OnJavaScriptConfirm);
+ view.LoadHtmlString("<head><script type='text/javascript'>confirm('this is a confirm popup.');</script></head><body>Hello World!</body>");
+ view.JavaScriptConfirmReply(true);
Test::EmitGlobalTimerSignal();
- DALI_TEST_EQUALS( gJavaScriptConfirmCallbackCalled, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(gJavaScriptConfirmCallbackCalled, 1, TEST_LOCATION);
- view.RegisterJavaScriptPromptCallback( &OnJavaScriptPrompt );
- view.LoadHtmlString( "<head><script type='text/javascript'>prompt('this is a prompt popup.');</script></head><body>Hello World!</body>" );
- view.JavaScriptPromptReply( "it is a prompt." );
+ view.RegisterJavaScriptPromptCallback(&OnJavaScriptPrompt);
+ view.LoadHtmlString("<head><script type='text/javascript'>prompt('this is a prompt popup.');</script></head><body>Hello World!</body>");
+ view.JavaScriptPromptReply("it is a prompt.");
Test::EmitGlobalTimerSignal();
- DALI_TEST_EQUALS( gJavaScriptPromptCallbackCalled, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(gJavaScriptPromptCallbackCalled, 1, TEST_LOCATION);
END_TEST;
}
{
ToolkitTestApplication application;
- WebView view = WebView::New( "ko-KR", "Asia/Seoul" );
- DALI_TEST_CHECK( view );
+ WebView view = WebView::New("ko-KR", "Asia/Seoul");
+ DALI_TEST_CHECK(view);
std::string html("<body>Hello World!</body>");
std::string basicUri("http://basicurl");
std::string unreachableUrl("http://unreachableurl");
- bool result = view.LoadHtmlStringOverrideCurrentEntry( html, basicUri, unreachableUrl );
- DALI_TEST_CHECK( result );
+ bool result = view.LoadHtmlStringOverrideCurrentEntry(html, basicUri, unreachableUrl);
+ DALI_TEST_CHECK(result);
application.SendNotification();
application.Render();
Test::EmitGlobalTimerSignal();
- result = view.LoadContents( html, html.length(), "html/text", "utf-8", basicUri );
- DALI_TEST_CHECK( result );
+ result = view.LoadContents(html, html.length(), "html/text", "utf-8", basicUri);
+ DALI_TEST_CHECK(result);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- view.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
- view.SetProperty( Actor::Property::POSITION, Vector2( 0, 0 ));
- view.SetProperty( Actor::Property::SIZE, Vector2( 800, 600 ) );
+ view.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ view.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ view.SetProperty(Actor::Property::POSITION, Vector2(0, 0));
+ view.SetProperty(Actor::Property::SIZE, Vector2(800, 600));
- application.GetScene().Add( view );
+ application.GetScene().Add(view);
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
- view.LoadUrl( "http://test.html" );
+ view.LoadUrl("http://test.html");
bool result = view.AddCustomHeader("key", "value");
- DALI_TEST_CHECK( result );
+ DALI_TEST_CHECK(result);
result = view.ReloadWithoutCache();
- DALI_TEST_CHECK( result );
+ DALI_TEST_CHECK(result);
uint32_t portNumber = view.StartInspectorServer(5000);
- DALI_TEST_EQUALS( portNumber, 5000, TEST_LOCATION );
+ DALI_TEST_EQUALS(portNumber, 5000, TEST_LOCATION);
application.SendNotification();
application.Render();
Test::EmitGlobalTimerSignal();
result = view.StopInspectorServer();
- DALI_TEST_CHECK( result );
+ DALI_TEST_CHECK(result);
view.SuspendNetworkLoading();
result = view.RemoveCustomHeader("key");
- DALI_TEST_CHECK( result );
+ DALI_TEST_CHECK(result);
view.ResumeNetworkLoading();
{
ToolkitTestApplication application;
- WebView view = WebView::New( "ko-KR", "Asia/Seoul" );
+ WebView view = WebView::New("ko-KR", "Asia/Seoul");
- view.LoadHtmlString( "<body>Hello World!</body>" );
- view.AddJavaScriptMessageHandler( "jsObject",
- []( const std::string& arg ) {
- }
- );
+ view.LoadHtmlString("<body>Hello World!</body>");
+ view.AddJavaScriptMessageHandler("jsObject",
+ [](const std::string& arg) {
+ });
view.SetTtsFocus(true);
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebBackForwardList* bfList = view.GetBackForwardList();
- DALI_TEST_CHECK( bfList != 0 )
+ DALI_TEST_CHECK(bfList != 0)
unsigned int itemCount = bfList->GetItemCount();
- DALI_TEST_CHECK( itemCount == 1 )
+ DALI_TEST_CHECK(itemCount == 1)
std::unique_ptr<Dali::WebEngineBackForwardListItem> citem = bfList->GetCurrentItem();
- DALI_TEST_CHECK( citem != 0 );
+ DALI_TEST_CHECK(citem != 0);
std::unique_ptr<Dali::WebEngineBackForwardListItem> citemP = bfList->GetPreviousItem();
- DALI_TEST_CHECK( citemP != 0 );
+ DALI_TEST_CHECK(citemP != 0);
std::unique_ptr<Dali::WebEngineBackForwardListItem> citemN = bfList->GetNextItem();
- DALI_TEST_CHECK( citemN != 0 );
+ DALI_TEST_CHECK(citemN != 0);
- const std::string kDefaultUrl( "http://url" );
- std::string testValue = citem->GetUrl();
- DALI_TEST_EQUALS( testValue, kDefaultUrl, TEST_LOCATION );
+ const std::string kDefaultUrl("http://url");
+ std::string testValue = citem->GetUrl();
+ DALI_TEST_EQUALS(testValue, kDefaultUrl, TEST_LOCATION);
- const std::string kDefaultTitle( "title" );
+ const std::string kDefaultTitle("title");
testValue = citem->GetTitle();
- DALI_TEST_EQUALS( testValue, kDefaultTitle, TEST_LOCATION );
+ DALI_TEST_EQUALS(testValue, kDefaultTitle, TEST_LOCATION);
- const std::string kDefaultOriginalUrl( "http://originalurl" );
+ const std::string kDefaultOriginalUrl("http://originalurl");
testValue = citem->GetOriginalUrl();
- DALI_TEST_EQUALS( testValue, kDefaultOriginalUrl, TEST_LOCATION );
+ DALI_TEST_EQUALS(testValue, kDefaultOriginalUrl, TEST_LOCATION);
- std::unique_ptr<Dali::WebEngineBackForwardListItem> item = bfList->GetItemAtIndex( 0 );
- DALI_TEST_CHECK( item != 0 );
+ std::unique_ptr<Dali::WebEngineBackForwardListItem> item = bfList->GetItemAtIndex(0);
+ DALI_TEST_CHECK(item != 0);
std::vector<std::unique_ptr<Dali::WebEngineBackForwardListItem>> vecBack = bfList->GetBackwardItems(-1);
- DALI_TEST_CHECK( vecBack.size() == 1 );
+ DALI_TEST_CHECK(vecBack.size() == 1);
std::vector<std::unique_ptr<Dali::WebEngineBackForwardListItem>> vecForward = bfList->GetForwardItems(-1);
- DALI_TEST_CHECK( vecForward.size() == 1 );
+ DALI_TEST_CHECK(vecForward.size() == 1);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebContext* context = view.GetContext();
- DALI_TEST_CHECK( context != 0 )
+ DALI_TEST_CHECK(context != 0)
std::string kDefaultValue;
// Reset something
- context->SetAppId( "id" );
- context->SetApplicationType( Dali::WebEngineContext::ApplicationType::OTHER );
- context->SetTimeOffset( 0 );
- context->SetTimeZoneOffset( 0, 0 );
- context->SetDefaultProxyAuth( kDefaultValue, kDefaultValue );
+ context->SetAppId("id");
+ context->SetApplicationType(Dali::WebEngineContext::ApplicationType::OTHER);
+ context->SetTimeOffset(0);
+ context->SetTimeZoneOffset(0, 0);
+ context->SetDefaultProxyAuth(kDefaultValue, kDefaultValue);
context->DeleteAllWebDatabase();
context->DeleteAllWebStorage();
context->DeleteLocalFileSystem();
// Check default value
Dali::WebEngineContext::CacheModel value = context->GetCacheModel();
- DALI_TEST_CHECK( value == Dali::WebEngineContext::CacheModel::DOCUMENT_VIEWER );
+ DALI_TEST_CHECK(value == Dali::WebEngineContext::CacheModel::DOCUMENT_VIEWER);
// Check Set/GetProperty
- context->SetCacheModel( Dali::WebEngineContext::CacheModel::DOCUMENT_BROWSER );
+ context->SetCacheModel(Dali::WebEngineContext::CacheModel::DOCUMENT_BROWSER);
value = context->GetCacheModel();
- DALI_TEST_CHECK( value == Dali::WebEngineContext::CacheModel::DOCUMENT_BROWSER );
+ DALI_TEST_CHECK(value == Dali::WebEngineContext::CacheModel::DOCUMENT_BROWSER);
// Get cache enabled
- context->EnableCache( true );
- DALI_TEST_CHECK( context->IsCacheEnabled() );
+ context->EnableCache(true);
+ DALI_TEST_CHECK(context->IsCacheEnabled());
// Get certificate
- context->SetCertificateFilePath( "test" );
+ context->SetCertificateFilePath("test");
std::string str = context->GetCertificateFilePath();
- DALI_TEST_EQUALS( str, "test", TEST_LOCATION );
+ DALI_TEST_EQUALS(str, "test", TEST_LOCATION);
// Set version
- DALI_TEST_CHECK( context->SetAppVersion( "test" ) );
+ DALI_TEST_CHECK(context->SetAppVersion("test"));
// Register
std::vector<std::string> temp;
- context->RegisterUrlSchemesAsCorsEnabled( temp );
- context->RegisterJsPluginMimeTypes( temp );
- context->DeleteFormPasswordDataList( temp );
+ context->RegisterUrlSchemesAsCorsEnabled(temp);
+ context->RegisterJsPluginMimeTypes(temp);
+ context->DeleteFormPasswordDataList(temp);
// Get zoom factor
- context->SetDefaultZoomFactor( 1.0f );
- DALI_TEST_EQUALS( context->GetDefaultZoomFactor(), float( 1.0f ), TEST_LOCATION );
+ context->SetDefaultZoomFactor(1.0f);
+ DALI_TEST_EQUALS(context->GetDefaultZoomFactor(), float(1.0f), TEST_LOCATION);
// Delete cache and database
- DALI_TEST_CHECK( context->DeleteAllApplicationCache() );
- DALI_TEST_CHECK( context->DeleteAllWebIndexedDatabase() );
+ DALI_TEST_CHECK(context->DeleteAllApplicationCache());
+ DALI_TEST_CHECK(context->DeleteAllWebIndexedDatabase());
// Get contextProxy
- context->SetProxyUri( "test" );
- DALI_TEST_EQUALS( context->GetProxyUri(), "test", TEST_LOCATION );
+ context->SetProxyUri("test");
+ DALI_TEST_EQUALS(context->GetProxyUri(), "test", TEST_LOCATION);
context->SetProxyBypassRule("", "test");
- DALI_TEST_EQUALS( context->GetProxyBypassRule(), "test", TEST_LOCATION );
+ DALI_TEST_EQUALS(context->GetProxyBypassRule(), "test", TEST_LOCATION);
//Notify low memory
- DALI_TEST_CHECK( context->FreeUnusedMemory() );
+ DALI_TEST_CHECK(context->FreeUnusedMemory());
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebContext* context = view.GetContext();
- DALI_TEST_CHECK( context != 0 )
+ DALI_TEST_CHECK(context != 0)
std::string kDefaultValue;
// get origins of web database
bool result = context->GetWebDatabaseOrigins(&OnSecurityOriginsAcquired);
- DALI_TEST_CHECK( result );
+ DALI_TEST_CHECK(result);
Test::EmitGlobalTimerSignal();
- DALI_TEST_EQUALS( gSecurityOriginsAcquiredCallbackCalled, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(gSecurityOriginsAcquiredCallbackCalled, 1, TEST_LOCATION);
DALI_TEST_CHECK(gSecurityOriginList.size() == 1);
Dali::WebEngineSecurityOrigin* origin = gSecurityOriginList[0].get();
- DALI_TEST_CHECK( origin );
+ DALI_TEST_CHECK(origin);
result = context->DeleteWebDatabase(*origin);
- DALI_TEST_CHECK( result );
+ DALI_TEST_CHECK(result);
// get origins of web storage
result = context->GetWebStorageOrigins(&OnSecurityOriginsAcquired);
- DALI_TEST_CHECK( result );
+ DALI_TEST_CHECK(result);
Test::EmitGlobalTimerSignal();
- DALI_TEST_EQUALS( gSecurityOriginsAcquiredCallbackCalled, 2, TEST_LOCATION );
+ DALI_TEST_EQUALS(gSecurityOriginsAcquiredCallbackCalled, 2, TEST_LOCATION);
DALI_TEST_CHECK(gSecurityOriginList.size() == 1);
origin = gSecurityOriginList[0].get();
- DALI_TEST_CHECK( origin );
+ DALI_TEST_CHECK(origin);
result = context->GetWebStorageUsageForOrigin(*origin, &OnStorageUsageAcquired);
- DALI_TEST_CHECK( result );
+ DALI_TEST_CHECK(result);
Test::EmitGlobalTimerSignal();
- DALI_TEST_EQUALS( gStorageUsageAcquiredCallbackCalled, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(gStorageUsageAcquiredCallbackCalled, 1, TEST_LOCATION);
result = context->DeleteWebStorage(*origin);
- DALI_TEST_CHECK( result );
+ DALI_TEST_CHECK(result);
result = context->DeleteApplicationCache(*origin);
- DALI_TEST_CHECK( result );
+ DALI_TEST_CHECK(result);
// form passwords, download state, mime type.
context->GetFormPasswordList(&OnFormPasswordsAcquired);
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebContext* context = view.GetContext();
- DALI_TEST_CHECK( context != 0 )
+ DALI_TEST_CHECK(context != 0)
// load url.
context->RegisterRequestInterceptedCallback(&OnRequestIntercepted);
DALI_TEST_CHECK(!gRequestInterceptorInstance);
Test::EmitGlobalTimerSignal();
- DALI_TEST_EQUALS( gRequestInterceptedCallbackCalled, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(gRequestInterceptedCallbackCalled, 1, TEST_LOCATION);
// check request interceptor.
DALI_TEST_CHECK(gRequestInterceptorInstance);
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebCookieManager* cookieManager = view.GetCookieManager();
- DALI_TEST_CHECK( cookieManager != 0 )
+ DALI_TEST_CHECK(cookieManager != 0)
const std::string kDefaultValue;
// Reset something
- cookieManager->SetPersistentStorage( kDefaultValue, Dali::WebEngineCookieManager::CookiePersistentStorage::SQLITE );
+ cookieManager->SetPersistentStorage(kDefaultValue, Dali::WebEngineCookieManager::CookiePersistentStorage::SQLITE);
cookieManager->ClearCookies();
// Check default value
Dali::WebEngineCookieManager::CookieAcceptPolicy value = cookieManager->GetCookieAcceptPolicy();
- DALI_TEST_CHECK( value == Dali::WebEngineCookieManager::CookieAcceptPolicy::NO_THIRD_PARTY );
+ DALI_TEST_CHECK(value == Dali::WebEngineCookieManager::CookieAcceptPolicy::NO_THIRD_PARTY);
// Check Set/GetProperty
- cookieManager->SetCookieAcceptPolicy( Dali::WebEngineCookieManager::CookieAcceptPolicy::ALWAYS );
+ cookieManager->SetCookieAcceptPolicy(Dali::WebEngineCookieManager::CookieAcceptPolicy::ALWAYS);
value = cookieManager->GetCookieAcceptPolicy();
- DALI_TEST_CHECK( value == Dali::WebEngineCookieManager::CookieAcceptPolicy::ALWAYS );
+ DALI_TEST_CHECK(value == Dali::WebEngineCookieManager::CookieAcceptPolicy::ALWAYS);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebCookieManager* cookieManager = view.GetCookieManager();
- DALI_TEST_CHECK( cookieManager != 0 )
+ DALI_TEST_CHECK(cookieManager != 0)
cookieManager->ChangesWatch(&OnChangesWatch);
Test::EmitGlobalTimerSignal();
- DALI_TEST_EQUALS( gCookieManagerChangsWatchCallbackCalled, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS(gCookieManagerChangsWatchCallbackCalled, 1, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebSettings* settings = view.GetSettings();
- DALI_TEST_CHECK( settings != 0 )
+ DALI_TEST_CHECK(settings != 0)
// Reset something
- settings->AllowMixedContents( false );
- settings->EnableSpatialNavigation( false );
- settings->EnableWebSecurity( false );
- settings->EnableCacheBuilder( false );
- settings->EnableDoNotTrack( false );
- settings->UseScrollbarThumbFocusNotifications( false );
- settings->AllowFileAccessFromExternalUrl( false );
- settings->AllowScriptsOpenWindows( false );
+ settings->AllowMixedContents(false);
+ settings->EnableSpatialNavigation(false);
+ settings->EnableWebSecurity(false);
+ settings->EnableCacheBuilder(false);
+ settings->EnableDoNotTrack(false);
+ settings->UseScrollbarThumbFocusNotifications(false);
+ settings->AllowFileAccessFromExternalUrl(false);
+ settings->AllowScriptsOpenWindows(false);
// Check default value
int value = settings->GetDefaultFontSize();
- DALI_TEST_CHECK( value == 16 );
+ DALI_TEST_CHECK(value == 16);
// Check Set/GetProperty
- settings->SetDefaultFontSize( 20 );
+ settings->SetDefaultFontSize(20);
value = settings->GetDefaultFontSize();
- DALI_TEST_CHECK( value == 20 );
+ DALI_TEST_CHECK(value == 20);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebSettings* settings = view.GetSettings();
- DALI_TEST_CHECK( settings != 0 )
+ DALI_TEST_CHECK(settings != 0)
// Reset something
- settings->AllowMixedContents( false );
- settings->EnableSpatialNavigation( false );
- settings->EnableWebSecurity( false );
- settings->EnableCacheBuilder( false );
- settings->EnableDoNotTrack( false );
- settings->UseScrollbarThumbFocusNotifications( false );
- settings->AllowFileAccessFromExternalUrl( false );
- settings->AllowScriptsOpenWindows( false );
+ settings->AllowMixedContents(false);
+ settings->EnableSpatialNavigation(false);
+ settings->EnableWebSecurity(false);
+ settings->EnableCacheBuilder(false);
+ settings->EnableDoNotTrack(false);
+ settings->UseScrollbarThumbFocusNotifications(false);
+ settings->AllowFileAccessFromExternalUrl(false);
+ settings->AllowScriptsOpenWindows(false);
// Check default value is true or not
bool value = settings->IsJavaScriptEnabled();
- DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK(value);
// Check Set/GetProperty
- settings->EnableJavaScript( false );
+ settings->EnableJavaScript(false);
value = settings->IsJavaScriptEnabled();
- DALI_TEST_CHECK( !value );
+ DALI_TEST_CHECK(!value);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebSettings* settings = view.GetSettings();
- DALI_TEST_CHECK( settings != 0 )
+ DALI_TEST_CHECK(settings != 0)
// Reset something
- settings->AllowMixedContents( false );
- settings->EnableSpatialNavigation( false );
- settings->EnableWebSecurity( false );
- settings->EnableCacheBuilder( false );
- settings->EnableDoNotTrack( false );
- settings->UseScrollbarThumbFocusNotifications( false );
- settings->AllowFileAccessFromExternalUrl( false );
- settings->AllowScriptsOpenWindows( false );
+ settings->AllowMixedContents(false);
+ settings->EnableSpatialNavigation(false);
+ settings->EnableWebSecurity(false);
+ settings->EnableCacheBuilder(false);
+ settings->EnableDoNotTrack(false);
+ settings->UseScrollbarThumbFocusNotifications(false);
+ settings->AllowFileAccessFromExternalUrl(false);
+ settings->AllowScriptsOpenWindows(false);
// Check default value is true or not
bool value = settings->IsAutoFittingEnabled();
- DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK(value);
// Check Set/GetProperty
- settings->EnableAutoFitting( false );
+ settings->EnableAutoFitting(false);
value = settings->IsAutoFittingEnabled();
- DALI_TEST_CHECK( !value );
+ DALI_TEST_CHECK(!value);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebSettings* settings = view.GetSettings();
- DALI_TEST_CHECK( settings != 0 )
+ DALI_TEST_CHECK(settings != 0)
// Reset something
- settings->AllowMixedContents( false );
- settings->EnableSpatialNavigation( false );
- settings->EnableWebSecurity( false );
- settings->EnableCacheBuilder( false );
- settings->EnableDoNotTrack( false );
- settings->UseScrollbarThumbFocusNotifications( false );
- settings->AllowFileAccessFromExternalUrl( false );
- settings->AllowScriptsOpenWindows( false );
+ settings->AllowMixedContents(false);
+ settings->EnableSpatialNavigation(false);
+ settings->EnableWebSecurity(false);
+ settings->EnableCacheBuilder(false);
+ settings->EnableDoNotTrack(false);
+ settings->UseScrollbarThumbFocusNotifications(false);
+ settings->AllowFileAccessFromExternalUrl(false);
+ settings->AllowScriptsOpenWindows(false);
// Check default value is true or not
bool value = settings->ArePluginsEnabled();
- DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK(value);
// Check Set/GetProperty
- settings->EnablePlugins( false );
+ settings->EnablePlugins(false);
value = settings->ArePluginsEnabled();
- DALI_TEST_CHECK( !value );
+ DALI_TEST_CHECK(!value);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebSettings* settings = view.GetSettings();
- DALI_TEST_CHECK( settings != 0 )
+ DALI_TEST_CHECK(settings != 0)
// Reset something
- settings->AllowMixedContents( false );
- settings->EnableSpatialNavigation( false );
- settings->EnableWebSecurity( false );
- settings->EnableCacheBuilder( false );
- settings->EnableDoNotTrack( false );
- settings->UseScrollbarThumbFocusNotifications( false );
- settings->AllowFileAccessFromExternalUrl( false );
- settings->AllowScriptsOpenWindows( false );
+ settings->AllowMixedContents(false);
+ settings->EnableSpatialNavigation(false);
+ settings->EnableWebSecurity(false);
+ settings->EnableCacheBuilder(false);
+ settings->EnableDoNotTrack(false);
+ settings->UseScrollbarThumbFocusNotifications(false);
+ settings->AllowFileAccessFromExternalUrl(false);
+ settings->AllowScriptsOpenWindows(false);
// Check default value is true or not
bool value = settings->IsPrivateBrowsingEnabled();
- DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK(value);
// Check Set/GetProperty
- settings->EnablePrivateBrowsing( false );
+ settings->EnablePrivateBrowsing(false);
value = settings->IsPrivateBrowsingEnabled();
- DALI_TEST_CHECK( !value );
+ DALI_TEST_CHECK(!value);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebSettings* settings = view.GetSettings();
- DALI_TEST_CHECK( settings != 0 )
+ DALI_TEST_CHECK(settings != 0)
// Reset something
- settings->AllowMixedContents( false );
- settings->EnableSpatialNavigation( false );
- settings->EnableWebSecurity( false );
- settings->EnableCacheBuilder( false );
- settings->EnableDoNotTrack( false );
- settings->UseScrollbarThumbFocusNotifications( false );
- settings->AllowFileAccessFromExternalUrl( false );
- settings->AllowScriptsOpenWindows( false );
+ settings->AllowMixedContents(false);
+ settings->EnableSpatialNavigation(false);
+ settings->EnableWebSecurity(false);
+ settings->EnableCacheBuilder(false);
+ settings->EnableDoNotTrack(false);
+ settings->UseScrollbarThumbFocusNotifications(false);
+ settings->AllowFileAccessFromExternalUrl(false);
+ settings->AllowScriptsOpenWindows(false);
// Check default value is true or not
bool value = settings->IsLinkMagnifierEnabled();
- DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK(value);
// Check Set/GetProperty
- settings->EnableLinkMagnifier( false );
+ settings->EnableLinkMagnifier(false);
value = settings->IsLinkMagnifierEnabled();
- DALI_TEST_CHECK( !value );
+ DALI_TEST_CHECK(!value);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebSettings* settings = view.GetSettings();
- DALI_TEST_CHECK( settings != 0 )
+ DALI_TEST_CHECK(settings != 0)
// Reset something
- settings->AllowMixedContents( false );
- settings->EnableSpatialNavigation( false );
- settings->EnableWebSecurity( false );
- settings->EnableCacheBuilder( false );
- settings->EnableDoNotTrack( false );
- settings->UseScrollbarThumbFocusNotifications( false );
- settings->AllowFileAccessFromExternalUrl( false );
- settings->AllowScriptsOpenWindows( false );
+ settings->AllowMixedContents(false);
+ settings->EnableSpatialNavigation(false);
+ settings->EnableWebSecurity(false);
+ settings->EnableCacheBuilder(false);
+ settings->EnableDoNotTrack(false);
+ settings->UseScrollbarThumbFocusNotifications(false);
+ settings->AllowFileAccessFromExternalUrl(false);
+ settings->AllowScriptsOpenWindows(false);
// Check default value is true or not
bool value = settings->IsKeypadWithoutUserActionUsed();
- DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK(value);
// Check Set/GetProperty
- settings->UseKeypadWithoutUserAction( false );
+ settings->UseKeypadWithoutUserAction(false);
value = settings->IsKeypadWithoutUserActionUsed();
- DALI_TEST_CHECK( !value );
+ DALI_TEST_CHECK(!value);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebSettings* settings = view.GetSettings();
- DALI_TEST_CHECK( settings != 0 )
+ DALI_TEST_CHECK(settings != 0)
// Reset something
- settings->AllowMixedContents( false );
- settings->EnableSpatialNavigation( false );
- settings->EnableWebSecurity( false );
- settings->EnableCacheBuilder( false );
- settings->EnableDoNotTrack( false );
- settings->UseScrollbarThumbFocusNotifications( false );
- settings->AllowFileAccessFromExternalUrl( false );
- settings->AllowScriptsOpenWindows( false );
+ settings->AllowMixedContents(false);
+ settings->EnableSpatialNavigation(false);
+ settings->EnableWebSecurity(false);
+ settings->EnableCacheBuilder(false);
+ settings->EnableDoNotTrack(false);
+ settings->UseScrollbarThumbFocusNotifications(false);
+ settings->AllowFileAccessFromExternalUrl(false);
+ settings->AllowScriptsOpenWindows(false);
// Check default value is true or not
bool value = settings->IsAutofillPasswordFormEnabled();
- DALI_TEST_CHECK( value );
- settings->EnableAutofillPasswordForm( false );
+ DALI_TEST_CHECK(value);
+ settings->EnableAutofillPasswordForm(false);
value = settings->IsAutofillPasswordFormEnabled();
- DALI_TEST_CHECK( !value );
+ DALI_TEST_CHECK(!value);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebSettings* settings = view.GetSettings();
- DALI_TEST_CHECK( settings != 0 );
+ DALI_TEST_CHECK(settings != 0);
// Reset something
- settings->AllowMixedContents( false );
- settings->EnableSpatialNavigation( false );
- settings->EnableWebSecurity( false );
- settings->EnableCacheBuilder( false );
- settings->EnableDoNotTrack( false );
- settings->UseScrollbarThumbFocusNotifications( false );
- settings->AllowFileAccessFromExternalUrl( false );
- settings->AllowScriptsOpenWindows( false );
+ settings->AllowMixedContents(false);
+ settings->EnableSpatialNavigation(false);
+ settings->EnableWebSecurity(false);
+ settings->EnableCacheBuilder(false);
+ settings->EnableDoNotTrack(false);
+ settings->UseScrollbarThumbFocusNotifications(false);
+ settings->AllowFileAccessFromExternalUrl(false);
+ settings->AllowScriptsOpenWindows(false);
// Check default value is true or not
bool value = settings->IsFormCandidateDataEnabled();
- DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK(value);
// Check Set/GetProperty
- settings->EnableFormCandidateData( false );
+ settings->EnableFormCandidateData(false);
value = settings->IsFormCandidateDataEnabled();
- DALI_TEST_CHECK( !value );
+ DALI_TEST_CHECK(!value);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebSettings* settings = view.GetSettings();
- DALI_TEST_CHECK( settings != 0 );
+ DALI_TEST_CHECK(settings != 0);
// Reset something
- settings->AllowMixedContents( false );
- settings->EnableSpatialNavigation( false );
- settings->EnableWebSecurity( false );
- settings->EnableCacheBuilder( false );
- settings->EnableDoNotTrack( false );
- settings->UseScrollbarThumbFocusNotifications( false );
- settings->AllowFileAccessFromExternalUrl( false );
- settings->AllowScriptsOpenWindows( false );
+ settings->AllowMixedContents(false);
+ settings->EnableSpatialNavigation(false);
+ settings->EnableWebSecurity(false);
+ settings->EnableCacheBuilder(false);
+ settings->EnableDoNotTrack(false);
+ settings->UseScrollbarThumbFocusNotifications(false);
+ settings->AllowFileAccessFromExternalUrl(false);
+ settings->AllowScriptsOpenWindows(false);
// Check default value is true or not
bool value = settings->IsTextSelectionEnabled();
- DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK(value);
//Check Set/GetProperty
settings->EnableTextSelection(false);
value = settings->IsTextSelectionEnabled();
- DALI_TEST_CHECK( !value );
+ DALI_TEST_CHECK(!value);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebSettings* settings = view.GetSettings();
- DALI_TEST_CHECK( settings != 0 );
+ DALI_TEST_CHECK(settings != 0);
// Reset something
- settings->AllowMixedContents( false );
- settings->EnableSpatialNavigation( false );
- settings->EnableWebSecurity( false );
- settings->EnableCacheBuilder( false );
- settings->EnableDoNotTrack( false );
- settings->UseScrollbarThumbFocusNotifications( false );
- settings->AllowFileAccessFromExternalUrl( false );
- settings->AllowScriptsOpenWindows( false );
+ settings->AllowMixedContents(false);
+ settings->EnableSpatialNavigation(false);
+ settings->EnableWebSecurity(false);
+ settings->EnableCacheBuilder(false);
+ settings->EnableDoNotTrack(false);
+ settings->UseScrollbarThumbFocusNotifications(false);
+ settings->AllowFileAccessFromExternalUrl(false);
+ settings->AllowScriptsOpenWindows(false);
// Check default value is true or not
bool value = settings->IsTextAutosizingEnabled();
- DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK(value);
// Check Set/GetProperty
settings->EnableTextAutosizing(false);
value = settings->IsTextAutosizingEnabled();
- DALI_TEST_CHECK( !value );
+ DALI_TEST_CHECK(!value);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebSettings* settings = view.GetSettings();
- DALI_TEST_CHECK( settings != 0 );
+ DALI_TEST_CHECK(settings != 0);
// Reset something
- settings->AllowMixedContents( false );
- settings->EnableSpatialNavigation( false );
- settings->EnableWebSecurity( false );
- settings->EnableCacheBuilder( false );
- settings->EnableDoNotTrack( false );
- settings->UseScrollbarThumbFocusNotifications( false );
- settings->AllowFileAccessFromExternalUrl( false );
- settings->AllowScriptsOpenWindows( false );
+ settings->AllowMixedContents(false);
+ settings->EnableSpatialNavigation(false);
+ settings->EnableWebSecurity(false);
+ settings->EnableCacheBuilder(false);
+ settings->EnableDoNotTrack(false);
+ settings->UseScrollbarThumbFocusNotifications(false);
+ settings->AllowFileAccessFromExternalUrl(false);
+ settings->AllowScriptsOpenWindows(false);
// Check default value is true or not
bool value = settings->IsArrowScrollEnabled();
- DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK(value);
// Check Set/GetProperty
settings->EnableArrowScroll(false);
value = settings->IsArrowScrollEnabled();
- DALI_TEST_CHECK( !value );
+ DALI_TEST_CHECK(!value);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebSettings* settings = view.GetSettings();
- DALI_TEST_CHECK( settings != 0 );
+ DALI_TEST_CHECK(settings != 0);
// Reset something
- settings->AllowMixedContents( false );
- settings->EnableSpatialNavigation( false );
- settings->EnableWebSecurity( false );
- settings->EnableCacheBuilder( false );
- settings->EnableDoNotTrack( false );
- settings->UseScrollbarThumbFocusNotifications( false );
- settings->AllowFileAccessFromExternalUrl( false );
- settings->AllowScriptsOpenWindows( false );
+ settings->AllowMixedContents(false);
+ settings->EnableSpatialNavigation(false);
+ settings->EnableWebSecurity(false);
+ settings->EnableCacheBuilder(false);
+ settings->EnableDoNotTrack(false);
+ settings->UseScrollbarThumbFocusNotifications(false);
+ settings->AllowFileAccessFromExternalUrl(false);
+ settings->AllowScriptsOpenWindows(false);
// Check default value is true or not
bool value = settings->IsClipboardEnabled();
- DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK(value);
settings->EnableClipboard(false);
value = settings->IsClipboardEnabled();
- DALI_TEST_CHECK( !value );
+ DALI_TEST_CHECK(!value);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebSettings* settings = view.GetSettings();
- DALI_TEST_CHECK( settings != 0 );
+ DALI_TEST_CHECK(settings != 0);
// Reset something
- settings->AllowMixedContents( false );
- settings->EnableSpatialNavigation( false );
- settings->EnableWebSecurity( false );
- settings->EnableCacheBuilder( false );
- settings->EnableDoNotTrack( false );
- settings->UseScrollbarThumbFocusNotifications( false );
- settings->AllowFileAccessFromExternalUrl( false );
- settings->AllowScriptsOpenWindows( false );
+ settings->AllowMixedContents(false);
+ settings->EnableSpatialNavigation(false);
+ settings->EnableWebSecurity(false);
+ settings->EnableCacheBuilder(false);
+ settings->EnableDoNotTrack(false);
+ settings->UseScrollbarThumbFocusNotifications(false);
+ settings->AllowFileAccessFromExternalUrl(false);
+ settings->AllowScriptsOpenWindows(false);
// Check default value is true or not
bool value = settings->IsImePanelEnabled();
- DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK(value);
// Check Set/GetProperty
settings->EnableImePanel(false);
value = settings->IsImePanelEnabled();
- DALI_TEST_CHECK( !value );
+ DALI_TEST_CHECK(!value);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebSettings* settings = view.GetSettings();
- DALI_TEST_CHECK( settings != 0 )
+ DALI_TEST_CHECK(settings != 0)
// Reset something
- settings->AllowMixedContents( false );
- settings->EnableSpatialNavigation( false );
- settings->EnableWebSecurity( false );
- settings->EnableCacheBuilder( false );
- settings->EnableDoNotTrack( false );
- settings->UseScrollbarThumbFocusNotifications( false );
- settings->AllowFileAccessFromExternalUrl( false );
- settings->AllowScriptsOpenWindows( false );
+ settings->AllowMixedContents(false);
+ settings->EnableSpatialNavigation(false);
+ settings->EnableWebSecurity(false);
+ settings->EnableCacheBuilder(false);
+ settings->EnableDoNotTrack(false);
+ settings->UseScrollbarThumbFocusNotifications(false);
+ settings->AllowFileAccessFromExternalUrl(false);
+ settings->AllowScriptsOpenWindows(false);
// Check default value is true or not
bool value = settings->AreImagesLoadedAutomatically();
- DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK(value);
// Check Set/GetProperty
- settings->AllowImagesLoadAutomatically( false );
+ settings->AllowImagesLoadAutomatically(false);
value = settings->AreImagesLoadedAutomatically();
- DALI_TEST_CHECK( !value );
+ DALI_TEST_CHECK(!value);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebSettings* settings = view.GetSettings();
- DALI_TEST_CHECK( settings != 0 )
+ DALI_TEST_CHECK(settings != 0)
const std::string kDefaultValue;
const std::string kTestValue = "UTF-8";
// Reset something
- settings->AllowMixedContents( false );
- settings->EnableSpatialNavigation( false );
- settings->EnableWebSecurity( false );
- settings->EnableCacheBuilder( false );
- settings->EnableDoNotTrack( false );
- settings->UseScrollbarThumbFocusNotifications( false );
- settings->AllowFileAccessFromExternalUrl( false );
- settings->AllowScriptsOpenWindows( false );
+ settings->AllowMixedContents(false);
+ settings->EnableSpatialNavigation(false);
+ settings->EnableWebSecurity(false);
+ settings->EnableCacheBuilder(false);
+ settings->EnableDoNotTrack(false);
+ settings->UseScrollbarThumbFocusNotifications(false);
+ settings->AllowFileAccessFromExternalUrl(false);
+ settings->AllowScriptsOpenWindows(false);
// Check default value
std::string value = settings->GetDefaultTextEncodingName();
- DALI_TEST_EQUALS( value, kDefaultValue, TEST_LOCATION );
+ DALI_TEST_EQUALS(value, kDefaultValue, TEST_LOCATION);
// Check Set/GetProperty
- settings->SetDefaultTextEncodingName( kTestValue );
+ settings->SetDefaultTextEncodingName(kTestValue);
value = settings->GetDefaultTextEncodingName();
- DALI_TEST_EQUALS( value, kTestValue, TEST_LOCATION );
+ DALI_TEST_EQUALS(value, kTestValue, TEST_LOCATION);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebSettings* settings = view.GetSettings();
- DALI_TEST_CHECK( settings != 0 )
+ DALI_TEST_CHECK(settings != 0)
// Check the value is true or not
bool value = settings->SetViewportMetaTag(true);
- DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK(value);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebSettings* settings = view.GetSettings();
- DALI_TEST_CHECK( settings != 0 )
+ DALI_TEST_CHECK(settings != 0)
// Check the value is true or not
bool value = settings->SetForceZoom(true);
- DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK(value);
value = settings->IsZoomForced();
- DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK(value);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebSettings* settings = view.GetSettings();
- DALI_TEST_CHECK( settings != 0 )
+ DALI_TEST_CHECK(settings != 0)
// Check the value is true or not
bool value = settings->SetTextZoomEnabled(true);
- DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK(value);
value = settings->IsTextZoomEnabled();
- DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK(value);
END_TEST;
}
ToolkitTestApplication application;
WebView view = WebView::New();
- DALI_TEST_CHECK( view );
+ DALI_TEST_CHECK(view);
Dali::Toolkit::WebSettings* settings = view.GetSettings();
- DALI_TEST_CHECK( settings != 0 )
+ DALI_TEST_CHECK(settings != 0)
// Check the value is true or not
settings->SetExtraFeature("test", true);
bool value = settings->IsExtraFeatureEnabled("test");
- DALI_TEST_CHECK( value );
+ DALI_TEST_CHECK(value);
END_TEST;
}