X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-Popup.cpp;h=31faabbaa721dabcb8e96083298326cdc3b52e0e;hb=5e937a6322849b76d49d5b3f41cb5d91c94acd3e;hp=0b95d1f5ed5dee9db0e84ee50c3083e442fdcba8;hpb=d3f2653b1750861e4071acbe1e43fdcc9ec0c593;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp old mode 100644 new mode 100755 index 0b95d1f..31faabb --- a/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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. @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -174,22 +175,26 @@ struct PopupTestFunctor // 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 DevelDevice::Class::Type& deviceClass = DevelDevice::Class::NONE, - const DevelDevice::Subclass::Type& deviceSubclass = DevelDevice::Subclass::NONE + 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 ); @@ -632,8 +637,8 @@ int UtcDaliPopupOnTouchedOutsideSignal(void) // Create the Popup actor Popup popup = Popup::New(); - popup.SetParentOrigin( ParentOrigin::CENTER ); - popup.SetAnchorPoint( ParentOrigin::CENTER ); + popup.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + popup.SetProperty( Actor::Property::ANCHOR_POINT, ParentOrigin::CENTER ); popup.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS); popup.SetSize( 50.0f, 50.0f ); popup.SetProperty( Popup::Property::ANIMATION_DURATION, 0.0f ); @@ -912,8 +917,8 @@ int UtcDaliPopupPropertyContextualMode(void) // Placement actor to parent the popup from so the popup's contextual position can be relative to it. Actor placement = Actor::New(); - placement.SetParentOrigin( ParentOrigin::CENTER ); - placement.SetAnchorPoint( AnchorPoint::CENTER ); + placement.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + placement.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); placement.SetSize( 1.0f, 1.0f ); placement.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); Stage::GetCurrent().Add( placement ); @@ -942,7 +947,7 @@ int UtcDaliPopupPropertyContextualMode(void) application.Render(); // Check the position of the label within the popup. - DALI_TEST_EQUALS( contentLabel.GetCurrentWorldPosition().GetVectorXY(), offsetValues[i], TEST_LOCATION ); + DALI_TEST_EQUALS( contentLabel.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).GetVectorXY(), offsetValues[i], TEST_LOCATION ); popup.SetDisplayState( Popup::HIDDEN ); application.SendNotification(); @@ -965,20 +970,20 @@ int UtcDaliPopupPropertyBacking(void) Actor backing = popup.FindChildByName( "popupBacking" ); DALI_TEST_CHECK( backing ); - DALI_TEST_EQUALS( backing.GetCurrentOpacity(), 1.0f, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + DALI_TEST_EQUALS( backing.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 1.0f, Math::MACHINE_EPSILON_0, TEST_LOCATION ); // Check enabled property. popup.SetDisplayState( Popup::SHOWN ); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( backing.GetCurrentOpacity(), 0.5f, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + DALI_TEST_EQUALS( backing.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.5f, Math::MACHINE_EPSILON_0, TEST_LOCATION ); popup.SetDisplayState( Popup::HIDDEN ); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( backing.GetCurrentOpacity(), 0.0f, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + DALI_TEST_EQUALS( backing.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.0f, Math::MACHINE_EPSILON_0, TEST_LOCATION ); popup.SetProperty( Popup::Property::BACKING_ENABLED, false ); bool propertyResult; @@ -989,13 +994,13 @@ int UtcDaliPopupPropertyBacking(void) application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( backing.GetCurrentOpacity(), 0.0f, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + DALI_TEST_EQUALS( backing.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.0f, Math::MACHINE_EPSILON_0, TEST_LOCATION ); popup.SetDisplayState( Popup::HIDDEN ); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( backing.GetCurrentOpacity(), 0.0f, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + DALI_TEST_EQUALS( backing.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.0f, Math::MACHINE_EPSILON_0, TEST_LOCATION ); // Check color property. popup.SetProperty( Popup::Property::BACKING_ENABLED, true ); @@ -1092,7 +1097,7 @@ int UtcDaliPopupPropertyCustomAnimation(void) } // Test the popup has animated to it's entry-transition destination. - DALI_TEST_EQUALS( popupContainer.GetCurrentWorldPosition(), entryAnimationDestination, 0.1f, TEST_LOCATION ); + DALI_TEST_EQUALS( popupContainer.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), entryAnimationDestination, 0.1f, TEST_LOCATION ); popup.SetDisplayState( Popup::HIDDEN ); @@ -1102,7 +1107,7 @@ int UtcDaliPopupPropertyCustomAnimation(void) application.Render( RENDER_FRAME_INTERVAL ); } - DALI_TEST_EQUALS( popupContainer.GetCurrentWorldPosition(), exitAnimationDestination, 0.1f, TEST_LOCATION ); + DALI_TEST_EQUALS( popupContainer.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), exitAnimationDestination, 0.1f, TEST_LOCATION ); END_TEST; } @@ -1124,15 +1129,15 @@ int UtcDaliPopupPropertyTouchTransparent(void) TextLabel content = TextLabel::New( "text" ); popup.SetContent( content ); popup.SetProperty( Popup::Property::ANIMATION_DURATION, 0.0f ); - popup.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - popup.SetParentOrigin( ParentOrigin::TOP_LEFT ); + popup.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + popup.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); popup.SetSize( 100, 100 ); popup.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); // Create a button (to go underneath the popup). PushButton button = Toolkit::PushButton::New(); - button.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - button.SetParentOrigin( ParentOrigin::TOP_LEFT ); + button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); button.SetSize( 100, 100 ); button.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); @@ -1195,8 +1200,8 @@ int UtcDaliPopupPropertyTail(void) // Create the Popup actor Popup popup = Popup::New(); - popup.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - popup.SetParentOrigin( ParentOrigin::TOP_LEFT ); + popup.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + popup.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); popup.SetSize( 100, 100 ); popup.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); TextLabel content = TextLabel::New( "text" ); @@ -1239,9 +1244,9 @@ int UtcDaliPopupPropertyTail(void) tailActor = popup.FindChildByName( "tailImage" ); DALI_TEST_CHECK( tailActor ); - float baseValX = tailActor.GetCurrentWorldPosition().x; + float baseValX = tailActor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).x; - DALI_TEST_GREATER( baseValX, tailActor.GetCurrentWorldPosition().y, TEST_LOCATION ); + DALI_TEST_GREATER( baseValX, tailActor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).y, TEST_LOCATION ); popup.SetDisplayState( Popup::HIDDEN ); application.SendNotification(); @@ -1256,8 +1261,8 @@ int UtcDaliPopupPropertyTail(void) tailActor = popup.FindChildByName( "tailImage" ); DALI_TEST_CHECK( tailActor ); - float baseValY = tailActor.GetCurrentWorldPosition().y; - DALI_TEST_GREATER( baseValX, tailActor.GetCurrentWorldPosition().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 ); application.SendNotification(); @@ -1271,8 +1276,8 @@ int UtcDaliPopupPropertyTail(void) application.Render(); tailActor = popup.FindChildByName( "tailImage" ); DALI_TEST_CHECK( tailActor ); - DALI_TEST_EQUALS( tailActor.GetCurrentWorldPosition().x, baseValX, TEST_LOCATION ); - DALI_TEST_GREATER( tailActor.GetCurrentWorldPosition().y, baseValY, TEST_LOCATION ); + 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 ); application.SendNotification(); @@ -1286,8 +1291,8 @@ int UtcDaliPopupPropertyTail(void) application.Render(); tailActor = popup.FindChildByName( "tailImage" ); DALI_TEST_CHECK( tailActor ); - DALI_TEST_GREATER( tailActor.GetCurrentWorldPosition().x, baseValX, TEST_LOCATION ); - DALI_TEST_EQUALS( tailActor.GetCurrentWorldPosition().y, baseValY, TEST_LOCATION ); + 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 ); application.SendNotification(); @@ -1432,7 +1437,7 @@ int UtcDaliPopupOnKeyEvent(void) popup.SetKeyInputFocus(); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Down, "", DevelDevice::Class::TOUCH, DevelDevice::Subclass::NONE ) ); + application.ProcessEvent( GenerateKey( "", "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Down, "", "", Device::Class::TOUCH, Device::Subclass::NONE ) ); application.SendNotification(); application.Render();