Remove tool crash git.io link shortener (#99574)

This commit is contained in:
Jenn Magder
2022-03-08 17:00:06 -08:00
committed by GitHub
parent c8538873c8
commit dd97133df2
6 changed files with 4 additions and 97 deletions

View File

@@ -56,26 +56,6 @@ String _toMethodString(HttpMethod method) {
}
}
/// Override the creation of all [HttpClient] objects with a zone injection.
///
/// This should only be used when the http client cannot be set directly, such as
/// when testing `package:http` code.
Future<void> overrideHttpClients(Future<void> Function() callback, FakeHttpClient httpClient) async {
final HttpOverrides overrides = _FakeHttpClientOverrides(httpClient);
await HttpOverrides.runWithHttpOverrides(callback, overrides);
}
class _FakeHttpClientOverrides extends HttpOverrides {
_FakeHttpClientOverrides(this.httpClient);
final FakeHttpClient httpClient;
@override
HttpClient createHttpClient(SecurityContext? context) {
return httpClient;
}
}
/// Create a fake request that configures the [FakeHttpClient] to respond
/// with the provided [response].
///