Add connection window overflow test (#72)
This commit is contained in:
		
				
					committed by
					
						 Carl Lerche
						Carl Lerche
					
				
			
			
				
	
			
			
			
						parent
						
							5c0efcf8c4
						
					
				
				
					commit
					460afa41c8
				
			| @@ -34,6 +34,12 @@ pub fn window_update<T>(id: T, sz: u32) -> frame::WindowUpdate | ||||
|     frame::WindowUpdate::new(id.into(), sz) | ||||
| } | ||||
|  | ||||
| pub fn go_away<T>(id: T) -> MockGoAway | ||||
|     where T: Into<StreamId>, | ||||
| { | ||||
|     MockGoAway(frame::GoAway::new(id.into(), frame::Reason::NoError)) | ||||
| } | ||||
|  | ||||
| // Headers helpers | ||||
|  | ||||
| pub struct MockHeaders(frame::Headers); | ||||
| @@ -139,6 +145,35 @@ impl From<MockData> for SendFrame { | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| // GoAway helpers | ||||
|  | ||||
| pub struct MockGoAway(frame::GoAway); | ||||
|  | ||||
| impl MockGoAway { | ||||
|     pub fn flow_control(self) -> Self { | ||||
|         MockGoAway(frame::GoAway::new(self.0.last_stream_id(), frame::Reason::FlowControlError)) | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl fmt::Debug for MockGoAway { | ||||
|     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | ||||
|         fmt::Debug::fmt(&self.0, f) | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl From<MockGoAway> for Frame { | ||||
|     fn from(src: MockGoAway) -> Self { | ||||
|         Frame::GoAway(src.0) | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl From<MockGoAway> for SendFrame { | ||||
|     fn from(src: MockGoAway) -> Self { | ||||
|         Frame::GoAway(src.0) | ||||
|     } | ||||
| } | ||||
|  | ||||
| // ==== "trait alias" for types that are HttpTryFrom and have Debug Errors ==== | ||||
|  | ||||
| pub trait HttpTryInto<T> { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user