[AT-SPI] Squashed implementation
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-test-application.h
index 1b576bc..85df495 100644 (file)
  *
  */
 
+// EXTERNAL INCLUDES
+#include <memory>
+
 // INTERNAL INCLUDES
 #include <dali-test-suite-utils.h>
 #include <dali/devel-api/text-abstraction/font-client.h>
-#include <dali/integration-api/adaptors/adaptor.h>
+#include <dali/integration-api/adaptor-framework/adaptor.h>
 #include <toolkit-adaptor-impl.h>
-#include <toolkit-singleton-service.h>
+#include <dali/devel-api/adaptor-framework/accessibility.h>
+#include "test-application.h"
+
+#undef assert
 
 namespace Dali
 {
 
+class Adaptor;
+class Window;
+
 /**
  * Adds some functionality on top of TestApplication that is required by the Toolkit.
+ *
+ * This includes creation and destruction of the Adaptor and Window classes.
  */
 class ToolkitTestApplication : public TestApplication
 {
@@ -38,40 +49,9 @@ public:
   ToolkitTestApplication( size_t surfaceWidth  = DEFAULT_SURFACE_WIDTH,
                           size_t surfaceHeight = DEFAULT_SURFACE_HEIGHT,
                           float  horizontalDpi = DEFAULT_HORIZONTAL_DPI,
-                          float  verticalDpi   = DEFAULT_VERTICAL_DPI )
-  : TestApplication( surfaceWidth, surfaceHeight, horizontalDpi, verticalDpi )
-  {
-    auto singletonService = SingletonService::Get();
-    Test::SetApplication( singletonService, *this );
-
-    // set the DPI value for font rendering
-    Dali::TextAbstraction::FontClient fontClient = Dali::TextAbstraction::FontClient::Get();
-    if( fontClient )
-    {
-      fontClient.SetDpi( mDpi.x, mDpi.y );
-    }
-  }
-
-  ~ToolkitTestApplication()
-  {
-    // Need to delete core before we delete the adaptor.
-    delete mCore;
-    mCore = NULL;
-  }
+                          float  verticalDpi   = DEFAULT_VERTICAL_DPI );
 
-  //ToolkitOrientation& GetOrientation()
-  //{
-  //return mOrientation;
-  //}
-
-  /**
-   * @brief Creates an adaptor implementation for those controls like the
-   * text-field and the text-editor which connects a callback to the idle signal.
-   */
-  void CreateAdaptor()
-  {
-    Adaptor::Get();
-  }
+  ~ToolkitTestApplication() override;
 
   /**
    * @brief Executes the idle callbacks.
@@ -79,26 +59,12 @@ public:
    * Some controls like the text-field and the text-editor connect callbacks to the
    * idle signal.
    */
-  void RunIdles()
-  {
-    if( Adaptor::IsAvailable() )
-    {
-      for( Vector<CallbackBase*>::Iterator it = Internal::Adaptor::Adaptor::mCallbacks.Begin(),
-             endIt = Internal::Adaptor::Adaptor::mCallbacks.End();
-           it != endIt;
-           ++it )
-      {
-        CallbackBase* callback = *it;
-
-        CallbackBase::Execute( *callback );
-      }
-
-      Internal::Adaptor::Adaptor::mCallbacks.Clear();
-    }
-  }
+  void RunIdles();
 
 private:
-  //ToolkitOrientation mOrientation;
+
+  std::unique_ptr<Dali::Window> mMainWindow;
+  std::unique_ptr< Adaptor > mAdaptor;
 };
 
 } // namespace Dali