OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of mocks; | 5 part of mocks; |
6 | 6 |
7 class EventRepositoryMock implements M.EventRepository { | 7 class EventRepositoryMock implements M.EventRepository { |
8 final _onEvent = new StreamController<M.Event>.broadcast(); | 8 final _onEvent = new StreamController<M.Event>.broadcast(); |
9 get onEvent => _onEvent.stream; | 9 get onEvent => _onEvent.stream; |
10 get onEventHasListener => _onEvent.hasListener; | 10 get onEventHasListener => _onEvent.hasListener; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 final _onTimelineEvents = | 115 final _onTimelineEvents = |
116 new StreamController<M.TimelineEventsEvent>.broadcast(); | 116 new StreamController<M.TimelineEventsEvent>.broadcast(); |
117 get onTimelineEvents => _onTimelineEvents.stream; | 117 get onTimelineEvents => _onTimelineEvents.stream; |
118 get onTimelineEventsEventHasListener => _onTimelineEvents.hasListener; | 118 get onTimelineEventsEventHasListener => _onTimelineEvents.hasListener; |
119 | 119 |
120 final _onConnectionClosed = | 120 final _onConnectionClosed = |
121 new StreamController<M.ConnectionClosedEvent>.broadcast(); | 121 new StreamController<M.ConnectionClosedEvent>.broadcast(); |
122 get onConnectionClosed => _onConnectionClosed.stream; | 122 get onConnectionClosed => _onConnectionClosed.stream; |
123 get onConnectionClosedHasListener => _onConnectionClosed.hasListener; | 123 get onConnectionClosedHasListener => _onConnectionClosed.hasListener; |
124 | 124 |
| 125 final _onServiceEvent = new StreamController<M.ServiceEvent>.broadcast(); |
| 126 get onServiceEvent => _onServiceEvent.stream; |
| 127 get onServiceEventHasListener => _onServiceEvent.hasListener; |
| 128 |
| 129 final _onServiceRegistered = |
| 130 new StreamController<M.ServiceRegisteredEvent>.broadcast(); |
| 131 get onServiceRegistered => _onServiceRegistered.stream; |
| 132 get onServiceRegisteredHasListener => _onServiceRegistered.hasListener; |
| 133 |
| 134 final _onServiceUnregistered = |
| 135 new StreamController<M.ServiceUnregisteredEvent>.broadcast(); |
| 136 get onServiceUnregistered => _onServiceUnregistered.stream; |
| 137 get onServiceUnregisteredHasListener => _onServiceUnregistered.hasListener; |
| 138 |
125 void add(M.Event event) { | 139 void add(M.Event event) { |
126 _onEvent.add(event); | 140 _onEvent.add(event); |
127 if (event is M.VMEvent) { | 141 if (event is M.VMEvent) { |
128 _onVMEvent.add(event); | 142 _onVMEvent.add(event); |
129 if (event is M.VMUpdateEvent) { | 143 if (event is M.VMUpdateEvent) { |
130 _onVMUpdate.add(event); | 144 _onVMUpdate.add(event); |
131 } | 145 } |
132 } else if (event is M.IsolateEvent) { | 146 } else if (event is M.IsolateEvent) { |
133 _onIsolateEvent.add(event); | 147 _onIsolateEvent.add(event); |
134 if (event is M.IsolateStartEvent) { | 148 if (event is M.IsolateStartEvent) { |
(...skipping 29 matching lines...) Expand all Loading... |
164 _onBreakpointRemoved.add(event); | 178 _onBreakpointRemoved.add(event); |
165 } else if (event is M.InspectEvent) { | 179 } else if (event is M.InspectEvent) { |
166 _onInspect.add(event); | 180 _onInspect.add(event); |
167 } | 181 } |
168 } else if (event is M.GCEvent) { | 182 } else if (event is M.GCEvent) { |
169 _onGCEvent.add(event); | 183 _onGCEvent.add(event); |
170 } else if (event is M.ExtensionEvent) { | 184 } else if (event is M.ExtensionEvent) { |
171 _onExtensionEvent.add(event); | 185 _onExtensionEvent.add(event); |
172 } else if (event is M.TimelineEventsEvent) { | 186 } else if (event is M.TimelineEventsEvent) { |
173 _onTimelineEvents.add(event); | 187 _onTimelineEvents.add(event); |
| 188 } else if (event is M.ServiceEvent) { |
| 189 _onServiceEvent.add(event); |
| 190 if (event is M.ServiceRegisteredEvent) { |
| 191 _onServiceRegistered.add(event); |
| 192 } else if (event is M.ServiceUnregisteredEvent) { |
| 193 _onServiceUnregistered.add(event); |
| 194 } |
174 } | 195 } |
175 } | 196 } |
176 } | 197 } |
OLD | NEW |