/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
// Check gesture actually happens
{
DummyControl dummy = DummyControl::New(true);
- dummy.SetRelayoutEnabled( true );
dummy.SetSize( Vector2(100.0f, 100.0f ) );
dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
// Ensure full code coverage
{
DummyControl dummy = DummyControl::New();
- dummy.SetRelayoutEnabled( true );
dummy.SetSize( Vector2( 100.0f, 100.0f ) );
dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
END_TEST;
}
-int UtcDaliControlImplSizeSet(void)
+int UtcDaliControlImplSizeSetP(void)
{
ToolkitTestApplication application;
{
DummyControl dummy = DummyControl::New( true );
- dummy.SetRelayoutEnabled( true );
DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
Stage::GetCurrent().Add(dummy);
application.Render();
application.SendNotification();
- DALI_TEST_EQUALS( dummyImpl.sizeSetCalled, true, TEST_LOCATION ); // Called from size negotiation
+ DALI_TEST_EQUALS( dummyImpl.sizeSetCalled, false, TEST_LOCATION ); // Size not set, no onSizeSet called
Vector2 size(100.0f, 200.0f);
- dummy.SetSize(size);
+ dummy.SetSize( size );
+
+ DALI_TEST_EQUALS( dummyImpl.sizeSetCalled, false, TEST_LOCATION ); // Size is going to get negotiated, no onSizeSet called
- application.Render();
application.SendNotification();
application.Render();
- application.SendNotification();
- DALI_TEST_EQUALS(size, dummy.GetCurrentSize().GetVectorXY(), TEST_LOCATION);
+ DALI_TEST_EQUALS( size, dummy.GetCurrentSize().GetVectorXY(), TEST_LOCATION );
DALI_TEST_EQUALS( dummyImpl.sizeSetCalled, true, TEST_LOCATION );
Stage::GetCurrent().Remove(dummy);
}
- // Ensure full code coverage
+ END_TEST;
+}
+
+int UtcDaliControlImplSizeSet2P(void)
+{
+ ToolkitTestApplication application;
+
{
DummyControl dummy = DummyControl::New();
- dummy.SetRelayoutEnabled( true );
Stage::GetCurrent().Add(dummy);
Vector2 size(100.0f, 200.0f);
DALI_TEST_CHECK( size != dummy.GetCurrentSize().GetVectorXY() );
- application.Render();
application.SendNotification();
+ application.Render();
dummy.SetSize(size);
- application.Render();
application.SendNotification();
application.Render();
- application.SendNotification();
DALI_TEST_EQUALS(size, dummy.GetCurrentSize().GetVectorXY(), TEST_LOCATION);
END_TEST;
}
+
int UtcDaliControlImplSizeAnimation(void)
{
ToolkitTestApplication application;
{
DummyControl dummy = DummyControl::New( true );
- dummy.SetRelayoutEnabled( true );
DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
dummy.SetSize( Vector2( 100.0f, 100.0f ) );
// Ensure full code coverage
{
DummyControl dummy = DummyControl::New();
- dummy.SetRelayoutEnabled( true );
dummy.SetSize( Vector2( 100.0f, 100.0f ) );
dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
END_TEST;
}
-int UtcDaliControlImplStyleChange(void)
-{
- ToolkitTestApplication application;
-
- DummyControl dummy = DummyControl::New( true );
- DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
-
- Stage::GetCurrent().Add(dummy);
-
- application.Render();
- application.SendNotification();
- application.Render();
- application.SendNotification();
-
- // Add a Control and normal Actor as children
- DummyControl dummyChild = DummyControl::New();
- dummy.Add(dummyChild);
-
- Actor actor = Actor::New();
- dummy.Add(actor);
-
- DALI_TEST_EQUALS( dummyImpl.fontChangeCalled, false, TEST_LOCATION );
- StyleChange styleChange;
- styleChange.defaultFontChange = true;
- Dali::StyleMonitor styleMonitor = StyleMonitor::Get();
- styleMonitor.EmitStyleChangeSignal(styleChange);
-
- DALI_TEST_EQUALS( dummyImpl.fontChangeCalled, true, TEST_LOCATION );
-
- Stage::GetCurrent().Remove(dummy);
- END_TEST;
-}
-
int UtcDaliControlImplKeyInputFocusGained(void)
{
ToolkitTestApplication application;
{
DummyControl dummy = DummyControl::New( true );
- dummy.SetRelayoutEnabled( true );
DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
dummy.SetSize( Vector2( 100.0f, 100.0f ) );
// Ensure full code coverage
{
DummyControl dummy = DummyControl::New();
- dummy.SetRelayoutEnabled( true );
dummy.SetSize( Vector2( 100.0f, 100.0f ) );
dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);