From 9e0e8ef5275d8622f5edd6362d19c7d0001b59c4 Mon Sep 17 00:00:00 2001 From: Joe Konno Date: Wed, 20 Jun 2012 11:00:54 -0700 Subject: [PATCH] EFL_Background_Suite: add image test Signed-off-by: Joe Konno --- src/efl/Makefile.am | 1 + src/efl/test_background.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/src/efl/Makefile.am b/src/efl/Makefile.am index 48c3320..36e37ab 100644 --- a/src/efl/Makefile.am +++ b/src/efl/Makefile.am @@ -34,6 +34,7 @@ wayland_efl_test_SOURCES = \ test_window.cpp \ test_engine_set.cpp \ test_actionslider.cpp \ + test_background.cpp \ ../testmain.cpp endif diff --git a/src/efl/test_background.cpp b/src/efl/test_background.cpp index 5089ab5..c35cfe3 100644 --- a/src/efl/test_background.cpp +++ b/src/efl/test_background.cpp @@ -1,6 +1,7 @@ #include #include +#include "application.h" #include "window.h" #include "background.h" #include "evasobject.h" @@ -52,8 +53,51 @@ private: Background bg_; }; +class BackgroundImageTest : public ElmTestHarness +{ +public: + + BackgroundImageTest() + : ElmTestHarness::ElmTestHarness() + , window_("BackgroundImageTest", "Background Image Test") + , bg_(window_) + { + evas_object_size_hint_weight_set(bg_, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_win_resize_object_add(window_, bg_); + return; + } + + void setup() + { + bg_.show(); + window_.show(); + + path p(MEDIA_PATH"/crater_lake.png"); + + queueCallback( + ModifyCheckCallback( + boost::bind(&Background::setImage, boost::ref(bg_), p), + boost::bind(&BackgroundImageTest::checkImage, boost::ref(*this), p) + ) + ); + } + + void checkImage(path& p) + { + path ret; + bg_.getImage(ret); + + BOOST_CHECK_EQUAL(ret, p); + } + +private: + Window window_; + Background bg_; +}; + BOOST_AUTO_TEST_SUITE(Wayland_EFL_Background_Suite) WAYLAND_ELM_HARNESS_TEST_CASE(BackgroundColorTest) + WAYLAND_ELM_HARNESS_TEST_CASE(BackgroundImageTest) BOOST_AUTO_TEST_SUITE_END() -- 2.7.4