summaryrefslogtreecommitdiff
path: root/tests/ivi_layout-test-plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ivi_layout-test-plugin.c')
-rw-r--r--tests/ivi_layout-test-plugin.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/ivi_layout-test-plugin.c b/tests/ivi_layout-test-plugin.c
index fd57d068..afd108bc 100644
--- a/tests/ivi_layout-test-plugin.c
+++ b/tests/ivi_layout-test-plugin.c
@@ -697,3 +697,45 @@ RUNNER_TEST(get_surface_after_destroy_surface)
runner_assert(ivisurf == NULL);
}
+RUNNER_TEST(layer_render_order)
+{
+ const struct ivi_controller_interface *ctl = ctx->controller_interface;
+ struct ivi_layout_layer *ivilayer;
+ struct ivi_layout_surface *ivisurfs[IVI_TEST_SURFACE_COUNT] = {};
+ struct ivi_layout_surface **array;
+ int32_t length = 0;
+ uint32_t i;
+
+ ivilayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300);
+
+ for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++)
+ ivisurfs[i] = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(i));
+
+ runner_assert(ctl->layer_set_render_order(
+ ivilayer, ivisurfs, IVI_TEST_SURFACE_COUNT) == IVI_SUCCEEDED);
+
+ ctl->commit_changes();
+
+ runner_assert(ctl->get_surfaces_on_layer(
+ ivilayer, &length, &array) == IVI_SUCCEEDED);
+ runner_assert(IVI_TEST_SURFACE_COUNT == length);
+ for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++)
+ runner_assert(array[i] == ivisurfs[i]);
+
+ if (length > 0)
+ free(array);
+
+ runner_assert(ctl->layer_set_render_order(
+ ivilayer, NULL, 0) == IVI_SUCCEEDED);
+
+ array = NULL;
+
+ ctl->commit_changes();
+
+ runner_assert(ctl->get_surfaces_on_layer(
+ ivilayer, &length, &array) == IVI_SUCCEEDED);
+ runner_assert(length == 0 && array == NULL);
+
+ ctl->layer_destroy(ivilayer);
+}
+