Пример #1
0
  public void testKeyPressedForwardedToTextPanel() throws Exception {
    MockOS os = new MockOS();
    Context.instance().os = os;
    KeyEvent event = new KeyEvent(new JPanel(), 1, 2, 3, 4, 'a');

    panel.keyPressed(event);

    assertEquals(false, os.wasPrimaryModifierDownChecked());

    panel.setText("foo");
    panel.keyPressed(event);

    assertEquals(true, os.wasPrimaryModifierDownChecked());
  }
Пример #2
0
  public void testKeyPressedEvent() throws Exception {
    KeyEvent event = new KeyEvent(new JPanel(), 1, 2, 3, 4, 'a');
    panel.keyPressed(event);

    assertSame(event, prop.pressedKey);
  }