-SUBDIRS = src
+SUBDIRS = src \
+ data
MAINTAINERCLEANFILES = \
Makefile.in
wayland-client \
ecore-wl2 \
tizen-extension-client \
+ tizen-launch-client \
tzsh-screensaver-manager-service \
tzsh-screensaver-service \
"
PKG_CHECK_MODULES(E_TEST_RUNNER, [${requirements}])
+# Find edje_cc
+PKG_CHECK_MODULES(EDJE, [edje >= 1.0.0])
+AC_ARG_WITH(edje-cc,
+ AC_HELP_STRING([--with-edje-cc=PATH], [specify a specific path to edje_cc]),
+ [
+ v=$withval;
+ EDJE_CC=$v
+ ],
+ [
+ EDJE_CC=$(pkg-config --variable=prefix edje)/bin/edje_cc
+ ]
+)
+AC_SUBST(EDJE_CC)
+AC_MSG_CHECKING([Which edje_cc to use])
+AC_MSG_RESULT(${EDJE_CC})
+
AC_CONFIG_FILES([
Makefile
src/Makefile
+data/Makefile
])
AC_OUTPUT
--- /dev/null
+MAINTAINERCLEANFILES = Makefile.in
+
+EDJE_CC = @EDJE_CC@
+EDJE_CC_FLAGS = -v -id $(top_srcdir)/data/img
+
+filesdir = $(pkgdatadir)/data
+files_DATA = launch_splash.edj
+
+EXTRA_DIST = \
+ edc/launch_splash.edc \
+ img/launchimg_splash.png
+
+launch_splash.edj: Makefile $(EXTRA_DIST)
+ $(EDJE_CC) $(EDJE_CC_FLAGS) \
+ $(top_srcdir)/data/edc/launch_splash.edc \
+ $(top_builddir)/data/launch_splash.edj
+
+clean-local:
+ rm -f *.edj
+
--- /dev/null
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+collections {
+
+ group
+ {
+ name: "effect";
+
+ parts {
+ part {
+ name: "bg";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ color: 21 108 148 255;
+ }
+ }
+ part {
+ name: "title";
+ type: RECT;
+ scale: 1;
+ repeat_events: 0;
+ description {
+ state: "default" 0.0;
+ min, 0 96;
+ fixed,0 1;
+ align: 0.5 0;
+ rel1 { relative: 0.0 0.0; }
+ rel2 { relative: 1.0 0.0; }
+ color: 255 108 148 255;
+ }
+ }
+ part {
+ name: "category";
+ type: RECT;
+ scale: 1;
+ repeat_events: 0;
+ description {
+ state: "default" 0.0;
+ min, 0 532;
+ fixed,0 1;
+ align: 0.5 0;
+ rel1 { relative: 0.0 1.0; to_y:"title";}
+ rel2 { relative: 1.0 1.0; to_y:"title";}
+ color: 21 255 148 255;
+ }
+ }
+
+ part {
+ name: "tabbar";
+ type: RECT;
+ scale: 1;
+ repeat_events: 1;
+ description {
+ state: "default" 0.0;
+ min, 0 75;
+ fixed,0 1;
+ align: 0.5 0.0;
+ rel1 { relative: 0.0 1.0; to:"category";}
+ rel2 { relative: 1.0 1.0; to:"category";}
+ color: 21 255 242 255;
+ }
+ }
+ part {
+ name: "elm.swallow.content";
+ type: RECT;
+ scale: 1;
+ repeat_events: 1;
+ description {
+ state: "default" 0.0;
+ align: 0.5 0;
+ fixed: 0 1;
+ rel1 { relative: 0.0 1.0; to_y: "tabbar";}
+ rel2 { relative: 1.0 1.0;}
+ color: 21 108 148 255;
+ }
+ }
+ }
+ }
+}
+
+
BuildRequires: pkgconfig(ecore-wl2)
BuildRequires: gettext
BuildRequires: pkgconfig(tizen-extension-client)
+BuildRequires: pkgconfig(tizen-launch-client)
BuildRequires: pkgconfig(tzsh-screensaver-manager-service)
BuildRequires: pkgconfig(tzsh-screensaver-service)
BuildRequires: gtest-devel
+BuildRequires: pkgconfig(edje)
+BuildRequires: edje-tools
%description
This package is a test case runner for enlightenment.
%install
rm -rf %{buildroot}
+%__mkdir_p %{buildroot}/usr/share/e_test_runner/data/
+%__cp -afr data/img/launchimg_splash.png %{buildroot}/usr/share/e_test_runner/data/
# install
make install DESTDIR=%{buildroot}
%defattr(-,root,root,-)
%attr(550,root,root) %{_bindir}/e_test_runner
%license COPYING
+%{_datadir}/e_test_runner/data/
testcase/0006_tzsh.cpp \
testcase/0007_rotation.cpp \
testcase/0008_focus.cpp \
-testcase/0009_input.cpp
+testcase/0009_input.cpp \
+testcase/0010_splashcpp
e_test_runner_SOURCES = \
e_test_main.cpp \
testcase/0006_tzsh.cpp \
testcase/0007_rotation.cpp \
testcase/0008_focus.cpp \
-testcase/0009_input.cpp
+testcase/0009_input.cpp \
+testcase/0010_splash.cpp
MAINTAINERCLEANFILES = \
Makefile.in
tzSurface = NULL;
}
+ if (tzlaunch_splash)
+ {
+ tizen_launch_splash_destroy(tzlaunch_splash);
+ tzlaunch_splash = NULL;
+ }
+
+ if (tzlaunch_effect)
+ {
+ tizen_launch_effect_destroy(tzlaunch_effect);
+ tzlaunch_effect = NULL;
+ }
+
// deinit eldbus
eldbus_proxy_unref(dbus.proxy);
eldbus_object_unref(dbus.obj);
this);
}
+Eina_Bool
+etRunner::setSplashLaunch(const char *path, int type)
+{
+ const char *effect_type = "launch";
+ struct wl_array options1, options2;
+
+ // init tzlaunch_splash
+ if (tzlaunch_splash)
+ {
+ tizen_launch_splash_destroy(tzlaunch_splash);
+ tzlaunch_splash = NULL;
+ }
+ if (tzlaunch_effect) tzlaunch_splash = tizen_launch_effect_create_splash_img(tzlaunch_effect);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(tzlaunch_splash, EINA_FALSE);
+
+ wl_array_init(&options1);
+ tizen_launch_effect_type_set(tzlaunch_effect, "launch", 555, &options1);
+ wl_array_release(&options1);
+
+ wl_array_init(&options2);
+ tizen_launch_splash_launch(tzlaunch_splash, path, type,
+ 24, 0, 0,
+ effect_type, NULL, &options2);
+ wl_array_release(&options2);
+
+ return EINA_TRUE;
+}
+
+Eina_Bool
+etRunner::setSplashOwner()
+{
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(tzlaunch_splash, EINA_FALSE);
+
+ tizen_launch_splash_owner(tzlaunch_splash, (int)getpid());
+
+ return EINA_TRUE;
+}
Eina_Bool
etRunner::freezeEvent()
&tizen_surface_interface,
(global->version > 1)? 1 : global->version);
}
+ if (!strcmp(global->interface, "tizen_launch_effect"))
+ {
+ tzlaunch_effect = (struct tizen_launch_effect *)
+ wl_registry_bind(registry,
+ global->id,
+ &tizen_launch_effect_interface,
+ (global->version > 1)? 1 : global->version);
+ }
}
EINA_SAFETY_ON_NULL_GOTO(tzPolicy, err);
EINA_SAFETY_ON_NULL_GOTO(tzSurface, err);
+ EINA_SAFETY_ON_NULL_GOTO(tzlaunch_effect, err);
eina_iterator_free(globals);
return EINA_TRUE;
worker.waitTime = 0.0;
tzPolicy = NULL;
tzSurface = NULL;
+ tzlaunch_effect = NULL;
+ tzlaunch_splash = NULL;
ev.expire_timer = NULL;
ev.request = E_TC_EVENT_TYPE_NONE;
ev.response = E_TC_EVENT_TYPE_NONE;
struct tizen_policy *tzPolicy;
struct tizen_surface *tzSurface;
+ struct tizen_launch_effect *tzlaunch_effect;
+ struct tizen_launch_splash *tzlaunch_splash;
Eina_List *listWinInfo;
Eina_Bool generateKeyPress(const char *key);
Eina_Bool generateKeyRelease(const char *key);
void generateKeyEvent(const char *keyname, double delay);
+ Eina_Bool setSplashLaunch(const char *path, int type);
+ Eina_Bool setSplashOwner();
Eina_Bool freezeEvent();
Eina_Bool thawEvent();
Eina_Bool waitEvent(E_TC_Event_Type ev);
#include <Elementary.h>
#include <wayland-client.h>
#include <tizen-extension-client-protocol.h>
+#include <tizen-launch-client-protocol.h>
#ifdef ERR
# undef ERR
--- /dev/null
+#include "e_test_event.h"
+#include "e_test_base.h"
+
+#define SPLASH_TYPE_IMG 0
+#define SPLASH_TYPE_EDC 1
+
+char const *path_edc = "/usr/share/e_test_runner/data/launch_splash.edj";
+char const *path_img = "/usr/share/e_test_runner/data/launchimg_splash.png";
+
+class etTestSplash : public ::etTCBase
+{
+ public:
+ etTestSplash() { };
+ ~etTestSplash() { };
+
+ protected:
+ etWin *tw = NULL;
+
+ void initTC(char * path, int type);
+};
+
+void
+etTestSplash::initTC(char * path, int type)
+{
+ Eina_Bool ret = EINA_FALSE;
+
+ tw = initNormalWin("TCWin_Splash", EINA_FALSE, EINA_FALSE);
+ ASSERT_TRUE(tw != NULL) << "failed to initiation window";
+
+ ret = etRunner::get().setSplashLaunch(path, type);
+ ASSERT_TRUE(ret);
+}
+
+TEST_F(etTestSplash, splash_edc)
+{
+ etWin *tw2 = NULL;
+ Eina_Bool res = EINA_FALSE;
+ Eina_List *list = NULL, *l = NULL;
+
+ initTC((char*)path_edc, SPLASH_TYPE_EDC);
+
+ // find Launchscreen from toplv windows
+ list = etRunner::get().getWinInfoList();
+ ASSERT_TRUE(list != NULL);
+
+ EINA_LIST_CAST_FOREACH(list, l, tw2, etWin*)
+ {
+ // todo: check cw->obj is EDJ type, and group name is effect
+ if (!strncmp(tw2->name, "Launchscreen", strlen(tw2->name)))
+ res = EINA_TRUE;
+ }
+ etRunner::get().freeWinInfoList(list);
+
+ ASSERT_TRUE(res);
+}
+
+TEST_F(etTestSplash, splash_img)
+{
+ etWin *tw2 = NULL;
+ Eina_Bool res = EINA_FALSE;
+ Eina_List *list = NULL, *l = NULL;
+
+ initTC((char*)path_img, SPLASH_TYPE_IMG);
+
+ // find Launchscreen from toplv windows
+ list = etRunner::get().getWinInfoList();
+ ASSERT_TRUE(list != NULL);
+
+ EINA_LIST_CAST_FOREACH(list, l, tw2, etWin*)
+ {
+ // todo: check cw->obj is IMG type, and img file
+ if (!strncmp(tw2->name, "Launchscreen", strlen(tw2->name)))
+ res = EINA_TRUE;
+ }
+ etRunner::get().freeWinInfoList(list);
+
+ ASSERT_TRUE(res);
+}
+
+TEST_F(etTestSplash, splash_replace)
+{
+ etWin *tw2 = NULL;
+ Eina_List *list = NULL, *l = NULL;
+
+ initTC((char*)path_img, SPLASH_TYPE_IMG);
+ etRunner::get().setSplashOwner();
+
+ tw->updateGeometry();
+ tw->show();
+ etRunner::get().waitEvent(E_TC_EVENT_TYPE_VIS_ON);
+
+ // Expected focus res:
+ list = etRunner::get().getWinInfoList();
+ ASSERT_TRUE(list != NULL);
+
+ EINA_LIST_CAST_FOREACH(list, l, tw2, etWin*)
+ {
+ if (tw->native_win == tw2->native_win)
+ ASSERT_TRUE(tw2->Focus.obj);
+ if (!strncmp(tw2->name, "Launchscreen", strlen(tw2->name)))
+ ASSERT_NE(tw->native_win, tw2->native_win);
+ }
+ etRunner::get().freeWinInfoList(list);
+}