[flutter_tools] remove package HTTP and add pub.dev head check tests (#75871)

This commit is contained in:
Jonah Williams
2021-02-12 10:44:19 -08:00
committed by GitHub
parent af0ea8c3db
commit 980880e2b6
6 changed files with 125 additions and 31 deletions

View File

@@ -263,6 +263,12 @@ class FakeHttpClient implements HttpClient {
int _requestCount = 0;
_FakeHttpClientRequest _findRequest(HttpMethod method, Uri uri) {
// Ensure the fake client throws similar errors to the real client.
if (uri.host.isEmpty) {
throw ArgumentError('No host specified in URI $uri');
} else if (uri.scheme != 'http' && uri.scheme != 'https') {
throw ArgumentError("Unsupported scheme '${uri.scheme}' in URI $uri");
}
final String methodString = _toMethodString(method);
if (_any) {
return _FakeHttpClientRequest(