summaryrefslogtreecommitdiff
path: root/tests/ivi_layout-test-plugin.c
diff options
context:
space:
mode:
authorNobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>2015-06-22 15:33:26 +0900
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2015-06-25 11:38:25 +0300
commitc74bafa0e97a584ca8ba57b967a993d132354f17 (patch)
tree66f2e85a3e91478038aa9c0cd75460dcc199e51b /tests/ivi_layout-test-plugin.c
parent23d95824a508b0724dde77587147706a7f724a79 (diff)
downloadweston-c74bafa0e97a584ca8ba57b967a993d132354f17.tar.gz
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>
Diffstat (limited to 'tests/ivi_layout-test-plugin.c')
-rw-r--r--tests/ivi_layout-test-plugin.c134
1 files changed, 134 insertions, 0 deletions
diff --git a/tests/ivi_layout-test-plugin.c b/tests/ivi_layout-test-plugin.c
index 1d0ce028..fd57d068 100644
--- a/tests/ivi_layout-test-plugin.c
+++ b/tests/ivi_layout-test-plugin.c
@@ -563,3 +563,137 @@ RUNNER_TEST(surface_source_rectangle)
runner_assert(prop->source_x == 20);
runner_assert(prop->source_y == 30);
}
+
+RUNNER_TEST(surface_bad_opacity)
+{
+ const struct ivi_controller_interface *ctl = ctx->controller_interface;
+ struct ivi_layout_surface *ivisurf;
+ wl_fixed_t opacity;
+
+ ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
+ runner_assert(ivisurf != NULL);
+
+ runner_assert(ctl->surface_set_opacity(
+ NULL, wl_fixed_from_double(0.3)) == IVI_FAILED);
+
+ runner_assert(ctl->surface_set_opacity(
+ ivisurf, wl_fixed_from_double(0.3)) == IVI_SUCCEEDED);
+
+ runner_assert(ctl->surface_set_opacity(
+ ivisurf, wl_fixed_from_double(-1)) == IVI_FAILED);
+
+ ctl->commit_changes();
+
+ opacity = ctl->surface_get_opacity(ivisurf);
+ runner_assert(opacity == wl_fixed_from_double(0.3));
+
+ runner_assert(ctl->surface_set_opacity(
+ ivisurf, wl_fixed_from_double(1.1)) == IVI_FAILED);
+
+ ctl->commit_changes();
+
+ opacity = ctl->surface_get_opacity(ivisurf);
+ runner_assert(opacity == wl_fixed_from_double(0.3));
+
+ runner_assert(ctl->surface_set_opacity(
+ NULL, wl_fixed_from_double(0.5)) == IVI_FAILED);
+
+ ctl->commit_changes();
+
+ opacity = ctl->surface_get_opacity(NULL);
+ runner_assert(opacity == wl_fixed_from_double(0.0));
+}
+
+RUNNER_TEST(ivi_layout_commit_changes)
+{
+ const struct ivi_controller_interface *ctl = ctx->controller_interface;
+
+ ctl->commit_changes();
+}
+
+RUNNER_TEST(commit_changes_after_visibility_set_surface_destroy)
+{
+ const struct ivi_controller_interface *ctl = ctx->controller_interface;
+ struct ivi_layout_surface *ivisurf;
+
+ ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
+ runner_assert(ivisurf != NULL);
+ runner_assert(ctl->surface_set_visibility(
+ ivisurf, true) == IVI_SUCCEEDED);
+}
+
+RUNNER_TEST(commit_changes_after_opacity_set_surface_destroy)
+{
+ const struct ivi_controller_interface *ctl = ctx->controller_interface;
+ struct ivi_layout_surface *ivisurf;
+
+ ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
+ runner_assert(ivisurf != NULL);
+ runner_assert(ctl->surface_set_opacity(
+ ivisurf, wl_fixed_from_double(0.5)) == IVI_SUCCEEDED);
+}
+
+RUNNER_TEST(commit_changes_after_orientation_set_surface_destroy)
+{
+ const struct ivi_controller_interface *ctl = ctx->controller_interface;
+ struct ivi_layout_surface *ivisurf;
+
+ ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
+ runner_assert(ivisurf != NULL);
+ runner_assert(ctl->surface_set_orientation(
+ ivisurf, WL_OUTPUT_TRANSFORM_90) == IVI_SUCCEEDED);
+}
+
+RUNNER_TEST(commit_changes_after_dimension_set_surface_destroy)
+{
+ const struct ivi_controller_interface *ctl = ctx->controller_interface;
+ struct ivi_layout_surface *ivisurf;
+
+ ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
+ runner_assert(ivisurf != NULL);
+ runner_assert(ctl->surface_set_dimension(
+ ivisurf, 200, 300) == IVI_SUCCEEDED);
+}
+
+RUNNER_TEST(commit_changes_after_position_set_surface_destroy)
+{
+ const struct ivi_controller_interface *ctl = ctx->controller_interface;
+ struct ivi_layout_surface *ivisurf;
+
+ ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
+ runner_assert(ivisurf != NULL);
+ runner_assert(ctl->surface_set_position(
+ ivisurf, 20, 30) == IVI_SUCCEEDED);
+}
+
+RUNNER_TEST(commit_changes_after_source_rectangle_set_surface_destroy)
+{
+ const struct ivi_controller_interface *ctl = ctx->controller_interface;
+ struct ivi_layout_surface *ivisurf;
+
+ ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
+ runner_assert(ivisurf != NULL);
+ runner_assert(ctl->surface_set_source_rectangle(
+ ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED);
+}
+
+RUNNER_TEST(commit_changes_after_destination_rectangle_set_surface_destroy)
+{
+ const struct ivi_controller_interface *ctl = ctx->controller_interface;
+ struct ivi_layout_surface *ivisurf;
+
+ ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
+ runner_assert(ivisurf != NULL);
+ runner_assert(ctl->surface_set_destination_rectangle(
+ ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED);
+}
+
+RUNNER_TEST(get_surface_after_destroy_surface)
+{
+ const struct ivi_controller_interface *ctl = ctx->controller_interface;
+ struct ivi_layout_surface *ivisurf;
+
+ ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
+ runner_assert(ivisurf == NULL);
+}
+