mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-25 15:56:01 +00:00
feat: validate Quest guest frame entrypoint
This commit is contained in:
1 parent
040d31c1ee
commit
2ef2d4b53d
13 files changed
+245
-45
No files matched your search
@@ -25,7 +25,7 @@ def main():
|
||||
return subprocess.run([args.adb, '-s', serial, *command], check=True,
|
||||
capture_output=True, text=True, timeout=30).stdout
|
||||
|
||||
for name in ('test_xr_frames', 'send_xr_frame'):
|
||||
for name in ('test_xr_tracking', 'test_xr_frames', 'send_xr_frame'):
|
||||
binary = args.native_tests / name
|
||||
if not binary.is_file():
|
||||
parser.error(f'Missing Android executable: {binary}')
|
||||
@@ -33,7 +33,8 @@ def main():
|
||||
adb('push', str(binary), remote)
|
||||
adb('shell', 'run-as', package, 'cp', remote, f'./{name}')
|
||||
adb('shell', 'run-as', package, 'chmod', '700', f'./{name}')
|
||||
unit_output = adb('shell', 'run-as', package, './test_xr_frames', './files')
|
||||
unit_output = adb('shell', 'run-as', package, './test_xr_tracking', './files')
|
||||
unit_output += adb('shell', 'run-as', package, './test_xr_frames', './files')
|
||||
adb('shell', 'am', 'force-stop', package)
|
||||
adb('shell', 'rm', '-f', health_path)
|
||||
failure = None
|
||||
@@ -61,12 +62,25 @@ def main():
|
||||
time.sleep(0.2)
|
||||
except (subprocess.CalledProcessError, subprocess.TimeoutExpired, json.JSONDecodeError) as error:
|
||||
failure = f'Frame channel operation failed: {error}'
|
||||
if isinstance(error, subprocess.CalledProcessError) and error.stderr:
|
||||
failure += f' {error.stderr.strip()}'
|
||||
finally:
|
||||
try:
|
||||
sample = json.loads(adb('shell', 'cat', health_path))
|
||||
if not samples or sample != samples[-1]:
|
||||
samples.append(sample)
|
||||
except (subprocess.CalledProcessError, subprocess.TimeoutExpired, json.JSONDecodeError):
|
||||
pass
|
||||
try:
|
||||
adb('shell', 'am', 'broadcast', '-a', 'com.oculus.vrpowermanager.prox_far')
|
||||
adb('shell', 'am', 'force-stop', package)
|
||||
except (subprocess.CalledProcessError, subprocess.TimeoutExpired):
|
||||
failure = failure or 'Could not restore headset proximity after testing'
|
||||
try:
|
||||
log = adb('logcat', '-d', '-s', 'DroidDeckXR:I', 'AndroidRuntime:E')
|
||||
(args.output / 'logcat.txt').write_text(log, encoding='utf-8')
|
||||
except (subprocess.CalledProcessError, subprocess.TimeoutExpired):
|
||||
pass
|
||||
latest = samples[-1] if samples else {}
|
||||
if not failure:
|
||||
if latest.get('source') != 'frames' or latest.get('receivedFrames') != sent.get('sent'):
|
||||
|
||||
Reference in new issue
Block a user