#!/bin/bash
-TEMP=`getopt -o dhsSm --long debug,help,serial,tct,modules -n 'execute.sh' -- "$@"`
+TEMP=`getopt -o hsSm --long help,serial,tct,modules -n 'execute.sh' -- "$@"`
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
function usage
{
- echo -e "Usage: execute.sh [-d][-s|-S|-r] [module|testcase]"
+ echo -e "Usage: execute.sh [-s|-S|-r] [module|testcase]"
echo -e " execute.sh\t\tExecute test cases from all modules in parallel"
- echo -e " execute.sh -d <testcase>\tDebug testcase"
echo -e " execute.sh [module]\tExecute test cases from the given module in parallel"
echo -e " execute.sh -s [module]\t\tExecute test cases in serial using Testkit-Lite"
echo -e " execute.sh -S [module]\t\tExecute test cases in serial"
opt_tct=0
opt_serial=""
opt_modules=0
-opt_debug=0
while true ; do
case "$1" in
-h|--help) usage ;;
- -d|--debug) opt_debug=1 ; shift ;;
-s|--tct) opt_tct=1 ; shift ;;
-S|--serial) opt_serial="-s" ; shift ;;
-m|--modules) opt_modules=1 ; shift ;;
summary_end
else
- # First argument is not an executable. Is it a test case name?
- # Try executing each executable with the test case name until success/known failure
+ # First argument is not an executable. Is it a test case name?
+ # Try executing each executable with the test case name until success/known failure
for mod in $modules
do
output=`build/src/$mod/tct-$mod-core $1`
ret=$?
if [ $ret -ne 6 ] ; then
- if [ $opt_debug -ne 0 ] ; then
- if [ $ret -eq 0 ] ; then
- gdb --args build/src/$mod/tct-$mod-core $1
- fi
- else
- echo $output
- if [ $ret -eq 0 ] ; then echo -e "\nPassed" ; fi
- fi
- exit $ret
+ echo $output
+ if [ $ret -eq 0 ] ; then echo -e "\nPassed" ; fi
+ exit $ret
fi
done
echo $1 not found
: DummyControlImpl(),
initializeCalled(false),
activatedCalled(false),
- onAccTouchedCalled(false),
- onAccValueChangeCalled(false),
- themeChangeCalled(false),
- fontChangeCalled(false),
+ themeChangeCalled( false ),
+ fontChangeCalled( false ),
pinchCalled(false),
panCalled(false),
tapCalled(false),
void DummyControlImplOverride::OnInitialize() { initializeCalled = true; }
bool DummyControlImplOverride::OnAccessibilityActivated() { activatedCalled = true; return true; }
-bool DummyControlImplOverride::OnAccessibilityTouch(const TouchEvent& touchEvent) { onAccTouchedCalled = true; return true; }
-bool DummyControlImplOverride::OnAccessibilityValueChange( bool isIncrease )
-{
- onAccValueChangeCalled = true; return true;
-}
-
void DummyControlImplOverride::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change )
{
themeChangeCalled = change == StyleChange::THEME_CHANGE;
virtual void OnInitialize();
virtual bool OnAccessibilityActivated();
- virtual bool OnAccessibilityTouch( const TouchEvent& touchEvent );
- virtual bool OnAccessibilityValueChange( bool isIncrease );
-
virtual void OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change );
virtual void OnPinch(const PinchGesture& pinch);
virtual void OnPan(const PanGesture& pan);
bool initializeCalled;
bool activatedCalled;
- bool onAccTouchedCalled;
- bool onAccValueChangeCalled;
bool themeChangeCalled;
bool fontChangeCalled;
bool pinchCalled;
*
*/
+#include "toolkit-accessibility-adaptor.h"
+
+#include <dali/public-api/object/base-object.h>
#include <dali/public-api/object/base-object.h>
-#include <dali/integration-api/events/pan-gesture-event.h>
-#include <dali/devel-api/adaptor-framework/accessibility-adaptor.h>
#include <dali/devel-api/adaptor-framework/accessibility-action-handler.h>
-#include <dali/devel-api/adaptor-framework/accessibility-gesture-handler.h>
namespace Dali
{
void MockSetReadPosition( Vector2& position );
- void SetEnabled(bool enabled)
- {
- mIsEnabled = enabled;
- }
-
- void SendPanGesture( const Dali::Integration::PanGestureEvent& panEvent );
-
public:
bool IsEnabled() const;
Vector2 GetReadPosition() const;
- bool HandleActionNextEvent(bool);
- bool HandleActionPreviousEvent(bool);
+ bool HandleActionNextEvent();
+ bool HandleActionPreviousEvent();
bool HandleActionActivateEvent();
bool HandleActionReadEvent(unsigned int x, unsigned int y, bool allowReadAgain);
- bool HandleActionReadNextEvent(bool);
- bool HandleActionReadPreviousEvent(bool);
+ bool HandleActionReadNextEvent();
+ bool HandleActionReadPreviousEvent();
bool HandleActionUpEvent();
bool HandleActionDownEvent();
bool HandleActionClearFocusEvent();
- bool HandleActionScrollEvent(const TouchPoint& point, unsigned long timeStamp);
- bool HandleActionTouchEvent(const TouchPoint& point, unsigned long timeStamp);
+ bool HandleActionScrollEvent(TouchPoint& point, unsigned long timeStamp);
bool HandleActionBackEvent();
bool HandleActionEnableEvent();
bool HandleActionDisableEvent();
bool HandleActionReadPauseResumeEvent();
bool HandleActionStartStopEvent();
+public: // Signals
+
private:
bool mIsEnabled;
return mIsEnabled;
}
-void AccessibilityAdaptor::SendPanGesture( const Integration::PanGestureEvent& panEvent )
-{
- mGestureHandler->HandlePanGesture( panEvent );
-}
-
void AccessibilityAdaptor::SetActionHandler(Dali::AccessibilityActionHandler& handler)
{
mActionHandler = &handler;
mGestureHandler = &handler;
}
-bool AccessibilityAdaptor::HandleActionNextEvent(bool allowEndFeedback)
+bool AccessibilityAdaptor::HandleActionNextEvent()
{
if( mActionHandler )
{
return false;
}
-bool AccessibilityAdaptor::HandleActionPreviousEvent(bool allowEndFeedback)
+bool AccessibilityAdaptor::HandleActionPreviousEvent()
{
if( mActionHandler )
{
return false;
}
-bool AccessibilityAdaptor::HandleActionReadNextEvent(bool allowEndFeedback)
+bool AccessibilityAdaptor::HandleActionReadNextEvent()
{
if( mActionHandler )
{
return false;
}
-bool AccessibilityAdaptor::HandleActionReadPreviousEvent(bool allowEndFeedback)
+bool AccessibilityAdaptor::HandleActionReadPreviousEvent()
{
if( mActionHandler )
{
return false;
}
-bool AccessibilityAdaptor::HandleActionScrollEvent(const TouchPoint& point, unsigned long timeStamp)
+bool AccessibilityAdaptor::HandleActionScrollEvent(TouchPoint& point, unsigned long timeStamp)
{
if( mActionHandler )
{
return false;
}
-bool AccessibilityAdaptor::HandleActionTouchEvent(const TouchPoint& point, unsigned long timeStamp)
-{
- if( mActionHandler )
- {
- Dali::TouchEvent touchEvent;
- touchEvent.points.push_back( point );
- return mActionHandler->AccessibilityActionTouch( touchEvent );
- }
- return false;
-}
-
bool AccessibilityAdaptor::HandleActionBackEvent()
{
if( mActionHandler )
{
}
+// Mock setup:
+
+void AccessibilityAdaptor::MockSetReadPosition( Vector2& position )
+{
+ Internal::Adaptor::GetImplementation(*this).MockSetReadPosition( position );
+}
+
// Methods:
Vector2 AccessibilityAdaptor::GetReadPosition() const
bool AccessibilityAdaptor::IsEnabled() const
{
- return Internal::Adaptor::GetImplementation(*this).IsEnabled();
+ //return Internal::Adaptor::GetImplementation(*this).IsEnabled();
+ return false;
}
void AccessibilityAdaptor::SetActionHandler(AccessibilityActionHandler& handler)
Internal::Adaptor::GetImplementation(*this).SetGestureHandler(handler);
}
-bool AccessibilityAdaptor::HandleActionNextEvent(bool allowEndFeedback)
+bool AccessibilityAdaptor::HandleActionNextEvent()
{
- return Internal::Adaptor::GetImplementation(*this).HandleActionNextEvent(allowEndFeedback);
+ return Internal::Adaptor::GetImplementation(*this).HandleActionNextEvent();
}
-bool AccessibilityAdaptor::HandleActionPreviousEvent(bool allowEndFeedback)
+bool AccessibilityAdaptor::HandleActionPreviousEvent()
{
- return Internal::Adaptor::GetImplementation(*this).HandleActionPreviousEvent(allowEndFeedback);
+ return Internal::Adaptor::GetImplementation(*this).HandleActionPreviousEvent();
}
bool AccessibilityAdaptor::HandleActionActivateEvent()
return Internal::Adaptor::GetImplementation(*this).HandleActionReadEvent( x, y, allowReadAgain );
}
-bool AccessibilityAdaptor::HandleActionReadNextEvent(bool allowEndFeedback)
+bool AccessibilityAdaptor::HandleActionReadNextEvent()
{
- return Internal::Adaptor::GetImplementation(*this).HandleActionReadNextEvent(allowEndFeedback);
+ return Internal::Adaptor::GetImplementation(*this).HandleActionReadNextEvent();
}
-bool AccessibilityAdaptor::HandleActionReadPreviousEvent(bool allowEndFeedback)
+bool AccessibilityAdaptor::HandleActionReadPreviousEvent()
{
- return Internal::Adaptor::GetImplementation(*this).HandleActionReadPreviousEvent(allowEndFeedback);
+ return Internal::Adaptor::GetImplementation(*this).HandleActionReadPreviousEvent();
}
bool AccessibilityAdaptor::HandleActionUpEvent()
return Internal::Adaptor::GetImplementation(*this).HandleActionClearFocusEvent();
}
-bool AccessibilityAdaptor::HandleActionScrollEvent(const TouchPoint& point, unsigned long timeStamp)
+bool AccessibilityAdaptor::HandleActionScrollEvent(TouchPoint& point, unsigned long timeStamp)
{
return Internal::Adaptor::GetImplementation(*this).HandleActionScrollEvent(point, timeStamp);
}
-bool AccessibilityAdaptor::HandleActionTouchEvent(const TouchPoint& point, unsigned long timeStamp)
-{
- return Internal::Adaptor::GetImplementation(*this).HandleActionTouchEvent(point, timeStamp);
-}
-
bool AccessibilityAdaptor::HandleActionBackEvent()
{
return Internal::Adaptor::GetImplementation(*this).HandleActionBackEvent();
}
} // namespace Dali
-
-
-namespace Test
-{
-namespace AccessibilityAdaptor
-{
-
-// Mock setup:
-
-void MockSetReadPosition( Dali::AccessibilityAdaptor adaptor, Dali::Vector2& position )
-{
- Dali::Internal::Adaptor::GetImplementation(adaptor).MockSetReadPosition( position );
-}
-
-void SetEnabled( Dali::AccessibilityAdaptor adaptor, bool enabled )
-{
- Dali::Internal::Adaptor::GetImplementation(adaptor).SetEnabled(enabled);
-}
-
-void SendPanGesture( Dali::AccessibilityAdaptor adaptor, const Dali::Integration::PanGestureEvent& panEvent )
-{
- Dali::Internal::Adaptor::GetImplementation(adaptor).SendPanGesture( panEvent );
-}
-
-} // namespace AccessibilityAdaptor
-} // namespace Test
-#ifndef __DALI_TEST_TOOLKIT_ACCESSIBILITY_ADAPTOR_H__
-#define __DALI_TEST_TOOLKIT_ACCESSIBILITY_ADAPTOR_H__
+// Prevent normal accessibility adaptor declaration from loading
+#define __DALI_ACCESSIBILITY_ADAPTOR_H__
+
+#ifndef __DALI_TOOLKIT_ACCESSIBILITY_ADAPTOR_H__
+#define __DALI_TOOLKIT_ACCESSIBILITY_ADAPTOR_H__
/*
- * Copyright (c) 2016 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.
*/
// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/accessibility-adaptor.h>
-#include <dali/integration-api/events/pan-gesture-event.h>
+#include <string>
+#include <dali/public-api/object/base-handle.h>
+#include <dali/public-api/events/touch-point.h>
-namespace Test
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
{
-namespace AccessibilityAdaptor
+class AccessibilityAdaptor;
+}
+}
+class AccessibilityActionHandler;
+class AccessibilityGestureHandler;
+class TouchPoint;
+
+/**
+ * This creates a stubbed AccessibilityAdaptor so that internal Toolkit Adaptor calls work.
+ */
+class AccessibilityAdaptor : public BaseHandle
{
+public: // Construction & Destruction
+ AccessibilityAdaptor();
+ ~AccessibilityAdaptor();
+
+public: // Mock object setup.
+
+ void MockSetReadPosition( Vector2& position );
+
+public: // Getters
+
+ static AccessibilityAdaptor Get();
+
+ Vector2 GetReadPosition() const;
+ bool IsEnabled() const;
+ void SetActionHandler(AccessibilityActionHandler& handler);
+ void SetGestureHandler(AccessibilityGestureHandler& handler);
+
+ bool HandleActionNextEvent();
+ bool HandleActionPreviousEvent();
+ bool HandleActionActivateEvent();
+ bool HandleActionReadEvent(unsigned int x, unsigned int y, bool allowReadAgain);
+ bool HandleActionReadNextEvent();
+ bool HandleActionReadPreviousEvent();
+ bool HandleActionUpEvent();
+ bool HandleActionDownEvent();
+ bool HandleActionClearFocusEvent();
+ bool HandleActionScrollEvent(TouchPoint& point, unsigned long timeStamp);
+ bool HandleActionBackEvent();
+ void HandleActionEnableEvent();
+ void HandleActionDisableEvent();
+ bool HandleActionScrollUpEvent();
+ bool HandleActionScrollDownEvent();
+ bool HandleActionPageLeftEvent();
+ bool HandleActionPageRightEvent();
+ bool HandleActionPageUpEvent();
+ bool HandleActionPageDownEvent();
+ bool HandleActionMoveToFirstEvent();
+ bool HandleActionMoveToLastEvent();
+ bool HandleActionReadFromTopEvent();
+ bool HandleActionReadFromNextEvent();
+ bool HandleActionZoomEvent();
+ bool HandleActionReadIndicatorInformationEvent();
+ bool HandleActionReadPauseResumeEvent();
+ bool HandleActionStartStopEvent();
-void MockSetReadPosition( Dali::AccessibilityAdaptor adaptor, Dali::Vector2& position );
-void SetEnabled( Dali::AccessibilityAdaptor adaptor, bool enabled);
-void SendPanGesture( Dali::AccessibilityAdaptor adaptor, const Dali::Integration::PanGestureEvent& panEvent );
+ AccessibilityAdaptor( Internal::Adaptor::AccessibilityAdaptor* adaptor );
+};
-} // namespace AccessibilityAdaptor
-} // namespace Test
+} // namespace Dali
-#endif //
+#endif // __DALI_TOOLKIT_ACCESSIBILITY_ADAPTOR_H__
+#include "toolkit-tts-player.h"
+
/*
* Copyright (c) 2015 Samsung Electronics Co., Ltd.
*
*/
// EXTERNAL INCLUDES
-#include <dali/dali.h>
-
+#include <dali/public-api/object/base-handle.h>
+#include <dali/public-api/signals/dali-signal.h>
namespace Dali
{
{
}
-namespace Internal
-{
-namespace Adaptor
-{
-
-class TtsPlayer : public BaseObject
-{
-public:
- TtsPlayer()
- {
- }
-
- void Play(const std::string& text)
- {
- }
-
- void Stop()
- {
- }
-
- void Pause()
- {
- }
-
- void Resume()
- {
- }
-
- Dali::TtsPlayer::State GetState()
- {
- return Dali::TtsPlayer::READY;
- }
-
- Dali::TtsPlayer::StateChangedSignalType& StateChangedSignal()
- {
- return mStateChangedSignal;
- }
-private:
- Dali::TtsPlayer::StateChangedSignalType mStateChangedSignal;
-};
-
-
-inline TtsPlayer& GetImplementation(Dali::TtsPlayer& player)
-{
- DALI_ASSERT_ALWAYS( player && "TtsPlayer handle is empty" );
- BaseObject& handle = player.GetBaseObject();
- return static_cast<Internal::Adaptor::TtsPlayer&>(handle);
-}
-
-inline const TtsPlayer& GetImplementation(const Dali::TtsPlayer& player)
-{
- DALI_ASSERT_ALWAYS( player && "TtsPlayer handle is empty" );
- const BaseObject& handle = player.GetBaseObject();
- return static_cast<const Internal::Adaptor::TtsPlayer&>(handle);
-}
-
-} // Adaptor
-} // Internal
-
-static IntrusivePtr<Internal::Adaptor::TtsPlayer> ttsSingleton = NULL;
-
TtsPlayer TtsPlayer::Get(Dali::TtsPlayer::Mode mode)
{
- if( ! ttsSingleton )
- {
- ttsSingleton.Reset( new Dali::Internal::Adaptor::TtsPlayer() );
- }
- TtsPlayer playerHandle(ttsSingleton.Get());
+ TtsPlayer ttsPlayer;
- return playerHandle;
+ return ttsPlayer;
}
TtsPlayer::~TtsPlayer()
TtsPlayer::StateChangedSignalType& TtsPlayer::StateChangedSignal()
{
- return Internal::Adaptor::GetImplementation(*this).StateChangedSignal();
-}
-
-TtsPlayer::TtsPlayer( Internal::Adaptor::TtsPlayer* player )
-: BaseHandle( player )
-{
+ return mStateChangedSignal; // GetImplementation(*this).StateChangedSignal();
}
} // namespace Dali
--- /dev/null
+#ifndef __DALI_TOOLKIT_TTS_PLAYER_H__
+#define __DALI_TOOLKIT_TTS_PLAYER_H__
+
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/base-handle.h>
+#include <dali/public-api/signals/dali-signal.h>
+
+namespace Dali
+{
+
+namespace Internal DALI_INTERNAL
+{
+namespace Adaptor
+{
+class TtsPlayer;
+}
+}
+
+class DALI_IMPORT_API TtsPlayer : public BaseHandle
+{
+public:
+
+ enum Mode
+ {
+ DEFAULT = 0, ///< Default mode for normal application
+ NOTIFICATION, ///< Notification mode
+ SCREEN_READER, ///< Screen reader mode
+ MODE_NUM
+ };
+
+ enum State
+ {
+ UNAVAILABLE = 0, ///< Player is not available
+ READY, ///< Player is ready to play
+ PLAYING, ///< Player is playing
+ PAUSED ///< Player is paused
+ };
+
+ typedef Signal< void ( const Dali::TtsPlayer::State, const Dali::TtsPlayer::State ) > StateChangedSignalType;
+
+ TtsPlayer();
+ static TtsPlayer Get(Dali::TtsPlayer::Mode mode = Dali::TtsPlayer::DEFAULT);
+ ~TtsPlayer();
+
+ TtsPlayer(const TtsPlayer& handle);
+ TtsPlayer& operator=(const TtsPlayer& rhs);
+ void Play(const std::string& text);
+ void Stop();
+ void Pause();
+ void Resume();
+ State GetState();
+ Dali::TtsPlayer::StateChangedSignalType& StateChangedSignal();
+
+public:
+
+ // explicit DALI_INTERNAL TtsPlayer( Internal::Adaptor::TtsPlayer* ttsPlayer );
+
+private:
+
+ StateChangedSignalType mStateChangedSignal;
+};
+
+} // namespace Dali
+
+#endif // __DALI_TOOLKIT_TTS_PLAYER_H__
#include <iostream>
#include <stdlib.h>
-#include <dali-toolkit/dali-toolkit.h>
-
+// Need to override adaptor classes for toolkit test harness, so include
+// test harness headers before dali headers.
#include <dali-toolkit-test-suite-utils.h>
#include <toolkit-accessibility-adaptor.h>
-#include <dummy-control.h>
+
+#include <dali-toolkit/dali-toolkit.h>
using namespace Dali;
using namespace Toolkit;
// make sure the change of focus order doesn't affect the actor's description
DALI_TEST_CHECK(manager.GetAccessibilityAttribute(second, AccessibilityManager::ACCESSIBILITY_LABEL) == "second");
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
// Set the focus order and description for the third actor
Actor third = Actor::New();
manager.SetFocusOrder(third, 1);
DALI_TEST_CHECK(manager.GetActorByFocusOrder(2) == second);
DALI_TEST_CHECK(manager.GetActorByFocusOrder(3) == third);
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
// Change the focus order of the third actor to 1
manager.SetFocusOrder(third, 1);
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK(manager);
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
// Create the first actor and add it to the stage
Actor first = Actor::New();
manager.SetFocusOrder(first, 1);
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK(manager);
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
// Create an actor with two child actors and add it to the stage
Actor parent = Actor::New();
Actor firstChild = Actor::New();
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK(manager);
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
Actor first = Actor::New();
Stage::GetCurrent().Add(first);
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK(manager);
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
Actor first = Actor::New();
Stage::GetCurrent().Add(first);
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK(manager);
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
Actor first = Actor::New();
Stage::GetCurrent().Add(first);
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK(manager);
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
// Create the first actor and add it to the stage
Actor first = Actor::New();
manager.SetFocusOrder(first, 1);
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK(manager);
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
// Create an actor with two child actors and add it to the stage
Actor parent = Actor::New();
Actor firstChild = Actor::New();
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK(manager);
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
bool signalVerified = false;
FocusOvershotCallback callback(signalVerified);
manager.FocusOvershotSignal().Connect(&callback, &FocusOvershotCallback::Callback);
AccessibilityManagerSignalHandler callback;
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK( manager );
AccessibilityManagerSignalHandler callback;
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK( manager );
AccessibilityManagerSignalHandler callback;
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK( manager );
AccessibilityManagerSignalHandler callback;
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK( manager );
AccessibilityManagerSignalHandler callback;
- Dali::AccessibilityAdaptor accessibilityAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accessibilityAdaptor, true );
- accessibilityAdaptor.HandleActionEnableEvent();
-
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK( manager );
manager.ActionUpSignal().Connect( &callback, &AccessibilityManagerSignalHandler::Callback );
- DummyControl dummyControl = DummyControl::New(true);
- dummyControl.SetSize(480, 800);
- manager.SetFocusOrder( dummyControl, 1 );
- Stage::GetCurrent().Add( dummyControl );
- manager.SetCurrentFocusActor( dummyControl );
-
+ Dali::AccessibilityAdaptor accessibilityAdaptor = Dali::AccessibilityAdaptor::Get();
accessibilityAdaptor.HandleActionUpEvent();
DALI_TEST_EQUALS( callback.GetCalls(), 1u, TEST_LOCATION );
AccessibilityManagerSignalHandler callback;
- Dali::AccessibilityAdaptor accessibilityAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accessibilityAdaptor, true );
- accessibilityAdaptor.HandleActionEnableEvent();
-
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK( manager );
manager.ActionDownSignal().Connect( &callback, &AccessibilityManagerSignalHandler::Callback );
- DummyControl dummyControl = DummyControl::New(true);
- dummyControl.SetSize(480, 800);
- manager.SetFocusOrder( dummyControl, 1 );
- Stage::GetCurrent().Add( dummyControl );
- manager.SetCurrentFocusActor( dummyControl );
-
+ Dali::AccessibilityAdaptor accessibilityAdaptor = Dali::AccessibilityAdaptor::Get();
accessibilityAdaptor.HandleActionDownEvent();
DALI_TEST_EQUALS( callback.GetCalls(), 1u, TEST_LOCATION );
AccessibilityManagerSignalHandler callback;
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK( manager );
AccessibilityManagerSignalHandler callback;
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK( manager );
AccessibilityManagerSignalHandler callback;
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK( manager );
AccessibilityManagerSignalHandler callback;
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK( manager );
AccessibilityManagerSignalHandler callback;
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK( manager );
AccessibilityManagerSignalHandler callback;
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK( manager );
AccessibilityManagerSignalHandler callback;
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK( manager );
AccessibilityManagerSignalHandler callback;
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK( manager );
AccessibilityManagerSignalHandler callback;
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK( manager );
AccessibilityManagerSignalHandler callback;
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK( manager );
AccessibilityManagerSignalHandler callback;
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK( manager );
AccessibilityManagerSignalHandler callback;
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK( manager );
AccessibilityManagerSignalHandler callback;
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK( manager );
AccessibilityManagerSignalHandler callback;
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK( manager );
AccessibilityManagerSignalHandler callback;
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK( manager );
AccessibilityManagerSignalHandler callback;
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK( manager );
AccessibilityManagerSignalHandler callback;
- Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
- Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
- accAdaptor.HandleActionEnableEvent();
-
AccessibilityManager manager = AccessibilityManager::Get();
DALI_TEST_CHECK( manager );
END_TEST;
}
-
-int UtcDaliAccessibilityManagerActionTouch(void)
-{
- ToolkitTestApplication application;
- tet_infoline( " UtcDaliAccessibilityManagerActionTouch" );
-
- AccessibilityManager manager = AccessibilityManager::Get();
- DALI_TEST_CHECK( manager );
-
- Dali::AccessibilityAdaptor accessibilityAdaptor = Dali::AccessibilityAdaptor::Get();
-
- DummyControl dummyControl = DummyControl::New(true);
- DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummyControl.GetImplementation());
- dummyControl.SetSize(480, 800);
- manager.SetFocusOrder( dummyControl, 1 );
- Stage::GetCurrent().Add( dummyControl );
- manager.SetCurrentFocusActor( dummyControl );
-
- TouchPoint point( 0, TouchPoint::Started, 100.0f, 200.0f );
- accessibilityAdaptor.HandleActionTouchEvent( point, 0u );
-
- DALI_TEST_CHECK( dummyImpl.onAccTouchedCalled );
-
- END_TEST;
-}
-
-
-int UtcDaliAccessibilityManagerHandlePanGesture(void)
-{
- // Pan gesture sent from adaptor to manager via AccessibilityGestureHandler
- // Adaptor.SetGestureHandler is called in Initialize (check it's the toolkit version)
- ToolkitTestApplication application;
- tet_infoline( " UtcDaliAccessibilityManagerHandlePanGesture" );
-
- AccessibilityManager manager = AccessibilityManager::Get();
- DALI_TEST_CHECK( manager );
-
- Dali::AccessibilityAdaptor accessibilityAdaptor = Dali::AccessibilityAdaptor::Get();
- DummyControl dummyControl = DummyControl::New(true);
- dummyControl.SetSize(480, 800);
- Stage::GetCurrent().Add( dummyControl );
-
- Dali::Integration::PanGestureEvent panGestureEvent(Gesture::Started);
- panGestureEvent.previousPosition = Vector2(0.f, 0.f);
- panGestureEvent.currentPosition = Vector2(100.f, 0.f);
- panGestureEvent.timeDelta = 16;
- panGestureEvent.numberOfTouches = 1;
-
- Test::AccessibilityAdaptor::SendPanGesture( accessibilityAdaptor, panGestureEvent );
-
- panGestureEvent.state = Gesture::Continuing;
- panGestureEvent.previousPosition = Vector2(100.f, 0.f);
- panGestureEvent.currentPosition = Vector2(200.f, 0.f);
- Test::AccessibilityAdaptor::SendPanGesture( accessibilityAdaptor, panGestureEvent );
-
- panGestureEvent.state = Gesture::Finished;
- panGestureEvent.previousPosition = Vector2(200.f, 0.f);
- panGestureEvent.currentPosition = Vector2(300.f, 0.f);
- Test::AccessibilityAdaptor::SendPanGesture( accessibilityAdaptor, panGestureEvent );
-
-
- END_TEST;
-}
-
-// Methods missing coverage:
-// IsActorFocusableFunction
-// DoActivate
-// SetFocusable
-// TtsStateChanged
return false;
}
-struct CallbackFunctor
-{
- CallbackFunctor(bool* callbackFlag)
- : mCallbackFlag( callbackFlag )
- {
- }
-
- void operator()()
- {
- *mCallbackFlag = true;
- }
- bool* mCallbackFlag;
-};
-
-
Image CreateSolidColorImage( const Vector4& color, unsigned int width, unsigned int height )
{
BufferImage imageData = BufferImage::New( width, height, Pixel::RGBA8888 );
application.Render();
// connect to its touch signal
- ConnectionTracker* testTracker = new ConnectionTracker();
button.PressedSignal().Connect( &ButtonCallback );
button.ReleasedSignal().Connect( &ButtonCallback );
- bool pressedSignal = false;
- bool releasedSignal = false;
- button.ConnectSignal( testTracker, "pressed", CallbackFunctor(&pressedSignal) );
- button.ConnectSignal( testTracker, "released", CallbackFunctor(&releasedSignal) );
Dali::Integration::TouchEvent event;
application.ProcessEvent( event );
DALI_TEST_CHECK( gIsCalledButtonCallback );
- DALI_TEST_CHECK( pressedSignal );
gIsCalledButtonCallback = false;
event = Dali::Integration::TouchEvent();
application.ProcessEvent( event );
DALI_TEST_CHECK( gIsCalledButtonCallback );
- DALI_TEST_CHECK( releasedSignal );
// Test2. Touch point down and up outside the button.
- pressedSignal = false;
- releasedSignal = false;
gIsCalledButtonCallback = false;
event = Dali::Integration::TouchEvent();
event.AddPoint( GetPointDownOutside() );
application.ProcessEvent( event );
DALI_TEST_CHECK( !gIsCalledButtonCallback );
- DALI_TEST_CHECK( !pressedSignal );
gIsCalledButtonCallback = false;
event = Dali::Integration::TouchEvent();
application.ProcessEvent( event );
DALI_TEST_CHECK( !gIsCalledButtonCallback );
- DALI_TEST_CHECK( !releasedSignal );
// Test3. Touch point down inside and up outside the button.
// connect to its touch signal
button.ClickedSignal().Connect( &ButtonCallback );
- bool clickedSignal = false;
- ConnectionTracker* testTracker = new ConnectionTracker();
- button.ConnectSignal( testTracker, "clicked", CallbackFunctor(&clickedSignal) );
Dali::Integration::TouchEvent event;
application.ProcessEvent( event );
DALI_TEST_CHECK( gIsCalledButtonCallback );
- DALI_TEST_CHECK( clickedSignal );
// Test2. Touch point down and up outside the button.
gIsCalledButtonCallback = false;
- clickedSignal = false;
event = Dali::Integration::TouchEvent();
event.AddPoint( GetPointDownOutside() );
application.ProcessEvent( event );
application.ProcessEvent( event );
DALI_TEST_CHECK( !gIsCalledButtonCallback );
- DALI_TEST_CHECK( !clickedSignal );
// Test3. Touch point down inside and up outside the button.
gIsCalledButtonCallback = false;
- clickedSignal = false;
event = Dali::Integration::TouchEvent();
event.AddPoint( GetPointDownInside() );
application.ProcessEvent( event );
application.ProcessEvent( event );
DALI_TEST_CHECK( !gIsCalledButtonCallback );
- DALI_TEST_CHECK( !clickedSignal );
// Test4. Touch point down outside and up inside the button.
gIsCalledButtonCallback = false;
- clickedSignal = false;
event = Dali::Integration::TouchEvent();
event.AddPoint( GetPointDownOutside() );
application.ProcessEvent( event );
application.ProcessEvent( event );
DALI_TEST_CHECK( !gIsCalledButtonCallback );
- DALI_TEST_CHECK( !clickedSignal );
END_TEST;
}
// connect to its signal
button.StateChangedSignal().Connect( &ButtonCallback );
- bool stateChangedSignal = false;
- ConnectionTracker* testTracker = new ConnectionTracker();
- button.ConnectSignal( testTracker, "stateChanged", CallbackFunctor(&stateChangedSignal) );
gIsCalledButtonCallback = false;
button.SetSelected( true );
DALI_TEST_CHECK( gIsCalledButtonCallback );
- DALI_TEST_CHECK( stateChangedSignal );
gIsCalledButtonCallback = false;
- stateChangedSignal = false;
-
button.SetSelected( false );
DALI_TEST_CHECK( gIsCalledButtonCallback );
- DALI_TEST_CHECK( stateChangedSignal );
END_TEST;
}
DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
+ dummyImpl.OnAccessibilityValueChange( true );
dummyImpl.IsKeyboardNavigationSupported();
dummyImpl.IsKeyboardFocusGroup();
typedef NinePatchImage::StretchRanges StretchRanges;
const char* TEST_IMAGE_FILE_NAME = "gallery_image_01.jpg";
-const char* TEST_NPATCH_FILE_NAME = "gallery_image_01.9.png";
+const char* TEST_NPATCH_FILE_NAME = "gallery_image_01.9.jpg";
const char* TEST_SVG_FILE_NAME = TEST_RESOURCE_DIR "/svg1.svg";
tet_infoline("Getting resource");
Integration::ResourcePointer resourcePtr(bitmap);
- //platform.SetResourceLoaded( 0, Dali::Integration::ResourceBitmap, resourcePtr );
- platform.SetSynchronouslyLoadedResource( resourcePtr);
+ platform.SetResourceLoaded( 0, Dali::Integration::ResourceBitmap, resourcePtr );
return resourcePtr;
}
DALI_TEST_CHECK(gSliderMarkCallBackCalled);
END_TEST;
}
-
-namespace
-{
-bool gSliderSignal=false;
-struct SliderSignalFunctor
-{
- SliderSignalFunctor()
- {
- }
-
- void operator()()
- {
- gSliderSignal = true;
- }
-};
-} // anonymous
-
-
-
-int UtcDaliSliderSignals2(void)
-{
- ToolkitTestApplication application; // Exceptions require ToolkitTestApplication
- tet_infoline(" UtcDaliSliderSignals1");
-
- // Create the Popup actor
- Slider slider = Slider::New();
- Stage::GetCurrent().Add( slider );
- slider.SetParentOrigin(ParentOrigin::TOP_LEFT);
- slider.SetAnchorPoint(ParentOrigin::TOP_LEFT);
- slider.SetSize( Vector2( Stage::GetCurrent().GetSize().x, 20.0f ) );
- slider.SetPosition( 0.0f, 0.0f );
-
- const float MIN_BOUND = 0.0f;
- const float MAX_BOUND = 1.0f;
- const int NUM_MARKS = 5;
- Property::Array marks;
- for( int i = 0; i < NUM_MARKS; ++i )
- {
- marks.PushBack( MIN_BOUND + ( static_cast<float>(i) / ( NUM_MARKS - 1) ) * ( MAX_BOUND - MIN_BOUND ) );
- }
- slider.SetProperty( Slider::Property::MARKS, marks );
- slider.SetProperty( Slider::Property::MARK_TOLERANCE, 0.1f );
-
- gSliderSignal = false;
- ConnectionTracker* testTracker = new ConnectionTracker();
- slider.ConnectSignal( testTracker, "valueChanged", SliderSignalFunctor() );
-
- application.SendNotification();
- application.Render();
-
- gSliderValueChangedCallBackCalled = false;
- gSliderMarkCallBackCalled = false;
-
- Dali::Integration::TouchEvent event;
-
- event = Dali::Integration::TouchEvent();
-
- Integration::Point pointDown;
- pointDown.SetState( PointState::DOWN );
- pointDown.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
- event.AddPoint( pointDown );
-
- for( int i = 0; i < 5; ++i )
- {
- Integration::Point pointMotion;
- pointMotion.SetState( PointState::MOTION );
- pointMotion.SetScreenPosition( Vector2( 10.0f + i * 10.0f, 10.0f ) );
- event.AddPoint( pointMotion );
- }
-
- Integration::Point pointUp;
- pointUp.SetState( PointState::UP );
- pointUp.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
- event.AddPoint( pointUp );
-
- application.ProcessEvent( event );
-
- application.SendNotification();
- application.Render();
-
- DALI_TEST_CHECK(gSliderSignal);
- END_TEST;
-}
-
-int UtcDaliSetPropertyP(void)
-{
- ToolkitTestApplication application;
- tet_infoline( "UtcDaliSetPropertyP" );
-
- Slider slider = Slider::New();
- slider.SetParentOrigin(ParentOrigin::TOP_LEFT);
- slider.SetAnchorPoint(ParentOrigin::TOP_LEFT);
- slider.SetSize( Vector2( Stage::GetCurrent().GetSize().x, 20.0f ) );
- slider.SetPosition( 0.0f, 0.0f );
-
- Stage::GetCurrent().Add(slider);
- application.SendNotification();
- application.Render();
-
- slider.SetProperty(Slider::Property::LOWER_BOUND, 1.0f);
- slider.SetProperty(Slider::Property::UPPER_BOUND, 5.0f);
- slider.SetProperty(Slider::Property::VALUE, 3.0f);
- slider.SetProperty(Slider::Property::DISABLED_COLOR, Color::BLACK);
- slider.SetProperty(Slider::Property::VALUE_PRECISION, 4);
- slider.SetProperty(Slider::Property::SHOW_POPUP, true);
- slider.SetProperty(Slider::Property::SHOW_VALUE, true);
- slider.SetProperty(Slider::Property::MARKS, false);
- slider.SetProperty(Slider::Property::SNAP_TO_MARKS, false);
- slider.SetProperty(Slider::Property::MARK_TOLERANCE, 0.5f);
-
- float lb = slider.GetProperty<float>(Slider::Property::LOWER_BOUND);
- DALI_TEST_EQUALS(lb, 1.0f, TEST_LOCATION);
- float ub = slider.GetProperty<float>(Slider::Property::UPPER_BOUND);
- DALI_TEST_EQUALS(ub, 5.0f, TEST_LOCATION);
- float val = slider.GetProperty<float>(Slider::Property::VALUE);
- DALI_TEST_EQUALS(val, 3.0f, TEST_LOCATION);
- Vector4 color = slider.GetProperty<Vector4>(Slider::Property::DISABLED_COLOR);
- DALI_TEST_EQUALS( color, Color::BLACK, TEST_LOCATION );
- int precision = slider.GetProperty<int>(Slider::Property::VALUE_PRECISION);
- DALI_TEST_EQUALS( precision, 4, TEST_LOCATION);
- bool showPopup = slider.GetProperty<bool>(Slider::Property::SHOW_POPUP);
- DALI_TEST_EQUALS( showPopup, true , TEST_LOCATION);
- bool showValue = slider.GetProperty<bool>(Slider::Property::SHOW_VALUE);
- DALI_TEST_EQUALS( showValue, true, TEST_LOCATION );
- bool marks = slider.GetProperty<bool>(Slider::Property::MARKS);
- DALI_TEST_EQUALS( marks, false, TEST_LOCATION );
- bool snapToMarks = slider.GetProperty<bool>(Slider::Property::SNAP_TO_MARKS);
- DALI_TEST_EQUALS( snapToMarks, false, TEST_LOCATION );
- float tolerance = slider.GetProperty<float>(Slider::Property::MARK_TOLERANCE);
- DALI_TEST_EQUALS( tolerance, 0.5f, TEST_LOCATION );
-
- {
- Property::Map map;
- map["rendererType"] = "image";
- map["size"] = Vector2(200, 200);
- map["url"] = "track2.png";
- slider.SetProperty(Slider::Property::TRACK_VISUAL, map);
- map["url"] = "handle2.png";
- slider.SetProperty(Slider::Property::HANDLE_VISUAL, map);
- map["url"] = "progress2.png";
- slider.SetProperty(Slider::Property::PROGRESS_VISUAL, map);
- map["url"] = "popup2.png";
- slider.SetProperty(Slider::Property::POPUP_VISUAL, map);
- map["url"] = "popupArrow2.png";
- slider.SetProperty(Slider::Property::POPUP_ARROW_VISUAL, map);
-
- Property::Value value = slider.GetProperty(Slider::Property::TRACK_VISUAL);
- Property::Map* resultMap = value.GetMap();
- DALI_TEST_CHECK( resultMap );
- Property::Value* url = resultMap->Find("url");
- DALI_TEST_CHECK( url ) ;
- DALI_TEST_EQUALS( *url, "track2.png", TEST_LOCATION );
-
- value = slider.GetProperty(Slider::Property::HANDLE_VISUAL);
- resultMap = value.GetMap();
- DALI_TEST_CHECK( resultMap );
- url = resultMap->Find("url");
- DALI_TEST_CHECK( url ) ;
- DALI_TEST_EQUALS( *url, "handle2.png", TEST_LOCATION );
-
- value = slider.GetProperty(Slider::Property::PROGRESS_VISUAL);
- resultMap = value.GetMap();
- DALI_TEST_CHECK( resultMap );
- url = resultMap->Find("url");
- DALI_TEST_CHECK( url ) ;
- DALI_TEST_EQUALS( *url, "progress2.png", TEST_LOCATION );
-
- value = slider.GetProperty(Slider::Property::POPUP_VISUAL);
- resultMap = value.GetMap();
- DALI_TEST_CHECK( resultMap );
- url = resultMap->Find("url");
- DALI_TEST_CHECK( url ) ;
- DALI_TEST_EQUALS( *url, "popup2.png", TEST_LOCATION );
-
- value = slider.GetProperty(Slider::Property::POPUP_ARROW_VISUAL);
- resultMap = value.GetMap();
- DALI_TEST_CHECK( resultMap );
- url = resultMap->Find("url");
- DALI_TEST_CHECK( url ) ;
- DALI_TEST_EQUALS( *url, "popupArrow2.png", TEST_LOCATION );
- }
-
- END_TEST;
-}
{
const int BLUR_LEVELS = 3;
const int RENDER_FRAME_INTERVAL = 16;
-const char* TEST_IMAGE_FILE_NAME("image.png");
+
static bool gObjectCreatedCallBackCalled;
static void TestCallback(BaseHandle handle)
{
return imageData;
}
-
-void LoadBitmapResource(TestPlatformAbstraction& platform, int width, int height)
-{
- Integration::ResourceRequest* request = platform.GetRequest();
- Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_DISCARD );
- Integration::ResourcePointer resource(bitmap);
- bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, width, height, width, height);
-
- if(request)
- {
- platform.SetResourceLoaded(request->GetId(), request->GetType()->id, resource);
- }
-}
-
-class SignalHandler : public Dali::ConnectionTracker
-{
-public:
- SignalHandler() :
- mCalls( 0 )
- {
- }
-
- void Callback( SuperBlurView handle )
- {
- mCalls++;
- tet_infoline( "Signal called" );
- }
-
- unsigned int GetCalls() const
- {
- return mCalls;
- }
-
-private:
- unsigned int mCalls; ///< Keeps track of how many times the signal has been called.
-};
-
}//namespace
END_TEST;
}
-int UtcDaliSuperBlurViewCreate(void)
-{
- ToolkitTestApplication application;
-
- tet_infoline(" UtcDaliSuperBlurViewNew ");
-
- // Test default constructor.
- SuperBlurView blurView;
- DALI_TEST_CHECK( !blurView );
-
- // Test object creation
- TypeInfo type = TypeRegistry::Get().GetTypeInfo("SuperBlurView");
- if( type )
- {
- Dali::BaseHandle handle = type.CreateInstance();
- if( handle )
- {
- blurView = Dali::Toolkit::SuperBlurView::DownCast( handle );
- }
- }
-
- DALI_TEST_CHECK( blurView );
-
- END_TEST;
-}
-
-
int UtcDaliSuperBlurViewSetImage(void)
{
ToolkitTestApplication application;
// start multiple guassian blur call, each guassian blur creates two render tasks
DALI_TEST_CHECK( Stage::GetCurrent().GetRenderTaskList().GetTaskCount() == 1+BLUR_LEVELS*2);
- {
- // create image renderers for the original image and each blurred image
- Stage::GetCurrent().Add( blurView );
- Wait(application);
- DALI_TEST_EQUALS(blurView.GetRendererCount(), BLUR_LEVELS+1, TEST_LOCATION );
-
- application.SendNotification();
- application.Render();
- Stage::GetCurrent().Remove( blurView );
- }
-
- END_TEST;
-}
-
-int UtcDaliSuperBlurViewSetProperty(void)
-{
- ToolkitTestApplication application;
-
- tet_infoline(" UtcDaliSuperBlurViewSetProperty ");
-
- SuperBlurView blurView = SuperBlurView::New( BLUR_LEVELS );
// create image renderers for the original image and each blurred image
Stage::GetCurrent().Add( blurView );
- blurView.SetSize( 100.f, 100.f );
-
- tet_infoline(" Set property map. Set height and width large enough to avoid atlassing");
- int width(512);
- int height(513);
- LoadBitmapResource( application.GetPlatform(), width, height );
-
- Property::Map propertyMap;
- propertyMap["filename"] = TEST_IMAGE_FILE_NAME ;
- propertyMap["width"] = width;
- propertyMap["height"] = height;
-
- // Will create ResourceImage
- blurView.SetProperty(SuperBlurView::Property::IMAGE, propertyMap);
- Wait(application);
-
- // start multiple guassian blur call, each guassian blur creates two render tasks
- DALI_TEST_CHECK( Stage::GetCurrent().GetRenderTaskList().GetTaskCount() == 1+BLUR_LEVELS*2);
-
Wait(application);
-
- END_TEST;
-}
-
-
-int UtcDaliSuperBlurViewGetProperty(void)
-{
- ToolkitTestApplication application;
-
- tet_infoline(" UtcDaliSuperBlurViewSetProperty ");
-
- SuperBlurView blurView = SuperBlurView::New( BLUR_LEVELS );
- blurView.SetSize( 100.f, 100.f );
-
- tet_infoline(" Set property map.");
- int width(512);
- int height(513); // Value large enough to avoid future atlassing
- LoadBitmapResource( application.GetPlatform(), width, height );
-
- Property::Map propertyMap;
- propertyMap["filename"] = TEST_IMAGE_FILE_NAME ;
- propertyMap["width"] = width;
- propertyMap["height"] = height;
-
- // Will create ResourceImage
- blurView.SetProperty(SuperBlurView::Property::IMAGE, propertyMap);
- Wait(application);
-
- // create image renderers for the original image and each blurred image
- Stage::GetCurrent().Add( blurView );
-
- Property::Value imageProperty = blurView.GetProperty(SuperBlurView::Property::IMAGE);
- Property::Map* map = imageProperty.GetMap();
- DALI_TEST_CHECK( map != NULL );
- if( map )
- {
- Property::Map& mapRef = *map;
- DALI_TEST_EQUALS( mapRef["filename"], TEST_IMAGE_FILE_NAME, TEST_LOCATION );
- }
-
+ DALI_TEST_EQUALS(blurView.GetRendererCount(), BLUR_LEVELS+1, TEST_LOCATION );
END_TEST;
}
-
int UtcDaliSuperBlurViewSetGetBlurStrength(void)
{
ToolkitTestApplication application;
END_TEST;
}
-
-int UtcDaliSuperBlurViewBlurSignal(void)
-{
- ToolkitTestApplication application;
-
- tet_infoline(" UtcDaliSuperBlurViewSignal ");
-
- SuperBlurView blurView = SuperBlurView::New( BLUR_LEVELS );
- blurView.SetSize( 100.f, 100.f );
-
- Image inputImage = CreateSolidColorImage( application, Color::GREEN, 50, 50 );
- blurView.SetImage( inputImage );
- // start multiple guassian blur call, each guassian blur creates two render tasks
- DALI_TEST_CHECK( Stage::GetCurrent().GetRenderTaskList().GetTaskCount() == 1+BLUR_LEVELS*2);
-
- SignalHandler signalHandler;
- blurView.BlurFinishedSignal().Connect(&signalHandler, &SignalHandler::Callback);
-
- // create image renderers for the original image and each blurred image
- Stage::GetCurrent().Add( blurView );
- Wait(application, 1000);
-
- DALI_TEST_EQUALS(blurView.GetRendererCount(), BLUR_LEVELS+1, TEST_LOCATION );
- //DALI_TEST_EQUALS(signalHandler.GetCalls(), 1, TEST_LOCATION);
-
- END_TEST;
-}
return mFocusedActorActivatedSignal;
}
+bool AccessibilityManager::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
+{
+ bool connected( true );
+ AccessibilityManager* manager = dynamic_cast<AccessibilityManager*>( object );
+
+ if( manager )
+ {
+ if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUS_CHANGED ) )
+ {
+ manager->FocusChangedSignal().Connect( tracker, functor );
+ }
+ else if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUS_OVERSHOT ) )
+ {
+ manager->FocusOvershotSignal().Connect( tracker, functor );
+ }
+ else if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUSED_ACTOR_ACTIVATED ) )
+ {
+ manager->FocusedActorActivatedSignal().Connect( tracker, functor );
+ }
+ else
+ {
+ // signalName does not match any signal
+ connected = false;
+ }
+ }
+
+ return connected;
+}
+
} // namespace Internal
} // namespace Toolkit
*/
Toolkit::AccessibilityManager::FocusedActorActivatedSignalType& FocusedActorActivatedSignal();
+ /**
+ * Connects a callback function with the object's signals.
+ * @param[in] object The object providing the signal.
+ * @param[in] tracker Used to disconnect the signal.
+ * @param[in] signalName The signal to connect to.
+ * @param[in] functor A newly allocated FunctorDelegate.
+ * @return True if the signal was connected.
+ * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
+ */
+ static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
+
public: // Signals
/**
{
Property::Map map;
Image inputImage = superBlurViewImpl.GetImage();
- if( inputImage )
+ if( !inputImage )
{
Scripting::CreatePropertyMap( inputImage, map );
}
DALI_TYPE_REGISTRATION_BEGIN_CREATE( Toolkit::KeyboardFocusManager, Dali::BaseHandle, Create, true )
-DALI_SIGNAL_REGISTRATION( Toolkit, KeyboardFocusManager, "keyboardPreFocusChange", SIGNAL_PRE_FOCUS_CHANGE )
-DALI_SIGNAL_REGISTRATION( Toolkit, KeyboardFocusManager, "keyboardFocusChanged", SIGNAL_FOCUS_CHANGED )
-DALI_SIGNAL_REGISTRATION( Toolkit, KeyboardFocusManager, "keyboardFocusGroupChanged", SIGNAL_FOCUS_GROUP_CHANGED )
+DALI_SIGNAL_REGISTRATION( Toolkit, KeyboardFocusManager, "keyboardPreFocusChange", SIGNAL_PRE_FOCUS_CHANGE )
+DALI_SIGNAL_REGISTRATION( Toolkit, KeyboardFocusManager, "keyboardFocusChanged", SIGNAL_FOCUS_CHANGED )
+DALI_SIGNAL_REGISTRATION( Toolkit, KeyboardFocusManager, "keyboardFocusGroupChanged", SIGNAL_FOCUS_GROUP_CHANGED )
DALI_SIGNAL_REGISTRATION( Toolkit, KeyboardFocusManager, "keyboardFocusedActorEnterKey", SIGNAL_FOCUSED_ACTOR_ENTER_KEY )
DALI_TYPE_REGISTRATION_END()