Commit Graph

234 Commits

Author SHA1 Message Date
Timm Bäder
85793fe6b6 testsuite: Update expected css errors 2020-01-18 08:49:52 +01:00
Timm Bäder
7aa17afe7a testsuite: Update css color output 2020-01-18 08:49:51 +01:00
Matthias Clasen
f28cd6cea9 Remove the widget-factory test again
This was failing in ci, in hard to track down ways.
2020-01-18 00:27:52 -05:00
Matthias Clasen
b8b90fefd8 change tests: Update test output
Some of these test cases involve :not, and thus are affected
by our now correct handling of it for change computation.

All of them are affected by the window now being visible.
2020-01-17 23:47:34 -05:00
Matthias Clasen
8ecd4e87e3 Add testcases for css change flags
Add various tests for the change flag computation that
we do in the css selector tree.

test1: Just test the basic machinery of this test
test2: Trigger every change flag at least once
test3: Test that multiple states combine as expected
test4: Test negations (known to produce wrong results)
test5: Test a complex selector (not producing the expected
       output atm)
widget-factory.ui:
       The real thing: widget-factory+Adwaita. Note that
       this expedts to be run with GSETTINGS_BACKEND=memory

Note that test4 checks the wrong results that we currently
produce for selectors involving :not. It will have to be
updated when we fix the handling of :not. The widget-factory.ui
testcase will certainly also be affected.
2020-01-17 23:47:34 -05:00
Matthias Clasen
9de31929d6 Add a test for css change flags 2020-01-17 23:47:34 -05:00
Matthias Clasen
0f694b8beb style tests: Update expected output
The printing of css nodes has changed, and the window
is visible now.
2020-01-17 23:47:34 -05:00
Matthias Clasen
7b1ab8fb8b style tests: Show the window
Not doing so somewhat defeats the point that we want
to verify the regular styles, not some weird initial
conditions.
2020-01-17 23:47:34 -05:00
Matthias Clasen
d9b1a1ebb1 style tests: Clean up --generate support
Reshuffle things so we don't call gtk_test_init() when --generate
is passed, to avoid polluting the output with test spew.
2020-01-17 23:47:34 -05:00
Matthias Clasen
d4f3979896 node tests: Update expected output
The printing of css nodes has changed and the
window is visible now.
2020-01-17 23:47:34 -05:00
Matthias Clasen
2e7cb6019f node tests: Show the window
This avoids using default styles.
2020-01-17 23:47:34 -05:00
Matthias Clasen
f1fce5253e node tests: Clean up --generate support
Reshuffle things so we don't call gtk_test_init() when --generate
is passed, to avoid polluting the output with test spew.
2020-01-17 23:47:34 -05:00
Matthias Clasen
20b92638ec testsuite: Improve --generate support
We don't want annoying spew from GTest when
using --generate, since it interferes with just
piping the output to a text file.
2020-01-14 18:32:05 -05:00
Matthias Clasen
57b7e87d76 testsuite: Update combobox tests
Some of the expected output needs to be updated.
2019-12-29 18:45:40 -05:00
Benjamin Otte
292371932b css: Handle invalid :not() selectors
We weren't correctly ending the ( ) block when encountering an error.

Testcases added.

Fixes #2281
2019-12-03 18:12:25 +01:00
Benjamin Otte
9e4901e8ce testsuite: Fix expected test output
This reverts part of 91497348bf
2019-11-23 19:33:36 +01:00
Benjamin Otte
7523a3f2f2 cssprovider: Don't add empty rulesets
This change was lost during the parser changes, but the newly added test
exposes it.

And fix the expected error, the syntax has changed.
2019-11-23 19:02:36 +01:00
Alexandr Miloslavskiy
fd1630e049 Fix crash in parse_border()
The bug was introduced in commit:
	9b7640b8 by Benjamin Otte, 2012-03-26 17:24:02
	styleproperty: Make _gtk_style_property_parse_value() return a CssValue

In that commit, `values` changed from `GValue*` to `GtkCssValue**`,
but one `!G_IS_VALUE (&values[8])` was left untouched. As a result,
if `border` shorthand contains anything after color, it might crash,
depending on memory layout.

New test included.

Fixes: #751
2019-11-23 18:15:19 +01:00
Benjamin Otte
6d20fe0bf9 expander: Rename CSS nodes
The expander icon is renamed from "arrow" to "expander".
The expander widget itself is renamed from "expander" to
"expander-widget" (Better ideas welcome).

This makes it possible to have an "expander" icon in more places then
the GtkExpander widget (in particular in tree lists) and not
confuse it with arrows.
2019-10-15 07:17:07 +02:00
Timm Bäder
54ed31ebaf notebook: Use a box layout
And incidentally make the CSS node docs correct again.
2019-09-13 19:21:04 +02:00
Timm Bäder
822547dfef spinbutton: Use a box layout 2019-09-09 17:36:23 +02:00
Christoph Reiter
9856218073 Merge branch 'tests-no-box-packing' into 'master'
testsuite: Remove dangling references to box-packing tests

See merge request GNOME/gtk!997
2019-07-18 19:32:19 +00:00
Simon McVittie
5cfe9ab603 testsuite: Remove dangling references to box-packing tests
These were removed in commit c47abb5f, before 3.96.0.

Signed-off-by: Simon McVittie <smcv@debian.org>
2019-07-18 09:26:07 +01:00
Timm Bäder
24a4063645 scrollbar: Use a box layout
Makes a lot more sense than the intermediate box just for its layout.
2019-07-15 07:52:42 +02:00
Matthias Clasen
e31190cf7c Update css node results 2019-06-01 03:47:19 +00:00
Krzesimir Nowak
49d994ddc2 testsuite: Fix leak 2019-05-21 19:23:00 +02:00
Benjamin Otte
04da31f5f5 build: Convert CSS parser tests to single meson tests 2019-05-18 17:06:08 +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
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
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
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
Benjamin Otte
a938c14d11 build: Add gtk-css static library
This library is meant to be the new CSS library that gets used from GDK,
GSK and GTK for string printing and parsing.

As a first step, move GtkCssProviderError into it.

While doing so, split it into GtkCssParserError (for critical problems)
and GtkCssParserWarning (for non-critical problems).
2019-04-12 19:34:28 +02:00
Emmanuele Bassi
c9d8ff21d2 testsuite/css: Change the active RadioButton
The `buttons` test for CSS nodes sets the second RadioButton as the
active one, whereas the first RadioButton is not set as active.
Nevertheless, the reference output says that the first radio button
should match the `:checked` selector, whereas the second radio button
should not.

The fact that the test currently passes is a mystery.
2019-04-05 01:42:37 +01:00
Emmanuele Bassi
824743a395 testsuite/css: Update UI files
Run the UI files through `gtk-builder-tool simplify --3to4` to update
the layout properties.
2019-04-05 01:01:40 +01:00
Matthias Clasen
396deb44fa Convert ui files
Run gtk4-builder-tool simplify --3to4 over all ui files.
2019-03-27 21:48:12 -04:00
Benjamin Otte
799cb39e08 Remove win32 themeing support
It was unused through all of GTK 3, so it is not worth supporting.

The best Windows themes do not make use of it at all.
2019-03-22 22:30:01 +01:00
Matthias Clasen
837d9bf39e Remove css test for key bindings 2019-02-21 12:29:46 -05:00
Matthias Clasen
7d69430ebd css tests: Update ui files for notebooks 2019-02-21 00:31:17 -05:00
Matthias Clasen
572142b950 css tests: Update expected output for entries
Flat is gone.
2019-02-21 00:30:48 -05:00
Matthias Clasen
613f8ceacf testsuite: update css node tests
The entries have changed. Reflect that.
2019-02-19 00:25:59 -05:00