function expectClosed(/** number= */ times = undefined) {
  mockClosedHandler.handleEvent(new ArgumentMatcher(
      (arg) => arg.type == AbstractDialogPlugin.EventType.CLOSED));
  mockField.dispatchSelectionChangeEvent();
  if (times) {
    mockClosedHandler.$times(times);
    mockField.$times(times);
  }
}
Sets up the mock event handler to expect a CLOSED event.
@suppress {missingProperties} suppression added to enable type checking