editor.getInput().getActionExecutor().addDelegate(TextActions.INSTANCE);
PathUtil path = new PathUtil("test.css");
DocumentParser documentParser = createDocumentParser(path);
Autoindenter autoindenter = Autoindenter.create(documentParser, editor);
LineFinder lineFinder = editor.getDocument().getLineFinder();
editor.getSelection().setSelection(
lineFinder.findLine(line1), column1, lineFinder.findLine(line2), column2);
final JsonArray<Scheduler.ScheduledCommand> scheduled = JsonCollections.createArray();
TestSchedulerImpl.AngryScheduler scheduler = new TestSchedulerImpl.AngryScheduler() {
@Override
public void scheduleDeferred(ScheduledCommand scheduledCommand) {
// Do nothing
}
@Override
public void scheduleFinally(ScheduledCommand scheduledCommand) {
scheduled.add(scheduledCommand);
}
};
Runnable triggerClicker = new Runnable() {
@Override
public void run() {
editor.getInput().processSignalEvent(trigger);
}
};
try {
TestSchedulerImpl.runWithSpecificScheduler(triggerClicker, scheduler);
} finally {
autoindenter.teardown();
}
if (scheduled.size() != 1) {
fail("exactly 1 scheduled command expected");
}