Commit Graph

441 Commits

Author SHA1 Message Date
Matthias Clasen
64431a17e3 Add a test for required cursors
We use these cursors in GTK+, so check for their existence.
2015-12-05 19:09:17 -05:00
Matthias Clasen
f19cadeaf3 testsuite: Fix notify tests
GtkStatusIcon tests don't work well under xwayland either, so just
skip them unconditionally.
GtkEntry now fails because the update of the im-module is no longer
deferred to an idle, and (gtk-im-simple) is not a valid module
name, so skip this property.
2015-12-04 13:22:26 -05:00
Benjamin Otte
05bdecb2f8 reftests: Add test for missing-image handling
Add a test that ensures that missing images get the icon-effect properly
applied.
2015-12-04 17:44:51 +01:00
Matthias Clasen
cbde3ee01f css: Add a :dnd pseudoclass
This will be used for drag highlighting.
2015-12-02 23:23:36 -05:00
Benjamin Otte
2396265523 css: Rename -gtk-image-effect to -gtk-icon-effect
This is a property for icons, so we should name it as such.
2015-12-02 00:29:31 +01:00
Benjamin Otte
afd0e28437 iconhelper: Improve size determination for surfaces
Instead of just working for image surface, this should now work for all
bounded surfaces.

Test included.
2015-12-02 00:29:29 +01:00
Sébastien Wilmet
1a8f3e2462 textiter: fix bug in case insensitive backward search
'win.lines' contains the same content as the GtkTextBuffer, so to find
@match_start, forward_chars_with_skipping() is called with
skip_decomp=FALSE (the last parameter). So far so good.

On the other hand, the content 'lines' (the needle split in lines) is
casefolded and normalized for a case insensitive search. So,
forward_chars_with_skipping(..., skip_decomp=TRUE) must be called only
for the portion of text containing the needle.

Since 'start_tmp' contains the location at the start of the match, we
can simply begin at that location to find the end of the match.

Unit tests are added.

https://bugzilla.gnome.org/show_bug.cgi?id=758698
2015-11-30 19:46:16 +01:00
Matthias Clasen
8640216be7 Add a test for deprecated css properties 2015-11-23 22:31:20 -05:00
Benjamin Otte
d75989a52b cssstyle: Don't store custom css properties
This makes custom CSS properties no longer configurable. But it avoids
crashes when loading custom themes, so that's a good thing.

Testcase included.

https://bugzilla.redhat.com/show_bug.cgi?id=1281234
2015-11-20 21:22:15 +01:00
Matthias Clasen
9202bc244e Fix make check
For some reason, GtkFileChooserNative is causing the defaultvalue
test to fail. I couldn't track this down quickly, so skip the
type for now.
2015-11-20 00:13:20 -05:00
Matthias Clasen
8f3ffe4d08 Work around g_test_dbus annoyance
Without iterating a mainloop for a bit, g_test_dbus_down() will
give us an error.
2015-11-20 00:13:20 -05:00
Benjamin Otte
0a4e88b79b cssprovider: Have a section on import error
When loading a nonexisting CSS file using
gtk_css_provider_load_from_file() or gtk_css_provider_load_from_path()
we would emit the error using a NULL scanner. Don't do that, because
we'll have a NULL section in that case and error handlers don't like
that.

Testcase attached.

https://bugzilla.redhat.com/show_bug.cgi?id=1277959
2015-11-16 17:39:15 +01:00
Matthias Clasen
fe65c3ac4c Add one more selector to CSS parsing tests
Add an E + F selector to the selector parsing tests.
It is a CSS selector that we support.
2015-11-14 19:04:42 -05:00
Matthias Clasen
2d054fa6ae Always pass the right state in style context getters
Otherwise, we are causing warnings that break make check.
2015-11-14 19:03:57 -05:00
Matthias Clasen
dedab98bbb testsuite: Skip GtkFileChooserNative for notification tests
Like all the other GtkFileChooser implementations, this one
emits some unneeded notifications.
2015-11-14 19:03:10 -05:00
Sébastien Wilmet
1685da6f69 textbuffer: nicer get_iter functions, without return values
Avoid crashes when passing an invalid location to a
gtk_text_buffer_get_iter_at_*() function.

A first attempt added boolean return values to know if @iter has been set to
the exact location, but it breaks Python and JS bindings because the out
parameter is already a return value in those languages.

Unit tests are added.

https://bugzilla.gnome.org/show_bug.cgi?id=735341
2015-11-12 17:50:39 +01:00
Matthias Clasen
fde91c3bec Revert "textbuffer: nicer get_iter functions"
This reverts commit a9a1c00cc9.

Unfortunately, adding the boolean return broke both the python
and javascript bindings, since they now return a tuple consisting
of the boolean and the out argument.
2015-11-12 09:58:28 -05:00
Benjamin Otte
61db7da2ef testsuite: Remove a bunch of broken tests
These tests have either been commented out for way too long or use APIs
that we don't want to support.
2015-11-04 05:06:23 +01:00
Benjamin Otte
a58d8bdcbc cssprovider: Have a section when parsing style properties
Signal handlers expect a section to be present, so provide them with
one.

New testcase included.

https://bugzilla.gnome.org/show_bug.cgi?id=757240
2015-10-28 19:37:27 +01:00
Matthias Clasen
339cb1fe6b Fix reftests
Multiple reftests were damaged by the element name transition.
Repair them. The region reftests are no longer needed, since
we no longer do regions.
2015-10-27 20:06:24 -04:00
Matthias Clasen
5ee39befb8 Fix make check
Don't try setting GtkShortcutsShortcut::accelerator to a
random value, it only accepts strings that it can parse.
2015-10-27 13:27:43 -04:00
Matthias Clasen
e9aa33527f Don't use g_slist_next in the testsuite
We generally use ->next directly.
2015-10-20 06:14:57 -04:00
Matthias Clasen
65aa367029 Add some more builder parser tests
These tests contain non-canonical and non-existing property names.
2015-10-20 06:14:57 -04:00
Sébastien Wilmet
a9a1c00cc9 textbuffer: nicer get_iter functions
Avoid crashes when passing an invalid location to a
gtk_text_buffer_get_iter_at_*() function.

A boolean is returned to know if @iter has been set to the exact
location.

Unit tests are added.

https://bugzilla.gnome.org/show_bug.cgi?id=735341
2015-10-16 08:43:27 +02:00
Matthias Clasen
af8c2d2f7b Improve text a11y test
Test appending text as well as replacing the entire text.
Insert non-ASCII text to verify offsets are correct.
2015-10-15 22:35:38 -04:00
Bastien Nocera
3df565cbf7 reftests: Rename reftest
After figuring out what the actual problem is, name the reftest
properly.
The actual problem is that the use-fallback property is ignored when
using an icon-name on GtkImage.
2015-10-08 14:44:19 +02:00
Bastien Nocera
8bd98c08aa reftests: Add test for GtkImage use-fallback property
Fallback seems to be working in the GtkIconTheme test suite, but fails
in GtkImage itself.

This is a test for a bug in the Bluetooth settings. An icon named
"phone-apple-iphone" should fallback to "phone" if the
gnome-icon-theme-extras package isn't installed.
2015-10-08 14:05:35 +02:00
Matthias Clasen
40190c295c Add a test for gtk_style_context_list_classes
This test failed before the previous commit.
2015-10-03 17:38:36 -04:00
Matthias Clasen
cfcd28041c Fix make check 2015-10-03 00:01:04 -04:00
Christian Hergert
5bb9c1891c build: only compile plug/socket when available
Plug and Socket require X11 windowing. Often times this is compiled
on systems with both wayland and x11, but not always. Quartz is an
example where it is usually not compiled.
2015-09-22 12:46:02 +02:00
Matthias Clasen
e0d72c5376 test-simplify: Explicitly use bash
The script uses bash features, after all.

https://bugzilla.gnome.org/show_bug.cgi?id=755274
2015-09-20 12:18:35 -04:00
Benjamin Otte
c8c666c87c bitmask: Fix broken invert_range() implementation
The speed-up in 7da1f8a1ce was wrong in
certain conditions, even though it didn't trigger the existing
testsuite.

New testcase /bitmask/invert_range_hardcoded included.
2015-09-07 14:32:09 +02:00
Matthias Clasen
42864bc338 Avoid some duplicate test names
GLib considers these an bug now.
2015-09-02 07:15:57 -04:00
Matthias Clasen
3d7d2f245f Work towards succeeding make check under Wayland
Skip tests that don't work under Wayland, such as tests for GtkPlug
and GtkSocket.
2015-08-28 13:08:23 -04:00
Matthias Clasen
cbe5e596af Make display test not fail under Wayland
This test really only works under X, since it relies on modifying
the DISPLAY env var.
2015-08-28 12:26:25 -04:00
Matthias Clasen
dee75bce2d Fix distcheck
Makefile.decl does not work well with scripts that stay
in srcdir, so generate test-simplify from test-simplify.in,
just os that it ends up in builddir.
2015-07-21 00:19:10 -04:00
Benjamin Otte
99d4ec2676 reftests: Fix underlines in link-coloring reftest
Underlines now need to be manually specified in CSS since GTK got
text-decoration support.
2015-07-21 02:28:53 +02:00
Emmanuele Bassi
e259b2f30d Avoid O(n²) walking of string arrays
"Yo, we heard you like traversing NULL-terminated arrays to operate on
them, so we called g_strv_length() as the for condition, so you can
iterate the array while iterating the array."

Instead of making famed rapper and television producer Xzibit proud, we
should avoid calling g_strv_length() on an array while looping on the
array, to avoid quadratic complexity.

We do this in various places that deal with arrays of strings that we
cannot really guess are short enough not to matter — e.g. the list of
CSS selectors in the inspector, or the required authentication
information for printing.
2015-07-16 16:19:55 +01:00
Paolo Borelli
a19331f231 label: add support for CSS letter-spacing property
Support letter-spacing CSS property on GtkLabel.
Reftest is included.
2015-07-06 00:04:05 +02:00
Benjamin Otte
cd3f24d579 cssvalue: Change color transitions to run premultiplied
Previously, the unpremultiplied values from the GdkRGBA were taken. Now
we premultiply the color values as specified by the CSS specs.
This is only relevant when transitioning with translucent colors.

An example is the halfway transition between transparent (0, 0, 0, 0)
and white (1, 1, 1, 1). Previously, all 4 values where transitioned
separately and the result was semi-transparent gray (0.5, 0.5, 0.5,
0.5).
By depending on the alpha value, the result is now semi-transparent
white (1, 1, 1, 0.5) which is what one would naively expect.

New reftest: color-transition
2015-06-26 21:12:50 +02:00
Matthias Clasen
68aa48cc44 Fix up expected results of a11y tests
These changed due to th extra box that GtkAssistant now
inserts for each page.
2015-06-23 17:08:14 -04:00
Cosimo Cecchi
131abe28a4 reftests: fix style class syntax in CSS file
Fixes reftests.

https://bugzilla.gnome.org/show_bug.cgi?id=750605
2015-06-12 08:55:23 -07:00
Cosimo Cecchi
0093b156d7 testsuite: add a test for non-square symbolic icons
To verify the previous fix.

https://bugzilla.gnome.org/show_bug.cgi?id=750605
2015-06-12 08:55:23 -07:00
Benjamin Otte
d921a4fe84 testsuite: Add deprecation guards 2015-05-28 16:53:53 +02:00
Matthias Clasen
43ba6a492e Dist the gtk-builder-tool test script 2015-05-26 14:58:15 -04:00
Cosimo Cecchi
cfbd862aae tests: wait for draw before fetching tree view style
On some slower machines (e.g. an ARM OBS builder), this test is failing
with a race condition where we're trying to fetch the style before it's
applied.

https://bugzilla.gnome.org/show_bug.cgi?id=749593
2015-05-24 12:08:33 -07:00
Matthias Clasen
fb51f447a2 Fix a11y tests
The output of the about dialog test is affected by the keynav
fixes.
2015-05-12 07:44:21 -04:00
Matthias Clasen
dedfcd7d58 Quiet the bitmask test
Don't spew so many 0s and 1s.
2015-05-12 07:40:47 -04:00
Sjoerd Simons
9a7e69a990 notify test: Don't test object relying on dbus connections
Don't test types that rely on a pre-existing dbus session bus.

https://bugzilla.gnome.org/show_bug.cgi?id=749009
2015-05-07 22:37:55 -04:00
Matthias Clasen
fb8294f5e4 gtk-builder-tool: Run the tests installed too 2015-05-02 17:39:06 -04:00