Adding 'override', removing 'virtual' from overriding functions' declarations in...
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-test-application.h
index a90881c..66527da 100644 (file)
@@ -1,33 +1,39 @@
-#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) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.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://floralicense.org/license/
-//
-// 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.
-//
+/*
+ * 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.
+ * 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 <memory>
 
 // INTERNAL INCLUDES
 #include <dali-test-suite-utils.h>
 
-#include "toolkit-adaptor.h"
-#include "toolkit-orientation.h"
-
 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
 {
@@ -36,43 +42,24 @@ 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( false, surfaceWidth, surfaceHeight, horizontalDpi, verticalDpi )
-  {
-    Initialize();
-  }
-
-  ~ToolkitTestApplication()
-  {
-    // Need to delete core before we delete the adaptor.
-    delete mCore;
-    mCore = NULL;
-  }
+                          float  verticalDpi   = DEFAULT_VERTICAL_DPI );
 
-  inline ToolkitAdaptor& GetAdaptor()
-  {
-    return mAdaptor;
-  }
+  ~ToolkitTestApplication() override;
 
-  //ToolkitOrientation& GetOrientation()
-  //{
-  //return mOrientation;
-  //}
+  /**
+   * @brief Executes the idle callbacks.
+   *
+   * Some controls like the text-field and the text-editor connect callbacks to the
+   * idle signal.
+   */
+  void RunIdles();
 
 private:
-  ToolkitAdaptor mAdaptor;
-  //ToolkitOrientation mOrientation;
+
+  std::unique_ptr<Dali::Window> mMainWindow;
+  std::unique_ptr< Adaptor > mAdaptor;
 };
 
 } // namespace Dali
 
-inline ImageActor CreateSolidColorImageActor(ToolkitTestApplication& application, const Vector4& color, int width, int height)
-{
-  ImageActor actor = ImageActor::New(CreateBitmapImage(width, height, color));
-  application.SendNotification();
-  application.Render();
-  return actor;
-}
-
-
-#endif // __DALI_TOOLKIT_TEST_APPLICATION_H__
+#endif // DALI_TOOLKIT_TEST_APPLICATION_H