Unverified Commit 883d6ead authored by Todd Volkert's avatar Todd Volkert Committed by GitHub

More `HttpClientResponse implements Stream<Uint8List>` fixes (#35149)

https://github.com/dart-lang/sdk/issues/36900
parent 3ead8a40
......@@ -233,7 +233,7 @@ class MockHttpClientRequest implements io.HttpClientRequest {
}
}
class MockHttpClientResponse extends Stream<List<int>> implements io.HttpClientResponse {
class MockHttpClientResponse implements io.HttpClientResponse {
MockHttpClientResponse(this.statusCode);
@override
......@@ -253,6 +253,11 @@ class MockHttpClientResponse extends Stream<List<int>> implements io.HttpClientR
.listen(onData, onError: onError, onDone: onDone, cancelOnError: cancelOnError);
}
@override
Future<dynamic> forEach(void Function(Uint8List element) action) {
return Future<void>.error(const io.SocketException('test'));
}
@override
dynamic noSuchMethod(Invocation invocation) {
throw 'io.HttpClientResponse - $invocation';
......
......@@ -1286,7 +1286,7 @@ class MockHttpClientRequest implements HttpClientRequest {
}
}
class MockHttpClientResponse extends Stream<List<int>> implements HttpClientResponse {
class MockHttpClientResponse implements HttpClientResponse {
MockHttpClientResponse(this.statusCode, {this.result});
@override
......@@ -1313,6 +1313,12 @@ class MockHttpClientResponse extends Stream<List<int>> implements HttpClientResp
.listen(onData, onError: onError, onDone: onDone, cancelOnError: cancelOnError);
}
@override
Future<dynamic> forEach(void Function(Uint8List element) action) {
action(Uint8List.fromList(result.codeUnits));
return Future<void>.value();
}
@override
dynamic noSuchMethod(Invocation invocation) {
throw 'io.HttpClientResponse - $invocation';
......
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