14package org.dartlang.vm.service;
16import org.dartlang.vm.service.element.Event;
17import org.dartlang.vm.service.element.EventKind;
25 private final Object lock =
new Object();
26 private String lastStreamId;
27 private Event lastEvent;
28 private final Set<EventKind> ignoreAll;
31 this.ignoreAll = ignoreAll;
42 if (ignoreAll.contains(
event.getKind())) {
45 if (lastStreamId !=
null) {
46 unexpectedEvent(lastStreamId, lastEvent);
48 lastStreamId = streamId;
59 public Event waitFor(String expectedStreamId, EventKind expectedEventKind) {
60 long end = System.currentTimeMillis() + 5000;
63 if (expectedStreamId.equals(lastStreamId) && expectedEventKind.equals(lastEvent.getKind())) {
64 Event event = lastEvent;
69 long timeout =
end - System.currentTimeMillis();
75 }
catch (InterruptedException
e) {
80 throw new RuntimeException(
"Expected event: " + expectedStreamId +
", " + expectedEventKind);
83 private void unexpectedEvent(String streamId,
Event event) {
84 System.out.println(
"****** Unexpected Event: " + streamId +
", " +
event.getKind());
GrAATriangulator::Event Event
void received(String streamId, Event event)
Event waitFor(String expectedStreamId, EventKind expectedEventKind)
SampleVmServiceListener(Set< EventKind > ignoreAll)
def timeout(deadline, cmd)