From 51626258d10844e374e40a1567746ff9c30ec898 Mon Sep 17 00:00:00 2001 From: yetone Date: Wed, 7 Oct 2026 03:03:07 +0800 Subject: [PATCH] gui tests: text-size zooms the page out only after the 100% post and the click's frame, as the webview does (scrolled from 120 to 61, max 78, since bd33e575's font rows made Settings run past the window's foot) The test resized the page in the same frame as the click, while the Mac header still drew at 150%'s 33px: the view was 17px taller for a moment and the browser clamped its scroll to it. In magpie the webview zooms only once Go has the post (textsize.go), frames later. Before bd33e575 Settings fit the window and was clamped to 0 either way. Passes 3 runs in a row in Chromium and WebKit, and still fails 2 cases with newTextSize's reset (#911) taken out. --- internal/gui/tests/text-size.test.cjs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/gui/tests/text-size.test.cjs b/internal/gui/tests/text-size.test.cjs index b42a703c..0835f0ea 100644 --- a/internal/gui/tests/text-size.test.cjs +++ b/internal/gui/tests/text-size.test.cjs @@ -227,6 +227,13 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", assert(before > 0, "the settings page must scroll"); await segs.nth(0).click(); await page.locator("#textSizeSegs .opt.on", { hasText: "100%" }).waitFor(); + // the webview zooms out only once Go has the post (textsize.go), by + // when the page has drawn the click: the Mac header back at 50px. A + // resize before that frame is clamped to a view 17px too tall, which + // shows once the page runs past the window's foot (bd33e575's font + // rows made Settings that long) + for (let i = 0; i < 50 && !posts.length; i++) await page.waitForTimeout(20); + await page.evaluate(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(r)))); // the webview's zoom out: the same window is half as many CSS pixels again await page.setViewportSize({ width: 1440, height: 900 }); await page.waitForTimeout(600);