Processor interface moved from core.h
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-singleton-service.cpp
index d8efd70..7ba5ca4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
  *
  */
 
-#include <dali/devel-api/adaptor-framework/singleton-service.h>
+#include <toolkit-singleton-service.h>
 
-#include <dali/public-api/common/dali-common.h>
+#include <dali-toolkit/public-api/dali-toolkit-common.h>
 #include <dali/public-api/object/base-object.h>
 #include <dali/devel-api/common/map-wrapper.h>
 #include <dali/public-api/signals/dali-signal.h>
+#include <dali/integration-api/processor-interface.h>
 
 namespace Dali
 {
@@ -74,6 +75,13 @@ public:
     if( singleton )
     {
       mSingletonContainer.insert( SingletonPair( info.name(), singleton ) );
+
+      Integration::Processor* processor = dynamic_cast<Integration::Processor*>( &singleton.GetBaseObject() );
+      if( processor )
+      {
+        Integration::Core& core = mTestApplication->GetCore();
+        core.RegisterProcessor( *processor );
+      }
     }
   }
 
@@ -100,6 +108,11 @@ public:
     return object;
   }
 
+  void SetApplication( Dali::TestApplication& testApplication )
+  {
+    mTestApplication = &testApplication;
+  }
+
 private:
 
   /**
@@ -132,6 +145,7 @@ private:
   typedef SingletonContainer::const_iterator SingletonConstIter;
 
   SingletonContainer mSingletonContainer; ///< The container to look up singleton by its type name
+  TestApplication* mTestApplication;
 };
 
 } // namespace Adaptor
@@ -192,3 +206,14 @@ SingletonService::SingletonService( Internal::Adaptor::SingletonService* singlet
 }
 
 } // namespace Dali
+
+
+namespace Test
+{
+
+void SetApplication( Dali::SingletonService singletonService, TestApplication& testApplication )
+{
+  GetImplementation( singletonService ).SetApplication( testApplication );
+}
+
+} // Test