private void testRouteToCollapsedKeyComboHelperInner(EditorEvent tabSignal,
boolean isHandledCommand, boolean isHandledBlockLevelCommand) {
final Point<ContentNode> caret =
Point.<ContentNode> end(newParaElement());
FocusedContentRange selection = new FocusedContentRange(caret);
ContentRange range = selection.asOrderedRange(true);
FakeEditorInteractor interactor = setupFakeEditorInteractor(selection);
FakeEditorEventsSubHandler subHandler = new FakeEditorEventsSubHandler();
EditorEventHandler handler = createEditorEventHandler(interactor, subHandler);
subHandler.call(FakeEditorEventsSubHandler.HANDLE_COMMAND).nOf(1).withArgs(tabSignal).returns(
isHandledCommand);
if (!isHandledCommand) {
subHandler.call(FakeEditorEventsSubHandler.HANDLE_BLOCK_LEVEL_COMMANDS).nOf(1).withArgs(
tabSignal, range).returns(isHandledBlockLevelCommand);
if (!isHandledBlockLevelCommand) {
// Stop it here by returning true, test lower down commands in other
// methods.
subHandler.call(FakeEditorEventsSubHandler.HANDLE_COLLAPSED_KEY_COMBO).nOf(1).withArgs(
tabSignal, selection.getFocus()).returns(true);
}
}
boolean cancel = handler.handleEvent(tabSignal);
interactor.checkExpectations();
subHandler.checkExpectations();