EFL: Hover tests, Hoversel basic tests
authorJoe Konno <joe.konno@intel.com>
Wed, 25 Jul 2012 22:50:14 +0000 (15:50 -0700)
committerJoe Konno <joe.konno@intel.com>
Tue, 31 Jul 2012 20:40:58 +0000 (13:40 -0700)
Signed-off-by: Joe Konno <joe.konno@intel.com>
src/efl/Makefile.am
src/efl/test_hover.cpp
src/efl/test_hoversel.cpp [new file with mode: 0644]

index 4cb5a71..1135640 100644 (file)
@@ -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
 
index 4a40745..d3d6423 100644 (file)
@@ -1,5 +1,12 @@
+#include <vector>
+#include <string>
+
+#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<Hover> HoverResizeTest;
 typedef PositionObjectTest<Hover> 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 (file)
index 0000000..997c859
--- /dev/null
@@ -0,0 +1,29 @@
+#include "templates.h"
+
+class Hoversel : public EvasObject
+{
+public:
+       Hoversel(EvasObject &parent)
+               : EvasObject::EvasObject(elm_hoversel_add(parent))
+       {
+               return;
+       }
+};
+
+
+typedef ResizeObjectTest<Hoversel> HoverselResizeTest;
+typedef PositionObjectTest<Hoversel> HoverselPositionTest;
+typedef VisibleObjectTest<Hoversel> 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()
+