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 051126e..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)
@@ -121,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;
@@ -300,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( ... )
   {
@@ -316,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( ... )
@@ -332,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( ... )
@@ -348,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;
+}