提交 8fc35029 编写于 作者: L lwx1121892

modify

Signed-off-by: Nlwx1121892 <liuxueqi3@huawei.com>
上级 28506824
......@@ -77,7 +77,7 @@ describe('audioCapturer', function () {
eventEmitter.on(CREATE_EVENT, (audioCap, steps, done) => {
console.log(`${Tag} emit: ${JSON.stringify(CREATE_EVENT)}`);
steps.shift();
audio.createAudioCapturer(steps[0], async (err, data) => {
audio.createAudioCapturer(steps[0], (err, data) => {
console.log(`${Tag} enter createAudioCapturer`);
steps.shift();
if (err && steps[0] == ERROR_EVENT) {
......@@ -167,7 +167,7 @@ describe('audioCapturer', function () {
while (numBuffersToCapture) {
try {
await new Promise((resolve, reject) => {
audioCap.read(bufferSize, true, async (err, buffer) => {
audioCap.read(bufferSize, true, (err, buffer) => {
if (err) {
console.info(`${Tag} AudioFrameworkRecLog: Capturer release :ERROR : ${JSON.stringify(err.message)}`);
reject(err);
......@@ -436,7 +436,7 @@ describe('audioCapturer', function () {
console.info(`${Tag} AudioFrameworkTest: afterEach: Test case-level clearance conditions`);
})
afterAll(async function () {
afterAll(function () {
console.info(`${Tag} AudioFrameworkTest: afterAll: Test suite-level cleanup condition`);
})
......@@ -547,7 +547,7 @@ describe('audioCapturer', function () {
*@tc.type : Function
*@tc.level : Level 1
*/
it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_PREPARED_STATE_0100', 1, async function (done) {
it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_PREPARED_STATE_0100', 1, function (done) {
let AudioStreamInfo = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100,
channels: audio.AudioChannel.CHANNEL_2,
......@@ -577,7 +577,7 @@ describe('audioCapturer', function () {
*@tc.type : Function
*@tc.level : Level 1
*/
it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_RUNNING_STATE_0100', 1, async function (done) {
it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_RUNNING_STATE_0100', 1, function (done) {
let AudioStreamInfo = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100,
channels: audio.AudioChannel.CHANNEL_2,
......@@ -606,7 +606,7 @@ describe('audioCapturer', function () {
*@tc.type : Function
*@tc.level : Level 1
*/
it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_STOPPED_STATE_0100', 1, async function (done) {
it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_STOPPED_STATE_0100', 1, function (done) {
let AudioStreamInfo = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100,
channels: audio.AudioChannel.CHANNEL_2,
......@@ -635,7 +635,7 @@ describe('audioCapturer', function () {
*@tc.type : Function
*@tc.level : Level 1
*/
it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_GET_BUFFER_SIZE_0100', 1, async function (done) {
it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_GET_BUFFER_SIZE_0100', 1, function (done) {
let AudioStreamInfo = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100,
channels: audio.AudioChannel.CHANNEL_2,
......@@ -710,7 +710,7 @@ describe('audioCapturer', function () {
capturerInfo: AudioCapturerInfo
}
let audioCapPromise;
await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) {
await audio.createAudioCapturer(AudioCapturerOptions).then(function (data) {
audioCapPromise = data;
console.info(`${Tag} AudioFrameworkRecLog: AudioCapturer Created : Success : Stream Type: success`);
expect(audioCapPromise.state).assertEqual(audio.AudioState.STATE_PREPARED);
......@@ -2077,7 +2077,7 @@ describe('audioCapturer', function () {
console.log(`${Tag} stop ok`);
} catch (err) {
console.log(`${Tag} stop err: ${JSON.stringify(err)}`);
expect(err.code).assertEqual(200);
expect(false).assertTrue();
}
done();
})
......@@ -2410,7 +2410,7 @@ describe('audioCapturer', function () {
streamInfo: audioStreamInfo44100,
capturerInfo: audioCapturerInfo44100,
}
await audio.createAudioCapturer(AudioCapturerOptionsInvalid).then(async function (data) {
await audio.createAudioCapturer(AudioCapturerOptionsInvalid).then(function (data) {
if (data == undefined) {
console.info(`${Tag} AudioFrameworkRecLog: AudioCapturer Created : Unsuccess : ${JSON.stringify(data)}`);
expect(true).assertTrue();
......@@ -2449,7 +2449,7 @@ describe('audioCapturer', function () {
capturerInfo: audioCapturerInfo44100,
}
await audio.createAudioCapturer(AudioCapturerOptionsInvalid).then(async function (data) {
await audio.createAudioCapturer(AudioCapturerOptionsInvalid).then(function (data) {
if (data == undefined) {
console.info(`${Tag} AudioFrameworkRecLog: AudioCapturer Created : Unsuccess : ${JSON.stringify(data)}`);
expect(true).assertTrue();
......@@ -2473,7 +2473,7 @@ describe('audioCapturer', function () {
*@tc.type : Function
*@tc.level : Level 2
*/
it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_ON_0100', 2, async function (done) {
it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_ON_0100', 2, function (done) {
let AudioStreamInfo = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100,
channels: audio.AudioChannel.CHANNEL_2,
......@@ -2502,7 +2502,7 @@ describe('audioCapturer', function () {
*@tc.type : Function
*@tc.level : Level 2
*/
it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_ON_0200', 2, async function (done) {
it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_ON_0200', 2, function (done) {
let AudioStreamInfo = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100,
channels: audio.AudioChannel.CHANNEL_2,
......@@ -2531,7 +2531,7 @@ describe('audioCapturer', function () {
*@tc.type : Function
*@tc.level : Level 2
*/
it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_ON_0300', 2, async function (done) {
it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_ON_0300', 2, function (done) {
let AudioStreamInfo = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100,
channels: audio.AudioChannel.CHANNEL_2,
......@@ -2560,7 +2560,7 @@ describe('audioCapturer', function () {
*@tc.type : Function
*@tc.level : Level 2
*/
it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_ON_0400', 2, async function (done) {
it('SUB_MULTIMEDIA_AUDIO_VOIP_CAP_CB_ON_0400', 2, function (done) {
let AudioStreamInfo = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100,
channels: audio.AudioChannel.CHANNEL_2,
......
......@@ -2906,20 +2906,20 @@ describe('audioFramework', function () {
*/
it('SUB_MULTIMEDIA_AUDIO_MANAGER_MUTE_1400', 2, async function (done) {
await audioManager.setVolume(audioMedia, lowVol);
audioManager.mute(audioMedia, true, async (err) => {
audioManager.mute(audioMedia, true, (err) => {
if (err) {
console.error(`${TagFrmwk}: Callback : SetVolume: Media : failed to set Mute Status ${err.message}`);
expect().assertFail();
done();
} else {
console.log(`${TagFrmwk}: Set Stream Mute: Media: Callback : TRUE`);
audioManager.getVolume(audioMedia, async (err, value) => {
audioManager.getVolume(audioMedia, (err, value) => {
if (err) {
console.error(`Failed to obtain the volume. ${err.message}`);
expect(false).assertTrue();
done();
} else if (value == 0) {
await audioManager.setVolume(audioMedia, highVol, (err) => {
audioManager.setVolume(audioMedia, highVol, (err) => {
if (err) {
console.error(`Failed to obtain the volume. ${err.message}`);
expect(false).assertTrue();
......@@ -2996,7 +2996,7 @@ describe('audioFramework', function () {
*/
it('SUB_MULTIMEDIA_AUDIO_MANAGER_MUTE_1600', 2, async function (done) {
await audioManager.setVolume(audioRingtone, highVol);
audioManager.mute(audioRingtone, true, async (err) => {
audioManager.mute(audioRingtone, true, (err) => {
if (err) {
console.error(`${TagFrmwk}: Callback : SetVolume: Ringtone : failed to set Mute Status ${err.message}`);
expect().assertFail();
......@@ -3082,7 +3082,7 @@ describe('audioFramework', function () {
done();
return;
}
audioManager.mute(audio.AudioVolumeType.VOICE_CALL, true, async (err) => {
audioManager.mute(audio.AudioVolumeType.VOICE_CALL, true, (err) => {
if (err) {
console.error(`${TagFrmwk}: Callback : SetVolume: VOICE_CALL : failed to set Mute Status ${err.message}`);
expect().assertFail();
......@@ -5119,7 +5119,7 @@ describe('audioFramework', function () {
*@tc.type : Function
*@tc.level : Level 2
*/
it('SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0800', 2, async function (done) {
it('SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0800', 2, function (done) {
audioManager.getRoutingManager(async (err, AudioRoutingManager) => {
if (err) {
console.error(`${TagFrmwk}: Callback: failed to get RoutingManager ${err.message}`);
......@@ -5150,7 +5150,7 @@ describe('audioFramework', function () {
*@tc.type : Function
*@tc.level : Level 2
*/
it('SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0900', 2, async function (done) {
it('SUB_MULTIMEDIA_AUDIO_ROUTING_MANAGER_GETDEVICES_0900', 2, function (done) {
audioManager.getRoutingManager(async (err, AudioRoutingManager) => {
if (err) {
console.error(`${TagFrmwk}:Callback:failed to get RoutingManager ${err.message}`);
......
......@@ -1068,7 +1068,7 @@ describe('audioRenderer', function () {
resultFlag = true;
audioRen.on('periodReach', 73, (position) => {
console.log(`${TagFrmwk}: periodReach Event is called : ${position}`);
resultFlag = false;
resultFlag = true;
});
});
......
......@@ -51,7 +51,7 @@ describe('audioVoip', function () {
console.info(`AudioFrameworkTest: afterEach: Test case-level clearance conditions`);
})
afterAll(async function () {
afterAll(function () {
console.info(`AudioFrameworkTest: afterAll: Test suite-level cleanup condition`);
})
......@@ -111,7 +111,7 @@ describe('audioVoip', function () {
console.info(`${TagRender}: Promise : Audio Playback Function`);
let audioRen;
await audio.createAudioRenderer(AudioRendererOptions).then(async function (data) {
await audio.createAudioRenderer(AudioRendererOptions).then((data) => {
audioRen = data;
console.info(`${TagRender}: AudioRender Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
......@@ -123,7 +123,7 @@ describe('audioVoip', function () {
console.info(`${TagRender}: AudioRenderer : STATE : ${audioRen.state}`);
await audioRen.getStreamInfo().then(async function (audioParamsGet) {
await audioRen.getStreamInfo().then((audioParamsGet) => {
console.info(`${TagRender}: Renderer getStreamInfo:`);
console.info(`${TagRender}: Renderer sampleFormat: ${audioParamsGet.sampleFormat}`);
console.info(`${TagRender}: Renderer samplingRate: ${audioParamsGet.samplingRate}`);
......@@ -138,7 +138,7 @@ describe('audioVoip', function () {
return resultFlag;
}
await audioRen.getRendererInfo().then(async function (audioParamsGet) {
await audioRen.getRendererInfo().then((audioParamsGet) => {
console.info(`${TagRender}: Renderer RendererInfo:`);
console.info(`${TagRender}: Renderer content type: ${audioParamsGet.content}`);
console.info(`${TagRender}: Renderer usage: ${audioParamsGet.usage}`);
......@@ -152,7 +152,7 @@ describe('audioVoip', function () {
return resultFlag;
}
await audioRen.start().then(async function () {
await audioRen.start().then(() => {
console.info(`${TagRender}: renderInstant started :SUCCESS `);
}).catch((err) => {
console.info(`${TagRender}: renderInstant start :ERROR : ${err.message}`);
......@@ -166,7 +166,7 @@ describe('audioVoip', function () {
console.info(`${TagRender}: AudioRenderer : STATE : ${audioRen.state}`);
let bufferSize;
await audioRen.getBufferSize().then(async function (data) {
await audioRen.getBufferSize().then((data) => {
console.info(`${TagRender}: getBufferSize :SUCCESS ${data}`);
bufferSize = data;
}).catch((err) => {
......@@ -193,7 +193,7 @@ describe('audioVoip', function () {
console.info(`${TagRender}: BufferAudioFramework: bytes read from file: ${rlen}`);
await audioRen.write(buf);
if (rlen > (totalSize / 2)) {
await AUDIOMANAGER.getAudioScene().then(async function (data) {
await AUDIOMANAGER.getAudioScene().then((data) => {
console.info(`${TagRender}:AudioFrameworkAudioScene: getAudioScene : Value : ${data}`);
}).catch((err) => {
console.info(`${TagRender}:AudioFrameworkAudioScene: getAudioScene : ERROR : ${err.message}`);
......@@ -203,7 +203,7 @@ describe('audioVoip', function () {
}
console.info(`${TagRender}: Renderer after read`);
await audioRen.drain().then(async function () {
await audioRen.drain().then(() => {
console.info(`${TagRender}: Renderer drained : SUCCESS`);
}).catch((err) => {
console.error(`${TagRender}: Renderer drain: ERROR : ${err.message}`);
......@@ -216,7 +216,7 @@ describe('audioVoip', function () {
console.info(`${TagRender}: AudioRenderer : STATE : ${audioRen.state}`);
await audioRen.stop().then(async function () {
await audioRen.stop().then(() => {
console.info(`${TagRender}: Renderer stopped : SUCCESS`);
resultFlag = true;
console.info(`${TagRender}: resultFlagRen : ${resultFlag}`);
......@@ -227,7 +227,7 @@ describe('audioVoip', function () {
console.info(`${TagRender}: AudioRenderer : STATE : ${audioRen.state}`);
await audioRen.release().then(async function () {
await audioRen.release().then(() => {
console.info(`${TagRender}: Renderer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagRender}: Renderer release :ERROR : ${err.message}`);
......@@ -247,7 +247,7 @@ describe('audioVoip', function () {
let audioCap;
await audio.createAudioCapturer(AudioCapturerOptions).then(async function (data) {
await audio.createAudioCapturer(AudioCapturerOptions).then((data) => {
audioCap = data;
console.info(`${TagRec}: AudioCapturer Created : Success : Stream Type: SUCCESS`);
}).catch((err) => {
......@@ -259,7 +259,7 @@ describe('audioVoip', function () {
console.info(`${TagRec}: AudioCapturer : STATE : ${audioCap.state}`);
await audioCap.getStreamInfo().then(async function (audioParamsGet) {
await audioCap.getStreamInfo().then((audioParamsGet) => {
if (audioParamsGet != undefined) {
console.info(`${TagRec}: Capturer getStreamInfo:`);
console.info(`${TagRec}: Capturer sampleFormat: ${audioParamsGet.sampleFormat}`);
......@@ -280,7 +280,7 @@ describe('audioVoip', function () {
return resultFlag;
}
await audioCap.getCapturerInfo().then(async function (audioParamsGet) {
await audioCap.getCapturerInfo().then((audioParamsGet) => {
if (audioParamsGet != undefined) {
console.info(`${TagRec}: Capturer CapturerInfo:`);
console.info(`${TagRec}: Capturer SourceType: ${audioParamsGet.source}`);
......@@ -299,7 +299,7 @@ describe('audioVoip', function () {
return resultFlag;
}
await audioCap.start().then(async function () {
await audioCap.start().then(() => {
console.info(`${TagRec}: Capturer started :SUCCESS`);
}).catch((err) => {
console.info(`${TagRec}: Capturer start :ERROR : ${err.message}`);
......@@ -349,7 +349,7 @@ describe('audioVoip', function () {
await sleep(1000);
console.info(`${TagRec}: AudioCapturer : STATE : ${audioCap.state}`);
await audioCap.stop().then(async function () {
await audioCap.stop().then(() => {
console.info(`${TagRec}: Capturer stopped : SUCCESS`);
resultFlag = true;
console.info(`${TagRec}: resultFlag : ${resultFlag}`);
......@@ -360,7 +360,7 @@ describe('audioVoip', function () {
console.info(`${TagRec}: AudioCapturer : STATE : ${audioCap.state}`);
await audioCap.release().then(async function () {
await audioCap.release().then(() => {
console.info(`${TagRec}: Capturer release : SUCCESS`);
}).catch((err) => {
console.info(`${TagRec}: Capturer release :ERROR : ${err.message}`);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册