提交 1e9e0fb1 编写于 作者: W wangzx0705

modify the output deviceinfo cases

Signed-off-by: Nwangzx0705 <wangzx0705@thundersoft.com>
上级 c0bedd19
...@@ -137,10 +137,11 @@ export default function audioRendererTest() { ...@@ -137,10 +137,11 @@ export default function audioRendererTest() {
it('SUB_MULTIMEDIA_AUDIO_RENDERER_GETCURRENTOUTPUTDEVICES_PROMISE_0100', 0, async function (done) { it('SUB_MULTIMEDIA_AUDIO_RENDERER_GETCURRENTOUTPUTDEVICES_PROMISE_0100', 0, async function (done) {
try { try {
await audioRen.getCurrentOutputDevices().then((data) => { await audioRen.getCurrentOutputDevices().then((data) => {
console.info(`${TagFrmwkRender}: deviceRole:${data.deviceRole}, deviceType:${data.deviceType}, id:${data.id}, name:${data.name}, address:${data.address}, sampleRates:${data.sampleRates}, channelCounts:${data.channelCounts}, channelMasks:${data.channelMasks}`); console.info(`${TagFrmwkRender}: deviceRole:${data[0].deviceRole}, deviceType:${data[0].deviceType}, id:${data[0].id}, name:${data[0].name},
expect(data.deviceRole).assertEqual(audio.DeviceRole.OUTPUT_DEVICE); address:${data[0].address}, sampleRates:${data[0].sampleRates}, channelCounts:${data[0].channelCounts}, channelMasks:${data[0].channelMasks}`);
expect(data.deviceType).assertEqual(audio.DeviceType.SPEAKER); expect(data[0].deviceRole).assertEqual(audio.DeviceRole.OUTPUT_DEVICE);
expect(data.id).assertEqual(env.OUTPUT_NUMBER_1); expect(data[0].deviceType).assertEqual(audio.DeviceType.SPEAKER);
expect(data[0].id).assertEqual(env.OUTPUT_NUMBER_1);
done(); done();
}).catch((error) => { }).catch((error) => {
console.log("${TagFrmwkRender}: getCurrentOutputDevices error = " + error); console.log("${TagFrmwkRender}: getCurrentOutputDevices error = " + error);
...@@ -166,10 +167,11 @@ export default function audioRendererTest() { ...@@ -166,10 +167,11 @@ export default function audioRendererTest() {
try { try {
await renderPlay(); await renderPlay();
await audioRen.getCurrentOutputDevices().then((data) => { await audioRen.getCurrentOutputDevices().then((data) => {
console.info(`${TagFrmwkRender}: deviceRole:${data.deviceRole}, deviceType:${data.deviceType}, id:${data.id}, address:${data.address}, sampleRates:${data.sampleRates}, channelCounts:${data.channelCounts}, channelMasks:${data.channelMasks}`); console.info(`${TagFrmwkRender}: deviceRole:${data[0].deviceRole}, deviceType:${data[0].deviceType}, id:${data[0].id},
expect(data.deviceRole).assertEqual(audio.DeviceRole.OUTPUT_DEVICE); address:${data[0].address}, sampleRates:${data[0].sampleRates}, channelCounts:${data[0].channelCounts}, channelMasks:${data[0].channelMasks}`);
expect(data.deviceType).assertEqual(audio.DeviceType.SPEAKER); expect(data[0].deviceRole).assertEqual(audio.DeviceRole.OUTPUT_DEVICE);
expect(data.id).assertEqual(env.OUTPUT_NUMBER_1); expect(data[0].deviceType).assertEqual(audio.DeviceType.SPEAKER);
expect(data[0].id).assertEqual(env.OUTPUT_NUMBER_1);
console.info(`${TagFrmwkRender}: Renderer get current output device SUCCESS, now stop audiorender`); console.info(`${TagFrmwkRender}: Renderer get current output device SUCCESS, now stop audiorender`);
audioRen.drain().then(() => { audioRen.drain().then(() => {
console.info(`${TagFrmwkRender}: Renderer drain : SUCCESS, stop audiorender`); console.info(`${TagFrmwkRender}: Renderer drain : SUCCESS, stop audiorender`);
...@@ -207,10 +209,11 @@ export default function audioRendererTest() { ...@@ -207,10 +209,11 @@ export default function audioRendererTest() {
console.info(`${TagFrmwkRender}: getCurrentOutputDevices ERROR ! code: ${err.code}, mesage: ${err.message}`); console.info(`${TagFrmwkRender}: getCurrentOutputDevices ERROR ! code: ${err.code}, mesage: ${err.message}`);
expect(false).assertTrue(); expect(false).assertTrue();
} else { } else {
console.info(`${TagFrmwkRender}: deviceRole:${data.deviceRole}, deviceType:${data.deviceType}, id:${data.id}, address:${data.address}, sampleRates:${data.sampleRates}, channelCounts:${data.channelCounts}, channelMasks:${data.channelMasks}`); console.info(`${TagFrmwkRender}: deviceRole:${data[0].deviceRole}, deviceType:${data[0].deviceType}, id:${data[0].id},
expect(data.deviceRole).assertEqual(audio.DeviceRole.OUTPUT_DEVICE); address:${data[0].address}, sampleRates:${data[0].sampleRates}, channelCounts:${data[0].channelCounts}, channelMasks:${data[0].channelMasks}`);
expect(data.deviceType).assertEqual(audio.DeviceType.SPEAKER); expect(data[0].deviceRole).assertEqual(audio.DeviceRole.OUTPUT_DEVICE);
expect(data.id).assertEqual(env.OUTPUT_NUMBER_1); expect(data[0].deviceType).assertEqual(audio.DeviceType.SPEAKER);
expect(data[0].id).assertEqual(env.OUTPUT_NUMBER_1);
done(); done();
} }
}); });
...@@ -232,10 +235,11 @@ export default function audioRendererTest() { ...@@ -232,10 +235,11 @@ export default function audioRendererTest() {
expect(false).assertTrue(); expect(false).assertTrue();
done(); done();
} else { } else {
console.info(`${TagFrmwkRender}: getCurrentOutputDevices :deviceRole:${data.deviceRole}, deviceType:${data.deviceType}, id:${data.id}, address:${data.address}, sampleRates:${data.sampleRates}, channelCounts:${data.channelCounts}, channelMasks:${data.channelMasks}`); console.info(`${TagFrmwkRender}: getCurrentOutputDevices :deviceRole:${data[0].deviceRole}, deviceType:${data[0].deviceType}, id:${data[0].id},
expect(data.deviceRole).assertEqual(audio.DeviceRole.OUTPUT_DEVICE); address:${data[0].address}, sampleRates:${data[0].sampleRates}, channelCounts:${data[0].channelCounts}, channelMasks:${data[0].channelMasks}`);
expect(data.deviceType).assertEqual(audio.DeviceType.SPEAKER); expect(data[0].deviceRole).assertEqual(audio.DeviceRole.OUTPUT_DEVICE);
expect(data.id).assertEqual(env.OUTPUT_NUMBER_1); expect(data[0].deviceType).assertEqual(audio.DeviceType.SPEAKER);
expect(data[0].id).assertEqual(env.OUTPUT_NUMBER_1);
console.info(`${TagFrmwkRender}: Renderer getCurrentOutputDevices SUCCESS! now stop the audiorenderer`); console.info(`${TagFrmwkRender}: Renderer getCurrentOutputDevices SUCCESS! now stop the audiorenderer`);
audioRen.drain().then(() => { audioRen.drain().then(() => {
console.info(`${TagFrmwkRender}: Renderer drain, stop the audiorenderer`); console.info(`${TagFrmwkRender}: Renderer drain, stop the audiorenderer`);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册