5#include "flutter/shell/platform/linux/fl_gnome_settings.h"
6#include "flutter/shell/platform/linux/testing/fl_test.h"
7#include "flutter/shell/platform/linux/testing/mock_settings.h"
8#include "flutter/shell/platform/linux/testing/mock_signal_handler.h"
9#include "flutter/testing/testing.h"
12#define G_SETTINGS_ENABLE_BACKEND
13#include <gio/gsettingsbackend.h>
15#include "gmock/gmock.h"
16#include "gtest/gtest.h"
22 g_settings_backend_get_default();
27 g_autofree gchar*
path =
29 g_autoptr(GSettingsSchemaSource)
source =
30 g_settings_schema_source_new_from_directory(
path,
nullptr,
false,
32 g_autoptr(GSettingsSchema) schema =
33 g_settings_schema_source_lookup(
source, schema_id,
false);
34 g_autoptr(GSettingsBackend)
backend = g_memory_settings_backend_new();
35 return g_settings_new_full(schema,
backend,
nullptr);
39 g_autoptr(GSettings) interface_settings =
41 g_settings_set_string(interface_settings,
"clock-format",
"24h");
43 g_autoptr(FlSettings)
settings = FL_SETTINGS(
44 g_object_new(fl_gnome_settings_get_type(),
"interface_settings",
45 interface_settings,
nullptr));
51 g_settings_set_string(interface_settings,
"clock-format",
"12h");
56 g_autoptr(GSettings) interface_settings =
58 g_settings_set_string(interface_settings,
"gtk-theme",
"Yaru");
60 g_autoptr(FlSettings)
settings = FL_SETTINGS(
61 g_object_new(fl_gnome_settings_get_type(),
"interface_settings",
62 interface_settings,
nullptr));
68 g_settings_set_string(interface_settings,
"gtk-theme",
"Yaru-dark");
83 g_autoptr(GSettings) interface_settings =
85 g_settings_set_double(interface_settings,
"text-scaling-factor", 1.0);
87 g_autoptr(FlSettings)
settings = FL_SETTINGS(
88 g_object_new(fl_gnome_settings_get_type(),
"interface_settings",
89 interface_settings,
nullptr));
95 g_settings_set_double(interface_settings,
"text-scaling-factor", 1.5);
100 g_autoptr(GSettings) interface_settings =
103 g_autoptr(FlSettings)
settings = FL_SETTINGS(
104 g_object_new(fl_gnome_settings_get_type(),
"interface_settings",
105 interface_settings,
nullptr));
110 g_settings_set_string(interface_settings,
"clock-format",
"12h");
111 g_settings_set_string(interface_settings,
"gtk-theme",
"Yaru-dark");
112 g_settings_set_double(interface_settings,
"text-scaling-factor", 1.5);
119 g_settings_set_string(interface_settings,
"clock-format",
"24h");
120 g_settings_set_string(interface_settings,
"gtk-theme",
"Yaru");
121 g_settings_set_double(interface_settings,
"text-scaling-factor", 2.0);
FlSettings * fl_gnome_settings_new()
TEST_F(FlGnomeSettingsTest, ClockFormat)
static GSettings * create_settings(const gchar *name, const gchar *schema_id)
gboolean fl_settings_get_high_contrast(FlSettings *self)
gdouble fl_settings_get_text_scaling_factor(FlSettings *self)
gboolean fl_settings_get_enable_animations(FlSettings *self)
FlColorScheme fl_settings_get_color_scheme(FlSettings *self)
FlClockFormat fl_settings_get_clock_format(FlSettings *self)
#define EXPECT_SIGNAL(mock)
const char * GetFixturesPath()
Returns the directory containing the test fixture for the target if this target has fixtures configur...
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
DEF_SWITCHES_START aot vmservice shared library name
SK_API sk_sp< PrecompileColorFilter > HighContrast()
#define EXPECT_TRUE(handle)