Merge "Changed 'virtual' function override declarations to 'override' in automated...
[platform/core/uifw/dali-adaptor.git] / automated-tests / src / dali-adaptor / utc-Dali-Window.cpp
index c908977..b02764a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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/dali.h>
-#include <Ecore_X.h>
-#include <devel-api/adaptor-framework/drag-and-drop-detector.h>
+#include <dali/devel-api/adaptor-framework/window-devel.h>
+#include <dali/internal/system/linux/dali-ecore-x.h>
 #include <dali-test-suite-utils.h>
 
+
 using namespace Dali;
 
 void utc_dali_window_startup(void)
@@ -35,8 +36,6 @@ void utc_dali_window_cleanup(void)
 namespace
 {
 
-class Internal::Adaptor::Window;
-
 intptr_t screenId = 0; // intptr_t has the same size as a pointer and is platform independent so this can be returned as a pointer in ecore_x_default_screen_get below without compilation warnings
 
 } // unnamed namespace
@@ -123,52 +122,17 @@ int UtcDaliWindowNewN(void)
     DALI_TEST_ASSERT( e, "Failed to create X window", TEST_LOCATION );
   }
 
-  END_TEST;
-}
-
-int UtcDaliWindowShowIndicatorN(void)
-{
-  Dali::Window window;
-  try
-  {
-    window.ShowIndicator(Dali::Window::VISIBLE);
-    DALI_TEST_CHECK( false ); // Should not reach here!
-  }
-  catch( ... )
-  {
-    DALI_TEST_CHECK( true );
-  }
-
-  END_TEST;
-}
-
-int UtcDaliWindowSetIndicatorBgOpacityN(void)
-{
-  Dali::Window window;
+  // Attempt to create a new window
   try
   {
-    window.SetIndicatorBgOpacity(Dali::Window::OPAQUE);
-    DALI_TEST_CHECK( false ); // Should not reach here!
-  }
-  catch( ... )
-  {
-    DALI_TEST_CHECK( true );
-  }
-
-  END_TEST;
-}
+    PositionSize windowPosition(0, 0, 0, 0);
+    Dali::Window window = Dali::Window::New( windowPosition, "test-window", "test-window-class", true );
 
-int UtcDaliWindowRotateIndicatorN(void)
-{
-  Dali::Window window;
-  try
-  {
-    window.RotateIndicator(Dali::Window::PORTRAIT);
-    DALI_TEST_CHECK( false ); // Should not reach here!
+    tet_result( TET_FAIL );
   }
-  catch( ... )
+  catch ( DaliException& e )
   {
-    DALI_TEST_CHECK( true );
+    DALI_TEST_ASSERT( e, "Failed to create X window", TEST_LOCATION );
   }
 
   END_TEST;
@@ -302,13 +266,13 @@ int UtcDaliWindowGetPreferredOrientationN(void)
   END_TEST;
 }
 
-int UtcDaliWindowGetDragAndDropDetectorN(void)
+int UtcDaliWindowGetNativeHandleN(void)
 {
   Dali::Window window;
   try
   {
-    DragAndDropDetector detector = window.GetDragAndDropDetector();
-    DALI_TEST_CHECK( !detector ); // Should not reach here!
+    Dali::Any handle = window.GetNativeHandle();
+    DALI_TEST_CHECK( false ); // Should not reach here!
   }
   catch( ... )
   {
@@ -318,12 +282,12 @@ int UtcDaliWindowGetDragAndDropDetectorN(void)
   END_TEST;
 }
 
-int UtcDaliWindowGetNativeHandleN(void)
+int UtcDaliWindowSetAcceptFocusN(void)
 {
   Dali::Window window;
   try
   {
-    Dali::Any handle = window.GetNativeHandle();
+    window.SetAcceptFocus( true );
     DALI_TEST_CHECK( false ); // Should not reach here!
   }
   catch( ... )
@@ -334,12 +298,12 @@ int UtcDaliWindowGetNativeHandleN(void)
   END_TEST;
 }
 
-int UtcDaliWindowIndicatorVisibilityChangedSignalN(void)
+int UtcDaliWindowIsFocusAcceptableN(void)
 {
   Dali::Window window;
   try
   {
-    window.IndicatorVisibilityChangedSignal();
+    window.IsFocusAcceptable();
     DALI_TEST_CHECK( false ); // Should not reach here!
   }
   catch( ... )
@@ -350,6 +314,18 @@ int UtcDaliWindowIndicatorVisibilityChangedSignalN(void)
   END_TEST;
 }
 
+int UtcDaliWindowFocusChangeSignalN(void)
+{
+  Dali::Window window;
+  try
+  {
+    window.FocusChangeSignal();
+    DALI_TEST_CHECK( false ); // Should not reach here!
+  }
+  catch( ... )
+  {
+    DALI_TEST_CHECK( true );
+  }
 
-
-
+  END_TEST;
+}