anchor.diff:    }, skip: isBrowser); // Browser loads images through <img> not Http.
   
     test('NetworkImage is evicted from cache on SocketException', () async {
  -    final _MockHttpClient mockHttpClient = _MockHttpClient();
  -    when(mockHttpClient.getUrl(any)).thenAnswer((_) => throw const SocketException('test exception'));
  +    final _FakeHttpClient mockHttpClient = _FakeHttpClient();
  +    mockHttpClient.thrownError = const SocketException('test exception');
       debugNetworkImageHttpClientProvider = () => mockHttpClient;
  -
   
       final ImageProvider imageProvider = NetworkImage(nonconst('testing.url'));
       expect(imageCache.pendingImageCount, 0);
  
positive.code: 
      expect(completer.debugLabel, url);
    });
  
  }
  
  class _MockHttpClient extends Mock implements HttpClient {}
  class _MockHttpClientRequest extends Mock implements HttpClientRequest {}
  class _MockHttpClientResponse extends Mock implements HttpClientResponse {}
  
  class FakeCodec implements Codec {
    @override
  
negative.code: 
      await loadNetworkImage();
      expect(capturedErrors, <dynamic>['client1']);
      final _FakeHttpClient client2 = _FakeHttpClient();
      client2.thrownError = 'client2';
      debugNetworkImageHttpClientProvider = () => client2;
      await loadNetworkImage();
      expect(capturedErrors, <dynamic>['client1', 'client2']);
    }, skip: isBrowser); // Browser implementation does not use HTTP client but an <img> tag.
  
    test('Propagates http client errors during resolve()', () async {
      httpClient.thrownError = Error();
      bool uncaught = false;
  
      final FlutterExceptionHandler oldError = FlutterError.onError;
  