/*
- * Copyright (c) 2019 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-test-suite-utils.h>
-
-namespace Dali
-{
-class DragAndDropDetector : public BaseHandle {}; // For UtcDaliWindowGetDragAndDropDetectorN
-}
+#include <dali/dali.h>
+#include <dali/devel-api/adaptor-framework/window-devel.h>
+#include <dali/internal/system/linux/dali-ecore-x.h>
using namespace Dali;
namespace
{
-
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
extern "C"
{
+ Ecore_X_Screen* ecore_x_default_screen_get(void)
+ {
+ screenId += 8;
+ return (Ecore_X_Screen*)screenId;
+ }
-Ecore_X_Screen* ecore_x_default_screen_get(void)
-{
- screenId += 8;
- return (Ecore_X_Screen*)screenId;
-}
-
-void ecore_x_screen_size_get(const Ecore_X_Screen *screen, int *w, int *h)
-{
- *w = 100;
- *h = 100;
-}
-
-Ecore_X_Window ecore_x_window_argb_new(Ecore_X_Window parent, int x, int y, int w, int h)
-{
- return 0;
-}
+ void ecore_x_screen_size_get(const Ecore_X_Screen* screen, int* w, int* h)
+ {
+ *w = 100;
+ *h = 100;
+ }
+ Ecore_X_Window ecore_x_window_argb_new(Ecore_X_Window parent, int x, int y, int w, int h)
+ {
+ return 0;
+ }
}
int UtcDaliWindowConstructorP(void)
{
Dali::Window window;
- DALI_TEST_CHECK( !window );
+ DALI_TEST_CHECK(!window);
END_TEST;
}
int UtcDaliWindowCopyConstructorP(void)
{
Dali::Window window;
- Dali::Window copy( window );
- DALI_TEST_CHECK( copy == window );
+ Dali::Window copy(window);
+ DALI_TEST_CHECK(copy == window);
END_TEST;
}
int UtcDaliWindowConstructorFromInternalPointerN(void)
{
Internal::Adaptor::Window* internalWindow = NULL;
- Dali::Window window(internalWindow);
- DALI_TEST_CHECK( !window ); // Should not reach here!
+ 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 );
+ Dali::Window copy;
+ DALI_TEST_CHECK(!copy);
copy = window;
- DALI_TEST_CHECK( copy == window );
+ DALI_TEST_CHECK(copy == window);
END_TEST;
}
Dali::Window* window = new Dali::Window();
delete window;
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
END_TEST;
}
try
{
PositionSize windowPosition(0, 0, 0, 0);
- Dali::Window window = Dali::Window::New( windowPosition, "test-window", true );
+ Dali::Window window = Dali::Window::New(windowPosition, "test-window", true);
- tet_result( TET_FAIL );
+ tet_result(TET_FAIL);
}
- catch ( DaliException& e )
+ catch(DaliException& e)
{
- DALI_TEST_ASSERT( e, "Failed to create X window", TEST_LOCATION );
+ 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 );
+ Dali::Window window = Dali::Window::New(windowPosition, "test-window", "test-window-class", true);
- tet_result( TET_FAIL );
+ tet_result(TET_FAIL);
}
- catch ( DaliException& e )
+ catch(DaliException& e)
{
- 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;
- 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 );
+ DALI_TEST_ASSERT(e, "Failed to create X window", TEST_LOCATION);
}
END_TEST;
try
{
window.SetClass("window-name", "window-class");
- DALI_TEST_CHECK( false ); // Should not reach here!
+ DALI_TEST_CHECK(false); // Should not reach here!
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
try
{
window.Raise();
- DALI_TEST_CHECK( false ); // Should not reach here!
+ DALI_TEST_CHECK(false); // Should not reach here!
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
try
{
window.Lower();
- DALI_TEST_CHECK( false ); // Should not reach here!
+ DALI_TEST_CHECK(false); // Should not reach here!
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
try
{
window.Activate();
- DALI_TEST_CHECK( false ); // Should not reach here!
+ DALI_TEST_CHECK(false); // Should not reach here!
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
try
{
window.AddAvailableOrientation(Dali::Window::PORTRAIT);
- DALI_TEST_CHECK( false ); // Should not reach here!
+ DALI_TEST_CHECK(false); // Should not reach here!
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
try
{
window.RemoveAvailableOrientation(Dali::Window::PORTRAIT);
- DALI_TEST_CHECK( false ); // Should not reach here!
+ DALI_TEST_CHECK(false); // Should not reach here!
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
try
{
window.SetPreferredOrientation(Dali::Window::PORTRAIT);
- DALI_TEST_CHECK( false ); // Should not reach here!
+ DALI_TEST_CHECK(false); // Should not reach here!
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
try
{
Dali::Window::WindowOrientation orientation = window.GetPreferredOrientation();
- DALI_TEST_CHECK( orientation == Dali::Window::PORTRAIT ); // Should not reach here!
+ DALI_TEST_CHECK(orientation == Dali::Window::PORTRAIT); // Should not reach here!
}
- catch( ... )
+ 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 );
+ DALI_TEST_CHECK(true);
}
END_TEST;
try
{
Dali::Any handle = window.GetNativeHandle();
- DALI_TEST_CHECK( false ); // Should not reach here!
+ DALI_TEST_CHECK(false); // Should not reach here!
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
Dali::Window window;
try
{
- window.SetAcceptFocus( true );
- DALI_TEST_CHECK( false ); // Should not reach here!
+ window.SetAcceptFocus(true);
+ DALI_TEST_CHECK(false); // Should not reach here!
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
try
{
window.IsFocusAcceptable();
- 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!
+ DALI_TEST_CHECK(false); // Should not reach here!
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;
}
-int UtcDaliWindowFocusChangedSignalN(void)
+int UtcDaliWindowFocusChangeSignalN(void)
{
Dali::Window window;
try
{
- window.FocusChangedSignal();
- DALI_TEST_CHECK( false ); // Should not reach here!
+ window.FocusChangeSignal();
+ DALI_TEST_CHECK(false); // Should not reach here!
}
- catch( ... )
+ catch(...)
{
- DALI_TEST_CHECK( true );
+ DALI_TEST_CHECK(true);
}
END_TEST;