aboutsummaryrefslogtreecommitdiffstats
path: root/test/twitter_SUITE.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-03-12 19:22:19 +0100
committerLoïc Hoguin <[email protected]>2015-03-12 19:22:19 +0100
commitc409897f508eedff8ecc6f0860c9379fcc11bf23 (patch)
treed5a651df4ef5e8f9c6c6bb77366defa53c686e20 /test/twitter_SUITE.erl
parentea2de24f18741fc89d7a1dd6a3a0a43f3ccb1fd4 (diff)
downloadgun-c409897f508eedff8ecc6f0860c9379fcc11bf23.tar.gz
gun-c409897f508eedff8ecc6f0860c9379fcc11bf23.tar.bz2
gun-c409897f508eedff8ecc6f0860c9379fcc11bf23.zip
Add initial Websocket support
All autobahntestsuite tests pass including the permessage-deflate compression tests. Some of the tests pass in a non-strict fashion. They are testing for protocol errors and expect events to happen in a particular order, which is not respected by Gun. Gun fails earlier than is expected due to concurrent processing of frames. The implementation when error occurs during handshake is probably a bit rough at this point. The documentation is also incomplete and/or wrong at this time, though this is the general state of the Gun documentation and will be resolved in a separate commit.
Diffstat (limited to 'test/twitter_SUITE.erl')
-rw-r--r--test/twitter_SUITE.erl34
1 files changed, 2 insertions, 32 deletions
diff --git a/test/twitter_SUITE.erl b/test/twitter_SUITE.erl
index 17086e6..a303440 100644
--- a/test/twitter_SUITE.erl
+++ b/test/twitter_SUITE.erl
@@ -13,42 +13,11 @@
%% OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-module(twitter_SUITE).
-
--include_lib("common_test/include/ct.hrl").
-
-%% ct.
--export([all/0]).
--export([init_per_suite/1]).
--export([end_per_suite/1]).
-
-%% Tests.
--export([spdy/1]).
-
-%% ct.
+-compile(export_all).
all() ->
[spdy].
-init_per_suite(Config) ->
- ok = application:start(ranch),
- ok = application:start(crypto),
- ok = application:start(cowlib),
- ok = application:start(asn1),
- ok = application:start(public_key),
- ok = application:start(ssl),
- ok = application:start(gun),
- Config.
-
-end_per_suite(_) ->
- ok = application:stop(gun),
- ok = application:stop(ssl),
- ok = application:stop(public_key),
- ok = application:stop(asn1),
- ok = application:stop(cowlib),
- ok = application:stop(crypto),
- ok = application:stop(ranch),
- ok.
-
spdy(_) ->
{ok, Pid} = gun:open("twitter.com", 443),
Ref = gun:get(Pid, "/"),
@@ -66,6 +35,7 @@ data_loop(Pid, Ref) ->
ct:print("data ~p", [Data]),
data_loop(Pid, Ref);
{gun_data, Pid, Ref, fin, Data} ->
+ gun:close(Pid),
ct:print("data ~p~nend", [Data])
after 5000 ->
error(timeout)