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:
2026-10-27 19:11:42 -04:00
co-authored by Claude Opus 5.5
parent 9781aa3ee1
commit b2c9ad9533
22 changed files with 376 additions and 91 deletions
+38
View File
@@ -0,0 +1,38 @@
"""An isolated Firefox title screen and three seconds of a new pixel world."""
import json
from pathlib import Path
import sys
sys.path.insert(0, str(Path(__file__).resolve().parent.parent / 'tools'))
from use_venv import ensure_playwright
ensure_playwright()
from browser import capabilities, consume_gpu_option, installed, launch
consume_gpu_option()
if not installed('firefox'):
print('SKIP firefox_smoke.py: Playwright Firefox is not installed')
sys.exit(0)
with launch(browser_name='firefox') as (_, page, url):
errors = []
page.on('pageerror', lambda e: errors.append(str(e)))
page.add_init_script("localStorage.setItem('deepgrain.settings', JSON.stringify({look:'pixel', sv:2}));")
page.goto(url)
caps = capabilities(page)
print('Firefox: ' + json.dumps(caps))
assert caps['isolated']
if not caps['webgpu']:
assert page.locator('#cap-notice').is_visible()
text = page.inner_text('#cap-notice')
assert 'about:config' in text and 'dom.webgpu.enabled' in text and 'Firefox Nightly' in text
print('PASS Firefox isolation and capability notice')
page.click('#btn-new')
page.fill('#nw-seed', '424242')
page.select_option('#nw-size', '2048x1024')
page.click('#btn-generate')
page.wait_for_function('GAME.running && !GAME.loading', timeout=60000)
before = page.evaluate('tick')
page.wait_for_timeout(3000)
assert page.evaluate('tick') > before
assert not errors, errors
print('PASS Firefox new world runs for three seconds without page errors')