Update UTC for Window 14/40014/2
authorRichard Huang <r.huang@samsung.com>
Wed, 27 May 2015 15:10:33 +0000 (16:10 +0100)
committerRichard Huang <r.huang@samsung.com>
Wed, 27 May 2015 16:00:34 +0000 (09:00 -0700)
Change-Id: Ic1d0a819fe804f26e7cd21d28cabab0fdbfb2961

automated-tests/src/dali-adaptor/utc-Dali-Window.cpp

index 3a082ef..c908977 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <dali/dali.h>
 #include <Ecore_X.h>
+#include <devel-api/adaptor-framework/drag-and-drop-detector.h>
 #include <dali-test-suite-utils.h>
 
 using namespace Dali;
@@ -34,6 +35,8 @@ 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
@@ -60,14 +63,14 @@ Ecore_X_Window ecore_x_window_argb_new(Ecore_X_Window parent, int x, int y, int
 
 }
 
-int UtcDaliToolkitWindowConstructorP(void)
+int UtcDaliWindowConstructorP(void)
 {
   Dali::Window window;
   DALI_TEST_CHECK( !window );
   END_TEST;
 }
 
-int UtcDaliToolkitWindowCopyConstructorP(void)
+int UtcDaliWindowCopyConstructorP(void)
 {
   Dali::Window window;
   Dali::Window copy( window );
@@ -76,10 +79,21 @@ int UtcDaliToolkitWindowCopyConstructorP(void)
   END_TEST;
 }
 
-int UtcDaliToolkitWindowAssignmentOperatorP(void)
+int UtcDaliWindowConstructorFromInternalPointerN(void)
 {
-  Dali::Window window;
-  Dali::Window copy = window;
+  Internal::Adaptor::Window* internalWindow = NULL;
+  Dali::Window window(internalWindow);
+  DALI_TEST_CHECK( !window ); // Should not reach here!
+
+  END_TEST;
+}
+
+int UtcDaliWindowAssignmentOperatorP(void)
+{
+  const Dali::Window window;
+  Dali::Window copy;
+  DALI_TEST_CHECK( ! copy );
+  copy = window;
   DALI_TEST_CHECK( copy == window );
 
   END_TEST;
@@ -112,6 +126,229 @@ int UtcDaliWindowNewN(void)
   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;
+  try
+  {
+    window.SetIndicatorBgOpacity(Dali::Window::OPAQUE);
+    DALI_TEST_CHECK( false ); // Should not reach here!
+  }
+  catch( ... )
+  {
+    DALI_TEST_CHECK( true );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliWindowRotateIndicatorN(void)
+{
+  Dali::Window window;
+  try
+  {
+    window.RotateIndicator(Dali::Window::PORTRAIT);
+    DALI_TEST_CHECK( false ); // Should not reach here!
+  }
+  catch( ... )
+  {
+    DALI_TEST_CHECK( true );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliWindowSetClassN(void)
+{
+  Dali::Window window;
+  try
+  {
+    window.SetClass("window-name", "window-class");
+    DALI_TEST_CHECK( false ); // Should not reach here!
+  }
+  catch( ... )
+  {
+    DALI_TEST_CHECK( true );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliWindowRaiseN(void)
+{
+  Dali::Window window;
+  try
+  {
+    window.Raise();
+    DALI_TEST_CHECK( false ); // Should not reach here!
+  }
+  catch( ... )
+  {
+    DALI_TEST_CHECK( true );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliWindowLowerN(void)
+{
+  Dali::Window window;
+  try
+  {
+    window.Lower();
+    DALI_TEST_CHECK( false ); // Should not reach here!
+  }
+  catch( ... )
+  {
+    DALI_TEST_CHECK( true );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliWindowActivateN(void)
+{
+  Dali::Window window;
+  try
+  {
+    window.Activate();
+    DALI_TEST_CHECK( false ); // Should not reach here!
+  }
+  catch( ... )
+  {
+    DALI_TEST_CHECK( true );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliWindowAddAvailableOrientationN(void)
+{
+  Dali::Window window;
+  try
+  {
+    window.AddAvailableOrientation(Dali::Window::PORTRAIT);
+    DALI_TEST_CHECK( false ); // Should not reach here!
+  }
+  catch( ... )
+  {
+    DALI_TEST_CHECK( true );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliWindowRemoveAvailableOrientationN(void)
+{
+  Dali::Window window;
+  try
+  {
+    window.RemoveAvailableOrientation(Dali::Window::PORTRAIT);
+    DALI_TEST_CHECK( false ); // Should not reach here!
+  }
+  catch( ... )
+  {
+    DALI_TEST_CHECK( true );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliWindowSetPreferredOrientationN(void)
+{
+  Dali::Window window;
+  try
+  {
+    window.SetPreferredOrientation(Dali::Window::PORTRAIT);
+    DALI_TEST_CHECK( false ); // Should not reach here!
+  }
+  catch( ... )
+  {
+    DALI_TEST_CHECK( true );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliWindowGetPreferredOrientationN(void)
+{
+  Dali::Window window;
+  try
+  {
+    Dali::Window::WindowOrientation orientation = window.GetPreferredOrientation();
+    DALI_TEST_CHECK( orientation == Dali::Window::PORTRAIT ); // Should not reach here!
+  }
+  catch( ... )
+  {
+    DALI_TEST_CHECK( true );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliWindowGetDragAndDropDetectorN(void)
+{
+  Dali::Window window;
+  try
+  {
+    DragAndDropDetector detector = window.GetDragAndDropDetector();
+    DALI_TEST_CHECK( !detector ); // Should not reach here!
+  }
+  catch( ... )
+  {
+    DALI_TEST_CHECK( true );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliWindowGetNativeHandleN(void)
+{
+  Dali::Window window;
+  try
+  {
+    Dali::Any handle = window.GetNativeHandle();
+    DALI_TEST_CHECK( false ); // Should not reach here!
+  }
+  catch( ... )
+  {
+    DALI_TEST_CHECK( true );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliWindowIndicatorVisibilityChangedSignalN(void)
+{
+  Dali::Window window;
+  try
+  {
+    window.IndicatorVisibilityChangedSignal();
+    DALI_TEST_CHECK( false ); // Should not reach here!
+  }
+  catch( ... )
+  {
+    DALI_TEST_CHECK( true );
+  }
+
+  END_TEST;
+}