6 #include "flutter/shell/platform/linux/testing/fl_test.h"
7 #include "flutter/testing/testing.h"
11 #include "gmock/gmock.h"
12 #include "gtest/gtest.h"
14 TEST(FlSettingsPortalTest, ClockFormat) {
15 g_autoptr(GVariantDict) settings = g_variant_dict_new(
nullptr);
17 g_autoptr(FlSettings) portal =
21 g_variant_dict_insert_value(settings,
22 "org.gnome.desktop.interface::clock-format",
23 g_variant_new_string(
"24h"));
26 g_variant_dict_insert_value(settings,
27 "org.gnome.desktop.interface::clock-format",
28 g_variant_new_string(
"12h"));
31 g_variant_dict_insert_value(settings,
32 "org.gnome.desktop.interface::clock-format",
33 g_variant_new_string(
"unknown"));
38 g_autoptr(GVariantDict) settings = g_variant_dict_new(
nullptr);
40 g_autoptr(FlSettings) portal =
44 g_variant_dict_insert_value(settings,
45 "org.freedesktop.appearance::color-scheme",
46 g_variant_new_uint32(1));
49 g_variant_dict_insert_value(settings,
50 "org.freedesktop.appearance::color-scheme",
51 g_variant_new_uint32(2));
54 g_variant_dict_insert_value(settings,
55 "org.freedesktop.appearance::color-scheme",
56 g_variant_new_uint32(123));
60 g_variant_dict_insert_value(settings,
61 "org.gnome.desktop.interface::gtk-theme",
62 g_variant_new_string(
"Yaru-dark"));
66 TEST(FlSettingsPortalTest, GtkTheme) {
67 g_autoptr(GVariantDict) settings = g_variant_dict_new(
nullptr);
69 g_autoptr(FlSettings) portal =
73 g_variant_dict_insert_value(settings,
74 "org.gnome.desktop.interface::gtk-theme",
75 g_variant_new_string(
"Yaru-dark"));
78 g_variant_dict_insert_value(settings,
79 "org.gnome.desktop.interface::gtk-theme",
80 g_variant_new_string(
"Yaru"));
83 g_variant_dict_insert_value(settings,
84 "org.gnome.desktop.interface::gtk-theme",
85 g_variant_new_string(
"Adwaita"));
88 g_variant_dict_insert_value(settings,
89 "org.gnome.desktop.interface::gtk-theme",
90 g_variant_new_string(
"Adwaita-dark"));
94 g_variant_dict_insert_value(settings,
95 "org.freedesktop.appearance::color-scheme",
96 g_variant_new_uint32(2));
100 TEST(FlSettingsPortalTest, EnableAnimations) {
101 g_autoptr(GVariantDict) settings = g_variant_dict_new(
nullptr);
103 g_autoptr(FlSettings) portal =
107 g_variant_dict_insert_value(settings,
108 "org.gnome.desktop.interface::enable-animations",
109 g_variant_new_boolean(
false));
113 TEST(FlSettingsPortalTest, HighContrast) {
114 g_autoptr(GVariantDict) settings = g_variant_dict_new(
nullptr);
116 g_autoptr(FlSettings) portal =
120 g_variant_dict_insert_value(settings,
121 "org.gnome.desktop.a11y.interface::high-contrast",
122 g_variant_new_boolean(
true));
126 TEST(FlSettingsPortalTest, TextScalingFactor) {
127 g_autoptr(GVariantDict) settings = g_variant_dict_new(
nullptr);
129 g_autoptr(FlSettings) portal =
133 g_variant_dict_insert_value(
134 settings,
"org.gnome.desktop.interface::text-scaling-factor",
135 g_variant_new_double(1.5));