@Override
  protected void setKeyboard(@NonNull AnyKeyboard newKeyboard, float verticalCorrection) {
    mExtensionKey = null;
    mExtensionVisible = false;

    mUtilityKey = null;
    super.setKeyboard(newKeyboard, verticalCorrection);
    setProximityCorrectionEnabled(true);

    // looking for the space-bar, so I'll be able to detect swipes starting
    // at it
    mSpaceBarKey = null;
    for (Keyboard.Key aKey : newKeyboard.getKeys()) {
      if (aKey.getPrimaryCode() == KeyCodes.SPACE) {
        mSpaceBarKey = aKey;
        break;
      }
    }

    final Keyboard.Key lastKey = newKeyboard.getKeys().get(newKeyboard.getKeys().size() - 1);
    mWatermarkEdgeX = Keyboard.Key.getEndX(lastKey);
  }
@Test
  public void testKeyClickDomain() {
    mEnglishKeyboard =
        AnyApplication.getKeyboardFactory(getApplicationContext())
            .getEnabledAddOn()
            .createKeyboard(Keyboard.KEYBOARD_ROW_MODE_URL);
    mEnglishKeyboard.loadKeyboard(mViewUnderTest.getThemedKeyboardDimens());

    mViewUnderTest.setKeyboard(mEnglishKeyboard, 0);

    AnyKeyboard.AnyKey key = findKey(KeyCodes.DOMAIN);
    Assert.assertNotNull(key);
    Mockito.reset(mMockKeyboardListener);

    ViewTestUtils.navigateFromTo(mViewUnderTest, key, key, 30, true, true);

    Mockito.verify(mMockKeyboardListener).onText(same(key), eq(".com"));
    Mockito.verify(mMockKeyboardListener, Mockito.never())
        .onKey(anyInt(), any(), anyInt(), any(), anyBoolean());
    Mockito.reset(mMockKeyboardListener);

    Assert.assertNull(
        Shadows.shadowOf((Application) ApplicationProvider.getApplicationContext())
            .getLatestPopupWindow());

    ViewTestUtils.navigateFromTo(mViewUnderTest, key, key, 1000, true, false);

    Mockito.verify(mMockKeyboardListener, Mockito.never()).onText(any(), any());
    Mockito.verify(mMockKeyboardListener, Mockito.never())
        .onKey(anyInt(), any(), anyInt(), any(), anyBoolean());
    Mockito.reset(mMockKeyboardListener);

    PopupWindow currentlyShownPopup =
        Shadows.shadowOf((Application) ApplicationProvider.getApplicationContext())
            .getLatestPopupWindow();
    Assert.assertNotNull(currentlyShownPopup);
    Assert.assertTrue(currentlyShownPopup.isShowing());
    AnyKeyboardViewBase miniKeyboard = mViewUnderTest.getMiniKeyboard();
    Assert.assertNotNull(miniKeyboard);
  }