comparison h2.t @ 721:4a1397cad0c0

Tests: removed HTTP/2 $server_protocol TODOs, fix committed.
author Sergey Kandaurov <pluknet@nginx.com>
date Mon, 28 Sep 2015 22:35:16 +0300
parents 3c09ccf97d80
children e09a6cda6764
comparison
equal deleted inserted replaced
720:3c09ccf97d80 721:4a1397cad0c0
685 685
686 } 686 }
687 687
688 # $server_protocol 688 # $server_protocol
689 689
690 TODO: {
691 local $TODO = 'not yet';
692
693 $sess = new_session(); 690 $sess = new_session();
694 $sid = new_stream($sess, { path => '/sp' }); 691 $sid = new_stream($sess, { path => '/sp' });
695 $frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]); 692 $frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]);
696 693
697 ($frame) = grep { $_->{type} eq "DATA" } @$frames; 694 ($frame) = grep { $_->{type} eq "DATA" } @$frames;
698 is($frame->{data}, 'HTTP/2.0', 'server_protocol variable'); 695 is($frame->{data}, 'HTTP/2.0', 'server_protocol variable');
699
700 }
701 696
702 # $server_protocol - SSL/TLS connection, NPN 697 # $server_protocol - SSL/TLS connection, NPN
703 698
704 SKIP: { 699 SKIP: {
705 eval { IO::Socket::SSL->can_npn() or die; }; 700 eval { IO::Socket::SSL->can_npn() or die; };
706 skip 'OpenSSL NPN support required', 1 if $@; 701 skip 'OpenSSL NPN support required', 1 if $@;
707 702
708 TODO: {
709 local $TODO = 'not yet';
710
711 $sess = new_session(8084, SSL => 1, npn => 'h2'); 703 $sess = new_session(8084, SSL => 1, npn => 'h2');
712 $sid = new_stream($sess, { path => '/sp' }); 704 $sid = new_stream($sess, { path => '/sp' });
713 $frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]); 705 $frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]);
714 706
715 ($frame) = grep { $_->{type} eq "DATA" } @$frames; 707 ($frame) = grep { $_->{type} eq "DATA" } @$frames;
716 is($frame->{data}, 'HTTP/2.0', 'server_protocol variable - npn'); 708 is($frame->{data}, 'HTTP/2.0', 'server_protocol variable - npn');
717
718 }
719 709
720 } 710 }
721 711
722 # $server_protocol - SSL/TLS connection, ALPN 712 # $server_protocol - SSL/TLS connection, ALPN
723 713
724 SKIP: { 714 SKIP: {
725 eval { IO::Socket::SSL->can_alpn() or die; }; 715 eval { IO::Socket::SSL->can_alpn() or die; };
726 skip 'OpenSSL ALPN support required', 1 if $@; 716 skip 'OpenSSL ALPN support required', 1 if $@;
727 717
728 TODO: {
729 local $TODO = 'not yet';
730
731 $sess = new_session(8084, SSL => 1, alpn => 'h2'); 718 $sess = new_session(8084, SSL => 1, alpn => 'h2');
732 $sid = new_stream($sess, { path => '/sp' }); 719 $sid = new_stream($sess, { path => '/sp' });
733 $frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]); 720 $frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]);
734 721
735 ($frame) = grep { $_->{type} eq "DATA" } @$frames; 722 ($frame) = grep { $_->{type} eq "DATA" } @$frames;
736 is($frame->{data}, 'HTTP/2.0', 'server_protocol variable - alpn'); 723 is($frame->{data}, 'HTTP/2.0', 'server_protocol variable - alpn');
737
738 }
739 724
740 } 725 }
741 726
742 # $scheme 727 # $scheme
743 728