mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-25 17:15:45 +08:00
Fix intermittent wxTextCtrl URL test on MSW
Rich edit can generate more than one wxEVT_TEXT_URL for a simulated mouse click, as URL events are emitted for mouse messages over the URL. Check that at least one URL event is received instead of requiring exactly one. Use Catch assertions for the simulator calls and make the test explicitly create a multiline control so the Url section can run on its own.
This commit is contained in:
@@ -663,14 +663,14 @@ void TextCtrlTestCase::Url()
|
||||
m_text->AppendText("http://www.wxwidgets.org");
|
||||
|
||||
wxUIActionSimulator sim;
|
||||
sim.MouseMove(m_text->ClientToScreen(wxPoint(5, 5)));
|
||||
REQUIRE(sim.MouseMove(m_text->ClientToScreen(wxPoint(5, 5))));
|
||||
|
||||
EventCounter url(m_text.get(), wxEVT_TEXT_URL);
|
||||
|
||||
sim.MouseClick();
|
||||
REQUIRE(sim.MouseClick());
|
||||
wxYield();
|
||||
|
||||
CHECK(url.GetCount() == 1);
|
||||
CHECK(url.GetCount() >= 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user