a69198185bac23174219ffd260286c463956df24
[test/generic/wayland-fits.git] / src / efl / test_actionslider.cpp
1 #include <vector>
2
3 #include "templates.h"
4
5 using std::vector;
6
7 class Actionslider : public EvasObject
8 {
9 public:
10         Actionslider(EvasObject &parent)
11                 : EvasObject::EvasObject(elm_actionslider_add(parent))
12         {
13                 return;
14         }
15 };
16
17 class ActionsliderIndicatorTest : public ElmTestHarness
18 {
19 public:
20         ActionsliderIndicatorTest()
21                 : ElmTestHarness::ElmTestHarness()
22                 , window_("ActionsliderIndicatorTest", "Actionslider Position Test")
23                 , control_(window_)
24         {
25                 positions_.push_back(ELM_ACTIONSLIDER_LEFT);
26                 positions_.push_back(ELM_ACTIONSLIDER_CENTER);
27                 positions_.push_back(ELM_ACTIONSLIDER_LEFT);
28                 positions_.push_back(ELM_ACTIONSLIDER_RIGHT);
29                 positions_.push_back(ELM_ACTIONSLIDER_CENTER);
30                 positions_.push_back(ELM_ACTIONSLIDER_RIGHT);
31                 positions_.push_back(ELM_ACTIONSLIDER_LEFT);
32                 positions_.push_back(ELM_ACTIONSLIDER_RIGHT);
33                 positions_.push_back(ELM_ACTIONSLIDER_CENTER);
34         }
35
36         void setup()
37         {
38                 window_.show();
39                 control_.show();
40
41                 control_.setSize(200, 100);
42                 control_.setPosition(50, 10);
43
44                 foreach (Elm_Actionslider_Pos p, positions_) {
45                         queueStep(boost::bind(elm_actionslider_indicator_pos_set, boost::ref(control_), p));
46                         queueStep(boost::bind(&ActionsliderIndicatorTest::checkPos, boost::ref(*this), p));
47                 }
48         }
49
50         void checkPos(const Elm_Actionslider_Pos expected)
51         {
52                 FAIL_UNLESS_EQUAL(elm_actionslider_indicator_pos_get(control_), expected);
53         }
54
55 private:
56         Window                          window_;
57         Actionslider                    control_;
58         vector<Elm_Actionslider_Pos>    positions_;
59 };
60
61 typedef ResizeObjectTest<Actionslider> ActionsliderResizeTest;
62 typedef PositionObjectTest<Actionslider> ActionsliderPositionTest;
63 typedef VisibleObjectTest<Actionslider> ActionsliderVisibilityTest;
64
65 WAYLAND_ELM_HARNESS_TEST_CASE(ActionsliderResizeTest, "ActionSlider")
66 WAYLAND_ELM_HARNESS_TEST_CASE(ActionsliderPositionTest, "ActionSlider")
67 WAYLAND_ELM_HARNESS_TEST_CASE(ActionsliderVisibilityTest, "ActionSlider")
68 WAYLAND_ELM_HARNESS_TEST_CASE(ActionsliderIndicatorTest, "ActionSlider")
69