Commit Graph

22 Commits

Author SHA1 Message Date
Ucan, Emre (ADITG/SW1) 67f0aa8767 ivi-shell: rework remove_surface notification
The add_notification_remove_surface API accepts a simple
wl_listener instead of a ivi-shell specific notification
function. Therefore, the API is renamed to add_listener_remove_surface.

This change has several advantages:
1. Code cleanup
2. No dynamic memory allocation. Listeners are allocated
   by controller plugins
3. Remove API is not needed. Controller plugins can easily
   remove the listener link.

The remove API is removed too:
- ivi_layout_remove_notification_remove_surface

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-04-05 11:53:48 +03:00
Ucan, Emre (ADITG/SW1) 970f831588 ivi-shell: rework create_surface notification
The add_notification_create_surface API accepts a simple
wl_listener instead of a ivi-shell specific notification
function. Therefore, the API is renamed to
add_listener_create_surface.

This change has several advantages:
1. Code cleanup
2. No dynamic memory allocation. Listeners are allocated
   by controller plugins
3. Remove API is not needed. Controller plugins can easily
   remove the listener link.

The remove API is removed too:
- ivi_layout_remove_notification_create_surface

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-04-05 11:53:48 +03:00
Ucan, Emre (ADITG/SW1) 706cb5aa7c ivi-shell: rework surface_add_notification API
The surface_add_notification API accepts a simple
wl_listener instead of a ivi-shell specific notification
function. Therefore, the API is renamed to surface_add_listener.

This change has several advantages:
1. Code cleanup
2. No dynamic memory allocation. Listeners are allocated
   by controller plugins
3. Remove API is not needed. Controller plugins can easily
   remove the listener link.

This patch also remove two APIs which are not needed:
- ivi_layout_surface_remove_notification
- ivi_layout_surface_remove_notification_by_callback

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-04-05 11:53:48 +03:00
Ucan, Emre \(ADITG/SW1\) 45d3942816 ivi-shell: remove ivi_layout_surface_set_dimension API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) 161da40b06 ivi-shell: remove ivi_layout_surface_set_position API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) 4d9001bc49 ivi-shell: remove ivi_layout_surface_get_orientation API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) c507f67f9e ivi-shell: remove ivi_layout_surface_get_dimension API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) b2ff255792 ivi-shell: remove ivi_layout_surface_get_position API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) 995e6fbcd0 ivi-shell: remove ivi_layout_surface_get_opacity API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:34 -08:00
Ucan, Emre \(ADITG/SW1\) c6a138c6f0 ivi-shell: remove ivi_layout_surface_get_visibility API
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-03-04 10:33:27 -08:00
Ucan, Emre \(ADITG/SW1\) 0c0e51e096 ivi-shell: rename ivi_controller_interface
The name of ivi_controller_interface is changed to ivi_layout_interface
with this patch.

This name is better suited to the interface, because it is implemented
in ivi-layout.c and its methods are linked to ivi_layout* functions.

Furthermore, the controller modules (e.g. hmi-controller) are the users
of this interface and they have their own interfaces,
which are called *_controller_interface,
e.g.: ivi_hmi_controller_interface.

This causes confusion about the software architecture.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
2015-10-29 13:55:16 -07:00
Nobuhiko Tanibata 0af22d4d77 tests: test set for ivi-shell notification in bad condition with helper client
These tests are implemented on test suite framework, which provides
helper client.
Following features are tested,
- add notfication of ivi-surface with bad condition

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:39:54 +03:00
Nobuhiko Tanibata 915303a275 tests: test set for ivi-shell notification normal use case with helper client
These tests are implemented on test suite framework, which provides
helper client.
Following features are tested,
  - notification of adding ivi-surface
  - notification of ivi-surface configure
  - notification of creating ivi-surface
  - notification of removing ivi-surface

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:39:45 +03:00
Nobuhiko Tanibata a10352e5c3 tests: make the test context persistent
The TESTs in ivi_layout-test.c may have several server-side parts
(RUNNER_TEST in ivi_layout-test-plugin.c) each. Sometimes we need to
carry state from one RUNNER_TEST to another within one TEST, but not
across multiple TESTs. The correct lifetime of that state would be the
lifetime (and identity) of the runner_resource, as one TEST creates and
uses at most one weston_test_runner during its lifetime.

However, tests are executed one by one. Take a shortcut, and use a static
global for storing that state. This turns the test_context into a
singleton. To ensure it is not confused between multiple TESTs, add
asserts to verify its identity.

Following patches will add tests for notification callbacks. These will
be using the carried state.

[Pekka: add serialization checks, rename the global, rewrite commit message.]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:39:10 +03:00
Nobuhiko Tanibata 0671b4d930 tests: test set for ivi-layer bad condition with helper-client
These tests are implemented on test suite framework, which provides
helper client.
Following features are tested,
- bad render order of ivi-surface on ivi-layer
- call commitchanges after a ivi_surface in render order is destoryed

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:38:48 +03:00
Nobuhiko Tanibata d364393fca tests: test set for ivi-layer normal use case with helper client
These test are implemented on test suite framework, which provides
helper client.
Following features are tested,
- render order of ivi-surfaces on ivi-layer

Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:38:37 +03:00
Nobuhiko Tanibata c74bafa0e9 tests: test set for ivi-surface bad condition with helper client
These tests are implemented on test suite framework, which provides
helper client.
Following features are tested,
- ivi_layout_runner with basic_test_names[]
 - surface with bad opacity
- destroy ivi/wl_surface and call get_surface
- commit_changes_after_properties_set_surface_destroy with
  surface_property_commit_changes_test_names[]
 - call set_visibility, destroy ivi-surface, and commit_changes
 - call set_opacity, destroy ivi-surface, and commit_changes
 - call set_orientation, destroy ivi-surface, and commit_changes
 - call set_dimension, destroy ivi-surface, and commit_changes
 - call set_position, destroy ivi-surface, and commit_changes
 - call set_source_rectangle, destroy ivi-surface, and commit_changes
 - call set_destination_rectangle, destroy ivi-surface, and
  commit_changes

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:38:25 +03:00
Nobuhiko Tanibata 23d95824a5 tests: test set for ivi-surface normal use case with helper client
These tests are implemented on test suite framework, which provides
helper client.
Following features are tested for ivi-surface
- orientation
- dimension
- position
- destination rectangle
- source rectangle

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:38:10 +03:00
Jon Cruz 867d50eea7 Unified multiple definitions of container_of() macro.
Removed duplicate definitions of the container_of() macro and
refactored sources to use the single implementation.

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-06-15 17:11:58 -07:00
Jon Cruz 4678bab13c Remove redundant #include path component.
Using the parent '../' path component in #include statements makes
the codebase more rigid and is redundant due to proper -I use.

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-06-15 17:11:09 -07:00
Bryce Harrington 2cc9297aca tests: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-15 13:04:19 -07:00
Pekka Paalanen f5b74f7ded tests: ivi_layout test infrastructure
Testing the ivi_layout API requires two things:
- the tests must be written as a controller module to access the API
- the tests need a helper client to create some objects that can then be
  managed via the API

This patch adds all the infrastructure and two different kinds of
example tests.

Internal ivi-shell (ivi_layout) API tests are listed as ivi-*.la files
in TESTS in Makefile.am. Weston-tests-env detects these, and runs Weston
with ivi-shell, and loads the given module as a controller module, not
as a normal plugin.

The test controller module ivi-*.la will launch a helper client. For
ivi-layout-test.la the helper client is ivi-layout.ivi.

The helper client uses the weston-test-runner framework to fork and exec
each TEST with a fresh connection to the compositor.

The actual test is triggered by the weston_test_runner protocol
interface, a new addition to weston-test.xml. The helper client uses
weston_test_runner to trigger a test, and the server side of the
interface is implemented by the test controller module
(ivi-layout-test.la).

The server side of weston_test_runner uses the same trick as
weston-test-runner.h to gather a list of defined tests. A test is
defined with the RUNNER_TEST macro.

If a test defined by RUNNER_TEST succeeds, an event is sent to the
helper client that it can continue (or exit). If a test fails, a fatal
protocol error is sent to the helper client.

Once the helper client has iterated over all of its tests, it signals
the batch success/failure via process exit code. That is cought in the
test controller module, and forwarded as Weston's exit code.

In summary: each ivi_layout test is a combination of a client side
helper/setup and server side actual tests.

v2: Load weston-test.so, because create_client() needs it.

v3: add a comment about IVI_TEST_SURFACE_ID_BASE.

v4: Rebased to upstream weston-tests-env changes.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com> (v2)
2015-04-09 09:27:05 +03:00