From: Joe Konno Date: Thu, 2 Aug 2012 00:24:45 +0000 (-0700) Subject: EFL: add (deactivated) Window tests X-Git-Tag: upstream/0.2.1~252 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7e9d005f5ad06d281f808a162f402361cc74d421;p=test%2Fgeneric%2Fwayland-fits.git EFL: add (deactivated) Window tests Blocked by NULL deref issues within EFL, or test framework shortcomings, in the case of the Alpha (transparency) test. Signed-off-by: Joe Konno --- diff --git a/src/efl/test_window.cpp b/src/efl/test_window.cpp index fce162e..6d2511d 100644 --- a/src/efl/test_window.cpp +++ b/src/efl/test_window.cpp @@ -283,6 +283,144 @@ private: vector degrees_; }; +class WindowAlphaTest : public ElmTestHarness +{ +public: + WindowAlphaTest() + : ElmTestHarness::ElmTestHarness() + , window_("WindowAlphaTest", "Window Alpha Test") + { + return; + } + + void setup() + { + window_.show(); + + queueCallback( + ModifyCheckCallback( + boost::bind(elm_win_alpha_set, boost::ref(window_), EINA_TRUE), + boost::bind(&WindowAlphaTest::checkAlpha, boost::ref(*this), EINA_TRUE) + ) + ); + + queueCallback( + ModifyCheckCallback( + boost::bind(elm_win_alpha_set, boost::ref(window_), EINA_FALSE), + boost::bind(&WindowAlphaTest::checkAlpha, boost::ref(*this), EINA_FALSE) + ) + ); + + queueCallback( + ModifyCheckCallback( + boost::bind(elm_win_alpha_set, boost::ref(window_), EINA_TRUE), + boost::bind(&WindowAlphaTest::checkAlpha, boost::ref(*this), EINA_TRUE) + ) + ); + + } + + void checkAlpha(const Eina_Bool expected) + { + BOOST_CHECK_EQUAL(elm_win_alpha_get(window_), expected); + } + +private: + Window window_; +}; + +class WindowIndicatorTest : public ElmTestHarness +{ +public: + WindowIndicatorTest() + : ElmTestHarness::ElmTestHarness() + , window_("WindowIndicatorTest", "Window Indicator Test") + { + return; + } + + void setup() + { + window_.show(); + + queueCallback( + ModifyCheckCallback( + boost::bind(elm_win_indicator_mode_set, boost::ref(window_), ELM_WIN_INDICATOR_SHOW), + boost::bind(&WindowIndicatorTest::checkIndicator, boost::ref(*this), ELM_WIN_INDICATOR_SHOW) + ) + ); + + queueCallback( + ModifyCheckCallback( + boost::bind(elm_win_indicator_mode_set, boost::ref(window_), ELM_WIN_INDICATOR_HIDE), + boost::bind(&WindowIndicatorTest::checkIndicator, boost::ref(*this), ELM_WIN_INDICATOR_HIDE) + ) + ); + + queueCallback( + ModifyCheckCallback( + boost::bind(elm_win_indicator_mode_set, boost::ref(window_), ELM_WIN_INDICATOR_SHOW), + boost::bind(&WindowIndicatorTest::checkIndicator, boost::ref(*this), ELM_WIN_INDICATOR_SHOW) + ) + ); + } + + void checkIndicator(const Elm_Win_Indicator_Mode expected) + { + BOOST_CHECK_EQUAL(elm_win_indicator_mode_get(window_), expected); + } + +private: + Window window_; +}; + +class WindowIndicatorOpacityTest : public ElmTestHarness +{ +public: + WindowIndicatorOpacityTest() + : ElmTestHarness::ElmTestHarness() + , window_("WindowIndicatorOpacityTest", "Window Indicator Opacity Test") + { + modes_.push_back(ELM_WIN_INDICATOR_OPAQUE); + modes_.push_back(ELM_WIN_INDICATOR_TRANSLUCENT); + modes_.push_back(ELM_WIN_INDICATOR_TRANSPARENT); + + return; + } + + void setup() + { + window_.show(); + + vector::iterator it; + for (it = modes_.begin(); it != modes_.end(); it++) + { + queueCallback( + ModifyCheckCallback( + boost::bind(elm_win_indicator_opacity_set, boost::ref(window_), *it), + boost::bind(&WindowIndicatorOpacityTest::checkOpacity, boost::ref(*this), *it) + ) + ); + + queueCallback( + ModifyCheckCallback( + boost::bind(elm_win_indicator_opacity_set, boost::ref(window_), ELM_WIN_INDICATOR_OPAQUE), + boost::bind(&WindowIndicatorOpacityTest::checkOpacity, boost::ref(*this), ELM_WIN_INDICATOR_OPAQUE) + ) + ); + } + } + + void checkOpacity(const Elm_Win_Indicator_Opacity_Mode expected) + { + BOOST_CHECK_EQUAL(elm_win_indicator_opacity_get(window_), expected); + } + +private: + Window window_; + vector modes_; +}; + BOOST_AUTO_TEST_SUITE(EFL) BOOST_AUTO_TEST_SUITE(Window) @@ -295,7 +433,18 @@ BOOST_AUTO_TEST_SUITE(EFL) WAYLAND_ELM_HARNESS_TEST_CASE(WindowStickyTest) WAYLAND_ELM_HARNESS_TEST_CASE(WindowWithdrawnTest) WAYLAND_ELM_HARNESS_TEST_CASE(WindowRotationTest) + +/* XXX: The Window ctor uses a convenience function that creates a bare bg, + XXX: covering transparency-- need to have Window inherit from WindowBase + XXX: or something. + WAYLAND_ELM_HARNESS_TEST_CASE(WindowAlphaTest) +*/ +/* XXX: blocked by Wayland #53018 + WAYLAND_ELM_HARNESS_TEST_CASE(WindowIndicatorTest) + WAYLAND_ELM_HARNESS_TEST_CASE(WindowIndicatorOpacityTest) +*/ + BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()