Commit Graph

8 Commits

Author SHA1 Message Date
Dan Winship
d68f8012b2 gio/tests/testapps: Fix source refcounting
Either child_watch_source or timeout_source will already have been
destroyed after we finish the loop, and it's not safe to call
g_source_destroy() on it a second time unless we're still holding a
ref on it.
2010-06-22 15:37:42 -04:00
Colin Walters
85210bcf9b Switch to using variants for timestamps, split out signals
Like how we're handling activation, use GVariant for timestamps.  To
avoid polluting the GtkApplication API with GVariants, we rename the
GApplication signals to "quit-with-data" and "action-with-data".
GtkApplication will then wrap those as just "quit" and "action".

https://bugzilla.gnome.org/show_bug.cgi?id=621002
2010-06-14 16:36:23 -04:00
Matthias Clasen
fdb15058a4 Avoid a race in application registration
We need to register the object before taking the name.
Remove the workarounds for this race from the test suite.
2010-06-13 01:03:10 -04:00
Matthias Clasen
19012ada57 Accept no-reply errors
This can happen if the app quits before the dbus reply can be
sent out.
2010-06-12 01:55:25 -04:00
Matthias Clasen
330cdfbdf1 Make the tests not fall over every other time 2010-06-11 23:21:49 -04:00
Colin Walters
cc19922183 Rewrite apps test to ensure children are killed
Create a function run_with_application that both ensures the
app is running exactly while the test is running, which most
of the tests use.  We start it beforehand, and kill it after.
This avoids having any interdependence between the tests (and
there definitely was before, because we didn't wait for
the process to actually terminate after a kill() call).

Also, open a pipe between the two, and have the child app
monitor that pipe.  If it gets closed (e.g. because the parent
died), the child exits.  This is the most reliable way to
avoid stale children; before, if we failed an assertion, the
parent would abort, and not run kill().

https://bugzilla.gnome.org/show_bug.cgi?id=621034
2010-06-10 13:14:29 -04:00
Matthias Clasen
6720596544 Fix GApplication tests to run without a session bus
We reuse code from the GDBus tests here to launch a session bus.
2010-06-09 23:44:13 -04:00
Matthias Clasen
6427e93757 Merge the wip/gapplication branch
This adds a GApplication object to GIO, which is the core of
an application support class, supporting
- uniqueness
- exporting actions (simple scripting)
- standard actions (quit, activate)

The implementation for Linux uses D-Bus, takes a name on the
session bus, and exports a org.gtk.Application interface.

Implementations for Win32 and OS X are still missing.
2010-06-07 13:48:42 -04:00