未验证 提交 c310e38e 编写于 作者: O openharmony_ci 提交者: Gitee

!10015 AVSession后置方法优化

Merge pull request !10015 from 杜蕊/master
...@@ -640,6 +640,8 @@ export default function AVSession() { ...@@ -640,6 +640,8 @@ export default function AVSession() {
console.info(`TestLog: Set metadata error: code: ${err.code}, message: ${err.message}`); console.info(`TestLog: Set metadata error: code: ${err.code}, message: ${err.message}`);
expect(true).assertTrue(); expect(true).assertTrue();
}); });
sleep(200);
session = await avSession.createAVSession(context,tag,type);
done(); done();
}) })
...@@ -1025,6 +1027,8 @@ export default function AVSession() { ...@@ -1025,6 +1027,8 @@ export default function AVSession() {
console.info(`TestLog: Set playbackState error: code: ${err.code}, message: ${err.message}`); console.info(`TestLog: Set playbackState error: code: ${err.code}, message: ${err.message}`);
expect(true).assertTrue(); expect(true).assertTrue();
}); });
sleep(200);
session = await avSession.createAVSession(context,tag,type);
done(); done();
}) })
......
...@@ -645,9 +645,10 @@ export default function AVSessionCallback() { ...@@ -645,9 +645,10 @@ export default function AVSessionCallback() {
console.info('TestLog: Set metadata : successfully'); console.info('TestLog: Set metadata : successfully');
expect(false).assertTrue(); expect(false).assertTrue();
} }
done();
}) })
await sleep(500); await sleep(500);
session = await avSession.createAVSession(context,tag,type);
done();
}) })
/* * /* *
...@@ -1050,9 +1051,10 @@ export default function AVSessionCallback() { ...@@ -1050,9 +1051,10 @@ export default function AVSessionCallback() {
console.info('TestLog: Set playbackState successfully'); console.info('TestLog: Set playbackState successfully');
expect(false).assertTrue(); expect(false).assertTrue();
} }
done();
}) })
await sleep(500); await sleep(500);
session = await avSession.createAVSession(context,tag,type);
done();
}) })
/* * /* *
...@@ -1237,6 +1239,7 @@ export default function AVSessionCallback() { ...@@ -1237,6 +1239,7 @@ export default function AVSessionCallback() {
console.info('TestLog: Session destroyed failed'); console.info('TestLog: Session destroyed failed');
expect(false).assertTrue(); expect(false).assertTrue();
} }
session = await avSession.createAVSession(context,tag,type);
done(); done();
}) })
}) })
......
...@@ -65,18 +65,22 @@ export default function AVSessionErrorCode() { ...@@ -65,18 +65,22 @@ export default function AVSessionErrorCode() {
afterEach(async function (done) { afterEach(async function (done) {
console.info('TestLog: Destroy Session And Controller'); console.info('TestLog: Destroy Session And Controller');
await session.destroy().then(() => { if(session){
await session.destroy().then(() => {
console.info('TestLog: Session destroy success'); console.info('TestLog: Session destroy success');
}).catch((err) => { }).catch((err) => {
console.info(`TestLog: Session destroy error: code: ${err.code}, message: ${err.message}`); console.info(`TestLog: Session destroy error: code: ${err.code}, message: ${err.message}`);
expect(false).assertTrue(); expect(false).assertTrue();
}); });
}
if(controller){
await controller.destroy().then(() => { await controller.destroy().then(() => {
console.info('TestLog: Controller destroy success'); console.info('TestLog: Controller destroy success');
}).catch((err) => { }).catch((err) => {
console.info(`TestLog: Controller destroy error: code: ${err.code}, message: ${err.message}`); console.info(`TestLog: Controller destroy error: code: ${err.code}, message: ${err.message}`);
expect(false).assertTrue(); expect(false).assertTrue();
}); });
}
done(); done();
}) })
...@@ -127,6 +131,8 @@ export default function AVSessionErrorCode() { ...@@ -127,6 +131,8 @@ export default function AVSessionErrorCode() {
console.info(`TestLog: Controller destroy error: code: ${err.code}, message: ${err.message}`); console.info(`TestLog: Controller destroy error: code: ${err.code}, message: ${err.message}`);
expect(false).assertTrue(); expect(false).assertTrue();
}); });
await sleep(200);
controller = await session.getController();
done(); done();
}) })
......
...@@ -89,6 +89,8 @@ export default function AVSessionManager() { ...@@ -89,6 +89,8 @@ export default function AVSessionManager() {
console.info(`TestLog: avSession create error: code: ${err.code}, message: ${err.message}`); console.info(`TestLog: avSession create error: code: ${err.code}, message: ${err.message}`);
expect(true).assertTrue(); expect(true).assertTrue();
}); });
sleep(200);
currentAVSession = await avSession.createAVSession(context,tag,"audio");
done(); done();
}) })
...@@ -107,7 +109,8 @@ export default function AVSessionManager() { ...@@ -107,7 +109,8 @@ export default function AVSessionManager() {
console.info(`TestLog: avSession create error: code: ${err.code}, message: ${err.message}`); console.info(`TestLog: avSession create error: code: ${err.code}, message: ${err.message}`);
expect(true).assertTrue(); expect(true).assertTrue();
}); });
sleep(200);
currentAVSession = await avSession.createAVSession(context,tag,"audio");
done(); done();
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册