tests/kms/render: Get backend from context

Avoids a couple of singleton accesses.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2417>
This commit is contained in:
Jonas Ådahl 2022-05-13 22:06:46 +02:00 committed by Marge Bot
parent a8c2df6fb5
commit f76258b840

View File

@ -29,6 +29,8 @@ typedef struct
GMainLoop *loop;
} KmsRenderingTest;
static MetaContext *test_context;
static void
on_after_update (ClutterStage *stage,
ClutterStageView *stage_view,
@ -44,7 +46,7 @@ on_after_update (ClutterStage *stage,
static void
meta_test_kms_render_basic (void)
{
MetaBackend *backend = meta_get_backend ();
MetaBackend *backend = meta_context_get_backend (test_context);
ClutterActor *stage = meta_backend_get_stage (backend);
KmsRenderingTest test;
@ -79,6 +81,8 @@ main (int argc,
META_CONTEXT_TEST_FLAG_NO_X11);
g_assert (meta_context_configure (context, &argc, &argv, NULL));
test_context = context;
init_tests ();
return meta_context_test_run_tests (META_CONTEXT_TEST (context),