tests/conform: Use the clutter stage from mutter

The tests created their own stage, which caused various issues. Lets use
the one from mutter instead.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1289
This commit is contained in:
Jonas Ådahl
2020-05-29 19:31:22 +02:00
committed by Georges Basile Stavracas Neto
parent 01609de587
commit 007d27fa40
5 changed files with 23 additions and 20 deletions

View File

@ -5,8 +5,6 @@
#include <clutter/clutter.h>
typedef struct {
ClutterActor *stage;
guint no_display : 1;
} ClutterTestEnvironment;
@ -98,18 +96,9 @@ out:
ClutterActor *
clutter_test_get_stage (void)
{
g_assert (test_environ != NULL);
MetaBackend *backend = meta_get_backend ();
if (test_environ->stage == NULL)
{
/* create a stage, and ensure that it goes away at the end */
test_environ->stage = clutter_stage_new ();
clutter_actor_set_name (test_environ->stage, "Test Stage");
g_object_add_weak_pointer (G_OBJECT (test_environ->stage),
(gpointer *) &test_environ->stage);
}
return test_environ->stage;
return meta_backend_get_stage (backend);
}
typedef struct {
@ -122,11 +111,13 @@ static void
clutter_test_func_wrapper (gconstpointer data_)
{
const ClutterTestData *data = data_;
ClutterActor *stage;
g_test_log_set_fatal_handler (log_func, NULL);
/* ensure that the previous test state has been cleaned up */
g_assert_null (test_environ->stage);
stage = clutter_test_get_stage ();
g_assert_false (clutter_actor_is_mapped (stage));
if (test_environ->no_display)
{
@ -151,11 +142,8 @@ out:
if (data->test_notify != NULL)
data->test_notify (data->test_data);
if (test_environ->stage != NULL)
{
clutter_actor_destroy (test_environ->stage);
g_assert_null (test_environ->stage);
}
clutter_actor_remove_all_children (stage);
clutter_actor_hide (stage);
}
/**