testBecomeIdle() {
    const idleThreshold = 1000;
    const mockActivityMonitor = new MockActivityMonitor();
    const idleTimer = new IdleTimer(idleThreshold, mockActivityMonitor);

    mockActivityMonitor.simulateEvent();
    assertFalse('Precondition: user should be active', idleTimer.isIdle());

    let onBecomeIdleCount = 0;
    const onBecomeIdle = () => {
      onBecomeIdleCount += 1;
    };
    events.listen(idleTimer, IdleTimer.Event.BECOME_IDLE, onBecomeIdle);

    clock.tick(idleThreshold);
    mockActivityMonitor.simulateEvent();
    clock.tick(idleThreshold);
    assert('The BECOME_IDLE event fired too early', onBecomeIdleCount == 0);
    assertFalse('The user should still be active', idleTimer.isIdle());

    clock.tick(1);
    assert('The BECOME_IDLE event fired too late', onBecomeIdleCount == 1);
    assert('The user should be idle', idleTimer.isIdle());

    idleTimer.dispose();
  }
Tests whether an event is fired when the user becomes idle