aboutsummaryrefslogtreecommitdiffstats
path: root/test/cowboy_test.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-01-22 10:50:39 +0100
committerLoïc Hoguin <[email protected]>2017-01-22 10:50:39 +0100
commit3e05ab8f82ac69da7c55d1b28284c32ea63186c4 (patch)
treecc13546e9579d572d7d926aeab73847a4fc56ca5 /test/cowboy_test.erl
parent3b91523a3c84a882dcc83f0591b919a939cb72c2 (diff)
downloadcowboy-3e05ab8f82ac69da7c55d1b28284c32ea63186c4.tar.gz
cowboy-3e05ab8f82ac69da7c55d1b28284c32ea63186c4.tar.bz2
cowboy-3e05ab8f82ac69da7c55d1b28284c32ea63186c4.zip
Add experimental cowboy_compress_h stream handler
Currently marked as experimental because it can't be tweaked (just enabled/disabled) and because it is not documented yet.
Diffstat (limited to 'test/cowboy_test.erl')
-rw-r--r--test/cowboy_test.erl51
1 files changed, 36 insertions, 15 deletions
diff --git a/test/cowboy_test.erl b/test/cowboy_test.erl
index bb74ad0..a219878 100644
--- a/test/cowboy_test.erl
+++ b/test/cowboy_test.erl
@@ -43,10 +43,11 @@ common_all() ->
{group, http},
{group, https},
{group, h2},
- {group, h2c}%,
-%% @todo
-% {group, http_compress},
-% {group, https_compress}
+ {group, h2c},
+ {group, http_compress},
+ {group, https_compress},
+ {group, h2_compress},
+ {group, h2c_compress}
].
common_groups(Tests) ->
@@ -54,31 +55,51 @@ common_groups(Tests) ->
{http, [parallel], Tests},
{https, [parallel], Tests},
{h2, [parallel], Tests},
- {h2c, [parallel], Tests}%,
-%% @todo
-% {http_compress, [parallel], Tests},
-% {https_compress, [parallel], Tests}
+ {h2c, [parallel], Tests},
+ {http_compress, [parallel], Tests},
+ {https_compress, [parallel], Tests},
+ {h2_compress, [parallel], Tests},
+ {h2c_compress, [parallel], Tests}
].
init_common_groups(Name = http, Config, Mod) ->
- init_http(Name, #{env => #{dispatch => Mod:init_dispatch(Config)}}, Config);
+ init_http(Name, #{
+ env => #{dispatch => Mod:init_dispatch(Config)}
+ }, Config);
init_common_groups(Name = https, Config, Mod) ->
- init_https(Name, #{env => #{dispatch => Mod:init_dispatch(Config)}}, Config);
+ init_https(Name, #{
+ env => #{dispatch => Mod:init_dispatch(Config)}
+ }, Config);
init_common_groups(Name = h2, Config, Mod) ->
- init_http2(Name, #{env => #{dispatch => Mod:init_dispatch(Config)}}, Config);
+ init_http2(Name, #{
+ env => #{dispatch => Mod:init_dispatch(Config)}
+ }, Config);
init_common_groups(Name = h2c, Config, Mod) ->
- Config1 = init_http(Name, #{env => #{dispatch => Mod:init_dispatch(Config)}}, Config),
+ Config1 = init_http(Name, #{
+ env => #{dispatch => Mod:init_dispatch(Config)}
+ }, Config),
lists:keyreplace(protocol, 1, Config1, {protocol, http2});
init_common_groups(Name = http_compress, Config, Mod) ->
init_http(Name, #{
env => #{dispatch => Mod:init_dispatch(Config)},
- compress => true
+ stream_handlers => [cowboy_compress_h, cowboy_stream_h]
}, Config);
init_common_groups(Name = https_compress, Config, Mod) ->
init_https(Name, #{
env => #{dispatch => Mod:init_dispatch(Config)},
- compress => true
- }, Config).
+ stream_handlers => [cowboy_compress_h, cowboy_stream_h]
+ }, Config);
+init_common_groups(Name = h2_compress, Config, Mod) ->
+ init_http2(Name, #{
+ env => #{dispatch => Mod:init_dispatch(Config)},
+ stream_handlers => [cowboy_compress_h, cowboy_stream_h]
+ }, Config);
+init_common_groups(Name = h2c_compress, Config, Mod) ->
+ Config1 = init_http(Name, #{
+ env => #{dispatch => Mod:init_dispatch(Config)},
+ stream_handlers => [cowboy_compress_h, cowboy_stream_h]
+ }, Config),
+ lists:keyreplace(protocol, 1, Config1, {protocol, http2}).
%% Support functions for testing using Gun.