aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am11
-rw-r--r--tests/org.gnome.desktop.lockdown.gschema.xml45
-rw-r--r--tests/org.gnome.settings-daemon.plugins.media-keys.gschema.xml203
-rw-r--r--tests/test-service.cc8
4 files changed, 260 insertions, 7 deletions
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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schemalist gettext-domain="gsettings-desktop-schemas">
+ <schema path="/org/gnome/desktop/lockdown/" id="org.gnome.desktop.lockdown">
+ <key type="b" name="disable-command-line">
+ <default>false</default>
+ <summary>Disable command line</summary>
+ <description>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.</description>
+ </key>
+ <key type="b" name="disable-save-to-disk">
+ <default>false</default>
+ <summary>Disable saving files to disk</summary>
+ <description>Prevent the user from saving files to disk. For example, this would disable access to all applications' "Save as" dialogs.</description>
+ </key>
+ <key type="b" name="disable-printing">
+ <default>false</default>
+ <summary>Disable printing</summary>
+ <description>Prevent the user from printing. For example, this would disable access to all applications' "Print" dialogs.</description>
+ </key>
+ <key type="b" name="disable-print-setup">
+ <default>false</default>
+ <summary>Disable print setup</summary>
+ <description>Prevent the user from modifying print settings. For example, this would disable access to all applications' "Print Setup" dialogs.</description>
+ </key>
+ <key type="b" name="disable-user-switching">
+ <default>false</default>
+ <summary>Disable user switching</summary>
+ <description>Prevent the user from switching to another account while his session is active.</description>
+ </key>
+ <key type="b" name="disable-lock-screen">
+ <default>false</default>
+ <summary>Disable lock screen</summary>
+ <description>Prevent the user to lock his screen.</description>
+ </key>
+ <key type="b" name="disable-application-handlers">
+ <default>false</default>
+ <summary>Disable URL and MIME type handlers</summary>
+ <description>Prevent running any URL or MIME type handler applications.</description>
+ </key>
+ <key type="b" name="disable-log-out">
+ <default>false</default>
+ <summary>Disable log out</summary>
+ <description>Prevent the user from logging out.</description>
+ </key>
+ </schema>
+</schemalist> \ 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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schemalist>
+ <schema path="/org/gnome/settings-daemon/plugins/media-keys/" id="org.gnome.settings-daemon.plugins.media-keys" gettext-domain="gnome-settings-daemon">
+ <key type="b" name="active">
+ <default>true</default>
+ <summary>Activation of this plugin</summary>
+ <description>Whether this plugin would be activated by gnome-settings-daemon or not</description>
+ </key>
+ <key type="as" name="custom-keybindings">
+ <default>[]</default>
+ <summary>Custom keybindings</summary>
+ <description>List of custom keybindings</description>
+ </key>
+ <key type="s" name="calculator">
+ <default>'XF86Calculator'</default>
+ <summary>Launch calculator</summary>
+ <description>Binding to launch the calculator.</description>
+ </key>
+ <key type="s" name="email">
+ <default>'XF86Mail'</default>
+ <summary>Launch email client</summary>
+ <description>Binding to launch the email client.</description>
+ </key>
+ <key type="s" name="eject">
+ <default>'XF86Eject'</default>
+ <summary>Eject</summary>
+ <description>Binding to eject an optical disc.</description>
+ </key>
+ <key type="s" name="help">
+ <default>''</default>
+ <summary>Launch help browser</summary>
+ <description>Binding to launch the help browser.</description>
+ </key>
+ <key type="s" name="home">
+ <default>'XF86Explorer'</default>
+ <summary>Home folder</summary>
+ <description>Binding to open the Home folder.</description>
+ </key>
+ <key type="s" name="media">
+ <default>'XF86AudioMedia'</default>
+ <summary>Launch media player</summary>
+ <description>Binding to launch the media player.</description>
+ </key>
+ <key type="s" name="next">
+ <default>'XF86AudioNext'</default>
+ <summary>Next track</summary>
+ <description>Binding to skip to next track.</description>
+ </key>
+ <key type="s" name="pause">
+ <default>'XF86AudioPause'</default>
+ <summary>Pause playback</summary>
+ <description>Binding to pause playback.</description>
+ </key>
+ <key type="s" name="play">
+ <default>'XF86AudioPlay'</default>
+ <summary>Play (or play/pause)</summary>
+ <description>Binding to start playback (or toggle play/pause).</description>
+ </key>
+ <key type="s" name="logout">
+ <default>'&lt;Control&gt;&lt;Alt&gt;Delete'</default>
+ <summary>Log out</summary>
+ <description>Binding to log out.</description>
+ </key>
+ <key type="s" name="previous">
+ <default>'XF86AudioPrev'</default>
+ <summary>Previous track</summary>
+ <description>Binding to skip to previous track.</description>
+ </key>
+ <key type="i" name="priority">
+ <default>98</default>
+ <summary>Priority to use for this plugin</summary>
+ <description>Priority to use for this plugin in gnome-settings-daemon startup queue</description>
+ </key>
+ <key type="s" name="screensaver">
+ <default>'&lt;Control&gt;&lt;Alt&gt;l'</default>
+ <summary>Lock screen</summary>
+ <description>Binding to lock the screen.</description>
+ </key>
+ <key type="s" name="search">
+ <default>'XF86Search'</default>
+ <summary>Search</summary>
+ <description>Binding to launch the search tool.</description>
+ </key>
+ <key type="s" name="stop">
+ <default>'XF86AudioStop'</default>
+ <summary>Stop playback</summary>
+ <description>Binding to stop playback.</description>
+ </key>
+ <key type="s" name="volume-down">
+ <default>'XF86AudioLowerVolume'</default>
+ <summary>Volume down</summary>
+ <description>Binding to lower the system volume.</description>
+ </key>
+ <key type="s" name="volume-mute">
+ <default>'XF86AudioMute'</default>
+ <summary>Volume mute</summary>
+ <description>Binding to mute the system volume.</description>
+ </key>
+ <key type="s" name="volume-up">
+ <default>'XF86AudioRaiseVolume'</default>
+ <summary>Volume up</summary>
+ <description>Binding to raise the system volume.</description>
+ </key>
+ <key type="s" name="screenshot">
+ <default>'Print'</default>
+ <summary>Take a screenshot</summary>
+ <description>Binding to take a screenshot.</description>
+ </key>
+ <key type="s" name="window-screenshot">
+ <default>'&lt;Alt&gt;Print'</default>
+ <summary>Take a screenshot of a window</summary>
+ <description>Binding to take a screenshot of a window.</description>
+ </key>
+ <key type="s" name="area-screenshot">
+ <default>'&lt;Shift&gt;Print'</default>
+ <summary>Take a screenshot of an area</summary>
+ <description>Binding to take a screenshot of an area.</description>
+ </key>
+ <key type="s" name="screenshot-clip">
+ <default>'&lt;Ctrl&gt;Print'</default>
+ <summary>Copy a screenshot to clipboard</summary>
+ <description>Binding to copy a screenshot to clipboard.</description>
+ </key>
+ <key type="s" name="window-screenshot-clip">
+ <default>'&lt;Ctrl&gt;&lt;Alt&gt;Print'</default>
+ <summary>Copy a screenshot of a window to clipboard</summary>
+ <description>Binding to copy a screenshot of a window to clipboard.</description>
+ </key>
+ <key type="s" name="area-screenshot-clip">
+ <default>'&lt;Ctrl&gt;&lt;Shift&gt;Print'</default>
+ <summary>Copy a screenshot of an area to clipboard</summary>
+ <description>Binding to copy a screenshot of an area to clipboard.</description>
+ </key>
+ <key type="s" name="terminal">
+ <default>'&lt;Primary&gt;&lt;Alt&gt;t'</default>
+ <summary>Launch terminal</summary>
+ <description>Binding to launch the terminal.</description>
+ </key>
+ <key type="s" name="www">
+ <default>'XF86WWW'</default>
+ <summary>Launch web browser</summary>
+ <description>Binding to launch the web browser.</description>
+ </key>
+ <key type="s" name="magnifier">
+ <default>''</default>
+ <summary>Toggle magnifier</summary>
+ <description>Binding to show the screen magnifier</description>
+ </key>
+ <key type="s" name="screenreader">
+ <default>''</default>
+ <summary>Toggle screen reader</summary>
+ <description>Binding to start the screen reader</description>
+ </key>
+ <key type="s" name="on-screen-keyboard">
+ <default>''</default>
+ <summary>Toggle on-screen keyboard</summary>
+ <description>Binding to show the on-screen keyboard</description>
+ </key>
+ <key type="s" name="increase-text-size">
+ <default>''</default>
+ <summary>Increase text size</summary>
+ <description>Binding to increase the text size</description>
+ </key>
+ <key type="s" name="decrease-text-size">
+ <default>''</default>
+ <summary>Decrease text size</summary>
+ <description>Binding to decrease the text size</description>
+ </key>
+ <key type="s" name="toggle-contrast">
+ <default>''</default>
+ <summary>Toggle contrast</summary>
+ <description>Binding to toggle the interface contrast</description>
+ </key>
+ <key type="s" name="magnifier-zoom-in">
+ <default>''</default>
+ <summary>Magnifier zoom in</summary>
+ <description>Binding for the magnifier to zoom in</description>
+ </key>
+ <key type="s" name="magnifier-zoom-out">
+ <default>''</default>
+ <summary>Magnifier zoom out</summary>
+ <description>Binding for the magnifier to zoom out</description>
+ </key>
+ </schema>
+
+ <schema id="org.gnome.settings-daemon.plugins.media-keys.custom-keybinding" gettext-domain="gnome-settings-daemon">
+ <key type="s" name="name">
+ <default>''</default>
+ <summary>Name</summary>
+ <description>Name of the custom binding</description>
+ </key>
+ <key type="s" name="binding">
+ <default>''</default>
+ <summary>Binding</summary>
+ <description>Binding for the custom binding</description>
+ </key>
+ <key type="s" name="command">
+ <default>''</default>
+ <summary>Command</summary>
+ <description>Command to run when the binding is invoked</description>
+ </key>
+ </schema>
+</schemalist> \ 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);