From e6b9b5efb7433ba709ea697064dd646f8085fc58 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Fri, 25 Sep 2020 14:14:45 -0700 Subject: [PATCH] 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 --- dev/manual_tests/test/mock_image_http.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/manual_tests/test/mock_image_http.dart b/dev/manual_tests/test/mock_image_http.dart index 1a15b7a5f9e..7c5c4aa6c56 100644 --- a/dev/manual_tests/test/mock_image_http.dart +++ b/dev/manual_tests/test/mock_image_http.dart @@ -19,6 +19,7 @@ MockHttpClient createMockImageHttpClient(SecurityContext _) { when(request.close()).thenAnswer((_) => Future.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) onData = invocation.positionalArguments[0] as void Function(List); final void Function() onDone = invocation.namedArguments[#onDone] as void Function();