X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-ControlImpl.cpp;h=bdd74f97e38e928a6ccc9046c7f2e09b3859deae;hp=31f309436374bca21bd515bfcd8b1bab956e0183;hb=dea624eb348a4926d8761c8a1364f03f9f71acf5;hpb=4aaa3009e1e192b20eae5f0831996f1034cbb6f4 diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp index 31f3094..bdd74f9 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) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -217,10 +217,10 @@ int UtcDaliControlImplOnGestureMethods(void) // Check gesture actually happens { DummyControl dummy = DummyControl::New(true); - dummy.SetSize( Vector2(100.0f, 100.0f ) ); + dummy.SetProperty( Actor::Property::SIZE, Vector2(100.0f, 100.0f ) ); - dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT); - Stage::GetCurrent().Add(dummy); + dummy.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT); + application.GetScene().Add(dummy); // Render and notify a couple of times application.SendNotification(); @@ -255,7 +255,7 @@ int UtcDaliControlImplOnGestureMethods(void) DALI_TEST_CHECK( dummyImpl.longPressCalled == true ); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } END_TEST; @@ -267,7 +267,7 @@ int UtcDaliControlImplChildAddAndRemove(void) { DummyControl dummy = DummyControl::New( true ); - Stage::GetCurrent().Add(dummy); + application.GetScene().Add(dummy); Impl::DummyControl& dummyImpl = static_cast(dummy.GetImplementation()); application.Render(); @@ -291,13 +291,13 @@ int UtcDaliControlImplChildAddAndRemove(void) application.Render(); application.SendNotification(); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } // Ensure full code coverage { DummyControl dummy = DummyControl::New(); - Stage::GetCurrent().Add(dummy); + application.GetScene().Add(dummy); application.Render(); application.SendNotification(); @@ -316,7 +316,7 @@ int UtcDaliControlImplChildAddAndRemove(void) application.Render(); application.SendNotification(); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } END_TEST; } @@ -330,13 +330,13 @@ int UtcDaliControlImplStageConnection(void) Impl::DummyControl& dummyImpl = static_cast(dummy.GetImplementation()); DALI_TEST_EQUALS( dummyImpl.stageConnectionCalled, false, TEST_LOCATION ); - Stage::GetCurrent().Add(dummy); + application.GetScene().Add(dummy); application.Render(); application.SendNotification(); DALI_TEST_EQUALS( dummyImpl.stageConnectionCalled, true, TEST_LOCATION ); DALI_TEST_EQUALS( dummyImpl.stageDisconnectionCalled, false, TEST_LOCATION ); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); application.Render(); application.SendNotification(); DALI_TEST_EQUALS( dummyImpl.stageDisconnectionCalled, true, TEST_LOCATION ); @@ -344,19 +344,19 @@ int UtcDaliControlImplStageConnection(void) // Ensure full code coverage { - unsigned int stageChildren = Stage::GetCurrent().GetLayer(0).GetChildCount(); + unsigned int stageChildren = application.GetScene().GetLayer(0).GetChildCount(); DummyControl dummy = DummyControl::New(); - DALI_TEST_EQUALS( Stage::GetCurrent().GetLayer(0).GetChildCount(), stageChildren, TEST_LOCATION ); - Stage::GetCurrent().Add(dummy); + DALI_TEST_EQUALS( application.GetScene().GetLayer(0).GetChildCount(), stageChildren, TEST_LOCATION ); + application.GetScene().Add(dummy); application.Render(); application.SendNotification(); - DALI_TEST_EQUALS( Stage::GetCurrent().GetLayer(0).GetChildCount(), stageChildren + 1, TEST_LOCATION ); + DALI_TEST_EQUALS( application.GetScene().GetLayer(0).GetChildCount(), stageChildren + 1, TEST_LOCATION ); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); application.Render(); application.SendNotification(); - DALI_TEST_EQUALS( Stage::GetCurrent().GetLayer(0).GetChildCount(), stageChildren, TEST_LOCATION ); + DALI_TEST_EQUALS( application.GetScene().GetLayer(0).GetChildCount(), stageChildren, TEST_LOCATION ); } END_TEST; } @@ -369,23 +369,23 @@ int UtcDaliControlImplSizeSetP(void) DummyControl dummy = DummyControl::New( true ); Impl::DummyControl& dummyImpl = static_cast(dummy.GetImplementation()); - Stage::GetCurrent().Add(dummy); + application.GetScene().Add(dummy); application.Render(); application.SendNotification(); DALI_TEST_EQUALS( dummyImpl.sizeSetCalled, false, TEST_LOCATION ); // Size not set, no onSizeSet called Vector2 size(100.0f, 200.0f); - dummy.SetSize( size ); + dummy.SetProperty( Actor::Property::SIZE, size ); 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.GetCurrentSize().GetVectorXY(), TEST_LOCATION ); + DALI_TEST_EQUALS( size, dummy.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).GetVectorXY(), TEST_LOCATION ); DALI_TEST_EQUALS( dummyImpl.sizeSetCalled, true, TEST_LOCATION ); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } END_TEST; @@ -397,22 +397,22 @@ int UtcDaliControlImplSizeSet2P(void) { DummyControl dummy = DummyControl::New(); - Stage::GetCurrent().Add(dummy); + application.GetScene().Add(dummy); Vector2 size(100.0f, 200.0f); - DALI_TEST_CHECK( size != dummy.GetCurrentSize().GetVectorXY() ); + DALI_TEST_CHECK( size != dummy.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).GetVectorXY() ); application.SendNotification(); application.Render(); - dummy.SetSize(size); + dummy.SetProperty( Actor::Property::SIZE, size); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(size, dummy.GetCurrentSize().GetVectorXY(), TEST_LOCATION); + DALI_TEST_EQUALS(size, dummy.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).GetVectorXY(), TEST_LOCATION); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } END_TEST; } @@ -426,7 +426,7 @@ int UtcDaliControlImplSizeAnimation(void) DummyControl dummy = DummyControl::New( true ); Impl::DummyControl& dummyImpl = static_cast(dummy.GetImplementation()); - Stage::GetCurrent().Add(dummy); + application.GetScene().Add(dummy); DALI_TEST_EQUALS( dummyImpl.sizeAnimationCalled, false, TEST_LOCATION ); Animation animation = Animation::New(1.0f); @@ -440,14 +440,14 @@ int UtcDaliControlImplSizeAnimation(void) DALI_TEST_EQUALS( dummyImpl.sizeAnimationCalled, true, TEST_LOCATION ); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } // Ensure full code coverage { DummyControl dummy = DummyControl::New(); - Stage::GetCurrent().Add(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 ) ); @@ -458,7 +458,7 @@ int UtcDaliControlImplSizeAnimation(void) application.Render(); application.SendNotification(); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } END_TEST; } @@ -473,9 +473,9 @@ int UtcDaliControlImplTouchEvent(void) DummyControl dummy = DummyControl::New( true ); Impl::DummyControl& dummyImpl = static_cast(dummy.GetImplementation()); - dummy.SetSize( Vector2( 100.0f, 100.0f ) ); - dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT); - Stage::GetCurrent().Add(dummy); + dummy.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) ); + dummy.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT); + application.GetScene().Add(dummy); application.Render(); application.SendNotification(); @@ -492,16 +492,16 @@ int UtcDaliControlImplTouchEvent(void) application.ProcessEvent(touchEvent); DALI_TEST_EQUALS( dummyImpl.touchEventCalled, true, TEST_LOCATION ); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } // Ensure full code coverage { DummyControl dummy = DummyControl::New(); - dummy.SetSize( Vector2( 100.0f, 100.0f ) ); - dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT); - Stage::GetCurrent().Add(dummy); + dummy.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) ); + dummy.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT); + application.GetScene().Add(dummy); application.Render(); application.SendNotification(); @@ -516,7 +516,7 @@ int UtcDaliControlImplTouchEvent(void) touchEvent.AddPoint(point); application.ProcessEvent(touchEvent); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } END_TEST; } @@ -529,9 +529,9 @@ int UtcDaliControlImplHoverEvent(void) DummyControl dummy = DummyControl::New( true ); Impl::DummyControl& dummyImpl = static_cast(dummy.GetImplementation()); - dummy.SetSize( Vector2( 100.0f, 100.0f ) ); - dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT); - Stage::GetCurrent().Add(dummy); + dummy.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) ); + dummy.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT); + application.GetScene().Add(dummy); application.Render(); application.SendNotification(); @@ -548,16 +548,16 @@ int UtcDaliControlImplHoverEvent(void) application.ProcessEvent( event ); DALI_TEST_EQUALS( dummyImpl.hoverEventCalled, true, TEST_LOCATION ); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } // Ensure full code coverage { DummyControl dummy = DummyControl::New(); - dummy.SetSize( Vector2( 100.0f, 100.0f ) ); - dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT); - Stage::GetCurrent().Add(dummy); + dummy.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) ); + dummy.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT); + application.GetScene().Add(dummy); application.Render(); application.SendNotification(); @@ -572,7 +572,7 @@ int UtcDaliControlImplHoverEvent(void) event.AddPoint(point); application.ProcessEvent( event ); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } END_TEST; } @@ -588,7 +588,7 @@ int UtcDaliControlImplKeyEvent(void) DummyControl dummy = DummyControl::New( true ); Impl::DummyControl& dummyImpl = static_cast(dummy.GetImplementation()); - Stage::GetCurrent().Add(dummy); + application.GetScene().Add(dummy); dummy.SetKeyInputFocus(); application.Render(); @@ -601,14 +601,14 @@ int UtcDaliControlImplKeyEvent(void) application.ProcessEvent(keyEvent); DALI_TEST_EQUALS( dummyImpl.keyEventCalled, true, TEST_LOCATION ); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } // Ensure full code coverage { DummyControl dummy = DummyControl::New(); - Stage::GetCurrent().Add(dummy); + application.GetScene().Add(dummy); dummy.SetKeyInputFocus(); application.Render(); @@ -619,7 +619,7 @@ int UtcDaliControlImplKeyEvent(void) Integration::KeyEvent keyEvent; application.ProcessEvent(keyEvent); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } END_TEST; } @@ -632,7 +632,7 @@ int UtcDaliControlImplKeyInputFocusGained(void) DummyControl dummy = DummyControl::New( true ); Impl::DummyControl& dummyImpl = static_cast(dummy.GetImplementation()); - Stage::GetCurrent().Add(dummy); + application.GetScene().Add(dummy); DALI_TEST_EQUALS( dummyImpl.keyInputFocusGained, false, TEST_LOCATION ); @@ -640,16 +640,16 @@ int UtcDaliControlImplKeyInputFocusGained(void) DALI_TEST_EQUALS( dummyImpl.keyInputFocusGained, true, TEST_LOCATION ); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } // Ensure full code coverage { DummyControl dummy = DummyControl::New(); - Stage::GetCurrent().Add(dummy); + application.GetScene().Add(dummy); dummy.SetKeyInputFocus(); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } END_TEST; } @@ -662,7 +662,7 @@ int UtcDaliControlImplKeyInputFocusLost(void) DummyControl dummy = DummyControl::New( true ); Impl::DummyControl& dummyImpl = static_cast(dummy.GetImplementation()); - Stage::GetCurrent().Add(dummy); + application.GetScene().Add(dummy); DALI_TEST_EQUALS( dummyImpl.keyInputFocusLost, false, TEST_LOCATION ); @@ -671,14 +671,14 @@ int UtcDaliControlImplKeyInputFocusLost(void) DALI_TEST_EQUALS( dummyImpl.keyInputFocusLost, true, TEST_LOCATION ); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } // Ensure full code coverage { DummyControl dummy = DummyControl::New(); - Stage::GetCurrent().Add(dummy); + application.GetScene().Add(dummy); dummy.SetKeyInputFocus(); dummy.ClearKeyInputFocus(); @@ -687,7 +687,7 @@ int UtcDaliControlImplKeyInputFocusLost(void) dummyImpl.IsKeyboardNavigationSupported(); dummyImpl.IsKeyboardFocusGroup(); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } END_TEST; } @@ -726,9 +726,9 @@ int UtcDaliControlImplWheelEvent(void) DummyControl dummy = DummyControl::New( true ); Impl::DummyControl& dummyImpl = static_cast(dummy.GetImplementation()); - dummy.SetSize( Vector2( 100.0f, 100.0f ) ); - dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT); - Stage::GetCurrent().Add(dummy); + dummy.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) ); + dummy.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT); + application.GetScene().Add(dummy); dummy.WheelEventSignal().Connect(&WheelEventCallback); @@ -745,16 +745,16 @@ int UtcDaliControlImplWheelEvent(void) application.ProcessEvent( event ); DALI_TEST_EQUALS( dummyImpl.wheelEventCalled, true, TEST_LOCATION ); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } // Ensure full code coverage { DummyControl dummy = DummyControl::New(); - dummy.SetSize( Vector2( 100.0f, 100.0f ) ); - dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT); - Stage::GetCurrent().Add(dummy); + dummy.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) ); + dummy.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT); + application.GetScene().Add(dummy); dummy.WheelEventSignal().Connect(&WheelEventCallback); @@ -768,7 +768,7 @@ int UtcDaliControlImplWheelEvent(void) Integration::WheelEvent event( Integration::WheelEvent::MOUSE_WHEEL, 0, 0u, screenCoordinates, 1, 1000u ); application.ProcessEvent( event ); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } END_TEST; } @@ -780,15 +780,15 @@ int UtcDaliControlImplSetStyleName(void) { DummyControl dummy = DummyControl::New( true ); - dummy.SetSize( Vector2( 100.0f, 100.0f ) ); - dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT); - Stage::GetCurrent().Add(dummy); + 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" ); - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); } END_TEST; } @@ -946,7 +946,7 @@ int UtcDaliControlImplRegisterVisualToSelf(void) { ToolkitTestApplication application; - Test::ObjectDestructionTracker objectDestructionTracker; + Test::ObjectDestructionTracker objectDestructionTracker( application.GetCore().GetObjectRegistry() ); { DummyControl dummy = DummyControl::New(); @@ -1040,7 +1040,7 @@ int UtcDaliControlImplRegisterUnregisterVisual(void) dummyImpl.RegisterVisual( index, visual ); tet_infoline( "Add control with visual to stage and check renderer count is 1" ); - Stage::GetCurrent().Add( dummy ); + application.GetScene().Add( dummy ); application.SendNotification(); application.Render(); @@ -1051,7 +1051,7 @@ int UtcDaliControlImplRegisterUnregisterVisual(void) dummyImpl.UnregisterVisual( index ); tet_infoline( "Remove control with visual from stage and check renderer count is 0" ); - Stage::GetCurrent().Remove( dummy ); + application.GetScene().Remove( dummy ); application.SendNotification(); application.Render(); @@ -1086,7 +1086,7 @@ int UtcDaliControlImplRegisterDisabledVisual(void) DALI_TEST_CHECK( dummyImpl.GetVisual( TEST_PROPERTY ) == visual ); DALI_TEST_CHECK( dummyImpl.IsVisualEnabled( TEST_PROPERTY ) == false ); - Stage::GetCurrent().Add(dummy); + application.GetScene().Add(dummy); // Render and notify application.SendNotification(); @@ -1094,7 +1094,7 @@ int UtcDaliControlImplRegisterDisabledVisual(void) DALI_TEST_CHECK( dummyImpl.IsVisualEnabled( TEST_PROPERTY ) == false ); - DALI_TEST_CHECK( dummy.OnStage() == true ); + DALI_TEST_CHECK( dummy.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) == true ); dummyImpl.EnableVisual( TEST_PROPERTY, true ); @@ -1125,7 +1125,7 @@ int UtcDaliControlImplDisableRegisteredVisual(void) // Register index with a color visual dummyImpl.RegisterVisual( TEST_PROPERTY, visual ); - Stage::GetCurrent().Add(dummy); + application.GetScene().Add(dummy); // Render and notify application.SendNotification(); @@ -1133,7 +1133,7 @@ int UtcDaliControlImplDisableRegisteredVisual(void) DALI_TEST_CHECK( dummyImpl.IsVisualEnabled( TEST_PROPERTY ) == true); - DALI_TEST_CHECK( dummy.OnStage() == true ); + DALI_TEST_CHECK( dummy.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) == true ); dummyImpl.EnableVisual( TEST_PROPERTY, false ); @@ -1167,13 +1167,13 @@ int UtcDaliControlImplEnabledVisualParentRemovedFromStage(void) // Register index with a color visual dummyImpl.RegisterVisual( TEST_PROPERTY, visual, false ); - Stage::GetCurrent().Add(dummy); + application.GetScene().Add(dummy); // Render and notify application.SendNotification(); application.Render(); DALI_TEST_CHECK( dummyImpl.IsVisualEnabled( TEST_PROPERTY ) == false ); - DALI_TEST_CHECK( dummy.OnStage() == true ); + DALI_TEST_CHECK( dummy.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) == true ); dummyImpl.EnableVisual( TEST_PROPERTY, true ); // Render and notify @@ -1182,13 +1182,13 @@ int UtcDaliControlImplEnabledVisualParentRemovedFromStage(void) DALI_TEST_CHECK( dummy.GetRendererCount() == 1u ); // Remove control from stage, visual should be removed from stage too - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); // Render and notify application.SendNotification(); application.Render(); DALI_TEST_CHECK( dummy.GetRendererCount() == 0u ); - Stage::GetCurrent().Add(dummy); + application.GetScene().Add(dummy); // Render and notify application.SendNotification(); application.Render(); @@ -1237,7 +1237,7 @@ int UtcDaliControlImplRegisterTwoVisualsAndEnableOnlyOne(void) // Register second index with a color visual dummyImpl.RegisterVisual( TEST_PROPERTY2, visual2 ); - Stage::GetCurrent().Add(dummy); + application.GetScene().Add(dummy); // Render and notify application.SendNotification(); application.Render(); @@ -1245,7 +1245,7 @@ int UtcDaliControlImplRegisterTwoVisualsAndEnableOnlyOne(void) 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.OnStage() == true ); + DALI_TEST_CHECK( dummy.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) == true ); dummyImpl.EnableVisual( TEST_PROPERTY2, false ); // Render and notify @@ -1254,13 +1254,13 @@ int UtcDaliControlImplRegisterTwoVisualsAndEnableOnlyOne(void) DALI_TEST_CHECK( dummy.GetRendererCount() == 1u ); // Remove control from stage, visual should be removed from stage too - Stage::GetCurrent().Remove(dummy); + application.GetScene().Remove(dummy); // Render and notify application.SendNotification(); application.Render(); DALI_TEST_CHECK( dummy.GetRendererCount() == 0u ); - Stage::GetCurrent().Add(dummy); + application.GetScene().Add(dummy); // Render and notify application.SendNotification(); application.Render(); @@ -1293,7 +1293,7 @@ int UtcDaliControlImplAutoClippingWithVisuals(void) control.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN ); - Stage::GetCurrent().Add( control ); + application.GetScene().Add( control ); application.SendNotification(); application.Render(); @@ -1323,7 +1323,7 @@ int UtcDaliControlImplAutoClippingWithVisualsAlreadyOnStage(void) DALI_TEST_EQUALS( 0, control.GetRendererCount(), TEST_LOCATION ); - Stage::GetCurrent().Add( control ); + application.GetScene().Add( control ); application.SendNotification(); application.Render(); @@ -1337,3 +1337,28 @@ int UtcDaliControlImplAutoClippingWithVisualsAlreadyOnStage(void) END_TEST; } + +int UtcDaliControlImplOnPinch(void) +{ + 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); + application.GetScene().Add(control); + + application.SendNotification(); + application.Render(); + + Toolkit::Internal::Control& impl = Toolkit::Internal::GetImplementation(control); + impl.EnableGestureDetection(Gesture::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 ); + + DALI_TEST_EQUALS(0.666f, control.GetProperty( Actor::Property::SCALE_X).Get(), 0.01f, TEST_LOCATION); + + END_TEST; + +}