mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 00:02:31 +00:00
test(mobile): pin the decoded screencast frame with the base64 it now carries (OTA phase C, C6) (#21769)
C6.1 (#21758) pinned the frame `decodeBridgeScreencastFrame` hands back with an exact `toEqual`; C6.2 (#21754) made that decoder carry the wire's `b64` on the frame so the page's data URI can reuse it. Each PR was green against the main it branched from, and their squashes together red two of C6.1's cases on main. The pins stay exact and gain the field, with the encoded string spelled out rather than wildcarded. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
This commit is contained in:
@@ -90,7 +90,11 @@ describe('a binary frame crosses as the event the page decodes', () => {
|
||||
expect(event).toMatchObject({ v: 1, type: 'event', id: ID, seq: 1 })
|
||||
const binary = 'binary' in event ? event.binary : null
|
||||
expect(binary).not.toBeNull()
|
||||
expect(binary === null ? null : decodeBridgeScreencastFrame(binary)).toEqual(frame(41, IMAGE))
|
||||
// The decoded frame carries the wire's own base64 beside the bytes (C6.2's data-URI reuse).
|
||||
expect(binary === null ? null : decodeBridgeScreencastFrame(binary)).toEqual({
|
||||
...frame(41, IMAGE),
|
||||
b64: binary?.b64
|
||||
})
|
||||
})
|
||||
|
||||
/** One ledger, not two: the page acks by the event seq, so a binary frame that restarted or
|
||||
|
||||
@@ -44,12 +44,15 @@ describe('the shell encodes a screencast frame the page can decode', () => {
|
||||
frameOf(Uint8Array.of(1, 2, 3), { format: 'png', seq: 77, metadata })
|
||||
)
|
||||
expect(event).toEqual({ b64: expect.any(String), format: 'png', frameSeq: 77, metadata })
|
||||
// `b64` rides on the decoded frame so the page's data URI can reuse it (C6.2); exact, so a
|
||||
// re-encode on either side cannot hide behind a wildcard.
|
||||
expect(decodeBridgeScreencastFrame(event)).toEqual({
|
||||
opcode: BrowserScreencastOpcode.Frame,
|
||||
seq: 77,
|
||||
format: 'png',
|
||||
metadata,
|
||||
image: Uint8Array.of(1, 2, 3)
|
||||
image: Uint8Array.of(1, 2, 3),
|
||||
b64: 'AQID'
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user