feat: 完善机巢图传、拍摄阶段与任务交互

- 完善双路 RTC 接收、首帧切换及拍摄结束后的本地播放释放
- 对齐无人机状态枚举与正常拍完返航标记,新增到达后本地倒计时
- 补充准备页电量与前往回执,进入任务时移除准备页路由
- 对齐拍摄中和拍摄完成原型布局,移除详情按钮
- 补充隔离测试、接口记录与项目约定

验证:最近 157 项相关模拟器隔离测试通过,Release 无签名编译通过;未调用真实飞控或图传。
This commit is contained in:
2026-11-03 16:43:23 +08:00
parent 0ed0077ec4
commit 54210925f0
33 changed files with 3242 additions and 205 deletions
@@ -5,6 +5,25 @@ import XCTest
/// 验证禁飞调试在进入传输层之前拦截真实操作,所有探针本身也不联网。
@MainActor
final class DeviceCommandDebugPolicyTests: XCTestCase {
/// 不联网核对编译策略:Release 保留准备页电量参数,Debug 强制缓存;不开放任务实时采集。
func testPreparationBatteryPolicyIsScopedToBuildAndEndpoint() throws {
for (path, key) in [("plane-status", "live_battery"), ("shooting", "live_battery"), ("status", "live_metrics")] {
for value in ["0", "1"] {
var request = URLRequest(url: try XCTUnwrap(URL(string:
"https://policy.invalid/api/app/airport/\(path)?scenic_id=128&\(key)=\(value)")))
request.httpMethod = "GET"
let prepared = try DeviceCommandDebugPolicy.prepare(request, isLocalSimulation: false)
let items = try XCTUnwrap(URLComponents(url: XCTUnwrap(prepared.url), resolvingAgainstBaseURL: false)?.queryItems)
#if DEBUG
let expected = "0"
#else
let expected = path == "plane-status" ? value : "0"
#endif
XCTAssertEqual(items.first { $0.name == key }?.value, expected)
XCTAssertEqual(items.first { $0.name == "scenic_id" }?.value, "128")
}
}
}
/// 用户授权 Release 真机操作,当前模拟器 Debug 测试仍必须禁止真实飞控。
func testDebugKeepsFlightRestriction() {
XCTAssertTrue(DeviceCommandDebugPolicy.blocksFlightRequests)