6a6f14084909
restore deterministic Chromium release assurance (v5.2.57)
- time
- 2026-09-14 19:23 UTC · 1 month ago
- machine
- koh2
- agent
- camel-stream/auto
- session
- restore release assurance
- parent
- 69320fbe5c70
↓ peach-browser-6a6f1408.tar.gzatlas at this save
files changed4 files
tests/fixtures/synthetic-backup.peach+1 −0tests/helpers/vault.ts+23 −11tests/lock-screen.spec.ts+4 −7tests/vault-lifecycle.spec.ts+18 −15tests/fixtures/synthetic-backup.peach+1 −0
@@ -0,0 +1 @@1+\ No newline at end of filetests/helpers/vault.ts+23 −11
@@ -59,20 +59,12 @@5959 }6060 6161 /** Click through the intro carousel until the create-vault form is on screen. */62-async function reachCreateScreen(popup: Page): Promise<void> {63- // Final card's nav button reads "Create vault"; card-body taps are guarded64- // there, so the carousel only advances via the button.62+export async function reachCreateScreen(popup: Page): Promise<void> {6563 const advanceButton = popup.getByRole("button", { name: /next|get started|create vault/i });66- // Create screen uses #master-password; the unlock/lock screen uses67- // #unlock-password. Keep this one pointed at the create field.6864 const pw = popup.locator("#master-password");6965 for (let i = 0; i < 5 && !(await pw.isVisible().catch(() => false)); i++) {70- if (await advanceButton.isVisible({ timeout: 500 }).catch(() => false)) {71- await advanceButton.click();72- await popup.waitForTimeout(300);73- continue;74- }75- await popup.locator(".peach-onboarding-card").click();66+ await expect(advanceButton).toBeVisible({ timeout: 5000 });67+ await advanceButton.click();7668 await popup.waitForTimeout(300);7769 }7870 if (!(await pw.isVisible().catch(() => false))) {@@ -161,6 +153,26 @@161153 export async function openSettings(popup: Page): Promise<void> {162154 await popup.locator(".peach-icon-btn[aria-label='Settings']").click();163155 await expect(popup.locator(".stk-shell")).toBeVisible({ timeout: 10000 });156+}157+158+export async function setLockOnClose(popup: Page, enabled: boolean): Promise<void> {159+ const response = await popup.evaluate(async (lockOnClose) => {160+ return new Promise<{ ok?: boolean; error?: string }>((resolve) => {161+ chrome.runtime.sendMessage({ type: "UPDATE_SETTINGS", payload: { lockOnClose } }, resolve);162+ });163+ }, enabled);164+ if (!response?.ok) throw new Error(`setLockOnClose failed: ${response?.error ?? "no response"}`);165+}166+167+export async function waitForLocked(ctx: BrowserContext): Promise<void> {168+ await expect.poll(async () => {169+ const worker = ctx.serviceWorkers()[0];170+ if (!worker) return false;171+ return worker.evaluate(async () => {172+ const stored = await chrome.storage.session.get("peach_session_dk");173+ return stored.peach_session_dk === undefined;174+ });175+ }).toBe(true);164176 }165177 166178 /**tests/lock-screen.spec.ts+4 −7
@@ -1,7 +1,7 @@1-import { test, expect, Page, BrowserContext } from "@playwright/test";2-import { existsSync } from "fs";1+import { test, expect, type Page, type BrowserContext } from "@playwright/test";2+import { fileURLToPath } from "node:url";33 4-const fsExists = async (path: string) => existsSync(path);4+const PEACH_FILE = fileURLToPath(new URL("./fixtures/synthetic-backup.peach", import.meta.url));55 import {66 UNLOCKED,77 VAULT_PASSWORD,@@ -329,10 +329,7 @@329329 330330 test("LS26 - the .peach picker detaches to a window that receives the file", async () => {331331 // The action popup dismisses when the OS file dialog steals focus, so the332- // picker opens a standalone window; the chosen file must land there.333- const PEACH_FILE = "/Users/june/Downloads/peach-backup-2026-08-20.peach";334- test.skip(!(await fsExists(PEACH_FILE)), "real PeachScript backup not in Downloads");335-332+ // picker opens a standalone window; the chosen synthetic file must land there.336333 const { popup } = await loadPopup(ctx);337334 const next = popup.locator(".peach-onboarding-next");338335 await next.click();tests/vault-lifecycle.spec.ts+18 −15
@@ -6,6 +6,8 @@66 loadPopup,77 lockVault,88 makeContext,9+ reachCreateScreen,10+ setLockOnClose,911 setupVault,1012 unlockVault,1113 } from "./helpers/vault";@@ -23,15 +25,6 @@2325 // vault creation. What is left is the part that is both real and not already2426 // covered by lock-screen.spec.ts: the create-vault gate, and persistence.2527 26-/** Advance the intro carousel until the create-vault form is on screen. */27-async function reachCreateScreen(popup: import("@playwright/test").Page) {28- const pw = popup.locator("#master-password");29- for (let i = 0; i < 5 && !(await pw.isVisible().catch(() => false)); i++) {30- await popup.locator(".peach-onboarding-card").click();31- await popup.waitForTimeout(300);32- }33- await expect(pw).toBeVisible();34-}3528 3629 test.describe("Vault creation gate", () => {3730 let ctx: BrowserContext;@@ -116,27 +109,37 @@116109 });117110 118111 test("VL10 - reopening the popup requires the password again", async () => {119- const { popup, extId } = await setupVault(ctx);112+ const { popup } = await setupVault(ctx);120113 await addEntry(popup, { title: "ReopenTest", url: "https://reopen.test", username: "[email protected]", password: "entry-secret" });114+ await setLockOnClose(popup, true);115+ await lockVault(popup);121116 await popup.close();122117 123- const reopened = await ctx.newPage();124- await reopened.goto(`chrome-extension://${extId}/src/popup/index.html`);118+ const { popup: reopened } = await loadPopup(ctx);125119 await expect(reopened.locator("#unlock-password")).toBeVisible({ timeout: 15000 });126120 await unlockVault(reopened);127121 await expect(reopened.locator(".peach-entry-name-text").first()).toHaveText("ReopenTest", { timeout: 10000 });128122 });129123 130124 test("VL11 - a wrong password does not unlock a reopened popup", async () => {131- const { popup, extId } = await setupVault(ctx);125+ const { popup } = await setupVault(ctx);126+ await setLockOnClose(popup, true);127+ await lockVault(popup);132128 await popup.close();133129 134- const reopened = await ctx.newPage();135- await reopened.goto(`chrome-extension://${extId}/src/popup/index.html`);130+ const { popup: reopened } = await loadPopup(ctx);136131 await expect(reopened.locator("#unlock-password")).toBeVisible({ timeout: 15000 });137132 await reopened.locator("#unlock-password").fill("not the right password");138133 await reopened.getByRole("button", { name: /unlock/i }).click();139134 await expect(reopened.locator(".peach-hint-error")).toBeVisible({ timeout: 15000 });140135 await expect(reopened.locator(UNLOCKED)).toHaveCount(0);136+ });137+138+ test("VL12 - default popup close leaves the vault unlocked", async () => {139+ const { popup } = await setupVault(ctx);140+ await popup.close();141+142+ const { popup: reopened } = await loadPopup(ctx);143+ await expect(reopened.locator(UNLOCKED)).toBeVisible({ timeout: 15000 });141144 });142145 });