Commit Graph

138 Commits

Author SHA1 Message Date
Steve Lamerton
236cff7334 Rename all WEB_VIEW* style identifiers to WEBVIEW*.
This makes wxWebView consistent with the rest of the toolkit. 

Closes #15013

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73453 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-02-01 09:38:53 +00:00
Vadim Zeitlin
ae72623b64 Add wxCheckListBox::GetCheckedItems() helper.
This method is similar to wxListBox::GetSelections() and allows to retrieve
all checked items at once.

Closes #14969.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73422 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-01-21 11:18:55 +00:00
Steve Lamerton
39a18da1a8 Pass wxWANTS_CHARS to the wxRichTextCtrl constructor in the unit tests.
Fixes test failures caused by the return key being used for dialog navigation.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73413 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-01-20 19:28:20 +00:00
Vadim Zeitlin
09ca8913fa Fix wxSearchCtrl::HasFocus() in the generic version.
Override GetMainWindowOfCompositeControl() in the windows composing the
generic wxSearchCtrl to ensure that HasFocus() correctly returns true for the
entire control when any of them has focus.

Add a trivial unit test to check that this really works and facilitate adding
more tests for this class later.

Closes #14970.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73401 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-01-20 02:09:44 +00:00
Vadim Zeitlin
fe218f1e4b Fix setting initial wxSpinCtrl value outside 0..100 range in wxMSW.
Set the range before setting the initial value when creating wxSpinCtrl, as
otherwise the value was wrongly limited to the default 0..100 range instead of
the one really specified.

Closes #14894.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73394 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-01-20 02:09:14 +00:00
Václav Slavík
a96de8a36a Tests for wxTEST_DIALOG and wx/testing.h.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72838 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-11-01 16:45:14 +00:00
Vadim Zeitlin
532324df23 Don't generate events from wxSpinCtrl::SetRange() in wxMSW.
Other ports don't send wxEVT_COMMAND_SPINCTRL_UPDATED from SetRange() even if
the value changed because it was adjusted to fit into the new range and this
makes sense as this change is not due to a user action, so don't send this
event under wxMSW neither.

Also add a unit test checking for this behaviour.

Closes #14583.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72341 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-08-15 23:34:10 +00:00
Julian Smart
04b2b47a4e Fixed wxRichTextCtrl caret test case
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72072 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-07-13 16:38:15 +00:00
Vadim Zeitlin
85668a34b3 Revert "Temporarily disable the failing wxRichTextCtrl case."
Revert r71945 which disabled failing wxRichTextCtrl unit test. It fails again
now and hopefully will be fixed before 2.9.5.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72031 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-07-11 12:16:41 +00:00
Vadim Zeitlin
300fed484c Temporarily disable the failing wxRichTextCtrl case.
Disable CaretPosition() unit test as it is broken now. This is only temporary
to allow tests to pass in 2.9.4, will be reenabled (and hopefully fixed) later.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71945 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-07-02 15:08:09 +00:00
Vadim Zeitlin
a523d3c643 Add a unit test verifying that wxSpinCtrl ctor doesn't generate any events.
This shouldn't happen but did (and apparently still does, sometimes) under MSW
so add a test verifying that no events are generated by the ctor.

See #14428.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71892 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-06-30 16:33:36 +00:00
Vadim Zeitlin
784130d290 Disable wxUIActionSimulator wxGrid tests using mouse under wxGTK.
Something is seriously wrong with simulated mouse events and wxGrid under
wxGTK, they seem to simply disappear sometimes. This results in unit tests
suite failure, so disable these tests for the next release as I just don't
understand how to fix them.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71635 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-06-01 16:21:08 +00:00
Vadim Zeitlin
f1287154cd Add IsAutomaticTest() function to the unit tests.
This allows to easily test if we're running on a buildbot slave and disable
some difficult to debug test failures there.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71634 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-06-01 16:21:06 +00:00
Vadim Zeitlin
6e36db5eca Correct the initial value setting in wxMSW wxSpinCtrl.
Always use value argument for the text control contents and also override the
initial numeric value with it if it's numeric.

This seems to be the only consistent thing to do, so document this behaviour
and add a unit test checking for it.

Closes #13589.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71387 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-09 14:24:20 +00:00
Vadim Zeitlin
7c7bd972fa Add a hack to prevent the test suite from aborting after Grid test case.
There is a problem with the native header control still having the mouse
capture when the grid is destroyed in wxGTK and this resulted in asserts when
destroying the grid, nested asserts due to an exception being thrown from a
dtor and finally abort that prevented the rest of the tests from running.

As I failed to find the real reason for this problem, just forcefully ensure
that we don't have the mouse capture when destroying the grid. This at least
allows the complete test suite to run.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71319 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-04-29 23:22:10 +00:00
Vadim Zeitlin
d9abe7f2f9 Run some wxTextCtrl unit test cases for single and multi-line controls.
Some of the tests that were previously ran for single or multi-line controls
only actually apply to both of them, so run them for both kinds of control to
test that both of them work correctly.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71307 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-04-28 22:25:01 +00:00
Vadim Zeitlin
358fb6ada6 No changes, just refactor wxTextCtrl unit test case.
Allow running the same tests for both single and multi-line controls easily.
No real changes yet though, the tests are still ran for the controls with the
same styles as before for now.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71306 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-04-28 22:24:59 +00:00
Steve Lamerton
1e0b0d7c55 Add new WX_ASSERT_EVENT_OCCURS macro to improve behaviour of testing asynchronous events. Use it in the wxWebView tests and re-enable previously failing tests.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70882 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-03-12 14:57:44 +00:00
Steve Lamerton
744d91d41f Move getting the unit test event count from wxTestableFrame to the EventCounter class. This reduces the need to have wxTestableFrame pointers all over the unit testing code and should reduce bugs caused by counting the wrong events.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70871 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-03-11 14:32:24 +00:00
Vadim Zeitlin
be74a2a21a Fix the size of the font returned from wxTextCtrl::GetStyle() in wxMSW.
Due to a typo the size was expressed in 1/10th of a point and not in points.
Fix this and add a unit test checking that GetStyle() returns the same font as
was set by SetStyle().

Closes #2120.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70341 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-01-14 17:57:11 +00:00
Vadim Zeitlin
e4aadc2f1d Update wxGrid unit tests after r70177.
The row/column selection is not stored in the block arrays, see #12638.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70194 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-29 23:39:27 +00:00
Steve Lamerton
d296f9a114 Disable final failing wxWebView test. It fails on the buildbot but not locally.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70149 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-28 10:01:05 +00:00
Vadim Zeitlin
4a04898fe0 Really fix the use of deprecated methods in wxGrid test.
The changes of r70111 were wrong, the unit test for wxGrid really did intend
to test the deprecated methods so restore them -- but only in
WXWIN_COMPATIBILITY_2_8 case.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70113 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-24 18:30:52 +00:00
Vadim Zeitlin
b73da1a41b Don't use deprecated methods in wxGrid test.
Don't use the methods defined only when building 2.8-compatible mode to let
the tests compile even with WXWIN_COMPATIBILITY_2_8 off. This only worked
before because of the wrong tests in grid.h but broke after the fixes of
r70098.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70111 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-24 17:58:32 +00:00
Steve Lamerton
8a31648287 Disable some wxWebView tests that fail on the buildbot but not locally.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70102 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-24 10:08:37 +00:00
Steve Lamerton
ed1c9160bf Add some extra yields to wxWebView unit tests to hopefully fix some of the failing buildbot runs.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70100 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-23 19:16:47 +00:00
Steve Lamerton
7f98bdd6a5 Ensure wxWebViewIE::SetPage clears the existing content before writing the new output. Also add a basic unit test to verify correctness in the future.
Fixes #13770

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70041 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-18 11:51:52 +00:00
Vadim Zeitlin
bfbd873bfe Don't use wxTE_DONTWRAP style in Lines() wxTextCtrl unit case.
The last check in this test couldn't pass under MSW as it relied on the (long)
line of text being wrapped but the style used for the control prevented this
from happening. Not sure how could it have ever worked before but in any case
removing wxTE_DONTWRAP does make the test pass.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70019 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-16 19:57:17 +00:00
Vadim Zeitlin
b281a92305 Keep the item being updated selected in wxMSW wxChoice::SetString().
Changing the text of the selected wxChoice (or wxComboBox, as it derives from
it in wxMSW) item made it unselected. Fix this by explicitly restoring the
selection to the item if needed.

Closes #13769.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70018 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-16 19:47:58 +00:00
Steve Lamerton
30e2c04682 Only build the wxWebView tests if there is an available backend.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69081 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-09-14 07:39:28 +00:00
Steve Lamerton
6edb39127b Correct a typo in the wxWebView tests.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69078 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-09-13 19:39:38 +00:00
Steve Lamerton
1d156af324 Merge in from trunk r68684 - r69046
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@69047 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-09-10 15:09:22 +00:00
Vadim Zeitlin
211d331379 No changes, just fix the file name in the header comment of wxDVC test.
s/tree/dataview/

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68923 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-27 14:11:31 +00:00
Vadim Zeitlin
524cb04066 Add new wxTreeListCtrl class.
This is a facade for wxDataViewCtrl allowing to easily work with multi-column
trees, possibly with an optional checkbox in the first column. Its API is very
similar to wxTreeListCtrl and it provides a simple migration path from the
latter.

Add the class itself, documentation for it and minimal unit tests.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68916 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-27 14:11:03 +00:00
Václav Slavík
c08598f6cd Fix typo.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68847 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-22 14:14:55 +00:00
Vadim Zeitlin
fa93d732e2 Harmonize wxDataViewCtrl::GetSelection() behaviour in all ports.
wxDataViewCtrl::GetSelection() now always returns invalid item if more than
a single item is selected in a multi-selection control.

Also add HasSelection() and GetSelectedItemsCount() to allow checking if any
items are selected.

Updated the documentation, all ports and added a test for all these functions.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68844 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-22 12:41:19 +00:00
Vadim Zeitlin
c3ad4d4a45 No changes, just use CPPUNIT_ASSERT_EQUAL() instead of CPPUNIT_ASSERT().
CPPUNIT_ASSERT_EQUAL() gives more informative error messages in case of
failure which is important when running tests unattended on build slaves.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68843 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-22 12:41:12 +00:00
Vadim Zeitlin
36a96421b3 Replace wxComboBox::IsEmpty() with Is{List,Text}Empty().
IsEmpty() didn't exist in all ports (notably not wxMSW) and its meaning was
unclear anyhow, so remove it even from the ports where it did exist and add
clear Is{List,Text}Empty() replacements instead.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68808 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-21 12:06:16 +00:00
Steve Lamerton
e7aef23e7b Rename wxUSE_WEB to wxUSE_WEBVIEW to reflect that actually it specifically toggles the wxWebView class and associated features.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68788 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-19 09:15:06 +00:00
Steve Lamerton
94e0018723 Merge in from trunk r64802 - r68625
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68626 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-10 18:10:42 +00:00
Václav Slavík
cbef7338c1 Add some basic tests for wxDataViewCtrl selection handling.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68623 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-10 15:24:25 +00:00
Vadim Zeitlin
567e5e47ee Improve wxTextCtrl::GetNumberOfLines() unit test and documentation.
First, enable execution of the Lines() wxTextCtrl unit test case under wxOSX
as it passes since the fix in the previous commit.

Do add a test for GetNumberOfLines() that currently doesn't work in the same
way under all platforms -- but with this test we at least can be sure how does
it work exactly where.

Also mention the current discrepancy in this function behaviour in the
documentation.

See #12366.

Fix Lines() wxTextCtrl unit test to pass under wxGTK too.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68465 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-30 21:54:15 +00:00
Vadim Zeitlin
6ce832135e Add wxTextCtrl::PositionToCoords() functions for wxMSW and wxGTK.
The new method allows to find the coordinates in pixels of the given character
in a text control.

Closes #13221.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68450 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-29 15:11:54 +00:00
Steve Lamerton
906c935a80 Merge in from trunk r67662 to r64801
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68402 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-25 16:54:53 +00:00
Steve Lamerton
c9ccc09c64 Add RunScript and implement on all backends. Document and add a very simple unit test.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68275 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-15 12:38:47 +00:00
Steve Lamerton
41933aa5a0 Add ClearSelection for msw ie and gtk webkit, with a stub for osx webkit. Document and add to unit tests.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68274 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-15 09:36:08 +00:00
Steve Lamerton
0609769d3b Fix all the unit tests for gtk, they now all pass on msw with the ie backend and gtk with the webkit backend.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68271 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-14 19:31:21 +00:00
Steve Lamerton
18cf6bb5b4 Add unit tests for zoom functions
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68270 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-14 14:02:14 +00:00
Steve Lamerton
d563e28f82 Yield after control creation to allow it to load the initial page.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68269 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-14 13:33:20 +00:00
Steve Lamerton
526292e713 Update web units tests so that they compile after api change.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68268 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-14 13:19:53 +00:00