提交 4a7e13a0 编写于 作者: B bayanxing

avRecorder多场景测试用例 codecheck

Signed-off-by: Nbayanxing <bayanxing@kaihong.com>
上级 c3426c99
...@@ -387,5 +387,23 @@ export async function avRecorderReliabilitTest03(avConfig, avRecorder, recorderT ...@@ -387,5 +387,23 @@ export async function avRecorderReliabilitTest03(avConfig, avRecorder, recorderT
await avRecorder.prepare(avConfig) await avRecorder.prepare(avConfig)
} }
export async function avRecorderReliabilitTest04(avConfig, avRecorder, recorderTime, done) {
avRecorder = await idle(avRecorder);
await avRecorder.prepare(avConfig).then(() => {
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.PREPARED);
console.info('avRecorderReliabilitTest04 prepare success');
}).catch((err) => {
console.info('avRecorderReliabilitTest04 prepare failed and catch error is ' + err.message);
});
await avRecorder.release().then(() => {
console.info('avRecorderReliabilitTest04 release AVRecorder success');
expect(avRecorder.state).assertEqual(AV_RECORDER_STATE.RELEASED);
done();
}).catch((err) => {
console.info('avRecorderReliabilitTest04 release AVRecorder failed and catch error is ' + err.message);
});
}
...@@ -17,7 +17,6 @@ import media from '@ohos.multimedia.media' ...@@ -17,7 +17,6 @@ import media from '@ohos.multimedia.media'
import * as mediaTestBase from '../../../../../MediaTestBase.js'; import * as mediaTestBase from '../../../../../MediaTestBase.js';
import * as avRecorderTestBase from '../../../../../AVRecorderTestBase.js'; import * as avRecorderTestBase from '../../../../../AVRecorderTestBase.js';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import { UiDriver, BY, PointerMatrix } from '@ohos.uitest'
export default function avRecorderTest() { export default function avRecorderTest() {
describe('avRecorderTest', function () { describe('avRecorderTest', function () {
...@@ -154,6 +153,23 @@ export default function avRecorderTest() { ...@@ -154,6 +153,23 @@ export default function avRecorderTest() {
avRecorderTestBase.avRecorderReliabilitTest03(avConfig, avRecorder, RECORDER_TIME, done); avRecorderTestBase.avRecorderReliabilitTest03(avConfig, avRecorder, RECORDER_TIME, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0300 end') console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0300 end')
}) })
/* *
* @tc.number : SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0400
* @tc.name : 001.test resume->prepare
* @tc.desc : Local audio resume->prepare
* @tc.size : MediumTest
* @tc.type : Function test
* @tc.level : Level2
*/
it('SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0400', 0, async function (done) {
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0400 start')
fdObject = await mediaTestBase.getAvRecorderFd(AV_SOURCES[4], "audio");
fdPath = "fd://" + fdObject.fdNumber;
avConfig.url = fdPath;
avRecorderTestBase.avRecorderReliabilitTest03(avConfig, avRecorder, RECORDER_TIME, done);
console.info(TAG + 'SUB_MULTIMEDIA_MEDIA_AVRECORDER_PREPARE_API_0400 end')
})
}) })
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册