Mercurial > hg > nginx-tests
diff h2.t @ 1182:83c88a830a45
Tests: added HTTP/2 SETTINGS test with multiple parameters.
The test ensures that all parameters are applied before emitting new frames.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Tue, 06 Jun 2017 14:55:26 +0300 |
parents | ec9ddfed9b63 |
children | 878696cb8510 |
line wrap: on
line diff
--- a/h2.t Tue Jun 06 14:40:46 2017 +0300 +++ b/h2.t Tue Jun 06 14:55:26 2017 +0300 @@ -26,7 +26,7 @@ select STDOUT; $| = 1; my $t = Test::Nginx->new()->has(qw/http http_v2 proxy rewrite charset gzip/) - ->plan(140); + ->plan(141); $t->write_file_expand('nginx.conf', <<'EOF'); @@ -835,6 +835,28 @@ @data = grep { $_->{type} eq "DATA" } @$frames; is($data[0]->{length}, 2**15, 'max frame size - custom'); +# SETTINGS_INITIAL_WINDOW_SIZE + SETTINGS_MAX_FRAME_SIZE +# Expanding available stream window should not result in emitting +# new frames before remaining SETTINGS parameters were applied. + +TODO: { +local $TODO = 'not yet' unless $t->has_version('1.13.2'); + +$s = Test::Nginx::HTTP2->new(); +$s->h2_window(2**17); +$s->h2_settings(0, 0x4 => 42); + +$sid = $s->new_stream({ path => '/frame_size' }); + +$s->h2_settings(0, 0x4 => 2**17, 0x5 => 2**15); + +$frames = $s->read(all => [{ sid => $sid, fin => 1 }]); +@data = grep { $_->{type} eq "DATA" } @$frames; +$lengths = join ' ', map { $_->{length} } @data; +is($lengths, '42 32768 32768 38', 'multiple SETTINGS'); + +} + # stream multiplexing + WINDOW_UPDATE $s = Test::Nginx::HTTP2->new();