fn priority_update_request_collected_stopped() {
        let mut s = Session::default().unwrap();
        s.handshake().unwrap();

        s.send_frame_client(
            frame::Frame::PriorityUpdateRequest {
                prioritized_element_id: 0,
                priority_field_value: b"u=3".to_vec(),
            },
            s.client.control_stream_id.unwrap(),
            false,
        )
        .unwrap();

        let (stream, req) = s.send_request(false).unwrap();
        let ev_headers = Event::Headers {
            list: req,
            has_body: true,
        };

        // Priority event is generated before request headers.
        assert_eq!(s.poll_server(), Ok((0, Event::PriorityUpdate)));
        assert_eq!(s.poll_server(), Ok((stream, ev_headers)));
        assert_eq!(s.poll_server(), Err(Error::Done));

        assert_eq!(s.server.take_last_priority_update(0), Ok(b"u=3".to_vec()));
        assert_eq!(s.server.take_last_priority_update(0), Err(Error::Done));

        s.pipe
            .client
            .stream_shutdown(stream, crate::Shutdown::Write, 0x100)
            .unwrap();
        s.pipe
            .client
            .stream_shutdown(stream, crate::Shutdown::Read, 0x100)
            .unwrap();

        s.advance().ok();

        assert_eq!(s.poll_server(), Ok((0, Event::Reset(0x100))));
        assert_eq!(s.poll_server(), Err(Error::Done));

        // Now send a PRIORITY_UPDATE for the closed request stream.
        s.send_frame_client(
            frame::Frame::PriorityUpdateRequest {
                prioritized_element_id: 0,
                priority_field_value: b"u=3".to_vec(),
            },
            s.client.control_stream_id.unwrap(),
            false,
        )
        .unwrap();

        // No event generated at server
        assert_eq!(s.poll_server(), Err(Error::Done));
    }
/// Send a PRIORITY_UPDATE for a request stream, before and after the stream
/// has been stopped.
Send a PRIORITY_UPDATE for a request stream, before and after the stream
has been stopped.
Send a PRIORITY_UPDATE for a request stream before and after the stream has been stopped .
fn priority_update_request_collected_stopped() {
        let mut s = Session::default().unwrap();
        s.handshake().unwrap();
        s.send_frame_client(
            frame::Frame::PriorityUpdateRequest {
                prioritized_element_id: 0,
                priority_field_value: b"u=3".to_vec(),
            },
            s.client.control_stream_id.unwrap(),
            false,
        )
        .unwrap();
        let (stream, req) = s.send_request(false).unwrap();
        let ev_headers = Event::Headers {
            list: req,
            has_body: true,
        };
        // Priority event is generated before request headers.
        assert_eq!(s.poll_server(), Ok((0, Event::PriorityUpdate)));
        assert_eq!(s.poll_server(), Ok((stream, ev_headers)));
        assert_eq!(s.poll_server(), Err(Error::Done));
        assert_eq!(s.server.take_last_priority_update(0), Ok(b"u=3".to_vec()));
        assert_eq!(s.server.take_last_priority_update(0), Err(Error::Done));
        s.pipe
            .client
            .stream_shutdown(stream, crate::Shutdown::Write, 0x100)
            .unwrap();
        s.pipe
            .client
            .stream_shutdown(stream, crate::Shutdown::Read, 0x100)
            .unwrap();
        s.advance().ok();
        assert_eq!(s.poll_server(), Ok((0, Event::Reset(0x100))));
        assert_eq!(s.poll_server(), Err(Error::Done));
        // Now send a PRIORITY_UPDATE for the closed request stream.
        s.send_frame_client(
            frame::Frame::PriorityUpdateRequest {
                prioritized_element_id: 0,
                priority_field_value: b"u=3".to_vec(),
            },
            s.client.control_stream_id.unwrap(),
            false,
        )
        .unwrap();
        // No event generated at server
        assert_eq!(s.poll_server(), Err(Error::Done));
    }
fn priority_update_request_collected_stopped ( ) { let mut s = Session :: default ( ) . unwrap ( ) ; s . handshake ( ) . unwrap ( ) ; s . send_frame_client ( frame :: Frame :: PriorityUpdateRequest { prioritized_element_id : 0 , priority_field_value : b" " . to_vec ( ) , } , s . client . control_stream_id . unwrap ( ) , false , ) . unwrap ( ) ; let ( stream , req ) = s . send_request ( false ) . unwrap ( ) ; let ev_headers = Event :: Headers { list : req , has_body : true , } ; // Priority event is generated before request headers. assert_eq ! ( s poll_server ( ) Ok ( ( 0 Event PriorityUpdate ) ) ) ; assert_eq ! ( s poll_server ( ) Ok ( ( stream ev_headers ) ) ) ; assert_eq ! ( s poll_server ( ) Err ( Error Done ) ) ; assert_eq ! ( s server take_last_priority_update ( 0 ) Ok ( b" " to_vec ( ) ) ) ; assert_eq ! ( s server take_last_priority_update ( 0 ) Err ( Error Done ) ) ; s . pipe . client . stream_shutdown ( stream , crate :: Shutdown :: Write , 0x100 ) . unwrap ( ) ; s . pipe . client . stream_shutdown ( stream , crate :: Shutdown :: Read , 0x100 ) . unwrap ( ) ; s . advance ( ) . ok ( ) ; assert_eq ! ( s poll_server ( ) Ok ( ( 0 Event Reset ( 0x100 ) ) ) ) ; assert_eq ! ( s poll_server ( ) Err ( Error Done ) ) ; // Now send a PRIORITY_UPDATE for the closed request stream. s . send_frame_client ( frame :: Frame :: PriorityUpdateRequest { prioritized_element_id : 0 , priority_field_value : b" " . to_vec ( ) , } , s . client . control_stream_id . unwrap ( ) , false , ) . unwrap ( ) ; // No event generated at server assert_eq ! ( s poll_server ( ) Err ( Error Done ) ) ; }
Send a PRIORITY_UPDATE for a request stream, before and after the stream
has been stopped.
Send a PRIORITY_UPDATE for a request stream before and after the stream has been stopped .