mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-05 02:40:55 -07:00
feat(ui): add flicker detection and metrics (#10821)
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
||||
import { appEvents, AppEvent } from '../../utils/events.js';
|
||||
import {
|
||||
profiler,
|
||||
ACTION_TIMESTAMP_CAPACITY,
|
||||
@@ -157,6 +158,18 @@ describe('DebugProfiler', () => {
|
||||
expect(profiler.totalIdleFrames).toBe(3);
|
||||
});
|
||||
|
||||
it('should report flicker frames', () => {
|
||||
const reportActionSpy = vi.spyOn(profiler, 'reportAction');
|
||||
const cleanup = profiler.registerFlickerHandler(true);
|
||||
|
||||
appEvents.emit(AppEvent.Flicker);
|
||||
|
||||
expect(profiler.totalFlickerFrames).toBe(1);
|
||||
expect(reportActionSpy).toHaveBeenCalled();
|
||||
|
||||
cleanup();
|
||||
});
|
||||
|
||||
it('should not report idle frames when actions are interleaved', async () => {
|
||||
const startTime = Date.now();
|
||||
vi.setSystemTime(startTime);
|
||||
|
||||
Reference in New Issue
Block a user