Open
test: add integration tests for AudioService.positionStream and model field read assertions (2 files, 7 cases) #70
程皖OrzAdd on 4 hours ago
test: add integration tests for AudioService.positionStream and model field read assertions (2 files, 7 cases) #70
Open
Merge blocked
4 hours ago Associated issue: [新需求] 补齐 audio_service integration 测试覆盖率:新增 7 用例覆盖 positionStream 与模型字段断言
4 hours ago Associated issue: [新需求] 补齐 audio_service integration 测试覆盖率:新增 7 用例覆盖 positionStream 与模型字段断言
程皖Orz
4 hours ago Comments:
4 hours ago Comments:
Start build


openharmony_ci
4 hours ago Comments:
4 hours ago Comments:
修改点
本次意图改动仅为 2 个新增测试文件(共 7 条用例,229 行),不改动库业务源码(audio_service/lib 与平台实现零变更):
audio_service/example/integration_test/position_stream_test.dart(新增,1 用例):覆盖基线集成覆盖率扫描中唯一未覆盖接口AudioService.positionStream(@Deprecated 兼容字段)——按既有 api_coverage 套件模式 mock 插件 MethodChannel 后调用 AudioService.init,验证 positionStream 种子值为 Duration.zero 并转发 handler playbackState 的位置更新;audio_service/example/integration_test/model_field_read_assertions_test.dart(新增,6 用例):为基线 16 条"仅具名参数兜底"字段补成员读取断言——PlaybackState 7 字段构造往返 + 默认值(2 例)、MediaItem 7 字段往返 + 默认 null(2 例)、AudioServiceConfig.androidNotificationChannelName(1 例)、AudioServiceWidget.child 兼容行为(1 例)。方案说明(AI输出)
测试情况
新增测试用例
audio_service/example/integration_test/position_stream_test.dart→ ✅ 通过(1 用例)audio_service/example/integration_test/model_field_read_assertions_test.dart→ ✅ 通过(6 用例)触发的已有测试用例
本工程 br_3.41_dev
audio_service/example/integration_test/app_test.dart(7 用例)与新增 7 用例共同在鸿蒙真机(CHZ-AL60,OpenHarmony 6.1,API 23,Flutter 3.41-ohos)全量执行:14/14 全部通过(100%),测试事件流正常捕获(doneEventCaptured=true)。手动验证
资料修改
依赖关系变更
无
关联 Issue
Closes #77(#77)
Checklist