Basic support of keyboard focus for multiple windows
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-test-application.h
index 5cc5bef..de2d0c4 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_TEST_APPLICATION_H__
-#define __DALI_TOOLKIT_TEST_APPLICATION_H__
+#ifndef DALI_TOOLKIT_TEST_APPLICATION_H
+#define DALI_TOOLKIT_TEST_APPLICATION_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -23,6 +23,8 @@
 #include <dali/devel-api/text-abstraction/font-client.h>
 #include <dali/integration-api/adaptors/adaptor.h>
 #include <toolkit-adaptor-impl.h>
+#include <toolkit-singleton-service.h>
+#include <toolkit-lifecycle-controller.h>
 
 namespace Dali
 {
@@ -38,9 +40,10 @@ public:
                           size_t surfaceHeight = DEFAULT_SURFACE_HEIGHT,
                           float  horizontalDpi = DEFAULT_HORIZONTAL_DPI,
                           float  verticalDpi   = DEFAULT_VERTICAL_DPI )
-  : TestApplication( false, surfaceWidth, surfaceHeight, horizontalDpi, verticalDpi )
+  : TestApplication( surfaceWidth, surfaceHeight, horizontalDpi, verticalDpi )
   {
-    Initialize();
+    auto singletonService = SingletonService::Get();
+    Test::SetApplication( singletonService, *this );
 
     // set the DPI value for font rendering
     Dali::TextAbstraction::FontClient fontClient = Dali::TextAbstraction::FontClient::Get();
@@ -48,6 +51,19 @@ public:
     {
       fontClient.SetDpi( mDpi.x, mDpi.y );
     }
+
+    bool isAdaptorAvailable = Dali::Internal::Adaptor::Adaptor::Get().IsAvailable();
+    if ( isAdaptorAvailable )
+    {
+      Dali::LifecycleController lifecycleController = Dali::LifecycleController::Get();
+      lifecycleController.InitSignal().Emit();
+
+      Dali::Window window = Dali::Internal::Adaptor::Adaptor::mWindows.front();
+      if ( window )
+      {
+        Dali::Internal::Adaptor::Adaptor::WindowCreatedSignal().Emit( window );
+      }
+    }
   }
 
   ~ToolkitTestApplication()
@@ -101,4 +117,4 @@ private:
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_TEST_APPLICATION_H__
+#endif // DALI_TOOLKIT_TEST_APPLICATION_H