Commit Graph

442 Commits

Author SHA1 Message Date
Matthias Clasen
fb8294f5e4 gtk-builder-tool: Run the tests installed too 2015-05-02 17:39:06 -04:00
Matthias Clasen
d22f351e28 gtk-builder-tool: Add some tests 2015-05-02 17:39:06 -04:00
Matthias Clasen
f06cd304bd Adjust tests 2015-04-30 06:19:10 -04:00
Matthias Clasen
5271106250 Test the new error conditions 2015-04-29 15:20:51 -04:00
Matthias Clasen
90352f1979 GtkInfoBar: Add a test for 'invalid ID' 2015-04-27 23:09:35 -04:00
Matthias Clasen
cd19f3bf0b GtkDialog: Add a test for 'invalid ID' 2015-04-27 23:09:35 -04:00
Matthias Clasen
86ca248c99 GtkContainer: Add a test for 'invalid ID'
...and add all the container tests to Makefile.am
2015-04-27 23:09:30 -04:00
Matthias Clasen
7969204e7a Adjust affected tests 2015-04-27 19:21:45 -04:00
Matthias Clasen
a84c15fef0 Fix the build
There was one too many dialog test cases in the Makefile.

https://bugzilla.gnome.org/show_bug.cgi?id=748509
2015-04-27 06:15:28 -04:00
Matthias Clasen
3c23a2e32b Adjust builder tests
Some errors are now returned as markup errors instead of builder
errors. Adjust the tests for this.
2015-04-27 01:15:25 -04:00
Matthias Clasen
d955c6e7e5 Adjust existing tests 2015-04-27 01:15:24 -04:00
Matthias Clasen
8ae4a82ae4 Add tests for the infobar builder parser 2015-04-27 01:15:23 -04:00
Matthias Clasen
cff5e0d15b Add tests for the GtkFileFilter builder parser 2015-04-27 01:15:23 -04:00
Matthias Clasen
95ea81d6d1 Add tests for the GtkDialog builder parser 2015-04-27 01:15:23 -04:00
Matthias Clasen
f11fedb719 Add tests for GtkLevelBar builder parser 2015-04-27 01:15:23 -04:00
Matthias Clasen
66ce0b6509 Add tests for GtkContainer builder parser 2015-04-27 01:15:22 -04:00
Matthias Clasen
e973d49a11 Add tests for the GtkScale builder parser
These tests check various error conditions in GtkScale
custom tags.
2015-04-27 01:15:22 -04:00
Matthias Clasen
d416f352ad Add tests for the GtkCellLayout builder parser
These tests check various error conditions in GtkCellLayout
custom tags.
2015-04-27 01:15:22 -04:00
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
Matthias Clasen
10703a0275 notification tests: Skip GtkEntryCompletion::text-column
This one is special.
2014-09-03 22:46:38 -04:00
Matthias Clasen
6fbb1c782b Add a testcase for counting selection in treeviews
https://bugzilla.gnome.org/show_bug.cgi?id=702957
2014-08-30 01:46:58 -04:00
Matthias Clasen
c71d1b9664 treeview tests: Clean up after each test
It is not good form to leak in testcases.
2014-08-30 01:46:26 -04:00
Matthias Clasen
00866d1c0a treeview tests: Add bug references 2014-08-30 01:34:10 -04:00
Matthias Clasen
e014b89310 Move gtkthemingengine to deprecated directory
This is the place for wholly-deprecated sources.
2014-08-29 16:35:37 -04:00
Emmanuele Bassi
5ad60caa3c css: Implement font-stretch
The font-stretch CSS property is defined in the Level 3 CSS Fonts
module, available at:

  http://dev.w3.org/csswg/css-fonts/#propdef-font-stretch

It allows defining a normal, condensed, or expanded face to the font
description. Pango already supports it, so this is literally just the
CSS parser machinery needed to bridge our CSS to the FontDescription
API.

https://bugzilla.gnome.org/show_bug.cgi?id=735593
2014-08-28 13:41:40 +01:00
Benjamin Otte
21d3701291 reftests: Fix Makefile
with non-installed tests the build would get an empty $(reftestdir)
which would screw up the LDFLAGS.

An rpath seems to be required to make libtool build a shared object.
Without an rpath line, it only builds a static object.

https://bugzilla.gnome.org/show_bug.cgi?id=735401
2014-08-27 18:02:52 +02:00
Benjamin Otte
0f0fc59fbd build: make reftests work without installed tests
The libreftest.so module needs to be built in all cases.
Without installed tests, it needs to not be installed though.

https://bugzilla.gnome.org/show_bug.cgi?id=735401
2014-08-26 20:05:49 -04:00
Matthias Clasen
bcb9eabf11 Add tests for parsing int64/uin64 in GtkBuilder
This tests the fix in the previous commit.
2014-08-21 14:22:13 -04:00
Sébastien Wilmet
706c8e9c8d Simplify _gtk_text_buffer_get_line_log_attrs()
NULL was returned in case of an empty last line. Every users needed to
special-case this. Now it will return the expected result: char_len of 0
with one PangoLogAttr.

In compute_log_attrs(), 'paragraph' will be the empty string "" with
'char_len' == 0.
pango_get_log_attrs() works fine with an empty string, it will return
one correct PangoLogAttr (because there is one text position for the
empty string).

It fixes the unit tests for gtk_text_iter_is_cursor_position().

https://bugzilla.gnome.org/show_bug.cgi?id=156164
2014-08-21 18:43:34 +02:00
Sébastien Wilmet
83bc0c4bb1 textbuffer: unit tests for the empty last line
For functions using _gtk_text_buffer_get_line_log_attrs():
- gtk_text_buffer_backspace()
- some gtk_text_iter functions (word/sentence/cursor boundaries)

As the FIXME comments show, there is a bug with
gtk_text_iter_is_cursor_position() for an empty last line.

https://bugzilla.gnome.org/show_bug.cgi?id=156164
2014-08-21 18:43:34 +02:00
Benjamin Otte
2737c67cce css: Round shadow extents properly
Otherwise drawing will be clipped.

Testcase included
2014-08-21 00:54:07 +02:00
Benjamin Otte
67456304d4 roundedbox: Only grow border-radius if there is one
This is relevant for shadow spread and goes in line with the web.

Testcase included.
2014-08-21 00:54:07 +02:00
Benjamin Otte
1126a34353 label: Respect box-shadow when computing clip
Testclase included.

Also reorder headers to be alphabetic.
2014-08-21 00:54:07 +02:00
Sébastien Wilmet
7bc819e88d tests textbuffer: don't use GdkColor (deprecated) 2014-08-20 17:19:30 +02:00
Benjamin Otte
b1ac4f91d3 reftests: Update for :active => :checked change 2014-08-16 20:41:32 +02:00
Matthias Clasen
aefe86d632 Update expected output for the font picker a11y test
This change is a consequence of the recent font chooser changes.
2014-08-16 13:02:47 -04:00
Matthias Clasen
d3dc05174e Update expected output in a11y tests for buttons
This is an expected change from the recent button state cleanups.
2014-08-16 13:01:50 -04:00
Benjamin Otte
36a2e7ca8e css: Add a :checked pseudoclass
https://bugzilla.gnome.org/show_bug.cgi?id=733967
2014-08-16 16:34:14 +02:00
Matthias Clasen
269d277afe Adapt to spinbutton changes 2014-08-14 19:39:07 -04:00
Benjamin Otte
9d2c3f5e68 reftests: Add reftest for statusbar fix
https://bugzilla.gnome.org/show_bug.cgi?id=724281
2014-08-14 19:52:59 +02:00
Benjamin Otte
2120ccfd5e reftests: Make gcc happy 2014-08-14 19:52:59 +02:00
Matthias Clasen
ec2bc3face Add some spinbutton tests
These tests check some of the changes from the previous commits.
2014-08-14 00:04:10 -04:00
Руслан Ижбулатов
694c8d32d5 Fix various warnings about unused things
https://bugzilla.gnome.org/show_bug.cgi?id=734735
2014-08-13 23:38:47 +00:00
Benjamin Otte
dff52f7a04 css: Match state in siblings properly
Previously, we always returned the state flags of the original widget
and did not consider the siblings' pseudoclasses.

Testcase is attached.
2014-08-13 16:51:16 +02:00
Alexander Larsson
f3b56261cb Fix symbolic-icon-translucent-color reftest
When using the pre-rendered png symbolics it seems that we're off a
tiny bit in a few of the pixels on the antialiased borders of a
stroke. To fix this we switch the icon to media-playback-stop-symbolic
which has no such antialiased borders.

I don't quite understand why the pixels are off, this needs more
research.

https://bugzilla.gnome.org/show_bug.cgi?id=734668
2014-08-12 15:51:36 +02:00
Matthias Clasen
80a8257302 Fix reftests for builddir != srcdir
Make gtk-reftest consult the REFTEST_MODULE_DIR environment
variable to find out where to look for modules, and fix the
libtool hack to construct the .libs subdirectory correctly.
2014-08-10 19:11:39 -04:00
Matthias Clasen
1185b9b29c Fix animation-direction reftest
This was another victim of clipping changes - the labels were
overdrawing each other, leading to test failure. Prevent this
by separating the grid columns.
2014-08-10 19:11:38 -04:00
Matthias Clasen
2d15c25d93 reftests: Make textview-margins pass in make check
I found that setting margins to zero makes the textview clip
away some overshooting pixels. So, instead of a 0/10 split,
do this test with a 2/8 split of margins, to avoid the clipping
issue.
2014-08-10 07:41:53 -04:00
Matthias Clasen
0b669dffa9 Skip focus tests in make check
These require a window manager to work, and we currently don't
run one when we run make check tests under Xvfb.
2014-08-10 07:08:39 -04:00
Matthias Clasen
b7365c52c4 Make focus tests session-exclusive
Otherwise, tests running in parallel will steal the focus that
we are trying to test.
2014-08-08 22:15:02 +02:00
Matthias Clasen
944e30d940 Add a11y state tests
This adds a new test which can be scripted to trigger various
event and action sequences, and record state changes in the
accessibility layer.

So far, there are a few tests verifying state changes when
focus changes.

Related to https://bugzilla.gnome.org/show_bug.cgi?id=715176
2014-08-04 09:58:58 +02:00