Sync source edition with VCC Plus 3.7.0 build 63
This commit is contained in:
1 parent
c652a5276d
commit
b2ecec4d87
86 files changed
+10519
-472
No files matched your search
@@ -93,6 +93,8 @@ def check(helper):
|
||||
result = {"result": active["playtest_graphics"]}
|
||||
if request["tool"] == "capture_playtest_audio" and "playtest_audio" in active:
|
||||
result = {"result": active["playtest_audio"]}
|
||||
if request["tool"] in ("start_playtest_video", "stop_playtest_video", "read_playtest_video") and "playtest_video" in active:
|
||||
result = {"result": active["playtest_video"]}
|
||||
if request["tool"] == "get_build_log" and "build_log" in active:
|
||||
result = {"result": active["build_log"]}
|
||||
if request["tool"] == "get_debug_snapshot" and "debug_snapshot" in active:
|
||||
@@ -788,6 +790,56 @@ def check(helper):
|
||||
assert refused["isError"] and not any(x["type"] == "audio" for x in refused["content"])
|
||||
del active["playtest_audio"]
|
||||
|
||||
video_tools = {"start_playtest_video", "stop_playtest_video", "read_playtest_video"}
|
||||
for kind, toolset, play, video in (("cmoc", 11, True, True), ("assembly", 12, True, True),
|
||||
("cmoc", 12, False, True), ("cmoc", 12, 1, True),
|
||||
("cmoc", 12, True, False), ("cmoc", 12, True, 1),
|
||||
("cmoc", 12, True, "yes"), ("cmoc", 12, True, True)):
|
||||
write_grant(kind=kind, toolset=toolset, playtest=play, playtestVideo=video, token=active["token"])
|
||||
with Client(helper, grant_file) as c:
|
||||
c.handshake("2025-11-25")
|
||||
catalog = {t["name"]: t for t in c.request("tools/list")["result"]["tools"]}
|
||||
enabled = kind == "cmoc" and toolset >= 12 and play is True and video is True
|
||||
assert video_tools.intersection(catalog) == (video_tools if enabled else set())
|
||||
if not enabled:
|
||||
continue
|
||||
assert catalog["start_playtest_video"]["annotations"]["readOnlyHint"] is False
|
||||
assert catalog["stop_playtest_video"]["annotations"]["readOnlyHint"] is False
|
||||
assert catalog["read_playtest_video"]["annotations"]["readOnlyHint"] is True
|
||||
for tool in video_tools:
|
||||
assert catalog[tool]["inputSchema"]["additionalProperties"] is False
|
||||
active["playtest_video"] = {"run_id":"owned", "video_recording":{"status":"recording"}}
|
||||
for args in ({"run_id":"owned", "request_id":"begin"},
|
||||
{"run_id":"owned", "request_id":"begin", "include_audio":False, "max_fields":3600}):
|
||||
assert c.call("start_playtest_video", **args)["result"]["structuredContent"] == active["playtest_video"]
|
||||
assert c.call("stop_playtest_video", run_id="owned", request_id="end")["result"]["structuredContent"] == active["playtest_video"]
|
||||
count = len(active["requests"])
|
||||
for update in ({"max_fields":0}, {"max_fields":3601}, {"max_fields":True}, {"max_fields":1.5},
|
||||
{"include_audio":1}, {"include_audio":"yes"}, {"path":"/tmp/private"}):
|
||||
args = {"run_id":"owned", "request_id":"bad", **update}
|
||||
assert c.call("start_playtest_video", **args)["result"]["isError"], update
|
||||
assert c.call("stop_playtest_video",run_id="owned",request_id="bad",path="/tmp/private")["result"]["isError"]
|
||||
for update in ({"offset":-1}, {"offset":True}, {"offset":67108865}, {"limit":0},
|
||||
{"limit":65537}, {"limit":True}, {"path":"/tmp/private"}):
|
||||
assert c.call("read_playtest_video",run_id="owned",clip_id="clip",**update)["result"]["isError"], update
|
||||
assert count == len(active["requests"]), "Invalid video requests must never reach the host"
|
||||
payload = b"\x00\x00\x00\x18ftypmp42" + bytes(range(256)) * 255
|
||||
chunk = dict(run_id="owned", clip_id="clip", video_chunk_base64=base64.b64encode(payload).decode(),
|
||||
offset=0,next_offset=len(payload),byte_count=len(payload),eof=True,
|
||||
sha256=hashlib.sha256(payload).hexdigest(),mime_type="video/mp4")
|
||||
active["playtest_video"] = chunk
|
||||
result = c.call("read_playtest_video",run_id="owned",clip_id="clip")["result"]
|
||||
assert result["structuredContent"] == chunk
|
||||
assert json.loads(result["content"][0]["text"]) == chunk
|
||||
for update in ({"video_chunk_base64":"!"}, {"next_offset":len(payload)+1}, {"byte_count":67108865},
|
||||
{"offset":1}, {"eof":False}, {"sha256":"x"*64}, {"clip_id":"foreign"},
|
||||
{"mime_type":"audio/wav"}, {"video_chunk_base64":"", "next_offset":0}):
|
||||
active["playtest_video"] = {**chunk, **update}
|
||||
assert c.call("read_playtest_video",run_id="owned",clip_id="clip")["result"]["isError"], update
|
||||
active["playtest_video"] = {**chunk, "video_chunk_base64":"", "offset":len(payload), "next_offset":len(payload)}
|
||||
assert c.call("read_playtest_video",run_id="owned",clip_id="clip",offset=len(payload))["result"]["structuredContent"]["eof"] is True
|
||||
del active["playtest_video"]
|
||||
|
||||
write_grant(version=2, kind="archive", token=active["token"], canPropose=True, toolset=3)
|
||||
with Client(helper, grant_file) as c:
|
||||
c.handshake("2025-11-25")
|
||||
|
||||
Reference in new issue
Block a user