Served with isolation headers; start-screen capability notices; tests on the real GPU (t88 phase 1)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Print isolation, WebGPU adapter info and GL renderer for installed browsers."""
|
||||
import argparse
|
||||
import json
|
||||
|
||||
from use_venv import ensure_playwright
|
||||
ensure_playwright()
|
||||
from browser import capabilities, gpu_option, installed, launch
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
gpu_option(parser)
|
||||
options = parser.parse_args()
|
||||
for name in ['chromium', 'firefox']:
|
||||
if not installed(name):
|
||||
print(f'SKIP {name}: Playwright browser is not installed')
|
||||
continue
|
||||
with launch(gpu=options.gpu, browser_name=name) as (browser, page, url):
|
||||
page.goto(url)
|
||||
caps = capabilities(page)
|
||||
print(f'{name} {browser.version}: {json.dumps(caps)}', flush=True)
|
||||
assert caps['isolated'], 'Server did not isolate the page'
|
||||
if name == 'chromium' and options.gpu == 'real':
|
||||
assert caps['webgpu'] and caps['adapterInfo'] is not None, 'No headless WebGPU adapter'
|
||||
assert caps['adapterInfo']['architecture'] != 'swiftshader', 'Software WebGPU in real mode'
|
||||
assert not any(s in (caps['renderer'] or '').lower() for s in ['swiftshader', 'llvmpipe', 'softpipe']), 'Software GL in real mode'
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user