From 434f5e5b7b0c22fe15b89e881ea86a7a8cd32b92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 2 Mar 2021 10:46:43 +0100 Subject: [PATCH] context/test: Add test context type enum A test context type will later determine what kind of backend the test case should use; i.e. whether the nested or headless backend should be used. Part-of: --- src/tests/meta-context-test.c | 5 ++++- src/tests/meta-context-test.h | 10 +++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/tests/meta-context-test.c b/src/tests/meta-context-test.c index e63504909..936808f53 100644 --- a/src/tests/meta-context-test.c +++ b/src/tests/meta-context-test.c @@ -29,6 +29,8 @@ struct _MetaContextTest { GObject parent; + + MetaContextTestType type; }; G_DEFINE_TYPE (MetaContextTest, meta_context_test, META_TYPE_CONTEXT) @@ -57,13 +59,14 @@ meta_context_test_get_compositor_type (MetaContext *context) } MetaContext * -meta_create_test_context (void) +meta_create_test_context (MetaContextTestType type) { MetaContextTest *context_test; context_test = g_object_new (META_TYPE_CONTEXT_TEST, "name", "Mutter Test", NULL); + context_test->type = type; return META_CONTEXT (context_test); } diff --git a/src/tests/meta-context-test.h b/src/tests/meta-context-test.h index bc79b0296..f2c7b4928 100644 --- a/src/tests/meta-context-test.h +++ b/src/tests/meta-context-test.h @@ -23,11 +23,19 @@ #include "core/meta-context-private.h" +typedef enum _MetaContextTestType +{ +#ifdef HAVE_NATIVE_BACKEND + META_CONTEXT_TEST_TYPE_HEADLESS, +#endif + META_CONTEXT_TEST_TYPE_NESTED, +} MetaContextTestType; + #define META_TYPE_CONTEXT_TEST (meta_context_test_get_type ()) G_DECLARE_FINAL_TYPE (MetaContextTest, meta_context_test, META, CONTEXT_TEST, MetaContext) -MetaContext * meta_create_test_context (void); +MetaContext * meta_create_test_context (MetaContextTestType type); #endif /* META_CONTEXT_TEST_H */