function createTestDialog() {
  const dialog = new AbstractDialog(new DomHelper());
  builder = new AbstractDialog.Builder(dialog);
  /** @suppress {visibility} suppression added to enable type checking */
  dialog.createDialogControl = () => builder.build();
  /** @suppress {visibility} suppression added to enable type checking */
  dialog.createOkEvent = (e) => new GoogEvent(AbstractDialog.EventType.OK);
  dialog.addEventListener(
      AbstractDialog.EventType.AFTER_HIDE, mockAfterHideHandler);
  dialog.addEventListener(AbstractDialog.EventType.OK, mockOkHandler);
  dialog.addEventListener(AbstractDialog.EventType.CANCEL, mockCancelHandler);
  dialog.addEventListener(CUSTOM_EVENT, mockCustomButtonHandler);
  return dialog;
}
Helper to create the dialog being tested in each test. Since NewDialog is
abstract, needs to add a concrete version of any abstract methods. Also
creates up the global builder variable which should be set up after the call
to this method.
@return {!AbstractDialog} The dialog.
@suppress {checkTypes} suppression added to enable type checking