[mutter] context/test: Add test context type enum



commit 434f5e5b7b0c22fe15b89e881ea86a7a8cd32b92
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Tue Mar 2 10:46:43 2021 +0100

    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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861>

 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 e635049097..936808f532 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 bc79b02969..f2c7b49280 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 */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]