mirror of
https://github.com/stablyai/orca.git
synced 2026-10-23 16:03:49 +00:00
fix(terminal): cover serialized WebGL probe state
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -434,6 +434,20 @@ describe('check-mode reporting', () => {
|
||||
// These run without network or a build, so ordinary `pnpm test` catches the two
|
||||
// desyncs that would otherwise only surface in the heavy xterm_patch_sync job.
|
||||
describe('committed xterm patch artifacts', () => {
|
||||
it('normalizes Chromium font-weight serialization in every WebGL runtime copy', async () => {
|
||||
const patch = await readFile(
|
||||
path.join(REPO_ROOT, 'config/patches/@xterm__addon-webgl@0.20.0-beta.286.patch'),
|
||||
'utf8'
|
||||
)
|
||||
expect(patch).not.toMatch(/desiredWeight !== '400'|orcaProbeWeight!=="400"/)
|
||||
expect(
|
||||
patch.match(/(?:actualWeightToken === 'normal'|orcaActualWeightToken==="normal")/g)
|
||||
).toHaveLength(3)
|
||||
expect(
|
||||
patch.match(/(?:actualWeight !== desiredWeight|orcaActualWeight!==orcaProbeWeight)/g)
|
||||
).toHaveLength(3)
|
||||
})
|
||||
|
||||
it('records the lockfile hash pnpm derives from the patch file', async () => {
|
||||
const manifest = JSON.parse(await readFile(MANIFEST_PATH, 'utf8'))
|
||||
const lockfile = await readFile(path.join(REPO_ROOT, 'pnpm-lock.yaml'), 'utf8')
|
||||
|
||||
Generated
+3
-3
@@ -18,7 +18,7 @@ patchedDependencies:
|
||||
hash: af3b156143ed2ee9903b753145b63dd4a2ee72cadd7ef333ab0f4d5d3ebfc32c
|
||||
path: config/patches/@xterm__addon-serialize@0.15.0-beta.287.patch
|
||||
'@xterm/addon-webgl@0.20.0-beta.286':
|
||||
hash: 335427c05eef212851ba4e2fc19623c65af82898c5243c6b7f308c97b1d6a174
|
||||
hash: 118f649459ba56a51627d46603e2d5d81d837ac9c4dc393f5cc20263d0ac1b91
|
||||
path: config/patches/@xterm__addon-webgl@0.20.0-beta.286.patch
|
||||
'@xterm/xterm@6.1.0-beta.287':
|
||||
hash: 46796c152f3b73e28238f44499eaf5a867a863809bc7b470b159526a41e354f7
|
||||
@@ -229,7 +229,7 @@ importers:
|
||||
version: 0.13.0-beta.287(@xterm/xterm@6.1.0-beta.287(patch_hash=46796c152f3b73e28238f44499eaf5a867a863809bc7b470b159526a41e354f7))
|
||||
'@xterm/addon-webgl':
|
||||
specifier: 0.20.0-beta.286
|
||||
version: 0.20.0-beta.286(patch_hash=335427c05eef212851ba4e2fc19623c65af82898c5243c6b7f308c97b1d6a174)(@xterm/xterm@6.1.0-beta.287(patch_hash=46796c152f3b73e28238f44499eaf5a867a863809bc7b470b159526a41e354f7))
|
||||
version: 0.20.0-beta.286(patch_hash=118f649459ba56a51627d46603e2d5d81d837ac9c4dc393f5cc20263d0ac1b91)(@xterm/xterm@6.1.0-beta.287(patch_hash=46796c152f3b73e28238f44499eaf5a867a863809bc7b470b159526a41e354f7))
|
||||
'@xterm/xterm':
|
||||
specifier: 6.1.0-beta.287
|
||||
version: 6.1.0-beta.287(patch_hash=46796c152f3b73e28238f44499eaf5a867a863809bc7b470b159526a41e354f7)
|
||||
@@ -9638,7 +9638,7 @@ snapshots:
|
||||
dependencies:
|
||||
'@xterm/xterm': 6.1.0-beta.287(patch_hash=46796c152f3b73e28238f44499eaf5a867a863809bc7b470b159526a41e354f7)
|
||||
|
||||
'@xterm/addon-webgl@0.20.0-beta.286(patch_hash=335427c05eef212851ba4e2fc19623c65af82898c5243c6b7f308c97b1d6a174)(@xterm/xterm@6.1.0-beta.287(patch_hash=46796c152f3b73e28238f44499eaf5a867a863809bc7b470b159526a41e354f7))':
|
||||
'@xterm/addon-webgl@0.20.0-beta.286(patch_hash=118f649459ba56a51627d46603e2d5d81d837ac9c4dc393f5cc20263d0ac1b91)(@xterm/xterm@6.1.0-beta.287(patch_hash=46796c152f3b73e28238f44499eaf5a867a863809bc7b470b159526a41e354f7))':
|
||||
dependencies:
|
||||
'@xterm/xterm': 6.1.0-beta.287(patch_hash=46796c152f3b73e28238f44499eaf5a867a863809bc7b470b159526a41e354f7)
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import {
|
||||
measureDivergence,
|
||||
reachRenderInternals,
|
||||
releaseRenderDesyncReadback,
|
||||
type BufferLike,
|
||||
type SentinelRenderInternals
|
||||
@@ -73,3 +74,26 @@ describe('measureDivergence', () => {
|
||||
expect(createElement).toHaveBeenCalledTimes(1)
|
||||
})
|
||||
})
|
||||
|
||||
describe('reachRenderInternals', () => {
|
||||
it('reads the generation name emitted by the packaged WebGL bundle', () => {
|
||||
const terminal = {
|
||||
rows: 2,
|
||||
cols: 3,
|
||||
_core: {
|
||||
_renderService: {
|
||||
_renderer: {
|
||||
value: {
|
||||
_canvas: {} as HTMLCanvasElement,
|
||||
_charAtlas: { _clearModelGeneration: 7, pages: [] },
|
||||
_themeService: { colors: { background: { rgba: 0 } } },
|
||||
dimensions: { device: { cell: { width: 8, height: 16 } } }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
expect(reachRenderInternals(terminal)?.rendererState.atlasClearModelGeneration).toBe(7)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -57,6 +57,7 @@ export function reachRenderInternals(terminal: unknown): SentinelRenderInternals
|
||||
_canvas?: HTMLCanvasElement
|
||||
_charAtlas?: {
|
||||
clearModelGeneration?: number
|
||||
_clearModelGeneration?: number
|
||||
pages?: { version?: number }[]
|
||||
}
|
||||
_model?: { lineLengths?: number[] | Uint32Array }
|
||||
@@ -107,7 +108,10 @@ export function reachRenderInternals(terminal: unknown): SentinelRenderInternals
|
||||
],
|
||||
rendererState: {
|
||||
atlasPages: renderer._charAtlas.pages?.length ?? -1,
|
||||
atlasClearModelGeneration: renderer._charAtlas.clearModelGeneration ?? null,
|
||||
atlasClearModelGeneration:
|
||||
renderer._charAtlas.clearModelGeneration ??
|
||||
renderer._charAtlas._clearModelGeneration ??
|
||||
null,
|
||||
atlasPageVersions: renderer._charAtlas.pages?.map((page) => page.version ?? -1) ?? [],
|
||||
glyphLastSeenClearModelGeneration: glyphRenderer?._lastSeenClearModelGeneration ?? null,
|
||||
glyphTextureVersions:
|
||||
|
||||
Reference in New Issue
Block a user