From 2d48e440abd0e48ba68957523fd45a62d65b0fc4 Mon Sep 17 00:00:00 2001 From: Joe Konno Date: Wed, 25 Jul 2012 15:50:14 -0700 Subject: [PATCH] EFL: Hover tests, Hoversel basic tests Signed-off-by: Joe Konno --- src/efl/Makefile.am | 1 + src/efl/test_hover.cpp | 81 +++++++++++++++++++++++++++++++++++++++++++++++ src/efl/test_hoversel.cpp | 29 +++++++++++++++++ 3 files changed, 111 insertions(+) create mode 100644 src/efl/test_hoversel.cpp diff --git a/src/efl/Makefile.am b/src/efl/Makefile.am index 4cb5a71..1135640 100644 --- a/src/efl/Makefile.am +++ b/src/efl/Makefile.am @@ -46,6 +46,7 @@ wayland_efl_test_SOURCES = \ test_flipselector.cpp \ test_frame.cpp \ test_hover.cpp \ + test_hoversel.cpp \ test_window.cpp \ ../testmain.cpp diff --git a/src/efl/test_hover.cpp b/src/efl/test_hover.cpp index 4a40745..d3d6423 100644 --- a/src/efl/test_hover.cpp +++ b/src/efl/test_hover.cpp @@ -1,5 +1,12 @@ +#include +#include + +#include "background.h" #include "templates.h" +using std::vector; +using std::string; + class Hover : public EvasObject { public: @@ -10,6 +17,79 @@ public: } }; +class HoverParentTargetTest : public ElmTestHarness +{ +public: + + HoverParentTargetTest() + : ElmTestHarness::ElmTestHarness() + , window_("HoverTargetTest", "Entry Emoticon Test") + , control_(window_) + , button_(elm_button_add(window_)) + { + button_.setPosition(200, 100); + button_.setSize(200, 100); + + return; + } + + void setup() + { + window_.show(); + button_.show(); + + queueCallback( + ModifyCheckCallback( + boost::bind(elm_hover_parent_set, boost::ref(control_), boost::ref(window_)), + boost::bind(&HoverTargetTest::checkParent, boost::ref(*this), boost::ref(window_)) + ) + ); + + queueCallback( + ModifyCheckCallback( + boost::bind(elm_hover_target_set, boost::ref(control_), boost::ref(button_)), + boost::bind(&HoverTargetTest::checkTarget, boost::ref(*this), boost::ref(button_)) + ) + ); + } + + void checkTarget(const Evas_Object *expected) + { + BOOST_CHECK_EQUAL(elm_hover_target_get(control_), expected); + } + + void checkParent(const Evas_Object *expected) + { + BOOST_CHECK_EQUAL(elm_hover_parent_get(control_), expected); + } + +private: + Window window_; + Hover control_; + EvasObject button_; +}; + +/* + positions_.push_back("left"); + positions_.push_back("top-left"); + positions_.push_back("top"); + positions_.push_back("top-right"); + positions_.push_back("right"); + positions_.push_back("bottom-right"); + positions_.push_back("bottom"); + positions_.push_back("bottom-left"); + positions_.push_back("middle"); + positions_.push_back("smart"); +*/ + +/* + styles_.push_back("hoversel_vertical"); + styles_.push_back("default"); + styles_.push_back("menu"); + styles_.push_back("default"); + styles_.push_back("popout"); + styles_.push_back("default"); +*/ typedef ResizeObjectTest HoverResizeTest; typedef PositionObjectTest HoverPositionTest; @@ -22,6 +102,7 @@ BOOST_AUTO_TEST_SUITE(EFL) WAYLAND_ELM_HARNESS_TEST_CASE(HoverResizeTest) WAYLAND_ELM_HARNESS_TEST_CASE(HoverPositionTest) WAYLAND_ELM_HARNESS_TEST_CASE(HoverVisibilityTest) + WAYLAND_ELM_HARNESS_TEST_CASE(HoverParentTest) BOOST_AUTO_TEST_SUITE_END() diff --git a/src/efl/test_hoversel.cpp b/src/efl/test_hoversel.cpp new file mode 100644 index 0000000..997c859 --- /dev/null +++ b/src/efl/test_hoversel.cpp @@ -0,0 +1,29 @@ +#include "templates.h" + +class Hoversel : public EvasObject +{ +public: + Hoversel(EvasObject &parent) + : EvasObject::EvasObject(elm_hoversel_add(parent)) + { + return; + } +}; + + +typedef ResizeObjectTest HoverselResizeTest; +typedef PositionObjectTest HoverselPositionTest; +typedef VisibleObjectTest HoverselVisibilityTest; + +BOOST_AUTO_TEST_SUITE(EFL) + + BOOST_AUTO_TEST_SUITE(Hoversel) + + WAYLAND_ELM_HARNESS_TEST_CASE(HoverselResizeTest) + WAYLAND_ELM_HARNESS_TEST_CASE(HoverselPositionTest) + WAYLAND_ELM_HARNESS_TEST_CASE(HoverselVisibilityTest) + + BOOST_AUTO_TEST_SUITE_END() + +BOOST_AUTO_TEST_SUITE_END() + -- 2.7.4