/*
- * 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 <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)
}
-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 );
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;
DALI_TEST_ASSERT( e, "Failed to create X window", TEST_LOCATION );
}
+ // Attempt to create a new window
+ try
+ {
+ PositionSize windowPosition(0, 0, 0, 0);
+ Dali::Window window = Dali::Window::New( windowPosition, "test-window", "test-window-class", true );
+
+ tet_result( TET_FAIL );
+ }
+ catch ( DaliException& e )
+ {
+ DALI_TEST_ASSERT( e, "Failed to create X window", TEST_LOCATION );
+ }
+
+ 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 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 UtcDaliWindowSetAcceptFocusN(void)
+{
+ Dali::Window window;
+ try
+ {
+ window.SetAcceptFocus( true );
+ DALI_TEST_CHECK( false ); // Should not reach here!
+ }
+ catch( ... )
+ {
+ DALI_TEST_CHECK( true );
+ }
+
+ END_TEST;
+}
+
+int UtcDaliWindowIsFocusAcceptableN(void)
+{
+ Dali::Window window;
+ try
+ {
+ window.IsFocusAcceptable();
+ DALI_TEST_CHECK( false ); // Should not reach here!
+ }
+ catch( ... )
+ {
+ DALI_TEST_CHECK( true );
+ }
+
+ 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;
+}