Commit Graph

1230 Commits

Author SHA1 Message Date
Matthias Clasen
2eb0333017 Add a testcase
This tests the fix in 1e7225aa1c.
2019-05-30 14:12:07 -04:00
Benjamin Otte
53f23f8ae9 rendernodeparser: Handle empty Cairo nodes
Cairo nodes can contain a NULL surface if they have never been drawn to.
Make this the default Cairo node.
2019-05-30 15:32:36 +02:00
Benjamin Otte
1e0c0c0ba7 rendernodeparser: Parse cairo script
Use cairo-script-interpreter to parse the scripts that generate cairo
nodes.

This requires libcairoscriptinterpreter.so to work properly, but if
it isn't found we disable this (unimportant for normal functioning)
code and just emits a parser warning.
The testsuite requires it however or it will fail.

A new test is included that tests all of this.
2019-05-30 15:32:36 +02:00
Matthias Clasen
7f65e5f96b Rename GtkGestureMultiPress to GtkGestureClick
The name just made it hard for people to find the
right gesture to use.
2019-05-29 17:10:46 +00:00
Matthias Clasen
9abc7262b0 treeview column: Make final 2019-05-28 23:22:57 -04:00
Matthias Clasen
f0fd4843d5 iconview: Make final 2019-05-28 22:50:08 +00:00
Matthias Clasen
302d2a04ae Stop using gtk_widget_get_surface
Replace all uses of gtk_widget_get_surface by
gtk_native_get_surface.
2019-05-28 20:25:16 +00:00
Matthias Clasen
c3d7c947ad Add a test for the property renaming 2019-05-28 20:25:16 +00:00
Matthias Clasen
6e885abf66 testsuite: Fix some a11y output
This was affected by a recent fix to GtkAboutDialog.
2019-05-28 20:25:15 +00:00
Matthias Clasen
ebee21b248 testsuite: Fix popover-related failures 2019-05-28 20:25:15 +00:00
Matthias Clasen
07c8fd9997 Add a testcase for size allocation
This triggers a critical warning in gtk_widget_snapshot.
2019-05-28 20:25:15 +00:00
Matthias Clasen
d2951d3aac Rename surface constructors
We want to use a gdk_surface_new_popup for popups,
and align the constructor names with the surface
types, so rename

gdk_surface_new_popup -> gdk_surface_new_temp
gdk_surface_new_popup_full -> gdk_surface_new_popup

The temp surface type will disappear eventually.
2019-05-28 20:25:14 +00:00
Matthias Clasen
2ef8bd0b95 entry completion: Make final 2019-05-27 20:23:50 -04:00
Matthias Clasen
280bbfe522 Drop cellarea subclassing tests 2019-05-26 22:14:20 -04:00
Benjamin Otte
928c85ccc3 rendernodeparser: Parse Cairo nodes
We also print the script, but we don't parse it yet.
2019-05-26 00:50:13 +02:00
Krzesimir Nowak
49d994ddc2 testsuite: Fix leak 2019-05-21 19:23:00 +02:00
Benjamin Otte
63a8144e1a testsuite: Remove serialize-deserialize test
The serialize-deserialize test is completely handled via the new
nodeparser tests.

So move those tests over and delete the old test binary.
2019-05-21 06:43:59 +02:00
Benjamin Otte
0a32305f01 testsuite: Add render tests for all the empty nodes
Test that rendering empty nodes succees. For a lot of nodes the
resulting rendering isn't clearly defined, in those cases we overdraw
those regions (sometimes the whole image) with black.
2019-05-21 06:43:59 +02:00
Benjamin Otte
eb386134e3 testuite: Improve compare-render binary
- Remove remains of g_test_*() functions
  We're not a glib test, we're a simple binary.
- Handle nonexistence of reference image properly
  Don't assert, but create the output image and the error out.
2019-05-21 06:43:59 +02:00
Benjamin Otte
b37c2216fc testsuite: Add empty node tests
For every node type, add a test that creates it empty and ensure that
it prints the reference output.
2019-05-21 06:43:59 +02:00
Benjamin Otte
b90a66cab5 rendernodeparser: Allow parsing strings
Instead of only allowing for glyph indexes, allow ASCII characters as
replacements. So this glyph sequence
  glyphs: 65 8, 66 8, 67 8
Can be replaced by
  glyphs: "ABC"
provided that the glyph for "A", "B" and "C" are 65, 66 and 67
respectively and their advance is exactly 8.
x offset and y offset must always be 0 and every glyph must start a
cluster.
2019-05-21 06:43:59 +02:00
Benjamin Otte
1a65a6ce76 rendernodeparser: Update to new rules
Update to the docs outlined in #1887.

In particular, the changes do:

1. Require no property, have a working default for everything
2. Be clear about what gets printed and how.

Tests ahve been adapted to still pass.
2019-05-21 06:43:59 +02:00
Benjamin Otte
a1d08b4b52 rendernode: Take a graphene_point_t for the offset
... instead of 2 floats.
2019-05-21 06:43:59 +02:00
Benjamin Otte
0fd0be4f9a testsuite: Redo node-parser
Base the rewrite on testsuite/css/parser/test-css-parser - we now
require the node file to match a reference node and track the errors it
triggers.
We also no longer use gtester.
2019-05-21 06:43:59 +02:00
Benjamin Otte
ed0ecf0ff0 rendernodeparser: Allow single values instead of 4
This allows writing:
  colors: red;
instead of
  colors: red red red red;
to draw a red border.
2019-05-21 06:43:59 +02:00
Benjamin Otte
c8fc40e793 rendernodeparser: Print properties alphabetically
Because now we have a rule.

Also update some tests to the new order.
2019-05-21 06:43:59 +02:00
Benjamin Otte
6e2df85ec8 Merge branch 'wip/otte/for-master' into 'master'
Wip/otte/for master

Closes #1900

See merge request GNOME/gtk!854
2019-05-18 15:19:29 +00:00
Benjamin Otte
04da31f5f5 build: Convert CSS parser tests to single meson tests 2019-05-18 17:06:08 +02:00
Matthias Clasen
9d16715eb3 Merge branch 'menubutton-no-button' into 'master'
Menubutton: don't derive from GtkButton

See merge request GNOME/gtk!853
2019-05-18 13:13:48 +00:00
Matthias Clasen
83d9e7a1c3 Adapt tests
We no longer have a clicked signal on GtkMenuButton.
2019-05-18 13:06:33 +00:00
Timm Bäder
2979aea3ae testsuite: Add a color matrix test case
Color matrix nodes with an identity matrix and no offset should still
produce the expected image.
2019-05-18 13:47:59 +02:00
Carlos Garnacho
c2d92794e2 gdk/x11: Drop GdkDeviceManagerCore
Keep only the XInput2 device manager, which handles "modern" stuff
like scroll and touch.
2019-05-15 01:05:29 +02:00
Benjamin Otte
6f6b07aaae testsuite: Stop using g_test_bug()
The calls used old bugzilla URLs and nobody cared about that.
So apparently they are very unused.

There's also a potential conflict between gitlab and bugzilla URLs and
what base bug to use there.

The old usages have been converted to comments.
2019-05-12 17:28:18 +02:00
Benjamin Otte
63578d832a testsuite: Don't die on the first error
Continue running the test, just mark it as a failure.
2019-05-12 17:27:01 +02:00
Benjamin Otte
3a373b9b33 rendernodeparser: Parse images differently
Instead of encoding the raw data, encode the full image to a PNG.
And instead of stuffing that encoding into a string, use a full
data: url.
And then remove the width and height properties, because they're now
implicitly included in the data.
And then change the parser to match.
And because the parser now parses regular urls on top of data: urls, we
can now load any random file.
2019-05-12 17:27:01 +02:00
Benjamin Otte
8be95ca348 css: Add data URL parsing to images 2019-05-12 17:27:01 +02:00
Benjamin Otte
5da58ba47d css: Add gtk_css_data_url_parse()
This surprisingly decodes data URLs.
2019-05-12 17:27:01 +02:00
Benjamin Otte
b651a355ab build: Fix
I did somethig wrong there. Whoops
2019-05-08 01:15:17 +02:00
Benjamin Otte
dd299c50bf csstokenizer: Add more testcases 2019-05-08 00:58:52 +02:00
Benjamin Otte
bc7972dfa7 csstokenizer: Handle backslash at end of document
Testcases included.
2019-05-08 00:58:52 +02:00
Timm Bäder
730b52b084 testsuite: Add blur node testcase
Renderers need to handle blur radius 0 as well. Currently broken in GL
and (I guess, unless it's my driver) Vulkan.
2019-05-07 17:21:16 +02:00
Matthias Clasen
a0c6d88858 Mark a failing reftest as xfail
I don't know why we expect different window types
to render identically in the first place.
2019-05-07 03:27:04 +00:00
Matthias Clasen
68560a941a Update a11y tests 2019-05-07 02:21:30 +00:00
Timm Bäder
c8865459fc testsuite: Add blend-difference test case
Comparing blend nodes with mode: difference
2019-05-06 17:34:48 +02:00
Timm Bäder
8559593a18 testsuite: Add a blend node test case
This is currently broken in the GL renderer.
2019-05-06 17:34:48 +02:00
Benjamin Otte
562e492056 csstokenizer: Consume the \ when encountering an error
Otherwise we infinitely end up with the error again.

Testcases added.
2019-05-06 05:56:06 +02:00
Matthias Clasen
d61e77dab4 Add some tests
These test various aspects of ui file conversion.
2019-05-05 17:13:38 +00:00
Matthias Clasen
82eee65334 testsuite: Add tests for ui file rewriting
Add a test script that runs
gtk4-builder-tool simplify --3to4.
No actual tests yet.
2019-05-05 17:13:13 +00:00
Matthias Clasen
4f6cc46278 Fix the simplify test
The script was returning the wrong number of tests.
2019-05-05 15:21:58 +00:00
Benjamin Otte
43a5ff8e01 testsuite: Add serialize test for debug node 2019-05-05 07:18:39 +02:00
Benjamin Otte
da5b99f807 testsuite: Add rounded-rect parsing test 2019-05-05 07:18:39 +02:00
Benjamin Otte
b4f5baf4fa rendernode: Parse and print blend nodes properly 2019-05-05 07:18:39 +02:00
Timm Bäder
8c04129b94 testsuite: Add nodeparser test case
A serialized frame from the widget factory!
2019-05-05 07:18:39 +02:00
Timm Bäder
dde69802cd Add error func to node deserialization 2019-05-05 07:18:39 +02:00
Benjamin Otte
5530331b35 testsuite: Black out parts of reftest 2019-05-05 07:18:39 +02:00
Timm Bäder
a55ebf2350 testsuite: Remove old cairo/vulkan tests
They are still in the old binary format and haven't worked for a while.
2019-05-05 07:18:39 +02:00
Timm Bäder
58666c6210 testsuite: Add another gl renderer test 2019-05-05 07:18:39 +02:00
Benjamin Otte
3a9fa035ee testsuite: Remove gl_tests infrastructure
They're now completely migrated to the new compare infrastructure, that
also tests Vulkan and Cairo.
2019-05-05 07:18:39 +02:00
Timm Bäder
1000d971f9 testsuite: Add cross-fade-in-opacity test
Making sure that an opacity node doesn't end up reviving a node that's
hidden because the cross-fade has progress 0 or 1.
2019-05-05 07:18:39 +02:00
Timm Bäder
349e6af2c8 testsuite: Remove broken GL comparison tests
These only work on special hardware, which not even I have anymore.
We'll need to redo them in a way that works on different systems.
2019-05-05 07:18:39 +02:00
Timm Bäder
44b3b8937a testsuite: Print serialized nodes when parsing fails 2019-05-05 07:18:39 +02:00
Timm Bäder
9598e16753 testsuite: add shadow node parser test 2019-05-05 07:18:39 +02:00
Timm Bäder
61a963d78d testsuite: add another nodeparser crash test 2019-05-05 07:18:39 +02:00
Timm Bäder
e31856fe1b testsuite: Add serialize-deserialize tests
Check that we can successfully deserialize a node, then serialize it
again and deserialize that result once more.
2019-05-05 07:18:39 +02:00
Benjamin Otte
1d6134f87d testsuite: Add a broken test
This also adds some build magic so all tests that contain "-3d" in them
won't be added to the Cairo renderer.

Of course, this new test is such a test.
2019-05-05 07:18:39 +02:00
Benjamin Otte
08e9725797 Move working tests to new directory
These are tests that are working on both GL and Cairo now.

Some tests got black boxes over the areas that aren't easy to compare.
2019-05-05 07:18:39 +02:00
Timm Bäder
4d98e96124 testsuite: Port gl tests to text-based format 2019-05-05 07:18:39 +02:00
Benjamin Otte
50e10cd771 testsuite: Delete some node tests
These are the tests that aren't going to be made to work, so let's just
delete them.
2019-05-05 07:18:39 +02:00
Benjamin Otte
b6838cb9f4 testsuite: Add tests for the new node parsing code
This adds a test tool gsk/node-parser that takes node files and parses
them.

A few of these node files have been added, for crashes I encountered while
developing the new parsing code.
2019-05-05 07:18:39 +02:00
Matthias Clasen
6f25168db3 Make the newly added test a bit more robust
Follow the style of the other tests and provide
style for both the test and ref.
2019-05-03 02:15:07 +00:00
Matthias Clasen
7037ff8f3d Add a reftest for multiple font families
This tests that listing multiple font
families in the css font-family property
works as expected.
2019-05-03 01:44:29 +00:00
Matthias Clasen
30942c4e3d Fix builder parser tests
The line numbers changed here because we
removed some properties.
2019-04-28 23:44:07 +00:00
Matthias Clasen
bf7d1e7b5a tests: Fix a default-related test
The test was setting has-default, but testing
receives-default.
2019-04-28 23:40:57 +00:00
Matthias Clasen
92e21c3f1c Drop the can-default property
It was added at a time when default buttons
had a very large external border that would disrupt
aligment. Not a problem nowadays.
2019-04-28 23:28:39 +00:00
Benjamin Otte
7420f9c34a testsuite: Rewrite text diff to use GSubprocess
... instead of g_spawn(). Avoids having to create a temp file, too.
2019-04-27 06:20:30 +02:00
Benjamin Otte
2a7e4ae7f6 testsuite: Don't pretend we're a GTest
This is a meson test, not a GTest thing. So:

- Use g_print(), not g_test_message
That makes meson test --verbose print the actual log messsages.

- Don't g_assert() all the time
Instead, run tests through to the end and just return a non-0 exit
status.
2019-04-23 17:09:14 +02:00
Matthias Clasen
51b2759eb1 surface: Drop group api
This was only ever implemented on X11, and
GTK is not using it at all. Relegate it to
x11-specific api.
2019-04-20 02:28:46 +00:00
Benjamin Otte
70fb29e81a reftests: Add a reftest for rendering failure
c18d2872f2 introduced a misrendering in
the Cairo fallback rendering code while fixing another one.

This test exposes that problem.

Related: !756
2019-04-19 03:39:57 +02:00
Benjamin Otte
5cd8e0f7f1 testsuite: Add theme-validate test
The test just loads all of GTK's themes and makes sure they cause no
errors or warnings from the CSS parser.
2019-04-18 02:28:42 +02:00
Benjamin Otte
84351ba9e5 reftests: Be more graceful about errors
The nice thing about that is that we can then log messages about the
errors to the log.

And then we can read the logs of the CI machinery and actually know
what's going on.
2019-04-13 01:48:28 +02:00
Benjamin Otte
e0730bc118 testsuite: Fix label-shadows test
Use a GtkFixed to position and rotate the labels. This is necessary
because the GtkLabel::angle property was removed.
2019-04-13 01:31:49 +02:00
Benjamin Otte
07e0411b98 reftests: Fix textview-margins test
The text is wider now that we changed the font properties, so account
for that.
2019-04-13 00:11:24 +02:00
Benjamin Otte
254feda16b Revert "reftests: Fix textview-margins test"
This reverts commit c6471ee874.

Doesn't work on CI.
2019-04-12 22:38:11 +02:00
Benjamin Otte
c6471ee874 reftests: Fix textview-margins test
The text is wider now that we changed the font properties, so account
for that.
2019-04-12 22:15:00 +02:00
Emmanuele Bassi
f58f0732c2 ci: Cache the reftest artifacts
Keeping the reftest output images as artifacts of a job allows us to
browse them and download them straight from GitLab.
2019-04-12 20:58:29 +01:00
Emmanuele Bassi
c5a4a26f06 Merge branch 'ci-update' into 'master'
ci: Install Monospace fonts

See merge request GNOME/gtk!742
2019-04-12 19:30:31 +00:00
Emmanuele Bassi
3046358d38 ci: Update list of xfail tests
The label tests do not fail any more, because the CI image has Monospace
fonts; the textview-margins test started to fail on the CI image,
though.
2019-04-12 20:21:29 +01:00
James Westman
c20360dd98 reftests: Use shared_library, not shared_module
This allows Meson to run on macOS, where shared modules cannot be linked
against.
2019-04-12 14:04:01 -05:00
Benjamin Otte
198207f1ff reftests: Mark the currently unfixed failures as XFAIL
They should be fixeed before 4.0 but the fixes are more involved. And we
want to start running the existing tests on CI, because they break
regularly and we want to catch that.
2019-04-12 19:34:29 +02:00
Benjamin Otte
6120f11ed3 reftests: Fix GtkFixed layout properties
GtkFixed was still using "x" and "y", when it should have been using
"position".
2019-04-12 19:34:29 +02:00
Benjamin Otte
0a440a804f reftests: Fix CSS for various tests
* :nth-child(first) => :first-child
* :nth-child(last) => :last-child
* Add semicolons at end of declarations
* Remove spaces between color functions (shade, alpha, ...) and args
2019-04-12 19:34:29 +02:00
Benjamin Otte
023b695422 testsuite: Fix stylecontext test
Update the test to the stricter interpretation of the CSS specification
and the removal of custom additions.
2019-04-12 19:34:29 +02:00
Benjamin Otte
ec6ce0707a testsuite: Update references for style test
We have more accurate section printouts now and they are used here.
2019-04-12 19:34:29 +02:00
Benjamin Otte
f37573f8dc testsuite: Check errors not just for line, but for full range
Instead of just checking that the line of the error message is correct,
assert that start and end position are on the correct character offset.

Also fix all the tests to conform to this.
2019-04-12 19:34:29 +02:00
Benjamin Otte
49f8b571b9 testsuite: Update integer test
Make the test use an actual integer property that accepts negative
numbers (opacity) instead of one that wants units (margin-top) or
can't deal with negative numbers (everything else).
2019-04-12 19:34:29 +02:00
Benjamin Otte
a8f712b09a cssection: Return locations, not numbers
Now that we have GtkCssLocation, actually use it.
2019-04-12 19:34:28 +02:00
Benjamin Otte
acaec5f186 testsuite: Update parser tests to new errors
Some errors are now properly detected as unknown values when previously
they were just treated as syntax errors.
2019-04-12 19:34:28 +02:00
Benjamin Otte
c8589a9a2f testsuite: Handle warnings in CSS tests 2019-04-12 19:34:28 +02:00
Benjamin Otte
a31e5f7a8c cssshadow: Use gtk_css_parser_consume_any()
This way, the arguments can now really be speicified in any order.

A new testcase testing all the ordering possibilities has been added.
2019-04-12 19:34:28 +02:00
Benjamin Otte
93b643c44d css: Make font-weight an integer
This conforms to what Pango does and to the CSS4 spec. And it makes the
parsing code easier. So let's go for it.
2019-04-12 19:34:28 +02:00