Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Unified Diff: pkg/analysis_server/test/mocks.dart

Issue 1966453002: More strong mode clean-up in server (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/mocks.dart
diff --git a/pkg/analysis_server/test/mocks.dart b/pkg/analysis_server/test/mocks.dart
index 4547bcc21cdce4c03c9f2bc12fc236272d3b9c51..2dddbf9e11814744bc5e48ff579612595fc0f607 100644
--- a/pkg/analysis_server/test/mocks.dart
+++ b/pkg/analysis_server/test/mocks.dart
@@ -252,9 +252,8 @@ class MockServerChannel implements ServerCommunicationChannel {
pumpEventQueue().then((_) {
responseController.addError(new NoResponseException(request));
});
- return responseController.stream.firstWhere((response) {
- return response.id == id;
- });
+ return new Future<Response>(() =>
+ responseController.stream.firstWhere((response) => response.id == id));
}
}
@@ -297,7 +296,7 @@ class MockSocket<T> implements WebSocket {
return socket1;
}
- void add(T text) => controller.add(text);
+ void add(dynamic text) => controller.add(text as T);
void allowMultipleListeners() {
stream = stream.asBroadcastStream();
@@ -306,14 +305,14 @@ class MockSocket<T> implements WebSocket {
Future close([int code, String reason]) =>
controller.close().then((_) => twin.controller.close());
- StreamSubscription<T> listen(void onData(T event),
+ StreamSubscription<T> listen(void onData(dynamic event),
{Function onError, void onDone(), bool cancelOnError}) =>
- stream.listen(onData,
+ stream.listen((T data) => onData(data),
onError: onError, onDone: onDone, cancelOnError: cancelOnError);
noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
- Stream<T> where(bool test(T t)) => stream.where(test);
+ Stream<T> where(bool test(dynamic t)) => stream.where((T data) => test(data));
}
class MockSource extends StringTypedMock implements Source {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698