提交 2609fce6 编写于 作者: 1 15754133731

<捕获异常>

Signed-off-by: N15754133731 <chenjiahuan@huawei.com>
上级 e3772558
...@@ -31,25 +31,30 @@ export async function getPermission(permissionNames) { ...@@ -31,25 +31,30 @@ export async function getPermission(permissionNames) {
export async function driveFn(num) { export async function driveFn(num) {
console.info(`case come in driveFn 111`) console.info(`case come in driveFn 111`)
let driver = await UiDriver.create() try {
console.info(`case come in driveFn 222`) let driver = await UiDriver.create()
console.info(`driver is ${JSON.stringify(driver)}`) console.info(`case come in driveFn 222`)
await msleepAsync(2000) console.info(`driver is ${JSON.stringify(driver)}`)
console.info(`UiDriver start`)
for (let i = 0; i < num; i++) {
let button = await driver.findComponent(BY.text('允许'))
console.info(`button is ${JSON.stringify(button)}`)
await msleepAsync(2000) await msleepAsync(2000)
await button.click() console.info(`UiDriver start`)
for (let i = 0; i < num; i++) {
let button = await driver.findComponent(BY.text('允许'))
console.info(`button is ${JSON.stringify(button)}`)
await msleepAsync(2000)
await button.click()
}
}
catch (err) {
console.info('err is ' + err);
return;
} }
await msleepAsync(2000)
} }
export async function getAvRecorderFd(pathName, fileType) { export async function getAvRecorderFd(pathName, fileType) {
console.info('case come in getAvRecorderFd') console.info('case come in getAvRecorderFd')
let fdObject = { let fdObject = {
fileAsset : null, fileAsset: null,
fdNumber : null fdNumber: null
} }
let displayName = pathName; let displayName = pathName;
console.info('[mediaLibrary] displayName is ' + displayName); console.info('[mediaLibrary] displayName is ' + displayName);
...@@ -70,8 +75,8 @@ export async function getAvRecorderFd(pathName, fileType) { ...@@ -70,8 +75,8 @@ export async function getAvRecorderFd(pathName, fileType) {
if (dataUri != undefined) { if (dataUri != undefined) {
let args = dataUri.id.toString(); let args = dataUri.id.toString();
let fetchOp = { let fetchOp = {
selections : fileKeyObj.ID + "=?", selections: fileKeyObj.ID + "=?",
selectionArgs : [args], selectionArgs: [args],
} }
let fetchFileResult = await mediaTest.getFileAssets(fetchOp); let fetchFileResult = await mediaTest.getFileAssets(fetchOp);
fdObject.fileAsset = await fetchFileResult.getAllObject(); fdObject.fileAsset = await fetchFileResult.getAllObject();
...@@ -98,7 +103,7 @@ export async function getStageFileDescriptor(fileName) { ...@@ -98,7 +103,7 @@ export async function getStageFileDescriptor(fileName) {
let fileDescriptor = undefined; let fileDescriptor = undefined;
let mgr = globalThis.abilityContext.resourceManager let mgr = globalThis.abilityContext.resourceManager
await mgr.getRawFileDescriptor(fileName).then(value => { await mgr.getRawFileDescriptor(fileName).then(value => {
fileDescriptor = {fd: value.fd, offset: value.offset, length: value.length}; fileDescriptor = { fd: value.fd, offset: value.offset, length: value.length };
console.log('case getRawFileDescriptor success fileName: ' + fileName); console.log('case getRawFileDescriptor success fileName: ' + fileName);
}).catch(error => { }).catch(error => {
console.log('case getRawFileDescriptor err: ' + error); console.log('case getRawFileDescriptor err: ' + error);
...@@ -179,15 +184,15 @@ export function catchCallback(error) { ...@@ -179,15 +184,15 @@ export function catchCallback(error) {
export function checkDescription(actualDescription, descriptionKey, descriptionValue) { export function checkDescription(actualDescription, descriptionKey, descriptionValue) {
for (let i = 0; i < descriptionKey.length; i++) { for (let i = 0; i < descriptionKey.length; i++) {
let property = actualDescription[descriptionKey[i]]; let property = actualDescription[descriptionKey[i]];
console.info('case key is '+ descriptionKey[i]); console.info('case key is ' + descriptionKey[i]);
console.info('case actual value is '+ property); console.info('case actual value is ' + property);
console.info('case hope value is '+ descriptionValue[i]); console.info('case hope value is ' + descriptionValue[i]);
if (descriptionKey[i] == 'codec_mime') { if (descriptionKey[i] == 'codec_mime') {
expect(property).assertEqual(CODECMIMEVALUE[descriptionValue[i]]); expect(property).assertEqual(CODECMIMEVALUE[descriptionValue[i]]);
} else { } else {
expect(property).assertEqual(descriptionValue[i]); expect(property).assertEqual(descriptionValue[i]);
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册