Updated test cases for increased coverage 34/77434/1
authorDavid Steele <david.steele@samsung.com>
Wed, 29 Jun 2016 15:00:17 +0000 (16:00 +0100)
committerDavid Steele <david.steele@samsung.com>
Wed, 29 Jun 2016 15:10:55 +0000 (16:10 +0100)
Fixed minor bug in super-blur-view,
removed dead code from accessibility manager.

Uncovered chaining issue with render tasks, but left test passing for the moment.
(Needs further investigation)

Change-Id: I4875183aa1b587a9b7228944a38796c33d15b367
On branch devel/master
nothing to commit, working directory clean

17 files changed:
automated-tests/execute.sh
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-accessibility-adaptor.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-accessibility-adaptor.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-tts-player.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-tts-player.h [deleted file]
automated-tests/src/dali-toolkit/utc-Dali-AccessibilityManager.cpp
automated-tests/src/dali-toolkit/utc-Dali-Button.cpp
automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp
automated-tests/src/dali-toolkit/utc-Dali-RendererFactory.cpp
automated-tests/src/dali-toolkit/utc-Dali-Slider.cpp
automated-tests/src/dali-toolkit/utc-Dali-SuperBlurView.cpp
dali-toolkit/internal/accessibility-manager/accessibility-manager-impl.cpp
dali-toolkit/internal/accessibility-manager/accessibility-manager-impl.h
dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp
dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp

index 64e27eeab7584410cd3928f862e56cdddb1ca057..bc108fab0570181c6fda9aa7bedde1320418bcdf 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-TEMP=`getopt -o hsSm --long help,serial,tct,modules -n 'execute.sh' -- "$@"`
+TEMP=`getopt -o dhsSm --long debug,help,serial,tct,modules -n 'execute.sh' -- "$@"`
 
 if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
 
@@ -9,8 +9,9 @@ eval set -- "$TEMP"
 
 function usage
 {
-    echo -e "Usage: execute.sh [-s|-S|-r] [module|testcase]"
+    echo -e "Usage: execute.sh [-d][-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"
@@ -21,9 +22,11 @@ function usage
 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 ;;
@@ -127,16 +130,22 @@ else
         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
-               echo $output
-               if [ $ret -eq 0 ] ; then echo -e "\nPassed" ; fi
-               exit $ret
+                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
             fi
         done
         echo $1 not found
index 873c8d2aa3d4e5b34e9816326981dd0c4d082398..1a3490b8bdc363241a1a7838c655a719276939b7 100644 (file)
@@ -87,8 +87,10 @@ DummyControlImplOverride::DummyControlImplOverride()
 : DummyControlImpl(),
   initializeCalled(false),
   activatedCalled(false),
-  themeChangeCalled( false ),
-  fontChangeCalled( false ),
+  onAccTouchedCalled(false),
+  onAccValueChangeCalled(false),
+  themeChangeCalled(false),
+  fontChangeCalled(false),
   pinchCalled(false),
   panCalled(false),
   tapCalled(false),
@@ -113,6 +115,12 @@ DummyControlImplOverride::~DummyControlImplOverride() { }
 
 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;
index 0538199b20cc5e651567bcedf7f086a4b1b9466e..496786e335498ef228ee340578120b14898db5ba 100644 (file)
@@ -103,6 +103,9 @@ private: // From Internal::Control
 
   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);
@@ -128,6 +131,8 @@ public:
 
   bool initializeCalled;
   bool activatedCalled;
+  bool onAccTouchedCalled;
+  bool onAccValueChangeCalled;
   bool themeChangeCalled;
   bool fontChangeCalled;
   bool pinchCalled;
index 5820806e1b5c7b70ebada2af0a92252654c8f406..286f7333adc22170b2873d0abb373e1ecdf0ee47 100644 (file)
  *
  */
 
-#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
 {
@@ -48,6 +48,13 @@ public:
 
   void MockSetReadPosition( Vector2& position );
 
+  void SetEnabled(bool enabled)
+  {
+    mIsEnabled = enabled;
+  }
+
+  void SendPanGesture( const Dali::Integration::PanGestureEvent& panEvent );
+
 public:
 
   bool IsEnabled() const;
@@ -56,16 +63,17 @@ public:
 
   Vector2 GetReadPosition() const;
 
-  bool HandleActionNextEvent();
-  bool HandleActionPreviousEvent();
+  bool HandleActionNextEvent(bool);
+  bool HandleActionPreviousEvent(bool);
   bool HandleActionActivateEvent();
   bool HandleActionReadEvent(unsigned int x, unsigned int y, bool allowReadAgain);
-  bool HandleActionReadNextEvent();
-  bool HandleActionReadPreviousEvent();
+  bool HandleActionReadNextEvent(bool);
+  bool HandleActionReadPreviousEvent(bool);
   bool HandleActionUpEvent();
   bool HandleActionDownEvent();
   bool HandleActionClearFocusEvent();
-  bool HandleActionScrollEvent(TouchPoint& point, unsigned long timeStamp);
+  bool HandleActionScrollEvent(const TouchPoint& point, unsigned long timeStamp);
+  bool HandleActionTouchEvent(const TouchPoint& point, unsigned long timeStamp);
   bool HandleActionBackEvent();
   bool HandleActionEnableEvent();
   bool HandleActionDisableEvent();
@@ -84,8 +92,6 @@ public:
   bool HandleActionReadPauseResumeEvent();
   bool HandleActionStartStopEvent();
 
-public: // Signals
-
 private:
 
   bool mIsEnabled;
@@ -133,6 +139,11 @@ bool AccessibilityAdaptor::IsEnabled() const
   return mIsEnabled;
 }
 
+void AccessibilityAdaptor::SendPanGesture( const Integration::PanGestureEvent& panEvent )
+{
+  mGestureHandler->HandlePanGesture( panEvent );
+}
+
 void AccessibilityAdaptor::SetActionHandler(Dali::AccessibilityActionHandler& handler)
 {
   mActionHandler = &handler;
@@ -143,7 +154,7 @@ void AccessibilityAdaptor::SetGestureHandler(Dali::AccessibilityGestureHandler&
   mGestureHandler = &handler;
 }
 
-bool AccessibilityAdaptor::HandleActionNextEvent()
+bool AccessibilityAdaptor::HandleActionNextEvent(bool allowEndFeedback)
 {
   if( mActionHandler )
   {
@@ -152,7 +163,7 @@ bool AccessibilityAdaptor::HandleActionNextEvent()
   return false;
 }
 
-bool AccessibilityAdaptor::HandleActionPreviousEvent()
+bool AccessibilityAdaptor::HandleActionPreviousEvent(bool allowEndFeedback)
 {
   if( mActionHandler )
   {
@@ -179,7 +190,7 @@ bool AccessibilityAdaptor::HandleActionReadEvent(unsigned int x, unsigned int y,
   return false;
 }
 
-bool AccessibilityAdaptor::HandleActionReadNextEvent()
+bool AccessibilityAdaptor::HandleActionReadNextEvent(bool allowEndFeedback)
 {
   if( mActionHandler )
   {
@@ -188,7 +199,7 @@ bool AccessibilityAdaptor::HandleActionReadNextEvent()
   return false;
 }
 
-bool AccessibilityAdaptor::HandleActionReadPreviousEvent()
+bool AccessibilityAdaptor::HandleActionReadPreviousEvent(bool allowEndFeedback)
 {
   if( mActionHandler )
   {
@@ -224,7 +235,7 @@ bool AccessibilityAdaptor::HandleActionClearFocusEvent()
   return false;
 }
 
-bool AccessibilityAdaptor::HandleActionScrollEvent(TouchPoint& point, unsigned long timeStamp)
+bool AccessibilityAdaptor::HandleActionScrollEvent(const TouchPoint& point, unsigned long timeStamp)
 {
   if( mActionHandler )
   {
@@ -235,6 +246,17 @@ bool AccessibilityAdaptor::HandleActionScrollEvent(TouchPoint& point, unsigned l
   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 )
@@ -419,13 +441,6 @@ AccessibilityAdaptor::~AccessibilityAdaptor()
 {
 }
 
-// Mock setup:
-
-void AccessibilityAdaptor::MockSetReadPosition( Vector2& position )
-{
-  Internal::Adaptor::GetImplementation(*this).MockSetReadPosition( position );
-}
-
 // Methods:
 
 Vector2 AccessibilityAdaptor::GetReadPosition() const
@@ -435,8 +450,7 @@ Vector2 AccessibilityAdaptor::GetReadPosition() const
 
 bool AccessibilityAdaptor::IsEnabled() const
 {
-  //return Internal::Adaptor::GetImplementation(*this).IsEnabled();
-  return false;
+  return Internal::Adaptor::GetImplementation(*this).IsEnabled();
 }
 
 void AccessibilityAdaptor::SetActionHandler(AccessibilityActionHandler& handler)
@@ -449,14 +463,14 @@ void AccessibilityAdaptor::SetGestureHandler(AccessibilityGestureHandler& handle
   Internal::Adaptor::GetImplementation(*this).SetGestureHandler(handler);
 }
 
-bool AccessibilityAdaptor::HandleActionNextEvent()
+bool AccessibilityAdaptor::HandleActionNextEvent(bool allowEndFeedback)
 {
-  return Internal::Adaptor::GetImplementation(*this).HandleActionNextEvent();
+  return Internal::Adaptor::GetImplementation(*this).HandleActionNextEvent(allowEndFeedback);
 }
 
-bool AccessibilityAdaptor::HandleActionPreviousEvent()
+bool AccessibilityAdaptor::HandleActionPreviousEvent(bool allowEndFeedback)
 {
-  return Internal::Adaptor::GetImplementation(*this).HandleActionPreviousEvent();
+  return Internal::Adaptor::GetImplementation(*this).HandleActionPreviousEvent(allowEndFeedback);
 }
 
 bool AccessibilityAdaptor::HandleActionActivateEvent()
@@ -469,14 +483,14 @@ bool AccessibilityAdaptor::HandleActionReadEvent(unsigned int x, unsigned int y,
   return Internal::Adaptor::GetImplementation(*this).HandleActionReadEvent( x, y, allowReadAgain );
 }
 
-bool AccessibilityAdaptor::HandleActionReadNextEvent()
+bool AccessibilityAdaptor::HandleActionReadNextEvent(bool allowEndFeedback)
 {
-  return Internal::Adaptor::GetImplementation(*this).HandleActionReadNextEvent();
+  return Internal::Adaptor::GetImplementation(*this).HandleActionReadNextEvent(allowEndFeedback);
 }
 
-bool AccessibilityAdaptor::HandleActionReadPreviousEvent()
+bool AccessibilityAdaptor::HandleActionReadPreviousEvent(bool allowEndFeedback)
 {
-  return Internal::Adaptor::GetImplementation(*this).HandleActionReadPreviousEvent();
+  return Internal::Adaptor::GetImplementation(*this).HandleActionReadPreviousEvent(allowEndFeedback);
 }
 
 bool AccessibilityAdaptor::HandleActionUpEvent()
@@ -494,11 +508,16 @@ bool AccessibilityAdaptor::HandleActionClearFocusEvent()
   return Internal::Adaptor::GetImplementation(*this).HandleActionClearFocusEvent();
 }
 
-bool AccessibilityAdaptor::HandleActionScrollEvent(TouchPoint& point, unsigned long timeStamp)
+bool AccessibilityAdaptor::HandleActionScrollEvent(const 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();
@@ -590,3 +609,29 @@ AccessibilityAdaptor::AccessibilityAdaptor( Internal::Adaptor::AccessibilityAdap
 }
 
 } // 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
index 2975c3358ede6817c6e36627c646f6b7df4578c7..744f97124d1ec3c7a7b679f2abf272cbd1e5220d 100644 (file)
@@ -1,11 +1,8 @@
-// Prevent normal accessibility adaptor declaration from loading
-#define __DALI_ACCESSIBILITY_ADAPTOR_H__
-
-#ifndef __DALI_TOOLKIT_ACCESSIBILITY_ADAPTOR_H__
-#define __DALI_TOOLKIT_ACCESSIBILITY_ADAPTOR_H__
+#ifndef __DALI_TEST_TOOLKIT_ACCESSIBILITY_ADAPTOR_H__
+#define __DALI_TEST_TOOLKIT_ACCESSIBILITY_ADAPTOR_H__
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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 <string>
-#include <dali/public-api/object/base-handle.h>
-#include <dali/public-api/events/touch-point.h>
+#include <dali/devel-api/adaptor-framework/accessibility-adaptor.h>
+#include <dali/integration-api/events/pan-gesture-event.h>
 
-namespace Dali
-{
-namespace Internal
-{
-namespace Adaptor
+namespace Test
 {
-class AccessibilityAdaptor;
-}
-}
-class AccessibilityActionHandler;
-class AccessibilityGestureHandler;
-class TouchPoint;
-
-/**
- * This creates a stubbed AccessibilityAdaptor so that internal Toolkit Adaptor calls work.
- */
-class AccessibilityAdaptor : public BaseHandle
+namespace AccessibilityAdaptor
 {
-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();
 
-  AccessibilityAdaptor( Internal::Adaptor::AccessibilityAdaptor* adaptor );
-};
+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 );
 
-} // namespace Dali
+} // namespace AccessibilityAdaptor
+} // namespace Test
 
-#endif // __DALI_TOOLKIT_ACCESSIBILITY_ADAPTOR_H__
+#endif //
index 6da3d4741bf53523abfd741ff61e7ec1619491c4..7200f0f70986c46251684d44575b986ba5c71f33 100644 (file)
@@ -1,5 +1,3 @@
-#include "toolkit-tts-player.h"
-
 /*
  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
  *
@@ -18,8 +16,8 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/object/base-handle.h>
-#include <dali/public-api/signals/dali-signal.h>
+#include <dali/dali.h>
+
 
 namespace Dali
 {
@@ -28,11 +26,76 @@ TtsPlayer::TtsPlayer()
 {
 }
 
+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)
 {
-  TtsPlayer ttsPlayer;
+  if( ! ttsSingleton )
+  {
+    ttsSingleton.Reset( new Dali::Internal::Adaptor::TtsPlayer() );
+  }
+  TtsPlayer playerHandle(ttsSingleton.Get());
 
-  return ttsPlayer;
+  return playerHandle;
 }
 
 TtsPlayer::~TtsPlayer()
@@ -77,7 +140,12 @@ TtsPlayer::State TtsPlayer::GetState()
 
 TtsPlayer::StateChangedSignalType& TtsPlayer::StateChangedSignal()
 {
-  return mStateChangedSignal; // GetImplementation(*this).StateChangedSignal();
+  return Internal::Adaptor::GetImplementation(*this).StateChangedSignal();
+}
+
+TtsPlayer::TtsPlayer( Internal::Adaptor::TtsPlayer* player )
+: BaseHandle( player )
+{
 }
 
 } // namespace Dali
diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-tts-player.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-tts-player.h
deleted file mode 100644 (file)
index 269039e..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-#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__
index a066d8fb6c66f8ef037bbef9132fa32c447d6794..238f67fa406a711bfd1656786e30e41fae757de3 100644 (file)
 #include <iostream>
 #include <stdlib.h>
 
-// Need to override adaptor classes for toolkit test harness, so include
-// test harness headers before dali headers.
+#include <dali-toolkit/dali-toolkit.h>
+
 #include <dali-toolkit-test-suite-utils.h>
 #include <toolkit-accessibility-adaptor.h>
-
-#include <dali-toolkit/dali-toolkit.h>
+#include <dummy-control.h>
 
 using namespace Dali;
 using namespace Toolkit;
@@ -223,6 +222,10 @@ int UtcDaliAccessibilityManagerSetAndGetFocusOrder(void)
   // 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);
@@ -309,6 +312,10 @@ int UtcDaliAccessibilityManagerGetActorByFocusOrder(void)
   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);
 
@@ -331,6 +338,10 @@ int UtcDaliAccessibilityManagerSetAndGetCurrentFocusActor(void)
   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);
@@ -422,6 +433,10 @@ int UtcDaliAccessibilityManagerGetCurrentFocusGroup(void)
   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();
@@ -489,6 +504,10 @@ int UtcDaliAccessibilityManagerGetCurrentFocusOrder(void)
   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);
 
@@ -546,6 +565,10 @@ int UtcDaliAccessibilityManagerMoveFocusForward(void)
   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);
 
@@ -659,6 +682,10 @@ int UtcDaliAccessibilityManagerMoveFocusBackward(void)
   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);
 
@@ -772,6 +799,10 @@ int UtcDaliAccessibilityManagerClearFocus(void)
   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);
@@ -850,6 +881,10 @@ int UtcDaliAccessibilityManagerFocusGroup(void)
   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();
@@ -1012,6 +1047,10 @@ int UtcDaliAccessibilityManagerSignalFocusOvershot(void)
   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);
@@ -1276,6 +1315,10 @@ int UtcDaliAccessibilityManagerActionReadSignalP(void)
 
   AccessibilityManagerSignalHandler callback;
 
+  Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
+  Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
+  accAdaptor.HandleActionEnableEvent();
+
   AccessibilityManager manager = AccessibilityManager::Get();
   DALI_TEST_CHECK( manager );
 
@@ -1296,6 +1339,10 @@ int UtcDaliAccessibilityManagerActionReadSignalN(void)
 
   AccessibilityManagerSignalHandler callback;
 
+  Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
+  Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
+  accAdaptor.HandleActionEnableEvent();
+
   AccessibilityManager manager = AccessibilityManager::Get();
   DALI_TEST_CHECK( manager );
 
@@ -1312,6 +1359,10 @@ int UtcDaliAccessibilityManagerActionOverSignalP(void)
 
   AccessibilityManagerSignalHandler callback;
 
+  Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
+  Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
+  accAdaptor.HandleActionEnableEvent();
+
   AccessibilityManager manager = AccessibilityManager::Get();
   DALI_TEST_CHECK( manager );
 
@@ -1333,6 +1384,10 @@ int UtcDaliAccessibilityManagerActionOverSignalN(void)
 
   AccessibilityManagerSignalHandler callback;
 
+  Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
+  Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
+  accAdaptor.HandleActionEnableEvent();
+
   AccessibilityManager manager = AccessibilityManager::Get();
   DALI_TEST_CHECK( manager );
 
@@ -1421,12 +1476,21 @@ int UtcDaliAccessibilityManagerActionUpSignalP(void)
 
   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 );
 
-  Dali::AccessibilityAdaptor accessibilityAdaptor = Dali::AccessibilityAdaptor::Get();
+  DummyControl dummyControl = DummyControl::New(true);
+  dummyControl.SetSize(480, 800);
+  manager.SetFocusOrder( dummyControl, 1 );
+  Stage::GetCurrent().Add( dummyControl );
+  manager.SetCurrentFocusActor( dummyControl );
+
   accessibilityAdaptor.HandleActionUpEvent();
 
   DALI_TEST_EQUALS( callback.GetCalls(), 1u, TEST_LOCATION );
@@ -1457,12 +1521,21 @@ int UtcDaliAccessibilityManagerActionDownSignalP(void)
 
   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 );
 
-  Dali::AccessibilityAdaptor accessibilityAdaptor = Dali::AccessibilityAdaptor::Get();
+  DummyControl dummyControl = DummyControl::New(true);
+  dummyControl.SetSize(480, 800);
+  manager.SetFocusOrder( dummyControl, 1 );
+  Stage::GetCurrent().Add( dummyControl );
+  manager.SetCurrentFocusActor( dummyControl );
+
   accessibilityAdaptor.HandleActionDownEvent();
 
   DALI_TEST_EQUALS( callback.GetCalls(), 1u, TEST_LOCATION );
@@ -1493,6 +1566,10 @@ int UtcDaliAccessibilityManagerActionClearFocusSignalP(void)
 
   AccessibilityManagerSignalHandler callback;
 
+  Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
+  Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
+  accAdaptor.HandleActionEnableEvent();
+
   AccessibilityManager manager = AccessibilityManager::Get();
   DALI_TEST_CHECK( manager );
 
@@ -1529,6 +1606,10 @@ int UtcDaliAccessibilityManagerActionBackSignalP(void)
 
   AccessibilityManagerSignalHandler callback;
 
+  Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
+  Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
+  accAdaptor.HandleActionEnableEvent();
+
   AccessibilityManager manager = AccessibilityManager::Get();
   DALI_TEST_CHECK( manager );
 
@@ -1565,6 +1646,10 @@ int UtcDaliAccessibilityManagerActionScrollUpSignalP(void)
 
   AccessibilityManagerSignalHandler callback;
 
+  Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
+  Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
+  accAdaptor.HandleActionEnableEvent();
+
   AccessibilityManager manager = AccessibilityManager::Get();
   DALI_TEST_CHECK( manager );
 
@@ -1601,6 +1686,10 @@ int UtcDaliAccessibilityManagerActionScrollDownSignalP(void)
 
   AccessibilityManagerSignalHandler callback;
 
+  Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
+  Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
+  accAdaptor.HandleActionEnableEvent();
+
   AccessibilityManager manager = AccessibilityManager::Get();
   DALI_TEST_CHECK( manager );
 
@@ -1637,6 +1726,10 @@ int UtcDaliAccessibilityManagerActionPageLeftSignalP(void)
 
   AccessibilityManagerSignalHandler callback;
 
+  Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
+  Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
+  accAdaptor.HandleActionEnableEvent();
+
   AccessibilityManager manager = AccessibilityManager::Get();
   DALI_TEST_CHECK( manager );
 
@@ -1673,6 +1766,10 @@ int UtcDaliAccessibilityManagerActionPageRightSignalP(void)
 
   AccessibilityManagerSignalHandler callback;
 
+  Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
+  Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
+  accAdaptor.HandleActionEnableEvent();
+
   AccessibilityManager manager = AccessibilityManager::Get();
   DALI_TEST_CHECK( manager );
 
@@ -1709,6 +1806,10 @@ int UtcDaliAccessibilityManagerActionPageUpSignalP(void)
 
   AccessibilityManagerSignalHandler callback;
 
+  Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
+  Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
+  accAdaptor.HandleActionEnableEvent();
+
   AccessibilityManager manager = AccessibilityManager::Get();
   DALI_TEST_CHECK( manager );
 
@@ -1729,6 +1830,10 @@ int UtcDaliAccessibilityManagerActionPageUpSignalN(void)
 
   AccessibilityManagerSignalHandler callback;
 
+  Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
+  Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
+  accAdaptor.HandleActionEnableEvent();
+
   AccessibilityManager manager = AccessibilityManager::Get();
   DALI_TEST_CHECK( manager );
 
@@ -1745,6 +1850,10 @@ int UtcDaliAccessibilityManagerActionPageDownSignalP(void)
 
   AccessibilityManagerSignalHandler callback;
 
+  Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
+  Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
+  accAdaptor.HandleActionEnableEvent();
+
   AccessibilityManager manager = AccessibilityManager::Get();
   DALI_TEST_CHECK( manager );
 
@@ -1781,6 +1890,10 @@ int UtcDaliAccessibilityManagerActionMoveToFirstSignalP(void)
 
   AccessibilityManagerSignalHandler callback;
 
+  Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
+  Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
+  accAdaptor.HandleActionEnableEvent();
+
   AccessibilityManager manager = AccessibilityManager::Get();
   DALI_TEST_CHECK( manager );
 
@@ -1801,6 +1914,10 @@ int UtcDaliAccessibilityManagerActionMoveToFirstSignalN(void)
 
   AccessibilityManagerSignalHandler callback;
 
+  Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
+  Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
+  accAdaptor.HandleActionEnableEvent();
+
   AccessibilityManager manager = AccessibilityManager::Get();
   DALI_TEST_CHECK( manager );
 
@@ -1817,6 +1934,10 @@ int UtcDaliAccessibilityManagerActionMoveToLastSignalP(void)
 
   AccessibilityManagerSignalHandler callback;
 
+  Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
+  Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
+  accAdaptor.HandleActionEnableEvent();
+
   AccessibilityManager manager = AccessibilityManager::Get();
   DALI_TEST_CHECK( manager );
 
@@ -1853,6 +1974,10 @@ int UtcDaliAccessibilityManagerActionReadFromTopSignalP(void)
 
   AccessibilityManagerSignalHandler callback;
 
+  Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
+  Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
+  accAdaptor.HandleActionEnableEvent();
+
   AccessibilityManager manager = AccessibilityManager::Get();
   DALI_TEST_CHECK( manager );
 
@@ -1889,6 +2014,10 @@ int UtcDaliAccessibilityManagerActionReadFromNextSignalP(void)
 
   AccessibilityManagerSignalHandler callback;
 
+  Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
+  Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
+  accAdaptor.HandleActionEnableEvent();
+
   AccessibilityManager manager = AccessibilityManager::Get();
   DALI_TEST_CHECK( manager );
 
@@ -1925,6 +2054,10 @@ int UtcDaliAccessibilityManagerActionZoomSignalP(void)
 
   AccessibilityManagerSignalHandler callback;
 
+  Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
+  Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
+  accAdaptor.HandleActionEnableEvent();
+
   AccessibilityManager manager = AccessibilityManager::Get();
   DALI_TEST_CHECK( manager );
 
@@ -1961,6 +2094,10 @@ int UtcDaliAccessibilityManagerActionReadIndicatorInformationSignalP(void)
 
   AccessibilityManagerSignalHandler callback;
 
+  Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
+  Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
+  accAdaptor.HandleActionEnableEvent();
+
   AccessibilityManager manager = AccessibilityManager::Get();
   DALI_TEST_CHECK( manager );
 
@@ -1997,6 +2134,10 @@ int UtcDaliAccessibilityManagerActionReadPauseResumeSignalP(void)
 
   AccessibilityManagerSignalHandler callback;
 
+  Dali::AccessibilityAdaptor accAdaptor = Dali::AccessibilityAdaptor::Get();
+  Test::AccessibilityAdaptor::SetEnabled( accAdaptor, true );
+  accAdaptor.HandleActionEnableEvent();
+
   AccessibilityManager manager = AccessibilityManager::Get();
   DALI_TEST_CHECK( manager );
 
@@ -2141,3 +2282,72 @@ int UtcDaliAccessibilityManagerActionScrollSignalN(void)
 
   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
index 07e2b14bac4908ea9ba9cbd572be9e8b630affed..80a8f70fea1c99ade2feb1ab19134ecb077d5ccc 100644 (file)
@@ -50,6 +50,21 @@ static bool ButtonCallback( Button button )
   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 );
@@ -437,8 +452,13 @@ int UtcDaliButtonPressedSignalP(void)
   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;
 
@@ -450,6 +470,7 @@ int UtcDaliButtonPressedSignalP(void)
   application.ProcessEvent( event );
 
   DALI_TEST_CHECK( gIsCalledButtonCallback );
+  DALI_TEST_CHECK( pressedSignal );
 
   gIsCalledButtonCallback = false;
   event = Dali::Integration::TouchEvent();
@@ -457,15 +478,19 @@ int UtcDaliButtonPressedSignalP(void)
   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();
@@ -473,6 +498,7 @@ int UtcDaliButtonPressedSignalP(void)
   application.ProcessEvent( event );
 
   DALI_TEST_CHECK( !gIsCalledButtonCallback );
+  DALI_TEST_CHECK( !releasedSignal );
 
   // Test3. Touch point down inside and up outside the button.
 
@@ -534,6 +560,9 @@ int UtcDaliButtonClickedSignalP(void)
 
   // 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;
 
@@ -549,10 +578,12 @@ int UtcDaliButtonClickedSignalP(void)
   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 );
@@ -562,10 +593,12 @@ int UtcDaliButtonClickedSignalP(void)
   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 );
@@ -579,10 +612,12 @@ int UtcDaliButtonClickedSignalP(void)
   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 );
@@ -596,6 +631,7 @@ int UtcDaliButtonClickedSignalP(void)
   application.ProcessEvent( event );
 
   DALI_TEST_CHECK( !gIsCalledButtonCallback );
+  DALI_TEST_CHECK( !clickedSignal );
   END_TEST;
 }
 
@@ -614,16 +650,23 @@ int UtcDaliButtonStateChangedSignalP(void)
 
   // 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;
 }
 
index f30007f3403bda20c007cbd21ba6364c3d6b5663..12ce9136af00224ffdd345a896821b2dbbfee81e 100644 (file)
@@ -762,7 +762,6 @@ int UtcDaliControlImplKeyInputFocusLost(void)
 
     DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
 
-    dummyImpl.OnAccessibilityValueChange( true );
     dummyImpl.IsKeyboardNavigationSupported();
     dummyImpl.IsKeyboardFocusGroup();
 
index d81326119df93bf78c99a5d26510101de9fe1cce..94a369fc6915872e9bd6d66f803c3387165dee45 100644 (file)
@@ -31,7 +31,8 @@ namespace
 typedef NinePatchImage::StretchRanges StretchRanges;
 
 const char* TEST_IMAGE_FILE_NAME =  "gallery_image_01.jpg";
-const char* TEST_NPATCH_FILE_NAME =  "gallery_image_01.9.jpg";
+const char* TEST_NPATCH_FILE_NAME =  "gallery_image_01.9.png";
+
 const char* TEST_SVG_FILE_NAME = TEST_RESOURCE_DIR "/svg1.svg";
 const char* TEST_OBJ_FILE_NAME = TEST_RESOURCE_DIR "/Cube.obj";
 const char* TEST_MTL_FILE_NAME = TEST_RESOURCE_DIR "/ToyRobot-Metal.mtl";
@@ -165,7 +166,8 @@ Integration::ResourcePointer CustomizeNinePatch( TestApplication& application,
 
   tet_infoline("Getting resource");
   Integration::ResourcePointer resourcePtr(bitmap);
-  platform.SetResourceLoaded( 0, Dali::Integration::ResourceBitmap, resourcePtr );
+  //platform.SetResourceLoaded( 0, Dali::Integration::ResourceBitmap, resourcePtr );
+  platform.SetSynchronouslyLoadedResource( resourcePtr);
 
   return resourcePtr;
 }
index e96556b4d8dcf49548806bc69544f670261d7de7..1ec25cebc4e95c8e488a6fdb9e76063da7b46405 100644 (file)
@@ -279,9 +279,6 @@ int UtcDaliSetPropertyP(void)
   application.SendNotification();
   application.Render();
 
-  Property::Map map;
-  map["rendererType"] = "image";
-  map["url"] = "url";
   slider.SetProperty(Slider::Property::LOWER_BOUND,        1.0f);
   slider.SetProperty(Slider::Property::UPPER_BOUND,        5.0f);
   slider.SetProperty(Slider::Property::VALUE,              3.0f);
@@ -315,6 +312,9 @@ int UtcDaliSetPropertyP(void)
   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";
index e0b5c9c83a905d75273f2b9ea412f720da226503..3c121c067b915da67f67e04b4033c0968f04ace7 100644 (file)
@@ -44,7 +44,7 @@ namespace
 {
 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)
 {
@@ -99,6 +99,43 @@ Image CreateSolidColorImage( ToolkitTestApplication& application, const Vector4&
 
   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
 
 
@@ -139,6 +176,33 @@ int UtcDaliSuperBlurViewNew(void)
   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;
@@ -153,13 +217,93 @@ int UtcDaliSuperBlurViewSetImage(void)
   // 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);
-  DALI_TEST_EQUALS(blurView.GetRendererCount(), BLUR_LEVELS+1, TEST_LOCATION );
+
+  // 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 );
+  }
+
+  END_TEST;
+}
+
+
 int UtcDaliSuperBlurViewSetGetBlurStrength(void)
 {
   ToolkitTestApplication application;
@@ -220,3 +364,30 @@ int UtcDaliSuperBlurViewGetBlurredImage(void)
 
   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;
+}
index 021216179557005d3824efb7e4bcb40638860f67..b6c4e3b618f8f199b012ac6ab0e7ee13ad929188 100644 (file)
@@ -1390,35 +1390,6 @@ Toolkit::AccessibilityManager::FocusedActorActivatedSignalType& AccessibilityMan
   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
index 1603a02a6d3eaa2518560327a7173a1606997c85..bb2b2756c72b29dd883b2e42690f6b4bb9af95fc 100644 (file)
@@ -220,17 +220,6 @@ public:
    */
   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
 
   /**
index c987ea319cd99398c9a22a771bd241b5e7ff2a74..2a4979b94dcd1d1ef7b2d8cc863ba34dd836302d 100644 (file)
@@ -382,7 +382,7 @@ Property::Value SuperBlurView::GetProperty( BaseObject* object, Property::Index
     {
       Property::Map map;
       Image inputImage = superBlurViewImpl.GetImage();
-      if( !inputImage )
+      if( inputImage )
       {
         Scripting::CreatePropertyMap( inputImage, map );
       }
index 4605cd7b2f7f915539ac4f4bfab6a6bf31925484..2a52cff2b0a5f2b487f3d927264d954b4c866f0c 100644 (file)
@@ -78,9 +78,9 @@ BaseHandle Create()
 
 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()