summaryrefslogtreecommitdiff
path: root/testsuite
Commit message (Collapse)AuthorAgeFilesLines
* reftests: Rename a bunch of testsBenjamin Otte2021-12-0831-30/+30
| | | | They use a GtkOverlay, so reflect that in the name.
* picture: Return natural size 0 for size 0Ivan Molodetskikh2021-12-083-3/+3
| | | | | | | It was returning the full natural size (same as -1) due to default value handling in the code below. Tests have been updated to match this output.
* Merge branch 'textview-im-surrounding' into 'main'Matthias Clasen2021-12-031-8/+8
|\ | | | | | | | | textview: Provide more context to input methods See merge request GNOME/gtk!4209
| * textview: Provide more context to input methodsMatthias Clasen2021-12-031-8/+8
| | | | | | | | | | | | | | | | When returning surrounding context to input methods, include at least 2 words before and after the insertion point. Update the affected input method tests.
* | textchildanchor: allow to specify replacement characterGeorg Vienna2021-12-031-0/+71
|/
* label: Don't set ellipsized size as natural sizeBenjamin Otte2021-11-307-2/+70
| | | | | | Natural size should never ellipsize. Tests added.
* texture: Remove gdk_texture_download_float()Benjamin Otte2021-11-302-145/+0
| | | | | | | The download API is not well thought out yet, so postpone it until there's an actual usecase for it. Remove testcases, too.
* testsuite: Make function arguments constBenjamin Otte2021-11-302-2/+2
|
* builder-tool: Don't simplify enums too muchBenjamin Otte2021-11-216-83/+83
| | | | | | | Store the enum nick, not the enum value. That way the file remains human-readable. Updated reftests to new expected output.
* paned: Compute the right handle sizeBenjamin Otte2021-11-214-0/+113
| | | | | | Testcase included Fixes #4469
* window: properly compute desired sizeBenjamin Otte2021-11-213-0/+27
| | | | | | | Previously, the code did not expand the size properly when a default size was already set. Reftest included.
* sizerequestcache: Increase sizeBenjamin Otte2021-11-203-0/+82
| | | | | | | This is a quickfix to avoid infinite runtime in nested boxes with wrapped labels. Test included
* widget: force adjustment method is one size is FILLBenjamin Otte2021-11-201-8/+3
| | | | | | | | | If halign=fill, force adjustment to height-for-width. If valign=fill, force adjustment to width-for-height. Otherwise look at request mode. This way we don't try to adapt the filled dimension and only adjust the one that is not set to fill.
* widget: Don't forget margins when adjustingBenjamin Otte2021-11-193-0/+43
| | | | | | | This could lead to the wrong values being passed and computing invalid sizes which would then lead to very unhappy code. Test included.
* Don't spam debug messages into TAP outputMatthias Clasen2021-11-161-1/+4
| | | | | | | g_log_writer_standard_streams just puts all the logs out onto stderr and stdout if we don't stop it. Pango recently grew a bunch of g_debug calls, and those were now showing up, making all the reftests fail.
* build: Disable gcc warnings as warnings, tooBenjamin Otte2021-11-153-3/+9
| | | | | We use -Werror in the build, so even if some warnings are just warnings, they'd be errors.
* css: Don't crash when color stop offsets descendBenjamin Otte2021-11-104-0/+27
| | | | | | Testcase included. Fixes #4424
* label: Handle width-chars > text widthBenjamin Otte2021-11-093-0/+27
| | | | | | This was broken in wrapping labels. Testcase included.
* boxlayout: Fix broken min-size-for-opposite-sizeBenjamin Otte2021-11-093-0/+59
| | | | | | | | | | | | | | | | | | | | | Assume a vbox with 2 wrapping labels saying Hello World Hi Ho being measured for their minimum width for 3 rows of text. This should be layouted like Hello World Hi Ho and measured accordingly. However, previously this was layouted as Hello World Hi Ho with 1.5 lines being assigned to both labels. That will obviously not compute the above wrapping which clearly results in a smaller min width. A reftest testing exactly this was included.
* label: max-width-chars should be ignored sometimesBenjamin Otte2021-11-093-0/+25
| | | | | When a widget is neither wrappable nor ellipsizable, we cannot modify the label to fit into any size. So we cannot respect max-width-chars.
* label: max-width-chars has no effect on smaller textBenjamin Otte2021-11-095-0/+52
| | | | | | | | | Having a short text and a large max-width-chars should request the natural width of the text, not the limit from max-width-chars. This caused huge message dialogs. Reftests added.
* reftests: Add reftest for last 2 issuesBenjamin Otte2021-11-063-0/+111
| | | | | | | | | | | Use a label that is long enough to require wrapping and force it into a hardcoded width. Use a sentence where all the words have the same size to not get unwanted wrapping behavior. Also append a 2nd row to check that the first row gets the proper height allocated. Found by Marco Melorio.
* boxlayout: Compute opposite size properlyBenjamin Otte2021-11-053-0/+38
| | | | | | | | | | | | | | For size -1 in the opposite orientation, GtkBoxLayout used to measure the children based on their min size in the box's orientation instead of -1. That wasn't really intended, but was a side effect of how the sizing code did (not) distribute extra size above the minimum size. This is clearly not what we want. What we want is measuring the orientation as is for size -1. Then we want to just take the maximum of all children and use that. A reftest is incldued that ensures a vbox wraps a label just like an hbox does.
* label: Redo measure() codeBenjamin Otte2021-11-051-72/+36
| | | | | | | | | | The old code couldn't properly do height-for-width because it only computed the widest and smallest layout instead of looking at the actual passed in for-size. The label-sizing reftest has been adapted as the label code is now smart enough to always display the whole text and no longer requests a too small width-for-single-row when wrapping.
* Revert "label: Never measure more than max-width-chars"Benjamin Otte2021-11-051-3/+1
| | | | | | | | | | | | | | | | | | | | This reverts commit ba44e7a228534ff066694ad97d25eaa23ec5f3af. The change was meant to revert to old GTK3 behavior but it actually broke new GTK4 behavior that is in use where max-width-chars is used to determine an ideal size, but where we don't want to limit the width to that size. So what happens is the reintroduction of GTK3-style lots of whitepsace bugs, and we really don't want those. We also don't want to break backwards compat if we can avoid it. So let's revert this. The reftest that was made for this purpose has been adapted. Fixes #4399
* reftest: No blinking, pleaseMatthias Clasen2021-11-031-0/+7
| | | | | Blinking cursors aren't helpful when we want to compare renderings pixel-by-pixel. Turn them off.
* reftest: Stop setting GDK_RENDERINGMatthias Clasen2021-11-031-13/+7
| | | | That environment variable isn't used anymore.
* testsuite: Set GDK_DEBUG unconditionallyMatthias Clasen2021-11-031-10/+2
| | | | | The default-settings key works in non-debug builds too, nowadays.
* cssparser: Remove unused argumentBenjamin Otte2021-10-281-1/+1
| | | | The base_directory argument is never used. So don't have it.
* css: Don't throw warnings on broken URL in image cssBenjamin Otte2021-10-264-0/+24
| | | | | | | | | | | | | | If a URL can't be loaded, we might end up with a NULL file. Handle that case properly by creating an invalid image instead and don't crash or complain to stderr when files are NULL. This was broken since 0886ade182f1a958024202d5c20248d57fcdb053 A new reftest has been included. We need a reftest instead of a CSS parser test, because the error only becomes visible when compute()ing the actual image. Fixes #4373
* Merge branch 'wip/otte/center-center-center' into 'master'Benjamin Otte2021-10-2236-1/+514
|\ | | | | | | | | | | | | Add a bunch of reftests and fix their failures Closes #4285 See merge request GNOME/gtk!4085
| * testsuite: Add lots of reftests for picture sizingBenjamin Otte2021-10-2235-0/+510
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Have square images in the following sizes: * 20 * 100 * 150 * 200 * 300 and place them in a can-shrink Picture allocated at the sizes: * 200x100 * 100x200 and set align to center/center. That's 10 combinations and they should all do the right thing.
| * reftests: Don't crash if no nodeBenjamin Otte2021-10-221-1/+4
| | | | | | | | | | | | If we have no node, don't crash when trying to save the node file. Instead, write an empty file.
* | testsuite: Create GL renderers without surfacesBenjamin Otte2021-10-202-10/+2
|/
* testsuite: don't XFAIL label-sizing anymoreBenjamin Otte2021-10-191-2/+0
| | | | It's fixed now.
* testsuite: Add test specifically for recent fixBenjamin Otte2021-10-193-0/+42
| | | | | | label-sizing.ui tests this, too - but that test tests lots of other things, and if this ever happens again, we want to debug it in a small test.
* reftest: On failure, save the node files, tooBenjamin Otte2021-10-192-1/+36
| | | | | Doesn't hurt to have them available, so it's easy to figure out if a failure is due to the renderer or if we're generating wrong node files.
* testsuite: Add workarounds for non-gl backendsBenjamin Otte2021-10-182-2/+12
| | | | read: Fix tests for broadway
* Add memory formats used by libpngBenjamin Otte2021-10-131-0/+42
| | | | | Add unpremultiplied high-depth formats. They are used in the real world, so let's support them.
* Merge branch 'ngl-is-the-new-gl' into 'master'Matthias Clasen2021-10-114-6/+6
|\ | | | | | | | | | | | | Rename ngl to gl Closes #4318 See merge request GNOME/gtk!4037
| * Rename ngl to glMatthias Clasen2021-10-074-6/+6
| | | | | | | | | | We have only one gl renderer now, and it is a bit odd for it not be called gl.
* | testsuite: Add run for GLESBenjamin Otte2021-10-091-0/+12
| | | | | | | | | | | | | | This is supposed to test the most fallback GL stuff, so we might want to set even more env vars here. Also enable the run for the Fedora builder in CI.
* | testsuite: Add a test targeting GL upload codeBenjamin Otte2021-10-091-0/+22
| | | | | | | | | | | | | | Previously, all the tests used the icon upload path using glTexSubImage2D(). This test uses the custom texture path using glTexImage2D().
* | css: Render the background-clip area, not the background-originBenjamin Otte2021-10-074-0/+46
|/ | | | | | Testcase included Fixes #4324
* testsuite: Fail more accuratelyBenjamin Otte2021-10-061-12/+14
| | | | | Don't run the full test and then return "something failed" - instead just explode when you find the failure.
* Merge branch 'wip/otte/for-master' into 'master'Matthias Clasen2021-10-011-3/+40
|\ | | | | | | | | testsuite: Actually run all memorytexture tests See merge request GNOME/gtk!4016
| * testsuite: Actually run all memorytexture testsBenjamin Otte2021-09-261-3/+40
| | | | | | | | Whoops
* | gtk-builder-tool: Simplify moreMatthias Clasen2021-09-2910-184/+184
| | | | | | | | | | | | Simplify enum properties as well. Update affected tests.
* | builder-tool: Avoid <style> when convertingMatthias Clasen2021-09-281-3/+1
| | | | | | | | | | | | We can just set the css-classes property instead. Update affected tests.
* | builder: Fix handling of <binding>Matthias Clasen2021-09-283-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | We were only applying <binding> elements when the object is constructed, which can be triggered by various things (e.g. a <style> element). Defer this until we reach </object>, so we can be sure that we pick up all the bindings. Testcase included. Fixes: #4147