aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2016-05-27 12:45:55 +0200
committerLoïc Hoguin <[email protected]>2016-05-27 12:45:55 +0200
commit23fc8e2a89058d2f96ff64c0bc0dff637662995c (patch)
treeaca36fc0958c6c0f2ddd975b8e18d6f18d42ddcc /test
parentd88f3675dba9e066ef339789d8c223358f744aac (diff)
downloadgun-23fc8e2a89058d2f96ff64c0bc0dff637662995c.tar.gz
gun-23fc8e2a89058d2f96ff64c0bc0dff637662995c.tar.bz2
gun-23fc8e2a89058d2f96ff64c0bc0dff637662995c.zip
Initial HTTP/2 support
A number of things are not implemented, but this is enough to connect to Twitter and get a response sent back. It also currently doesn't have tests.
Diffstat (limited to 'test')
-rw-r--r--test/twitter_SUITE.erl17
1 files changed, 15 insertions, 2 deletions
diff --git a/test/twitter_SUITE.erl b/test/twitter_SUITE.erl
index 86f9a85..6cd53c4 100644
--- a/test/twitter_SUITE.erl
+++ b/test/twitter_SUITE.erl
@@ -16,11 +16,24 @@
-compile(export_all).
all() ->
- [spdy].
+ [http, http2, spdy].
+
+http(_) ->
+ {ok, Pid} = gun:open("twitter.com", 443, #{protocols => [http]}),
+ {ok, http} = gun:await_up(Pid),
+ common(Pid).
+
+http2(_) ->
+ {ok, Pid} = gun:open("twitter.com", 443, #{protocols => [http2]}),
+ {ok, http2} = gun:await_up(Pid),
+ common(Pid).
spdy(_) ->
- {ok, Pid} = gun:open("twitter.com", 443),
+ {ok, Pid} = gun:open("twitter.com", 443, #{protocols => [spdy]}),
{ok, spdy} = gun:await_up(Pid),
+ common(Pid).
+
+common(Pid) ->
Ref = gun:get(Pid, "/"),
receive
{gun_response, Pid, Ref, nofin, Status, Headers} ->