Update common test util
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-test-application.h
index 40280a0..5cc5bef 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_TEST_APPLICATION_H__
 
 /*
- * Copyright (c) 2014 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.
@@ -21,8 +21,8 @@
 // INTERNAL INCLUDES
 #include <dali-test-suite-utils.h>
 #include <dali/devel-api/text-abstraction/font-client.h>
-
-#include "toolkit-orientation.h"
+#include <dali/integration-api/adaptors/adaptor.h>
+#include <toolkit-adaptor-impl.h>
 
 namespace Dali
 {
@@ -62,6 +62,39 @@ public:
   //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();
+  }
+
+  /**
+   * @brief Executes the idle callbacks.
+   *
+   * 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();
+    }
+  }
+
 private:
   //ToolkitOrientation mOrientation;
 };