Commit Graph

91 Commits

Author SHA1 Message Date
Matthias Clasen
f870a50f1f Add a test for property notification
This tests just a few basic things for now. Mainly, that we don't
emit redundant notifications for enum, flags, int and boolean
properties. It also checks that we do emit the expected notifications
when the value actually changes. This is checked for string, double
and float properties as well.

There is a large number of exceptions in the test, and a lot more
checks that could be done. One class of exceptions is all the places
where we have -set booleans to go along with another property. We
should have a dedicated test for these pairs. Another class of
exceptions is where naked objects created by g_object_new () just
don't have the full functionality - e.g. a tree selection without
a tree view does not work very well. We set up the instance object
better for these situations.
2014-06-09 13:31:14 -04:00
Carlos Garnacho
524e28a13c tests: Add multitouch gesture tests
So far, gesture behavior on lack/excess of touchpoints is tested, as well
as sequence hand-in between gestures in these situations.
2014-06-04 13:54:41 +02:00
Matthias Clasen
d467850af0 Shorten test paths 2014-06-03 14:22:55 -04:00
Carlos Garnacho
94f573d8a4 tests: Add tests for grab interaction with gestures
The behavior of gestures that are kept outside/inside a grab is tested,
to ensure the former are cancelled and the latter remain unchanged.
2014-06-03 16:13:25 +02:00
Carlos Garnacho
93f72985bf tests: Add gesture tests for early/late sequence claiming
This tests both a sequence being claimed early to be then denied
(and handled deeper in propagation chain), and a sequence being
claimed late in the capture phase (and thus being cancelled deeper
in the propagation chain)
2014-06-03 16:13:25 +02:00
Carlos Garnacho
fd1a566d46 tests: Inform of gesture updates during recognition
May be useful to find out which gestures are still being triggered
by a sequence.
2014-06-03 16:13:25 +02:00
Carlos Garnacho
fe7215e369 testsuite: Prepare gestures testsuite for mouse/touch events
state is preserved for mouse emulation, and up to 10 touchpoints for touch
emulation.
2014-06-03 15:59:03 +02:00
Carlos Garnacho
26ced6abad widget: Only deny a sequence if it was previously claimed
Before this change, a sequence being claimed deep in the event propagation
chain would make the sequence go denied on every ancestor, regardless of
previous state.

To make things more consistent, only deny the sequence if it was previously
claimed, so the behavior is the same for gesture groups within the widget
than for those outside the widget.

The gestures testsuite has been updated to reflect this new behavior.
2014-06-03 15:59:03 +02:00
Carlos Garnacho
c773859c99 gesture: Ensure late gestures handling the sequence get the group state
It might happen that a gesture claims a sequence before any other gesture
in its group even handled a single event from that sequence. In that case,
ensure the state is set accordingly right when the sequence is handled in
those.

The "group" gesture testcase has been updated to observe this behavior.
2014-06-03 15:59:03 +02:00
Matthias Clasen
97930a774b Add more gestures tests
Some of these sequences look wrong/questionable to me.
2014-05-31 18:46:43 -04:00
Matthias Clasen
bdf81a7c70 gestures test: make more readable 2014-05-31 12:54:36 -04:00
Matthias Clasen
4298e88f48 gestures: Add a test for grouping
I'm not entirely convinced the test produces the expected
outcome, here.
2014-05-31 12:48:14 -04:00
Matthias Clasen
1c24b288b0 Expand gesture tests a big more
Print out sequence state changes, and cancellation, and verify that
claiming a gestures causes the expected state changes.
2014-05-31 12:26:15 -04:00
Matthias Clasen
98cf67ddba testsuite: put installed tests in the right place
Follow the prevailing practice and put the installed tests
into $libdir/installed-tests/$PACKAGE instead of
$pkglibdir/installed-tests.
2014-05-31 00:16:07 -04:00
Matthias Clasen
1153ea86ed Add a failing builder testcase
This shows <signal> failing because class_init hasn't been run
yet.
2014-05-30 12:09:43 -04:00
Matthias Clasen
2388c69f0c Add some gesture tests
This test starts to assemble tests related to event propagation,
interaction with traditional event signal handlers, claiming of
events, etc.
2014-05-27 19:15:40 -04:00
Matthias Clasen
44d76fbcdc Organize the icons
Sort the icon list in check-icon-theme.c, and add
comments so we have a chance of keeping the order.
2014-05-24 18:20:31 -04:00
Matthias Clasen
ef38d6e397 Add two more icon names to check
These were found in the trash monitor.
2014-05-23 22:59:22 -04:00
Matthias Clasen
486c82ae8f testsuite: Add more icon names
These were found by looking over the GTK+ sources and ui files.
2014-05-23 12:17:56 -04:00
Matthias Clasen
7caecf3979 Add more icons to check-icon-names
These are icons which are used as GtkArrow replacement, and
icons used for the volume button.
2014-05-23 11:52:12 -04:00
Benjamin Otte
74b6f5fba8 testsuite: Add a test for icon names
This test just checks that all the icon names that GTK uses are present
in the default icon theme.

As icon names are not checked programmatically and we do not want to run
into missing-icon icons in the code, this test seems necessary.

For now, it's just a stub that tests stock icons.
2014-05-23 17:12:32 +02:00
Marc-André Lureau
a3d0b8d7f4 tests: add clipboard set_with_data test
https://bugzilla.gnome.org/show_bug.cgi?id=730183
2014-05-22 12:44:10 +02:00
Matthias Clasen
8f7dceda3c Update treeview tests for focus changes
The treeview is not using focus-pad here anymore, so update
the tests to not expect it.
2014-05-22 06:15:12 -04:00
Matthias Clasen
f750f70c7d tests: Make icontheme test installable
To make the icontheme test run successfully when installed,
we need to use the correct test-framework-provided location,
and we need to install the test theme without stripping its
subdirectory structure.
2014-05-21 13:46:49 -04:00
Benjamin Otte
0f788ab1be testsuite: Add rtl icontheme tests 2014-05-14 04:55:11 +02:00
Matthias Clasen
0f5814aa33 icontheme: Add a test for lookup order
Add tests that verify the expected lookup order between -symbolic,
-rtl/-ltr and generic fallback.
2014-05-14 04:28:36 +02:00
Matthias Clasen
26c2975007 testsuite: Add icontheme tests for generic fallback 2014-05-14 04:28:36 +02:00
Benjamin Otte
77a9539e07 icontheme: Do a failed lookup at the beginning
Do this to catch the g_warning() that the icontheme code emits the first
time a lookup fails.
2014-05-14 04:28:36 +02:00
Benjamin Otte
5f794773aa testsuite: Add more icontheme tests
Check that the lookup order works properly when forcing either symbolic
or regular icons.
2014-05-14 04:28:36 +02:00
Benjamin Otte
5ba4a085e2 testsuite: Add a basic icontheme test
Most of the work here is creating the infrastructure to have a custom
icon theme to add icons to and run tests against.
2014-05-14 04:28:35 +02:00
Matthias Clasen
ce0325207e Add a test for the previous fix 2014-05-13 11:56:29 -04:00
Juan Pablo Ugarte
49fa04212b GtkBuilder: improved parsing error report for invalid properties and signals.
Added GTK_BUILDER_ERROR_INVALID_PROPERTY and GTK_BUILDER_ERROR_INVALID_SIGNAL
error codes

ObjectInfo: Use a GType instead of a char * for the class name.
PropertyInfo: Use a GParamSpec instead of a char * for the property name.
SignalInfo: Use signal id and detail quark instead of a detailed signal name string.

This not only save us a few malloc in each case but lets us simplify the code
and report unknown properties and signals as a parsing error instead of just
printing a warning.
2014-05-01 17:59:53 -03:00
Juan Pablo Ugarte
9753f9f55f Added template test case to builder test. 2014-04-29 12:29:18 -03:00
Juan Pablo Ugarte
887fc60cce Added bindings support to GtkBuilder by introducing 3 new <property> attributes "bind-source" to specify the source object of the binding "bind-property" to specify the source property and "bind-flags" to specify the binding flags (optional)
Binding an object sensitive property with a check button active property will look like this:

<object class="GtkButton" id="button">
  <property name="sensitive" bind-source="checkbutton" bind-property="active"/>
</object>

This is based on the original work done by Denis Washington for his GSoC project

This closes Bug 654417 "[GSoC] Add <binding> element to GtkBuilder syntax"
2014-04-18 18:59:14 -03:00
Sébastien Wilmet
704a178abb tests textiter: test word boundaries
- As the tests show, some of the functions have a strange and
inconsistent behavior for corner cases.

- Rename test_full_buffer() -> test_search_full_buffer() because
textiter.c is used for other GtkTextIter unit tests.

https://bugzilla.gnome.org/show_bug.cgi?id=727908
2014-04-13 14:04:10 -07:00
Matthias Clasen
14ce8025ca listbox: Add tests for multi-selection
This was forgotten when the multi-selection API was added,
and it was promptly broken in some places.
2014-04-13 14:04:09 -07:00
Matthias Clasen
8520282f75 Fix up builder test
Dialogs now report two children. Thats alright, adapt
the test to deal with it.
2014-03-03 23:31:48 -05:00
Benjamin Otte
750eaf53d6 testsuite: Add a test for a Firefox issue
When creating a style context, the CSS for the theme might not be
loaded. If it is, this test will succeed.

https://bugzilla.redhat.com/show_bug.cgi?id=1064922
https://bugzilla.mozilla.org/show_bug.cgi?id=972382
2014-02-20 02:10:07 +01:00
Matthias Clasen
496f14ee53 Add some more templates tests
GtkActionBar and GtkSearchBar also use templates,
add them here.
2014-02-17 21:42:38 -05:00
Matthias Clasen
c45932f9bc Exempt GtkAssistant.use-header-bar from defaultvalue test
Just like GtkDialog, this one has a special-purpose
default value.
2014-02-02 19:47:36 -05:00
William Jon McCann
d87ea4776a Merge GtkFileChooserWidget and GtkFileChooserDefault
It seems that alternate implementations of GtkFileChooserWidget
never materialized. The split between GtkFileChooserWidget and
GtkFileChooserDefault is awkward. The immediate problem is that
it makes it difficult to document the keybinding signals. So it
makes sense to drop the abstraction and just have one thing.

https://bugzilla.gnome.org/show_bug.cgi?id=723157
2014-01-28 23:09:42 -05:00
Matthias Clasen
88a070e84d Exclude GtkPopover::pointing-to from the defaultvalue test 2014-01-25 14:20:51 -05:00
Matthias Clasen
c6ae9e6b47 Exclude use-header-bar from the defaultvalue test 2014-01-17 17:52:08 -05:00
Matthias Clasen
abe29dd188 Update all internal users of gtk_dialog_get_action_area
Some of these should be revisited and fixed. For now,
just avoid the deprecation warnings.
2014-01-17 17:52:07 -05:00
Ryan Lortie
bc3867eb85 GtkApplicationWindow: give up on handling dispose
Stop trying to deal with "theoretical possibilities".

We can't possibly continue to be a faithful GActionGroup implementation
across dispose because dispose has a side effect of removing everyone's
signal handlers.

The code that we ran after the dispose chainup to do all of the fancy
signal emulation was therefore dead.  The test that aimed to verify this
was buggy itself due to an uninitialised variable, so really, it never
worked at all.

We keep the re-ordering of the chainup from the original commit to avoid having
trouble with GtkActionMuxer and keep the checks in place that will prevent an
outright segfault in the case that someone else tries to use the interface
post-dispose.

https://bugzilla.gnome.org/show_bug.cgi?id=722189
2014-01-14 10:41:35 -05:00
Steve Langasek
256561db2f fix prototypes of signal callbacks in the test suite
The signal callbacks are defined to take pointers as their arguments, but the
callbacks found in testsuite/gtk/builder.c are passing a GParamSpec by value
as the second argument.  This confuses and angers the compiler on ppc64el,
resulting in segfaults after return from the function due to stack-smashing
by the (completely-unused) argument.

https://bugzilla.gnome.org/show_bug.cgi?id=721700
2014-01-08 10:43:52 +01:00
Ryan Lortie
99ebb1cad2 app window: test actiongroup across destroy
Make sure that we don't violate the interface contract of GActionGroup
just because gtk_widget_destroy() was called.

https://bugzilla.gnome.org/show_bug.cgi?id=710351
2014-01-07 20:30:57 -05:00
Matthias Clasen
9bfe7525ce Fix make dist 2013-12-05 01:04:10 -05:00
Lars Uebernickel
e5828073c2 gtk object tests: run under local environment
Make sure that the tests don't access the host's session bus or
installed gsettings schemas.

Also disable tests for some classes that leak a connection to the
session bus.

https://bugzilla.gnome.org/show_bug.cgi?id=711715
2013-12-03 14:24:16 +01:00
Ryan Lortie
ce2d9b430c defaultvalue test: ignore show-desktop
Ignore the "show-desktop" property on GtkPlacesSidebar for the
defaultvalue test.

Currently, "make check" is passing because it runs the test under a xvfb
with no XSETTINGS provider, so we see the Gtk default value.  No matter
what we set the default value to in Gtk, however, there will be some
desktop environment in which someone running the installed test outside
of an xvfb will get the wrong result.  Best to ignore it.

https://bugzilla.gnome.org/show_bug.cgi?id=712302
2013-11-26 14:27:59 -05:00