aboutsummaryrefslogtreecommitdiffstats
path: root/test/ws_SUITE_data
diff options
context:
space:
mode:
Diffstat (limited to 'test/ws_SUITE_data')
-rw-r--r--test/ws_SUITE_data/ws_echo.erl8
-rw-r--r--test/ws_SUITE_data/ws_echo_timer.erl12
-rw-r--r--test/ws_SUITE_data/ws_max_frame_size.erl12
-rw-r--r--test/ws_SUITE_data/ws_send_many.erl6
-rw-r--r--test/ws_SUITE_data/ws_timeout_cancel.erl6
5 files changed, 20 insertions, 24 deletions
diff --git a/test/ws_SUITE_data/ws_echo.erl b/test/ws_SUITE_data/ws_echo.erl
index a94b4c0..efdc204 100644
--- a/test/ws_SUITE_data/ws_echo.erl
+++ b/test/ws_SUITE_data/ws_echo.erl
@@ -12,11 +12,11 @@ init(Req, _) ->
}}.
websocket_handle({text, Data}, State) ->
- {reply, {text, Data}, State};
+ {[{text, Data}], State};
websocket_handle({binary, Data}, State) ->
- {reply, {binary, Data}, State};
+ {[{binary, Data}], State};
websocket_handle(_Frame, State) ->
- {ok, State}.
+ {[], State}.
websocket_info(_Info, State) ->
- {ok, State}.
+ {[], State}.
diff --git a/test/ws_SUITE_data/ws_echo_timer.erl b/test/ws_SUITE_data/ws_echo_timer.erl
index 7f37229..8157af3 100644
--- a/test/ws_SUITE_data/ws_echo_timer.erl
+++ b/test/ws_SUITE_data/ws_echo_timer.erl
@@ -12,17 +12,17 @@ init(Req, _) ->
websocket_init(State) ->
erlang:start_timer(1000, self(), <<"websocket_init">>),
- {ok, State}.
+ {[], State}.
websocket_handle({text, Data}, State) ->
- {reply, {text, Data}, State};
+ {[{text, Data}], State};
websocket_handle({binary, Data}, State) ->
- {reply, {binary, Data}, State};
+ {[{binary, Data}], State};
websocket_handle(_Frame, State) ->
- {ok, State}.
+ {[], State}.
websocket_info({timeout, _Ref, Msg}, State) ->
erlang:start_timer(1000, self(), <<"websocket_handle">>),
- {reply, {text, Msg}, State};
+ {[{text, Msg}], State};
websocket_info(_Info, State) ->
- {ok, State}.
+ {[], State}.
diff --git a/test/ws_SUITE_data/ws_max_frame_size.erl b/test/ws_SUITE_data/ws_max_frame_size.erl
index 2d34218..3d81497 100644
--- a/test/ws_SUITE_data/ws_max_frame_size.erl
+++ b/test/ws_SUITE_data/ws_max_frame_size.erl
@@ -1,22 +1,18 @@
-module(ws_max_frame_size).
-export([init/2]).
--export([websocket_init/1]).
-export([websocket_handle/2]).
-export([websocket_info/2]).
init(Req, State) ->
{cowboy_websocket, Req, State, #{max_frame_size => 8}}.
-websocket_init(State) ->
- {ok, State}.
-
websocket_handle({text, Data}, State) ->
- {reply, {text, Data}, State};
+ {[{text, Data}], State};
websocket_handle({binary, Data}, State) ->
- {reply, {binary, Data}, State};
+ {[{binary, Data}], State};
websocket_handle(_Frame, State) ->
- {ok, State}.
+ {[], State}.
websocket_info(_Info, State) ->
- {ok, State}.
+ {[], State}.
diff --git a/test/ws_SUITE_data/ws_send_many.erl b/test/ws_SUITE_data/ws_send_many.erl
index d621a3d..2f6437f 100644
--- a/test/ws_SUITE_data/ws_send_many.erl
+++ b/test/ws_SUITE_data/ws_send_many.erl
@@ -12,10 +12,10 @@ init(Req, Opts) ->
websocket_init(State) ->
erlang:send_after(10, self(), send_many),
- {ok, State}.
+ {[], State}.
websocket_handle(_Frame, State) ->
- {ok, State}.
+ {[], State}.
websocket_info(send_many, State = [{sequence, Sequence}]) ->
- {reply, Sequence, State}.
+ {Sequence, State}.
diff --git a/test/ws_SUITE_data/ws_timeout_cancel.erl b/test/ws_SUITE_data/ws_timeout_cancel.erl
index 587f2c5..481d5e6 100644
--- a/test/ws_SUITE_data/ws_timeout_cancel.erl
+++ b/test/ws_SUITE_data/ws_timeout_cancel.erl
@@ -13,10 +13,10 @@ init(Req, _) ->
}}.
websocket_handle({text, Data}, State) ->
- {reply, {text, Data}, State};
+ {[{text, Data}], State};
websocket_handle({binary, Data}, State) ->
- {reply, {binary, Data}, State}.
+ {[{binary, Data}], State}.
websocket_info(_Info, State) ->
erlang:start_timer(500, self(), should_not_cancel_timer),
- {ok, State}.
+ {[], State}.