11 lines
1.4 KiB
JavaScript
11 lines
1.4 KiB
JavaScript
import { readFile } from 'node:fs/promises'
|
|
import { resolve } from 'node:path'
|
|
|
|
const root = resolve(new URL('..', import.meta.url).pathname)
|
|
const report = JSON.parse(await readFile(resolve(root, 'config/chrome-native-history-verification.json'), 'utf8'))
|
|
if (report.status !== 'pass' || report.browserId !== 'chrome' || report.crossOriginIsolated !== true) throw new Error('Chrome native history verification is not passing.')
|
|
if (report.capabilities?.status !== 'ready' || report.nativeCapabilities?.availability !== 'available' || report.nativeCapabilities?.transport !== 'step-text' || report.nativeCapabilities?.operations?.includes('cut') !== true) throw new Error('Native OCCT history Worker capability evidence is incomplete.')
|
|
if (!Number.isSafeInteger(report.history?.recordCount) || report.history.recordCount <= 0 || !report.history.relations?.modified && !report.history.relations?.generated && !report.history.relations?.deleted) throw new Error('Native OCCT history relation evidence is empty.')
|
|
if (report.afterRelease?.shapeCount !== 0 || report.afterRelease?.kernelReferenceCount !== 0) throw new Error('Chrome native history handles were not released.')
|
|
console.log(JSON.stringify({ status: 'chrome-native-history-pass', browser: report.browserId, occtVersion: report.nativeCapabilities.occtVersion, records: report.history.recordCount, afterRelease: report.afterRelease }, null, 2))
|