Unverified Commit e6b9b5ef authored by Jason Simmons's avatar Jason Simmons Committed by GitHub

Add a compressionState value to HttpResponse mocks (#66679)

The Dart SDK now requires non-null enum values if the enum is used in an
exhaustive switch statement on a non-nullable type.

See https://github.com/flutter/flutter/issues/66674
parent 3e8fb33c
......@@ -19,6 +19,7 @@ MockHttpClient createMockImageHttpClient(SecurityContext _) {
when(request.close()).thenAnswer((_) => Future<HttpClientResponse>.value(response));
when(response.contentLength).thenReturn(kTransparentImage.length);
when(response.statusCode).thenReturn(HttpStatus.ok);
when(response.compressionState).thenReturn(HttpClientResponseCompressionState.notCompressed);
when(response.listen(any)).thenAnswer((Invocation invocation) {
final void Function(List<int>) onData = invocation.positionalArguments[0] as void Function(List<int>);
final void Function() onDone = invocation.namedArguments[#onDone] as void Function();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment