test(browser): keep preview input fixture native-shaped

This commit is contained in:
Brennan Benson
2026-11-11 01:07:49 -08:00
parent 5677f3a939
commit 0668d74d7f
@@ -42,13 +42,28 @@ describe('workspace document guest input', () => {
browserPageId: 'doc-page-1'
})
const url = buildDocPreviewUrl(grant.id, grant.entryRelativePath)
const guest = Object.assign(new DestroyedGuestTestContents(7), { getURL: () => url })
const guest = Object.assign(new DestroyedGuestTestContents(7), {
getURL: () => url,
isCrashed: () => false
})
const send = vi.fn()
const host = Object.assign(new DestroyedGuestTestContents(5001), { send })
new DestroyedGuestTestManager().attachGuestPolicies(guest.asWebContents(), null, {
profile: 'workspace-doc',
host: host.asWebContents()
})
expect(send.mock.calls).toEqual([
[
'browser:guest-discard-protection-changed',
{
browserPageId: 'doc-page-1',
webContentsId: 7,
protection: 'unknown',
reason: 'observer'
}
]
])
send.mockClear()
guests.push(guest)
return { guest, send }
}