X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-ControlImpl.cpp;h=49a9b0b07ba67a7bb6cc17a6537f678350db3e87;hb=4e65d7d134b192d68e41388b3a74ac61fb62daff;hp=6965f358da2206eba0a5b865ec6f440726ca25c7;hpb=c803046c24398c2037a83d105a932976dede943f;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp index 6965f35..49a9b0b 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -218,7 +218,7 @@ int UtcDaliControlImplOnGestureMethods(void) // Check gesture actually happens { DummyControl dummy = DummyControl::New(true); - dummy.SetSize( Vector3(100.0f, 100.0f, 100.0f) ); + dummy.SetSize( Vector2(100.0f, 100.0f ) ); dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT); Stage::GetCurrent().Add(dummy); @@ -278,7 +278,7 @@ int UtcDaliControlImplOnGestureMethods(void) // Ensure full code coverage { DummyControl dummy = DummyControl::New(); - dummy.SetSize( Vector3(100.0f, 100.0f, 100.0f) ); + dummy.SetSize( Vector2( 100.0f, 100.0f ) ); dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT); Stage::GetCurrent().Add(dummy); @@ -437,7 +437,7 @@ int UtcDaliControlImplStageConnection(void) END_TEST; } -int UtcDaliControlImplSizeSet(void) +int UtcDaliControlImplSizeSetP(void) { ToolkitTestApplication application; @@ -449,46 +449,51 @@ int UtcDaliControlImplSizeSet(void) application.Render(); application.SendNotification(); - DALI_TEST_EQUALS( dummyImpl.sizeSetCalled, false, TEST_LOCATION ); - Vector3 size(100.0f, 200.0f, 0.0f); - dummy.SetSize(size); + DALI_TEST_EQUALS( dummyImpl.sizeSetCalled, false, TEST_LOCATION ); // Size not set, no onSizeSet called + Vector2 size(100.0f, 200.0f); + 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(), 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(); Stage::GetCurrent().Add(dummy); - Vector3 size(100.0f, 200.0f, 0.0f); - DALI_TEST_CHECK( size != dummy.GetCurrentSize() ); + 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(), TEST_LOCATION); + DALI_TEST_EQUALS(size, dummy.GetCurrentSize().GetVectorXY(), TEST_LOCATION); Stage::GetCurrent().Remove(dummy); } END_TEST; } + int UtcDaliControlImplSizeAnimation(void) { ToolkitTestApplication application; @@ -501,7 +506,7 @@ int UtcDaliControlImplSizeAnimation(void) DALI_TEST_EQUALS( dummyImpl.sizeAnimationCalled, false, TEST_LOCATION ); Animation animation = Animation::New(1.0f); - animation.Resize(dummy, 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(); @@ -521,7 +526,7 @@ int UtcDaliControlImplSizeAnimation(void) Stage::GetCurrent().Add(dummy); Animation animation = Animation::New(1.0f); - animation.Resize(dummy, 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(); @@ -544,7 +549,7 @@ int UtcDaliControlImplTouchEvent(void) DummyControl dummy = DummyControl::New( true ); DummyControlImplOverride& dummyImpl = static_cast(dummy.GetImplementation()); - dummy.SetSize(100.0f, 100.0f); + dummy.SetSize( Vector2( 100.0f, 100.0f ) ); dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT); Stage::GetCurrent().Add(dummy); @@ -567,7 +572,7 @@ int UtcDaliControlImplTouchEvent(void) { DummyControl dummy = DummyControl::New(); - dummy.SetSize(100.0f, 100.0f); + dummy.SetSize( Vector2( 100.0f, 100.0f ) ); dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT); Stage::GetCurrent().Add(dummy); @@ -633,39 +638,6 @@ int UtcDaliControlImplKeyEvent(void) END_TEST; } -int UtcDaliControlImplStyleChange(void) -{ - ToolkitTestApplication application; - - DummyControl dummy = DummyControl::New( true ); - DummyControlImplOverride& dummyImpl = static_cast(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; @@ -769,7 +741,7 @@ int UtcDaliControlImplMouseWheelEvent(void) DummyControl dummy = DummyControl::New( true ); DummyControlImplOverride& dummyImpl = static_cast(dummy.GetImplementation()); - dummy.SetSize(100.0f, 100.0f); + dummy.SetSize( Vector2( 100.0f, 100.0f ) ); dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT); Stage::GetCurrent().Add(dummy); @@ -795,7 +767,7 @@ int UtcDaliControlImplMouseWheelEvent(void) { DummyControl dummy = DummyControl::New(); - dummy.SetSize(100.0f, 100.0f); + dummy.SetSize( Vector2( 100.0f, 100.0f ) ); dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT); Stage::GetCurrent().Add(dummy);