2 * Copyright © 2013 Intel Corporation
4 * Permission to use, copy, modify, distribute, and sell this software and
5 * its documentation for any purpose is hereby granted without fee, provided
6 * that the above copyright notice appear in all copies and that both that
7 * copyright notice and this permission notice appear in supporting
8 * documentation, and that the name of the copyright holders not be used in
9 * advertising or publicity pertaining to distribution of the software
10 * without specific, written prior permission. The copyright holders make
11 * no representations about the suitability of this software for any
12 * purpose. It is provided "as is" without express or implied warranty.
14 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
15 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
17 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
18 * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
19 * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
20 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23 #ifndef __WFITS_EFL_ELMTESTHARNESS_H__
24 #define __WFITS_EFL_ELMTESTHARNESS_H__
27 #include <Ecore_Wayland.h>
28 #include <Elementary.h>
29 #include "test/harness.h"
30 #include "application.h"
36 class ElmTestHarness : public test::Harness
39 typedef ::boost::function<bool (void)> Condition;
41 using test::Harness::queueStep;
44 * Construct the test harness.
50 void queueStep(TestStep, const std::string&);
52 /*virtual*/ void yield(const unsigned time = 0.01 * 1e6) const;
53 /*virtual*/ const test::Client& client() const;
55 void stepUntilCondition(Condition condition);
56 void assertCondition(Condition condition);
57 void assertCondition(Condition condition, const std::string&);
60 static Eina_Bool idleStep(void*);
61 static Eina_Bool doStep(void*, int, void*);
63 int eventType_; /// custom event type
64 Ecore_Event_Handler* handler_;
67 #define WAYLAND_ELM_HARNESS_EGL_TEST_CASE(Harness, suite) \
69 TEST(Harness, "EFL/Egl/" suite) \
72 app.setEngine(Application::ENGINE_EGL); \
77 #define WAYLAND_ELM_HARNESS_SHM_TEST_CASE(Harness, suite) \
79 TEST(Harness, "EFL/Shm/" suite) \
82 app.setEngine(Application::ENGINE_SHM); \
87 #define WAYLAND_ELM_HARNESS_TEST_CASE(Harness, suite) \
88 WAYLAND_ELM_HARNESS_SHM_TEST_CASE(Harness, suite) \
89 WAYLAND_ELM_HARNESS_EGL_TEST_CASE(Harness, suite)