Add Window::SetLayout method
[platform/core/uifw/dali-adaptor.git] / automated-tests / src / dali-adaptor / utc-Dali-Window.cpp
index db19976..19100ce 100644 (file)
@@ -198,6 +198,104 @@ int UtcDaliWindowActivateN(void)
   END_TEST;
 }
 
+int UtcDaliWindowMaximizeN(void)
+{
+  try
+  {
+    Dali::Window instance;
+    DevelWindow::Maximize(instance, true);
+    DALI_TEST_CHECK(false); // Should not reach here!
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true);
+  }
+
+  END_TEST;
+}
+
+int UtcDaliWindowIsMaximizedN(void)
+{
+  try
+  {
+    Dali::Window instance;
+    DevelWindow::IsMaximized(instance);
+    DALI_TEST_CHECK(false); // Should not reach here!
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true);
+  }
+
+  END_TEST;
+}
+
+int UtcDaliWindowSetMaximumSizeN(void)
+{
+  try
+  {
+    Dali::Window             instance;
+    Dali::Window::WindowSize size(100, 100);
+    DevelWindow::SetMaximumSize(instance, size);
+    DALI_TEST_CHECK(false); // Should not reach here!
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true);
+  }
+
+  END_TEST;
+}
+
+int UtcDaliWindowMinimizeN(void)
+{
+  try
+  {
+    Dali::Window instance;
+    DevelWindow::Minimize(instance, true);
+    DALI_TEST_CHECK(false); // Should not reach here!
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true);
+  }
+
+  END_TEST;
+}
+
+int UtcDaliWindowIsMinimizedN(void)
+{
+  try
+  {
+    Dali::Window instance;
+    DevelWindow::IsMinimized(instance);
+    DALI_TEST_CHECK(false); // Should not reach here!
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true);
+  }
+
+  END_TEST;
+}
+
+int UtcDaliWindowSetMimimumSizeN(void)
+{
+  try
+  {
+    Dali::Window             instance;
+    Dali::Window::WindowSize size(100, 100);
+    DevelWindow::SetMimimumSize(instance, size);
+    DALI_TEST_CHECK(false); // Should not reach here!
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true);
+  }
+
+  END_TEST;
+}
+
 int UtcDaliWindowAddAvailableOrientationN(void)
 {
   Dali::Window window;
@@ -262,6 +360,22 @@ int UtcDaliWindowGetPreferredOrientationN(void)
   END_TEST;
 }
 
+int UtcDaliWindowSetPositionSizeWithOrientationN(void)
+{
+  Dali::Window window;
+  try
+  {
+    DevelWindow::SetPositionSizeWithOrientation(window, PositionSize(0, 0, 200, 100), Dali::WindowOrientation::PORTRAIT);
+    DALI_TEST_CHECK(false); // Should not reach here!
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true);
+  }
+
+  END_TEST;
+}
+
 int UtcDaliWindowGetNativeHandleN(void)
 {
   Dali::Window window;
@@ -331,7 +445,7 @@ int UtcDaliWindowSetPositionNegative(void)
   Dali::Window instance;
   try
   {
-    Dali::Uint16Pair arg1;
+    Dali::Window::WindowPosition arg1;
     instance.SetPosition(arg1);
     DALI_TEST_CHECK(false); // Should not get here
   }
@@ -474,7 +588,7 @@ int UtcDaliWindowAddAuxiliaryHintNegative(void)
   {
     std::string arg1;
     std::string arg2;
-    instance.AddAuxiliaryHint(arg1,arg2);
+    instance.AddAuxiliaryHint(arg1, arg2);
     DALI_TEST_CHECK(false); // Should not get here
   }
   catch(...)
@@ -584,8 +698,8 @@ int UtcDaliWindowSetAuxiliaryHintValueNegative(void)
   try
   {
     unsigned int arg1(0u);
-    std::string arg2;
-    instance.SetAuxiliaryHintValue(arg1,arg2);
+    std::string  arg2;
+    instance.SetAuxiliaryHintValue(arg1, arg2);
     DALI_TEST_CHECK(false); // Should not get here
   }
   catch(...)
@@ -804,7 +918,7 @@ int UtcDaliWindowSetClassNegative(void)
   {
     std::string arg1;
     std::string arg2;
-    instance.SetClass(arg1,arg2);
+    instance.SetClass(arg1, arg2);
     DALI_TEST_CHECK(false); // Should not get here
   }
   catch(...)
@@ -829,6 +943,22 @@ int UtcDaliWindowGetPositionNegative(void)
   END_TEST;
 }
 
+int UtcDaliWindowSetLayoutNegative(void)
+{
+  Dali::Window instance;
+  try
+  {
+    unsigned int arg1(0);
+    instance.SetLayout(arg1, arg1, arg1, arg1, arg1, arg1);
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
 int UtcDaliWindowGetRootLayerNegative(void)
 {
   Dali::Window instance;
@@ -1122,9 +1252,9 @@ int UtcDaliWindowSetPositionSizeNegative(void)
 {
   try
   {
-    Dali::Window arg1;
+    Dali::Window    arg1;
     Dali::Rect<int> arg2;
-    DevelWindow::SetPositionSize(arg1,arg2);
+    DevelWindow::SetPositionSize(arg1, arg2);
     DALI_TEST_CHECK(false); // Should not get here
   }
   catch(...)
@@ -1198,10 +1328,10 @@ int UtcDaliWindowAddFrameRenderedCallbackNegative(void)
 {
   try
   {
-    Dali::Window arg1;
+    Dali::Window                        arg1;
     std::unique_ptr<Dali::CallbackBase> arg2;
-    int arg3(0);
-    DevelWindow::AddFrameRenderedCallback(arg1,std::move(arg2),arg3);
+    int                                 arg3(0);
+    DevelWindow::AddFrameRenderedCallback(arg1, std::move(arg2), arg3);
     DALI_TEST_CHECK(false); // Should not get here
   }
   catch(...)
@@ -1215,9 +1345,9 @@ int UtcDaliWindowSetAvailableOrientationsNegative(void)
 {
   try
   {
-    Dali::Window arg1;
+    Dali::Window                          arg1;
     Dali::Vector<Dali::WindowOrientation> arg2;
-    DevelWindow::SetAvailableOrientations(arg1,arg2);
+    DevelWindow::SetAvailableOrientations(arg1, arg2);
     DALI_TEST_CHECK(false); // Should not get here
   }
   catch(...)
@@ -1231,10 +1361,10 @@ int UtcDaliWindowAddFramePresentedCallbackNegative(void)
 {
   try
   {
-    Dali::Window arg1;
+    Dali::Window                        arg1;
     std::unique_ptr<Dali::CallbackBase> arg2;
-    int arg3(0);
-    DevelWindow::AddFramePresentedCallback(arg1,std::move(arg2),arg3);
+    int                                 arg3(0);
+    DevelWindow::AddFramePresentedCallback(arg1, std::move(arg2), arg3);
     DALI_TEST_CHECK(false); // Should not get here
   }
   catch(...)
@@ -1325,7 +1455,135 @@ int UtcDaliWindowSetParentNegative(void)
   {
     Dali::Window arg1;
     Dali::Window arg2;
-    DevelWindow::SetParent(arg1,arg2);
+    DevelWindow::SetParent(arg1, arg2);
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliWindowSetParentWithBelowParentNegative(void)
+{
+  try
+  {
+    Dali::Window arg1;
+    Dali::Window arg2;
+    DevelWindow::SetParent(arg1, arg2, true);
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliWindowAddInputRegion(void)
+{
+  Dali::Window instance;
+  try
+  {
+    Rect<int> includedInputRegion(0, 0, 720, 640);
+    DevelWindow::IncludeInputRegion(instance, includedInputRegion);
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliWindowSubtractInputRegion(void)
+{
+  Dali::Window instance;
+  try
+  {
+    Rect<int> includedInputRegion(0, 0, 720, 1280);
+    DevelWindow::IncludeInputRegion(instance, includedInputRegion);
+
+    Rect<int> excludedInputRegion(0, 641, 720, 640);
+    DevelWindow::ExcludeInputRegion(instance, excludedInputRegion);
+
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliWindowSetNeedsRotationCompletedAcknowledgementNegative(void)
+{
+  try
+  {
+    Dali::Window arg1;
+    DevelWindow::SetNeedsRotationCompletedAcknowledgement(arg1, true);
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliWindowUnsetNeedsRotationCompletedAcknowledgementNegative(void)
+{
+  try
+  {
+    Dali::Window arg1;
+    DevelWindow::SetNeedsRotationCompletedAcknowledgement(arg1, false);
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliWindowSendRotationCompletedAcknowledgementNegative(void)
+{
+  try
+  {
+    Dali::Window arg1;
+    DevelWindow::SendRotationCompletedAcknowledgement(arg1);
+
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliWindowMovedSignalNegative(void)
+{
+  Dali::Window instance;
+  try
+  {
+    DevelWindow::MovedSignal(instance);
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliWindowOrientationChangedSignalNegative(void)
+{
+  Dali::Window instance;
+  try
+  {
+    DevelWindow::OrientationChangedSignal(instance);
     DALI_TEST_CHECK(false); // Should not get here
   }
   catch(...)