testGeckoStyleKeyHandling_noKeyPressEventsOnNonPrintable() {
    userAgent.IE = false;
    userAgent.GECKO = true;
    userAgent.WEBKIT = false;
    userAgent.MAC = false;
    userAgent.WINDOWS = true;
    userAgent.LINUX = false;

    let eventsFired = 0;
    let keyEvent;
    const keyHandler = new KeyHandler();

    events.listen(keyHandler, KeyHandler.EventType.KEY, (e) => {
      keyEvent = e;
      eventsFired++;
    });

    fireKeyDown(keyHandler, KeyCodes.ENTER);
    fireKeyPress(keyHandler, KeyCodes.ENTER);
    assertEquals(
        'Enter should fire a key event with the keycode 13', KeyCodes.ENTER,
        keyEvent.keyCode);
    assertEquals(
        'Enter should fire a key event with the charcode 0', 0,
        keyEvent.charCode);
    assertEquals('Only one key event should have been fired.', 1, eventsFired);

    eventsFired = 0;
    fireKeyDown(keyHandler, KeyCodes.ESC);
    assertEquals(
        'Esc should fire a key event with the keycode 27', KeyCodes.ESC,
        keyEvent.keyCode);
    assertEquals(
        'Esc should fire a key event with the charcode 0', 0,
        keyEvent.charCode);
    assertEquals('Only one key event should have been fired.', 1, eventsFired);

    eventsFired = 0;
    fireKeyDown(keyHandler, KeyCodes.UP);
    assertEquals(
        'Up should fire a key event with the keycode 38', KeyCodes.UP,
        keyEvent.keyCode);
    assertEquals(
        'Up should fire a key event with the charcode 0', 0, keyEvent.charCode);
    assertEquals('Only one key event should have been fired.', 1, eventsFired);

    eventsFired = 0;
    fireKeyDown(
        keyHandler, KeyCodes.SEVEN, undefined, undefined, undefined, undefined,
        true);
    fireKeyPress(
        keyHandler, undefined, 38, undefined, undefined, undefined, true);
    assertEquals(
        'Shift+7 should fire a key event with the keycode 55', KeyCodes.SEVEN,
        keyEvent.keyCode);
    assertEquals(
        'Shift+7 should fire a key event with the charcode 38', 38,
        keyEvent.charCode);
    assertEquals('Only one key event should have been fired.', 1, eventsFired);

    eventsFired = 0;
    fireKeyDown(keyHandler, KeyCodes.A);
    fireKeyPress(keyHandler, undefined, 97);
    assertEquals(
        'Lower case a should fire a key event with the keycode 65', KeyCodes.A,
        keyEvent.keyCode);
    assertEquals(
        'Lower case a should fire a key event with the charcode 97', 97,
        keyEvent.charCode);
    assertEquals('Only one key event should have been fired.', 1, eventsFired);

    eventsFired = 0;
    fireKeyDown(keyHandler, KeyCodes.A);
    fireKeyPress(keyHandler, undefined, 65);
    assertEquals(
        'Upper case A should fire a key event with the keycode 65', KeyCodes.A,
        keyEvent.keyCode);
    assertEquals(
        'Upper case A should fire a key event with the charcode 65', 65,
        keyEvent.charCode);
    assertEquals('Only one key event should have been fired.', 1, eventsFired);

    eventsFired = 0;
    fireKeyDown(keyHandler, KeyCodes.DELETE);
    assertEquals(
        'Delete should fire a key event with the keycode 46', KeyCodes.DELETE,
        keyEvent.keyCode);
    assertEquals(
        'Delete should fire a key event with the charcode 0', 0,
        keyEvent.charCode);
    assertEquals('Only one key event should have been fired.', 1, eventsFired);

    eventsFired = 0;
    fireKeyDown(keyHandler, KeyCodes.PERIOD);
    fireKeyPress(keyHandler, undefined, 46);
    assertEquals(
        'Period should fire a key event with the keycode 190', KeyCodes.PERIOD,
        keyEvent.keyCode);
    assertEquals(
        'Period should fire a key event with the charcode 46', 46,
        keyEvent.charCode);
    assertEquals('Only one key event should have been fired.', 1, eventsFired);
  }
Tests the key handler for the Gecko behavior with the following experiment
rolled out on Gecko:
- `keypress` events are not dispatched on non-printable character events.
   See: https://github.com/google/closure-library/issues/883