testEscape() {
    dialog = createTestDialog();
    expectCancel(dialog);
    expectAfterHide(dialog);
    mockCtrl.$replayAll();

    dialog.show();
    events.fireKeySequence(dialog.dialogInternal_.getElement(), KeyCodes.ESC);
    assertNotOpen('Dialog should not be open after hitting escape', dialog);

    mockCtrl.$verifyAll();
  }
Tests that hitting the escape key dispatches the CANCEL event and closes
the dialog (dispatching the AFTER_HIDE event too).
@suppress {checkTypes,visibility} suppression added to enable type checking