Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 8ffd562

Browse files
committed
FlGnomeSettingsTest: pass the schema ID to create_settings()
There will be a need to pass e.g. "org.gnome.desktop.a11y.interface" later.
1 parent b4e17bb commit 8ffd562

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

shell/platform/linux/fl_gnome_settings_test.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,21 @@ class FlGnomeSettingsTest : public ::testing::Test {
2323
}
2424
};
2525

26-
static GSettings* create_interface_settings(const gchar* name) {
26+
static GSettings* create_settings(const gchar* name, const gchar* schema_id) {
2727
g_autofree gchar* path =
2828
g_build_filename(flutter::testing::GetFixturesPath(), name, nullptr);
2929
g_autoptr(GSettingsSchemaSource) source =
3030
g_settings_schema_source_new_from_directory(path, nullptr, false,
3131
nullptr);
32-
g_autoptr(GSettingsSchema) schema = g_settings_schema_source_lookup(
33-
source, "org.gnome.desktop.interface", false);
32+
g_autoptr(GSettingsSchema) schema =
33+
g_settings_schema_source_lookup(source, schema_id, false);
3434
g_autoptr(GSettingsBackend) backend = g_memory_settings_backend_new();
3535
return g_settings_new_full(schema, backend, nullptr);
3636
}
3737

3838
TEST_F(FlGnomeSettingsTest, ClockFormat) {
3939
g_autoptr(GSettings) interface_settings =
40-
create_interface_settings("ubuntu-20.04");
40+
create_settings("ubuntu-20.04", "org.gnome.desktop.interface");
4141
g_settings_set_string(interface_settings, "clock-format", "24h");
4242

4343
g_autoptr(FlSettings) settings = fl_gnome_settings_new(interface_settings);
@@ -52,7 +52,7 @@ TEST_F(FlGnomeSettingsTest, ClockFormat) {
5252

5353
TEST_F(FlGnomeSettingsTest, GtkTheme) {
5454
g_autoptr(GSettings) interface_settings =
55-
create_interface_settings("ubuntu-20.04");
55+
create_settings("ubuntu-20.04", "org.gnome.desktop.interface");
5656
g_settings_set_string(interface_settings, "gtk-theme", "Yaru");
5757

5858
g_autoptr(FlSettings) settings = fl_gnome_settings_new(interface_settings);
@@ -67,7 +67,7 @@ TEST_F(FlGnomeSettingsTest, GtkTheme) {
6767

6868
TEST_F(FlGnomeSettingsTest, TextScalingFactor) {
6969
g_autoptr(GSettings) interface_settings =
70-
create_interface_settings("ubuntu-20.04");
70+
create_settings("ubuntu-20.04", "org.gnome.desktop.interface");
7171
g_settings_set_double(interface_settings, "text-scaling-factor", 1.0);
7272

7373
g_autoptr(FlSettings) settings = fl_gnome_settings_new(interface_settings);
@@ -82,7 +82,7 @@ TEST_F(FlGnomeSettingsTest, TextScalingFactor) {
8282

8383
TEST_F(FlGnomeSettingsTest, SignalHandlers) {
8484
g_autoptr(GSettings) interface_settings =
85-
create_interface_settings("ubuntu-20.04");
85+
create_settings("ubuntu-20.04", "org.gnome.desktop.interface");
8686

8787
FlSettings* settings = fl_gnome_settings_new(interface_settings);
8888
flutter::testing::MockSignalHandler settings_changed(settings, "changed");

0 commit comments

Comments
 (0)