Commit Graph

1603 Commits

Author SHA1 Message Date
Benjamin Otte
224d65032e tests: Add CSS test checking that we don't need a semicolon 2011-05-18 21:58:43 +02:00
Benjamin Otte
8fd6bd323c tests: Add two simple css tests 2011-05-18 21:58:43 +02:00
Benjamin Otte
64fd32cdef tests: Add a test for the CSS parser
Tests in the parser need 1 or 2 files:
1) test.css
2) test.ref.css (optional, defaults to test.css)

The test instantiates a CSS provider, loads test.css, then dumps the
loaded file to test.out.css and then checks that that file matches
test.ref.css. If not, it dumps a diff between those two to the log and
fails.

You want to run the test with --verbose to get the output dumped to
stdout.
2011-05-18 21:58:43 +02:00
Benjamin Otte
c2f23ccd23 reftests: Add a shell script to create tests
See the documentation in the script.
Tests are not yet added as the output from the 2 included scripts
doesn't match and the intended reference output first needs to be agreed
on.
2011-05-13 02:46:15 +02:00
Benjamin Otte
d20aa1f8dc reftests: Add a test for the label fix 2011-05-12 23:40:26 +02:00
Matthias Clasen
7b6e3be4a7 Another grid spacing reftest
This one checks that empty rows/columns don't affect layout.
2011-05-11 19:52:33 -04:00
Matthias Clasen
87e46bfaa9 Add some reftests comparing aspects of grid and box spacing 2011-05-11 13:48:00 -04:00
Benjamin Otte
d01d90fccd reftests: Add test for undersized children of GtkPaned
Tests the recent fixes done in 206b9f940d
and 6bda6f0c58
2011-05-10 01:39:14 +02:00
Benjamin Otte
b6c8671fde reftests: Add CSS file for alignment test
We need to force arrow scaling to 1.0 to get the alignment right.
2011-05-09 13:25:36 +02:00
Matthias Clasen
432e89685f Fix up the misc-alignment test
The new-style ui file had some left-over GtkMisc properties
in it.
2011-05-08 21:28:36 -04:00
Benjamin Otte
42450cacd9 reftests: Modify test to ensure identical output
GtkArrow and the align properties use different methods (float vs int)
to center the arrow. If the size of the arrow is odd, this will cause a
rendering that differs by half a pixel. So we request an even size for
both the arrow and the container and everything works out.
2011-05-09 01:36:00 +02:00
Benjamin Otte
3c2105c9cd reftests: Add misc-alignment test to Makefile 2011-05-09 01:12:29 +02:00
Benjamin Otte
50c36f38ff reftests: Actually add toplevel vs popup testcase
Adds missing files from 79d1b11d0b and
reverts eba4ca3e66.
2011-05-09 01:10:13 +02:00
Matthias Clasen
eba4ca3e66 Drop missing tests 2011-05-07 00:03:13 -04:00
Matthias Clasen
1d647df176 Add a lock button widget
This is a special-purpose button that can be used together with
GPermission objects to control the sensitivity of system settings.

Suitable permission objects can e.g. be obtained from PolicyKit.

http://bugzilla.gnome.org/show_bug.cgi?id=626457
2011-05-06 22:44:38 -04:00
Tristan Van Berkom
9fd1feb2a8 Adding more traditional checkered background to testtextview. 2011-05-06 17:05:35 -04:00
Tristan Van Berkom
cefb950110 Added internal GdkRGBA support for GtkTextTag::paragraph-background-rgba
Added the remaining implementation bits for rendering paragraph backgrounds
with rgba values and updated the test case.
2011-05-06 17:05:34 -04:00
Tristan Van Berkom
d399a4acab Added GdkRGBA properties to GtkTextTag.
This now allows text view to render text with alpha values in
the text foreground and backgrounds, the work is almost complete,
currently the error-underline-color is still a GdkColor style property
and since we use only GdkRGBA for rendering it needs to be converted
and applied, probably a new rgba version of the style property should
also be introduced.

This commit adds tests/testtextview that must be run from the tests/
directory to show translucent text in action.
2011-05-06 17:05:10 -04:00
Cosimo Cecchi
297e739395 testassistant: don't use deprecated functions 2011-05-06 16:08:42 -04:00
Matthias Clasen
e8413cc28e testassistant: some more tests 2011-05-06 14:56:36 -04:00
Matthias Clasen
6c1133c885 Add an alignment property test
This test compares GtkAlignment properties and GtkWidget margin and
alignment properties.
2011-05-05 22:21:59 -04:00
Matthias Clasen
9966acbdaa Expand GtkMisc tests to cover arrows and images
This unveils something fishy with arrows.
2011-05-05 21:47:14 -04:00
Matthias Clasen
587e534b7e Add a misc-alignment reftest
This test compares GtkMisc properties and GtkWidget margin and
alignment properties.
2011-05-05 17:53:12 -04:00
Matthias Clasen
ebc325d38c More box<>grid comparison tests
Add a more complicated case with multiple expanding children.
Also, make the window a popup.
2011-05-05 17:13:28 -04:00
Benjamin Otte
dced75dcc4 reftests: Add missing css file for grid-expand test 2011-05-05 19:34:31 +02:00
Benjamin Otte
ac06529f61 reftests: Add testcase for label justify fix 2011-05-05 17:33:44 +02:00
Benjamin Otte
278260a3ae reftests: Fix filename in makefile 2011-05-05 17:33:44 +02:00
Benjamin Otte
79d1b11d0b reftests: Add a test that ensures toplevels and popups render identical 2011-05-05 17:33:44 +02:00
Benjamin Otte
66f0544238 reftests: Ensure we got a draw event before quitting the main loop 2011-05-05 17:33:04 +02:00
Benjamin Otte
3f4f900242 reftests: Add a hack to make toplevels work in various WMs
If we have a toplevel, and not a popup window, do wait an additional
0.5s to give the WM/server enough time to actually create the window.

This is a hack and there should be a better solution. But it works.

Please use POPUP windows for tests unless the test must use toplevel
windows.
2011-05-05 17:33:04 +02:00
Benjamin Otte
5c026f32e9 reftests: Plug a leak 2011-05-05 17:33:04 +02:00
Benjamin Otte
9f47d388f2 reftests: Add test for box expand handling 2011-05-05 17:33:04 +02:00
Benjamin Otte
96c9dd119b reftests: Add a test for grid expand flags 2011-05-05 17:33:04 +02:00
Matthias Clasen
dd95a099be Fix box-packing test 2011-05-05 07:28:18 -04:00
Matthias Clasen
8816a12f0b Expand box-packing reftest
Compare vexpand behavior, too.
2011-05-04 22:58:32 -04:00
Matthias Clasen
f3fbdeecdb Add a box-packing reftest
This test compares GtkHBox expand handling with GtkGrid+GtkWidget::hexpand,
to ensure that replacing GtkHBox by GtkGrid works as intended.
2011-05-04 20:40:22 -04:00
Matthias Clasen
e8dd560851 Convert the commit message into a README
Not everybody thinks git grep is a great doc reader...
2011-05-03 19:37:00 -04:00
Benjamin Otte
d0451d6fa4 reftests: Add a --output option to the test runner
This argument specifies where to dump images instead of /tmp. It's not
hooked up to the test runner, so that one will continue to dump into
/tmp.
2011-05-03 15:40:49 +02:00
Benjamin Otte
3a5669afd0 reftests: Add test for low mnemonics
Low mnemonics were invisible previously. This tests the fix from
9bb145a677
2011-05-03 15:40:49 +02:00
Benjamin Otte
97ad34c3a7 reftests: Test that nonresizable windows get the right size
We want the default size, not the minimum one. This tests the fixes from
4f23dc34be
2011-05-03 15:40:49 +02:00
Benjamin Otte
32a3ad412e tests: Add a test for small ellipsized labels
Tests the fix from bf41392861
2011-05-03 15:40:49 +02:00
Benjamin Otte
af75173ddd reftests: Add grid-homogeneous test
Checks that the homogeneous properties of GtkGrid actually do what
they're supposed to.

Tests fixes from 8331b45a5f
2011-05-03 15:40:49 +02:00
Benjamin Otte
17a6d6b5f6 reftests: Add a test for correct entry text clipping in progress drawing
Tests for fixes in da1f618b09
2011-05-03 15:40:49 +02:00
Benjamin Otte
9229b3216a reftests: Add label-sizing test
Checks that the size requests for labels are as they should be for
required and natural size given various combinations of wrap, ellipsize,
width-chars and max-width-chars.

See
http://mail.gnome.org/archives/gtk-devel-list/2011-April/msg00036.html
for the discussion spawning this test.
2011-05-03 15:40:48 +02:00
Benjamin Otte
363dbb6039 reftests: Add
Add a new test runner supposed to do a lot of generic tests. Run it like
this:

./gtk-reftest [OPTIONS] TESTFILE [TESTFILES...]

where FILE is a GtkBuilder ui file to run.

For a general test named "test", you want to have the following files:
1) test.ui
2) test.ref.ui
3) test.css (optional)
The test will then check that test.ui and test.ref.ui are rendered
identically with the provided css.

In detail, for every provided TESTFILE the test runner will:
1) Add the css to the default screen
2) Load the test.ui file and the test.ref.ui file
3) Grab the first GtkWindow subclass widget
4) gtk_widget_show() it and take a snapshot image of its contents into
   a cairo surface.
5) Compare the two images to be bitwise identical. If they are not, a
   diff image will be created hilighting the differences.
6) Save the images as png files to the output directory named:
   - test.out.png (rendering of test.ui)
   - test.ref.png (rendering of test.ref.ui)
   - test.diff.png (optional, differences from step 5)
7) Fail the test if the two images are not bitwise identical

Credit for the idea of reftests goes to Mozilla and in particular David
Baron. For a larger introduction of why reftests are useful, see
http://weblogs.mozillazine.org/roc/archives/2008/12/reftests.html
2011-05-03 15:40:48 +02:00
Javier Jardón
fb3c16b7ad tests/testgtk.c: Fix crash in cursor test
This was introduced in
commit ac4c12ff60
2011-05-02 18:20:23 +01:00
Benjamin Otte
e8c6dbfab1 testgtk: right-justify menuitem by using expand/align flags
gtk_menu_item_set_right_justify() is about to be deprecated and this
thing should work. (Note: should, because I didn't implemented it yet.)
2011-05-02 16:57:12 +02:00
Benjamin Otte
cb99f0750d tests: Make testmenubars make all menubar items ellipsized
This reproduces a bug in Nautilus. And it allows to shrink things,
woohoo!
2011-05-01 04:44:56 +02:00
Javier Jardón
ac4c12ff60 tests: Use gtk_box_new() instead v/h subclasses 2011-04-22 14:44:02 +01:00
Benjamin Otte
616e6d1565 testgtk: Make it possible to stop the progressbar from updating
This way, I can check that my invalidation fixes actually work.
2011-04-14 14:59:24 +02:00