keyboard_zoom_focus: disabled, because it fails randomly
restore_recently_closed_multi_column_dock: tracked down the
failure to GTK+ and disabled until we depend on GTK+ >= 2.24.11
repeatedly_switch_window_mode: disabled, I have no clue how to
fix this. These UI tests run way too much code to be useful.
Warning
g_thread_init has been deprecated since version 2.32 and should not be used in newly-written code. This function is no longer necessary. The GLib threading system is automatically initialized at the start of your program.
Rename the 'basic_usage' test to 'basic_read' and add 'basic_write'
test. Implement GimpTileBackendTileManagerPrivate enough to make them
pass.
Note that these tests currently do not work with GIMP's "effective
tile size" optimization.
Add a super basic GimpTileBackendTileManager unit test and implement
GimpTileBackendTileManager enough to make it pass. Still a lot of work
left to do, this was just to get things up and running.
In single-window mode, gimp_session_managed_set_aux_info() will set
the size of the dock areas at the sides. If we don't wait for those
areas to get their size-allocation, we can't properly restore the
docks inside them, so do that in an idle callback.
Also add a required call to gimp_test_run_mainloop_until_idle()
because of this in the 'automatic_tab_style' test.
GIMP 2.6 session files can't have many docks in a dock window, so
remove that from the GIMP 2.6 session file we use for compatibility
testing. Also remove the "gimp-single-image-window" entry.
The downside is that we need a separate 'expected'-file, but we need
to live with that.
Rememeber if image windows are opened because we want the
gimp_session_info_restore() code to run for the single-image window
once that code is in place.
Add regression test for "app: Give configure event info to
gimp_session_info_read_geometry()", commit
93fd257c52, which fails without that fix
being present.
Move code in test-session-management.c to a common place so we can
have several variants of session management tests. We can't easily run
all session management tests in a single process, because some parts
of Gimp (the GObject) initialization eeks if done twice in the same
process.
Rename test-session-management.c to test-session-2-6-compatibility.c
and create a new test for GIMP 2.8 multi-window mode session files,
namely test-session-2-8-compatibility-multi-window.c. Copy and rename
sessionrc files accordingly.
Make GimpDockContainer::get_docks() return a new list and not just a
pointer to a list so that GimpImageWindow can implement it (who needs
to merge its two GimpDockColumns lists).
Make GimpDockWindow implement the GimpDockContainer interface. The
plan is to make GimpImageWindow also implement the GimpDockContainer
interface when we start to session manage docks in single-window mode.
Use a selected set of plug-ins from the build dir rather than the
install dir. In particular 'file-png' for the
'/gimp-save-and-export/imported_file_uris' test. We might need to use
other plug-ins from the build dir as well later, but for the ones from
'plug-ins/common' is enough.
An image can not be considered both exported and imported at the same
time, so stop consider it as imported after we consider it exported.
Also add an automatic regression test.
Remove files in /tmp after tests so that other users on the same
machine (like buildbots) also can run make distcheck without getting
"can't overwrite file" errors.
Add a configure check for xvfb-run and run tests with that if
available. This makes it possible to easily run UI tests in headless
environments such as a server that does nightly builds; one just needs
to make sure xvfb-run is available.
Eventually we might want to be more strict, but I think it will be
fine to depend on UI headers in non-UI tests. Non-UI tests just means
we don't need to initalize the UI.
Make gimp_ui_get_ui_manager() a global test util and make
gimp_test_utils_create_image() return void, clients can reach the new
image and display from the Gimp instance.
Increase GIMP_UI_WINDOW_POSITION_EPSILON, we had a nightly build that
failed with
assertion failed ((int)abs (y_before_hide - y_after_show) <=
GIMP_UI_WINDOW_POSITION_EPSILON): (21 <= 10)
so appearently we need to be more liberal.
Add a "pre-clicked" signal to GimpCellRendererViewable that can
prevent a selection from happening. Move the Alt-Click code in
GimpLayerTreeView to this signal and if a layer is Alt-Clicked, don't
go ahead and make the layer active. Also add a test for this use case.
Remove two GIMP initializations by putting
"gimp-window-management/window_roles" into "gimp-ui" and removing
"gimp-layer-groups/add_layer" which we already have in
"gimp-layers". And we can have layer group tests there too.
Add a regression test that makes sure its possible to Alt-Click on a
layer in the layers dockable to create a selection from it.
Change sessionrc to have only one page in the GimpDockbook to
avoid problems with gtk_test_find_widget().
When we are going to open new image windows, unset the transient
window. We don't need it since we will use gdk_window_raise() to
keep the dialog on top. And if we don't do it, then the dialog
will pull the image window it was invoked from on top of all the
new opened image windows, and we don't want that to happen.
Patch heavily inspiried by hack from Massimo Valentini.
Also add a manual test case for the fix. (I don't think there is GTK+
API to automate it).
Make gimp_ui_synthesize_plus_key_event() generic and implement it with
gdk_test_simulate_key(). We can't use gtk_test_widget_send_key()
because its input window logic doesn't seem to work very well.
Apparently, $(abs_top_srcdir) and $(abs_top_builddir) aren't set as
shell variables any longer. Instead, use @abs_top_srcdir@ and
@abs_top_builddir@ so they get substituted at configure time.
Introduce a few pixels of error margin in sessionrc, otherwise the
tests are too fragile, widgets have a tendency to change size a bit
and window managers have a tendency to move windows a bit.
Still needs more work, should probably do the same on book positions
too...
Remove the dockable drag handle and move the menu button it hosts up
to the GimpDockbook, with the gtk_notebook_set_action_widget() API.
This frees up quite a lot of screen estate which can be used for the
content of dockables instead.
Add support for a new type of Tab Style called 'Automatic'. This tab
style makes the GimpDockbook use the biggest actual tab style it can
for its auto tab style dockables, based on its widget allocation.
The tab style candidates for auto tab style are "Status + Blurb",
"Status + Text" and "Status". A docked widget can also say that it
wants to use "Icon" instead of "Status" for its auto tab style. The
'Tool Options' dockable does this. This is to be as backwards
compatible with the old tab style setup, we make 'automatic' the
default everywhere.
We have quite a bit of dependency to internal layout code in
GtkNotebook, but the current code should be pixel perfect and rather
complete.
Also add a basic regression test.
We need to be able to pass a GimpUIManager to
gimp_dialog_factory_dialog_new(), so make that possible. Also make
sure to set ui_manager in gimp_dialog_factory_dialog_new_internal()
when we create both a dock window and a dock, so tooltips works in
toolboxes created from scratch.
Generalize gimp_ui_find_non_toolbox_dock_window() by renaming it to
gimp_ui_find_dock_window() and adding a parameter with a function that
will be used to find the toolbox.
Instead of including dialogs/dialogs.h everywhere, introduce
gimp_dialog_factory_get_singleton(). The dialog factory singleton is
still initialized by dialogs.c though.
Right now the assumption is that we never will have another dialog
factory instance around. There were so many problems before when we
had four of them, so let's just keep one of them around.
We only have one dialog factory now, and
gimp_dialog_factory_from_name() doesn't provide compile-time type
safety, so use global_dialog_factory directly instead.
Add a "hide-docks" config and connect the Windows->Hide docks menu
item to it. Also connect the image window to the config property so it
can hide/show its docks when it needs to.
Also add and use a utility function
gimp_image_window_keep_canvas_pos() to ensure that the image in the
window remains fixed when toggling visiblity of docks. One problem:
When GimpDrawTool is active on the canvas, there is flicker. The end
position is correct though.
Also add regression testing for this fix to test-ui.c
In GIMP 2.6 dockrc did not contain the factory entries for the session
infos, so set that up manually if needed. Also take the opportunity to
add a copyright notice to dialogs.c since tha file is almost rewritten
by now...
Add regression test for hide/show of dock windows that makes sure that
dock window positions are kept after a hide/show cycle. Also introduce
a helper function gimp_ui_find_non_toolbox_dock_window().
Make gimp_ui_get_ui_manager() in test-ui.c handle when there is no
empty display so we can put the new-image test before the
single-window mode tests. We want the single-window mode tests lasts
because they are so flickery.
Make our test cases write gimpdir files in a dedicate output directory
by changing GIMP2_DIRECTORY at runtime. This ends the writing to the
source directory which make distcheck doesn't like, and it also allows
us to have a separate expected sessionrc for the session management
test. In that test we load a GIMP 2.6 formated sessionrc but write one
updated for 2.8.
We perform this change by passing the builddir through an environment
variable to the test cases. The patch also does some generalizations
in gimp-app-test-utils.c and adapts test cases accordingly.
Also do an adjustment in sessionrc on the toolbox size since
GIMP/GTK+/X/whatever has a tendency to adjust that during runs. The
new size is stable for the moment.
Get rid of 'global_toolbox_factory' and manage everything dock-related
with 'global_dock_factory'. The whole of 'global_toolbox_factory' was
a big special-case and getting rid of it makes it easier to extend the
session management with e.g. single-window mode dock functionality.
To get rid of 'global_toolbox_factory' we, roughly, have to
* Replace 'global_toolbox_factory' with 'global_dock_factory'
everywhere. We can also get rid of lots of code that did special
things for the "toolbox" factory.
* Make the use or interaction with the toolbox explicit in some
places. For example, a function gimp_dock_window_has_toolbox() has
been introduced.
* Make GimpSessionInfoDock have an 'identifier' parameter so we can
differentiate between the "gimp-dock" and "gimp-toolbox" dock
types.
Rename back global_dock_window_factory to
global_dock_factory. Renaming to global_dock_window_factory was done
under the assumption that there would be a separate factory that would
create non-toplevel dockables, but I don't expect this to happen in
the forseeable future.
Add a test to create a new image via the new image dialog that would
have caught the regression fixed by:
db2221c9 "app: Fix gimp_dialog_factory_constructor()".
In order to let tests run against the source dir, allow them to
override the menus directory. Add utility functions for this and
adjust gimpuimanager.c accordingly.
Add template code for writing a test that makes sure GIMP 2.8 images
do not lose information when written to a file and loaded again, in
hope that mitch will fill in the rest ;)
Do a basic regression test on being able to load XCF files created
with GIMP 2.6. To add things to this file, add things to
gimp_write_and_read_file() and run the code in GIMP 2.6.
Also add a file-local helper function gimp_test_load_image().
This reverts commit 2d2b6f03c5 and
adapts the code. We can use gimp_vectors_stroke_get_next (vectors,
NULL) instead of gimp_vectors_get_stroke (vectors, 0). Thanks to nomis
for pointing this out.
Add another layer, a channel, a selection and two vectors to the test
image. Parameterize the image construction so we can create different
variants of test images, and add a test for an "unusual" GimpImage,
which is an image with compatible vectors and with a floating
selection. The test are renamed to something with "GIMP 2.6" to
emphasize that the tests work with files that might as well have been
constructed with GIMP 2.6. Also adjust the list of things that should
be tested, but that isn't tested yet.
FWIW, using the GNU gcc gcov tool it can be seen that xcf-load.c now
has a code coverage of 67.04% of 722 lines.
Let each test sets GIMP2_DIRECTORY on their own through the help of a
new test utility function gimp_test_utils_set_gimp2_directory() that
is compiled into its own lib which tests are then linked with. Also,
instead of using "/tmp/gimpdir", we use "gimpdir-empty" in the source
dir. This way we get rid of a bunch of annoying warnings when running
the tests and have more control.