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,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')
|
||||
Reference in New Issue
Block a user