未验证 提交 cf9eae13 编写于 作者: O openharmony_ci 提交者: Gitee

!9581 add volumeEvent返回值断言

Merge pull request !9581 from 秦莉文/OpenHarmony-4.0-Beta2
...@@ -476,8 +476,16 @@ export default function audioManagerApi9() { ...@@ -476,8 +476,16 @@ export default function audioManagerApi9() {
*/ */
it('SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ON_VOLUMECHANGE_0100', 3, async function (done) { it('SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ON_VOLUMECHANGE_0100', 3, async function (done) {
let audioVolumeManager = audioManager.getVolumeManager(); let audioVolumeManager = audioManager.getVolumeManager();
audioVolumeManager.on('volumeChange', (VolumeEvent) => { }); let maxVolume = await audioManager.getMaxVolume(audio.AudioVolumeType.MEDIA)
expect(true).assertTrue(); let minVolume = await audioManager.getMinVolume(audio.AudioVolumeType.MEDIA)
await audioManager.setVolume(audio.AudioVolumeType.MEDIA, maxVolume)
audioVolumeManager.on('volumeChange', (VolumeEvent) => {
console.info(`SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ON_VOLUMECHANGE_0100 VolumeEvent.volumeType: ${VolumeEvent.volumeType}, VolumeEvent.volume:${VolumeEvent.volume}, VolumeEvent.updateUi:${VolumeEvent.updateUi}`);
expect(VolumeEvent.volumeType).assertEqual(audio.AudioVolumeType.MEDIA);
expect(VolumeEvent.volume).assertEqual(minVolume);
expect(VolumeEvent.updateUi).assertEqual(false);
});
await audioManager.setVolume(audio.AudioVolumeType.MEDIA, minVolume)
done(); done();
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册