From 1e5206eed3848d8014a225b5d8252c5c7aeb137e Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 8 Nov 2012 21:10:09 -0600 Subject: ensure that the service unit test can find all the GSettings schemas that it needs. --- tests/Makefile.am | 11 +- tests/org.gnome.desktop.lockdown.gschema.xml | 45 +++++ ....settings-daemon.plugins.media-keys.gschema.xml | 203 +++++++++++++++++++++ tests/test-service.cc | 8 +- 4 files changed, 260 insertions(+), 7 deletions(-) create mode 100644 tests/org.gnome.desktop.lockdown.gschema.xml create mode 100644 tests/org.gnome.settings-daemon.plugins.media-keys.gschema.xml diff --git a/tests/Makefile.am b/tests/Makefile.am index eedef3a..088b283 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -18,14 +18,16 @@ nodist_libgtest_a_SOURCES = \ AM_CPPFLAGS = $(GTEST_CPPFLAGS) -I${top_srcdir}/src -Wall -Werror AM_CXXFLAGS = $(GTEST_CXXFLAGS) +### +### +### + BUILT_SOURCES += gschemas.compiled CLEANFILES += gschemas.compiled gschemas.compiled: Makefile - @glib-compile-schemas --targetdir=$(abs_builddir) $(top_builddir)/data + $(AM_V_at) cp -f $(top_builddir)/data/*gschema.xml . + $(AM_V_GEN) $(GLIB_COMPILE_SCHEMAS) --targetdir=. . -### -### -### TESTS += test-service check_PROGRAMS += test-service @@ -34,6 +36,7 @@ test_service_LDADD = \ $(TEST_SERVICE_LIBS) \ libgtest.a test_service_CPPFLAGS = \ + -DSCHEMA_DIR="\"$(top_builddir)/tests/\"" \ -DINDICATOR_SERVICE_DIR="\"$(abs_builddir)\"" \ -DINDICATOR_SERVICE_PATH="\"$(top_builddir)/src/indicator-session-service\"" \ $(TEST_SERVICE_CFLAGS) \ diff --git a/tests/org.gnome.desktop.lockdown.gschema.xml b/tests/org.gnome.desktop.lockdown.gschema.xml new file mode 100644 index 0000000..6ccee17 --- /dev/null +++ b/tests/org.gnome.desktop.lockdown.gschema.xml @@ -0,0 +1,45 @@ + + + + + false + Disable command line + Prevent the user from accessing the terminal or specifying a command line to be executed. For example, this would disable access to the panel's "Run Application" dialog. + + + false + Disable saving files to disk + Prevent the user from saving files to disk. For example, this would disable access to all applications' "Save as" dialogs. + + + false + Disable printing + Prevent the user from printing. For example, this would disable access to all applications' "Print" dialogs. + + + false + Disable print setup + Prevent the user from modifying print settings. For example, this would disable access to all applications' "Print Setup" dialogs. + + + false + Disable user switching + Prevent the user from switching to another account while his session is active. + + + false + Disable lock screen + Prevent the user to lock his screen. + + + false + Disable URL and MIME type handlers + Prevent running any URL or MIME type handler applications. + + + false + Disable log out + Prevent the user from logging out. + + + \ No newline at end of file diff --git a/tests/org.gnome.settings-daemon.plugins.media-keys.gschema.xml b/tests/org.gnome.settings-daemon.plugins.media-keys.gschema.xml new file mode 100644 index 0000000..3f8dd50 --- /dev/null +++ b/tests/org.gnome.settings-daemon.plugins.media-keys.gschema.xml @@ -0,0 +1,203 @@ + + + + + true + Activation of this plugin + Whether this plugin would be activated by gnome-settings-daemon or not + + + [] + Custom keybindings + List of custom keybindings + + + 'XF86Calculator' + Launch calculator + Binding to launch the calculator. + + + 'XF86Mail' + Launch email client + Binding to launch the email client. + + + 'XF86Eject' + Eject + Binding to eject an optical disc. + + + '' + Launch help browser + Binding to launch the help browser. + + + 'XF86Explorer' + Home folder + Binding to open the Home folder. + + + 'XF86AudioMedia' + Launch media player + Binding to launch the media player. + + + 'XF86AudioNext' + Next track + Binding to skip to next track. + + + 'XF86AudioPause' + Pause playback + Binding to pause playback. + + + 'XF86AudioPlay' + Play (or play/pause) + Binding to start playback (or toggle play/pause). + + + '<Control><Alt>Delete' + Log out + Binding to log out. + + + 'XF86AudioPrev' + Previous track + Binding to skip to previous track. + + + 98 + Priority to use for this plugin + Priority to use for this plugin in gnome-settings-daemon startup queue + + + '<Control><Alt>l' + Lock screen + Binding to lock the screen. + + + 'XF86Search' + Search + Binding to launch the search tool. + + + 'XF86AudioStop' + Stop playback + Binding to stop playback. + + + 'XF86AudioLowerVolume' + Volume down + Binding to lower the system volume. + + + 'XF86AudioMute' + Volume mute + Binding to mute the system volume. + + + 'XF86AudioRaiseVolume' + Volume up + Binding to raise the system volume. + + + 'Print' + Take a screenshot + Binding to take a screenshot. + + + '<Alt>Print' + Take a screenshot of a window + Binding to take a screenshot of a window. + + + '<Shift>Print' + Take a screenshot of an area + Binding to take a screenshot of an area. + + + '<Ctrl>Print' + Copy a screenshot to clipboard + Binding to copy a screenshot to clipboard. + + + '<Ctrl><Alt>Print' + Copy a screenshot of a window to clipboard + Binding to copy a screenshot of a window to clipboard. + + + '<Ctrl><Shift>Print' + Copy a screenshot of an area to clipboard + Binding to copy a screenshot of an area to clipboard. + + + '<Primary><Alt>t' + Launch terminal + Binding to launch the terminal. + + + 'XF86WWW' + Launch web browser + Binding to launch the web browser. + + + '' + Toggle magnifier + Binding to show the screen magnifier + + + '' + Toggle screen reader + Binding to start the screen reader + + + '' + Toggle on-screen keyboard + Binding to show the on-screen keyboard + + + '' + Increase text size + Binding to increase the text size + + + '' + Decrease text size + Binding to decrease the text size + + + '' + Toggle contrast + Binding to toggle the interface contrast + + + '' + Magnifier zoom in + Binding for the magnifier to zoom in + + + '' + Magnifier zoom out + Binding for the magnifier to zoom out + + + + + + '' + Name + Name of the custom binding + + + '' + Binding + Binding for the custom binding + + + '' + Command + Command to run when the binding is invoked + + + \ No newline at end of file diff --git a/tests/test-service.cc b/tests/test-service.cc index 2f82bb3..21967cb 100644 --- a/tests/test-service.cc +++ b/tests/test-service.cc @@ -46,14 +46,16 @@ class ClientTest : public ::testing::Test session_bus = NULL; main_loop = NULL; - static bool ran_once_init = false; - if (!ran_once_init) + static bool first_run = true; + if (first_run) { g_type_init(); g_setenv ("INDICATOR_SERVICE_SHUTDOWN_TIMEOUT", "1000", TRUE); g_unsetenv ("INDICATOR_ALLOW_NO_WATCHERS"); g_unsetenv ("INDICATOR_SERVICE_REPLACE_MODE"); - ran_once_init = true; + g_setenv ("GSETTINGS_SCHEMA_DIR", SCHEMA_DIR, TRUE); + g_setenv ("GSETTINGS_BACKEND", "memory", TRUE); + first_run = false; } main_loop = g_main_loop_new (NULL, FALSE); -- cgit v1.2.3