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

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

Issue 2211603002: Centralized event streams (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merged with master Created 4 years, 4 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 part of mocks;
6
7 class EventRepositoryMock implements M.EventRepository {
8 final _onEvent = new StreamController<M.Event>.broadcast();
9 get onEvent => _onEvent.stream;
10 get onEventHasListener => _onEvent.hasListener;
11
12 final _onVMEvent = new StreamController<M.VMEvent>.broadcast();
13 get onVMEvent => _onVMEvent.stream;
14 get onVMEventHasListener => _onVMEvent.hasListener;
15
16 final _onVMUpdate = new StreamController<M.Event>.broadcast();
17 get onVMUpdate => _onVMUpdate.stream;
18 get onVMUpdateHasListener => _onVMUpdate.hasListener;
19
20 final _onIsolateEvent = new StreamController<M.IsolateEvent>.broadcast();
21 get onIsolateEvent => _onIsolateEvent.stream;
22 get onIsolateEventHasListener => _onIsolateEvent.hasListener;
23
24 final _onIsolateStart = new StreamController<M.IsolateStartEvent>.broadcast();
25 get onIsolateStart => _onIsolateStart.stream;
26 get onIsolateStartHasListener => _onIsolateStart.hasListener;
27
28 final _onIsolateRunnable =
29 new StreamController<M.IsolateRunnableEvent>.broadcast();
30 get onIsolateRunnable => _onIsolateRunnable.stream;
31 get onIsolateRunnableHasListener => _onIsolateRunnable.hasListener;
32
33 final _onIsolateExit = new StreamController<M.IsolateExitEvent>.broadcast();
34 get onIsolateExit => _onIsolateExit.stream;
35 get onIsolateExitHasListener => _onIsolateExit.hasListener;
36
37 final _onIsolateUpdate =
38 new StreamController<M.IsolateUpdateEvent>.broadcast();
39 get onIsolateUpdate => _onIsolateUpdate.stream;
40 get onIsolateUpdateHasListener => _onIsolateUpdate.hasListener;
41
42 final _onIsolateReload = new StreamController<M.IsolateReloadEvent>.broadcast( );
43 get onIsolateReload => _onIsolateReload.stream;
44 get onIsolateReloadHasListener => _onIsolateReload.hasListener;
45
46 final _onServiceExtensionAdded =
47 new StreamController<M.ServiceExtensionAddedEvent>.broadcast();
48 get onServiceExtensionAdded => _onServiceExtensionAdded.stream;
49 get onServiceExtensionAddedHasListener =>
50 _onServiceExtensionAdded.hasListener;
51
52 final _onDebugEvent = new StreamController<M.DebugEvent>.broadcast();
53 get onDebugEvent => _onDebugEvent.stream;
54 get onDebugEventHasListener => _onDebugEvent.hasListener;
55
56 final _onPauseStart = new StreamController<M.PauseStartEvent>.broadcast();
57 get onPauseStart => _onPauseStart.stream;
58 get onPauseStartHasListener => _onPauseStart.hasListener;
59
60 final _onPauseExit = new StreamController<M.PauseExitEvent>.broadcast();
61 get onPauseExit => _onPauseExit.stream;
62 get onPauseExitHasListener => _onPauseExit.hasListener;
63
64 final _onPauseBreakpoint =
65 new StreamController<M.PauseBreakpointEvent>.broadcast();
66 get onPauseBreakpoint => _onPauseBreakpoint.stream;
67 get onPauseBreakpointHasListener => _onPauseBreakpoint.hasListener;
68
69 final _onPauseInterrupted =
70 new StreamController<M.PauseInterruptedEvent>.broadcast();
71 get onPauseInterrupted => _onPauseInterrupted.stream;
72 get onPauseInterruptedHasListener => _onPauseInterrupted.hasListener;
73
74 final _onPauseException =
75 new StreamController<M.PauseExceptionEvent>.broadcast();
76 get onPauseException => _onPauseException.stream;
77 get onPauseExceptionHasListener => _onPauseException.hasListener;
78
79 final _onResume = new StreamController<M.ResumeEvent>.broadcast();
80 get onResume => _onResume.stream;
81 get onResumeHasListener => _onResume.hasListener;
82
83 final _onBreakpointAdded =
84 new StreamController<M.BreakpointAddedEvent>.broadcast();
85 get onBreakpointAdded => _onBreakpointAdded.stream;
86 get onBreakpointAddedHasListener => _onBreakpointAdded.hasListener;
87
88 final _onBreakpointResolved =
89 new StreamController<M.BreakpointResolvedEvent>.broadcast();
90 get onBreakpointResolved => _onBreakpointResolved.stream;
91 get onBreakpointResolvedHasListener => _onBreakpointResolved.hasListener;
92
93 final _onBreakpointRemoved =
94 new StreamController<M.BreakpointRemovedEvent>.broadcast();
95 get onBreakpointRemoved => _onBreakpointRemoved.stream;
96 get onBreakpointRemovedHasListener => _onBreakpointRemoved.hasListener;
97
98 final _onInspect = new StreamController<M.InspectEvent>.broadcast();
99 get onInspect => _onInspect.stream;
100 get onInspectHasListener => _onInspect.hasListener;
101
102 final _onGCEvent = new StreamController<M.GCEvent>.broadcast();
103 get onGCEvent => _onGCEvent.stream;
104 get onGCEventHasListener => _onGCEvent.hasListener;
105
106 final _onExtensionEvent = new StreamController<M.ExtensionEvent>.broadcast();
107 get onExtensionEvent => _onExtensionEvent.stream;
108 get onExtensionEventHasListener => _onExtensionEvent.hasListener;
109
110 final _onTimelineEvents =
111 new StreamController<M.TimelineEventsEvent>.broadcast();
112 get onTimelineEvents => _onTimelineEvents.stream;
113 get onTimelineEventsEventHasListener => _onTimelineEvents.hasListener;
114
115 final _onConnectionClosed =
116 new StreamController<M.ConnectionClosedEvent>.broadcast();
117 get onConnectionClosed => _onConnectionClosed.stream;
118 get onConnectionClosedHasListener => _onConnectionClosed.hasListener;
119
120 void add(M.Event event) {
121 _onEvent.add(event);
122 if (event is M.VMEvent) {
123 _onVMEvent.add(event);
124 if (event is M.VMUpdateEvent) {
125 _onVMUpdate.add(event);
126 }
127 } else if (event is M.IsolateEvent) {
128 _onIsolateEvent.add(event);
129 if (event is M.IsolateStartEvent) {
130 _onIsolateStart.add(event);
131 } else if (event is M.IsolateRunnableEvent) {
132 _onIsolateRunnable.add(event);
133 } else if (event is M.IsolateExitEvent) {
134 _onIsolateExit.add(event);
135 } else if (event is M.IsolateUpdateEvent) {
136 _onIsolateUpdate.add(event);
137 } else if (event is M.ServiceExtensionAddedEvent) {
138 _onServiceExtensionAdded.add(event);
139 }
140 } else if (event is M.DebugEvent) {
141 _onDebugEvent.add(event);
142 if (event is M.PauseStartEvent) {
143 _onPauseStart.add(event);
144 } else if (event is M.PauseExitEvent) {
145 _onPauseExit.add(event);
146 } else if (event is M.PauseBreakpointEvent) {
147 _onPauseBreakpoint.add(event);
148 } else if (event is M.PauseInterruptedEvent) {
149 _onPauseInterrupted.add(event);
150 } else if (event is M.PauseExceptionEvent) {
151 _onPauseException.add(event);
152 } else if (event is M.ResumeEvent) {
153 _onResume.add(event);
154 } else if (event is M.BreakpointAddedEvent) {
155 _onBreakpointAdded.add(event);
156 } else if (event is M.BreakpointResolvedEvent) {
157 _onBreakpointResolved.add(event);
158 } else if (event is M.BreakpointRemovedEvent) {
159 _onBreakpointRemoved.add(event);
160 } else if (event is M.InspectEvent) {
161 _onInspect.add(event);
162 }
163 } else if (event is M.GCEvent) {
164 _onGCEvent.add(event);
165 } else if (event is M.ExtensionEvent) {
166 _onExtensionEvent.add(event);
167 } else if (event is M.TimelineEventsEvent) {
168 _onTimelineEvents.add(event);
169 }
170 }
171 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698