Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added another connection test
  • Loading branch information
kraih committed Sep 25, 2011
1 parent b51d9ed commit fdf1da6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion lib/Mojo/IOWatcher/EV.pm
Expand Up @@ -31,7 +31,6 @@ sub one_tick {
my ($self, $timeout) = @_;
my $w = EV::timer($timeout, 0, sub { EV::unloop(EV::BREAK_ONE) });
EV::loop;
undef $w;
}

sub recurring { shift->_timer(shift, 1, @_) }
Expand Down
8 changes: 5 additions & 3 deletions t/mojo/websocket.t
Expand Up @@ -12,7 +12,7 @@ use Test::More;
plan skip_all => 'Perl 5.10 required for this test!' unless $] >= 5.010;
plan skip_all => 'This test does not work on some older versions of FreeBSD!'
if $^O =~ /freebsd/;
plan tests => 41;
plan tests => 42;

# "I can't believe it! Reading and writing actually paid off!"
use IO::Socket::INET;
Expand Down Expand Up @@ -55,8 +55,9 @@ websocket '/' => sub {

# GET /something/else
get '/something/else' => sub {
my $self = shift;
my $timeout = Mojo::IOLoop->connection_timeout($self->tx->connection);
my $self = shift;
my $timeout =
Mojo::IOLoop->singleton->connection_timeout($self->tx->connection);
$self->render(text => "${timeout}failed!");
};

Expand Down Expand Up @@ -227,6 +228,7 @@ $loop->start;
ok $result =~ /^lalala(\d+)$/, 'right result';
ok $1 > 100, 'right timeout';
ok $local, 'local port';
is $loop->handle($tx->connection), $socket, 'right connection id';

# WebSocket /early_start (server directly sends a message)
my $flag2;
Expand Down

0 comments on commit fdf1da6

Please sign in to comment.