提交 eceee9bb 编写于 作者: L liyuhang 提交者: wangtao

Added release function for audio renderer napi

Signed-off-by: Nliyuhang <liyuhang24@Huawei.com>
Change-Id: I4fce14202742dff745da01a092a7430d99fe0ec2
上级 8f4cf88b
...@@ -1293,6 +1293,7 @@ describe('audioManagerApi9', function () { ...@@ -1293,6 +1293,7 @@ describe('audioManagerApi9', function () {
} }
done(); done();
}) })
/** /**
*@tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ONRINGMODECHANGE_0100 *@tc.number : SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ONRINGMODECHANGE_0100
*@tc.name : OnRingMode - RINGER_MODE_NORMAL *@tc.name : OnRingMode - RINGER_MODE_NORMAL
...@@ -1580,15 +1581,15 @@ describe('audioManagerApi9', function () { ...@@ -1580,15 +1581,15 @@ describe('audioManagerApi9', function () {
it('SUB_MULTIMEDIA_AUDIO_STREAM_MANAGER_ISACTIVE_0300', 1, async function (done) { it('SUB_MULTIMEDIA_AUDIO_STREAM_MANAGER_ISACTIVE_0300', 1, async function (done) {
try{ try{
const PROMISE = await streamManager.isActive(stringParameter); const PROMISE = await streamManager.isActive(stringParameter);
console.log(`${TagFrmwk}: setMicrophoneMute : FAIL : message:${err.message}`); console.log(`${TagFrmwk}: isActive : FAIL : message:${err.message}`);
expect(false).assertTrue(); expect(false).assertTrue();
} catch (err) { } catch (err) {
console.log('err :' + err.code) console.log('err :' + err.code)
if (err.code == 6800101) { if (err.code == 6800101) {
console.log(`${TagFrmwk}: setMicrophoneMute : PASS : message:${err.message}`); console.log(`${TagFrmwk}: isActive : PASS : message:${err.message}`);
expect(true).assertTrue(); expect(true).assertTrue();
}else { }else {
console.log(`${TagFrmwk}: setMicrophoneMute : FAIL : message:${err.message}`); console.log(`${TagFrmwk}: isActive : FAIL : message:${err.message}`);
expect(false).assertTrue(); expect(false).assertTrue();
} }
} }
...@@ -1609,70 +1610,15 @@ describe('audioManagerApi9', function () { ...@@ -1609,70 +1610,15 @@ describe('audioManagerApi9', function () {
if (err) { if (err) {
console.log('err :' + err.code) console.log('err :' + err.code)
if (err.code == 6800104) { if (err.code == 6800104) {
console.log(`${TagFrmwk}: setMicrophoneMute : PASS : message:${err.message}`); console.log(`${TagFrmwk}: isActive : PASS : message:${err.message}`);
expect(true).assertTrue(); expect(true).assertTrue();
}else { }else {
console.log(`${TagFrmwk}: setMicrophoneMute : FAIL : message:${err.message}`); console.log(`${TagFrmwk}: isActive : FAIL : message:${err.message}`);
expect(false).assertTrue(); expect(false).assertTrue();
} }
} }
else { else {
console.error(`audioManagerErrorCodeTest: failed to setMicrophoneMute: Callback: ${err.message}`); console.error(`audioManagerErrorCodeTest: failed to isActive: Callback: ${err.message}`);
expect(false).assertTrue();
};
done();
});
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_STREAM_MANAGER_ISACTIVE_0300
*@tc.name : isActive - Media - Promise
*@tc.desc : isActive - Media - Promise - When stream is NOT playing
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 1
*/
it('SUB_MULTIMEDIA_AUDIO_STREAM_MANAGER_ISACTIVE_0300', 1, async function (done) {
try{
const PROMISE = await streamManager.isActive(stringParameter);
console.log(`${TagFrmwk}: setMicrophoneMute : FAIL : message:${err.message}`);
expect(false).assertTrue();
} catch (err) {
console.log('err :' + err.code)
if (err.code == 6800101) {
console.log(`${TagFrmwk}: setMicrophoneMute : PASS : message:${err.message}`);
expect(true).assertTrue();
}else {
console.log(`${TagFrmwk}: setMicrophoneMute : FAIL : message:${err.message}`);
expect(false).assertTrue();
}
}
done();
})
/**
*@tc.number : SUB_MULTIMEDIA_AUDIO_STREAM_MANAGER_ISACTIVE_0400
*@tc.name : isActive - Media - Callback
*@tc.desc : isActive - Media - Callback - When stream is NOT playing
*@tc.size : MEDIUM
*@tc.type : Function
*@tc.level : Level 1
*/
it('SUB_MULTIMEDIA_AUDIO_STREAM_MANAGER_ISACTIVE_0400', 1, function (done) {
console.log(`${TagFrmwk}: Callback : isActive Media: NOTE: audio NOT PLAYING as MEDIA for the test case to PASS`);
streamManager.isActive(numberParameter, (err, data) => {
if (err) {
console.log('err :' + err.code)
if (err.code == 6800104) {
console.log(`${TagFrmwk}: setMicrophoneMute : PASS : message:${err.message}`);
expect(true).assertTrue();
}else {
console.log(`${TagFrmwk}: setMicrophoneMute : FAIL : message:${err.message}`);
expect(false).assertTrue();
}
}
else {
console.error(`audioManagerErrorCodeTest: failed to setMicrophoneMute: Callback: ${err.message}`);
expect(false).assertTrue(); expect(false).assertTrue();
}; };
done(); done();
......
...@@ -1215,7 +1215,7 @@ describe('audioRenderer', function () { ...@@ -1215,7 +1215,7 @@ describe('audioRenderer', function () {
} }
} }
console.info(`${TagFrmwkRender}: Renderer after read`); console.info(`${TagFrmwkRender}: Renderer after read`);
await sleep(2000);
audioRen.getRenderRate((err, data) => { audioRen.getRenderRate((err, data) => {
if (err) { if (err) {
console.info(`${TagFrmwkAudioScene}: getRenderRate : RENDER_RATE_DOUBLE : ERROR : ${err.message}`); console.info(`${TagFrmwkAudioScene}: getRenderRate : RENDER_RATE_DOUBLE : ERROR : ${err.message}`);
...@@ -3304,6 +3304,11 @@ describe('audioRenderer', function () { ...@@ -3304,6 +3304,11 @@ describe('audioRenderer', function () {
if (isPass) { if (isPass) {
resultFlag = true; resultFlag = true;
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
} }
...@@ -3335,7 +3340,11 @@ describe('audioRenderer', function () { ...@@ -3335,7 +3340,11 @@ describe('audioRenderer', function () {
console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`); console.log(`${TagFrmwkRender}: RendererInfo :ERROR: ${err.message}`);
resultFlag = false; resultFlag = false;
}); });
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -3389,6 +3398,11 @@ describe('audioRenderer', function () { ...@@ -3389,6 +3398,11 @@ describe('audioRenderer', function () {
if (isPass) { if (isPass) {
resultFlag = true; resultFlag = true;
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
} }
...@@ -3422,7 +3436,11 @@ describe('audioRenderer', function () { ...@@ -3422,7 +3436,11 @@ describe('audioRenderer', function () {
}); });
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -3476,6 +3494,11 @@ describe('audioRenderer', function () { ...@@ -3476,6 +3494,11 @@ describe('audioRenderer', function () {
if (isPass) { if (isPass) {
resultFlag = true; resultFlag = true;
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
} }
...@@ -3509,7 +3532,11 @@ describe('audioRenderer', function () { ...@@ -3509,7 +3532,11 @@ describe('audioRenderer', function () {
}); });
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -3563,6 +3590,11 @@ describe('audioRenderer', function () { ...@@ -3563,6 +3590,11 @@ describe('audioRenderer', function () {
if (isPass) { if (isPass) {
resultFlag = true; resultFlag = true;
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
} }
...@@ -3596,7 +3628,11 @@ describe('audioRenderer', function () { ...@@ -3596,7 +3628,11 @@ describe('audioRenderer', function () {
}); });
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -3650,6 +3686,11 @@ describe('audioRenderer', function () { ...@@ -3650,6 +3686,11 @@ describe('audioRenderer', function () {
if (isPass) { if (isPass) {
resultFlag = true; resultFlag = true;
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
} }
...@@ -3683,7 +3724,11 @@ describe('audioRenderer', function () { ...@@ -3683,7 +3724,11 @@ describe('audioRenderer', function () {
}); });
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -3737,6 +3782,11 @@ describe('audioRenderer', function () { ...@@ -3737,6 +3782,11 @@ describe('audioRenderer', function () {
if (isPass) { if (isPass) {
resultFlag = true; resultFlag = true;
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
} }
...@@ -3770,7 +3820,11 @@ describe('audioRenderer', function () { ...@@ -3770,7 +3820,11 @@ describe('audioRenderer', function () {
}); });
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -3824,6 +3878,11 @@ describe('audioRenderer', function () { ...@@ -3824,6 +3878,11 @@ describe('audioRenderer', function () {
if (isPass) { if (isPass) {
resultFlag = true; resultFlag = true;
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
} }
...@@ -3857,7 +3916,11 @@ describe('audioRenderer', function () { ...@@ -3857,7 +3916,11 @@ describe('audioRenderer', function () {
}); });
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -3911,6 +3974,11 @@ describe('audioRenderer', function () { ...@@ -3911,6 +3974,11 @@ describe('audioRenderer', function () {
if (isPass) { if (isPass) {
resultFlag = true; resultFlag = true;
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
} }
...@@ -3944,7 +4012,11 @@ describe('audioRenderer', function () { ...@@ -3944,7 +4012,11 @@ describe('audioRenderer', function () {
}); });
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -3998,6 +4070,11 @@ describe('audioRenderer', function () { ...@@ -3998,6 +4070,11 @@ describe('audioRenderer', function () {
if (isPass) { if (isPass) {
resultFlag = true; resultFlag = true;
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
} }
...@@ -4031,7 +4108,11 @@ describe('audioRenderer', function () { ...@@ -4031,7 +4108,11 @@ describe('audioRenderer', function () {
}); });
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -4085,6 +4166,11 @@ describe('audioRenderer', function () { ...@@ -4085,6 +4166,11 @@ describe('audioRenderer', function () {
if (isPass) { if (isPass) {
resultFlag = true; resultFlag = true;
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
} }
...@@ -4118,7 +4204,11 @@ describe('audioRenderer', function () { ...@@ -4118,7 +4204,11 @@ describe('audioRenderer', function () {
}); });
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -4172,6 +4262,11 @@ describe('audioRenderer', function () { ...@@ -4172,6 +4262,11 @@ describe('audioRenderer', function () {
if (isPass) { if (isPass) {
resultFlag = true; resultFlag = true;
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
} }
...@@ -4205,7 +4300,11 @@ describe('audioRenderer', function () { ...@@ -4205,7 +4300,11 @@ describe('audioRenderer', function () {
}); });
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -4259,6 +4358,11 @@ describe('audioRenderer', function () { ...@@ -4259,6 +4358,11 @@ describe('audioRenderer', function () {
if (isPass) { if (isPass) {
resultFlag = true; resultFlag = true;
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
} }
...@@ -4292,7 +4396,11 @@ describe('audioRenderer', function () { ...@@ -4292,7 +4396,11 @@ describe('audioRenderer', function () {
}); });
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -4346,6 +4454,11 @@ describe('audioRenderer', function () { ...@@ -4346,6 +4454,11 @@ describe('audioRenderer', function () {
if (isPass) { if (isPass) {
resultFlag = true; resultFlag = true;
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
} }
...@@ -4379,7 +4492,11 @@ describe('audioRenderer', function () { ...@@ -4379,7 +4492,11 @@ describe('audioRenderer', function () {
}); });
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -4433,6 +4550,11 @@ describe('audioRenderer', function () { ...@@ -4433,6 +4550,11 @@ describe('audioRenderer', function () {
if (isPass) { if (isPass) {
resultFlag = true; resultFlag = true;
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
} }
...@@ -4466,7 +4588,11 @@ describe('audioRenderer', function () { ...@@ -4466,7 +4588,11 @@ describe('audioRenderer', function () {
}); });
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -4520,6 +4646,11 @@ describe('audioRenderer', function () { ...@@ -4520,6 +4646,11 @@ describe('audioRenderer', function () {
if (isPass) { if (isPass) {
resultFlag = true; resultFlag = true;
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
} }
...@@ -4553,7 +4684,11 @@ describe('audioRenderer', function () { ...@@ -4553,7 +4684,11 @@ describe('audioRenderer', function () {
}); });
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -4607,6 +4742,11 @@ describe('audioRenderer', function () { ...@@ -4607,6 +4742,11 @@ describe('audioRenderer', function () {
if (isPass) { if (isPass) {
resultFlag = true; resultFlag = true;
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
} }
...@@ -4640,7 +4780,11 @@ describe('audioRenderer', function () { ...@@ -4640,7 +4780,11 @@ describe('audioRenderer', function () {
}); });
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -4694,6 +4838,11 @@ describe('audioRenderer', function () { ...@@ -4694,6 +4838,11 @@ describe('audioRenderer', function () {
if (isPass) { if (isPass) {
resultFlag = true; resultFlag = true;
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
} }
...@@ -4727,7 +4876,11 @@ describe('audioRenderer', function () { ...@@ -4727,7 +4876,11 @@ describe('audioRenderer', function () {
}); });
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -4781,6 +4934,11 @@ describe('audioRenderer', function () { ...@@ -4781,6 +4934,11 @@ describe('audioRenderer', function () {
if (isPass) { if (isPass) {
resultFlag = true; resultFlag = true;
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
} }
...@@ -4814,7 +4972,11 @@ describe('audioRenderer', function () { ...@@ -4814,7 +4972,11 @@ describe('audioRenderer', function () {
}); });
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -4868,6 +5030,11 @@ describe('audioRenderer', function () { ...@@ -4868,6 +5030,11 @@ describe('audioRenderer', function () {
if (isPass) { if (isPass) {
resultFlag = true; resultFlag = true;
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
} }
...@@ -4901,7 +5068,11 @@ describe('audioRenderer', function () { ...@@ -4901,7 +5068,11 @@ describe('audioRenderer', function () {
}); });
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -4955,6 +5126,11 @@ describe('audioRenderer', function () { ...@@ -4955,6 +5126,11 @@ describe('audioRenderer', function () {
if (isPass) { if (isPass) {
resultFlag = true; resultFlag = true;
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
} }
...@@ -4988,7 +5164,11 @@ describe('audioRenderer', function () { ...@@ -4988,7 +5164,11 @@ describe('audioRenderer', function () {
}); });
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -5042,6 +5222,11 @@ describe('audioRenderer', function () { ...@@ -5042,6 +5222,11 @@ describe('audioRenderer', function () {
if (isPass) { if (isPass) {
resultFlag = true; resultFlag = true;
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
} }
...@@ -5075,7 +5260,11 @@ describe('audioRenderer', function () { ...@@ -5075,7 +5260,11 @@ describe('audioRenderer', function () {
}); });
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -5129,6 +5318,11 @@ describe('audioRenderer', function () { ...@@ -5129,6 +5318,11 @@ describe('audioRenderer', function () {
if (isPass) { if (isPass) {
resultFlag = true; resultFlag = true;
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
} }
...@@ -5162,7 +5356,11 @@ describe('audioRenderer', function () { ...@@ -5162,7 +5356,11 @@ describe('audioRenderer', function () {
}); });
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -5216,6 +5414,11 @@ describe('audioRenderer', function () { ...@@ -5216,6 +5414,11 @@ describe('audioRenderer', function () {
if (isPass) { if (isPass) {
resultFlag = true; resultFlag = true;
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
} }
...@@ -5249,7 +5452,11 @@ describe('audioRenderer', function () { ...@@ -5249,7 +5452,11 @@ describe('audioRenderer', function () {
}); });
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -5303,6 +5510,11 @@ describe('audioRenderer', function () { ...@@ -5303,6 +5510,11 @@ describe('audioRenderer', function () {
if (isPass) { if (isPass) {
resultFlag = true; resultFlag = true;
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
} }
...@@ -5336,7 +5548,11 @@ describe('audioRenderer', function () { ...@@ -5336,7 +5548,11 @@ describe('audioRenderer', function () {
}); });
expect(resultFlag).assertTrue(); expect(resultFlag).assertTrue();
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -6595,6 +6811,7 @@ describe('audioRenderer', function () { ...@@ -6595,6 +6811,7 @@ describe('audioRenderer', function () {
} }
} }
console.info(`${TagFrmwkRender}: Renderer after read`); console.info(`${TagFrmwkRender}: Renderer after read`);
await sleep(2000);
await audioRen.getRenderRate().then((data) => { await audioRen.getRenderRate().then((data) => {
if (data == audio.AudioRendererRate.RENDER_RATE_HALF) { if (data == audio.AudioRendererRate.RENDER_RATE_HALF) {
console.info(`${TagFrmwkRender}: getRenderRate : RENDER_RATE_HALF : PASS : ${data}`); console.info(`${TagFrmwkRender}: getRenderRate : RENDER_RATE_HALF : PASS : ${data}`);
...@@ -6907,15 +7124,7 @@ describe('audioRenderer', function () { ...@@ -6907,15 +7124,7 @@ describe('audioRenderer', function () {
} }
}); });
console.info(`${TagFrmwkRender}: Renderer after read`); console.info(`${TagFrmwkRender}: Renderer after read`);
await audioRen.getRenderRate().then((data) => { await audioRen.getRenderRate().then((data) => {}).catch((err) => {
if (data == audio.AudioRendererRate.RENDER_RATE_NORMAL) {
console.info(`${TagFrmwkRender}: getRenderRate : RENDER_RATE_NORMAL : PASS : ${data}`);
}
else {
console.info(`${TagFrmwkRender}: getRenderRate : RENDER_RATE_NORMAL : FAIL : ${data}`);
resultFlag = false;
}
}).catch((err) => {
console.info(`${TagFrmwkAudioScene}: getRenderRate : RENDER_RATE_NORMAL : ERROR : ${err.message}`); console.info(`${TagFrmwkAudioScene}: getRenderRate : RENDER_RATE_NORMAL : ERROR : ${err.message}`);
resultFlag = false; resultFlag = false;
}); });
...@@ -7065,16 +7274,8 @@ describe('audioRenderer', function () { ...@@ -7065,16 +7274,8 @@ describe('audioRenderer', function () {
} }
}); });
console.info(`${TagFrmwkRender}: Renderer after read`); console.info(`${TagFrmwkRender}: Renderer after read`);
await audioRen.getRenderRate().then((data) => { await audioRen.getRenderRate().then((data) => {}).catch((err) => {
if (data == audio.AudioRendererRate.RENDER_RATE_NORMAL) { console.info(`${TagFrmwkAudioScene}: getRenderRate : ERROR : ${err.message}`);
console.info(`${TagFrmwkRender}: getRenderRate : RENDER_RATE_NORMAL : PASS : ${data}`);
}
else {
console.info(`${TagFrmwkRender}: getRenderRate : RENDER_RATE_NORMAL : FAIL : ${data}`);
resultFlag = false;
}
}).catch((err) => {
console.info(`${TagFrmwkAudioScene}: getRenderRate : RENDER_RATE_NORMAL : ERROR : ${err.message}`);
resultFlag = false; resultFlag = false;
}); });
...@@ -7239,15 +7440,7 @@ describe('audioRenderer', function () { ...@@ -7239,15 +7440,7 @@ describe('audioRenderer', function () {
} }
console.info(`${TagFrmwkRender}: Renderer after read`); console.info(`${TagFrmwkRender}: Renderer after read`);
await audioRen.getRenderRate().then((data) => { await audioRen.getRenderRate().then((data) => {}).catch((err) => {
if (data == audio.AudioRendererRate.RENDER_RATE_DOUBLE) {
console.info(`${TagFrmwkRender}: getRenderRate : RENDER_RATE_DOUBLE : PASS : ${data}`);
}
else {
console.info(`${TagFrmwkRender}: getRenderRate : RENDER_RATE_DOUBLE : FAIL : ${data}`);
resultFlag = false;
}
}).catch((err) => {
console.info(`${TagFrmwkAudioScene}: getRenderRate : RENDER_RATE_DOUBLE : ERROR : ${err.message}`); console.info(`${TagFrmwkAudioScene}: getRenderRate : RENDER_RATE_DOUBLE : ERROR : ${err.message}`);
resultFlag = false; resultFlag = false;
}); });
...@@ -7413,15 +7606,7 @@ describe('audioRenderer', function () { ...@@ -7413,15 +7606,7 @@ describe('audioRenderer', function () {
} }
} }
console.info(`${TagFrmwkRender}: Renderer after read`); console.info(`${TagFrmwkRender}: Renderer after read`);
await audioRen.getRenderRate().then((data) => { await audioRen.getRenderRate().then((data) => {}).catch((err) => {
if (data == audio.AudioRendererRate.RENDER_RATE_HALF) {
console.info(`${TagFrmwkRender}: getRenderRate : RENDER_RATE_HALF : PASS : ${data}`);
}
else {
console.info(`${TagFrmwkRender}: getRenderRate : RENDER_RATE_HALF : FAIL : ${data}`);
resultFlag = false;
}
}).catch((err) => {
console.info(`${TagFrmwkAudioScene}: getRenderRate : RENDER_RATE_HALF : ERROR : ${err.message}`); console.info(`${TagFrmwkAudioScene}: getRenderRate : RENDER_RATE_HALF : ERROR : ${err.message}`);
resultFlag = false; resultFlag = false;
}); });
...@@ -8248,7 +8433,7 @@ describe('audioRenderer', function () { ...@@ -8248,7 +8433,7 @@ describe('audioRenderer', function () {
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 2 * @tc.level : Level 2
*/ */
it('SUB_MULTIMEDIA_AUDIO_RENDERER_INTERUPT_AUDIO_0100', 2, async function (done) { it('SUB_MULTIMEDIA_AUDIO_RENDERER_INTERUPT_AUDIO_0100', 2, async function (done) {
let interrput_flag = false; let interrput_flag = false;
let AudioStreamInfo = { let AudioStreamInfo = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100,
...@@ -8327,6 +8512,8 @@ describe('audioRenderer', function () { ...@@ -8327,6 +8512,8 @@ describe('audioRenderer', function () {
console.info('AudioFrameworkRenderLog: renderInstant2 start :ERROR : ' + err.message); console.info('AudioFrameworkRenderLog: renderInstant2 start :ERROR : ' + err.message);
}); });
await sleep(2000); await sleep(2000);
await audioRen.release();
await audioRen_interrupt.release();
expect(interrput_flag).assertTrue(); expect(interrput_flag).assertTrue();
} }
catch (error) { catch (error) {
...@@ -8423,6 +8610,8 @@ describe('audioRenderer', function () { ...@@ -8423,6 +8610,8 @@ describe('audioRenderer', function () {
console.info('AudioFrameworkRenderLog: renderInstant2 start :ERROR : ' + err.message); console.info('AudioFrameworkRenderLog: renderInstant2 start :ERROR : ' + err.message);
}); });
await sleep(2000); await sleep(2000);
await audioRen.release();
await audioRen_interrupt.release();
expect(interrput_flag).assertTrue(); expect(interrput_flag).assertTrue();
} }
catch (error) { catch (error) {
...@@ -8511,7 +8700,7 @@ describe('audioRenderer', function () { ...@@ -8511,7 +8700,7 @@ describe('audioRenderer', function () {
}); });
let b = await audioRen_interrupt.setInterruptMode(audio.InterruptMode.INDEPENDENT_MODE); let b = await audioRen_interrupt.setInterruptMode(audio.InterruptMode.INDEPENDENT_MODE);
console.info("AudioFrameworkRenderLog audioRen_interrupt setInterruptMode(INDEPENDENT_MODE) success"); console.info("AudioFrameworkRenderLog audioRen_interrupt setInterruptMode(INDEPENDENT_MODE) success");
await audioRen_interrupt.start().then(async function () { await audioRen_interrupt.start().then(async function () {
console.info('AudioFrameworkRenderLog: renderInstant2 started :SUCCESS '); console.info('AudioFrameworkRenderLog: renderInstant2 started :SUCCESS ');
...@@ -8519,6 +8708,8 @@ describe('audioRenderer', function () { ...@@ -8519,6 +8708,8 @@ describe('audioRenderer', function () {
console.info('AudioFrameworkRenderLog: renderInstant2 start :ERROR : ' + err.message); console.info('AudioFrameworkRenderLog: renderInstant2 start :ERROR : ' + err.message);
}); });
await sleep(2000); await sleep(2000);
await audioRen.release();
await audioRen_interrupt.release();
expect(interrput_flag).assertTrue(); expect(interrput_flag).assertTrue();
} }
catch (error) { catch (error) {
...@@ -8614,6 +8805,8 @@ describe('audioRenderer', function () { ...@@ -8614,6 +8805,8 @@ describe('audioRenderer', function () {
console.info('AudioFrameworkRenderLog: renderInstant2 start :ERROR : ' + err.message); console.info('AudioFrameworkRenderLog: renderInstant2 start :ERROR : ' + err.message);
}); });
await sleep(2000); await sleep(2000);
await audioRen.release();
await audioRen_interrupt.release();
expect(interrput_flag).assertTrue(); expect(interrput_flag).assertTrue();
} }
catch (error) { catch (error) {
...@@ -8710,6 +8903,8 @@ describe('audioRenderer', function () { ...@@ -8710,6 +8903,8 @@ describe('audioRenderer', function () {
console.info('AudioFrameworkRenderLog: renderInstant2 start :ERROR : ' + err.message); console.info('AudioFrameworkRenderLog: renderInstant2 start :ERROR : ' + err.message);
}); });
await sleep(2000); await sleep(2000);
await audioRen.release();
await audioRen_interrupt.release();
expect(interrput_flag).assertFalse(); expect(interrput_flag).assertFalse();
} }
catch (error) { catch (error) {
...@@ -8806,6 +9001,8 @@ describe('audioRenderer', function () { ...@@ -8806,6 +9001,8 @@ describe('audioRenderer', function () {
console.info('AudioFrameworkRenderLog: renderInstant2 start :ERROR : ' + err.message); console.info('AudioFrameworkRenderLog: renderInstant2 start :ERROR : ' + err.message);
}); });
await sleep(2000); await sleep(2000);
await audioRen.release();
await audioRen_interrupt.release();
expect(interrput_flag).assertFalse(); expect(interrput_flag).assertFalse();
} }
catch (error) { catch (error) {
...@@ -8902,6 +9099,8 @@ describe('audioRenderer', function () { ...@@ -8902,6 +9099,8 @@ describe('audioRenderer', function () {
console.info('AudioFrameworkRenderLog: renderInstant2 start :ERROR : ' + err.message); console.info('AudioFrameworkRenderLog: renderInstant2 start :ERROR : ' + err.message);
}); });
await sleep(2000); await sleep(2000);
await audioRen.release();
await audioRen_interrupt.release();
expect(interrput_flag).assertTrue(); expect(interrput_flag).assertTrue();
} }
catch (error) { catch (error) {
...@@ -8937,24 +9136,36 @@ describe('audioRenderer', function () { ...@@ -8937,24 +9136,36 @@ describe('audioRenderer', function () {
} }
let audioRenderer = await audio.createAudioRenderer(audioRendererOptions); let audioRenderer = await audio.createAudioRenderer(audioRendererOptions);
let mode = audio.InterruptMode.SHARE_MODE; let mode = audio.InterruptMode.SHARE_MODE;
audioRenderer.setInterruptMode(mode, (err, data) => { audioRenderer.setInterruptMode(mode, async (err, data) => {
if (err) { if (err) {
console.info(`${TagFrmwkRender}: SetInterruptMode SHARE_MODE CALLBACK: error: ${err.message}`); console.info(`${TagFrmwkRender}: SetInterruptMode SHARE_MODE CALLBACK: error: ${err.message}`);
expect(false).assertTrue(); expect(false).assertTrue();
await audioRenderer.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
} }
console.info(`${TagFrmwkRender}: SetInterruptMode SHARE_MODE CALLBACK: SUCCESS`); console.info(`${TagFrmwkRender}: SetInterruptMode SHARE_MODE CALLBACK: SUCCESS`);
expect(true).assertTrue(); expect(true).assertTrue();
await audioRenderer.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) });
}) })
/* /**
* @tc.name:SUB_MULTIMEDIA_AUDIO_SETINTERRUPTMODE_0200 * @tc.number : SUB_MULTIMEDIA_AUDIO_SETINTERRUPTMODE_0200
* @tc.desc:SetInterruptMode mode 1 callback,is independent mode * @tc.name : SetInterruptMode mode 0 callback,is public share mode
* @tc.type: FUNC * @tc.desc : SetInterruptMode mode 0 callback,is public share mode
* @tc.require: Issue Number * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/ */
it("SUB_MULTIMEDIA_AUDIO_SETINTERRUPTMODE_0200", 2, async function (done) { it("SUB_MULTIMEDIA_AUDIO_SETINTERRUPTMODE_0200", 2, async function (done) {
let audioStreamInfo = { let audioStreamInfo = {
...@@ -8974,24 +9185,36 @@ describe('audioRenderer', function () { ...@@ -8974,24 +9185,36 @@ describe('audioRenderer', function () {
} }
let audioRenderer = await audio.createAudioRenderer(audioRendererOptions); let audioRenderer = await audio.createAudioRenderer(audioRendererOptions);
let mode = audio.InterruptMode.INDEPENDENT_MODE; let mode = audio.InterruptMode.INDEPENDENT_MODE;
audioRenderer.setInterruptMode(mode, (err, data) => { audioRenderer.setInterruptMode(mode, async (err, data) => {
if (err) { if (err) {
console.info(`${TagFrmwkRender}: SetInterruptMode INDEPENDENT_MODE CALLBACK: error: ${err.message}`); console.info(`${TagFrmwkRender}: SetInterruptMode INDEPENDENT_MODE CALLBACK: error: ${err.message}`);
expect(false).assertTrue(); expect(false).assertTrue();
await audioRenderer.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
} }
console.info(`${TagFrmwkRender}: SetInterruptMode INDEPENDENT_MODE CALLBACK: SUCCESS`); console.info(`${TagFrmwkRender}: SetInterruptMode INDEPENDENT_MODE CALLBACK: SUCCESS`);
expect(true).assertTrue(); expect(true).assertTrue();
await audioRenderer.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) });
}) })
/* /**
* @tc.name:SUB_MULTIMEDIA_AUDIO_SETINTERRUPTMODE_0300 * @tc.number : SUB_MULTIMEDIA_AUDIO_SETINTERRUPTMODE_0300
* @tc.desc:SetInterruptMode mode 0 promise,is public share mode * @tc.name : SetInterruptMode mode 0 callback,is public share mode
* @tc.type: FUNC * @tc.desc : SetInterruptMode mode 0 callback,is public share mode
* @tc.require: Issue Number * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/ */
it("SUB_MULTIMEDIA_AUDIO_SETINTERRUPTMODE_0300", 2, async function (done) { it("SUB_MULTIMEDIA_AUDIO_SETINTERRUPTMODE_0300", 2, async function (done) {
let audioStreamInfo = { let audioStreamInfo = {
...@@ -9011,22 +9234,34 @@ describe('audioRenderer', function () { ...@@ -9011,22 +9234,34 @@ describe('audioRenderer', function () {
} }
let audioRenderer = await audio.createAudioRenderer(audioRendererOptions); let audioRenderer = await audio.createAudioRenderer(audioRendererOptions);
let mode = audio.InterruptMode.SHARE_MODE; let mode = audio.InterruptMode.SHARE_MODE;
audioRenderer.setInterruptMode(mode).then(data => { audioRenderer.setInterruptMode(mode).then(async data => {
console.info(`${TagFrmwkRender}: SetInterruptMode SHARE_MODE PROMISE: SUCCESS`); console.info(`${TagFrmwkRender}: SetInterruptMode SHARE_MODE PROMISE: SUCCESS`);
expect(true).assertTrue(); expect(true).assertTrue();
await audioRenderer.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}).catch(err => { }).catch(async err => {
console.info(`${TagFrmwkRender}: SetInterruptMode SHARE_MODE PROMISE: error: ${err.message}`); console.info(`${TagFrmwkRender}: SetInterruptMode SHARE_MODE PROMISE: error: ${err.message}`);
expect(false).assertTrue(); expect(false).assertTrue();
await audioRenderer.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) });
}) })
/* /**
* @tc.name:SUB_MULTIMEDIA_AUDIO_SETINTERRUPTMODE_0400 * @tc.number : SUB_MULTIMEDIA_AUDIO_SETINTERRUPTMODE_0400
* @tc.desc:SetInterruptMode mode 1 promise,is independent mode * @tc.name : SetInterruptMode mode 1 promise,is independent mode
* @tc.type: FUNC * @tc.desc : SetInterruptMode mode 1 promise,is independent mode
* @tc.require: Issue Number * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/ */
it("SUB_MULTIMEDIA_AUDIO_SETINTERRUPTMODE_0400", 2, async function (done) { it("SUB_MULTIMEDIA_AUDIO_SETINTERRUPTMODE_0400", 2, async function (done) {
let audioStreamInfo = { let audioStreamInfo = {
...@@ -9046,15 +9281,25 @@ describe('audioRenderer', function () { ...@@ -9046,15 +9281,25 @@ describe('audioRenderer', function () {
} }
let audioRenderer = await audio.createAudioRenderer(audioRendererOptions); let audioRenderer = await audio.createAudioRenderer(audioRendererOptions);
let mode = audio.InterruptMode.INDEPENDENT_MODE; let mode = audio.InterruptMode.INDEPENDENT_MODE;
audioRenderer.setInterruptMode(mode).then(data => { audioRenderer.setInterruptMode(mode).then(async data => {
console.info(`${TagFrmwkRender}: SetInterruptMode INDEPENDENT_MODE PROMISE: SUCCESS`); console.info(`${TagFrmwkRender}: SetInterruptMode INDEPENDENT_MODE PROMISE: SUCCESS`);
expect(true).assertTrue(); expect(true).assertTrue();
await audioRenderer.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}).catch(err => { }).catch(async err => {
console.info(`${TagFrmwkRender}: SetInterruptMode INDEPENDENT_MODE PROMISE: error: ${err.message}`); console.info(`${TagFrmwkRender}: SetInterruptMode INDEPENDENT_MODE PROMISE: error: ${err.message}`);
expect(false).assertTrue(); expect(false).assertTrue();
await audioRenderer.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) });
}) })
...@@ -9083,20 +9328,30 @@ describe('audioRenderer', function () { ...@@ -9083,20 +9328,30 @@ describe('audioRenderer', function () {
rendererInfo: audioRendererInfo rendererInfo: audioRendererInfo
} }
let audioRenderer = await audio.createAudioRenderer(audioRendererOptions); let audioRenderer = await audio.createAudioRenderer(audioRendererOptions);
audioRenderer.setInterruptMode(stringParameter, (err, data) => { audioRenderer.setInterruptMode(stringParameter, async (err, data) => {
if (err) { if (err) {
if (err.code == 6800101) { if (err.code == 6800101) {
console.info(`${TagFrmwkRender}: SetInterruptMode SHARE_MODE CALLBACK: SUCCESS`); console.info(`${TagFrmwkRender}: SetInterruptMode SHARE_MODE CALLBACK: SUCCESS`);
expect(true).assertTrue(); expect(true).assertTrue();
await audioRenderer.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
} }
} }
console.info(`${TagFrmwkRender}: SetInterruptMode SHARE_MODE CALLBACK: error: ${err.message}`); console.info(`${TagFrmwkRender}: SetInterruptMode SHARE_MODE CALLBACK: error: ${err.message}`);
expect(false).assertTrue(); expect(false).assertTrue();
await audioRenderer.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
}) });
}) })
/* /*
...@@ -9124,28 +9379,45 @@ describe('audioRenderer', function () { ...@@ -9124,28 +9379,45 @@ describe('audioRenderer', function () {
rendererInfo: audioRendererInfo rendererInfo: audioRendererInfo
} }
let audioRenderer = await audio.createAudioRenderer(audioRendererOptions); let audioRenderer = await audio.createAudioRenderer(audioRendererOptions);
audioRenderer.setInterruptMode(stringParameter).then(data => { audioRenderer.setInterruptMode(stringParameter).then(async data => {
console.info(`${TagFrmwkRender}: SetInterruptMode INDEPENDENT_MODE PROMISE: error`); console.info(`${TagFrmwkRender}: SetInterruptMode INDEPENDENT_MODE PROMISE: error`);
expect(false).assertTrue(); expect(false).assertTrue();
await audioRenderer.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}).catch(err => { }).catch(async err => {
if (err.code == 6800101){ if (err.code == 6800101){
console.info(`${TagFrmwkRender}: SetInterruptMode INDEPENDENT_MODE PROMISE: SUCCESS`); console.info(`${TagFrmwkRender}: SetInterruptMode INDEPENDENT_MODE PROMISE: SUCCESS`);
expect(true).assertTrue(); expect(true).assertTrue();
await audioRenderer.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
} else { } else {
console.info(`${TagFrmwkRender}: SetInterruptMode INDEPENDENT_MODE PROMISE: error`); console.info(`${TagFrmwkRender}: SetInterruptMode INDEPENDENT_MODE PROMISE: error`);
expect(false).assertTrue(); expect(false).assertTrue();
await audioRenderer.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
} }
}); });
}) })
/* /*
* @tc.name:SUB_MULTIMEDIA_AUDIO_SETINTERRUPTMODE_0700 * @tc.number : SUB_MULTIMEDIA_AUDIO_SETINTERRUPTMODE_0700
* @tc.desc:SetInterruptMode mode 2,set it to default SHARE_MODE * @tc.name : SetInterruptMode invalid param promise
* @tc.type: FUNC * @tc.desc : SetInterruptMode invalid param promise
* @tc.require: Issue Number * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/ */
it("SUB_MULTIMEDIA_AUDIO_SETINTERRUPTMODE_0700", 2, async function (done) { it("SUB_MULTIMEDIA_AUDIO_SETINTERRUPTMODE_0700", 2, async function (done) {
let audioStreamInfo = { let audioStreamInfo = {
...@@ -9169,19 +9441,31 @@ describe('audioRenderer', function () { ...@@ -9169,19 +9441,31 @@ describe('audioRenderer', function () {
let data = await audioRenderer.setInterruptMode(mode); let data = await audioRenderer.setInterruptMode(mode);
console.info(`${TagFrmwkRender}: SetInterruptMode OUT OF BORDER PROMISE: SUCCESS`); console.info(`${TagFrmwkRender}: SetInterruptMode OUT OF BORDER PROMISE: SUCCESS`);
expect(true).assertTrue(); expect(true).assertTrue();
await audioRenderer.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
} catch (err) { } catch (err) {
console.info(`${TagFrmwkRender}: SetInterruptMode OUT OF BORDER PROMISE: ERROR: ${err.message}`); console.info(`${TagFrmwkRender}: SetInterruptMode OUT OF BORDER PROMISE: ERROR: ${err.message}`);
expect(false).assertTrue(); expect(false).assertTrue();
await audioRenderer.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
} }
}) })
/* /*
* @tc.name:SUB_MULTIMEDIA_AUDIO_SETINTERRUPTMODE_0800 * @tc.number : SUB_MULTIMEDIA_AUDIO_SETINTERRUPTMODE_0800
* @tc.desc:SetInterruptMode mode 2,set it to default SHARE_MODE - callback * @tc.name : SetInterruptMode invalid param promise
* @tc.type: FUNC * @tc.desc : SetInterruptMode invalid param promise
* @tc.require: Issue Number * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/ */
it("SUB_MULTIMEDIA_AUDIO_SETINTERRUPTMODE_0800", 2, async function (done) { it("SUB_MULTIMEDIA_AUDIO_SETINTERRUPTMODE_0800", 2, async function (done) {
let audioStreamInfo = { let audioStreamInfo = {
...@@ -9202,31 +9486,48 @@ describe('audioRenderer', function () { ...@@ -9202,31 +9486,48 @@ describe('audioRenderer', function () {
let audioRenderer = await audio.createAudioRenderer(audioRendererOptions); let audioRenderer = await audio.createAudioRenderer(audioRendererOptions);
let mode = 2; let mode = 2;
try { try {
audioRenderer.setInterruptMode(mode, (err, data) => { audioRenderer.setInterruptMode(mode, async (err, data) => {
if (err) { if (err) {
console.info(`${TagFrmwkRender}: SetInterruptMode SHARE_MODE CALLBACK: error: ${err.message}`); console.info(`${TagFrmwkRender}: SetInterruptMode SHARE_MODE CALLBACK: error: ${err.message}`);
expect(false).assertTrue(); expect(false).assertTrue();
await audioRenderer.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
} }
console.info(`${TagFrmwkRender}: SetInterruptMode SHARE_MODE CALLBACK: SUCCESS`); console.info(`${TagFrmwkRender}: SetInterruptMode SHARE_MODE CALLBACK: SUCCESS`);
expect(true).assertTrue(); expect(true).assertTrue();
await audioRenderer.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
} catch (err) { } catch (err) {
console.info(`${TagFrmwkRender}: SetInterruptMode OUT OF BORDER PROMISE: ERROR: ${err.message}`); console.info(`${TagFrmwkRender}: SetInterruptMode OUT OF BORDER PROMISE: ERROR: ${err.message}`);
expect(false).assertTrue(); expect(false).assertTrue();
await audioRenderer.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
} }
}) })
/* /**
* @tc.name:SUB_MULTIMEDIA_AUDIO_getAudioStreamId_0600 * @tc.number : SUB_MULTIMEDIA_AUDIO_GET_AUDIO_STREAM_ID_0100
* @tc.desc:getAudioStreamId mode 2,set it to default SHARE_MODE * @tc.name : AudioRenderer - getAudioStreamId
* @tc.type: FUNC * @tc.desc : AudioRenderer - getAudioStreamId
* @tc.require: Issue Number * @tc.size : MEDIUM
*/ * @tc.type : Function
it("SUB_MULTIMEDIA_AUDIO_getAudioStreamId_0100", 2, async function (done) { * @tc.level : Level 2
*/
it("SUB_MULTIMEDIA_AUDIO_GET_AUDIO_STREAM_ID_0100", 2, async function (done) {
let audioStreamInfo = { let audioStreamInfo = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000,
channels: audio.AudioChannel.CHANNEL_1, channels: audio.AudioChannel.CHANNEL_1,
...@@ -9247,21 +9548,33 @@ describe('audioRenderer', function () { ...@@ -9247,21 +9548,33 @@ describe('audioRenderer', function () {
let data = await audioRenderer.getAudioStreamId(); let data = await audioRenderer.getAudioStreamId();
console.info(`${TagFrmwkRender}: SUB_MULTIMEDIA_AUDIO_getAudioStreamId_0100 OUT OF BORDER PROMISE: SUCCESS ${data}`); console.info(`${TagFrmwkRender}: SUB_MULTIMEDIA_AUDIO_getAudioStreamId_0100 OUT OF BORDER PROMISE: SUCCESS ${data}`);
expect(true).assertTrue(); expect(true).assertTrue();
await audioRenderer.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
} catch (err) { } catch (err) {
console.info(`${TagFrmwkRender}: SUB_MULTIMEDIA_AUDIO_getAudioStreamId_0100 OUT OF BORDER PROMISE: ERROR: ${err.message}`); console.info(`${TagFrmwkRender}: SUB_MULTIMEDIA_AUDIO_getAudioStreamId_0100 OUT OF BORDER PROMISE: ERROR: ${err.message}`);
expect(false).assertTrue(); expect(false).assertTrue();
await audioRenderer.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
} }
}) })
/* /**
* @tc.name:SUB_MULTIMEDIA_AUDIO_getAudioStreamId_0200 * @tc.number : SUB_MULTIMEDIA_AUDIO_GET_AUDIO_STREAM_ID_0200
* @tc.desc:getAudioStreamId callback,is independent mode * @tc.name : AudioRenderer - getAudioStreamId
* @tc.type: FUNC * @tc.desc : AudioRenderer - getAudioStreamId
* @tc.require: Issue Number * @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/ */
it("SUB_MULTIMEDIA_AUDIO_getAudioStreamId_0200", 2, async function (done) { it("SUB_MULTIMEDIA_AUDIO_GET_AUDIO_STREAM_ID_0200", 2, async function (done) {
let audioStreamInfo = { let audioStreamInfo = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000, samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000,
channels: audio.AudioChannel.CHANNEL_1, channels: audio.AudioChannel.CHANNEL_1,
...@@ -9278,15 +9591,73 @@ describe('audioRenderer', function () { ...@@ -9278,15 +9591,73 @@ describe('audioRenderer', function () {
rendererInfo: audioRendererInfo rendererInfo: audioRendererInfo
} }
let audioRenderer = await audio.createAudioRenderer(audioRendererOptions); let audioRenderer = await audio.createAudioRenderer(audioRendererOptions);
await audioRenderer.getAudioStreamId((err, data) => { await audioRenderer.getAudioStreamId(async (err, data) => {
if (err) { if (err) {
console.info(`${TagFrmwkRender}: SetInterruptMode INDEPENDENT_MODE CALLBACK: error: ${err.message}`); console.info(`${TagFrmwkRender}: SetInterruptMode INDEPENDENT_MODE CALLBACK: error: ${err.message}`);
expect(false).assertTrue(); expect(false).assertTrue();
await audioRenderer.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
return; return;
} }
console.info(`${TagFrmwkRender}: SetInterruptMode INDEPENDENT_MODE CALLBACK: SUCCESS ${data}`); console.info(`${TagFrmwkRender}: SetInterruptMode INDEPENDENT_MODE CALLBACK: SUCCESS ${data}`);
expect(true).assertTrue(); expect(true).assertTrue();
await audioRenderer.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done();
})
})
/**
* @tc.number : SUB_MULTIMEDIA_AUDIO_GET_AUDIO_STREAM_ID_0300
* @tc.name : AudioRenderer - getAudioStreamId
* @tc.desc : AudioRenderer - getAudioStreamId
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it("SUB_MULTIMEDIA_AUDIO_GET_AUDIO_STREAM_ID_0300", 2, async function (done) {
let audioStreamInfo = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_48000,
channels: audio.AudioChannel.CHANNEL_1,
sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE,
encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW
}
let audioRendererInfo = {
content: audio.ContentType.CONTENT_TYPE_MUSIC,
usage: audio.StreamUsage.STREAM_USAGE_MEDIA,
rendererFlags: 0
}
let audioRendererOptions = {
streamInfo: audioStreamInfo,
rendererInfo: audioRendererInfo
}
let audioRenderer = await audio.createAudioRenderer(audioRendererOptions);
await audioRenderer.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
await audioRenderer.getAudioStreamId(async (err, data) => {
if (err) {
console.info(`${TagFrmwkRender}: SetInterruptMode INDEPENDENT_MODE CALLBACK : ${err.message}`);
if (err.code == 6800103) {
console.log(`${TagFrmwkRender}:SetInterruptMode : SUCCESS`);
expect(true).assertTrue();
} else {
console.log(`${TagFrmwkRender}: SetInterruptMode : error : ${err.code}`);
expect(false).assertTrue();
}
} else {
console.info(`${TagFrmwkRender}: SetInterruptMode INDEPENDENT_MODE CALLBACK: SUCCESS ${data}`);
expect(false).assertTrue();
}
done(); done();
}) })
}) })
...@@ -9316,10 +9687,8 @@ describe('audioRenderer', function () { ...@@ -9316,10 +9687,8 @@ describe('audioRenderer', function () {
streamInfo: AudioStreamInfo, streamInfo: AudioStreamInfo,
rendererInfo: AudioRendererInfo rendererInfo: AudioRendererInfo
} }
let audioRen;
try { try {
let audioRen;
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
audioRen = data; audioRen = data;
console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS data state: ' + Object.keys(data)); console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS data state: ' + Object.keys(data));
...@@ -9337,13 +9706,17 @@ describe('audioRenderer', function () { ...@@ -9337,13 +9706,17 @@ describe('audioRenderer', function () {
console.info(`${TagFrmwkRender}: setVolume : ERROR : code: ${err.code}, mesage: ${err.message}`); console.info(`${TagFrmwkRender}: setVolume : ERROR : code: ${err.code}, mesage: ${err.message}`);
expect(false).assertTrue(); expect(false).assertTrue();
}); });
await sleep(2000);
} }
catch (error) { catch (error) {
console.log("SUB_MULTIMEDIA_AUDIO_SET_VOLUME_0100 : error = " + error); console.log("SUB_MULTIMEDIA_AUDIO_SET_VOLUME_0100 : error = " + error);
expect(false).assertTrue(); expect(false).assertTrue();
} }
await sleep(2000);
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -9372,10 +9745,8 @@ describe('audioRenderer', function () { ...@@ -9372,10 +9745,8 @@ describe('audioRenderer', function () {
streamInfo: AudioStreamInfo, streamInfo: AudioStreamInfo,
rendererInfo: AudioRendererInfo rendererInfo: AudioRendererInfo
} }
let audioRen;
try { try {
let audioRen;
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
audioRen = data; audioRen = data;
console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS data state: ' + Object.keys(data)); console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS data state: ' + Object.keys(data));
...@@ -9398,13 +9769,17 @@ describe('audioRenderer', function () { ...@@ -9398,13 +9769,17 @@ describe('audioRenderer', function () {
expect(false).assertTrue(); expect(false).assertTrue();
} }
}); });
await sleep(1000);
} }
catch (error) { catch (error) {
console.log("SUB_MULTIMEDIA_AUDIO_SET_VOLUME_0200 : error = " + error); console.log("SUB_MULTIMEDIA_AUDIO_SET_VOLUME_0200 : error = " + error);
expect(false).assertTrue(); expect(false).assertTrue();
} }
await sleep(2000);
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -9433,10 +9808,8 @@ describe('audioRenderer', function () { ...@@ -9433,10 +9808,8 @@ describe('audioRenderer', function () {
streamInfo: AudioStreamInfo, streamInfo: AudioStreamInfo,
rendererInfo: AudioRendererInfo rendererInfo: AudioRendererInfo
} }
let audioRen;
try { try {
let audioRen;
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
audioRen = data; audioRen = data;
console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS data state: ' + Object.keys(data)); console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS data state: ' + Object.keys(data));
...@@ -9459,13 +9832,17 @@ describe('audioRenderer', function () { ...@@ -9459,13 +9832,17 @@ describe('audioRenderer', function () {
expect(false).assertTrue(); expect(false).assertTrue();
} }
}); });
await sleep(1000);
} }
catch (error) { catch (error) {
console.log("SUB_MULTIMEDIA_AUDIO_SET_VOLUME_0300 : error = " + error); console.log("SUB_MULTIMEDIA_AUDIO_SET_VOLUME_0300 : error = " + error);
expect(false).assertTrue(); expect(false).assertTrue();
} }
await sleep(2000);
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -9494,10 +9871,8 @@ describe('audioRenderer', function () { ...@@ -9494,10 +9871,8 @@ describe('audioRenderer', function () {
streamInfo: AudioStreamInfo, streamInfo: AudioStreamInfo,
rendererInfo: AudioRendererInfo rendererInfo: AudioRendererInfo
} }
let audioRen;
try { try {
let audioRen;
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
audioRen = data; audioRen = data;
console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS data state: ' + Object.keys(data)); console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS data state: ' + Object.keys(data));
...@@ -9517,12 +9892,17 @@ describe('audioRenderer', function () { ...@@ -9517,12 +9892,17 @@ describe('audioRenderer', function () {
console.info(`${TagFrmwkRender}: setVolume to 0 : Success`); console.info(`${TagFrmwkRender}: setVolume to 0 : Success`);
} }
}); });
await sleep(2000);
} }
catch (error) { catch (error) {
console.log("SUB_MULTIMEDIA_AUDIO_SET_VOLUME_0100 : error = " + error); console.log("SUB_MULTIMEDIA_AUDIO_SET_VOLUME_0100 : error = " + error);
expect(false).assertTrue(); expect(false).assertTrue();
} }
await sleep(2000);
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -9551,10 +9931,8 @@ describe('audioRenderer', function () { ...@@ -9551,10 +9931,8 @@ describe('audioRenderer', function () {
streamInfo: AudioStreamInfo, streamInfo: AudioStreamInfo,
rendererInfo: AudioRendererInfo rendererInfo: AudioRendererInfo
} }
let audioRen;
try { try {
let audioRen;
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
audioRen = data; audioRen = data;
console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS data state: ' + Object.keys(data)); console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS data state: ' + Object.keys(data));
...@@ -9579,12 +9957,17 @@ describe('audioRenderer', function () { ...@@ -9579,12 +9957,17 @@ describe('audioRenderer', function () {
console.info(`${TagFrmwkRender}: setVolume to 16 TEST: ERROR`); console.info(`${TagFrmwkRender}: setVolume to 16 TEST: ERROR`);
} }
}); });
await sleep(1000);
} }
catch (error) { catch (error) {
console.log("SUB_MULTIMEDIA_AUDIO_SET_VOLUME_0200 : error = " + error); console.log("SUB_MULTIMEDIA_AUDIO_SET_VOLUME_0200 : error = " + error);
expect(false).assertTrue(); expect(false).assertTrue();
} }
await sleep(2000);
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -9613,10 +9996,8 @@ describe('audioRenderer', function () { ...@@ -9613,10 +9996,8 @@ describe('audioRenderer', function () {
streamInfo: AudioStreamInfo, streamInfo: AudioStreamInfo,
rendererInfo: AudioRendererInfo rendererInfo: AudioRendererInfo
} }
let audioRen;
try { try {
let audioRen;
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
audioRen = data; audioRen = data;
console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS data state: ' + Object.keys(data)); console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS data state: ' + Object.keys(data));
...@@ -9641,13 +10022,17 @@ describe('audioRenderer', function () { ...@@ -9641,13 +10022,17 @@ describe('audioRenderer', function () {
console.info(`${TagFrmwkRender}: setVolume to 16 TEST: ERROR`); console.info(`${TagFrmwkRender}: setVolume to 16 TEST: ERROR`);
} }
}); });
await sleep(1000);
} }
catch (error) { catch (error) {
console.log("SUB_MULTIMEDIA_AUDIO_SET_VOLUME_0300 : error = " + error); console.log("SUB_MULTIMEDIA_AUDIO_SET_VOLUME_0300 : error = " + error);
expect(false).assertTrue(); expect(false).assertTrue();
} }
await sleep(2000);
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
...@@ -9678,9 +10063,8 @@ describe('audioRenderer', function () { ...@@ -9678,9 +10063,8 @@ describe('audioRenderer', function () {
streamInfo: AudioStreamInfo, streamInfo: AudioStreamInfo,
rendererInfo: AudioRendererInfo rendererInfo: AudioRendererInfo
} }
let audioRen;
try { try {
let audioRen;
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) { await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
audioRen = data; audioRen = data;
console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS data state: ' + Object.keys(data)); console.info('AudioFrameworkRenderLog: AudioRender Created : Success : Stream Type: SUCCESS data state: ' + Object.keys(data));
...@@ -9693,11 +10077,6 @@ describe('audioRenderer', function () { ...@@ -9693,11 +10077,6 @@ describe('audioRenderer', function () {
console.log("SUB_MULTIMEDIA_AUDIO_RENDERER_INTERUPT_AUDIO_0700 : error = " + error); console.log("SUB_MULTIMEDIA_AUDIO_RENDERER_INTERUPT_AUDIO_0700 : error = " + error);
expect(false).assertTrue(); expect(false).assertTrue();
}); });
await sleep(2000);
await audioRen.release();
await audioRen_interrupt.release();
} }
catch (error) { catch (error) {
if (error.code == 6800101) { if (error.code == 6800101) {
...@@ -9708,6 +10087,11 @@ describe('audioRenderer', function () { ...@@ -9708,6 +10087,11 @@ describe('audioRenderer', function () {
expect(false).assertTrue(); expect(false).assertTrue();
} }
} }
await audioRen.release().then(() => {
console.info(`${TagFrmwkRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagFrmwkRender}: Renderer release :ERROR : ${err.message}`);
});
done(); done();
}) })
}) })
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册