aboutsummaryrefslogtreecommitdiffstats
path: root/lib/observer/test
diff options
context:
space:
mode:
authorvisciang <[email protected]>2017-01-26 11:18:12 +0100
committerSiri Hansen <[email protected]>2017-01-26 11:18:12 +0100
commit15dd52f771314b6eade47314afcd8b3206c694b1 (patch)
tree1f3a9fd6dc693de52f30e968d56748880399aedd /lib/observer/test
parentcd4a95b0abb45f07eef8a77991c2be8f5dea575e (diff)
downloadotp-15dd52f771314b6eade47314afcd8b3206c694b1.tar.gz
otp-15dd52f771314b6eade47314afcd8b3206c694b1.tar.bz2
otp-15dd52f771314b6eade47314afcd8b3206c694b1.zip
Fix observer application crash (#1296)
Fix observer application crash When clicking an HTML-link to a port before the port tab has been opened for the first time, observer would crash since port info is not initiated. This is now corrected. Also, when clicking on an HTML link to a port, and the port does not exist, then pop up an info dialog saying "No such port". OTP-14151
Diffstat (limited to 'lib/observer/test')
-rw-r--r--lib/observer/test/observer_SUITE.erl17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/observer/test/observer_SUITE.erl b/lib/observer/test/observer_SUITE.erl
index 4c882ad951..b5fb027878 100644
--- a/lib/observer/test/observer_SUITE.erl
+++ b/lib/observer/test/observer_SUITE.erl
@@ -34,7 +34,8 @@
%% Test cases
-export([app_file/1, appup_file/1,
- basic/1, process_win/1, table_win/1
+ basic/1, process_win/1, table_win/1,
+ port_win_when_tab_not_initiated/1
]).
%% Default timetrap timeout (set in init_per_testcase)
@@ -49,7 +50,8 @@ groups() ->
[{gui, [],
[basic,
process_win,
- table_win
+ table_win,
+ port_win_when_tab_not_initiated
]
}].
@@ -299,6 +301,17 @@ table_win(Config) when is_list(Config) ->
observer:stop(),
ok.
+%% Test PR-1296/OTP-14151
+%% Clicking a link to a port before the port tab has been activated the
+%% first time crashes observer.
+port_win_when_tab_not_initiated(Config) ->
+ {ok,Port} = gen_tcp:listen(0,[]),
+ ok = observer:start(),
+ Notebook = setup_whitebox_testing(),
+ observer ! {open_link,erlang:port_to_list(Port)},
+ timer:sleep(1000),
+ observer:stop(),
+ ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%