Commit Graph

30 Commits

Author SHA1 Message Date
Maarten Bent
7c1ab06ea5 Add more wxOVERRIDE 2018-09-22 14:44:07 +02:00
Maarten Bent
a914478f60 Add guards around test cases 2018-09-19 22:01:17 +02:00
Vadim Zeitlin
a59f5932df Add wxHtmlContainerCell::Detach()
This allows manipulating the HTML DOM from the outside, e.g. to detach
a header element in order to be able to repeat it on all pages.
2018-08-25 21:16:55 +02:00
Vadim Zeitlin
869fb4f2bc Remove CppUnit compatibility macros from wxHtmlParser test
There was just a single test there, so remove all CppUnit boilerplate
which accounted for more than 50% of the file before adding more tests.
2018-08-25 21:00:11 +02:00
Maarten Bent
57180d68c8 Add wxOVERRIDE to test files
And cleanup some tailing spaces and tabs.
2018-07-29 12:08:53 +02:00
Vadim Zeitlin
9e05eb42b5 Fix outdated comment in wxHtmlPrintout unit test
This should have been part of 321854b519
which changed the code, but not the accompanying comment.
2018-07-25 13:52:49 +02:00
Vadim Zeitlin
0338796847 Remove unnecessary headers from wxHtmlPrintout unit test
These headers were added by 905789485a
which was replaced with 321854b519 later
and are not needed any more.
2018-07-25 13:49:00 +02:00
Vadim Zeitlin
6acd663190 Revert "Add even more debug output to the test"
This reverts commit 1ce009e73a as AppVeyor
test failures problem is fixed now.
2018-07-25 13:47:13 +02:00
Vadim Zeitlin
542124aa95 Fix page-break-inside:avoid to work for nested tags too
The initial version was too naïve and didn't work correctly if the <div>
with this style had nested elements.
2018-07-25 02:23:02 +02:00
Vadim Zeitlin
321854b519 Try using fixed font size in pixels in the test 2018-07-22 00:54:05 +02:00
Vadim Zeitlin
1ce009e73a Add even more debug output to the test 2018-07-22 00:43:26 +02:00
Vadim Zeitlin
96cca10328 Use fixed font name in the HTML pagination test 2018-07-22 00:43:26 +02:00
Vadim Zeitlin
905789485a Fix the just added pagination test for high DPI systems
Adjust the font size used by a DPI-dependent factor to ensure that the
text takes the same amount of pixels independently of DPI.
2018-07-22 00:43:25 +02:00
Vadim Zeitlin
566e401a3f Add support for style="page-break-inside:avoid" to wxHTML
Allow using this style to prevent page breaks inside the given <div>.
2018-07-22 00:43:25 +02:00
Vadim Zeitlin
b55578e40c Fix HTML pagination test for high DPI values
The standard margins, expressed in millimeters, could result in the
usable page space being much smaller than 1000px used for the DC size
when using higher DPIs, which means that the test checking that a 2400px
image took only 3 pages could fail, as it could require 4 of them in
this case.

Fix this by getting rid of the margins, as this should ensure that the
page height is exactly 1000px now, independently of the actual DPI.
2018-05-27 22:43:28 +02:00
Vadim Zeitlin
8dffab0556 Add another page-break-before test to pagination unit test
Check that the nested elements with this style are handled as expected.
2018-05-27 22:28:33 +02:00
Vadim Zeitlin
b0ae6681be Add a test of explicit page breaks in wxHtmlPrintout too
Check that using the style forcing a page break does work.
2018-05-24 17:53:26 +02:00
Vadim Zeitlin
dd92a269c3 Add a simple unit test for wxHtmlPrintout pagination logic
Verify that the number of pages to be printed is as expected.
2018-05-23 18:14:07 +02:00
Vadim Zeitlin
8686ca62e7 Avoid asserts when destroying windows with mouse capture in tests
Destroying a window with mouse capture results in an assert, which is
translated into an exception when running the test suite. As this exception is
thrown from wxWindowBase dtor, it results in an immediate program termination
when using C++11 and can also have the same effect even when using C++98 if
this exception is thrown while already handling another exception due to a
test failure.

Try to avoid this by using a "safe" DeleteTestWindow() function instead of
deleting the window directly. Currently this function ensures that the window
doesn't have mouse capture before deleting it, but it could also be used to
check for other things later. Also, this commit only uses this function for
the two controls which do happen to be destroyed with mouse capture currently
(at least when using wxGTK), but it should probably be generalized to all
controls in the future.
2016-06-29 18:26:11 +02:00
Vadim Zeitlin
ea489e1a7d Fix assertion in the HtmlParser unit test case
Use wxHtmlWinParser instead of wxHtmlParser which can't be actually used
without being initialized with the tag handlers (it's not clear whether this
is really intentional...).
2016-02-27 01:14:14 +01:00
Dimitri Schoolwerth
8f8d58d193 Use wx-prefixed macros throughout the repository.
Change {DECLARE,IMPLEMENT}_*CLASS and {DECLARE,BEGIN,END}_EVENT_TABLE
occurrences to use the wx-prefixed version of the macros.
2015-04-23 22:00:35 +04:00
Vadim Zeitlin
31f0808ee2 reenable this tests under wxUniv/x11 port. EventPropagationTestCase::MenuEvent cause the problem, not these. MenuEvent will be fixed later
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77825 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:42:29 +00:00
Vadim Zeitlin
4363f9b578 These test will cause test_gui segmentation fault, disable for now.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77785 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:40:15 +00:00
Vadim Zeitlin
3f66f6a5b3 Remove all lines containing cvs/svn "$Id$" keyword.
This keyword is not expanded by Git which means it's not replaced with the
correct revision value in the releases made using git-based scripts and it's
confusing to have lines with unexpanded "$Id$" in the released files. As
expanding them with Git is not that simple (it could be done with git archive
and export-subst attribute) and there are not many benefits in having them in
the first place, just remove all these lines.

If nothing else, this will make an eventual transition to Git simpler.

Closes #14487.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-26 16:02:46 +00:00
Vadim Zeitlin
ce7fe42e84 Provide shorter synonyms for wxEVT_XXX constants.
Use the same short names as are used by the event table macros for the event
type constants themselves. This makes them much more comfortable to use, e.g.
Bind(wxEVT_BUTTON) compared to Bind(wxEVT_COMMAND_BUTTON_CLICKED).

The old long names are still kept for backwards compatibility and shouldn't be
removed as it doesn't really cost anything to continue providing them, but all
new event types should only use the short versions.

Closes #10661.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73850 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-04-25 10:11:03 +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
Dimitri Schoolwerth
e3778b4d9c No code changes, fixed some typos.
Changed several occurrences of "it's" where "its" is meant, as well as a few other minor typos.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67656 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-04-30 10:57:04 +00:00
Vadim Zeitlin
3625820490 Fixes for parsing invalid HTML without tag ends.
The code in wxHtmlParser supposed in many places that a '<' character must be
always followed by a '>' one and could create (and sometimes dereference)
invalid iterators if this wasn't the case resulting in asserts from MSVC debug
CRT and possibly crashes.

Fix this by ensuring that only valid iterators are used and add a trivial unit
test for wxHtmlParser which checks that it can parse invalid HTML without
crashing.

Closes #12869.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66678 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-01-13 14:49:55 +00:00
Vadim Zeitlin
232fdc630c Merge the new GUI tests from SOC2010_GUI_TEST branch.
Add a lot of tests for many wx GUI classes.

Add tests using the new wxUIActionSimulator class but disable them under OS X
as too many of them currently fail there.

Refactor the test suite to make organizing the existing tests and adding the
new ones easier.

Improve documentation using the information gathered while testing the
classes. Also update the documentation of the testing system itself.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65386 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-08-22 22:16:05 +00:00
Václav Slavík
c39058f631 added a test to check if wxHtmlWindow::SelectionToText() inserts \n characters correctly
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56335 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-10-15 15:55:25 +00:00