提交 0f1092c4 编写于 作者: W wangzx0705

modify case code for api change

Signed-off-by: Nwangzx0705 <wangzx0705@thundersoft.com>
上级 fc3edcd9
...@@ -452,10 +452,8 @@ export default function audioManagerTest() { ...@@ -452,10 +452,8 @@ export default function audioManagerTest() {
*@tc.level : Level 0 *@tc.level : Level 0
*/ */
it('SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ADJUSTSYSTEMVOLUMEBYSTEP_PROMISE_1100', 0, async function (done) { it('SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ADJUSTSYSTEMVOLUMEBYSTEP_PROMISE_1100', 0, async function (done) {
let type;
try { try {
for(let index in audio.AudioVolumeType){ for(let index in audio.AudioVolumeType){
type = index;
console.info(`####AudioVolumeType : ${index}`); console.info(`####AudioVolumeType : ${index}`);
let minVol = await audioVolumeGroupManager.getMinVolume(audio.AudioVolumeType[index]); let minVol = await audioVolumeGroupManager.getMinVolume(audio.AudioVolumeType[index]);
await audioVolumeGroupManager.setVolume(audio.AudioVolumeType[index], minVol); await audioVolumeGroupManager.setVolume(audio.AudioVolumeType[index], minVol);
...@@ -465,10 +463,17 @@ export default function audioManagerTest() { ...@@ -465,10 +463,17 @@ export default function audioManagerTest() {
await audioVolumeGroupManager.adjustSystemVolumeByStep(audio.AudioVolumeType[index], VOLUME_ADJUST_DOWN).then((data) => { await audioVolumeGroupManager.adjustSystemVolumeByStep(audio.AudioVolumeType[index], VOLUME_ADJUST_DOWN).then((data) => {
console.info(`####${index} adjustSystemVolumeByStep :SUCCESS ${data}`); console.info(`####${index} adjustSystemVolumeByStep :SUCCESS ${data}`);
}).catch((error) => { }).catch((error) => {
console.log(`${TagFrmwk}: ####${index} adjustSystemVolumeByStep : error ${error.message} ${error.code}`); if(index == 'ALL' && error.code == 6800104){
expect(false).assertTrue(); console.info(`####${index} adjustSystemVolumeByStep: error ${error.message}, code ${error.code}`);
done(); expect(true).assertTrue();
return; done();
return
}else{
console.log(`${TagFrmwk}: ####${index} adjustSystemVolumeByStep : error ${error.message} ${error.code}`);
expect(false).assertTrue();
done();
return;
}
}); });
await sleep(20); await sleep(20);
let curVol = await audioVolumeGroupManager.getVolume(audio.AudioVolumeType[index]); let curVol = await audioVolumeGroupManager.getVolume(audio.AudioVolumeType[index]);
...@@ -482,15 +487,9 @@ export default function audioManagerTest() { ...@@ -482,15 +487,9 @@ export default function audioManagerTest() {
} }
done(); done();
}catch (error){ }catch (error){
if(type == 'ALL' && error.code == env.UNSUPORTED_OPTION_6800104){ console.info(`SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ADJUSTSYSTEMVOLUMEBYSTEP_PROMISE_1000: error ${error.message}, code ${error.code}`);
console.info(`####${type} adjustSystemVolumeByStep: error ${error.message}, code ${error.code}`); expect(false).assertTrue();
expect(true).assertTrue(); done();
done();
}else{
console.info(`SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ADJUSTSYSTEMVOLUMEBYSTEP_PROMISE_1100: error ${error.message}, code ${error.code}`);
expect(false).assertTrue();
done();
}
} }
}) })
...@@ -931,19 +930,23 @@ export default function audioManagerTest() { ...@@ -931,19 +930,23 @@ export default function audioManagerTest() {
*@tc.level : Level 0 *@tc.level : Level 0
*/ */
it('SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ADJUSTSYSTEMVOLUMEBYSTEP_CALLBACK_1100', 0, async function (done) { it('SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ADJUSTSYSTEMVOLUMEBYSTEP_CALLBACK_1100', 0, async function (done) {
let type;
try { try {
for(let index in audio.AudioVolumeType) { for(let index in audio.AudioVolumeType) {
type = index;
console.info(`####AudioVolumeType: ${index}`); console.info(`####AudioVolumeType: ${index}`);
let minVol = await audioVolumeGroupManager.getMinVolume(audio.AudioVolumeType[index]); let minVol = await audioVolumeGroupManager.getMinVolume(audio.AudioVolumeType[index]);
await audioVolumeGroupManager.setVolume(audio.AudioVolumeType[index], minVol); await audioVolumeGroupManager.setVolume(audio.AudioVolumeType[index], minVol);
console.info(`####${index} setVolume :volome ${minVol}`); console.info(`####${index} setVolume :volome ${minVol}`);
await audioVolumeGroupManager.adjustSystemVolumeByStep(audio.AudioVolumeType[index], VOLUME_ADJUST_DOWN, (err,data) => { await audioVolumeGroupManager.adjustSystemVolumeByStep(audio.AudioVolumeType[index], VOLUME_ADJUST_DOWN, (err,data) => {
if(err){ if(err){
console.log(`${TagFrmwk}: ####${index} adjustSystemVolumeByStep : error ${err.message}, code ${err.code}`); if(index == 'ALL' && err.code == 6800104){
expect(false).assertTrue(); console.info(`####${index} adjustSystemVolumeByStep: error ${err.message}, code ${err.code}`);
done(); expect(true).assertTrue();
done();
}else{
console.log(`${TagFrmwk}: ####${index} adjustSystemVolumeByStep : error ${err.message} ${err.code}`);
expect(false).assertTrue();
done();
}
}else{ }else{
console.info(`####${index} adjustSystemVolumeByStep :SUCCESS ${data}`); console.info(`####${index} adjustSystemVolumeByStep :SUCCESS ${data}`);
} }
...@@ -960,15 +963,9 @@ export default function audioManagerTest() { ...@@ -960,15 +963,9 @@ export default function audioManagerTest() {
} }
done(); done();
}catch (error){ }catch (error){
if(type == 'ALL' && error.code == env.UNSUPORTED_OPTION_6800104){ console.info(`SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ADJUSTSYSTEMVOLUMEBYSTEP_CALLBACK_1100: error ${error.message}, code ${error.code}`);
console.info(`####${type} adjustSystemVolumeByStep: error ${error.message}, code ${error.code}`); expect(false).assertTrue();
expect(true).assertTrue(); done();
done();
}else{
console.info(`SUB_MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_ADJUSTSYSTEMVOLUMEBYSTEP_CALLBACK_1100: error ${error.message}, code ${error.code}`);
expect(false).assertTrue();
done();
}
} }
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册