Initial Beta build
All checks were successful
Validate and publish Kaleido / android (push) Successful in 2m27s
All checks were successful
Validate and publish Kaleido / android (push) Successful in 2m27s
This commit is contained in:
commit
2b585badac
65 changed files with 3535 additions and 0 deletions
22
scripts/check_video.py
Normal file
22
scripts/check_video.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
"""Regression loop: play the known live test title at 90s and assert visible video."""
|
||||
import pathlib, sys, time, re
|
||||
sys.path.insert(0,str(pathlib.Path(__file__).resolve().parent))
|
||||
from device import adb,OUT
|
||||
from PIL import Image
|
||||
import io
|
||||
mode=int(sys.argv[1]) if len(sys.argv)>1 else 0
|
||||
adb('shell','am','force-stop','tv.kaleido.app')
|
||||
adb('shell','am','start','-n','tv.kaleido.app/.MainActivity','--es','testTitleId','9776','--el','testOffset','90000','--ei','testMode',str(mode))
|
||||
time.sleep(12)
|
||||
pid=adb('shell','pidof','tv.kaleido.app').decode().strip()
|
||||
assert pid,'Kaleido process exited during playback'
|
||||
logs=adb('logcat','-d','-t','1000','--pid='+pid,'-s','KaleidoPlayback:I','AndroidRuntime:E','*:S').decode(errors='replace')
|
||||
assert 'READY item=' in logs,'Player never reached READY: '+logs[-3000:]
|
||||
assert re.search(r'topResumedActivity=.*tv\.kaleido\.app',adb('shell','dumpsys','activity','activities').decode(errors='replace')),'Kaleido is not the foreground activity'
|
||||
raw=adb('exec-out','screencap','-p');(OUT/f'video-mode-{mode}.png').write_bytes(raw)
|
||||
im=Image.open(io.BytesIO(raw)).convert('RGB')
|
||||
pixels=list(im.crop((450,150,1750,600)).getdata())
|
||||
visible=sum(max(p)>32 for p in pixels)/len(pixels)
|
||||
print(f'Video region visible pixels: {visible:.1%}')
|
||||
assert visible>.05,'BLACK VIDEO: decoded picture is not visible'
|
||||
print('PASS: actual video picture is visible')
|
||||
Loading…
Add table
Add a link
Reference in a new issue