X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Fdali-toolkit-test-utils%2Fdummy-control.cpp;h=7ca109cec9d8b2423a10134b5d1f4c4dac78ac02;hp=96699ecbba9694df90fd602a7fd4a34cb4165414;hb=ca99959003c0445d5afb437e2be26361dff51623;hpb=14a48afd7d9b5ba7bd8c8ebc69b214be8310613a diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp index 96699ec..7ca109c 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 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. @@ -93,7 +93,7 @@ DummyControl DummyControlImpl::New() } DummyControlImpl::DummyControlImpl() -: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_HOVER_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ), +: Control( ControlBehaviour( REQUIRES_STYLE_CHANGE_SIGNALS ) ), mCustomSlot1Called(false) { } @@ -188,7 +188,17 @@ void DummyControlImpl::SetProperty( BaseObject* object, Dali::Property::Index in Property::Value DummyControlImpl::GetProperty( BaseObject* object, Dali::Property::Index propertyIndex ) { - Dali::Property::Value value; + Toolkit::DummyControl control = Toolkit::DummyControl::DownCast( Dali::BaseHandle( object ) ); + DummyControlImpl& dummyImpl = static_cast( control.GetImplementation() ); + + Visual::Base visual = dummyImpl.GetVisual( propertyIndex ); + Property::Map map; + if( visual ) + { + visual.CreatePropertyMap( map ); + } + Dali::Property::Value value = map; + return value; } @@ -201,12 +211,13 @@ Toolkit::DummyControl Impl::DummyControl::New() return control; } +int Impl::DummyControl::constructorCount; +int Impl::DummyControl::destructorCount; Impl::DummyControl::DummyControl() : DummyControlImpl(), initializeCalled(false), activatedCalled(false), - onAccTouchedCalled(false), onAccValueChangeCalled(false), themeChangeCalled(false), fontChangeCalled(false), @@ -220,21 +231,22 @@ Impl::DummyControl::DummyControl() childRemoveCalled(false), sizeSetCalled(false), sizeAnimationCalled(false), - touchEventCalled(false), hoverEventCalled(false), wheelEventCalled(false), keyEventCalled(false), keyInputFocusGained(false), keyInputFocusLost(false) { + ++constructorCount; } -Impl::DummyControl::~DummyControl() { } - +Impl::DummyControl::~DummyControl() +{ + ++destructorCount; +} void Impl::DummyControl::OnInitialize() { initializeCalled = true; } bool Impl::DummyControl::OnAccessibilityActivated() { activatedCalled = true; return true; } -bool Impl::DummyControl::OnAccessibilityTouch(const TouchEvent& touchEvent) { onAccTouchedCalled = true; return true; } bool Impl::DummyControl::OnAccessibilityValueChange( bool isIncrease ) { onAccValueChangeCalled = true; return true; @@ -249,15 +261,12 @@ void Impl::DummyControl::OnPinch(const PinchGesture& pinch) { pinchCalled = true void Impl::DummyControl::OnPan(const PanGesture& pan) { panCalled = true; } void Impl::DummyControl::OnTap(const TapGesture& tap) { tapCalled = true; } void Impl::DummyControl::OnLongPress(const LongPressGesture& longPress) { longPressCalled = true; } -void Impl::DummyControl::OnStageConnection( int depth ) { Control::OnStageConnection( depth ); stageConnectionCalled = true; } -void Impl::DummyControl::OnStageDisconnection() { stageDisconnectionCalled = true; Control::OnStageDisconnection(); } +void Impl::DummyControl::OnSceneConnection( int depth ) { Control::OnSceneConnection( depth ); stageConnectionCalled = true; } +void Impl::DummyControl::OnSceneDisconnection() { stageDisconnectionCalled = true; Control::OnSceneDisconnection(); } void Impl::DummyControl::OnChildAdd(Actor& child) { childAddCalled = true; } void Impl::DummyControl::OnChildRemove(Actor& child) { childRemoveCalled = true; } void Impl::DummyControl::OnSizeSet(const Vector3& targetSize) { Control::OnSizeSet( targetSize ); sizeSetCalled = true; } void Impl::DummyControl::OnSizeAnimation(Animation& animation, const Vector3& targetSize) { Control::OnSizeAnimation( animation, targetSize ); sizeAnimationCalled = true; } -bool Impl::DummyControl::OnTouchEvent(const TouchEvent& event) { touchEventCalled = true; return false; } -bool Impl::DummyControl::OnHoverEvent(const HoverEvent& event) { hoverEventCalled = true; return false; } -bool Impl::DummyControl::OnWheelEvent(const WheelEvent& event) { wheelEventCalled = true; return false; } bool Impl::DummyControl::OnKeyEvent(const KeyEvent& event) { keyEventCalled = true; return false;} void Impl::DummyControl::OnKeyInputFocusGained() { keyInputFocusGained = true; } void Impl::DummyControl::OnKeyInputFocusLost() { keyInputFocusLost = true; }