提交 946f2e48 编写于 作者: L lwx1121892

modiy

Signed-off-by: Nlwx1121892 <liuxueqi3@huawei.com>
上级 e6f113ef
...@@ -357,6 +357,7 @@ describe('audioCapturer', function () { ...@@ -357,6 +357,7 @@ describe('audioCapturer', function () {
steps.shift(); steps.shift();
let markReachParam = steps[0]; let markReachParam = steps[0];
steps.shift(); steps.shift();
try {
audioCap.on('markReach', markReachParam, (position) => { audioCap.on('markReach', markReachParam, (position) => {
console.log(`${Tag} position: ${JSON.stringify(position)}`); console.log(`${Tag} position: ${JSON.stringify(position)}`);
console.log(`${Tag} markReachParam: ${JSON.stringify(markReachParam)}`); console.log(`${Tag} markReachParam: ${JSON.stringify(markReachParam)}`);
...@@ -366,6 +367,16 @@ describe('audioCapturer', function () { ...@@ -366,6 +367,16 @@ describe('audioCapturer', function () {
} }
}); });
toNextStep(audioCap, steps, done); toNextStep(audioCap, steps, done);
}
catch (error) {
if (error.code == 401){
markReachState = 'invalid_failure';
toNextStep(audioCap, steps, done);
}else{
console.info("err" + error.code);
toNextStep(audioCap, steps, done);
}
}
}); });
eventEmitter.on(OFF_MARK_REACH_EVENT, (audioCap, steps, done) => { eventEmitter.on(OFF_MARK_REACH_EVENT, (audioCap, steps, done) => {
...@@ -380,6 +391,7 @@ describe('audioCapturer', function () { ...@@ -380,6 +391,7 @@ describe('audioCapturer', function () {
steps.shift(); steps.shift();
let periodReachParam = steps[0]; let periodReachParam = steps[0];
steps.shift(); steps.shift();
try {
audioCap.on('periodReach', periodReachParam, (position) => { audioCap.on('periodReach', periodReachParam, (position) => {
console.log(`${Tag} position: ${JSON.stringify(position)}`); console.log(`${Tag} position: ${JSON.stringify(position)}`);
console.log(`${Tag} periodReachParam: ${JSON.stringify(periodReachParam)}`); console.log(`${Tag} periodReachParam: ${JSON.stringify(periodReachParam)}`);
...@@ -389,6 +401,17 @@ describe('audioCapturer', function () { ...@@ -389,6 +401,17 @@ describe('audioCapturer', function () {
} }
}); });
toNextStep(audioCap, steps, done); toNextStep(audioCap, steps, done);
}
catch (error) {
if (error.code == 401){
markReachState = 'invalid_failure';
toNextStep(audioCap, steps, done);
}else{
console.info("err" + error.code);
toNextStep(audioCap, steps, done);
}
}
}); });
eventEmitter.on(OFF_PERIODR_REACH_EVENT, (audioCap, steps, done) => { eventEmitter.on(OFF_PERIODR_REACH_EVENT, (audioCap, steps, done) => {
console.log(`${Tag} emit: ${JSON.stringify(OFF_PERIODR_REACH_EVENT)}`); console.log(`${Tag} emit: ${JSON.stringify(OFF_PERIODR_REACH_EVENT)}`);
...@@ -421,7 +444,7 @@ describe('audioCapturer', function () { ...@@ -421,7 +444,7 @@ describe('audioCapturer', function () {
console.info(`${Tag} AudioFrameworkTest: beforeAll: Prerequisites at the test suite level`); console.info(`${Tag} AudioFrameworkTest: beforeAll: Prerequisites at the test suite level`);
let permissionName1 = 'ohos.permission.MICROPHONE'; let permissionName1 = 'ohos.permission.MICROPHONE';
let permissionName2 = 'ohos.permission.MANAGE_AUDIO_CONFIG'; let permissionName2 = 'ohos.permission.MANAGE_AUDIO_CONFIG';
let permissionNameList = [permissionName1,permissionName2]; let permissionNameList = [permissionName1, permissionName2];
let appName = 'ohos.acts.multimedia.audio.audiocapturer'; let appName = 'ohos.acts.multimedia.audio.audiocapturer';
await audioTestBase.applyPermission(appName, permissionNameList); await audioTestBase.applyPermission(appName, permissionNameList);
await sleep(100); await sleep(100);
...@@ -1998,7 +2021,7 @@ describe('audioCapturer', function () { ...@@ -1998,7 +2021,7 @@ describe('audioCapturer', function () {
console.log(`${Tag} start-getAudioTime-getBufferSize-read-getAudioTimein- err: ${JSON.stringify(err)}`); console.log(`${Tag} start-getAudioTime-getBufferSize-read-getAudioTimein- err: ${JSON.stringify(err)}`);
expect(false).assertTrue(); expect(false).assertTrue();
} }
try{ try {
await audioCapPromise.stop(); await audioCapPromise.stop();
let audioTime2 = await audioCapPromise.getAudioTime(); let audioTime2 = await audioCapPromise.getAudioTime();
console.log(`${Tag} audioTime2: ${JSON.stringify(audioTime2)}`); console.log(`${Tag} audioTime2: ${JSON.stringify(audioTime2)}`);
...@@ -2899,7 +2922,7 @@ describe('audioCapturer', function () { ...@@ -2899,7 +2922,7 @@ describe('audioCapturer', function () {
let audioCap = null; let audioCap = null;
let markReachParam = 0; let markReachParam = 0;
markReachState = 'invalid_failure'; markReachState = 'fail';
let mySteps = [CREATE_EVENT, AudioCapturerOptions, MARK_REACH_EVENT, markReachParam, START_EVENT, GET_BUFFERSIZE_EVENT, READ_EVENT, OFF_MARK_REACH_EVENT, RELEASE_EVENT, END_EVENT]; let mySteps = [CREATE_EVENT, AudioCapturerOptions, MARK_REACH_EVENT, markReachParam, START_EVENT, GET_BUFFERSIZE_EVENT, READ_EVENT, OFF_MARK_REACH_EVENT, RELEASE_EVENT, END_EVENT];
eventEmitter.emit(mySteps[0], audioCap, mySteps, done); eventEmitter.emit(mySteps[0], audioCap, mySteps, done);
}) })
...@@ -2963,7 +2986,7 @@ describe('audioCapturer', function () { ...@@ -2963,7 +2986,7 @@ describe('audioCapturer', function () {
let audioCap = null; let audioCap = null;
let markReachParam = -2; let markReachParam = -2;
markReachState = 'invalid_failure'; markReachState = 'fail';
let mySteps = [CREATE_EVENT, AudioCapturerOptions, MARK_REACH_EVENT, markReachParam, START_EVENT, GET_BUFFERSIZE_EVENT, READ_EVENT, OFF_MARK_REACH_EVENT, RELEASE_EVENT, END_EVENT]; let mySteps = [CREATE_EVENT, AudioCapturerOptions, MARK_REACH_EVENT, markReachParam, START_EVENT, GET_BUFFERSIZE_EVENT, READ_EVENT, OFF_MARK_REACH_EVENT, RELEASE_EVENT, END_EVENT];
eventEmitter.emit(mySteps[0], audioCap, mySteps, done); eventEmitter.emit(mySteps[0], audioCap, mySteps, done);
}) })
...@@ -3059,7 +3082,7 @@ describe('audioCapturer', function () { ...@@ -3059,7 +3082,7 @@ describe('audioCapturer', function () {
let audioCap = null; let audioCap = null;
let periodReachParam = -2; let periodReachParam = -2;
periodReachState = 'invalid_failure'; periodReachState = 'fail';
let mySteps = [CREATE_EVENT, AudioCapturerOptions, PERIODR_REACH_EVENT, periodReachParam, START_EVENT, GET_BUFFERSIZE_EVENT, READ_EVENT, OFF_PERIODR_REACH_EVENT, RELEASE_EVENT, END_EVENT]; let mySteps = [CREATE_EVENT, AudioCapturerOptions, PERIODR_REACH_EVENT, periodReachParam, START_EVENT, GET_BUFFERSIZE_EVENT, READ_EVENT, OFF_PERIODR_REACH_EVENT, RELEASE_EVENT, END_EVENT];
eventEmitter.emit(mySteps[0], audioCap, mySteps, done); eventEmitter.emit(mySteps[0], audioCap, mySteps, done);
}) })
......
...@@ -65,7 +65,7 @@ describe('audioInterrupt', function () { ...@@ -65,7 +65,7 @@ describe('audioInterrupt', function () {
beforeAll(function () { beforeAll(function () {
console.info('audioRenderInterrupt: beforeAll: Prerequisites at the test suite level'); console.info('audioRenderInterrupt: beforeAll: Prerequisites at the test suite level');
getcreateAVSession(); // getcreateAVSession();
}) })
beforeEach(async function () { beforeEach(async function () {
...@@ -150,7 +150,8 @@ describe('audioInterrupt', function () { ...@@ -150,7 +150,8 @@ describe('audioInterrupt', function () {
// console.info('activated == false') // console.info('activated == false')
// return; // return;
// } // }
await audioRen.start().then(async function () { console.info('AudioFrameworkRenderLog: AudioRenderer : STATE : ' + audioRen.state);
await audioRen.start().then(() => {
console.info('AudioFrameworkRenderLog: renderInstant started :SUCCESS '); console.info('AudioFrameworkRenderLog: renderInstant started :SUCCESS ');
}).catch((err) => { }).catch((err) => {
console.info('AudioFrameworkRenderLog: renderInstant start :ERROR : ' + err.message); console.info('AudioFrameworkRenderLog: renderInstant start :ERROR : ' + err.message);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册