Commit Graph

374 Commits

Author SHA1 Message Date
Matthias Clasen
2c807335c4 Add tests for the GtkLabel builder parser
These tests check various error conditions in GtkLabel
custom tags.
2015-04-27 01:15:22 -04:00
Matthias Clasen
40bb2a1616 reftests: Add a way to compare different runs
gtk-reftest already had an --output=DIR option to tell it where
to save all the resulting images. Now you can combine this with
the --compare-with=DIR option in a second run to make gtk-reftest
compare the .out.png files from the first run with the .out.png
files of the current run, instead of producing .ref.png files.

The intended use for this is to verify that changes do not affect
the generated output.
2015-03-20 16:42:04 -04:00
Benjamin Otte
ec57c6c10b csspathnode: Handle context going away
Sometimes path nodes can survive longer than the style context that
created them. Don't crash in those cases.

Fixes startup of mutter.

Testcase included.

https://bugzilla.gnome.org/show_bug.cgi?id=746407
2015-03-18 18:24:45 +01:00
Benjamin Otte
6c00eba7fb testsuite: Add another random stylecontext test 2015-03-18 15:23:31 +01:00
Benjamin Otte
2670ae4436 reftests: Add a reftest for box sibling ordering 2015-03-18 15:23:31 +01:00
Benjamin Otte
2d013a739a reftests: Fix test on HighContrast theme
We are testing -gtk-icon-style and assume the theme doesn't touch it.
But HighContrast forces symbolic icons. And that breaks the reference
images.

So explicitly set "requested" for everything.
2015-03-16 15:44:42 +01:00
Matthias Clasen
98730f71f9 testsuite: Set some environment variables
These were set manually in some tests, but not consistently.
2015-03-13 17:51:42 -04:00
Matthias Clasen
b756fd42a0 testsuite: Drop test bus
It seems to be buggy in ways that make the test fail
with a critical when the test bus is brought down.
At the same time, drop manual settings of environment
variables that we can set globally.
2015-03-13 17:51:32 -04:00
Matthias Clasen
8615a52ca3 Add some reftests related to textview tags
This test shows that a) tags override the text view style and
b) tags override each other in the expected way.
2015-03-11 22:04:29 -04:00
Philip Withnall
52858f709c gtktreeselection: Fix an abort on selecting an invalid range
gtk_tree_selection_real_modify_range() has a g_return_if_fail() if the
start or end paths passed to it do not correspond to real tree nodes.
However, GtkTreePaths inherently do not have to be valid, so it should
be acceptable to call gtk_tree_selection_select_range() with
non-existent paths. Replace the g_return_if_fail() by a silent return,
and add a unit test.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2015-03-11 11:24:29 +00:00
Matthias Clasen
ec567e5fad Add a test for builder-constructed file filters 2015-03-08 09:12:21 -04:00
Benjamin Otte
40f2af665d gdkcairo: Bail if surface is in error
Don't try to paint onto an error surface. This happens for example when
gdk_cairo_set_source_pixbuf() is called with a pixbuf that is too big
for Cairo to handle.

Spotted by Christian Boxdörfer
2015-02-25 01:55:28 +01:00
Benjamin Otte
0ab48fcc42 css: Fix _gtk_bitmask_subtract()
We were doing the wrong thing *and* writing uninitialized memory while
doing so. BAD.

Also added tests exposing these.

https://bugzilla.redhat.com/show_bug.cgi?id=1185585
2015-02-25 01:55:28 +01:00
Benjamin Otte
7eecb16404 treeview: Don't create an overly large pixel cache
GPUs generally have problems when you create a 35000px wide surface.
Luckily X catches this and sends a BadAlloc. Which GTK immediately
abort()s on.

Testcase included.

https://bugzilla.redhat.com/show_bug.cgi?id=1163579
2015-02-05 18:57:29 +01:00
Benjamin Otte
edec64cda3 stylecontext: Don't crah when invalidate() is called on saved context
We need to invalidate the root node, not the current one.
Fixes crashes on startup of eclipse.

Testcase included.

https://bugzilla.redhat.com/show_bug.cgi?id=1185828
2015-02-04 21:20:29 +01:00
Benjamin Otte
7e5ac3a58d roundedbox: Treat path segments differently
If a side of the box is 0px wide, make the corners owned by the adjacent
sides. This avoids spilling over of unwanted colors from the 0-width
side into the corner.

New test for this case is included.
2015-01-22 16:25:54 +01:00
Benjamin Otte
f313a8235b reftests: Fix border-style-none reftest
Unset all CSS; Adwaita was messing up things.
2015-01-20 01:15:04 +01:00
Benjamin Otte
ad199e4cf9 stylecontext: Use correct parent style for lookups
After 3a337156d1 style lookups still used
the parent context's style as the parent style, even though after a
gtk_style_context_save() the root style of the style context is the
proper parent.

Testcase attached.
2015-01-07 14:26:48 +01:00
Ting-Wei Lan
ef57ac6bf1 reftests: Fix typo
It causes build failure on MinGW.

https://bugzilla.gnome.org/show_bug.cgi?id=741827
2014-12-22 11:14:17 +08:00
Benjamin Otte
7b6c68adc6 testsuite: Fix test that was committed in a broken state
1) Use font-size instead of color
This makes it easier to compare reference and test because the values
don't change.

2) Actually sort the reference properly
This unbreaks the test.
2014-12-01 04:05:44 +01:00
Matthias Clasen
0438df6d14 Quiet a rule 2014-11-30 19:58:34 -05:00
Matthias Clasen
c5f2f86ff9 Drop an unused function 2014-11-30 19:58:08 -05:00
Benjamin Otte
06952d807a testsuite: Add a bunch of parsing tests for :not() 2014-11-25 19:33:18 +01:00
Ray Strode
3a5d15358e testsuite: add hide-titlebar-when-maximized test for GtkWindow
This commit adds a test that checks whether or not
hide-titlebar-when-maximized can be set before the window is
realized.

https://bugzilla.gnome.org/show_bug.cgi?id=740287
2014-11-24 12:52:25 -05:00
Matthias Clasen
7d35351c7a Update expected results 2014-11-23 18:53:06 -05:00
Matthias Clasen
a09ff50a1d notify test: Exclude a few new properties
The button properties don't make sense on GtkModelButton (indicating
that GtkModelButton should really not be a GtkButton subclass).
2014-11-23 18:30:13 -05:00
Matthias Clasen
824fa0314d Add some more builder tests 2014-11-03 19:07:18 -05:00
Matthias Clasen
e6e511eb46 GtkListBox: Fix a bug in unselection
Ensure that gtk_list_box_get_selected_row returns NULL after
gtk_list_box_unselect_all. Add a testcase that detects this
problem.
2014-10-31 22:34:09 -04:00
Matthias Clasen
60a11333af Update expected results of a11y tests
The new has-tooltip state is showing up in a number of places,
as expected.
2014-10-27 20:03:51 -04:00
Joanmarie Diggs
2893a71a3e Implement support for ATK_STATE_HAS_TOOLTIP
https://bugzilla.gnome.org/show_bug.cgi?id=738982
2014-10-22 22:55:13 -04:00
Emmanuele Bassi
7b6a6c9421 tests/gtk: Add GdkX11GLContext to the whitelist
We cannot create them directly anyway.
2014-10-22 21:20:52 +01:00
Emmanuele Bassi
9464415121 tests/a11y/about: Fix expected text
We recently changed the uppercase licensing text to lower case. The
reference test that checks the contents of the about dialog has to be
fixed to reflect that change.
2014-10-22 21:17:37 +01:00
Matthias Clasen
0f309c9dcf Skip GdkX11GLContext in some object tests
Since it can't be constructed without specifying a GdkWindow,
which we don't have here.
2014-10-21 23:48:12 -04:00
Matthias Clasen
38b315d0be Add a a drop-in test for the GtkBuilder parser 2014-10-18 22:18:59 -04:00
Matthias Clasen
80226ca926 GtkBuilder: Undo the type name heuristic changes
These turned out to break existing ui files, concretely
GWeatherLocationEntry was no longer guessed correctly.

Update the testcases to reflect this, and add a testcase
for GWeather.
2014-10-03 09:29:45 -04:00
Benjamin Otte
e683e915b8 css: Queue resize for properties that affect clip
This fixes shadows that are animated not updating the clip of the widget
they are drawn on. An example of this are the buttons in the CSS shadows
example in gtk-demo.

Reftest included
2014-10-03 06:18:04 +02:00
Benjamin Otte
7afac9670b image: Implement clipping support for icon-shadow
Testcase is attached.
2014-10-03 06:18:04 +02:00
Marek Kasik
8b5d30d439 Remove redundant checks for NULL
Remove checks for NULL before g_free() and g_clear_object().
Merge check for NULL, freeing of pointer and its setting
to NULL by g_clear_pointer().

https://bugzilla.gnome.org/show_bug.cgi?id=733157
2014-10-02 19:06:03 +02:00
Jasper St. Pierre
3b08ba24b3 reftests: Actually add a text-shadow to the text-shadow reftest
The reftest still passes, since the code still works, but we might as
well test what we claim to test.
2014-09-30 13:43:36 -06:00
Matthias Clasen
4a38330a90 Add a test for GtkBuilder typename-mangling
This test makes sure that out heuristic for finding
get_type functions works as expected.

https://bugzilla.gnome.org/show_bug.cgi?id=635258
2014-09-26 23:31:11 -04:00
Benjamin Otte
9d0ec409ff reftest: Build a shared lib on win32
Windows needs a shared library to link the modules against, otherwise
the undefined symbols make it not work.

So build a shared library on Windows.

We don't want a library elsewhere, as that just complicates things, so
we only make the library shared on Windows and keep it as a noinst
library otherwise.

https://bugzilla.gnome.org/show_bug.cgi?id=736338
2014-09-22 15:47:02 +02:00
Rico Tzschichholz
aa08b87ab6 reftest: Add missing include of reftest-snapshot.h 2014-09-22 15:19:51 +02:00
Matthias Clasen
7ead9d45de check-icon-names: Check for legacy names again
Keep checking the legacy icon names as long as we support them
(this caught gtk-undelete not working quite as expected).
2014-09-21 23:14:56 -04:00
Matthias Clasen
b5a3900588 check-icon-theme: Print the name of the icon-theme 2014-09-21 16:34:33 -04:00
Matthias Clasen
df8a688656 icon-theme: Test inheritance vs. generic fallback
Add a few tests that check the behavior of icon theme inheritance
vs generic fallback vs symbolic icons.
2014-09-21 16:34:27 -04:00
Benjamin Otte
ee9e708cf6 reftest: Build a private library for gtk-reftest
This is a noinst library for now, but the idea is to turn it into a
proper DLL on Windows, so that we can install it and properly link the
modules to it. Windows doesn't allow undefined symbols in modules.

https://bugzilla.gnome.org/show_bug.cgi?id=736338
2014-09-21 18:59:12 +02:00
Benjamin Otte
2e6dd4082f reftest: Split our more functionality
Split actually taking the snapshot into its own file.
2014-09-21 18:58:45 +02:00
Benjamin Otte
0182d1ed38 reftest: Split out some functionality into own file
Comparing two surfaces is something that can be nicely factored out.
2014-09-21 18:58:45 +02:00
Benjamin Otte
9a8a4a8b14 widget: Don't assume opacity is 100%
... just because there is no style context instantiated yet. Instead,
instantiate a style context during realize() and ask it.

Fixes problems with dim labels not being dimmed on first show.

Testcase included.

https://bugzilla.gnome.org/show_bug.cgi?id=735240
2014-09-07 01:57:10 +02:00
Benjamin Otte
95959ef470 overlay: Handle overlays when no main widget exists
Just pretend that the main widget is an empty widget the size of the
overlay.
Makes it possible to write testcases where no size requests are run on
overlay widgets before size_allocate() is called.

Testcase included.
2014-09-07 01:57:09 +02:00