evas_object_show(*this);
}
+void EvasObject::hide()
+{
+ evas_object_hide(*this);
+}
+
const int EvasObject::getX()
{
int x;
{
BOOST_CHECK_EQUAL(this->isVisible(), isVisible);
}
+
+void EvasObject::checkHidden(const Eina_Bool isHidden)
+{
+ BOOST_CHECK_EQUAL(this->isVisible(), (isHidden == EINA_TRUE ? EINA_FALSE : EINA_TRUE));
+}
void setSize(int w, int h);
void setPosition(int x, int y);
void show();
+ void hide();
const int getWidth();
const int getHeight();
void checkSize(const int width, const int height);
void checkPosition(const int x, const int y);
void checkVisible(const Eina_Bool isVisible);
+ void checkHidden(const Eina_Bool isHidden);
private:
Evas_Object* obj_;
};
-#define SET_CHECK_SIZE(obj, w, h)\
+#define EFL_CHECK_SIZE(obj, w, h)\
queueCallback( \
ModifyCheckCallback( \
boost::bind(&EvasObject::setSize, boost::ref(obj), w, h), \
) \
)
-#define SET_CHECK_POSITION(obj, x, y) \
+#define EFL_CHECK_POSITION(obj, x, y) \
queueCallback( \
ModifyCheckCallback( \
boost::bind(&EvasObject::setPosition, boost::ref(obj), x, y), \
) \
)
-#define SET_CHECK_SHOW(obj) \
+#define EFL_CHECK_SHOW(obj) \
queueCallback( \
ModifyCheckCallback( \
boost::bind(&EvasObject::show, boost::ref(obj)), \
) \
)
+#define EFL_CHECK_HIDE(obj) \
+ queueCallback( \
+ ModifyCheckCallback( \
+ boost::bind(&EvasObject::hide, boost::ref(obj)), \
+ boost::bind(&EvasObject::checkHidden, boost::ref(obj), EINA_TRUE) \
+ ) \
+ )
+
#endif
--- /dev/null
+#include <Elementary.h>
+#include <boost/bind.hpp>
+
+#include "evasobject.h"
+#include "window.h"
+#include "elmtestharness.h"
+#include "application.h"
+
+#ifndef __WAYLAND_EFL_TEMPLATES_H__
+#define __WAYLAND_EFL_TEMPLATES_H__
+
+
+
+#define EFL_RESIZE_TEST(_suite, _obj, _w1, _h1, _w2, _h2) \
+class _suite ## ResizeTest : public ElmTestHarness \
+{ \
+public: \
+ \
+ _suite ## ResizeTest() \
+ : ElmTestHarness::ElmTestHarness() \
+ , window_(#_suite "ResizeTest", #_suite "Resize Test") \
+ , control_(elm_ ## _obj ## _add(window_)) \
+ { \
+ return; \
+ } \
+ \
+ void setup() \
+ { \
+ window_.show(); \
+ control_.show(); \
+ \
+ EFL_CHECK_SIZE(control_, _w1, _h1); \
+ EFL_CHECK_SIZE(control_, _w2, _h2); \
+ } \
+ \
+private: \
+ Window window_; \
+ EvasObject control_; \
+}; \
+BOOST_AUTO_TEST_SUITE(EFL) \
+ BOOST_AUTO_TEST_SUITE(_suite) \
+ WAYLAND_ELM_HARNESS_TEST_CASE(_suite ## ResizeTest) \
+ BOOST_AUTO_TEST_SUITE_END() \
+BOOST_AUTO_TEST_SUITE_END() \
+
+
+
+#define EFL_POSITION_TEST(_suite, _obj, _x1, _y1, _x2, _y2) \
+class _suite ## PositionTest : public ElmTestHarness \
+{ \
+public: \
+ \
+ _suite ## PositionTest() \
+ : ElmTestHarness::ElmTestHarness() \
+ , window_(#_suite "PositionTest", #_suite "Position Test") \
+ , control_(elm_ ## _obj ## _add(window_)) \
+ { \
+ return; \
+ } \
+ \
+ void setup() \
+ { \
+ window_.show(); \
+ control_.show(); \
+ \
+ EFL_CHECK_POSITION(control_, _x1, _x1); \
+ EFL_CHECK_POSITION(control_, _x2, _x2); \
+ } \
+ \
+private: \
+ Window window_; \
+ EvasObject control_; \
+}; \
+BOOST_AUTO_TEST_SUITE(EFL) \
+ BOOST_AUTO_TEST_SUITE(_suite) \
+ WAYLAND_ELM_HARNESS_TEST_CASE(_suite ## PositionTest) \
+ BOOST_AUTO_TEST_SUITE_END() \
+BOOST_AUTO_TEST_SUITE_END() \
+
+
+
+#define EFL_VISIBILITY_TEST(_suite, _obj) \
+class _suite ## VisibilityTest : public ElmTestHarness \
+{ \
+public: \
+ \
+ _suite ## VisibilityTest() \
+ : ElmTestHarness::ElmTestHarness() \
+ , window_(#_suite "VisibilityTest", #_suite "Visibility Test") \
+ , control_(elm_ ## _obj ## _add(window_)) \
+ { \
+ return; \
+ } \
+ \
+ void setup() \
+ { \
+ window_.show(); \
+ \
+ EFL_CHECK_SHOW(control_); \
+ EFL_CHECK_HIDE(control_); \
+ } \
+ \
+private: \
+ Window window_; \
+ EvasObject control_; \
+}; \
+BOOST_AUTO_TEST_SUITE(EFL) \
+ BOOST_AUTO_TEST_SUITE(_suite) \
+ WAYLAND_ELM_HARNESS_TEST_CASE(_suite ## VisibilityTest) \
+ BOOST_AUTO_TEST_SUITE_END() \
+BOOST_AUTO_TEST_SUITE_END() \
+
+
+/* XXX: For now, keep it regular-- when BASIC_TESTS is uncommented and working,
+ * XXX: makes it easier to replace across files
+ */
+// Basic suite START
+//EFL_RESIZE_TEST(suite, obj, 300, 200, 200, 100)
+//EFL_POSITION_TEST(suite, obj, 100, 50, 150, 100)
+//EFL_VISIBILITY_TEST(suite, obj)
+// Basic suite END
+
+
+/* XXX
+#define EFL_BASIC_TESTS(suite, obj) \
+ EFL_RESIZE_TEST(suite, obj, 300, 200, 200, 100) \
+ EFL_POSITION_TEST(suite, obj, 100, 50, 150, 100) \
+ EFL_VISIBILITY_TEST(suite, obj) \
+*/
+
+
+#endif
+
-#include <Elementary.h>
-#include <boost/bind.hpp>
-
#include <vector>
-#include "window.h"
-#include "evasobject.h"
-#include "elmtestharness.h"
+#include "templates.h"
using std::vector;
-class ActionsliderPosTest : public ElmTestHarness
+
+// Basic suite START
+EFL_RESIZE_TEST(Actionslider, actionslider, 300, 200, 200, 100)
+EFL_POSITION_TEST(Actionslider, actionslider, 100, 50, 150, 100)
+EFL_VISIBILITY_TEST(Actionslider, actionslider)
+// Basic suite END
+
+class ActionsliderIndicatorTest : public ElmTestHarness
{
public:
- ActionsliderPosTest()
+ ActionsliderIndicatorTest()
: ElmTestHarness::ElmTestHarness()
- , window_("ActionsliderPosTest", "Actionslider Position Test")
+ , window_("ActionsliderIndicatorTest", "Actionslider Position Test")
, control_(elm_actionslider_add(window_))
{
positions_.push_back(ELM_ACTIONSLIDER_LEFT);
positions_.push_back(ELM_ACTIONSLIDER_LEFT);
positions_.push_back(ELM_ACTIONSLIDER_RIGHT);
positions_.push_back(ELM_ACTIONSLIDER_CENTER);
+ positions_.push_back(ELM_ACTIONSLIDER_RIGHT);
+ positions_.push_back(ELM_ACTIONSLIDER_LEFT);
+ positions_.push_back(ELM_ACTIONSLIDER_RIGHT);
+ positions_.push_back(ELM_ACTIONSLIDER_CENTER);
return;
}
void setup()
{
- SET_CHECK_SHOW(window_);
- SET_CHECK_SHOW(control_);
+ window_.show();
+ control_.show();
control_.setSize(200, 100);
control_.setPosition(50, 10);
queueCallback(
ModifyCheckCallback(
boost::bind(elm_actionslider_indicator_pos_set, boost::ref(control_), *it),
- boost::bind(&ActionsliderPosTest::checkPos, boost::ref(*this), *it)
+ boost::bind(&ActionsliderIndicatorTest::checkPos, boost::ref(*this), *it)
)
);
}
BOOST_AUTO_TEST_SUITE(ActionSlider)
- WAYLAND_ELM_HARNESS_TEST_CASE(ActionsliderPosTest)
+ WAYLAND_ELM_HARNESS_TEST_CASE(ActionsliderIndicatorTest)
BOOST_AUTO_TEST_SUITE_END()
-#include <Elementary.h>
-#include <boost/bind.hpp>
+#include "templates.h"
-#include "window.h"
-#include "evasobject.h"
-#include "elmtestharness.h"
+// Basic suite START
+EFL_RESIZE_TEST(Button, button, 300, 200, 200, 100)
-class ButtonResizeTest : public ElmTestHarness
-{
-public:
+EFL_POSITION_TEST(Button, button, 100, 50, 150, 100)
- ButtonResizeTest()
- : ElmTestHarness::ElmTestHarness()
- , window_("ButtonResizeTest", "Button Resize Test")
- , button_(elm_button_add(window_))
- {
- return;
- }
+EFL_VISIBILITY_TEST(Button, button)
+// Basic suite END
- void setup()
- {
- window_.show();
- button_.show();
-
- SET_CHECK_SIZE(button_, 75, 75);
- SET_CHECK_SIZE(button_, 120, 30);
- }
-
-private:
- Window window_;
- EvasObject button_;
-};
-
-class ButtonMoveTest : public ElmTestHarness
-{
-public:
- ButtonMoveTest()
- : ElmTestHarness::ElmTestHarness()
- , window_("ButtonMoveTest", "Button Move Test")
- , button_(elm_button_add(window_))
- {
- return;
- }
-
- void setup()
- {
- window_.show();
- button_.show();
-
- SET_CHECK_POSITION(button_, 60, 15);
- SET_CHECK_POSITION(button_, 10, 10);
- }
-
-private:
- Window window_;
- EvasObject button_;
-};
-
-BOOST_AUTO_TEST_SUITE(EFL)
-
- BOOST_AUTO_TEST_SUITE(Button)
-
- WAYLAND_ELM_HARNESS_TEST_CASE(ButtonResizeTest)
- WAYLAND_ELM_HARNESS_TEST_CASE(ButtonMoveTest)
-
- BOOST_AUTO_TEST_SUITE_END()
-
-BOOST_AUTO_TEST_SUITE_END()