Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): bound preview recording warmup #20085

MergedQuicksaver(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/20085/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 93 additions and 8 deletions.

x
0 of 2 viewed, 2 left
79 additions and 0 deletionsapps/desktop/src/preview/Manager.test.tsModified
View file
@@ -3322,6 +3322,85 @@
+ effectIt.effect(
+ "releases queued STOP after stalled recording warmups and ignores late completion",
+ () =>
+ withManager((manager) =>
+ Effect.gen(function* () {
+ const warmupStarted = Promise.withResolvers<void>();
+ const firstWarmup = Promise.withResolvers<TestCapturedPreviewImage>();
+ const lateWarmup = Promise.withResolvers<TestCapturedPreviewImage>();
+ const capturePage = vi
+ .fn<() => Promise<TestCapturedPreviewImage>>()
+ .mockImplementationOnce(() => {
+ warmupStarted.resolve();
+ return firstWarmup.promise;
+ })
+ .mockImplementation(() => lateWarmup.promise);
+ const host = makeTestHostWebContents();
+ const webContents = makeTestPreviewWebContents(capturePage, 42, host);
+ const windowThrottling = vi.fn();
+ fromId.mockReturnValue(webContents);
+ yield* manager.createTab("tab_recording_stalled_warmup");
+ yield* manager.registerWebview("tab_recording_stalled_warmup", 42);
+ yield* manager.setMainWindow({
+ isDestroyed: () => false,
+ once: vi.fn(),
+ webContents: { setBackgroundThrottling: windowThrottling },
+ } as never);