Commit graph

572 commits

Author SHA1 Message Date
taler21
0b8a85ad64 Enable MultiSelect() unit test for generic wxListCtrl
This test just doesn't want to work when run on GitHub CI under wxGTK2
even though it works perfectly locally. So enable the test at least for
all other ports.
2024-02-21 08:51:09 +01:00
taler21
d091a44adb Fix missing deselection of single selected but not focused item
A generic multi-select wxListCtrl did not deselect a single selected
item that did not have focus when the user single-selected another
item.

This fixes a regression introduced in fedc80eee3 (Improve selection and
focus events generation in wxGenericLisCtrl, 2020-10-10).

Closes #24312.
2024-02-19 13:58:51 +01:00
Scott Talbert
1622a5c9c2 Fix WebView tests with WebKitGTK 2.43+
It seems that WebKitGTK is now failing to navigate to about: URLs unless
they are about:blank or about:srcdoc, so use about:srcdoc as the
alternate URL to fix the WebView tests.

Ref: 3c3163e71f
2024-02-01 20:56:32 -05:00
Vadim Zeitlin
261490d5e2 Ignore failures in tests handling mouse clicks under AppVeyor
For some completely mysterious reason we don't get the expected mouse
click events when running under AppVeyor, something might be covering
the window and stealing the clicks for itself there.

As there doesn't seem to be anything to do about it, just skip the test
in this case.

Closes #24082.
2024-01-03 20:21:59 +01:00
Vadim Zeitlin
268b2b98e0 Use WaitForEventAt() in Grid::ReorderedColumnsCellClick test too
This test also sporadically fails on AppVeyor.
2024-01-01 22:04:41 +01:00
Vadim Zeitlin
5f62f30231 Use WaitForEventAt() in Grid::CellSelect test too
Try making this test more robust as well as it also sporadically fails
on AppVeyor.

Also simplify it a bit, checking for each of the expected events in turn
instead of checking for their total number at the end.
2023-12-27 02:49:53 +01:00
Vadim Zeitlin
bac0aa0e83 Merge branch 'ui-tests-fixes'
Attempt to work around failures in UI tests under AppVeyor.

See #24162.
2023-12-25 18:02:51 +01:00
Vadim Zeitlin
61edcbc5a6 Use WaitForEventAt() in Grid::CellClick test too
This test doesn't use the native header but somehow still fails on
AppVeyor and locally a very failure can be reproduced if the mouse is
moved while the test runs, so check for this here too.
2023-12-25 17:07:53 +01:00
Vadim Zeitlin
216b5a4b23 Also use WaitForEventAt() in Grid::SortClick test case
Abandon this test too if the mouse moves for whatever reason.
2023-12-25 17:07:53 +01:00
Vadim Zeitlin
8218e31418 Abandon tests waiting for mouse events if mouse moved
If the mouse pointer moves, for whatever unexplained reason, the click
is not going to happen, so don't wait for it.
2023-12-25 17:07:53 +01:00
Vadim Zeitlin
ab0a44a63a Give information about which section of grid tests fails
This is useful to see when the failure occurs exactly as the same checks
are performed in 3 different cases.
2023-12-25 15:18:05 +01:00
Artur Wieczorek
c8552aec0c Make wxPGPropertyFlags a bitmask
To improve type safety of flags.
2023-12-25 15:09:50 +01:00
ali kettab
47bc3a8b96 Try to fix unit tests systematically failing under AppVeyor
Raise the window to ensure that it gets the expected mouse events.

See #24082.

Closes #24109.
2023-11-30 16:32:48 +01:00
Paul Cornett
edd1d758de Fix wxCheckBox::SetValue() when in undetermined state with GTK
State becomes determined when SetValue() is called.
See #24074
2023-11-20 08:50:05 -08:00
ali kettab
aa4a19cb1d Fix or skip other failures in the tests under wxQt 2023-11-01 00:39:19 +01:00
ali kettab
7469f0f5c4 Fix failures in TreeCtrlTestCase tests under wxQt 2023-10-31 22:58:21 +01:00
ali kettab
0e325e6262 Fix failures in ListBoxTestCase tests under wxQt 2023-10-31 22:56:30 +01:00
ali kettab
53c2b7d65b Fix failures in wxGrid tests under wxQt 2023-10-31 22:53:59 +01:00
ali kettab
b5dad92007 Make sure the window is active after SetFocus() under wxQt
Calling wxYield() after SetFocus() ensures that the window is active
and the tests will pass. Otherwise, they would fail.
2023-10-31 22:42:27 +01:00
ali kettab
3a71aeed5e Enable some more tests under wxQt 2023-10-31 22:28:34 +01:00
ali kettab
b7cf27f2ce Enable HitTestSingleLine test case under wxQt 2023-10-23 21:16:31 +01:00
Vadim Zeitlin
c601bf4279 Merge branch 'qt-fixes'
Fix bugs preventing GUI tests from working with wxQt and provide native
implementations of wx{Date,Time}Ctrl in this port.

See #23925.
2023-10-22 01:18:50 +02:00
Vadim Zeitlin
99febcf9c1 Wait for events in Grid::LabelClick and RangeSelect tests too
Not sure if it really helps, but try to wait for the events in these
tests as well if only for consistency with what was done in 3d07de66b1
(Add a wait to wxGrid UI unit tests too, 2023-10-03).
2023-10-22 01:06:38 +02:00
ali kettab
09c22b080e Fix listboxtest test failing under wxQt
Qt uses QString::localeAwareCompare() for comparison and this is what their
documentation says: "On other Unix-like systems without ICU, the comparison
falls back to the system library's strcoll()". Under MSW, Qt uses CompareStringEx()
IOW, Qt always compares strings by locale-specific sorting criteria and BTW
this is what wxGTK was like before this commit 625ed74 (Make sorting of wxListBox,
wxChoice and wxComboBox identical to the MSW sorting)
2023-10-15 00:10:02 +01:00
ali kettab
155b24daea Fix gridtest test failing under wxQt 2023-10-15 00:10:02 +01:00
ali kettab
942b3bccf4 Fix windowtest test failing under wxQt 2023-10-15 00:10:02 +01:00
ali kettab
ae0d707166 Fix wxListCtrl test failing under wxQt
The wxListCtrl would assert with this message: '../src/qt/listctrl.cpp(452):
assert "col < columnCount()" failed in SetItem(): Invalid col'

Because under wxQt: no columns means no items, and no items means
no selection can be made at all.
2023-10-15 00:10:02 +01:00
ali kettab
f7e7c037c2 Fix wxTextCtrl::GetBestSize test case failing under wxQt 2023-10-15 00:10:02 +01:00
ali kettab
d0bf5fdb8f Use cursor type guaranteed to be supported on all platforms.
The wxCURSOR_CHAR cursor type is not supported under wxQt and using it
causes the test to fail there.
2023-10-15 00:10:02 +01:00
ali kettab
7e360dcf1e Fix testing wxSpinCtrl[Double] unsupported features under wxQt
Backwards ranges are not supported under wxQt and setting empty string
in the control automatically displays minVal.
2023-10-15 00:10:02 +01:00
ali kettab
ff4995ec01 Enable formerly skipped tests under wxQt 2023-10-14 17:58:53 +01:00
Vadim Zeitlin
3d07de66b1 Add a wait to wxGrid UI unit tests too
Wait for a bit before checking for the expected event as a single
wxYield() call might apparently not be enough under load, as this test
sporadically fails in AppVeyor CI builds even though it passes locally.
2023-10-03 16:05:31 +02:00
Vadim Zeitlin
fa5964c100 Use WaitFor() and new YieldForAWhile() helpers in the tests
Reuse the existing function (and another new one, which is even simpler)
instead of duplicating its code in many places in the tests.

No real changes.
2023-10-02 15:10:36 +02:00
Vadim Zeitlin
1237322404 Add WaitFor() helper and use it in Button::Click unit test
This test also sporadically happens under AppVeyor, check if it happens
because we need to wait for some time before the event is processed.
2023-10-01 21:30:00 +02:00
Vadim Zeitlin
55e074f5bc Rename tests/waitforpaint.h into just waitfor.h
No changes yet, just prepare for adding more "waiting" helpers.
2023-10-01 21:25:46 +02:00
Vadim Zeitlin
3f2b7f6bdb Try changing BitmapToggleButtonTestCase to avoid wxMSW failures
This test sporadically fails under AppVeyor, perhaps due to a hard-coded
sleep in it which may somehow misbehave there -- try changing it not to
rely on this sleep.

This has a nice side effect of making the test run faster, too.
2023-10-01 21:14:00 +02:00
Vadim Zeitlin
7d362c3fca Enable wxStyledTextCtrl unit test in static builds too
It should link there too now after the previous commits.
2023-07-29 16:01:33 +02:00
Martin Corino
4d76a87015 Make wxSearchCtrl inherit from wxTextEntry in all ports
Previously it only inherited from wxTextEntryBase in the generic
implementation (used e.g. in wxMSW).

Update the code, documentation and add new unit tests checking that
wxSearchCtrl member functions inherited from wxTextEntry behave
correctly.

Closes #23686.

Closes #23697.
2023-07-20 14:46:41 +02:00
Brian Nixon
381c39a051 Clear grid attribute cache when loading new table
Clear the cached attributes when replacing the table they were used
with.

Add unit test checking that the attributes are not used any longer.

Closes #23607.
2023-06-05 15:22:49 +02:00
Vadim Zeitlin
c41969eff2 Disable wxHyperlinkCtrl colours test under Wine
This doesn't work due to LM_GETITEM not returning the expected result
after changing the state using LM_SETITEM under Wine.

It could be worked around by remembering whether we changed the colours
in our own variable, or maybe just reverted later if Wine fixes this,
but for now disable the test.
2023-05-15 21:50:31 +01:00
Vadim Zeitlin
cd28031b4d Document that wxMSW wxHyperlinkCtrl hover colour can't be changed
This isn't supported by the native control, and it doesn't seem worth to
make an extra effort to support it, so just document it and stop
checking that it works in the unit test.
2023-05-15 21:39:13 +01:00
Vadim Zeitlin
d1fedc1415 Get rid of CppUnit boilerplate in wxHyperlinkCtrl unit test
No real changes, just avoid using compatibility macros in this test.
2023-05-15 21:39:13 +01:00
Vadim Zeitlin
54a8a6ac16 Fix wxTreeCtrl::ScrollTo() with hidden root item in wxMSW
Scroll to the topmost item, as the generic version does, instead of
crashing.

Closes #23534.
2023-05-10 19:08:00 +01:00
Vadim Zeitlin
50dcf06bff Revert to using wxBaseObjectArray for wxAuiToolBarItemArray
This partially undoes the changes of bc23b1f4f0 (Use wxBaseArray instead
of object array for wxAuiToolBarItemArray, 2023-04-11) as they broke the
existing code using wxAuiToolBar because the pointers to the tools were
not stable any more.

At least avoid the use of the ugly -WX_DECLARE_USER_EXPORTED_OBJARRAY()
macro by just using wxBaseObjectArray<> directly, which is simpler now,
after the change in the parent commit.

Add a trivial test checking that pointers to wxAuiToolBar tools remain
stable when more tools are added.

Closes #23514.
2023-05-07 00:52:07 +01:00
Vadim Zeitlin
8d8f94da64 Merge branch 'webkit2_fixes' of https://github.com/swt2c/wxWidgets
Miscellaneous fixes for WebKit2 wxWebView backend.

See #23497.
2023-04-28 16:39:49 +02:00
Vadim Zeitlin
fd0a52250d Remove redundant wxUSE_STD_IOSTREAM test
It's not necessary to check for it as wxHAS_TEXT_WINDOW_STREAM is only
set to 1 if standard streams are used.
2023-04-28 15:26:46 +02:00
Scott Talbert
9688ccc087 WebView tests: Fix Selection test with WebKit 2.40+
For some reason, calling HasSelection() immediately after SelectAll()
causes the web extension to get stuck under WebKit 2.40.  Instead of
sleeping, call wxYield() a few times to let the event loop run a bit.
2023-04-26 10:26:16 -04:00
Vadim Zeitlin
363f0988cf Replace wxScopedPtr with std::unique_ptr in the tests
Just use the standard class instead of the wx one, as they can be used
in exactly the same way.
2023-03-06 23:34:44 +01:00
Vadim Zeitlin
c6a18264e1 Fix signed/unsigned comparison warnings in wxPropertyGrid tests
Use size_t for a variable being compared with a size_t expression.
2023-02-19 23:47:08 +01:00
Artur Wieczorek
5b1911523c Add more unit tests of wxPGVIterator 2023-02-19 22:36:40 +01:00