From: Joe Konno Date: Mon, 11 Jun 2012 19:42:47 +0000 (-0700) Subject: test_window: add iconify, maximize tests X-Git-Tag: upstream/0.2.1~335 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e4176d2c706735498ff2d408b1d9e58a9cbac542;p=test%2Fgeneric%2Fwayland-fits.git test_window: add iconify, maximize tests Added simple test stubs for iconify and un-iconify. Also known as minimize and un-minimize. In addition, simple tests for maxmize. Signed-off-by: Joe Konno --- diff --git a/src/efl/test_window.cpp b/src/efl/test_window.cpp index 427fdaf..74e9f70 100644 --- a/src/efl/test_window.cpp +++ b/src/efl/test_window.cpp @@ -83,9 +83,88 @@ private: Window window_; }; +class WindowIconifyTest : public ElmTestHarness +{ +public: + WindowIconifyTest() + : ElmTestHarness::ElmTestHarness() + , window_("WindowIconifyTest", "Window Iconify/Minimize Test") + { + return; + } + + void setup() + { + window_.show(); + + queueCallback( + ModifyCheckCallback( + boost::bind(&Window::iconify, boost::ref(window_), EINA_TRUE), + boost::bind(&WindowIconifyTest::checkIconified, boost::ref(*this), EINA_TRUE) + ) + ); + + queueCallback( + ModifyCheckCallback( + boost::bind(&Window::iconify, boost::ref(window_), EINA_FALSE), + boost::bind(&WindowIconifyTest::checkIconified, boost::ref(*this), EINA_FALSE) + ) + ); + } + + void checkIconified(Eina_Bool isIconified) + { + BOOST_CHECK_EQUAL(window_.isIconified(), isIconified); + } + +private: + Window window_; +}; + +class WindowMaximizeTest : public ElmTestHarness +{ +public: + WindowMaximizeTest() + : ElmTestHarness::ElmTestHarness() + , window_("WindowMaximizeTest", "Window Maximize Test") + { + return; + } + + void setup() + { + window_.show(); + + queueCallback( + ModifyCheckCallback( + boost::bind(&Window::maximize, boost::ref(window_), EINA_TRUE), + boost::bind(&WindowMaximizeTest::checkMaximized, boost::ref(*this), EINA_TRUE) + ) + ); + + queueCallback( + ModifyCheckCallback( + boost::bind(&Window::maximize, boost::ref(window_), EINA_FALSE), + boost::bind(&WindowMaximizeTest::checkMaximized, boost::ref(*this), EINA_FALSE) + ) + ); + } + + void checkMaximized(Eina_Bool isMaximized) + { + BOOST_CHECK_EQUAL(window_.isMaximized(), isMaximized); + } + +private: + Window window_; +}; + + BOOST_AUTO_TEST_SUITE(Wayland_EFL_Window_Suite) WAYLAND_ELM_HARNESS_TEST_CASE(WindowResizeTest) WAYLAND_ELM_HARNESS_TEST_CASE(WindowMoveTest) + WAYLAND_ELM_HARNESS_TEST_CASE(WindowIconifyTest) + WAYLAND_ELM_HARNESS_TEST_CASE(WindowMaximizeTest) BOOST_AUTO_TEST_SUITE_END() diff --git a/src/efl/window.cpp b/src/efl/window.cpp index 374426a..a6c4651 100644 --- a/src/efl/window.cpp +++ b/src/efl/window.cpp @@ -10,3 +10,23 @@ Window::Window(const std::string& name, const std::string& title, const unsigned setSize(width, height); } + +void Window::iconify(Eina_Bool iconify) +{ + elm_win_iconified_set(*this, iconify); +} + +Eina_Bool Window::isIconified() +{ + return elm_win_iconified_get(*this); +} + +void Window::maximize(Eina_Bool maximize) +{ + elm_win_maximized_set(*this, maximize); +} + +Eina_Bool Window::isMaximized() +{ + return elm_win_maximized_get(*this); +} \ No newline at end of file diff --git a/src/efl/window.h b/src/efl/window.h index 17c73c0..c6c7077 100644 --- a/src/efl/window.h +++ b/src/efl/window.h @@ -9,6 +9,12 @@ class Window : public EvasObject { public: Window(const std::string& = "name", const std::string& = "title", const unsigned = 50, const unsigned = 50); + + void iconify(Eina_Bool iconify); + void maximize(Eina_Bool maximize); + + Eina_Bool isIconified(); + Eina_Bool isMaximized(); }; #endif