aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/test/wx_event_SUITE.erl
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2014-01-21 15:57:57 +0100
committerDan Gudmundsson <[email protected]>2014-01-21 15:57:57 +0100
commit31172443bfc849b879385d7ee0d2ea8019c32307 (patch)
treea66e29fe08d3bccc85a9b1a4cefdbb0f2edfceed /lib/wx/test/wx_event_SUITE.erl
parent744984833cc1a51f51781e3417db7f152eeab4ae (diff)
parent51e369a1b90490e69a358d8c8f0bb9bfbf9f511c (diff)
downloadotp-31172443bfc849b879385d7ee0d2ea8019c32307.tar.gz
otp-31172443bfc849b879385d7ee0d2ea8019c32307.tar.bz2
otp-31172443bfc849b879385d7ee0d2ea8019c32307.zip
Merge branch 'dgud/wx/more-fixes/OTP-11444' into maint
* dgud/wx/more-fixes/OTP-11444: wx: Fix hanging wx calls Update wx build instsructions for Darwin wx: Remove compiler option -fomit-frame-pointer on Darwin wx: Fix crash when garbage collect event handlers (debugger caused seg fault) wx: Fix LDFLAGS for Mac
Diffstat (limited to 'lib/wx/test/wx_event_SUITE.erl')
-rw-r--r--lib/wx/test/wx_event_SUITE.erl33
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/wx/test/wx_event_SUITE.erl b/lib/wx/test/wx_event_SUITE.erl
index 6a9f19ad51..bbb5294d08 100644
--- a/lib/wx/test/wx_event_SUITE.erl
+++ b/lib/wx/test/wx_event_SUITE.erl
@@ -484,6 +484,7 @@ callback_clean(Config) ->
%% timer:sleep(infinity),
%% ok.
+
white_box_check_event_handlers() ->
{_,_,Server,_} = wx:get_env(),
{status, _, _, [Env, _, _, _, Data]} = sys:get_status(Server),
@@ -495,3 +496,35 @@ white_box_check_event_handlers() ->
gb_trees:to_list(CBs),
[Funs || Funs = {Id, {Fun,_}} <- Env, is_integer(Id), is_function(Fun)]
}.
+
+handler_clean(TestInfo) when is_atom(TestInfo) ->
+ wx_test_lib:tc_info(TestInfo);
+handler_clean(_Config) ->
+ wx:new(),
+ Init = fun() -> create_window() end,
+ Frame1 = wx_obj_test:start([{init, Init}]),
+ ?mt(wxFrame, Frame1),
+ wxWindow:show(Frame1),
+ ?m([_|_], lists:sort(wx_test_lib:flush())),
+ ?m({stop,_}, wx_obj_test:stop(Frame1, fun(_) -> normal end)),
+ ?m([{terminate,normal}], lists:sort(wx_test_lib:flush())),
+
+ Frame2 = wx_obj_test:start([{init, Init}]),
+ wxWindow:show(Frame2),
+ ?m([_|_], lists:sort(wx_test_lib:flush())),
+ ?m({stop,_}, wx_obj_test:stop(Frame2, fun(_) -> wxWindow:destroy(Frame2), normal end)),
+ ?m([{terminate,normal}], lists:sort(wx_test_lib:flush())),
+ timer:sleep(104),
+ ?m({[],[],[]}, white_box_check_event_handlers()),
+ ?m(ok, wx:destroy()),
+ ok.
+
+create_window() ->
+ Frame = wxFrame:new(wx:null(), ?wxID_ANY, "Test wx_object", [{size, {500, 400}}]),
+ Sz = wxBoxSizer:new(?wxHORIZONTAL),
+ Panel = wxPanel:new(Frame),
+ wxSizer:add(Sz, Panel, [{flag, ?wxEXPAND}, {proportion, 1}]),
+ wxWindow:connect(Frame, show),
+ %% wxPanel:connect(Panel, paint, [callback, {userData, foobar}]),
+ wxWindow:connect(Panel, size, [callback]),
+ {Frame, {Frame, Panel}}.