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

Unified Diff: runtime/observatory/tests/observatory_ui/mocks/repositories/event.dart

Issue 2980733003: Introduced support for external services registration in the ServiceProtocol (Closed)
Patch Set: Address comments Created 3 years, 5 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
Index: runtime/observatory/tests/observatory_ui/mocks/repositories/event.dart
diff --git a/runtime/observatory/tests/observatory_ui/mocks/repositories/event.dart b/runtime/observatory/tests/observatory_ui/mocks/repositories/event.dart
index 6ea310b899fc70510c490d77cef93a228ea7c9b5..2bbdb4b473415b168cb9a95ee75e1e926367f064 100644
--- a/runtime/observatory/tests/observatory_ui/mocks/repositories/event.dart
+++ b/runtime/observatory/tests/observatory_ui/mocks/repositories/event.dart
@@ -122,6 +122,20 @@ class EventRepositoryMock implements M.EventRepository {
get onConnectionClosed => _onConnectionClosed.stream;
get onConnectionClosedHasListener => _onConnectionClosed.hasListener;
+ final _onServiceEvent = new StreamController<M.ServiceEvent>.broadcast();
+ get onServiceEvent => _onServiceEvent.stream;
+ get onServiceEventHasListener => _onServiceEvent.hasListener;
+
+ final _onServiceRegistered =
+ new StreamController<M.ServiceRegisteredEvent>.broadcast();
+ get onServiceRegistered => _onServiceRegistered.stream;
+ get onServiceRegisteredHasListener => _onServiceRegistered.hasListener;
+
+ final _onServiceUnregistered =
+ new StreamController<M.ServiceUnregisteredEvent>.broadcast();
+ get onServiceUnregistered => _onServiceUnregistered.stream;
+ get onServiceUnregisteredHasListener => _onServiceUnregistered.hasListener;
+
void add(M.Event event) {
_onEvent.add(event);
if (event is M.VMEvent) {
@@ -171,6 +185,13 @@ class EventRepositoryMock implements M.EventRepository {
_onExtensionEvent.add(event);
} else if (event is M.TimelineEventsEvent) {
_onTimelineEvents.add(event);
+ } else if (event is M.ServiceEvent) {
+ _onServiceEvent.add(event);
+ if (event is M.ServiceRegisteredEvent) {
+ _onServiceRegistered.add(event);
+ } else if (event is M.ServiceUnregisteredEvent) {
+ _onServiceUnregistered.add(event);
+ }
}
}
}
« no previous file with comments | « runtime/observatory/observatory_sources.gypi ('k') | runtime/observatory/tests/service/auth_token1_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698