feat: show skip offer countdown and transitions
This commit is contained in:
@@ -331,6 +331,48 @@ def check_cli_instances(root, app, fixtures):
|
||||
wait_states(count, lambda _: True, "original players survive independent resolved GUI quits")
|
||||
print("PASS actual resolved CLI handoff: two isolated GUI episodes, authenticated encrypted HLS, independent default VTT, v2 progress and quit")
|
||||
|
||||
def check_stream_queue_instance():
|
||||
# DEBUG-queue-startup: distinguish queue startup from ordinary empty startup.
|
||||
invoke(["--new-instance", "--no-config"])
|
||||
empty_states = wait_states(1, lambda _: True, "diagnostic empty startup creates its window")
|
||||
quit_instance(next(iter(empty_states)), 1)
|
||||
wait_states(0, lambda _: True, "diagnostic empty startup quits")
|
||||
session = (root / "stream-queue-session").resolve()
|
||||
session.mkdir(mode=0o700)
|
||||
paths = [session / "first.jsonl", session / "second.jsonl"]
|
||||
urls = [reported_urls[0], canonical] # Deliberately not alphabetical URL order.
|
||||
manifest = session / "queue.json"
|
||||
manifest.write_text(json.dumps({"version": 1, "items": [
|
||||
{"url": url, "progress_file": str(path)} for url, path in zip(urls, paths)]}))
|
||||
invoke(["--new-instance", "--no-config", "--queue-file", str(manifest)])
|
||||
states = wait_states(1, lambda snapshots: all(
|
||||
state["queueURLs"] == urls and state["queueIndex"] == 0 and not state["busy"]
|
||||
and state["status"] == 3 and state["hasVideo"] and state["position"] > 0.2
|
||||
for state in snapshots.values()), "actual queue CLI delivers ordered native stream playback")
|
||||
pid = next(iter(states))
|
||||
if paths[1].exists():
|
||||
raise RuntimeError("unselected queue entry must not create or write its report")
|
||||
input_request(pid, 1, lambda state: state["queueIndex"] == 1 and not state["busy"]
|
||||
and state["status"] == 3, "native queue manual next", action="queueAdvance", offset=1)
|
||||
input_request(pid, 1, lambda state: state["queueIndex"] == 0 and not state["busy"]
|
||||
and state["status"] == 3, "native queue previous revisits owned report", action="queueAdvance", offset=-1)
|
||||
states = input_request(pid, 1, lambda state: state["status"] == 2 and not state["busy"],
|
||||
"pause queue first item", action="pause")
|
||||
target = states[pid]["duration"] - 0.3
|
||||
input_request(pid, 1, lambda state: at_position(state, target),
|
||||
"acknowledged queue end seek", action="seek", position=target)
|
||||
input_request(pid, 1, lambda state: state["queueIndex"] == 1 and not state["busy"]
|
||||
and state["status"] == 3 and state["queueURLs"] == urls,
|
||||
"natural end advances without losing supplied queue", action="play")
|
||||
quit_instance(pid, 1)
|
||||
for path, url in zip(paths, urls):
|
||||
rows = wait_report(path, {url}, lambda rows: bool(rows) and rows[-1]["event"] == "closed",
|
||||
"queue quit drains independent stable report")
|
||||
if len(rows) < 4:
|
||||
raise RuntimeError(f"queue revisit must append without clobbering earlier records: {path}: {rows}")
|
||||
wait_states(0, lambda _: True, "queue GUI quit leaves no stale instance")
|
||||
print("PASS actual queue CLI: ordered lazy streams, manual next/previous, natural end advance and private report revisits")
|
||||
|
||||
resolved_fixtures(fixtures)
|
||||
with StartupStreamingServer(fixtures) as server:
|
||||
if extractor and runtime:
|
||||
@@ -365,9 +407,16 @@ def check_cli_instances(root, app, fixtures):
|
||||
runtime_settings = {"directory": str(root), "path": str(root) + os.pathsep + os.environ.get("PATH", "")}
|
||||
(app / "Contents/Resources/cli-check.json").write_text(json.dumps(runtime_settings))
|
||||
subprocess.run(["codesign", "--force", "--sign", "-", str(app)], check=True)
|
||||
if os.environ.get("TEREBI_CHECK_STREAM_QUEUE_ONLY") == "1":
|
||||
if not extractor or not runtime:
|
||||
raise RuntimeError("stream queue CLI smoke requires bundled extractor and runtime fixtures")
|
||||
check_stream_queue_instance()
|
||||
return
|
||||
if os.environ.get("TEREBI_CHECK_RESOLVED_ONLY") == "1":
|
||||
check_resolved_instances(server, 0)
|
||||
return
|
||||
if extractor and runtime:
|
||||
check_stream_queue_instance()
|
||||
movie = fixtures / "cache.mp4"
|
||||
audio = root / "audio with spaces.wav"
|
||||
shutil.copy2(fixtures / "audio.wav", audio)
|
||||
@@ -721,6 +770,9 @@ with tempfile.TemporaryDirectory(prefix="terebi-startup-") as directory:
|
||||
descriptor = os.open(pipe, os.O_RDONLY | os.O_NONBLOCK)
|
||||
launch = None
|
||||
try:
|
||||
if os.environ.get("TEREBI_CHECK_STREAM_QUEUE_ONLY") == "1":
|
||||
check_cli_instances(root, app, fixtures)
|
||||
sys.exit(0)
|
||||
with selectors.DefaultSelector() as selector:
|
||||
selector.register(descriptor, selectors.EVENT_READ)
|
||||
launch = subprocess.Popen(
|
||||
|
||||
Reference in New Issue
Block a user